react-semaphor 0.1.563 → 0.1.565
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/DATA_APP_SDK.md +3 -3
- package/README.md +2 -2
- package/dist/analytics-protocol/index.js +8 -8
- package/dist/assistant-context/index.js +3 -2
- package/dist/brand-studio/index.js +28 -29
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{assistant-chat-iIp02_77.js → assistant-chat-DNfb5fbF.js} +294 -294
- package/dist/chunks/{bookmark-impact-D4Kl4amw.js → bookmark-impact-CHr7b1J2.js} +2 -2
- package/dist/chunks/bookmark-state-ByODVqee.js +1613 -0
- package/dist/chunks/card-filter-builder-CcEcfaYz.js +4100 -0
- package/dist/chunks/{switch-BW4yXSYs.js → code-editor-DJNOsgJH.js} +463 -442
- package/dist/chunks/{comparison-window-caption-D1EUXzaR.js → comparison-window-caption-CMLb3mut.js} +451 -419
- package/dist/chunks/{dashboard-CmqeP3QZ.js → dashboard-CtIfxycc.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-D3mc6peE.js +4910 -0
- package/dist/chunks/{dashboard-controls-B253nJS-.js → dashboard-controls-BFv0zdws.js} +684 -674
- package/dist/chunks/{dashboard-json-osQuinUZ.js → dashboard-json-CXn_3OYb.js} +4 -4
- package/dist/chunks/{dates-DFY7Gfss.js → dates-DcRxw17S.js} +13 -13
- package/dist/chunks/{edit-dashboard-visual-CMar-NhA.js → edit-dashboard-visual-Y6HatqBd.js} +7704 -10337
- package/dist/chunks/filter-reach-copy-DbggA5B7.js +4673 -0
- package/dist/chunks/{filter-value-text-CPwFkrMz.js → filter-value-text-7zhmth1S.js} +2 -2
- package/dist/chunks/{index-CNGkfUp4.js → index-DDa_rklN.js} +69 -64
- package/dist/chunks/index-RNaTnE3m.js +585 -0
- package/dist/chunks/{layout-grid-BM65viQh.js → layout-grid-0hIlqEtk.js} +1 -1
- package/dist/chunks/{list-filter-BoeLBfL3.js → list-filter-DkgoCeBm.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-hEucouWM.js → matrix-analytical-definition-C9xB_T84.js} +18 -18
- package/dist/chunks/{matrix-card-CCh9JjP1.js → matrix-card-BSUeSXpD.js} +2 -2
- package/dist/chunks/{matrix-member-presentation-DsAUbuoL.js → matrix-member-presentation-DZNgQpUq.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-DsLdFdSa.js → matrix-operation-contract-Eb6elidS.js} +1 -1
- package/dist/chunks/{metric-comparison-Bnso1cm1.js → metric-comparison-ChXUFaZu.js} +1 -1
- package/dist/chunks/{palette-p1XSJFgB.js → palette-4vf2BEEg.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-B53jqszr.js → pivot-result-contract-expectations-Ddh1rNz5.js} +4 -4
- package/dist/chunks/{pivot-result-identity-Dq5jm-EC.js → pivot-result-identity-BlbLrqaC.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-l54wJyYE.js → report-preferences-dialog-Db-b04B4.js} +122 -131
- package/dist/chunks/{report-runtime-context-BITkNSDa.js → report-runtime-context-DnA_PiKo.js} +1 -1
- package/dist/chunks/resolve-dashboard-input-context-C18J-YZC.js +21394 -0
- package/dist/chunks/{save-CHV1B1fL.js → save-D6pHmSSP.js} +1 -1
- package/dist/chunks/saved-dashboard-context-DhC_EVus.js +629 -0
- package/dist/chunks/{selection-reducer-Bz5aywT4.js → selection-reducer-OaJ-N5uN.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-C3EQEiD9.js → semaphor-ready-indicator-T6TsiBMT.js} +80879 -80744
- package/dist/chunks/{shelf-drop-preview-context-BODiBlqT.js → shelf-drop-preview-context-CNWL_b0S.js} +407 -407
- package/dist/chunks/{source-entity-resolution-DdDVXFB8.js → source-entity-resolution-DF6GulDn.js} +1 -1
- package/dist/chunks/stored-dashboard-IdmtrNkA.js +5026 -0
- package/dist/chunks/{table-export-sheet-bSXxGn-v.js → table-export-sheet--DUKWk6o.js} +1 -1
- package/dist/chunks/{temporal-input-presentation-sk9gqLi6.js → temporal-input-presentation--2r9BLr0.js} +392 -377
- package/dist/chunks/{token-types-BUK06hU2.js → token-types-C8JymO8s.js} +1 -1
- package/dist/chunks/{upload-BnmuyPqW.js → upload-Cf3wXZT8.js} +1 -1
- package/dist/chunks/{validators-BIM0FE31.js → validators-wtjw0aw6.js} +7 -7
- package/dist/chunks/variable-draft-3xseULxR.js +241 -0
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2226 -1704
- package/dist/data-app-sdk/index.js +4 -4
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.js +5 -5
- package/dist/format-utils/index.js +174 -167
- package/dist/index.js +190 -188
- package/dist/layouts/index.js +1 -1
- package/dist/pdf-export-policy/index.js +80 -28
- package/dist/pdf-table-layout/index.js +65 -65
- package/dist/report-runtime-context/index.js +1 -1
- 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/components/activity/activity-bell.d.ts +5 -1
- package/dist/types/components/activity/activity-types.d.ts +12 -4
- package/dist/types/components/dashboard-variables/data-variables-menu.d.ts +8 -0
- package/dist/types/components/dashboard-variables/variable-editor-host.d.ts +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/build-normalized-dashboard-inputs.d.ts +62 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +33 -2
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +4 -2
- package/dist/types/lib/dashboard-variables/data-text.d.ts +33 -0
- package/dist/types/lib/dashboard-variables/types.d.ts +207 -0
- package/dist/types/lib/document/document-edits.d.ts +16 -1
- package/dist/types/lib/document/document-panel-target.d.ts +1 -1
- package/dist/types/lib/document/document-section-query-options.d.ts +29 -0
- package/dist/types/lib/document/document-table-data-policy.d.ts +0 -1
- package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +92 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +6 -0
- package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +1 -0
- package/dist/types/lib/query-context/use-semantic-execution-payload-for-cards.d.ts +24 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +36 -0
- package/dist/types/lib/text-variables/temporal-input-text.d.ts +28 -0
- package/dist/types/lib/text-variables/text-variable-types.d.ts +72 -0
- package/dist/types/lib/types/common-types.d.ts +155 -51
- package/dist/types/lib/utils/card-definition.d.ts +2 -2
- package/dist/types/shared/assistant-context/index.d.ts +1 -1
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +51 -1
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +7 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +7 -1
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +1088 -431
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -1
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +40 -40
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/dashboard-filter-targets.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +7 -4
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +159 -0
- package/dist/types/shared/dashboard-authoring/dashboard-variable-changes.d.ts +61 -0
- package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +50 -3
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +48 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/text-card-words/blocks.d.ts +87 -13
- package/dist/types/shared/dashboard-authoring/text-card-words/chip-colors.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/text-card-words/index.d.ts +90 -8
- package/dist/types/shared/dashboard-authoring/text-card-words/rich-content.d.ts +31 -3
- package/dist/types/shared/dashboard-authoring/text-card-words/variable-words.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/variable-editability.d.ts +24 -0
- package/dist/types/shared/dashboard-authoring/variable-references.d.ts +39 -0
- package/dist/types/shared/format-utils/document-print.d.ts +4 -2
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/pdf-capacity-lines.d.ts +17 -0
- package/dist/types/shared/format-utils/pdf-delivery.d.ts +8 -1
- package/dist/types/shared/format-utils/pdf-export-policy.d.ts +74 -6
- package/dist/types/shared/format-utils/presentation-execution.d.ts +9 -0
- package/package.json +2 -2
- package/src/data-app-sdk/README.md +3 -3
- package/dist/chunks/bookmark-state-CWeoGbrx.js +0 -743
- package/dist/chunks/braces-DzgoQC64.js +0 -23
- package/dist/chunks/dashboard-briefing-launcher-TYlSW77S.js +0 -3828
- package/dist/chunks/filter-reach-copy-CvV7W5dd.js +0 -3965
- package/dist/chunks/global-date-filter-utils-N1kcsOFE.js +0 -16722
- package/dist/chunks/index-CJW5BdWT.js +0 -583
- package/dist/chunks/resolve-dashboard-input-context-DaDrZGuA.js +0 -8214
- package/dist/chunks/saved-dashboard-context-DFYBrE6O.js +0 -564
- package/dist/chunks/use-create-flow-overlay-state-BXY8-Cyz.js +0 -1436
package/dist/chunks/{comparison-window-caption-D1EUXzaR.js → comparison-window-caption-CMLb3mut.js}
RENAMED
|
@@ -1,37 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import { h as H, e as ct, p as lt, k as ut } from "./export-file-format-C-tJsxsf.js";
|
|
6
|
-
import { aV as U, H as mt, t as z, aU as dt, v as ne, u as ft } from "./validators-BIM0FE31.js";
|
|
7
|
-
import "./matrix-operation-contract-DsLdFdSa.js";
|
|
1
|
+
import { au as qe, i as We, j, m as Ye, K as De, av as se, aw as Me, ax as Ze, ay as Ae, az as ke, ai as Je, an as Qe, aj as et, f as tt, a as B, $ as pe, ab as rt, Z as nt, ac as ot, ad as at, o as he, s as st, R as be, T as it, V as ct, a0 as lt, aA as A, aB as U } from "./temporal-input-presentation--2r9BLr0.js";
|
|
2
|
+
import { h as W, e as ut, p as mt, k as dt } from "./export-file-format-C-tJsxsf.js";
|
|
3
|
+
import { aV as K, H as ft, t as G, aU as pt, v as ie, u as ht } from "./validators-wtjw0aw6.js";
|
|
4
|
+
import "./matrix-operation-contract-Eb6elidS.js";
|
|
8
5
|
import "./analytics-base-schemas-BaIQrEzX.js";
|
|
9
6
|
import "zod";
|
|
10
|
-
import { PDF_SAFETY_LIMIT_EXCEEDED as
|
|
11
|
-
import { p as
|
|
12
|
-
import { c as
|
|
13
|
-
import { v as
|
|
7
|
+
import { readPdfCapacityFacts as bt, PDF_SAFETY_LIMIT_EXCEEDED as ce, PDF_CAPACITY as M, PDF_NUMBER_COLUMN_TOO_WIDE as Re, getUtf8ByteLength as yt, FAST_PDF_POLICY as gt, isPdfCapacityRefusalCode as wt } from "../pdf-export-policy/index.js";
|
|
8
|
+
import { p as Ct } from "./pivot-result-contract-expectations-Ddh1rNz5.js";
|
|
9
|
+
import { c as vt, b as ye } from "./pivot-result-identity-BlbLrqaC.js";
|
|
10
|
+
import { v as _t, g as xt, c as Tt } from "./raw-temporal-value-Bqz8wc7L.js";
|
|
14
11
|
import "../value-format-preferences/index.js";
|
|
15
|
-
function
|
|
12
|
+
function Et(e, t, r) {
|
|
16
13
|
const n = {
|
|
17
14
|
...t,
|
|
18
15
|
locale: t.locale ?? r
|
|
19
16
|
};
|
|
20
17
|
if (n.type === "number")
|
|
21
|
-
return
|
|
18
|
+
return j(e, n);
|
|
22
19
|
const { prefix: o, suffix: c, ...s } = n;
|
|
23
|
-
return `${o ?? ""}${
|
|
20
|
+
return `${o ?? ""}${j(e, {
|
|
24
21
|
...s,
|
|
25
22
|
negativeStyle: n.type === "currency" ? n.negativeStyle : "minus"
|
|
26
23
|
})}${c ?? ""}`;
|
|
27
24
|
}
|
|
28
|
-
function
|
|
29
|
-
return e === null ? { value: e, text: null } : !t || !
|
|
25
|
+
function Q(e, t, r) {
|
|
26
|
+
return e === null ? { value: e, text: null } : !t || !We(t) && t.type !== "duration" ? {
|
|
30
27
|
value: e,
|
|
31
|
-
text:
|
|
28
|
+
text: j(e, { type: "number", locale: r })
|
|
32
29
|
} : t.type === "duration" ? {
|
|
33
30
|
value: e,
|
|
34
|
-
text:
|
|
31
|
+
text: Ye(e, {
|
|
35
32
|
inputUnit: t.inputUnit,
|
|
36
33
|
outputStyle: t.outputStyle,
|
|
37
34
|
largestUnit: t.largestUnit,
|
|
@@ -41,12 +38,12 @@ function W(e, t, r) {
|
|
|
41
38
|
suffix: t.suffix,
|
|
42
39
|
negativeInParentheses: t.negativeStyle === "parentheses"
|
|
43
40
|
})
|
|
44
|
-
} : { value: e, text:
|
|
41
|
+
} : { value: e, text: Et(e, t, r) };
|
|
45
42
|
}
|
|
46
|
-
function
|
|
43
|
+
function ge(e, t, r, n) {
|
|
47
44
|
return e === null ? { value: e, text: null } : n === "percent" ? {
|
|
48
45
|
value: e,
|
|
49
|
-
text:
|
|
46
|
+
text: j(e, {
|
|
50
47
|
type: "percent",
|
|
51
48
|
locale: r,
|
|
52
49
|
minimumFractionDigits: t,
|
|
@@ -55,7 +52,7 @@ function pe(e, t, r, n) {
|
|
|
55
52
|
})
|
|
56
53
|
} : {
|
|
57
54
|
value: e,
|
|
58
|
-
text:
|
|
55
|
+
text: j(e, {
|
|
59
56
|
type: "number",
|
|
60
57
|
locale: r,
|
|
61
58
|
minimumFractionDigits: t,
|
|
@@ -64,55 +61,55 @@ function pe(e, t, r, n) {
|
|
|
64
61
|
})
|
|
65
62
|
};
|
|
66
63
|
}
|
|
67
|
-
function
|
|
64
|
+
function we(e, t) {
|
|
68
65
|
if (e === void 0) return t;
|
|
69
66
|
if (!Number.isInteger(e) || e < 0 || e > 6)
|
|
70
67
|
throw new RangeError("Comparison precision must be an integer from 0 to 6.");
|
|
71
68
|
return e;
|
|
72
69
|
}
|
|
73
|
-
function
|
|
70
|
+
function Or(e, t) {
|
|
74
71
|
const r = {
|
|
75
72
|
mode: t.displayMode,
|
|
76
|
-
current:
|
|
73
|
+
current: Q(
|
|
77
74
|
e.currentValue,
|
|
78
75
|
t.metricFormat,
|
|
79
76
|
t.locale
|
|
80
77
|
),
|
|
81
|
-
comparison:
|
|
78
|
+
comparison: Q(
|
|
82
79
|
e.comparisonValue,
|
|
83
80
|
t.metricFormat,
|
|
84
81
|
t.locale
|
|
85
82
|
)
|
|
86
83
|
};
|
|
87
|
-
return (t.displayMode === "difference" || t.displayMode === "both") && (r.difference =
|
|
84
|
+
return (t.displayMode === "difference" || t.displayMode === "both") && (r.difference = Q(
|
|
88
85
|
e.delta,
|
|
89
|
-
|
|
86
|
+
qe(t.metricFormat),
|
|
90
87
|
t.locale
|
|
91
|
-
)), (t.displayMode === "percent_change" || t.displayMode === "both") && (r.percentChange =
|
|
88
|
+
)), (t.displayMode === "percent_change" || t.displayMode === "both") && (r.percentChange = ge(
|
|
92
89
|
e.percentChange,
|
|
93
|
-
|
|
90
|
+
we(t.precision, 1),
|
|
94
91
|
t.locale,
|
|
95
92
|
"percent"
|
|
96
|
-
)), t.displayMode === "ratio" && (r.ratio =
|
|
93
|
+
)), t.displayMode === "ratio" && (r.ratio = ge(
|
|
97
94
|
e.ratio,
|
|
98
|
-
|
|
95
|
+
we(t.precision, 2),
|
|
99
96
|
t.locale,
|
|
100
97
|
"ratio"
|
|
101
98
|
)), r;
|
|
102
99
|
}
|
|
103
|
-
const
|
|
104
|
-
function
|
|
100
|
+
const $t = /* @__PURE__ */ new Set(["second", "minute", "hour", "day", "month"]);
|
|
101
|
+
function Ft(e) {
|
|
105
102
|
const { presentation: t } = e;
|
|
106
|
-
return e.formattedValues ? (t == null ? void 0 : t.kind) === "text" || (t == null ? void 0 : t.kind) === "measure" && t.format.type === "duration" ? "text" : (t == null ? void 0 : t.kind) === "temporal_bucket" ?
|
|
103
|
+
return e.formattedValues ? (t == null ? void 0 : t.kind) === "text" || (t == null ? void 0 : t.kind) === "measure" && t.format.type === "duration" ? "text" : (t == null ? void 0 : t.kind) === "temporal_bucket" ? $t.has(t.grain) ? "date" : "text" : (t == null ? void 0 : t.kind) === "datetime" ? "date" : e.dataType === "number" ? "number" : e.dataType === "boolean" ? "boolean" : e.dataType === "unknown" ? "by_value" : "text" : "by_value";
|
|
107
104
|
}
|
|
108
|
-
function
|
|
105
|
+
function St(e) {
|
|
109
106
|
const t = (o, c) => Number.isInteger(o) ? Math.min(20, Math.max(0, o)) : c, r = t(e.minimumFractionDigits, 0), n = Math.max(r, t(e.maximumFractionDigits, 2));
|
|
110
107
|
return n === 0 ? "" : `.${"0".repeat(n)}`;
|
|
111
108
|
}
|
|
112
|
-
function
|
|
109
|
+
function ee(e) {
|
|
113
110
|
return `"${e.replace(/"/g, "")}"`;
|
|
114
111
|
}
|
|
115
|
-
function
|
|
112
|
+
function Lt(e) {
|
|
116
113
|
let t;
|
|
117
114
|
try {
|
|
118
115
|
t = new Intl.NumberFormat(e.locale ?? "en-US", {
|
|
@@ -130,25 +127,25 @@ function Et(e) {
|
|
|
130
127
|
text: o(n + 1, r) + t[r].value
|
|
131
128
|
};
|
|
132
129
|
}
|
|
133
|
-
function
|
|
134
|
-
const t =
|
|
130
|
+
function Pt(e) {
|
|
131
|
+
const t = St(e);
|
|
135
132
|
let r;
|
|
136
133
|
if (e.type === "scientific")
|
|
137
134
|
r = `0${t}E+00`;
|
|
138
135
|
else {
|
|
139
136
|
const n = `${e.useGrouping === !1 ? "0" : "#,##0"}${t}`;
|
|
140
137
|
if (e.type === "currency") {
|
|
141
|
-
const o =
|
|
142
|
-
r = o ? o.side === "before" ? `${
|
|
143
|
-
} else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${n}${
|
|
138
|
+
const o = Lt(e);
|
|
139
|
+
r = o ? o.side === "before" ? `${ee(o.text)}${n}` : `${n}${ee(o.text)}` : n;
|
|
140
|
+
} else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${n}${ee("%")}` : `${n}%` : r = n;
|
|
144
141
|
}
|
|
145
142
|
return e.negativeStyle === "parentheses" ? `${r};(${r})` : r;
|
|
146
143
|
}
|
|
147
|
-
function
|
|
144
|
+
function It(e, t) {
|
|
148
145
|
if (!e.formattedValues) return;
|
|
149
146
|
const { presentation: r } = e;
|
|
150
147
|
if (t === "number" || t === "by_value")
|
|
151
|
-
return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 :
|
|
148
|
+
return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 : Pt(r.format);
|
|
152
149
|
if (t === "date") {
|
|
153
150
|
if ((r == null ? void 0 : r.kind) === "temporal_bucket")
|
|
154
151
|
return r.grain === "day" ? "yyyy-mm-dd" : r.grain === "month" ? "mmm yyyy" : "yyyy-mm-dd hh:mm";
|
|
@@ -156,8 +153,8 @@ function $t(e, t) {
|
|
|
156
153
|
return r.dateOnly ? "yyyy-mm-dd" : "yyyy-mm-dd hh:mm:ss";
|
|
157
154
|
}
|
|
158
155
|
}
|
|
159
|
-
function
|
|
160
|
-
const t =
|
|
156
|
+
function Ce(e) {
|
|
157
|
+
const t = Ft(e), r = It(e, t);
|
|
161
158
|
return Object.freeze({
|
|
162
159
|
key: e.key,
|
|
163
160
|
label: e.label,
|
|
@@ -165,18 +162,18 @@ function he(e) {
|
|
|
165
162
|
...r === void 0 ? {} : { numberFormat: r }
|
|
166
163
|
});
|
|
167
164
|
}
|
|
168
|
-
const
|
|
169
|
-
function
|
|
170
|
-
return
|
|
165
|
+
const Dt = 15, Mt = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
|
|
166
|
+
function Ne(e) {
|
|
167
|
+
return Mt.test(e) ? e : void 0;
|
|
171
168
|
}
|
|
172
|
-
function
|
|
169
|
+
function ve(e) {
|
|
173
170
|
const r = e.replace(/^-/, "").replace(/[eE].*$/, "").replace(".", "").replace(/^0+/, "").replace(/0+$/, "");
|
|
174
|
-
if (r.length >
|
|
171
|
+
if (r.length > Dt) return !1;
|
|
175
172
|
const n = Number(e);
|
|
176
173
|
return Number.isFinite(n) && (n !== 0 || r.length === 0);
|
|
177
174
|
}
|
|
178
|
-
const
|
|
179
|
-
function
|
|
175
|
+
const At = Date.UTC(1900, 2, 1), kt = Date.UTC(1e4, 0, 1), Rt = Date.UTC(1899, 11, 30), Nt = 864e5;
|
|
176
|
+
function Ot(e) {
|
|
180
177
|
const t = Date.UTC(
|
|
181
178
|
e.year,
|
|
182
179
|
e.month - 1,
|
|
@@ -185,20 +182,20 @@ function Pt(e) {
|
|
|
185
182
|
e.minute,
|
|
186
183
|
e.second
|
|
187
184
|
);
|
|
188
|
-
if (!(e.year < 1900 || !Number.isFinite(t)) && !(t <
|
|
189
|
-
return (t -
|
|
185
|
+
if (!(e.year < 1900 || !Number.isFinite(t)) && !(t < At || t >= kt))
|
|
186
|
+
return (t - Rt) / Nt;
|
|
190
187
|
}
|
|
191
|
-
function
|
|
188
|
+
function _e(e, t, r) {
|
|
192
189
|
if (typeof e == "number")
|
|
193
190
|
return Number.isFinite(e) ? { kind: "number", text: t, value: e } : void 0;
|
|
194
|
-
if (
|
|
195
|
-
return
|
|
191
|
+
if (K(e))
|
|
192
|
+
return ve(e.value) ? { kind: "number", text: t, value: e } : void 0;
|
|
196
193
|
if (r && typeof e == "string") {
|
|
197
|
-
const n =
|
|
198
|
-
return n !== void 0 &&
|
|
194
|
+
const n = Ne(e);
|
|
195
|
+
return n !== void 0 && ve(n) ? { kind: "number", text: t, value: n } : void 0;
|
|
199
196
|
}
|
|
200
197
|
}
|
|
201
|
-
function
|
|
198
|
+
function X(e) {
|
|
202
199
|
const { value: t, text: r, column: n } = e;
|
|
203
200
|
if (r === "") return { kind: "empty" };
|
|
204
201
|
const o = { kind: "text", text: r };
|
|
@@ -206,32 +203,32 @@ function j(e) {
|
|
|
206
203
|
case "text":
|
|
207
204
|
return o;
|
|
208
205
|
case "date": {
|
|
209
|
-
const c = e.wallClock ?
|
|
206
|
+
const c = e.wallClock ? Ot(e.wallClock) : void 0;
|
|
210
207
|
return c === void 0 ? o : { kind: "date", text: r, serial: c };
|
|
211
208
|
}
|
|
212
209
|
case "number":
|
|
213
|
-
return
|
|
210
|
+
return _e(t, r, !0) ?? o;
|
|
214
211
|
case "boolean":
|
|
215
212
|
return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : o;
|
|
216
213
|
case "by_value":
|
|
217
|
-
return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } :
|
|
214
|
+
return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : _e(t, r, !1) ?? o;
|
|
218
215
|
}
|
|
219
216
|
}
|
|
220
|
-
function
|
|
217
|
+
function Ur(e) {
|
|
221
218
|
return e.kind === "empty" ? "" : e.text;
|
|
222
219
|
}
|
|
223
|
-
const
|
|
224
|
-
function
|
|
225
|
-
return e >
|
|
220
|
+
const Oe = 1e4, Ut = 1e6, jr = 5e6, Kr = 1024 ** 3, Vr = 1024 ** 3;
|
|
221
|
+
function Br(e) {
|
|
222
|
+
return e > Oe;
|
|
226
223
|
}
|
|
227
|
-
function
|
|
228
|
-
return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <=
|
|
224
|
+
function Xr(e) {
|
|
225
|
+
return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= Oe ? "direct" : e.loadedRowCount <= Ut ? "background" : "blocked";
|
|
229
226
|
}
|
|
230
|
-
const
|
|
227
|
+
const zr = {
|
|
231
228
|
rowLabels: "tabular",
|
|
232
229
|
subtotals: "after"
|
|
233
230
|
};
|
|
234
|
-
function
|
|
231
|
+
function Hr(e, t) {
|
|
235
232
|
const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, n = e.totals.rows;
|
|
236
233
|
return {
|
|
237
234
|
...e,
|
|
@@ -250,13 +247,13 @@ function jr(e, t) {
|
|
|
250
247
|
}
|
|
251
248
|
};
|
|
252
249
|
}
|
|
253
|
-
const
|
|
254
|
-
function
|
|
255
|
-
return typeof e == "number" ? Number.isInteger(e) :
|
|
250
|
+
const jt = 2;
|
|
251
|
+
function Kt(e) {
|
|
252
|
+
return typeof e == "number" ? Number.isInteger(e) : K(e) ? !e.value.includes(".") : !0;
|
|
256
253
|
}
|
|
257
|
-
function
|
|
254
|
+
function Vt(e, t, r) {
|
|
258
255
|
const n = e.descriptors.measures.filter(
|
|
259
|
-
(s) => r.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 &&
|
|
256
|
+
(s) => r.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 && ft(s.column.dataType) === "number"
|
|
260
257
|
);
|
|
261
258
|
if (n.length === 0) return r;
|
|
262
259
|
const o = /* @__PURE__ */ new Set();
|
|
@@ -264,7 +261,7 @@ function Ot(e, t, r) {
|
|
|
264
261
|
if (!(s.kind !== "measure" || o.has(s.measureId)))
|
|
265
262
|
for (const f of t) {
|
|
266
263
|
const d = f.values[l];
|
|
267
|
-
if ((d == null ? void 0 : d.kind) === "value" && !
|
|
264
|
+
if ((d == null ? void 0 : d.kind) === "value" && !Kt(d.value)) {
|
|
268
265
|
o.add(s.measureId);
|
|
269
266
|
return;
|
|
270
267
|
}
|
|
@@ -272,7 +269,7 @@ function Ot(e, t, r) {
|
|
|
272
269
|
});
|
|
273
270
|
const c = { ...r.measureFormats };
|
|
274
271
|
for (const { id: s } of n) {
|
|
275
|
-
const l = o.has(s) ?
|
|
272
|
+
const l = o.has(s) ? jt : 0;
|
|
276
273
|
c[s] = {
|
|
277
274
|
type: "number",
|
|
278
275
|
minimumFractionDigits: l,
|
|
@@ -282,38 +279,38 @@ function Ot(e, t, r) {
|
|
|
282
279
|
}
|
|
283
280
|
return { ...r, measureFormats: c };
|
|
284
281
|
}
|
|
285
|
-
function
|
|
286
|
-
return
|
|
282
|
+
function z(e) {
|
|
283
|
+
return G(e.slice(0, -1));
|
|
287
284
|
}
|
|
288
|
-
function
|
|
289
|
-
return t.length > e.length &&
|
|
285
|
+
function Bt(e, t) {
|
|
286
|
+
return t.length > e.length && G(t.slice(0, e.length)) === G(e);
|
|
290
287
|
}
|
|
291
|
-
function
|
|
288
|
+
function Xt(e) {
|
|
292
289
|
return e.map((t, r) => {
|
|
293
290
|
if (r === 0 || t.kind !== "layout") return !1;
|
|
294
291
|
const n = e[r - 1];
|
|
295
292
|
if (n.kind !== "layout") return !1;
|
|
296
|
-
if (t.role !== "member" ||
|
|
293
|
+
if (t.role !== "member" || Bt(n.rowPath, t.rowPath)) return !0;
|
|
297
294
|
const o = e[r - 2];
|
|
298
|
-
return n.role === "member" && (!o || o.kind !== "layout" || o.role !== "member" ||
|
|
295
|
+
return n.role === "member" && (!o || o.kind !== "layout" || o.role !== "member" || z(o.rowPath) !== z(n.rowPath)) && t.rowPath.length === n.rowPath.length && z(t.rowPath) === z(n.rowPath);
|
|
299
296
|
});
|
|
300
297
|
}
|
|
301
|
-
const
|
|
302
|
-
function
|
|
303
|
-
return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" ||
|
|
298
|
+
const zt = "pdf-group-continuation";
|
|
299
|
+
function Ue(e, t, r) {
|
|
300
|
+
return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || K(t.value)) ? e : W(e);
|
|
304
301
|
}
|
|
305
|
-
function
|
|
306
|
-
const n =
|
|
302
|
+
function Ht(e, t, r) {
|
|
303
|
+
const n = De(e.descriptors, t.presentation, r), o = e.columns.map((u) => {
|
|
307
304
|
var a;
|
|
308
305
|
return u.kind === "measure" && ((a = n.measureSemantics.get(u.measureId)) == null ? void 0 : a.isNumeric) === !0;
|
|
309
|
-
}), c = (u) =>
|
|
306
|
+
}), c = (u) => se([u], n.levels), s = (u, a, m) => Me(u, a, t.presentation.totals[m], n.levels), l = e.columns.map((u) => {
|
|
310
307
|
if (u.kind !== "measure") return u.label;
|
|
311
308
|
const a = u.columnPath.map(c);
|
|
312
309
|
return u.role !== "member" && a.push(s(u.columnPath, u.role, "columns")), [...a, u.label].join(" / ");
|
|
313
310
|
}), f = Math.min(t.spec.columns.length, Math.max(
|
|
314
311
|
0,
|
|
315
312
|
...e.columns.map((u) => u.kind === "measure" ? u.columnPath.length + (u.role !== "member" ? 1 : 0) : 0)
|
|
316
|
-
)), d = Array.from({ length: f + 1 }, (u, a) => e.columns.map((m) => a === f ? m.label : m.kind !== "measure" ? "" : a < m.columnPath.length ? c(m.columnPath[a]) : a === m.columnPath.length && m.role !== "member" ? s(m.columnPath, m.role, "columns") : "")), y = (u, a) =>
|
|
313
|
+
)), d = Array.from({ length: f + 1 }, (u, a) => e.columns.map((m) => a === f ? m.label : m.kind !== "measure" ? "" : a < m.columnPath.length ? c(m.columnPath[a]) : a === m.columnPath.length && m.role !== "member" ? s(m.columnPath, m.role, "columns") : "")), y = (u, a) => Ze({
|
|
317
314
|
path: u.rowPath,
|
|
318
315
|
role: u.kind === "layout" ? u.role : "member",
|
|
319
316
|
levelCount: Math.max(1, t.spec.rows.length),
|
|
@@ -323,21 +320,21 @@ function jt(e, t, r) {
|
|
|
323
320
|
if (u.kind !== "layout") throw new Error("Layout presentation requires layout rows.");
|
|
324
321
|
if (u.values.length !== e.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
325
322
|
const m = y(u, a);
|
|
326
|
-
return e.columns.map((
|
|
327
|
-
if (
|
|
323
|
+
return e.columns.map((b, p) => {
|
|
324
|
+
if (b.kind === "hierarchy")
|
|
328
325
|
return `${" ".repeat(Math.max(0, u.rowPath.length - 1))}${s(u.rowPath, u.role, "rows")}`;
|
|
329
|
-
if (
|
|
330
|
-
const
|
|
331
|
-
return
|
|
326
|
+
if (b.kind === "level") {
|
|
327
|
+
const C = t.spec.rows.findIndex((S) => S.id === b.levelId), v = m[C];
|
|
328
|
+
return v != null && v.visible ? v.total ? s(u.rowPath, u.role, "rows") : se(v.path, n.levels) : "";
|
|
332
329
|
}
|
|
333
|
-
const
|
|
334
|
-
if (
|
|
330
|
+
const x = u.values[p], g = n.measures.get(b.measureId);
|
|
331
|
+
if (x.kind === "value" && !g)
|
|
335
332
|
throw new Error("Matrix value is missing its measure descriptor.");
|
|
336
|
-
return
|
|
333
|
+
return Ae(x, g, t.presentation.absence);
|
|
337
334
|
});
|
|
338
|
-
},
|
|
339
|
-
const p = e.columns[
|
|
340
|
-
return p.kind === "measure" ?
|
|
335
|
+
}, _ = (u, a) => w(u, a).map((m, b) => {
|
|
336
|
+
const p = e.columns[b];
|
|
337
|
+
return p.kind === "measure" ? Ue(m, u.values[b], n.measureSemantics.get(p.measureId)) : W(m);
|
|
341
338
|
});
|
|
342
339
|
return {
|
|
343
340
|
headers: l,
|
|
@@ -356,15 +353,15 @@ function jt(e, t, r) {
|
|
|
356
353
|
continuedColumns: (u, a) => {
|
|
357
354
|
const m = (p) => (p == null ? void 0 : p.kind) === "layout" && p.role === "member";
|
|
358
355
|
if (!m(u) || !m(a)) return [];
|
|
359
|
-
const
|
|
360
|
-
return e.columns.flatMap((p,
|
|
361
|
-
var
|
|
356
|
+
const b = y(u, a);
|
|
357
|
+
return e.columns.flatMap((p, x) => {
|
|
358
|
+
var C;
|
|
362
359
|
if (p.kind !== "level") return [];
|
|
363
|
-
const g = t.spec.rows.findIndex((
|
|
364
|
-
return g < u.rowPath.length && ((
|
|
360
|
+
const g = t.spec.rows.findIndex((v) => v.id === p.levelId);
|
|
361
|
+
return g < u.rowPath.length && ((C = b[g]) == null ? void 0 : C.visible) === !1 ? [x] : [];
|
|
365
362
|
});
|
|
366
363
|
},
|
|
367
|
-
csvRow: (u) =>
|
|
364
|
+
csvRow: (u) => _(u),
|
|
368
365
|
/**
|
|
369
366
|
* `previousRow` is the row before `data[0]`, carried by the export's
|
|
370
367
|
* continuation, so a tabular layout prints each label once across the
|
|
@@ -372,19 +369,19 @@ function jt(e, t, r) {
|
|
|
372
369
|
* formatter state or an earlier worker. Without it, the first row prints
|
|
373
370
|
* its labels.
|
|
374
371
|
*/
|
|
375
|
-
csvRows: (u, a) => u.map((m,
|
|
372
|
+
csvRows: (u, a) => u.map((m, b) => _(m, b ? u[b - 1] : a ?? void 0))
|
|
376
373
|
};
|
|
377
374
|
}
|
|
378
|
-
function
|
|
379
|
-
return e.columns.map((t) =>
|
|
375
|
+
function Gr(e) {
|
|
376
|
+
return e.columns.map((t) => W(t.label));
|
|
380
377
|
}
|
|
381
|
-
function
|
|
382
|
-
return
|
|
378
|
+
function qr(e, t, r) {
|
|
379
|
+
return Gt(e, t, r).map((n, o) => {
|
|
383
380
|
const c = t.columns[o];
|
|
384
|
-
return c.kind === "measure" ?
|
|
381
|
+
return c.kind === "measure" ? Ue(n, e.values[o], r.measureSemantics.get(c.measureId)) : W(n);
|
|
385
382
|
});
|
|
386
383
|
}
|
|
387
|
-
function
|
|
384
|
+
function Gt(e, t, r) {
|
|
388
385
|
if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
|
|
389
386
|
if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
390
387
|
const n = [...e.rowPath, ...e.columnPath];
|
|
@@ -392,15 +389,15 @@ function Bt(e, t, r) {
|
|
|
392
389
|
if (o.kind === "measure") {
|
|
393
390
|
const l = e.values[c], f = r.measures.get(o.measureId);
|
|
394
391
|
if (l.kind === "value" && !f) throw new Error("Matrix value is missing its measure descriptor.");
|
|
395
|
-
return
|
|
392
|
+
return Ae(l, f, r.absence);
|
|
396
393
|
}
|
|
397
394
|
const s = o.kind === "level" ? n.find((l) => l.levelId === o.levelId) : void 0;
|
|
398
395
|
if (!s) throw new Error("Flat Matrix row does not match its frozen layout.");
|
|
399
|
-
return
|
|
396
|
+
return se([s], r.levels);
|
|
400
397
|
});
|
|
401
398
|
}
|
|
402
|
-
function
|
|
403
|
-
const t =
|
|
399
|
+
function qt(e) {
|
|
400
|
+
const t = Ht(e.layout, e.request, e.report), r = e.layout.columns.map((s, l) => ({
|
|
404
401
|
index: l,
|
|
405
402
|
columnId: `matrix:${l}`,
|
|
406
403
|
label: t.headers[l],
|
|
@@ -421,7 +418,7 @@ function zt(e) {
|
|
|
421
418
|
cells: [
|
|
422
419
|
...c ? [{ ...n("", 0, !0), colspan: c }] : [],
|
|
423
420
|
{
|
|
424
|
-
...n(e.request.spec.columns.map((s) =>
|
|
421
|
+
...n(e.request.spec.columns.map((s) => ke(s, e.request.presentation)).join(" / "), c, !0),
|
|
425
422
|
colspan: e.layout.columns.length - c,
|
|
426
423
|
isNumeric: !1,
|
|
427
424
|
className: ""
|
|
@@ -445,7 +442,7 @@ function zt(e) {
|
|
|
445
442
|
subtotalLevel: String(s.rowPath.length),
|
|
446
443
|
// A tabular layout prints each label once unless it repeats them; the
|
|
447
444
|
// blank cell continues its group, so a grid draws no rule above it.
|
|
448
|
-
cells: t.row(s, e.rows[l - 1]).map((d, y) => f.has(y) ? { ...n(d, y, !1), className:
|
|
445
|
+
cells: t.row(s, e.rows[l - 1]).map((d, y) => f.has(y) ? { ...n(d, y, !1), className: zt } : n(d, y, !1))
|
|
449
446
|
};
|
|
450
447
|
}),
|
|
451
448
|
grandTotal: null,
|
|
@@ -462,38 +459,66 @@ function zt(e) {
|
|
|
462
459
|
}
|
|
463
460
|
};
|
|
464
461
|
}
|
|
465
|
-
function
|
|
466
|
-
const { levels: n } =
|
|
462
|
+
function Wt(e, t, r) {
|
|
463
|
+
const { levels: n } = De(e.descriptors, t.presentation, r), o = t.spec.columns.length > 0, c = [], s = [], l = e.columns.map((d, y) => {
|
|
467
464
|
if (d.kind !== "measure") return null;
|
|
468
|
-
const w = o ? `${d.role}:${
|
|
469
|
-
let
|
|
470
|
-
return
|
|
465
|
+
const w = o ? `${d.role}:${G(d.columnPath)}` : `measure:${y}`;
|
|
466
|
+
let _ = c.indexOf(w);
|
|
467
|
+
return _ < 0 && (_ = c.push(w) - 1, s.push(o ? Me(d.columnPath, d.role, t.presentation.totals.columns, n) : d.label)), _;
|
|
471
468
|
}), f = t.spec.columns[t.spec.columns.length - 1];
|
|
472
469
|
return {
|
|
473
470
|
columnGroups: l,
|
|
474
471
|
groupLabels: s,
|
|
475
472
|
/** What bands name their groups by: the innermost column level, or "Measures". */
|
|
476
|
-
groupLevelLabel: f ?
|
|
473
|
+
groupLevelLabel: f ? ke(f, t.presentation) : "Measures"
|
|
477
474
|
};
|
|
478
475
|
}
|
|
479
|
-
function
|
|
476
|
+
function Wr(e) {
|
|
480
477
|
const { layout: t, rows: r, report: n } = e, o = {
|
|
481
478
|
...e.request,
|
|
482
|
-
presentation:
|
|
483
|
-
}, c =
|
|
479
|
+
presentation: Vt(t, r, e.request.presentation)
|
|
480
|
+
}, c = qt({ layout: t, rows: r, request: o, report: n }), s = Xt(r), l = Wt(t, o, n), f = {
|
|
484
481
|
...c,
|
|
485
482
|
rows: c.rows.map((d, y) => ({ ...d, keepWithPrevious: s[y] })),
|
|
486
483
|
metadata: { ...c.metadata, ...l }
|
|
487
484
|
};
|
|
488
485
|
return { request: o, table: f, ...l };
|
|
489
486
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
487
|
+
const F = (e) => e.toLocaleString("en-US"), H = (e) => `${F(Math.ceil(e / 1048576))} MB`, te = "export the data as CSV or Excel";
|
|
488
|
+
function Yr(e) {
|
|
489
|
+
const t = bt(e.facts), r = e.dataExport ? `Add a filter to narrow it, or ${te}.` : "Add a filter to narrow it, then export again.";
|
|
490
|
+
switch (e.code) {
|
|
491
|
+
case "PDF_ROW_LIMIT_EXCEEDED": {
|
|
492
|
+
const n = e.subject ?? "This table", o = t.rowLimit ?? M.maxTableRows;
|
|
493
|
+
return t.rowCount !== void 0 ? `${n} has ${F(t.rowCount)} rows. A PDF holds up to ${F(o)} rows per table. ${r}` : `${n} has more than ${F(o)} rows, the most a PDF holds per table. ${r}`;
|
|
494
|
+
}
|
|
495
|
+
case "PDF_PAGE_LIMIT_EXCEEDED": {
|
|
496
|
+
const n = e.subject ?? "This PDF", o = t.pageLimit ?? M.maxPages;
|
|
497
|
+
return t.pageCount !== void 0 ? `${n} is ${F(t.pageCount)} pages. A PDF holds up to ${F(o)}. ${r}` : `${n} is longer than ${F(o)} pages, the most a PDF holds. ${r}`;
|
|
498
|
+
}
|
|
499
|
+
case "PDF_SIZE_LIMIT_EXCEEDED": {
|
|
500
|
+
const n = e.subject ?? "This PDF", o = t.byteLimit ?? M.maxFileBytes;
|
|
501
|
+
return t.bytes !== void 0 ? `${n} is ${H(t.bytes)}. A PDF file holds up to ${H(o)}. ${r}` : `${n} is larger than ${H(o)}, the most a PDF file holds. ${r}`;
|
|
502
|
+
}
|
|
503
|
+
case "PDF_CAPTURE_TOO_TALL":
|
|
504
|
+
return `${e.subject ?? "This dashboard"} is too long to print as one PDF. Print one sheet or fewer cards${e.dataExport ? `, or ${te}` : ""}.`;
|
|
505
|
+
case Re:
|
|
506
|
+
return `A number in this table is too wide for its column in a PDF. Use landscape or fewer columns${e.dataExport ? `, or ${te}` : ""}.`;
|
|
507
|
+
case ce:
|
|
508
|
+
return `This PDF is over what a PDF holds: ${F(M.maxTableRows)} rows per table, ${F(
|
|
509
|
+
M.maxPages
|
|
510
|
+
)} pages and ${H(M.maxFileBytes)}. ${r}`;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
class Yt extends Error {
|
|
514
|
+
constructor(t, r = ce) {
|
|
515
|
+
super(t), this.code = r;
|
|
494
516
|
}
|
|
495
517
|
}
|
|
496
|
-
function
|
|
518
|
+
function Zt(e) {
|
|
519
|
+
return wt(e) || e === ce || e === Re;
|
|
520
|
+
}
|
|
521
|
+
function xe(e) {
|
|
497
522
|
if (!e || typeof e != "object")
|
|
498
523
|
return;
|
|
499
524
|
const { error: t, message: r, detail: n } = e;
|
|
@@ -501,12 +526,12 @@ function we(e) {
|
|
|
501
526
|
if (typeof o == "string" && o.trim())
|
|
502
527
|
return o.trim();
|
|
503
528
|
}
|
|
504
|
-
async function
|
|
529
|
+
async function Jt(e) {
|
|
505
530
|
const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), r = e.headers.get("content-type") || "";
|
|
506
531
|
try {
|
|
507
532
|
if (r.includes("application/json")) {
|
|
508
533
|
const o = await e.json(), c = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
|
|
509
|
-
return { message:
|
|
534
|
+
return { message: xe(o) || t, code: c };
|
|
510
535
|
}
|
|
511
536
|
const n = await e.text();
|
|
512
537
|
if (!n.trim())
|
|
@@ -514,7 +539,7 @@ async function Gt(e) {
|
|
|
514
539
|
try {
|
|
515
540
|
const o = JSON.parse(n), c = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
|
|
516
541
|
return {
|
|
517
|
-
message:
|
|
542
|
+
message: xe(o) || n.trim(),
|
|
518
543
|
code: c
|
|
519
544
|
};
|
|
520
545
|
} catch {
|
|
@@ -524,9 +549,9 @@ async function Gt(e) {
|
|
|
524
549
|
return { message: t };
|
|
525
550
|
}
|
|
526
551
|
}
|
|
527
|
-
async function
|
|
552
|
+
async function Zr(e) {
|
|
528
553
|
if (!e.token) throw new Error("Missing auth token for PDF export");
|
|
529
|
-
if (
|
|
554
|
+
if (yt(e.serializedPayload) > gt.maxRequestBytes)
|
|
530
555
|
throw new Error("Fast-path PDF request exceeds the structured body limit");
|
|
531
556
|
const t = await (e.fetchImpl ?? fetch)(e.url, {
|
|
532
557
|
method: "POST",
|
|
@@ -535,8 +560,8 @@ async function Hr(e) {
|
|
|
535
560
|
signal: e.signal
|
|
536
561
|
});
|
|
537
562
|
if (!t.ok) {
|
|
538
|
-
const n = await
|
|
539
|
-
throw n.code
|
|
563
|
+
const n = await Jt(t);
|
|
564
|
+
throw Zt(n.code) ? new Yt(n.message, n.code) : new Error(n.message);
|
|
540
565
|
}
|
|
541
566
|
const r = await t.json();
|
|
542
567
|
if (r != null && r.error) throw new Error(r.error);
|
|
@@ -544,7 +569,7 @@ async function Hr(e) {
|
|
|
544
569
|
throw new Error("Fast-path PDF response missing download URL");
|
|
545
570
|
return r;
|
|
546
571
|
}
|
|
547
|
-
const
|
|
572
|
+
const Jr = 1, je = ["loading", "measuring", "checking", "laidOut"], Qt = [
|
|
548
573
|
// Already emitted before these contracts; names kept.
|
|
549
574
|
"document_matrix_too_large",
|
|
550
575
|
"document_matrix_unavailable",
|
|
@@ -560,22 +585,24 @@ const Gr = 1, Ne = ["loading", "measuring", "checking", "laidOut"], qt = [
|
|
|
560
585
|
"document_section_render_failed",
|
|
561
586
|
"document_page_overflow",
|
|
562
587
|
"document_sheet_not_found",
|
|
563
|
-
"document_print_timed_out"
|
|
588
|
+
"document_print_timed_out",
|
|
589
|
+
// PDF capacity contract PC-D3: more pages than one PDF holds.
|
|
590
|
+
"document_page_limit_exceeded"
|
|
564
591
|
];
|
|
565
|
-
function
|
|
566
|
-
return
|
|
592
|
+
function Qr(e) {
|
|
593
|
+
return Qt.includes(e);
|
|
567
594
|
}
|
|
568
|
-
const
|
|
569
|
-
function
|
|
595
|
+
const er = 64, tr = 120, rr = 3, nr = 80, or = [...je, "noPageStack", "unknown"];
|
|
596
|
+
function re(e, t) {
|
|
570
597
|
return typeof e != "string" ? void 0 : e.trim().slice(0, t).trim() || void 0;
|
|
571
598
|
}
|
|
572
|
-
function
|
|
599
|
+
function $(e, t) {
|
|
573
600
|
return typeof e == "number" && Number.isInteger(e) && e >= t ? e : void 0;
|
|
574
601
|
}
|
|
575
|
-
function
|
|
602
|
+
function ne(e, t) {
|
|
576
603
|
return t.includes(e) ? e : void 0;
|
|
577
604
|
}
|
|
578
|
-
function
|
|
605
|
+
function ar(e) {
|
|
579
606
|
let t = e;
|
|
580
607
|
if (typeof e == "string")
|
|
581
608
|
try {
|
|
@@ -584,28 +611,29 @@ function er(e) {
|
|
|
584
611
|
return {};
|
|
585
612
|
}
|
|
586
613
|
if (!t || typeof t != "object" || Array.isArray(t)) return {};
|
|
587
|
-
const r = t, n = Array.isArray(r.inputLabels) ? r.inputLabels.map((c) =>
|
|
588
|
-
sectionId:
|
|
589
|
-
sectionTitle:
|
|
590
|
-
pageNumber:
|
|
591
|
-
rowCount:
|
|
592
|
-
rowLimit:
|
|
614
|
+
const r = t, n = Array.isArray(r.inputLabels) ? r.inputLabels.map((c) => re(c, nr)).filter((c) => c !== void 0).slice(0, rr) : [], o = {
|
|
615
|
+
sectionId: re(r.sectionId, er),
|
|
616
|
+
sectionTitle: re(r.sectionTitle, tr),
|
|
617
|
+
pageNumber: $(r.pageNumber, 1),
|
|
618
|
+
rowCount: $(r.rowCount, 0),
|
|
619
|
+
rowLimit: $(r.rowLimit, 1),
|
|
593
620
|
inputLabels: n.length ? n : void 0,
|
|
594
|
-
overflowAxis:
|
|
595
|
-
overflowPx:
|
|
596
|
-
matrixLimit:
|
|
597
|
-
layoutStage:
|
|
598
|
-
loadingSectionCount:
|
|
599
|
-
measuredRowCount:
|
|
600
|
-
totalRowCount:
|
|
601
|
-
pageCount:
|
|
621
|
+
overflowAxis: ne(r.overflowAxis, ["height", "width"]),
|
|
622
|
+
overflowPx: $(r.overflowPx, 0),
|
|
623
|
+
matrixLimit: ne(r.matrixLimit, ["rows", "bytes"]),
|
|
624
|
+
layoutStage: ne(r.layoutStage, or),
|
|
625
|
+
loadingSectionCount: $(r.loadingSectionCount, 0),
|
|
626
|
+
measuredRowCount: $(r.measuredRowCount, 0),
|
|
627
|
+
totalRowCount: $(r.totalRowCount, 0),
|
|
628
|
+
pageCount: $(r.pageCount, 0),
|
|
629
|
+
pageLimit: $(r.pageLimit, 1)
|
|
602
630
|
};
|
|
603
631
|
return Object.fromEntries(
|
|
604
632
|
Object.entries(o).filter(([, c]) => c !== void 0)
|
|
605
633
|
);
|
|
606
634
|
}
|
|
607
|
-
function
|
|
608
|
-
const t =
|
|
635
|
+
function en(e) {
|
|
636
|
+
const t = ar(e.facts), r = t.sectionTitle ? `Section "${t.sectionTitle}"` : t.sectionId ? `Section ${t.sectionId}` : "A section", n = t.pageNumber !== void 0 ? ` on page ${t.pageNumber}` : "";
|
|
609
637
|
switch (e.code) {
|
|
610
638
|
case "document_section_setup":
|
|
611
639
|
return `${r} is not set up to print.`;
|
|
@@ -633,6 +661,8 @@ function Yr(e) {
|
|
|
633
661
|
return t.inputLabels ? `The report's input values were not saved: ${t.inputLabels.join(", ")}.` : "The report's input values were not saved.";
|
|
634
662
|
case "document_sheet_not_found":
|
|
635
663
|
return "The requested Document sheet is not in the dashboard.";
|
|
664
|
+
case "document_page_limit_exceeded":
|
|
665
|
+
return t.pageCount !== void 0 && t.pageLimit !== void 0 ? `The Document is ${t.pageCount} pages; a PDF holds up to ${t.pageLimit}.` : "The Document has more pages than a PDF holds.";
|
|
636
666
|
case "document_print_timed_out":
|
|
637
667
|
return [
|
|
638
668
|
`The Document did not finish preparing in time (stage ${t.layoutStage ?? "unknown"}`,
|
|
@@ -643,13 +673,13 @@ function Yr(e) {
|
|
|
643
673
|
].join("");
|
|
644
674
|
}
|
|
645
675
|
}
|
|
646
|
-
function
|
|
647
|
-
return
|
|
676
|
+
function sr(e) {
|
|
677
|
+
return je.includes(e);
|
|
648
678
|
}
|
|
649
|
-
function
|
|
679
|
+
function oe(e) {
|
|
650
680
|
return typeof e == "number" && Number.isInteger(e) && e >= 0;
|
|
651
681
|
}
|
|
652
|
-
function
|
|
682
|
+
function tn(e) {
|
|
653
683
|
let t = e;
|
|
654
684
|
if (typeof e == "string")
|
|
655
685
|
try {
|
|
@@ -659,27 +689,27 @@ function Wr(e) {
|
|
|
659
689
|
}
|
|
660
690
|
if (!t || typeof t != "object" || Array.isArray(t)) return;
|
|
661
691
|
const { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: c } = t;
|
|
662
|
-
if (!(!
|
|
692
|
+
if (!(!sr(r) || !oe(n) || o !== null && !oe(o) || c !== null && !oe(c)))
|
|
663
693
|
return { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: c };
|
|
664
694
|
}
|
|
665
|
-
function
|
|
695
|
+
function ir(e, t) {
|
|
666
696
|
return e.dashboardId === t.dashboardId && e.cardId === t.cardId && e.attachmentIndex === void 0;
|
|
667
697
|
}
|
|
668
|
-
function
|
|
698
|
+
function Ke(e) {
|
|
669
699
|
return new Map(
|
|
670
700
|
e.presentationExecutionSnapshot.resolvedFormats.flatMap(
|
|
671
|
-
(t) => t.format.type === "raw_temporal" && t.target.kind === "column" &&
|
|
701
|
+
(t) => t.format.type === "raw_temporal" && t.target.kind === "column" && ir(t.scope, e.scope) ? [[t.target.columnKey, t.format]] : []
|
|
672
702
|
)
|
|
673
703
|
);
|
|
674
704
|
}
|
|
675
|
-
function
|
|
705
|
+
function Ve(e) {
|
|
676
706
|
const t = e == null ? void 0 : e.sql, r = e == null ? void 0 : e.python;
|
|
677
707
|
return (e == null ? void 0 : e.resultOwner) === "freeform" && typeof t == "string" && !!t.trim() && (typeof r != "string" || !r.trim());
|
|
678
708
|
}
|
|
679
|
-
function
|
|
680
|
-
return e.formatting.useFormattedValues !== !1 &&
|
|
709
|
+
function rn(e) {
|
|
710
|
+
return e.formatting.useFormattedValues !== !1 && Ve(e.queryPayload) && Ke(e.formatting).size > 0;
|
|
681
711
|
}
|
|
682
|
-
function
|
|
712
|
+
function cr(e, t) {
|
|
683
713
|
return e.map((r, n) => {
|
|
684
714
|
if (!Object.prototype.hasOwnProperty.call(r, t) || r[t] === void 0)
|
|
685
715
|
throw new Error(
|
|
@@ -689,13 +719,13 @@ function nr(e, t) {
|
|
|
689
719
|
return o === null || typeof o == "string" ? o : String(o);
|
|
690
720
|
});
|
|
691
721
|
}
|
|
692
|
-
function
|
|
722
|
+
function lr(e) {
|
|
693
723
|
if (e.formatting.useFormattedValues === !1)
|
|
694
724
|
return {
|
|
695
725
|
activatedColumnKeys: /* @__PURE__ */ new Set(),
|
|
696
726
|
byColumnKey: /* @__PURE__ */ new Map()
|
|
697
727
|
};
|
|
698
|
-
const t =
|
|
728
|
+
const t = Ke(e.formatting), r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
|
|
699
729
|
if (t.size === 0)
|
|
700
730
|
return { activatedColumnKeys: r, byColumnKey: n };
|
|
701
731
|
const o = new Map(
|
|
@@ -703,19 +733,19 @@ function or(e) {
|
|
|
703
733
|
const f = l.key || l.field;
|
|
704
734
|
return f ? [[f, l]] : [];
|
|
705
735
|
})
|
|
706
|
-
), c =
|
|
736
|
+
), c = Ve(e.queryPayload), s = /* @__PURE__ */ new Map();
|
|
707
737
|
for (const [l, f] of t) {
|
|
708
738
|
const d = o.get(l);
|
|
709
739
|
let y;
|
|
710
740
|
if (d != null && d.rawTemporal)
|
|
711
|
-
y =
|
|
741
|
+
y = _t(d, {
|
|
712
742
|
metadataRequired: !0
|
|
713
743
|
}), r.add(l);
|
|
714
744
|
else if (c) {
|
|
715
745
|
r.add(l);
|
|
716
|
-
const w =
|
|
746
|
+
const w = Je({
|
|
717
747
|
columnKey: l,
|
|
718
|
-
values:
|
|
748
|
+
values: cr(e.records, l)
|
|
719
749
|
});
|
|
720
750
|
s.set(l, w), w.status === "classified" && (y = w.metadata);
|
|
721
751
|
} else
|
|
@@ -723,18 +753,18 @@ function or(e) {
|
|
|
723
753
|
y && n.set(l, {
|
|
724
754
|
metadata: y,
|
|
725
755
|
format: f,
|
|
726
|
-
formatValue:
|
|
756
|
+
formatValue: Qe({ metadata: y, format: f })
|
|
727
757
|
});
|
|
728
758
|
}
|
|
729
759
|
return {
|
|
730
760
|
activatedColumnKeys: r,
|
|
731
761
|
byColumnKey: n,
|
|
732
762
|
...c ? {
|
|
733
|
-
sqlChunkEvidence:
|
|
763
|
+
sqlChunkEvidence: et(s)
|
|
734
764
|
} : {}
|
|
735
765
|
};
|
|
736
766
|
}
|
|
737
|
-
function
|
|
767
|
+
function ur(e) {
|
|
738
768
|
if (!e.resolution.activatedColumnKeys.has(e.columnKey))
|
|
739
769
|
return;
|
|
740
770
|
if (e.value === void 0)
|
|
@@ -749,86 +779,86 @@ function ar(e) {
|
|
|
749
779
|
const r = t.formatValue(e.value);
|
|
750
780
|
return r.ok && r.wallClock ? { text: r.text, wallClock: r.wallClock } : { text: r.text };
|
|
751
781
|
}
|
|
752
|
-
function
|
|
782
|
+
function Te(e, t) {
|
|
753
783
|
const r = e.byColumnKey.get(t);
|
|
754
784
|
return r ? r.metadata.valueKind === "date" : void 0;
|
|
755
785
|
}
|
|
756
|
-
const
|
|
757
|
-
function
|
|
786
|
+
const mr = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime"]), dr = /^\d{4}-\d{2}-\d{2}|^\d{2}\/\d{2}\/\d{4}/, fr = /^\d{4}-\d{2}-\d{2}$/, Be = "MM/dd/yyyy";
|
|
787
|
+
function q(e) {
|
|
758
788
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
759
789
|
}
|
|
760
|
-
function
|
|
790
|
+
function O(e) {
|
|
761
791
|
return e.key || e.field || void 0;
|
|
762
792
|
}
|
|
763
|
-
function
|
|
764
|
-
return e == null ? "" : typeof e == "string" ? e :
|
|
793
|
+
function Ee(e) {
|
|
794
|
+
return e == null ? "" : typeof e == "string" ? e : K(e) ? e.value : e instanceof Date ? e.toISOString() : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
765
795
|
}
|
|
766
|
-
function
|
|
796
|
+
function $e(e, t) {
|
|
767
797
|
var n;
|
|
768
798
|
const r = (n = e.columnSettings) == null ? void 0 : n[t];
|
|
769
|
-
if (!(!
|
|
770
|
-
return
|
|
799
|
+
if (!(!q(r) || r.type !== "date"))
|
|
800
|
+
return q(r.dateFormat) ? r.dateFormat : {};
|
|
771
801
|
}
|
|
772
|
-
function
|
|
773
|
-
return e.useCustomFormat && e.customFormat ? e.customFormat : e.format ||
|
|
802
|
+
function Fe(e) {
|
|
803
|
+
return e.useCustomFormat && e.customFormat ? e.customFormat : e.format || Be;
|
|
774
804
|
}
|
|
775
|
-
function
|
|
805
|
+
function Se(e, t) {
|
|
776
806
|
return e && e !== "auto" ? e : t;
|
|
777
807
|
}
|
|
778
|
-
function
|
|
808
|
+
function pr(e) {
|
|
779
809
|
return !/[HhKkmsSa]/.test(e.replace(/'[^']*'/g, ""));
|
|
780
810
|
}
|
|
781
|
-
function
|
|
811
|
+
function hr(e) {
|
|
782
812
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
783
813
|
if (typeof e != "string" || !e.trim()) return null;
|
|
784
814
|
const t = Number(e);
|
|
785
815
|
return Number.isFinite(t) ? t : null;
|
|
786
816
|
}
|
|
787
|
-
function
|
|
788
|
-
const t =
|
|
817
|
+
function br(e) {
|
|
818
|
+
const t = Ne(e);
|
|
789
819
|
if (t !== void 0)
|
|
790
820
|
try {
|
|
791
|
-
return
|
|
821
|
+
return pt(t, /[.eE]/.test(t) ? "decimal" : "integer");
|
|
792
822
|
} catch {
|
|
793
823
|
return;
|
|
794
824
|
}
|
|
795
825
|
}
|
|
796
|
-
function
|
|
826
|
+
function yr(e) {
|
|
797
827
|
return e.calendar.fiscalCalendar && (e.granularity === "quarter" || e.granularity === "year") ? "fiscal" : e.granularity;
|
|
798
828
|
}
|
|
799
|
-
function
|
|
800
|
-
const { formatting: t, queryPayload: r } = e, n = t.useFormattedValues, o = t.scope, c = (a) =>
|
|
829
|
+
function nn(e) {
|
|
830
|
+
const { formatting: t, queryPayload: r } = e, n = t.useFormattedValues, o = t.scope, c = (a) => tt({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } }), s = (a) => nt({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } });
|
|
801
831
|
function l(a) {
|
|
802
|
-
var
|
|
803
|
-
if ((
|
|
804
|
-
const m = a.columns.map(
|
|
832
|
+
var b;
|
|
833
|
+
if ((b = t.visibleColumns) != null && b.length) return t.visibleColumns;
|
|
834
|
+
const m = a.columns.map(O).filter((p) => !!p);
|
|
805
835
|
return m.length > 0 ? m : a.records[0] ? Object.keys(a.records[0]) : [];
|
|
806
836
|
}
|
|
807
837
|
function f(a, m) {
|
|
808
838
|
return t.columnLabels && Object.prototype.hasOwnProperty.call(t.columnLabels, a) && t.columnLabels[a] || void 0 || d(m) || (m == null ? void 0 : m.label) || (m == null ? void 0 : m.headerName) || a;
|
|
809
839
|
}
|
|
810
840
|
function d(a, m) {
|
|
811
|
-
const
|
|
812
|
-
if (!
|
|
813
|
-
const p =
|
|
814
|
-
return
|
|
841
|
+
const b = a == null ? void 0 : a.pivotIdentity;
|
|
842
|
+
if (!b || !b.members || b.members.length === 0) return;
|
|
843
|
+
const p = ye({ identity: b, columnKey: (a == null ? void 0 : a.key) || (a == null ? void 0 : a.field) || "" });
|
|
844
|
+
return Ct({
|
|
815
845
|
members: p,
|
|
816
846
|
metricLabel: (a == null ? void 0 : a.label) || (a == null ? void 0 : a.headerName),
|
|
817
847
|
mode: n ? "formatted" : "canonical",
|
|
818
|
-
resolveTemporalFormat: (
|
|
819
|
-
const g = p.find((
|
|
848
|
+
resolveTemporalFormat: (x) => {
|
|
849
|
+
const g = p.find((v) => v.fieldId === x);
|
|
820
850
|
if (!(g != null && g.temporalBucket)) return;
|
|
821
|
-
const
|
|
851
|
+
const C = pe({
|
|
822
852
|
snapshot: t.presentationExecutionSnapshot,
|
|
823
853
|
scope: o,
|
|
824
|
-
target: { kind: "field", fieldId:
|
|
854
|
+
target: { kind: "field", fieldId: x, role: "pivotby" }
|
|
825
855
|
});
|
|
826
|
-
return
|
|
856
|
+
return C ? y(g.temporalBucket, C) : void 0;
|
|
827
857
|
}
|
|
828
858
|
}).flattenedLabel;
|
|
829
859
|
}
|
|
830
860
|
function y(a, m) {
|
|
831
|
-
return
|
|
861
|
+
return rt({
|
|
832
862
|
metadata: a,
|
|
833
863
|
cardFormat: m,
|
|
834
864
|
locale: m.locale,
|
|
@@ -836,129 +866,129 @@ function Jr(e) {
|
|
|
836
866
|
}).format;
|
|
837
867
|
}
|
|
838
868
|
function w(a, m) {
|
|
839
|
-
const { records:
|
|
840
|
-
(i) =>
|
|
869
|
+
const { records: b, columns: p } = a, x = q(r.cardConfig) ? r.cardConfig : void 0, g = x == null ? void 0 : x.pivotByColumns, C = Array.isArray(g) ? g.flatMap(
|
|
870
|
+
(i) => q(i) && typeof i.id == "string" && i.id ? [i.id] : []
|
|
841
871
|
) : [];
|
|
842
|
-
|
|
843
|
-
p.map((i) => ({ key:
|
|
844
|
-
{ expectedPivotFieldIds:
|
|
872
|
+
vt(
|
|
873
|
+
p.map((i) => ({ key: O(i) || "<unknown>", pivotIdentity: i.pivotIdentity })),
|
|
874
|
+
{ expectedPivotFieldIds: C }
|
|
845
875
|
);
|
|
846
|
-
const
|
|
876
|
+
const v = l(a), S = new Map(
|
|
847
877
|
p.flatMap((i) => {
|
|
848
|
-
const
|
|
849
|
-
return
|
|
878
|
+
const h = O(i);
|
|
879
|
+
return h ? [[h, i]] : [];
|
|
850
880
|
})
|
|
851
|
-
),
|
|
852
|
-
records:
|
|
881
|
+
), ze = new Map(a.resultColumns.map((i) => [i.key, i.dataType])), I = lr({
|
|
882
|
+
records: b,
|
|
853
883
|
columns: p,
|
|
854
884
|
formatting: t,
|
|
855
885
|
queryPayload: r
|
|
856
|
-
}),
|
|
886
|
+
}), Y = new Map(
|
|
857
887
|
p.flatMap((i) => {
|
|
858
|
-
const
|
|
859
|
-
return
|
|
888
|
+
const h = O(i);
|
|
889
|
+
return h && i.temporalBucket ? [[h, i.temporalBucket]] : [];
|
|
860
890
|
})
|
|
861
|
-
),
|
|
862
|
-
for (const i of
|
|
863
|
-
const
|
|
891
|
+
), ue = /* @__PURE__ */ new Map();
|
|
892
|
+
for (const i of v) {
|
|
893
|
+
const h = pe({
|
|
864
894
|
snapshot: t.presentationExecutionSnapshot,
|
|
865
895
|
scope: o,
|
|
866
896
|
target: { kind: "column", columnKey: i }
|
|
867
|
-
}),
|
|
897
|
+
}), T = Y.get(i);
|
|
868
898
|
if (n) {
|
|
869
|
-
if (
|
|
870
|
-
if (
|
|
899
|
+
if (h && !T) throw new Error(`Missing temporal bucket metadata for column "${i}"`);
|
|
900
|
+
if (T && !h) throw new Error(`Missing resolved temporal presentation for column "${i}"`);
|
|
871
901
|
}
|
|
872
|
-
|
|
902
|
+
h && T && ue.set(i, y(T, h));
|
|
873
903
|
}
|
|
874
|
-
const
|
|
875
|
-
const
|
|
904
|
+
const Z = v.map((i) => {
|
|
905
|
+
const h = ze.get(i), T = h && mr.has(h) ? h : "unknown", E = n ? _(i, I, Y) : void 0, P = f(i, S.get(i)), k = n && I.activatedColumnKeys.has(i) && Te(I, i) === void 0;
|
|
876
906
|
return {
|
|
877
907
|
key: i,
|
|
878
|
-
label:
|
|
879
|
-
dataType:
|
|
908
|
+
label: P,
|
|
909
|
+
dataType: T,
|
|
880
910
|
...E ? { presentation: E } : {},
|
|
881
|
-
xlsx:
|
|
882
|
-
...
|
|
911
|
+
xlsx: Ce({ key: i, label: P, formattedValues: n, dataType: T, presentation: E }),
|
|
912
|
+
...k ? { xlsxPending: !0 } : {}
|
|
883
913
|
};
|
|
884
914
|
});
|
|
885
|
-
function
|
|
886
|
-
if (!n) return { text:
|
|
887
|
-
const
|
|
888
|
-
if (
|
|
889
|
-
const
|
|
890
|
-
if (
|
|
891
|
-
const
|
|
892
|
-
if (
|
|
915
|
+
function He(i, h, T, E) {
|
|
916
|
+
if (!n) return { text: Ee(i), value: i };
|
|
917
|
+
const P = ur({ value: i, columnKey: h, rowIndex: T, resolution: I });
|
|
918
|
+
if (P !== void 0) return { text: P.text, value: i, ...P.wallClock ? { wallClock: P.wallClock } : {} };
|
|
919
|
+
const k = Y.get(h);
|
|
920
|
+
if (k) {
|
|
921
|
+
const L = ue.get(h);
|
|
922
|
+
if (!L) throw new Error(`Missing resolved temporal presentation for column "${h}"`);
|
|
893
923
|
if (i != null && typeof i != "string")
|
|
894
|
-
throw new Error(`Canonical temporal column "${
|
|
895
|
-
const
|
|
924
|
+
throw new Error(`Canonical temporal column "${h}" must contain a string or null`);
|
|
925
|
+
const R = i ?? null, N = ot(R, k);
|
|
896
926
|
return {
|
|
897
|
-
text:
|
|
927
|
+
text: at({ value: R, metadata: k, format: L }),
|
|
898
928
|
value: i,
|
|
899
|
-
...
|
|
929
|
+
...N ? { wallClock: N } : {}
|
|
900
930
|
};
|
|
901
931
|
}
|
|
902
932
|
if (i == null) return { text: "", value: i };
|
|
903
|
-
const
|
|
904
|
-
if (
|
|
933
|
+
const J = s(h);
|
|
934
|
+
if (J && typeof i == "number" && Number.isFinite(i))
|
|
905
935
|
return {
|
|
906
|
-
text:
|
|
936
|
+
text: he(
|
|
907
937
|
new Date(i).toISOString(),
|
|
908
|
-
|
|
909
|
-
|
|
938
|
+
J.pattern || Be,
|
|
939
|
+
Se(J.timezone, t.timezone),
|
|
910
940
|
"UTC"
|
|
911
941
|
),
|
|
912
942
|
value: i
|
|
913
943
|
};
|
|
914
|
-
const
|
|
944
|
+
const D = c(h);
|
|
915
945
|
if (typeof i == "number")
|
|
916
|
-
return { text:
|
|
917
|
-
if (
|
|
918
|
-
return { text:
|
|
919
|
-
const
|
|
920
|
-
if (
|
|
921
|
-
const
|
|
946
|
+
return { text: D ? B(i, D) : String(i), value: i };
|
|
947
|
+
if (K(i))
|
|
948
|
+
return { text: D ? B(i, D) : i.value, value: i };
|
|
949
|
+
const V = $e(t, h);
|
|
950
|
+
if (V && (i instanceof Date || typeof i == "string" && dr.test(i))) {
|
|
951
|
+
const L = i instanceof Date ? i.toISOString() : i, R = typeof i == "string" && fr.test(i), N = R ? "UTC" : Se(V.timezone, t.timezone), de = R ? "UTC" : V.sourceTimezone || "auto", fe = st(L, N, de);
|
|
922
952
|
return {
|
|
923
|
-
text:
|
|
953
|
+
text: he(L, Fe(V), N, de),
|
|
924
954
|
value: i,
|
|
925
|
-
...
|
|
955
|
+
...fe ? { wallClock: fe } : {}
|
|
926
956
|
};
|
|
927
957
|
}
|
|
928
|
-
if (typeof i == "string" &&
|
|
929
|
-
const
|
|
930
|
-
if (
|
|
958
|
+
if (typeof i == "string" && D && E.dataType === "number") {
|
|
959
|
+
const L = br(i);
|
|
960
|
+
if (L) return { text: B(L, D), value: i };
|
|
931
961
|
}
|
|
932
|
-
return { text:
|
|
962
|
+
return { text: Ee(i), value: i };
|
|
933
963
|
}
|
|
934
|
-
const
|
|
935
|
-
(i,
|
|
936
|
-
const E =
|
|
937
|
-
return
|
|
964
|
+
const Ge = b.map(
|
|
965
|
+
(i, h) => Z.map((T) => {
|
|
966
|
+
const E = He(i[T.key], T.key, h, T);
|
|
967
|
+
return X({ value: E.value, text: E.text, column: T.xlsx, wallClock: E.wallClock });
|
|
938
968
|
})
|
|
939
|
-
),
|
|
940
|
-
if (
|
|
941
|
-
for (const i of
|
|
942
|
-
const
|
|
943
|
-
|
|
969
|
+
), me = (m == null ? void 0 : m.withHeader) !== !1 && t.includeHeaders;
|
|
970
|
+
if (me)
|
|
971
|
+
for (const i of v) {
|
|
972
|
+
const h = S.get(i);
|
|
973
|
+
h != null && h.pivotIdentity && ye({ identity: h.pivotIdentity, columnKey: O(h) || i });
|
|
944
974
|
}
|
|
945
975
|
return {
|
|
946
|
-
...
|
|
947
|
-
columns:
|
|
948
|
-
rows:
|
|
949
|
-
...
|
|
976
|
+
...me ? { header: Z.map((i) => i.label) } : {},
|
|
977
|
+
columns: Z,
|
|
978
|
+
rows: Ge,
|
|
979
|
+
...I.sqlChunkEvidence ? { rawTemporalClassification: I.sqlChunkEvidence } : {}
|
|
950
980
|
};
|
|
951
981
|
}
|
|
952
|
-
function
|
|
982
|
+
function _(a, m, b) {
|
|
953
983
|
if (m.activatedColumnKeys.has(a)) {
|
|
954
|
-
const
|
|
955
|
-
return
|
|
984
|
+
const C = Te(m, a);
|
|
985
|
+
return C === void 0 ? { kind: "text" } : { kind: "datetime", dateOnly: C };
|
|
956
986
|
}
|
|
957
|
-
const p =
|
|
958
|
-
if (p) return { kind: "temporal_bucket", grain:
|
|
987
|
+
const p = b.get(a);
|
|
988
|
+
if (p) return { kind: "temporal_bucket", grain: yr(p) };
|
|
959
989
|
if (s(a)) return { kind: "text" };
|
|
960
|
-
const
|
|
961
|
-
if (
|
|
990
|
+
const x = $e(t, a);
|
|
991
|
+
if (x) return { kind: "datetime", dateOnly: pr(Fe(x)) };
|
|
962
992
|
const g = c(a);
|
|
963
993
|
return g ? { kind: "measure", format: g } : void 0;
|
|
964
994
|
}
|
|
@@ -966,22 +996,22 @@ function Jr(e) {
|
|
|
966
996
|
if (!Number.isInteger(m) || m < 0)
|
|
967
997
|
throw new Error("totalRows must be a non-negative integer");
|
|
968
998
|
return m === 0 ? void 0 : (t.visibleColumns ?? Object.keys(a)).map((p) => {
|
|
969
|
-
const g = Object.prototype.hasOwnProperty.call(a, p) ? a[p] : p === t.tableTotalsLabelColumnKey ? "Total" : null,
|
|
999
|
+
const g = Object.prototype.hasOwnProperty.call(a, p) ? a[p] : p === t.tableTotalsLabelColumnKey ? "Total" : null, C = n ? c(p) : void 0, v = Ce({
|
|
970
1000
|
key: p,
|
|
971
1001
|
label: p,
|
|
972
1002
|
formattedValues: n,
|
|
973
1003
|
dataType: "unknown",
|
|
974
|
-
...
|
|
1004
|
+
...C ? { presentation: { kind: "measure", format: C } } : {}
|
|
975
1005
|
});
|
|
976
1006
|
if (g == null) return { kind: "empty" };
|
|
977
|
-
if (!n) return
|
|
978
|
-
const S =
|
|
979
|
-
return
|
|
1007
|
+
if (!n) return X({ value: g, text: String(g), column: v });
|
|
1008
|
+
const S = C ? hr(g) : null;
|
|
1009
|
+
return X(C && S !== null ? { value: S, text: B(S, C), column: v } : { value: g, text: String(g), column: v });
|
|
980
1010
|
});
|
|
981
1011
|
}
|
|
982
1012
|
return { format: w, totals: u };
|
|
983
1013
|
}
|
|
984
|
-
const
|
|
1014
|
+
const gr = /* @__PURE__ */ new Set([
|
|
985
1015
|
"scope",
|
|
986
1016
|
"useFormattedValues",
|
|
987
1017
|
"timezone",
|
|
@@ -996,43 +1026,43 @@ const fr = /* @__PURE__ */ new Set([
|
|
|
996
1026
|
"fileFormat",
|
|
997
1027
|
"title"
|
|
998
1028
|
]);
|
|
999
|
-
function
|
|
1029
|
+
function le(e) {
|
|
1000
1030
|
return e !== null && typeof e == "object" && !Array.isArray(e);
|
|
1001
1031
|
}
|
|
1002
|
-
function
|
|
1032
|
+
function Le(e, t) {
|
|
1003
1033
|
if (e !== void 0) {
|
|
1004
|
-
if (!
|
|
1034
|
+
if (!le(e))
|
|
1005
1035
|
throw new Error(`formatting.${t} must be an object`);
|
|
1006
1036
|
return e;
|
|
1007
1037
|
}
|
|
1008
1038
|
}
|
|
1009
|
-
function
|
|
1010
|
-
if (!
|
|
1039
|
+
function on(e) {
|
|
1040
|
+
if (!le(e))
|
|
1011
1041
|
throw new Error("formatting must be an object");
|
|
1012
1042
|
const t = ["reportContext", "resolvedFormats"].find(
|
|
1013
1043
|
(a) => Object.prototype.hasOwnProperty.call(e, a)
|
|
1014
1044
|
);
|
|
1015
1045
|
if (t)
|
|
1016
|
-
throw new
|
|
1046
|
+
throw new be(
|
|
1017
1047
|
`formatting.${t} is retired; formatting.presentationExecutionSnapshot is authoritative.`
|
|
1018
1048
|
);
|
|
1019
|
-
const r = Object.keys(e).find((a) => !
|
|
1049
|
+
const r = Object.keys(e).find((a) => !gr.has(a));
|
|
1020
1050
|
if (r)
|
|
1021
1051
|
throw new Error(`formatting contains unknown property "${r}"`);
|
|
1022
1052
|
const n = typeof e.timezone == "string" ? e.timezone.trim() : "";
|
|
1023
1053
|
if (!n)
|
|
1024
1054
|
throw new Error("formatting.timezone must be a non-empty string");
|
|
1025
|
-
const o =
|
|
1055
|
+
const o = ut(e.delimiter);
|
|
1026
1056
|
if (!o)
|
|
1027
1057
|
throw new Error("formatting.delimiter must be a comma, semicolon or tab");
|
|
1028
|
-
const c =
|
|
1058
|
+
const c = mt(e.csvEncoding);
|
|
1029
1059
|
if (!c)
|
|
1030
1060
|
throw new Error("formatting.csvEncoding must be 'utf-8-bom' or 'utf-8'");
|
|
1031
1061
|
if (typeof e.includeHeaders != "boolean")
|
|
1032
1062
|
throw new Error("formatting.includeHeaders must be a boolean");
|
|
1033
1063
|
if (e.useFormattedValues !== void 0 && typeof e.useFormattedValues != "boolean")
|
|
1034
1064
|
throw new Error("formatting.useFormattedValues must be a boolean");
|
|
1035
|
-
const s = e.fileFormat === void 0 ? void 0 :
|
|
1065
|
+
const s = e.fileFormat === void 0 ? void 0 : dt(e.fileFormat);
|
|
1036
1066
|
if (e.fileFormat !== void 0 && !s)
|
|
1037
1067
|
throw new Error("formatting.fileFormat must be 'csv' or 'xlsx'");
|
|
1038
1068
|
if (e.title !== void 0 && typeof e.title != "string")
|
|
@@ -1040,37 +1070,37 @@ function Qr(e) {
|
|
|
1040
1070
|
const l = e.visibleColumns === void 0 ? void 0 : Array.isArray(e.visibleColumns) && e.visibleColumns.every((a) => typeof a == "string") ? e.visibleColumns : void 0;
|
|
1041
1071
|
if (e.visibleColumns !== void 0 && !l)
|
|
1042
1072
|
throw new Error("formatting.visibleColumns must be an array of strings");
|
|
1043
|
-
const f =
|
|
1073
|
+
const f = Le(e.columnLabels, "columnLabels");
|
|
1044
1074
|
if (f && Object.values(f).some((a) => typeof a != "string"))
|
|
1045
1075
|
throw new Error("formatting.columnLabels values must be strings");
|
|
1046
|
-
const d =
|
|
1076
|
+
const d = Le(e.columnSettings, "columnSettings"), y = e.tableTotalsLabelColumnKey === void 0 ? void 0 : typeof e.tableTotalsLabelColumnKey == "string" && e.tableTotalsLabelColumnKey.trim() ? e.tableTotalsLabelColumnKey : null;
|
|
1047
1077
|
if (y === null)
|
|
1048
1078
|
throw new Error("formatting.tableTotalsLabelColumnKey must be a non-empty string");
|
|
1049
1079
|
if (y && !(l != null && l.includes(y)))
|
|
1050
1080
|
throw new Error("formatting.tableTotalsLabelColumnKey must identify a visible column");
|
|
1051
|
-
const w =
|
|
1081
|
+
const w = it(e.scope, "formatting.scope");
|
|
1052
1082
|
if (!w.cardId || w.attachmentIndex !== void 0)
|
|
1053
1083
|
throw new Error("formatting.scope must identify exactly one dashboard card");
|
|
1054
|
-
const
|
|
1084
|
+
const _ = e.useFormattedValues !== !1, u = ct(e.presentationExecutionSnapshot);
|
|
1055
1085
|
if (n !== u.reportContext.calendar.tz)
|
|
1056
1086
|
throw new Error(
|
|
1057
1087
|
"formatting.timezone must equal presentationExecutionSnapshot.reportContext.calendar.tz"
|
|
1058
1088
|
);
|
|
1059
1089
|
try {
|
|
1060
|
-
|
|
1090
|
+
lt({
|
|
1061
1091
|
snapshot: u,
|
|
1062
1092
|
expectedScope: { dashboardId: w.dashboardId, cardId: w.cardId },
|
|
1063
1093
|
visibleColumns: l,
|
|
1064
|
-
useFormattedValues:
|
|
1094
|
+
useFormattedValues: _
|
|
1065
1095
|
});
|
|
1066
1096
|
} catch (a) {
|
|
1067
|
-
throw new
|
|
1097
|
+
throw new be(
|
|
1068
1098
|
`formatting.presentationExecutionSnapshot.${a instanceof Error ? a.message : String(a)}`
|
|
1069
1099
|
);
|
|
1070
1100
|
}
|
|
1071
1101
|
return {
|
|
1072
1102
|
scope: { dashboardId: w.dashboardId, cardId: w.cardId },
|
|
1073
|
-
useFormattedValues:
|
|
1103
|
+
useFormattedValues: _,
|
|
1074
1104
|
timezone: n,
|
|
1075
1105
|
presentationExecutionSnapshot: u,
|
|
1076
1106
|
delimiter: o,
|
|
@@ -1084,8 +1114,8 @@ function Qr(e) {
|
|
|
1084
1114
|
...typeof e.title == "string" ? { title: e.title } : {}
|
|
1085
1115
|
};
|
|
1086
1116
|
}
|
|
1087
|
-
function
|
|
1088
|
-
const t = e.formatOptions, r = (n) =>
|
|
1117
|
+
function an(e) {
|
|
1118
|
+
const t = e.formatOptions, r = (n) => le(n) ? n : void 0;
|
|
1089
1119
|
return {
|
|
1090
1120
|
scope: { dashboardId: e.dashboardId, cardId: e.cardId },
|
|
1091
1121
|
useFormattedValues: t.useFormattedValues !== !1,
|
|
@@ -1102,32 +1132,32 @@ function en(e) {
|
|
|
1102
1132
|
...typeof e.title == "string" ? { title: e.title } : {}
|
|
1103
1133
|
};
|
|
1104
1134
|
}
|
|
1105
|
-
const
|
|
1106
|
-
function
|
|
1135
|
+
const wr = /^\d{4}-\d{2}-\d{2}$/;
|
|
1136
|
+
function Xe(e) {
|
|
1107
1137
|
const t = e.split(".");
|
|
1108
1138
|
return t[t.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((o) => o.charAt(0).toUpperCase() + o.slice(1).toLowerCase()).join(" ");
|
|
1109
1139
|
}
|
|
1110
|
-
const
|
|
1111
|
-
function
|
|
1112
|
-
const r = e.slice(0,
|
|
1140
|
+
const Pe = 10;
|
|
1141
|
+
function ae(e, t) {
|
|
1142
|
+
const r = e.slice(0, Pe).map(t).join(", "), n = e.length - Pe;
|
|
1113
1143
|
return n > 0 ? `${r}, and ${n} more` : r;
|
|
1114
1144
|
}
|
|
1115
|
-
function
|
|
1145
|
+
function Cr(e) {
|
|
1116
1146
|
if (e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between")
|
|
1117
1147
|
return;
|
|
1118
|
-
const t =
|
|
1148
|
+
const t = ie(e.relativeMeta);
|
|
1119
1149
|
if (t)
|
|
1120
|
-
return
|
|
1150
|
+
return ht(t) || t.unit === "quarter" || t.unit === "year" ? t : void 0;
|
|
1121
1151
|
}
|
|
1122
|
-
function
|
|
1123
|
-
if (t !== "label") return
|
|
1152
|
+
function vr(e, t) {
|
|
1153
|
+
if (t !== "label") return Cr(e);
|
|
1124
1154
|
if (!(e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between"))
|
|
1125
|
-
return
|
|
1155
|
+
return ie(e.relativeMeta);
|
|
1126
1156
|
}
|
|
1127
|
-
function
|
|
1128
|
-
const { name: r, operation: n, values: o, valueType: c } = e, s = t.label ??
|
|
1157
|
+
function Ie(e, t = {}) {
|
|
1158
|
+
const { name: r, operation: n, values: o, valueType: c } = e, s = t.label ?? Xe(r), l = vr(e, t.relativeDates);
|
|
1129
1159
|
if (l) {
|
|
1130
|
-
const d =
|
|
1160
|
+
const d = xt(l);
|
|
1131
1161
|
if (d)
|
|
1132
1162
|
return n === "between" ? `${s}: ${d}` : `${s} not in ${d}`;
|
|
1133
1163
|
}
|
|
@@ -1144,7 +1174,7 @@ function $e(e, t = {}) {
|
|
|
1144
1174
|
minute: "2-digit"
|
|
1145
1175
|
} : {}
|
|
1146
1176
|
};
|
|
1147
|
-
if (typeof d == "string" &&
|
|
1177
|
+
if (typeof d == "string" && wr.test(d)) {
|
|
1148
1178
|
const [u, a, m] = d.split("-").map(Number);
|
|
1149
1179
|
return new Intl.DateTimeFormat(void 0, {
|
|
1150
1180
|
year: "numeric",
|
|
@@ -1153,22 +1183,22 @@ function $e(e, t = {}) {
|
|
|
1153
1183
|
timeZone: "UTC"
|
|
1154
1184
|
}).format(new Date(Date.UTC(u, a - 1, m)));
|
|
1155
1185
|
}
|
|
1156
|
-
if (typeof d == "string" &&
|
|
1157
|
-
const [u, a, m,
|
|
1186
|
+
if (typeof d == "string" && Tt(d) === "wall_datetime") {
|
|
1187
|
+
const [u, a, m, b, p] = d.split(/[-T :.]/).map(Number);
|
|
1158
1188
|
return new Intl.DateTimeFormat(void 0, {
|
|
1159
1189
|
...w,
|
|
1160
1190
|
timeZone: "UTC"
|
|
1161
|
-
}).format(new Date(Date.UTC(u, a - 1, m,
|
|
1191
|
+
}).format(new Date(Date.UTC(u, a - 1, m, b, p)));
|
|
1162
1192
|
}
|
|
1163
|
-
const
|
|
1164
|
-
if (!isNaN(
|
|
1193
|
+
const _ = new Date(d);
|
|
1194
|
+
if (!isNaN(_.getTime()))
|
|
1165
1195
|
try {
|
|
1166
1196
|
return new Intl.DateTimeFormat(void 0, {
|
|
1167
1197
|
...w,
|
|
1168
1198
|
...t.timezone ? { timeZone: t.timezone } : {}
|
|
1169
|
-
}).format(
|
|
1199
|
+
}).format(_);
|
|
1170
1200
|
} catch {
|
|
1171
|
-
return y ?
|
|
1201
|
+
return y ? _.toLocaleString(void 0, w) : _.toLocaleDateString(void 0, w);
|
|
1172
1202
|
}
|
|
1173
1203
|
}
|
|
1174
1204
|
return String(d);
|
|
@@ -1192,18 +1222,18 @@ function $e(e, t = {}) {
|
|
|
1192
1222
|
return n === "between" ? `${s}: ${d}` : `${s} not in ${d}`;
|
|
1193
1223
|
}
|
|
1194
1224
|
case "in":
|
|
1195
|
-
return o.length === 1 ? `${s}: ${f(o[0])}` : `${s}: ${
|
|
1225
|
+
return o.length === 1 ? `${s}: ${f(o[0])}` : `${s}: ${ae(o, f)}`;
|
|
1196
1226
|
case "not in":
|
|
1197
|
-
return `${s} not in (${
|
|
1227
|
+
return `${s} not in (${ae(o, f)})`;
|
|
1198
1228
|
case "like":
|
|
1199
1229
|
return `${s} contains "${o[0]}"`;
|
|
1200
1230
|
case "not like":
|
|
1201
1231
|
return `${s} doesn't contain "${o[0]}"`;
|
|
1202
1232
|
default:
|
|
1203
|
-
return `${s}: ${
|
|
1233
|
+
return `${s}: ${ae(o, f)}`;
|
|
1204
1234
|
}
|
|
1205
1235
|
}
|
|
1206
|
-
function
|
|
1236
|
+
function sn(e, t = {}) {
|
|
1207
1237
|
if (!e || e.length === 0)
|
|
1208
1238
|
return "";
|
|
1209
1239
|
const r = /* @__PURE__ */ new Map();
|
|
@@ -1214,46 +1244,46 @@ function tn(e, t = {}) {
|
|
|
1214
1244
|
const n = [];
|
|
1215
1245
|
return r.forEach((o, c) => {
|
|
1216
1246
|
if (o.length === 1) {
|
|
1217
|
-
const s =
|
|
1247
|
+
const s = Ie(o[0], t);
|
|
1218
1248
|
s && n.push(s);
|
|
1219
1249
|
} else {
|
|
1220
|
-
const s =
|
|
1250
|
+
const s = Xe(c), l = o.map((f) => Ie(f, t).replace(`${s}: `, "").replace(`${s} `, "")).filter(Boolean);
|
|
1221
1251
|
l.length > 0 && n.push(`${s}: ${l.join(" and ")}`);
|
|
1222
1252
|
}
|
|
1223
1253
|
}), n.join(" | ");
|
|
1224
1254
|
}
|
|
1225
|
-
function
|
|
1226
|
-
return ((e == null ? void 0 : e.filterValues) ?? []).filter(
|
|
1255
|
+
function cn(e) {
|
|
1256
|
+
return ((e == null ? void 0 : e.filterValues) ?? []).filter(_r).map(xr);
|
|
1227
1257
|
}
|
|
1228
|
-
function
|
|
1258
|
+
function _r(e) {
|
|
1229
1259
|
return !!e && typeof e == "object" && typeof e.name == "string" && Array.isArray(e.values);
|
|
1230
1260
|
}
|
|
1231
|
-
function
|
|
1261
|
+
function xr(e) {
|
|
1232
1262
|
if (!("relativeMeta" in e) || e.relativeMeta === void 0) return e;
|
|
1233
|
-
const { relativeMeta: t, ...r } = e, n =
|
|
1263
|
+
const { relativeMeta: t, ...r } = e, n = ie(t);
|
|
1234
1264
|
return n ? { ...r, relativeMeta: n } : r;
|
|
1235
1265
|
}
|
|
1236
|
-
const
|
|
1266
|
+
const Tr = /* @__PURE__ */ new Set([
|
|
1237
1267
|
"day",
|
|
1238
1268
|
"week",
|
|
1239
1269
|
"month",
|
|
1240
1270
|
"quarter",
|
|
1241
1271
|
"year"
|
|
1242
1272
|
]);
|
|
1243
|
-
function
|
|
1273
|
+
function Er(e, t) {
|
|
1244
1274
|
try {
|
|
1245
|
-
const r =
|
|
1246
|
-
|
|
1275
|
+
const r = A(
|
|
1276
|
+
U(e),
|
|
1247
1277
|
t,
|
|
1248
1278
|
"yyyy-MM-dd"
|
|
1249
1279
|
), [n, o, c] = r.split("-").map(Number), s = new Date(Date.UTC(n, o - 1, c));
|
|
1250
|
-
return s.setUTCDate(s.getUTCDate() - 1),
|
|
1280
|
+
return s.setUTCDate(s.getUTCDate() - 1), A(s, "UTC", "yyyy-MM-dd");
|
|
1251
1281
|
} catch {
|
|
1252
1282
|
return;
|
|
1253
1283
|
}
|
|
1254
1284
|
}
|
|
1255
|
-
function
|
|
1256
|
-
const o =
|
|
1285
|
+
function ln(e, t, r, n = !1) {
|
|
1286
|
+
const o = $r(
|
|
1257
1287
|
e,
|
|
1258
1288
|
t,
|
|
1259
1289
|
r,
|
|
@@ -1261,20 +1291,20 @@ function nn(e, t, r, n = !1) {
|
|
|
1261
1291
|
);
|
|
1262
1292
|
return `${o.start} - ${o.end}`;
|
|
1263
1293
|
}
|
|
1264
|
-
function
|
|
1294
|
+
function $r(e, t, r, n = !1) {
|
|
1265
1295
|
try {
|
|
1266
|
-
if (r &&
|
|
1267
|
-
const o =
|
|
1296
|
+
if (r && Tr.has(r)) {
|
|
1297
|
+
const o = Er(e.end, t);
|
|
1268
1298
|
if (o) {
|
|
1269
1299
|
const c = n ? "MMM d" : "MMM d, yyyy";
|
|
1270
1300
|
return {
|
|
1271
|
-
start:
|
|
1272
|
-
|
|
1301
|
+
start: A(
|
|
1302
|
+
U(e.start),
|
|
1273
1303
|
t,
|
|
1274
1304
|
c
|
|
1275
1305
|
),
|
|
1276
|
-
end:
|
|
1277
|
-
|
|
1306
|
+
end: A(
|
|
1307
|
+
U(`${o}T00:00:00Z`),
|
|
1278
1308
|
"UTC",
|
|
1279
1309
|
"MMM d, yyyy"
|
|
1280
1310
|
)
|
|
@@ -1284,9 +1314,9 @@ function Cr(e, t, r, n = !1) {
|
|
|
1284
1314
|
if (r === "second" || r === "minute" || r === "hour") {
|
|
1285
1315
|
const o = n ? "MMM d, h:mm a" : "MMM d, yyyy, h:mm a";
|
|
1286
1316
|
return {
|
|
1287
|
-
start:
|
|
1288
|
-
end: `before ${
|
|
1289
|
-
|
|
1317
|
+
start: A(U(e.start), t, o),
|
|
1318
|
+
end: `before ${A(
|
|
1319
|
+
U(e.end),
|
|
1290
1320
|
t,
|
|
1291
1321
|
o
|
|
1292
1322
|
)}`
|
|
@@ -1297,47 +1327,49 @@ function Cr(e, t, r, n = !1) {
|
|
|
1297
1327
|
return { start: e.start, end: `before ${e.end}` };
|
|
1298
1328
|
}
|
|
1299
1329
|
export {
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
Or as
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1330
|
+
Qt as A,
|
|
1331
|
+
Qr as B,
|
|
1332
|
+
ar as C,
|
|
1333
|
+
Oe as D,
|
|
1334
|
+
en as E,
|
|
1335
|
+
Ut as F,
|
|
1336
|
+
tn as G,
|
|
1337
|
+
nn as H,
|
|
1338
|
+
on as I,
|
|
1339
|
+
an as J,
|
|
1340
|
+
rn as K,
|
|
1341
|
+
Pe as L,
|
|
1342
|
+
jr as M,
|
|
1343
|
+
Cr as N,
|
|
1344
|
+
Ie as O,
|
|
1345
|
+
zt as P,
|
|
1346
|
+
sn as Q,
|
|
1347
|
+
cn as R,
|
|
1348
|
+
$r as S,
|
|
1349
|
+
Or as a,
|
|
1350
|
+
Kr as b,
|
|
1351
|
+
Vr as c,
|
|
1352
|
+
Br as d,
|
|
1353
|
+
Ur as e,
|
|
1354
|
+
ln as f,
|
|
1355
|
+
Xr as g,
|
|
1356
|
+
Gr as h,
|
|
1357
|
+
qr as i,
|
|
1358
|
+
qt as j,
|
|
1359
|
+
Wr as k,
|
|
1360
|
+
zr as l,
|
|
1361
|
+
Gt as m,
|
|
1362
|
+
Hr as n,
|
|
1363
|
+
jt as o,
|
|
1364
|
+
Ht as p,
|
|
1365
|
+
Vt as q,
|
|
1366
|
+
Ce as r,
|
|
1367
|
+
Xt as s,
|
|
1368
|
+
X as t,
|
|
1369
|
+
Yr as u,
|
|
1370
|
+
Yt as v,
|
|
1371
|
+
Zt as w,
|
|
1372
|
+
Jt as x,
|
|
1373
|
+
Zr as y,
|
|
1374
|
+
Jr as z
|
|
1343
1375
|
};
|