react-semaphor 0.1.600 → 0.1.601
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.js +9 -9
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +7 -7
- package/dist/briefings/index.js +48 -45
- package/dist/chunks/{assistant-chat-BULOkG9j.js → assistant-chat-BE0XXzZP.js} +12 -12
- package/dist/chunks/{bookmark-impact-kdvXke8n.js → bookmark-impact-DXDAN5AY.js} +3 -3
- package/dist/chunks/{bookmark-state-h1OLXVjE.js → bookmark-state-BMyB3Tb6.js} +4 -4
- package/dist/chunks/{card-filter-builder-CSCdSQQy.js → card-filter-builder-CE0-YVN5.js} +9 -9
- package/dist/chunks/comparison-window-caption-Dxj2CHOa.js +741 -0
- package/dist/chunks/{dashboard-briefing-launcher-9YwUclHA.js → dashboard-briefing-launcher-CntwKyiZ.js} +13 -13
- package/dist/chunks/{dashboard-controls-O6PNXMCp.js → dashboard-controls-XO089DMg.js} +15 -15
- package/dist/chunks/{dashboard-json-Bxf91TYq.js → dashboard-json-CQRiydUv.js} +4 -4
- package/dist/chunks/{dashboard-y9ON19ge.js → dashboard-mJKPFRbb.js} +1 -1
- package/dist/chunks/{dates-DPTbpNxK.js → dates-B-Urp5OD.js} +8 -8
- package/dist/chunks/{edit-dashboard-visual-CKwaW8H_.js → edit-dashboard-visual-f-Dm-BLR.js} +176 -176
- package/dist/chunks/filter-line-CKNMyNTQ.js +703 -0
- package/dist/chunks/{filter-reach-copy-ClzNcNhP.js → filter-reach-copy-B8GGyVuR.js} +1441 -1270
- package/dist/chunks/{filter-value-text-CXyuLW9Q.js → filter-value-text-CRtKecI5.js} +6 -6
- package/dist/chunks/{index-CRo5--Y6.js → index-DoPApnxg.js} +386 -360
- package/dist/chunks/{layout-grid-DSrBSfPM.js → layout-grid-CiSCZdIr.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-i9PQY066.js → matrix-analytical-definition-myf3D3Qx.js} +35 -35
- package/dist/chunks/{matrix-member-presentation-B_2beBc0.js → matrix-member-presentation-g0c_NpDW.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-DdK0J_KU.js → matrix-operation-contract-C1SuOHLZ.js} +35 -35
- package/dist/chunks/{metric-comparison-Bhz0V841.js → metric-comparison-Cm0G893W.js} +3 -3
- package/dist/chunks/{paintbrush-1UiU-uTz.js → paintbrush-DQIwqlck.js} +1 -1
- package/dist/chunks/{palette-DFIFf_-m.js → palette-Cun747Rg.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-Dk7WFR_u.js → pivot-result-contract-expectations-C1Dyx8du.js} +17 -17
- package/dist/chunks/{pivot-result-identity-CzzrJpEm.js → pivot-result-identity-CBS-ssEp.js} +1 -1
- package/dist/chunks/{raw-temporal-value-BLvdaMng.js → raw-temporal-value-DN_l-Tss.js} +16 -16
- package/dist/chunks/{report-preferences-dialog-DiDsYpng.js → report-preferences-dialog-SDZEcG2x.js} +13 -13
- package/dist/chunks/{report-runtime-context-CEGluufW.js → report-runtime-context-BbedQdtc.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-BAv33KGg.js → resolve-dashboard-input-context-DRBS0eRa.js} +553 -553
- package/dist/chunks/{save-CWQ02kHo.js → save-Dj5bjm7P.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-CvzYqADe.js → saved-dashboard-context-DWVlJcsa.js} +15 -15
- package/dist/chunks/{selection-filter-compiler-SwrBvyyJ.js → selection-filter-compiler-DmAr7yqC.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-1PRI9Yh2.js → semaphor-ready-indicator-OFOoAY-A.js} +16370 -16518
- package/dist/chunks/{shelf-drop-preview-context-BLk5Nc6K.js → shelf-drop-preview-context-2swWypXu.js} +5 -5
- package/dist/chunks/{stored-dashboard-xhYYKBsO.js → stored-dashboard-NtOuEX6a.js} +111 -111
- package/dist/chunks/{style-sheet-parts-BX7d7-2-.js → style-sheet-parts-Qv4UcLAo.js} +2 -2
- package/dist/chunks/{table-export-sheet-BWSVTclx.js → table-export-sheet-Do7ZB0_F.js} +1 -1
- package/dist/chunks/{token-types-CnlEiAdS.js → token-types-Dy_aXO-U.js} +1 -1
- package/dist/chunks/{upload-DsqUSS8l.js → upload-Bq-puSVy.js} +1 -1
- package/dist/chunks/{validators-D2Hm57lJ.js → validators-C7DFk3QK.js} +78 -78
- package/dist/chunks/{variable-draft-DcKj8T1b.js → variable-draft-Cy03qnEi.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +80 -75
- package/dist/format-utils/index.js +238 -237
- package/dist/index.js +18 -18
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/briefings/attachments.d.ts +45 -4
- package/dist/types/briefings/index.d.ts +1 -1
- package/dist/types/index.js +5 -5
- package/dist/types/lib/export-utils.d.ts +72 -0
- package/dist/types/lib/formatters/dashboard-temporal-presentation.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-data-file.d.ts +31 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +3 -0
- package/package.json +1 -1
- package/dist/chunks/comparison-window-caption-DJDwP9XO.js +0 -1309
- package/dist/chunks/filter-line-Dkg3yuOX.js +0 -134
|
@@ -0,0 +1,741 @@
|
|
|
1
|
+
import { aH as Q, i as ee, j as T, m as te, S as V, aI as R, aJ as X, aK as re, aL as G, aM as H, am as ne, ao as oe, aN as w, aO as $ } from "./pivot-result-contract-expectations-C1Dyx8du.js";
|
|
2
|
+
import { h as S } from "./export-file-format-C-tJsxsf.js";
|
|
3
|
+
import { a6 as ae, aX as q, m as E, k as se } from "./validators-C7DFk3QK.js";
|
|
4
|
+
import "./matrix-operation-contract-C1SuOHLZ.js";
|
|
5
|
+
import "./analytics-base-schemas-DevrgqQb.js";
|
|
6
|
+
import { readPdfCapacityFacts as ie, PDF_SAFETY_LIMIT_EXCEEDED as O, PDF_CAPACITY as v, PDF_NUMBER_COLUMN_TOO_WIDE as K, getUtf8ByteLength as ue, FAST_PDF_POLICY as le, isPdfCapacityRefusalCode as ce } from "../pdf-export-policy/index.js";
|
|
7
|
+
import { w as me } from "./raw-temporal-value-DN_l-Tss.js";
|
|
8
|
+
function de(e, t, r) {
|
|
9
|
+
const n = {
|
|
10
|
+
...t,
|
|
11
|
+
locale: t.locale ?? r
|
|
12
|
+
};
|
|
13
|
+
if (n.type === "number")
|
|
14
|
+
return T(e, n);
|
|
15
|
+
const { prefix: o, suffix: a, ...s } = n;
|
|
16
|
+
return `${o ?? ""}${T(e, {
|
|
17
|
+
...s,
|
|
18
|
+
negativeStyle: n.type === "currency" ? n.negativeStyle : "minus"
|
|
19
|
+
})}${a ?? ""}`;
|
|
20
|
+
}
|
|
21
|
+
function I(e, t, r) {
|
|
22
|
+
return e === null ? { value: e, text: null } : !t || !ee(t) && t.type !== "duration" ? {
|
|
23
|
+
value: e,
|
|
24
|
+
text: T(e, { type: "number", locale: r })
|
|
25
|
+
} : t.type === "duration" ? {
|
|
26
|
+
value: e,
|
|
27
|
+
text: te(e, {
|
|
28
|
+
inputUnit: t.inputUnit,
|
|
29
|
+
outputStyle: t.outputStyle,
|
|
30
|
+
largestUnit: t.largestUnit,
|
|
31
|
+
smallestUnit: t.smallestUnit,
|
|
32
|
+
maxUnits: t.maxUnits,
|
|
33
|
+
prefix: t.prefix,
|
|
34
|
+
suffix: t.suffix,
|
|
35
|
+
negativeInParentheses: t.negativeStyle === "parentheses"
|
|
36
|
+
})
|
|
37
|
+
} : { value: e, text: de(e, t, r) };
|
|
38
|
+
}
|
|
39
|
+
function U(e, t, r, n) {
|
|
40
|
+
return e === null ? { value: e, text: null } : n === "percent" ? {
|
|
41
|
+
value: e,
|
|
42
|
+
text: T(e, {
|
|
43
|
+
type: "percent",
|
|
44
|
+
locale: r,
|
|
45
|
+
minimumFractionDigits: t,
|
|
46
|
+
maximumFractionDigits: t,
|
|
47
|
+
percentValueMode: "fraction"
|
|
48
|
+
})
|
|
49
|
+
} : {
|
|
50
|
+
value: e,
|
|
51
|
+
text: T(e, {
|
|
52
|
+
type: "number",
|
|
53
|
+
locale: r,
|
|
54
|
+
minimumFractionDigits: t,
|
|
55
|
+
maximumFractionDigits: t,
|
|
56
|
+
suffix: "×"
|
|
57
|
+
})
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function j(e, t) {
|
|
61
|
+
if (e === void 0) return t;
|
|
62
|
+
if (!Number.isInteger(e) || e < 0 || e > 6)
|
|
63
|
+
throw new RangeError("Comparison precision must be an integer from 0 to 6.");
|
|
64
|
+
return e;
|
|
65
|
+
}
|
|
66
|
+
function qe(e, t) {
|
|
67
|
+
const r = {
|
|
68
|
+
mode: t.displayMode,
|
|
69
|
+
current: I(
|
|
70
|
+
e.currentValue,
|
|
71
|
+
t.metricFormat,
|
|
72
|
+
t.locale
|
|
73
|
+
),
|
|
74
|
+
comparison: I(
|
|
75
|
+
e.comparisonValue,
|
|
76
|
+
t.metricFormat,
|
|
77
|
+
t.locale
|
|
78
|
+
)
|
|
79
|
+
};
|
|
80
|
+
return (t.displayMode === "difference" || t.displayMode === "both") && (r.difference = I(
|
|
81
|
+
e.delta,
|
|
82
|
+
Q(t.metricFormat),
|
|
83
|
+
t.locale
|
|
84
|
+
)), (t.displayMode === "percent_change" || t.displayMode === "both") && (r.percentChange = U(
|
|
85
|
+
e.percentChange,
|
|
86
|
+
j(t.precision, 1),
|
|
87
|
+
t.locale,
|
|
88
|
+
"percent"
|
|
89
|
+
)), t.displayMode === "ratio" && (r.ratio = U(
|
|
90
|
+
e.ratio,
|
|
91
|
+
j(t.precision, 2),
|
|
92
|
+
t.locale,
|
|
93
|
+
"ratio"
|
|
94
|
+
)), r;
|
|
95
|
+
}
|
|
96
|
+
const Ke = {
|
|
97
|
+
rowLabels: "tabular",
|
|
98
|
+
subtotals: "after"
|
|
99
|
+
};
|
|
100
|
+
function We(e, t) {
|
|
101
|
+
const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, n = e.totals.rows;
|
|
102
|
+
return {
|
|
103
|
+
...e,
|
|
104
|
+
layout: r,
|
|
105
|
+
totals: {
|
|
106
|
+
...e.totals,
|
|
107
|
+
rows: {
|
|
108
|
+
...n,
|
|
109
|
+
levels: Object.fromEntries(
|
|
110
|
+
Object.entries(n.levels).map(([o, a]) => [
|
|
111
|
+
o,
|
|
112
|
+
{ ...a, position: t.subtotals }
|
|
113
|
+
])
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const fe = 2;
|
|
120
|
+
function he(e) {
|
|
121
|
+
return typeof e == "number" ? Number.isInteger(e) : q(e) ? !e.value.includes(".") : !0;
|
|
122
|
+
}
|
|
123
|
+
function pe(e, t, r) {
|
|
124
|
+
const n = e.descriptors.measures.filter(
|
|
125
|
+
(s) => r.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 && ae(s.column.dataType) === "number"
|
|
126
|
+
);
|
|
127
|
+
if (n.length === 0) return r;
|
|
128
|
+
const o = /* @__PURE__ */ new Set();
|
|
129
|
+
e.columns.forEach((s, u) => {
|
|
130
|
+
if (!(s.kind !== "measure" || o.has(s.measureId)))
|
|
131
|
+
for (const m of t) {
|
|
132
|
+
const l = m.values[u];
|
|
133
|
+
if ((l == null ? void 0 : l.kind) === "value" && !he(l.value)) {
|
|
134
|
+
o.add(s.measureId);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
const a = { ...r.measureFormats };
|
|
140
|
+
for (const { id: s } of n) {
|
|
141
|
+
const u = o.has(s) ? fe : 0;
|
|
142
|
+
a[s] = {
|
|
143
|
+
type: "number",
|
|
144
|
+
minimumFractionDigits: u,
|
|
145
|
+
maximumFractionDigits: u,
|
|
146
|
+
useGrouping: !0
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
return { ...r, measureFormats: a };
|
|
150
|
+
}
|
|
151
|
+
function L(e) {
|
|
152
|
+
return E(e.slice(0, -1));
|
|
153
|
+
}
|
|
154
|
+
function ge(e, t) {
|
|
155
|
+
return t.length > e.length && E(t.slice(0, e.length)) === E(e);
|
|
156
|
+
}
|
|
157
|
+
function ye(e) {
|
|
158
|
+
return e.map((t, r) => {
|
|
159
|
+
if (r === 0 || t.kind !== "layout") return !1;
|
|
160
|
+
const n = e[r - 1];
|
|
161
|
+
if (n.kind !== "layout") return !1;
|
|
162
|
+
if (t.role !== "member" || ge(n.rowPath, t.rowPath)) return !0;
|
|
163
|
+
const o = e[r - 2];
|
|
164
|
+
return n.role === "member" && (!o || o.kind !== "layout" || o.role !== "member" || L(o.rowPath) !== L(n.rowPath)) && t.rowPath.length === n.rowPath.length && L(t.rowPath) === L(n.rowPath);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
const we = "pdf-group-continuation";
|
|
168
|
+
function W(e, t, r) {
|
|
169
|
+
return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || q(t.value)) ? e : S(e);
|
|
170
|
+
}
|
|
171
|
+
function be(e, t, r) {
|
|
172
|
+
const n = V(e.descriptors, t.presentation, r), o = e.columns.map((i) => {
|
|
173
|
+
var c;
|
|
174
|
+
return i.kind === "measure" && ((c = n.measureSemantics.get(i.measureId)) == null ? void 0 : c.isNumeric) === !0;
|
|
175
|
+
}), a = (i) => R([i], n.levels), s = (i, c, d) => X(i, c, t.presentation.totals[d], n.levels), u = e.columns.map((i) => {
|
|
176
|
+
if (i.kind !== "measure") return i.label;
|
|
177
|
+
const c = i.columnPath.map(a);
|
|
178
|
+
return i.role !== "member" && c.push(s(i.columnPath, i.role, "columns")), [...c, i.label].join(" / ");
|
|
179
|
+
}), m = Math.min(t.spec.columns.length, Math.max(
|
|
180
|
+
0,
|
|
181
|
+
...e.columns.map((i) => i.kind === "measure" ? i.columnPath.length + (i.role !== "member" ? 1 : 0) : 0)
|
|
182
|
+
)), l = Array.from({ length: m + 1 }, (i, c) => e.columns.map((d) => c === m ? d.label : d.kind !== "measure" ? "" : c < d.columnPath.length ? a(d.columnPath[c]) : c === d.columnPath.length && d.role !== "member" ? s(d.columnPath, d.role, "columns") : "")), f = (i, c) => re({
|
|
183
|
+
path: i.rowPath,
|
|
184
|
+
role: i.kind === "layout" ? i.role : "member",
|
|
185
|
+
levelCount: Math.max(1, t.spec.rows.length),
|
|
186
|
+
repeatLabels: t.presentation.layout.kind !== "tabular" || t.presentation.layout.repeatLabels,
|
|
187
|
+
previousPath: c == null ? void 0 : c.rowPath
|
|
188
|
+
}), P = (i, c) => {
|
|
189
|
+
if (i.kind !== "layout") throw new Error("Layout presentation requires layout rows.");
|
|
190
|
+
if (i.values.length !== e.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
191
|
+
const d = f(i, c);
|
|
192
|
+
return e.columns.map((h, p) => {
|
|
193
|
+
if (h.kind === "hierarchy")
|
|
194
|
+
return `${" ".repeat(Math.max(0, i.rowPath.length - 1))}${s(i.rowPath, i.role, "rows")}`;
|
|
195
|
+
if (h.kind === "level") {
|
|
196
|
+
const D = t.spec.rows.findIndex((J) => J.id === h.levelId), b = d[D];
|
|
197
|
+
return b != null && b.visible ? b.total ? s(i.rowPath, i.role, "rows") : R(b.path, n.levels) : "";
|
|
198
|
+
}
|
|
199
|
+
const C = i.values[p], x = n.measures.get(h.measureId);
|
|
200
|
+
if (C.kind === "value" && !x)
|
|
201
|
+
throw new Error("Matrix value is missing its measure descriptor.");
|
|
202
|
+
return G(C, x, t.presentation.absence);
|
|
203
|
+
});
|
|
204
|
+
}, _ = (i, c) => P(i, c).map((d, h) => {
|
|
205
|
+
const p = e.columns[h];
|
|
206
|
+
return p.kind === "measure" ? W(d, i.values[h], n.measureSemantics.get(p.measureId)) : S(d);
|
|
207
|
+
});
|
|
208
|
+
return {
|
|
209
|
+
headers: u,
|
|
210
|
+
headerBands: l,
|
|
211
|
+
numericColumns: o,
|
|
212
|
+
/** The card's prepared formats this presentation formats with (the Excel form reads its measure formats). */
|
|
213
|
+
formatting: n,
|
|
214
|
+
/** A row's cells; after `previous`, a tabular layout prints each label once. */
|
|
215
|
+
row: (i, c) => P(i, c),
|
|
216
|
+
/**
|
|
217
|
+
* Level columns whose group label the row above shows, so this row
|
|
218
|
+
* continues the group (Plan 2, 2d, C8). Only a member row after a member
|
|
219
|
+
* row continues one: a total prints as a band, and its rules stay whole
|
|
220
|
+
* above and below it.
|
|
221
|
+
*/
|
|
222
|
+
continuedColumns: (i, c) => {
|
|
223
|
+
const d = (p) => (p == null ? void 0 : p.kind) === "layout" && p.role === "member";
|
|
224
|
+
if (!d(i) || !d(c)) return [];
|
|
225
|
+
const h = f(i, c);
|
|
226
|
+
return e.columns.flatMap((p, C) => {
|
|
227
|
+
var D;
|
|
228
|
+
if (p.kind !== "level") return [];
|
|
229
|
+
const x = t.spec.rows.findIndex((b) => b.id === p.levelId);
|
|
230
|
+
return x < i.rowPath.length && ((D = h[x]) == null ? void 0 : D.visible) === !1 ? [C] : [];
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
csvRow: (i) => _(i),
|
|
234
|
+
/**
|
|
235
|
+
* `previousRow` is the row before `data[0]`, carried by the export's
|
|
236
|
+
* continuation, so a tabular layout prints each label once across the
|
|
237
|
+
* whole file. Retries are pure: suppression never relies on mutable
|
|
238
|
+
* formatter state or an earlier worker. Without it, the first row prints
|
|
239
|
+
* its labels.
|
|
240
|
+
*/
|
|
241
|
+
csvRows: (i, c) => i.map((d, h) => _(d, h ? i[h - 1] : c ?? void 0))
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
function Ye(e) {
|
|
245
|
+
return e.columns.map((t) => S(t.label));
|
|
246
|
+
}
|
|
247
|
+
function Ze(e, t, r) {
|
|
248
|
+
return _e(e, t, r).map((n, o) => {
|
|
249
|
+
const a = t.columns[o];
|
|
250
|
+
return a.kind === "measure" ? W(n, e.values[o], r.measureSemantics.get(a.measureId)) : S(n);
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
function _e(e, t, r) {
|
|
254
|
+
if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
|
|
255
|
+
if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
256
|
+
const n = [...e.rowPath, ...e.columnPath];
|
|
257
|
+
return t.columns.map((o, a) => {
|
|
258
|
+
if (o.kind === "measure") {
|
|
259
|
+
const u = e.values[a], m = r.measures.get(o.measureId);
|
|
260
|
+
if (u.kind === "value" && !m) throw new Error("Matrix value is missing its measure descriptor.");
|
|
261
|
+
return G(u, m, r.absence);
|
|
262
|
+
}
|
|
263
|
+
const s = o.kind === "level" ? n.find((u) => u.levelId === o.levelId) : void 0;
|
|
264
|
+
if (!s) throw new Error("Flat Matrix row does not match its frozen layout.");
|
|
265
|
+
return R([s], r.levels);
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
function ve(e) {
|
|
269
|
+
const t = be(e.layout, e.request, e.report), r = e.layout.columns.map((s, u) => ({
|
|
270
|
+
index: u,
|
|
271
|
+
columnId: `matrix:${u}`,
|
|
272
|
+
label: t.headers[u],
|
|
273
|
+
isNumeric: t.numericColumns[u]
|
|
274
|
+
})), n = (s, u, m) => ({
|
|
275
|
+
text: s,
|
|
276
|
+
colspan: 1,
|
|
277
|
+
rowspan: 1,
|
|
278
|
+
columnId: r[u].columnId,
|
|
279
|
+
isHeader: m,
|
|
280
|
+
isNumeric: r[u].isNumeric,
|
|
281
|
+
className: r[u].isNumeric ? "numeric" : e.layout.columns[u].kind === "hierarchy" ? "matrix-hierarchy" : ""
|
|
282
|
+
}), o = [], a = e.layout.columns.findIndex((s) => s.kind === "measure");
|
|
283
|
+
e.request.spec.columns.length && a >= 0 && o.push({
|
|
284
|
+
repeatHeader: !0,
|
|
285
|
+
headerType: "pivot-axis",
|
|
286
|
+
headerRowIndex: 0,
|
|
287
|
+
cells: [
|
|
288
|
+
...a ? [{ ...n("", 0, !0), colspan: a }] : [],
|
|
289
|
+
{
|
|
290
|
+
...n(e.request.spec.columns.map((s) => H(s, e.request.presentation)).join(" / "), a, !0),
|
|
291
|
+
colspan: e.layout.columns.length - a,
|
|
292
|
+
isNumeric: !1,
|
|
293
|
+
className: ""
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
});
|
|
297
|
+
for (const [s, u] of t.headerBands.entries())
|
|
298
|
+
o.push({
|
|
299
|
+
repeatHeader: !0,
|
|
300
|
+
headerType: s === t.headerBands.length - 1 ? "metrics" : "pivot-level",
|
|
301
|
+
headerRowIndex: o.length,
|
|
302
|
+
cells: u.map((m, l) => n(m, l, !0))
|
|
303
|
+
});
|
|
304
|
+
return {
|
|
305
|
+
headers: o,
|
|
306
|
+
rows: e.rows.map((s, u) => {
|
|
307
|
+
const m = new Set(t.continuedColumns(s, e.rows[u - 1]));
|
|
308
|
+
return {
|
|
309
|
+
index: u,
|
|
310
|
+
type: s.kind === "layout" && s.role !== "member" ? "subtotal" : "data",
|
|
311
|
+
subtotalLevel: String(s.rowPath.length),
|
|
312
|
+
// A tabular layout prints each label once unless it repeats them; the
|
|
313
|
+
// blank cell continues its group, so a grid draws no rule above it.
|
|
314
|
+
cells: t.row(s, e.rows[u - 1]).map((l, f) => m.has(f) ? { ...n(l, f, !1), className: we } : n(l, f, !1))
|
|
315
|
+
};
|
|
316
|
+
}),
|
|
317
|
+
grandTotal: null,
|
|
318
|
+
// Totals are already in the ordered body at their authored position.
|
|
319
|
+
metadata: {
|
|
320
|
+
tableType: "pivot",
|
|
321
|
+
totalRows: e.rows.length,
|
|
322
|
+
totalColumns: r.length,
|
|
323
|
+
rowLevels: e.layout.columns.filter((s) => s.kind !== "measure").length,
|
|
324
|
+
pivotLevels: e.request.spec.columns.length,
|
|
325
|
+
hasGrandTotal: !1,
|
|
326
|
+
columnOrder: r.map((s) => s.columnId),
|
|
327
|
+
columns: r
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
function Pe(e, t, r) {
|
|
332
|
+
const { levels: n } = V(e.descriptors, t.presentation, r), o = t.spec.columns.length > 0, a = [], s = [], u = e.columns.map((l, f) => {
|
|
333
|
+
if (l.kind !== "measure") return null;
|
|
334
|
+
const P = o ? `${l.role}:${E(l.columnPath)}` : `measure:${f}`;
|
|
335
|
+
let _ = a.indexOf(P);
|
|
336
|
+
return _ < 0 && (_ = a.push(P) - 1, s.push(o ? X(l.columnPath, l.role, t.presentation.totals.columns, n) : l.label)), _;
|
|
337
|
+
}), m = t.spec.columns[t.spec.columns.length - 1];
|
|
338
|
+
return {
|
|
339
|
+
columnGroups: u,
|
|
340
|
+
groupLabels: s,
|
|
341
|
+
/** What bands name their groups by: the innermost column level, or "Measures". */
|
|
342
|
+
groupLevelLabel: m ? H(m, t.presentation) : "Measures"
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
function ze(e) {
|
|
346
|
+
const { layout: t, rows: r, report: n } = e, o = {
|
|
347
|
+
...e.request,
|
|
348
|
+
presentation: pe(t, r, e.request.presentation)
|
|
349
|
+
}, a = ve({ layout: t, rows: r, request: o, report: n }), s = ye(r), u = Pe(t, o, n), m = {
|
|
350
|
+
...a,
|
|
351
|
+
rows: a.rows.map((l, f) => ({ ...l, keepWithPrevious: s[f] })),
|
|
352
|
+
metadata: { ...a.metadata, ...u }
|
|
353
|
+
};
|
|
354
|
+
return { request: o, table: m, ...u };
|
|
355
|
+
}
|
|
356
|
+
const y = (e) => e.toLocaleString("en-US"), M = (e) => `${y(Math.ceil(e / 1048576))} MB`, F = "export the data as CSV or Excel";
|
|
357
|
+
function Je(e) {
|
|
358
|
+
const t = ie(e.facts), r = e.dataExport ? `Add a filter to narrow it, or ${F}.` : "Add a filter to narrow it, then export again.";
|
|
359
|
+
switch (e.code) {
|
|
360
|
+
case "PDF_ROW_LIMIT_EXCEEDED": {
|
|
361
|
+
const n = e.subject ?? "This table", o = t.rowLimit ?? v.maxTableRows;
|
|
362
|
+
return t.rowCount !== void 0 ? `${n} has ${y(t.rowCount)} rows. A PDF holds up to ${y(o)} rows per table. ${r}` : `${n} has more than ${y(o)} rows, the most a PDF holds per table. ${r}`;
|
|
363
|
+
}
|
|
364
|
+
case "PDF_PAGE_LIMIT_EXCEEDED": {
|
|
365
|
+
const n = e.subject ?? "This PDF", o = t.pageLimit ?? v.maxPages;
|
|
366
|
+
return t.pageCount !== void 0 ? `${n} is ${y(t.pageCount)} pages. A PDF holds up to ${y(o)}. ${r}` : `${n} is longer than ${y(o)} pages, the most a PDF holds. ${r}`;
|
|
367
|
+
}
|
|
368
|
+
case "PDF_SIZE_LIMIT_EXCEEDED": {
|
|
369
|
+
const n = e.subject ?? "This PDF", o = t.byteLimit ?? v.maxFileBytes;
|
|
370
|
+
return t.bytes !== void 0 ? `${n} is ${M(t.bytes)}. A PDF file holds up to ${M(o)}. ${r}` : `${n} is larger than ${M(o)}, the most a PDF file holds. ${r}`;
|
|
371
|
+
}
|
|
372
|
+
case "PDF_CAPTURE_TOO_TALL":
|
|
373
|
+
return `${e.subject ?? "This dashboard"} is too long to print as one PDF. Print one sheet or fewer cards${e.dataExport ? `, or ${F}` : ""}.`;
|
|
374
|
+
case K:
|
|
375
|
+
return `A number in this table is too wide for its column in a PDF. Use landscape or fewer columns${e.dataExport ? `, or ${F}` : ""}.`;
|
|
376
|
+
case O:
|
|
377
|
+
return `This PDF is over what a PDF holds: ${y(v.maxTableRows)} rows per table, ${y(
|
|
378
|
+
v.maxPages
|
|
379
|
+
)} pages and ${M(v.maxFileBytes)}. ${r}`;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
class xe extends Error {
|
|
383
|
+
constructor(t, r = O) {
|
|
384
|
+
super(t), this.code = r;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
function Te(e) {
|
|
388
|
+
return ce(e) || e === O || e === K;
|
|
389
|
+
}
|
|
390
|
+
function B(e) {
|
|
391
|
+
if (!e || typeof e != "object")
|
|
392
|
+
return;
|
|
393
|
+
const { error: t, message: r, detail: n } = e;
|
|
394
|
+
for (const o of [t, r, n])
|
|
395
|
+
if (typeof o == "string" && o.trim())
|
|
396
|
+
return o.trim();
|
|
397
|
+
}
|
|
398
|
+
async function $e(e) {
|
|
399
|
+
const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), r = e.headers.get("content-type") || "";
|
|
400
|
+
try {
|
|
401
|
+
if (r.includes("application/json")) {
|
|
402
|
+
const o = await e.json(), a = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
|
|
403
|
+
return { message: B(o) || t, code: a };
|
|
404
|
+
}
|
|
405
|
+
const n = await e.text();
|
|
406
|
+
if (!n.trim())
|
|
407
|
+
return { message: t };
|
|
408
|
+
try {
|
|
409
|
+
const o = JSON.parse(n), a = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
|
|
410
|
+
return {
|
|
411
|
+
message: B(o) || n.trim(),
|
|
412
|
+
code: a
|
|
413
|
+
};
|
|
414
|
+
} catch {
|
|
415
|
+
return { message: n.trim() };
|
|
416
|
+
}
|
|
417
|
+
} catch {
|
|
418
|
+
return { message: t };
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
async function Qe(e) {
|
|
422
|
+
if (!e.token) throw new Error("Missing auth token for PDF export");
|
|
423
|
+
if (ue(e.serializedPayload) > le.maxRequestBytes)
|
|
424
|
+
throw new Error("Fast-path PDF request exceeds the structured body limit");
|
|
425
|
+
const t = await (e.fetchImpl ?? fetch)(e.url, {
|
|
426
|
+
method: "POST",
|
|
427
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${e.token}` },
|
|
428
|
+
body: e.serializedPayload,
|
|
429
|
+
signal: e.signal
|
|
430
|
+
});
|
|
431
|
+
if (!t.ok) {
|
|
432
|
+
const n = await $e(t);
|
|
433
|
+
throw Te(n.code) ? new xe(n.message, n.code) : new Error(n.message);
|
|
434
|
+
}
|
|
435
|
+
const r = await t.json();
|
|
436
|
+
if (r != null && r.error) throw new Error(r.error);
|
|
437
|
+
if (typeof (r == null ? void 0 : r.url) != "string" || !r.url.trim())
|
|
438
|
+
throw new Error("Fast-path PDF response missing download URL");
|
|
439
|
+
return r;
|
|
440
|
+
}
|
|
441
|
+
const et = 1, Y = ["loading", "measuring", "checking", "laidOut"], Ce = [
|
|
442
|
+
// Already emitted before these contracts; names kept.
|
|
443
|
+
"document_matrix_too_large",
|
|
444
|
+
"document_matrix_unavailable",
|
|
445
|
+
"document_matrix_too_wide",
|
|
446
|
+
"document_kpi_value_overflow",
|
|
447
|
+
"print_inputs_not_captured",
|
|
448
|
+
// New.
|
|
449
|
+
"document_section_setup",
|
|
450
|
+
"document_input_missing",
|
|
451
|
+
"document_section_query_failed",
|
|
452
|
+
"document_table_completeness_unverified",
|
|
453
|
+
"document_row_limit_exceeded",
|
|
454
|
+
"document_section_render_failed",
|
|
455
|
+
"document_page_overflow",
|
|
456
|
+
"document_sheet_not_found",
|
|
457
|
+
"document_print_timed_out",
|
|
458
|
+
// PDF capacity contract PC-D3: more pages than one PDF holds.
|
|
459
|
+
"document_page_limit_exceeded"
|
|
460
|
+
];
|
|
461
|
+
function tt(e) {
|
|
462
|
+
return Ce.includes(e);
|
|
463
|
+
}
|
|
464
|
+
const De = 64, Le = 120, Me = 3, Ee = 80, Se = [...Y, "noPageStack", "unknown"];
|
|
465
|
+
function A(e, t) {
|
|
466
|
+
return typeof e != "string" ? void 0 : e.trim().slice(0, t).trim() || void 0;
|
|
467
|
+
}
|
|
468
|
+
function g(e, t) {
|
|
469
|
+
return typeof e == "number" && Number.isInteger(e) && e >= t ? e : void 0;
|
|
470
|
+
}
|
|
471
|
+
function k(e, t) {
|
|
472
|
+
return t.includes(e) ? e : void 0;
|
|
473
|
+
}
|
|
474
|
+
function Ie(e) {
|
|
475
|
+
let t = e;
|
|
476
|
+
if (typeof e == "string")
|
|
477
|
+
try {
|
|
478
|
+
t = JSON.parse(e);
|
|
479
|
+
} catch {
|
|
480
|
+
return {};
|
|
481
|
+
}
|
|
482
|
+
if (!t || typeof t != "object" || Array.isArray(t)) return {};
|
|
483
|
+
const r = t, n = Array.isArray(r.inputLabels) ? r.inputLabels.map((a) => A(a, Ee)).filter((a) => a !== void 0).slice(0, Me) : [], o = {
|
|
484
|
+
sectionId: A(r.sectionId, De),
|
|
485
|
+
sectionTitle: A(r.sectionTitle, Le),
|
|
486
|
+
pageNumber: g(r.pageNumber, 1),
|
|
487
|
+
rowCount: g(r.rowCount, 0),
|
|
488
|
+
rowLimit: g(r.rowLimit, 1),
|
|
489
|
+
inputLabels: n.length ? n : void 0,
|
|
490
|
+
overflowAxis: k(r.overflowAxis, ["height", "width"]),
|
|
491
|
+
overflowPx: g(r.overflowPx, 0),
|
|
492
|
+
matrixLimit: k(r.matrixLimit, ["rows", "bytes"]),
|
|
493
|
+
layoutStage: k(r.layoutStage, Se),
|
|
494
|
+
loadingSectionCount: g(r.loadingSectionCount, 0),
|
|
495
|
+
measuredRowCount: g(r.measuredRowCount, 0),
|
|
496
|
+
totalRowCount: g(r.totalRowCount, 0),
|
|
497
|
+
pageCount: g(r.pageCount, 0),
|
|
498
|
+
pageLimit: g(r.pageLimit, 1)
|
|
499
|
+
};
|
|
500
|
+
return Object.fromEntries(
|
|
501
|
+
Object.entries(o).filter(([, a]) => a !== void 0)
|
|
502
|
+
);
|
|
503
|
+
}
|
|
504
|
+
function rt(e) {
|
|
505
|
+
const t = Ie(e.facts), r = t.sectionTitle ? `Section "${t.sectionTitle}"` : t.sectionId ? `Section ${t.sectionId}` : "A section", n = t.pageNumber !== void 0 ? ` on page ${t.pageNumber}` : "";
|
|
506
|
+
switch (e.code) {
|
|
507
|
+
case "document_section_setup":
|
|
508
|
+
return `${r} is not set up to print.`;
|
|
509
|
+
case "document_input_missing":
|
|
510
|
+
return t.inputLabels ? `${r} needs a value for ${t.inputLabels.join(", ")}.` : `${r} needs a value for a required input.`;
|
|
511
|
+
case "document_section_query_failed":
|
|
512
|
+
return `${r}: its data could not be loaded.`;
|
|
513
|
+
case "document_table_completeness_unverified":
|
|
514
|
+
return `${r}: the query returned no total row count, so the table could not be confirmed complete.`;
|
|
515
|
+
case "document_row_limit_exceeded":
|
|
516
|
+
return t.rowCount !== void 0 && t.rowLimit !== void 0 ? `${r} has ${t.rowCount} rows; a document table prints up to ${t.rowLimit}.` : `${r} has more rows than a document table prints.`;
|
|
517
|
+
case "document_section_render_failed":
|
|
518
|
+
return `${r} could not be drawn.`;
|
|
519
|
+
case "document_page_overflow":
|
|
520
|
+
return `${r}${n} does not fit the page${t.overflowAxis ? ` (${t.overflowAxis}` : ""}${t.overflowAxis && t.overflowPx !== void 0 ? `, ${t.overflowPx} px over` : ""}${t.overflowAxis ? ")" : ""}.`;
|
|
521
|
+
case "document_matrix_too_large":
|
|
522
|
+
return t.matrixLimit === "rows" && t.rowLimit !== void 0 ? `${r}: the Matrix has more than ${t.rowLimit} rows, the most a report prints.` : `${r}: the Matrix is too large to print.`;
|
|
523
|
+
case "document_matrix_unavailable":
|
|
524
|
+
return `${r}: the Matrix result could not be loaded.`;
|
|
525
|
+
case "document_matrix_too_wide":
|
|
526
|
+
return `${r}: the Matrix is wider than the page.`;
|
|
527
|
+
case "document_kpi_value_overflow":
|
|
528
|
+
return `${r}: a KPI value does not fit its tile.`;
|
|
529
|
+
case "print_inputs_not_captured":
|
|
530
|
+
return t.inputLabels ? `The report's input values were not saved: ${t.inputLabels.join(", ")}.` : "The report's input values were not saved.";
|
|
531
|
+
case "document_sheet_not_found":
|
|
532
|
+
return "The requested Document sheet is not in the dashboard.";
|
|
533
|
+
case "document_page_limit_exceeded":
|
|
534
|
+
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.";
|
|
535
|
+
case "document_print_timed_out":
|
|
536
|
+
return [
|
|
537
|
+
`The Document did not finish preparing in time (stage ${t.layoutStage ?? "unknown"}`,
|
|
538
|
+
t.measuredRowCount !== void 0 ? `; ${t.measuredRowCount} of ${t.totalRowCount ?? "unknown"} rows measured` : "",
|
|
539
|
+
t.pageCount !== void 0 ? `; ${t.pageCount} pages` : "",
|
|
540
|
+
t.loadingSectionCount ? `; ${t.loadingSectionCount} sections loading` : "",
|
|
541
|
+
")."
|
|
542
|
+
].join("");
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
function Fe(e) {
|
|
546
|
+
return Y.includes(e);
|
|
547
|
+
}
|
|
548
|
+
function N(e) {
|
|
549
|
+
return typeof e == "number" && Number.isInteger(e) && e >= 0;
|
|
550
|
+
}
|
|
551
|
+
function nt(e) {
|
|
552
|
+
let t = e;
|
|
553
|
+
if (typeof e == "string")
|
|
554
|
+
try {
|
|
555
|
+
t = JSON.parse(e);
|
|
556
|
+
} catch {
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
if (!t || typeof t != "object" || Array.isArray(t)) return;
|
|
560
|
+
const { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: a } = t;
|
|
561
|
+
if (!(!Fe(r) || !N(n) || o !== null && !N(o) || a !== null && !N(a)))
|
|
562
|
+
return { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: a };
|
|
563
|
+
}
|
|
564
|
+
function ot(e, t, r) {
|
|
565
|
+
const n = t.from > e.start ? t.from : e.start, o = t.to && t.to < e.end ? t.to : e.end, a = o > r ? "running" : n > e.start ? "start" : o < e.end ? "end" : void 0;
|
|
566
|
+
return { start: n, end: o, ...a ? { partial: a } : {} };
|
|
567
|
+
}
|
|
568
|
+
function at(e, t, r) {
|
|
569
|
+
switch (t) {
|
|
570
|
+
case "running":
|
|
571
|
+
return `${e} (so far)`;
|
|
572
|
+
case "start":
|
|
573
|
+
return r ? `${e} (from ${r.start})` : `${e} (partial)`;
|
|
574
|
+
case "end":
|
|
575
|
+
return r ? `${e} (to ${r.end})` : `${e} (partial)`;
|
|
576
|
+
default:
|
|
577
|
+
return e;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
function st(e, t, r) {
|
|
581
|
+
const n = Date.parse(e.startInclusive), o = Date.parse(e.endExclusive);
|
|
582
|
+
if (!Number.isFinite(n) || !Number.isFinite(o)) return;
|
|
583
|
+
if (t.granularity === "hour" || t.granularity === "minute" || t.granularity === "second") {
|
|
584
|
+
const m = (l) => {
|
|
585
|
+
try {
|
|
586
|
+
return new Intl.DateTimeFormat((r == null ? void 0 : r.locale) ?? "en-US", {
|
|
587
|
+
timeStyle: (r == null ? void 0 : r.dateTime.timeStyle) ?? "short",
|
|
588
|
+
timeZone: t.calendar.tz
|
|
589
|
+
}).format(new Date(l));
|
|
590
|
+
} catch {
|
|
591
|
+
return new Date(l).toISOString();
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
return { start: m(n), end: m(o) };
|
|
595
|
+
}
|
|
596
|
+
const a = { kind: "temporal_bucket", granularity: "day", calendar: t.calendar };
|
|
597
|
+
let s;
|
|
598
|
+
try {
|
|
599
|
+
s = ne({
|
|
600
|
+
metadata: a,
|
|
601
|
+
locale: (r == null ? void 0 : r.locale) ?? "en-US",
|
|
602
|
+
...r ? { styles: { dateStyle: r.dateStyle, dateTime: r.dateTime } } : {}
|
|
603
|
+
});
|
|
604
|
+
} catch {
|
|
605
|
+
s = void 0;
|
|
606
|
+
}
|
|
607
|
+
const u = (m) => {
|
|
608
|
+
const l = me(new Date(m), t.calendar.tz), f = `${String(l.year).padStart(4, "0")}-${String(l.month).padStart(2, "0")}-${String(l.day).padStart(2, "0")}`;
|
|
609
|
+
try {
|
|
610
|
+
return s ? oe({ value: f, metadata: a, format: s.format }) : f;
|
|
611
|
+
} catch {
|
|
612
|
+
return f;
|
|
613
|
+
}
|
|
614
|
+
};
|
|
615
|
+
return { start: u(n), end: u(o - 1) };
|
|
616
|
+
}
|
|
617
|
+
function it(e) {
|
|
618
|
+
return ((e == null ? void 0 : e.filterValues) ?? []).filter(Ae).map(ke);
|
|
619
|
+
}
|
|
620
|
+
function Ae(e) {
|
|
621
|
+
return !!e && typeof e == "object" && typeof e.name == "string" && Array.isArray(e.values);
|
|
622
|
+
}
|
|
623
|
+
function ke(e) {
|
|
624
|
+
if (!("relativeMeta" in e) || e.relativeMeta === void 0) return e;
|
|
625
|
+
const { relativeMeta: t, ...r } = e, n = se(t);
|
|
626
|
+
return n ? { ...r, relativeMeta: n } : r;
|
|
627
|
+
}
|
|
628
|
+
const Ne = /* @__PURE__ */ new Set([
|
|
629
|
+
"day",
|
|
630
|
+
"week",
|
|
631
|
+
"month",
|
|
632
|
+
"quarter",
|
|
633
|
+
"year"
|
|
634
|
+
]);
|
|
635
|
+
function Re(e, t) {
|
|
636
|
+
try {
|
|
637
|
+
const r = $(e), n = w(r, t, "yyyy-MM-dd");
|
|
638
|
+
if (w(r, t, "HH:mm:ss.SSS") !== "00:00:00.000")
|
|
639
|
+
return {
|
|
640
|
+
date: n,
|
|
641
|
+
time: w(r, t, "h:mm a")
|
|
642
|
+
};
|
|
643
|
+
const [o, a, s] = n.split("-").map(Number), u = new Date(Date.UTC(o, a - 1, s));
|
|
644
|
+
return u.setUTCDate(u.getUTCDate() - 1), { date: w(u, "UTC", "yyyy-MM-dd") };
|
|
645
|
+
} catch {
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
function Z(e, t, r) {
|
|
650
|
+
const n = Re(e.end, t);
|
|
651
|
+
if (n)
|
|
652
|
+
return {
|
|
653
|
+
start: w(
|
|
654
|
+
$(e.start),
|
|
655
|
+
t,
|
|
656
|
+
r ? "MMM d" : "MMM d, yyyy"
|
|
657
|
+
),
|
|
658
|
+
endDate: w(
|
|
659
|
+
$(`${n.date}T00:00:00Z`),
|
|
660
|
+
"UTC",
|
|
661
|
+
"MMM d, yyyy"
|
|
662
|
+
),
|
|
663
|
+
...n.time ? { endTime: n.time } : {}
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
function z(e) {
|
|
667
|
+
return !!(e && Ne.has(e));
|
|
668
|
+
}
|
|
669
|
+
function ut(e, t, r, n = !1) {
|
|
670
|
+
if (z(r))
|
|
671
|
+
try {
|
|
672
|
+
const a = Z(e, t, !1);
|
|
673
|
+
if (a && a.start === a.endDate)
|
|
674
|
+
return a.endTime ? `${a.endDate} until ${a.endTime}` : a.endDate;
|
|
675
|
+
} catch {
|
|
676
|
+
}
|
|
677
|
+
const o = Oe(
|
|
678
|
+
e,
|
|
679
|
+
t,
|
|
680
|
+
r,
|
|
681
|
+
n
|
|
682
|
+
);
|
|
683
|
+
return `${o.start} – ${o.end}`;
|
|
684
|
+
}
|
|
685
|
+
function Oe(e, t, r, n = !1) {
|
|
686
|
+
try {
|
|
687
|
+
if (z(r)) {
|
|
688
|
+
const o = Z(e, t, n);
|
|
689
|
+
if (o)
|
|
690
|
+
return {
|
|
691
|
+
start: o.start,
|
|
692
|
+
end: o.endTime ? `${o.endDate}, ${o.endTime}` : o.endDate
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
if (r === "second" || r === "minute" || r === "hour") {
|
|
696
|
+
const o = n ? "MMM d, h:mm a" : "MMM d, yyyy, h:mm a";
|
|
697
|
+
return {
|
|
698
|
+
start: w($(e.start), t, o),
|
|
699
|
+
end: `before ${w(
|
|
700
|
+
$(e.end),
|
|
701
|
+
t,
|
|
702
|
+
o
|
|
703
|
+
)}`
|
|
704
|
+
};
|
|
705
|
+
}
|
|
706
|
+
} catch {
|
|
707
|
+
}
|
|
708
|
+
return { start: e.start, end: `before ${e.end}` };
|
|
709
|
+
}
|
|
710
|
+
export {
|
|
711
|
+
Oe as A,
|
|
712
|
+
et as D,
|
|
713
|
+
Ke as M,
|
|
714
|
+
we as P,
|
|
715
|
+
qe as a,
|
|
716
|
+
Ye as b,
|
|
717
|
+
Ze as c,
|
|
718
|
+
ve as d,
|
|
719
|
+
ze as e,
|
|
720
|
+
ut as f,
|
|
721
|
+
We as g,
|
|
722
|
+
fe as h,
|
|
723
|
+
pe as i,
|
|
724
|
+
ye as j,
|
|
725
|
+
Je as k,
|
|
726
|
+
xe as l,
|
|
727
|
+
_e as m,
|
|
728
|
+
Te as n,
|
|
729
|
+
Qe as o,
|
|
730
|
+
be as p,
|
|
731
|
+
Ce as q,
|
|
732
|
+
$e as r,
|
|
733
|
+
tt as s,
|
|
734
|
+
Ie as t,
|
|
735
|
+
rt as u,
|
|
736
|
+
nt as v,
|
|
737
|
+
ot as w,
|
|
738
|
+
at as x,
|
|
739
|
+
st as y,
|
|
740
|
+
it as z
|
|
741
|
+
};
|