react-semaphor 0.1.539 → 0.1.541
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/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +63 -54
- package/dist/brand-studio/index.js +1 -1
- package/dist/briefings/index.js +41 -38
- package/dist/chunks/add-to-dashboard-BuAqfA2Y.js +80 -0
- package/dist/chunks/{aggregate-table-row-presentation-BjK9YfMI.js → aggregate-table-row-presentation-B_vQjYR3.js} +319 -302
- package/dist/chunks/{assistant-chat-DgiSuFT4.js → assistant-chat-D1fDZD6O.js} +2448 -2228
- package/dist/chunks/{context-HD9usB1P.js → context-ClREvqCZ.js} +101 -102
- package/dist/chunks/{dashboard-y5BwcvzT.js → dashboard-B6IrON_Q.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Bl3gCeBR.js → dashboard-briefing-launcher-DwjFpewq.js} +117 -117
- package/dist/chunks/{dashboard-controls-0EX0HiJt.js → dashboard-controls-C_BI28ME.js} +6 -6
- package/dist/chunks/{dashboard-json-6X_2BDiL.js → dashboard-json-DDY15Trn.js} +2 -2
- package/dist/chunks/{document-dashboard-inputs-BrYYlRVo.js → document-dashboard-inputs-DP_Op5mu.js} +1168 -1166
- package/dist/chunks/{edit-dashboard-visual-Bzchfgga.js → edit-dashboard-visual-CH2dzWW-.js} +5 -5
- package/dist/chunks/{index-CqMiAkay.js → index-DaQlghLY.js} +547 -511
- package/dist/chunks/report-preferences-dialog-DpNkFfQO.js +1950 -0
- package/dist/chunks/{saved-dashboard-context-Dqve2jlB.js → saved-dashboard-context-CJ2WpoMF.js} +2 -2
- package/dist/chunks/{semaphor-ready-indicator-ldcwmLoY.js → semaphor-ready-indicator-KT598QJq.js} +33482 -33334
- package/dist/chunks/{shelf-drop-preview-context-BWxunXTq.js → shelf-drop-preview-context-BxV3Fl8h.js} +3 -3
- package/dist/chunks/{switch-CvItuC1Q.js → switch-DWEWiv1J.js} +53 -52
- package/dist/chunks/{use-create-flow-overlay-state-RHgzVfcz.js → use-create-flow-overlay-state-DdD12SMY.js} +3 -3
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +582 -568
- package/dist/format-utils/index.js +117 -114
- package/dist/index.js +11 -11
- package/dist/pdf-export-policy/index.js +20 -10
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/briefings/attachment-outcomes.d.ts +23 -0
- package/dist/types/briefings/index.d.ts +1 -0
- package/dist/types/components/assistant/assistant-entry-points.d.ts +3 -0
- package/dist/types/components/assistant/assistant-store.d.ts +49 -1
- package/dist/types/components/assistant/use-assistant.d.ts +10 -1
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
- package/dist/types/lib/query-context/card-server-request.d.ts +5 -1
- package/dist/types/lib/types/common-types.d.ts +7 -0
- package/dist/types/lib/types/explorer-types.d.ts +2 -2
- package/dist/types/shared/assistant-protocol/context.d.ts +88 -66
- package/dist/types/shared/assistant-protocol/conversation.d.ts +3 -0
- package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
- package/dist/types/shared/assistant-protocol/limits.d.ts +2 -0
- package/dist/types/shared/assistant-protocol/request.d.ts +6 -1
- package/dist/types/shared/assistant-protocol/tagged-fields.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +20 -0
- package/dist/types/shared/format-utils/attachment-filter-line.d.ts +14 -0
- package/dist/types/shared/format-utils/filter-line.d.ts +7 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/pdf-export-policy.d.ts +9 -0
- package/package.json +2 -1
- package/dist/chunks/add-to-dashboard-CxtTfISD.js +0 -56
- package/dist/chunks/report-preferences-dialog-CWhSbc5_.js +0 -1808
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { i as
|
|
5
|
-
import { h as G, m as _, i as
|
|
1
|
+
var ne = Object.defineProperty;
|
|
2
|
+
var se = (e, t, a) => t in e ? ne(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var V = (e, t, a) => se(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
+
import { i as le, g as L, k as ie, B as R, q as ue, A as ce, y as me, s as de } from "./raw-temporal-D61lr48Y.js";
|
|
5
|
+
import { h as G, m as _, i as X, j as fe, k as Z, l as b } from "./matrix-formatter-DQ8avoIQ.js";
|
|
6
6
|
import { h as E } from "./csv-utils-GUfKyT1J.js";
|
|
7
|
-
import { l as
|
|
7
|
+
import { l as ge, aD as W, w as k, A as F, z as he } from "./validators-Ej1DdCXa.js";
|
|
8
8
|
import "./matrix-operation-contract-B8PBF1Gd.js";
|
|
9
9
|
import "./analytics-base-schemas-BFAoRlkU.js";
|
|
10
10
|
import "zod";
|
|
11
|
-
import { g as
|
|
12
|
-
import { PDF_SAFETY_LIMIT_EXCEEDED as
|
|
11
|
+
import { g as K, p as v } from "./matrix-definition-DQDI2okF.js";
|
|
12
|
+
import { PDF_SAFETY_LIMIT_EXCEEDED as Y, getUtf8ByteLength as ye, FAST_PDF_POLICY as pe } from "../pdf-export-policy/index.js";
|
|
13
13
|
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as we } from "../value-format-preferences/index.js";
|
|
14
14
|
import { f as be, c as Te, g as ve } from "./temporal-bucket-D8JF7zKz.js";
|
|
15
|
-
import { z as
|
|
16
|
-
function Ce(e, t,
|
|
17
|
-
const
|
|
15
|
+
import { z as Le, g as Se } from "./zoned-wall-clock-MulfA26h.js";
|
|
16
|
+
function Ce(e, t, a) {
|
|
17
|
+
const o = {
|
|
18
18
|
...t,
|
|
19
|
-
locale: t.locale ??
|
|
19
|
+
locale: t.locale ?? a
|
|
20
20
|
};
|
|
21
|
-
if (
|
|
22
|
-
return
|
|
23
|
-
const { prefix: r, suffix: s, ...n } =
|
|
24
|
-
return `${r ?? ""}${
|
|
21
|
+
if (o.type === "number")
|
|
22
|
+
return L(e, o);
|
|
23
|
+
const { prefix: r, suffix: s, ...n } = o;
|
|
24
|
+
return `${r ?? ""}${L(e, {
|
|
25
25
|
...n,
|
|
26
|
-
negativeStyle:
|
|
26
|
+
negativeStyle: o.type === "currency" ? o.negativeStyle : "minus"
|
|
27
27
|
})}${s ?? ""}`;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return e === null ? { value: e, text: null } : !t || !
|
|
29
|
+
function x(e, t, a) {
|
|
30
|
+
return e === null ? { value: e, text: null } : !t || !le(t) && t.type !== "duration" ? {
|
|
31
31
|
value: e,
|
|
32
|
-
text:
|
|
32
|
+
text: L(e, { type: "number", locale: a })
|
|
33
33
|
} : t.type === "duration" ? {
|
|
34
34
|
value: e,
|
|
35
|
-
text:
|
|
35
|
+
text: ie(e, {
|
|
36
36
|
inputUnit: t.inputUnit,
|
|
37
37
|
outputStyle: t.outputStyle,
|
|
38
38
|
largestUnit: t.largestUnit,
|
|
@@ -42,84 +42,84 @@ function P(e, t, o) {
|
|
|
42
42
|
suffix: t.suffix,
|
|
43
43
|
negativeInParentheses: t.negativeStyle === "parentheses"
|
|
44
44
|
})
|
|
45
|
-
} : { value: e, text: Ce(e, t,
|
|
45
|
+
} : { value: e, text: Ce(e, t, a) };
|
|
46
46
|
}
|
|
47
|
-
function U(e, t,
|
|
48
|
-
return e === null ? { value: e, text: null } :
|
|
47
|
+
function U(e, t, a, o) {
|
|
48
|
+
return e === null ? { value: e, text: null } : o === "percent" ? {
|
|
49
49
|
value: e,
|
|
50
|
-
text:
|
|
50
|
+
text: L(e, {
|
|
51
51
|
type: "percent",
|
|
52
|
-
locale:
|
|
52
|
+
locale: a,
|
|
53
53
|
minimumFractionDigits: t,
|
|
54
54
|
maximumFractionDigits: t,
|
|
55
55
|
percentValueMode: "fraction"
|
|
56
56
|
})
|
|
57
57
|
} : {
|
|
58
58
|
value: e,
|
|
59
|
-
text:
|
|
59
|
+
text: L(e, {
|
|
60
60
|
type: "number",
|
|
61
|
-
locale:
|
|
61
|
+
locale: a,
|
|
62
62
|
minimumFractionDigits: t,
|
|
63
63
|
maximumFractionDigits: t,
|
|
64
64
|
suffix: "×"
|
|
65
65
|
})
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function O(e, t) {
|
|
69
69
|
if (e === void 0) return t;
|
|
70
70
|
if (!Number.isInteger(e) || e < 0 || e > 6)
|
|
71
71
|
throw new RangeError("Comparison precision must be an integer from 0 to 6.");
|
|
72
72
|
return e;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const
|
|
74
|
+
function St(e, t) {
|
|
75
|
+
const a = {
|
|
76
76
|
mode: t.displayMode,
|
|
77
|
-
current:
|
|
77
|
+
current: x(
|
|
78
78
|
e.currentValue,
|
|
79
79
|
t.metricFormat,
|
|
80
80
|
t.locale
|
|
81
81
|
),
|
|
82
|
-
comparison:
|
|
82
|
+
comparison: x(
|
|
83
83
|
e.comparisonValue,
|
|
84
84
|
t.metricFormat,
|
|
85
85
|
t.locale
|
|
86
86
|
)
|
|
87
87
|
};
|
|
88
|
-
return (t.displayMode === "difference" || t.displayMode === "both") && (
|
|
88
|
+
return (t.displayMode === "difference" || t.displayMode === "both") && (a.difference = x(
|
|
89
89
|
e.delta,
|
|
90
90
|
t.metricFormat,
|
|
91
91
|
t.locale
|
|
92
|
-
)), (t.displayMode === "percent_change" || t.displayMode === "both") && (
|
|
92
|
+
)), (t.displayMode === "percent_change" || t.displayMode === "both") && (a.percentChange = U(
|
|
93
93
|
e.percentChange,
|
|
94
|
-
|
|
94
|
+
O(t.precision, 1),
|
|
95
95
|
t.locale,
|
|
96
96
|
"percent"
|
|
97
|
-
)), t.displayMode === "ratio" && (
|
|
97
|
+
)), t.displayMode === "ratio" && (a.ratio = U(
|
|
98
98
|
e.ratio,
|
|
99
|
-
|
|
99
|
+
O(t.precision, 2),
|
|
100
100
|
t.locale,
|
|
101
101
|
"ratio"
|
|
102
|
-
)),
|
|
102
|
+
)), a;
|
|
103
103
|
}
|
|
104
|
-
const
|
|
105
|
-
function
|
|
106
|
-
return e >
|
|
104
|
+
const Me = 1e4, Ct = 1e6, Mt = 5e6, At = 1024 ** 3, kt = 1024 ** 3;
|
|
105
|
+
function $t(e) {
|
|
106
|
+
return e > Me;
|
|
107
107
|
}
|
|
108
|
-
const
|
|
108
|
+
const Et = {
|
|
109
109
|
rowLabels: "tabular",
|
|
110
110
|
subtotals: "after"
|
|
111
111
|
};
|
|
112
|
-
function
|
|
113
|
-
const
|
|
112
|
+
function xt(e, t) {
|
|
113
|
+
const a = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, o = e.totals.rows;
|
|
114
114
|
return {
|
|
115
115
|
...e,
|
|
116
|
-
layout:
|
|
116
|
+
layout: a,
|
|
117
117
|
totals: {
|
|
118
118
|
...e.totals,
|
|
119
119
|
rows: {
|
|
120
|
-
...
|
|
120
|
+
...o,
|
|
121
121
|
levels: Object.fromEntries(
|
|
122
|
-
Object.entries(
|
|
122
|
+
Object.entries(o.levels).map(([r, s]) => [
|
|
123
123
|
r,
|
|
124
124
|
{ ...s, position: t.subtotals }
|
|
125
125
|
])
|
|
@@ -129,27 +129,27 @@ function Mt(e, t) {
|
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
131
|
const Ae = 2;
|
|
132
|
-
function
|
|
133
|
-
return typeof e == "number" ? Number.isInteger(e) :
|
|
132
|
+
function ke(e) {
|
|
133
|
+
return typeof e == "number" ? Number.isInteger(e) : W(e) ? !e.value.includes(".") : !0;
|
|
134
134
|
}
|
|
135
|
-
function $e(e, t,
|
|
136
|
-
const
|
|
137
|
-
(n) =>
|
|
135
|
+
function $e(e, t, a) {
|
|
136
|
+
const o = e.descriptors.measures.filter(
|
|
137
|
+
(n) => a.measureFormats[n.id] === void 0 && n.semanticFormat === void 0 && ge(n.column.dataType) === "number"
|
|
138
138
|
);
|
|
139
|
-
if (
|
|
139
|
+
if (o.length === 0) return a;
|
|
140
140
|
const r = /* @__PURE__ */ new Set();
|
|
141
141
|
e.columns.forEach((n, l) => {
|
|
142
142
|
if (!(n.kind !== "measure" || r.has(n.measureId)))
|
|
143
143
|
for (const c of t) {
|
|
144
144
|
const i = c.values[l];
|
|
145
|
-
if ((i == null ? void 0 : i.kind) === "value" && !
|
|
145
|
+
if ((i == null ? void 0 : i.kind) === "value" && !ke(i.value)) {
|
|
146
146
|
r.add(n.measureId);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
|
-
const s = { ...
|
|
152
|
-
for (const { id: n } of
|
|
151
|
+
const s = { ...a.measureFormats };
|
|
152
|
+
for (const { id: n } of o) {
|
|
153
153
|
const l = r.has(n) ? Ae : 0;
|
|
154
154
|
s[n] = {
|
|
155
155
|
type: "number",
|
|
@@ -158,25 +158,25 @@ function $e(e, t, o) {
|
|
|
158
158
|
useGrouping: !0
|
|
159
159
|
};
|
|
160
160
|
}
|
|
161
|
-
return { ...
|
|
161
|
+
return { ...a, measureFormats: s };
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return
|
|
163
|
+
function M(e) {
|
|
164
|
+
return k(e.slice(0, -1));
|
|
165
165
|
}
|
|
166
166
|
function Ee(e, t) {
|
|
167
|
-
return t.length > e.length &&
|
|
168
|
-
}
|
|
169
|
-
function
|
|
170
|
-
return e.map((t,
|
|
171
|
-
if (
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
174
|
-
if (t.role !== "member" || Ee(
|
|
175
|
-
const r = e[
|
|
176
|
-
return
|
|
167
|
+
return t.length > e.length && k(t.slice(0, e.length)) === k(e);
|
|
168
|
+
}
|
|
169
|
+
function xe(e) {
|
|
170
|
+
return e.map((t, a) => {
|
|
171
|
+
if (a === 0 || t.kind !== "layout") return !1;
|
|
172
|
+
const o = e[a - 1];
|
|
173
|
+
if (o.kind !== "layout") return !1;
|
|
174
|
+
if (t.role !== "member" || Ee(o.rowPath, t.rowPath)) return !0;
|
|
175
|
+
const r = e[a - 2];
|
|
176
|
+
return o.role === "member" && (!r || r.kind !== "layout" || r.role !== "member" || M(r.rowPath) !== M(o.rowPath)) && t.rowPath.length === o.rowPath.length && M(t.rowPath) === M(o.rowPath);
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
const
|
|
179
|
+
const Pe = "pdf-group-continuation";
|
|
180
180
|
function _e(e) {
|
|
181
181
|
if (!e.previousRow || e.row.isSubtotal === !0 || e.row.isGrandTotal === !0 || e.previousRow.isSubtotal === !0 || e.previousRow.isGrandTotal === !0)
|
|
182
182
|
return !0;
|
|
@@ -185,21 +185,21 @@ function _e(e) {
|
|
|
185
185
|
return !0;
|
|
186
186
|
return !1;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
return !(
|
|
188
|
+
function q(e, t, a) {
|
|
189
|
+
return !(a != null && a.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || W(t.value)) ? e : E(e);
|
|
190
190
|
}
|
|
191
|
-
function Ie(e, t,
|
|
192
|
-
const
|
|
191
|
+
function Ie(e, t, a) {
|
|
192
|
+
const o = G(e.descriptors, t.presentation, a), r = e.columns.map((u) => {
|
|
193
193
|
var m;
|
|
194
|
-
return u.kind === "measure" && ((m =
|
|
195
|
-
}), s = (u) => _([u],
|
|
194
|
+
return u.kind === "measure" && ((m = o.measureSemantics.get(u.measureId)) == null ? void 0 : m.isNumeric) === !0;
|
|
195
|
+
}), s = (u) => _([u], o.levels), n = (u, m, d) => X(u, m, t.presentation.totals[d], o.levels), l = e.columns.map((u) => {
|
|
196
196
|
if (u.kind !== "measure") return u.label;
|
|
197
197
|
const m = u.columnPath.map(s);
|
|
198
198
|
return u.role !== "member" && m.push(n(u.columnPath, u.role, "columns")), [...m, u.label].join(" / ");
|
|
199
199
|
}), c = Math.min(t.spec.columns.length, Math.max(
|
|
200
200
|
0,
|
|
201
201
|
...e.columns.map((u) => u.kind === "measure" ? u.columnPath.length + (u.role !== "member" ? 1 : 0) : 0)
|
|
202
|
-
)), i = Array.from({ length: c + 1 }, (u, m) => e.columns.map((d) => m === c ? d.label : d.kind !== "measure" ? "" : m < d.columnPath.length ? s(d.columnPath[m]) : m === d.columnPath.length && d.role !== "member" ? n(d.columnPath, d.role, "columns") : "")), g = (u, m) =>
|
|
202
|
+
)), i = Array.from({ length: c + 1 }, (u, m) => e.columns.map((d) => m === c ? d.label : d.kind !== "measure" ? "" : m < d.columnPath.length ? s(d.columnPath[m]) : m === d.columnPath.length && d.role !== "member" ? n(d.columnPath, d.role, "columns") : "")), g = (u, m) => fe({
|
|
203
203
|
path: u.rowPath,
|
|
204
204
|
role: u.kind === "layout" ? u.role : "member",
|
|
205
205
|
levelCount: Math.max(1, t.spec.rows.length),
|
|
@@ -214,16 +214,16 @@ function Ie(e, t, o) {
|
|
|
214
214
|
return `${" ".repeat(Math.max(0, u.rowPath.length - 1))}${n(u.rowPath, u.role, "rows")}`;
|
|
215
215
|
if (y.kind === "level") {
|
|
216
216
|
const C = t.spec.rows.findIndex((oe) => oe.id === y.levelId), w = d[C];
|
|
217
|
-
return w != null && w.visible ? w.total ? n(u.rowPath, u.role, "rows") : _(w.path,
|
|
217
|
+
return w != null && w.visible ? w.total ? n(u.rowPath, u.role, "rows") : _(w.path, o.levels) : "";
|
|
218
218
|
}
|
|
219
|
-
const
|
|
220
|
-
if (
|
|
219
|
+
const S = u.values[p], T = o.measures.get(y.measureId);
|
|
220
|
+
if (S.kind === "value" && !T)
|
|
221
221
|
throw new Error("Matrix value is missing its measure descriptor.");
|
|
222
|
-
return
|
|
222
|
+
return Z(S, T, t.presentation.absence);
|
|
223
223
|
});
|
|
224
224
|
}, h = (u, m) => f(u, m).map((d, y) => {
|
|
225
225
|
const p = e.columns[y];
|
|
226
|
-
return p.kind === "measure" ?
|
|
226
|
+
return p.kind === "measure" ? q(d, u.values[y], o.measureSemantics.get(p.measureId)) : E(d);
|
|
227
227
|
});
|
|
228
228
|
return {
|
|
229
229
|
headers: l,
|
|
@@ -241,11 +241,11 @@ function Ie(e, t, o) {
|
|
|
241
241
|
const d = (p) => (p == null ? void 0 : p.kind) === "layout" && p.role === "member";
|
|
242
242
|
if (!d(u) || !d(m)) return [];
|
|
243
243
|
const y = g(u, m);
|
|
244
|
-
return e.columns.flatMap((p,
|
|
244
|
+
return e.columns.flatMap((p, S) => {
|
|
245
245
|
var C;
|
|
246
246
|
if (p.kind !== "level") return [];
|
|
247
247
|
const T = t.spec.rows.findIndex((w) => w.id === p.levelId);
|
|
248
|
-
return T < u.rowPath.length && ((C = y[T]) == null ? void 0 : C.visible) === !1 ? [
|
|
248
|
+
return T < u.rowPath.length && ((C = y[T]) == null ? void 0 : C.visible) === !1 ? [S] : [];
|
|
249
249
|
});
|
|
250
250
|
},
|
|
251
251
|
csvRow: (u) => h(u),
|
|
@@ -259,51 +259,51 @@ function Ie(e, t, o) {
|
|
|
259
259
|
csvRows: (u, m) => u.map((d, y) => h(d, y ? u[y - 1] : m ?? void 0))
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function Pt(e) {
|
|
263
263
|
return e.columns.map((t) => E(t.label));
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function _t(e, t, a) {
|
|
266
266
|
if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
|
|
267
267
|
if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
268
|
-
const
|
|
268
|
+
const o = [...e.rowPath, ...e.columnPath];
|
|
269
269
|
return t.columns.map((r, s) => {
|
|
270
270
|
if (r.kind === "measure") {
|
|
271
|
-
const l = e.values[s], c =
|
|
271
|
+
const l = e.values[s], c = a.measures.get(r.measureId);
|
|
272
272
|
if (l.kind === "value" && !c) throw new Error("Matrix value is missing its measure descriptor.");
|
|
273
|
-
return
|
|
274
|
-
|
|
273
|
+
return q(
|
|
274
|
+
Z(l, c, a.absence),
|
|
275
275
|
l,
|
|
276
|
-
|
|
276
|
+
a.measureSemantics.get(r.measureId)
|
|
277
277
|
);
|
|
278
278
|
}
|
|
279
|
-
const n = r.kind === "level" ?
|
|
279
|
+
const n = r.kind === "level" ? o.find((l) => l.levelId === r.levelId) : void 0;
|
|
280
280
|
if (!n) throw new Error("Flat Matrix row does not match its frozen layout.");
|
|
281
|
-
return E(_([n],
|
|
281
|
+
return E(_([n], a.levels));
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
284
|
function De(e) {
|
|
285
|
-
const t = Ie(e.layout, e.request, e.report),
|
|
285
|
+
const t = Ie(e.layout, e.request, e.report), a = e.layout.columns.map((n, l) => ({
|
|
286
286
|
index: l,
|
|
287
287
|
columnId: `matrix:${l}`,
|
|
288
288
|
label: t.headers[l],
|
|
289
289
|
isNumeric: t.numericColumns[l]
|
|
290
|
-
})),
|
|
290
|
+
})), o = (n, l, c) => ({
|
|
291
291
|
text: n,
|
|
292
292
|
colspan: 1,
|
|
293
293
|
rowspan: 1,
|
|
294
|
-
columnId:
|
|
294
|
+
columnId: a[l].columnId,
|
|
295
295
|
isHeader: c,
|
|
296
|
-
isNumeric:
|
|
297
|
-
className:
|
|
296
|
+
isNumeric: a[l].isNumeric,
|
|
297
|
+
className: a[l].isNumeric ? "numeric" : e.layout.columns[l].kind === "hierarchy" ? "matrix-hierarchy" : ""
|
|
298
298
|
}), r = [], s = e.layout.columns.findIndex((n) => n.kind === "measure");
|
|
299
299
|
e.request.spec.columns.length && s >= 0 && r.push({
|
|
300
300
|
repeatHeader: !0,
|
|
301
301
|
headerType: "pivot-axis",
|
|
302
302
|
headerRowIndex: 0,
|
|
303
303
|
cells: [
|
|
304
|
-
...s ? [{ ...
|
|
304
|
+
...s ? [{ ...o("", 0, !0), colspan: s }] : [],
|
|
305
305
|
{
|
|
306
|
-
...
|
|
306
|
+
...o(e.request.spec.columns.map((n) => K(n, e.request.presentation)).join(" / "), s, !0),
|
|
307
307
|
colspan: e.layout.columns.length - s,
|
|
308
308
|
isNumeric: !1,
|
|
309
309
|
className: ""
|
|
@@ -315,7 +315,7 @@ function De(e) {
|
|
|
315
315
|
repeatHeader: !0,
|
|
316
316
|
headerType: n === t.headerBands.length - 1 ? "metrics" : "pivot-level",
|
|
317
317
|
headerRowIndex: r.length,
|
|
318
|
-
cells: l.map((c, i) =>
|
|
318
|
+
cells: l.map((c, i) => o(c, i, !0))
|
|
319
319
|
});
|
|
320
320
|
return {
|
|
321
321
|
headers: r,
|
|
@@ -327,7 +327,7 @@ function De(e) {
|
|
|
327
327
|
subtotalLevel: String(n.rowPath.length),
|
|
328
328
|
// A tabular layout prints each label once unless it repeats them; the
|
|
329
329
|
// blank cell continues its group, so a grid draws no rule above it.
|
|
330
|
-
cells: t.row(n, e.rows[l - 1]).map((i, g) => c.has(g) ? { ...
|
|
330
|
+
cells: t.row(n, e.rows[l - 1]).map((i, g) => c.has(g) ? { ...o(i, g, !1), className: Pe } : o(i, g, !1))
|
|
331
331
|
};
|
|
332
332
|
}),
|
|
333
333
|
grandTotal: null,
|
|
@@ -335,34 +335,34 @@ function De(e) {
|
|
|
335
335
|
metadata: {
|
|
336
336
|
tableType: "pivot",
|
|
337
337
|
totalRows: e.rows.length,
|
|
338
|
-
totalColumns:
|
|
338
|
+
totalColumns: a.length,
|
|
339
339
|
rowLevels: e.layout.columns.filter((n) => n.kind !== "measure").length,
|
|
340
340
|
pivotLevels: e.request.spec.columns.length,
|
|
341
341
|
hasGrandTotal: !1,
|
|
342
|
-
columnOrder:
|
|
343
|
-
columns:
|
|
342
|
+
columnOrder: a.map((n) => n.columnId),
|
|
343
|
+
columns: a
|
|
344
344
|
}
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
|
-
function Re(e, t,
|
|
348
|
-
const { levels:
|
|
347
|
+
function Re(e, t, a) {
|
|
348
|
+
const { levels: o } = G(e.descriptors, t.presentation, a), r = t.spec.columns.length > 0, s = [], n = [], l = e.columns.map((i, g) => {
|
|
349
349
|
if (i.kind !== "measure") return null;
|
|
350
|
-
const f = r ? `${i.role}:${
|
|
350
|
+
const f = r ? `${i.role}:${k(i.columnPath)}` : `measure:${g}`;
|
|
351
351
|
let h = s.indexOf(f);
|
|
352
|
-
return h < 0 && (h = s.push(f) - 1, n.push(r ?
|
|
352
|
+
return h < 0 && (h = s.push(f) - 1, n.push(r ? X(i.columnPath, i.role, t.presentation.totals.columns, o) : i.label)), h;
|
|
353
353
|
}), c = t.spec.columns[t.spec.columns.length - 1];
|
|
354
354
|
return {
|
|
355
355
|
columnGroups: l,
|
|
356
356
|
groupLabels: n,
|
|
357
357
|
/** What bands name their groups by: the innermost column level, or "Measures". */
|
|
358
|
-
groupLevelLabel: c ?
|
|
358
|
+
groupLevelLabel: c ? K(c, t.presentation) : "Measures"
|
|
359
359
|
};
|
|
360
360
|
}
|
|
361
|
-
function
|
|
362
|
-
const { layout: t, rows:
|
|
361
|
+
function It(e) {
|
|
362
|
+
const { layout: t, rows: a, report: o } = e, r = {
|
|
363
363
|
...e.request,
|
|
364
|
-
presentation: $e(t,
|
|
365
|
-
}, s = De({ layout: t, rows:
|
|
364
|
+
presentation: $e(t, a, e.request.presentation)
|
|
365
|
+
}, s = De({ layout: t, rows: a, request: r, report: o }), n = xe(a), l = Re(t, r, o), c = {
|
|
366
366
|
...s,
|
|
367
367
|
rows: s.rows.map((i, g) => ({ ...i, keepWithPrevious: n[g] })),
|
|
368
368
|
metadata: { ...s.metadata, ...l }
|
|
@@ -372,41 +372,41 @@ function Pt(e) {
|
|
|
372
372
|
class Fe extends Error {
|
|
373
373
|
constructor() {
|
|
374
374
|
super(...arguments);
|
|
375
|
-
|
|
375
|
+
V(this, "code", Y);
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
function
|
|
378
|
+
function B(e) {
|
|
379
379
|
if (!e || typeof e != "object")
|
|
380
380
|
return;
|
|
381
|
-
const { error: t, message:
|
|
382
|
-
for (const r of [t,
|
|
381
|
+
const { error: t, message: a, detail: o } = e;
|
|
382
|
+
for (const r of [t, a, o])
|
|
383
383
|
if (typeof r == "string" && r.trim())
|
|
384
384
|
return r.trim();
|
|
385
385
|
}
|
|
386
386
|
async function Ne(e) {
|
|
387
|
-
const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(),
|
|
387
|
+
const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), a = e.headers.get("content-type") || "";
|
|
388
388
|
try {
|
|
389
|
-
if (
|
|
389
|
+
if (a.includes("application/json")) {
|
|
390
390
|
const r = await e.json(), s = typeof r.code == "string" ? r.code : typeof r.errorCode == "string" ? r.errorCode : void 0;
|
|
391
|
-
return { message:
|
|
391
|
+
return { message: B(r) || t, code: s };
|
|
392
392
|
}
|
|
393
|
-
const
|
|
394
|
-
if (!
|
|
393
|
+
const o = await e.text();
|
|
394
|
+
if (!o.trim())
|
|
395
395
|
return { message: t };
|
|
396
396
|
try {
|
|
397
|
-
const r = JSON.parse(
|
|
397
|
+
const r = JSON.parse(o), s = typeof r.code == "string" ? r.code : typeof r.errorCode == "string" ? r.errorCode : void 0;
|
|
398
398
|
return {
|
|
399
|
-
message:
|
|
399
|
+
message: B(r) || o.trim(),
|
|
400
400
|
code: s
|
|
401
401
|
};
|
|
402
402
|
} catch {
|
|
403
|
-
return { message:
|
|
403
|
+
return { message: o.trim() };
|
|
404
404
|
}
|
|
405
405
|
} catch {
|
|
406
406
|
return { message: t };
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
|
-
async function
|
|
409
|
+
async function Dt(e) {
|
|
410
410
|
if (!e.token) throw new Error("Missing auth token for PDF export");
|
|
411
411
|
if (ye(e.serializedPayload) > pe.maxRequestBytes)
|
|
412
412
|
throw new Error("Fast-path PDF request exceeds the structured body limit");
|
|
@@ -417,22 +417,22 @@ async function xt(e) {
|
|
|
417
417
|
signal: e.signal
|
|
418
418
|
});
|
|
419
419
|
if (!t.ok) {
|
|
420
|
-
const
|
|
421
|
-
throw
|
|
420
|
+
const o = await Ne(t);
|
|
421
|
+
throw o.code === Y ? new Fe(o.message) : new Error(o.message);
|
|
422
422
|
}
|
|
423
|
-
const
|
|
424
|
-
if (
|
|
425
|
-
if (typeof (
|
|
423
|
+
const a = await t.json();
|
|
424
|
+
if (a != null && a.error) throw new Error(a.error);
|
|
425
|
+
if (typeof (a == null ? void 0 : a.url) != "string" || !a.url.trim())
|
|
426
426
|
throw new Error("Fast-path PDF response missing download URL");
|
|
427
|
-
return
|
|
427
|
+
return a;
|
|
428
428
|
}
|
|
429
|
-
const
|
|
430
|
-
function
|
|
429
|
+
const Ve = /* @__PURE__ */ new Set(["short", "medium", "long"]), Ue = /^(\d{4})-(\d{2})-(\d{2})$/, Oe = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, Be = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, N = " – ";
|
|
430
|
+
function Rt(e) {
|
|
431
431
|
if (!ve(e)) return;
|
|
432
432
|
const t = Object.keys(e);
|
|
433
433
|
if (e.mode === "period_label" && t.length === 1)
|
|
434
434
|
return { mode: "period_label" };
|
|
435
|
-
if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" &&
|
|
435
|
+
if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && Ve.has(e.dateStyle))
|
|
436
436
|
return { mode: "style", dateStyle: e.dateStyle };
|
|
437
437
|
if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" && ze(e.pattern) === null)
|
|
438
438
|
return {
|
|
@@ -443,23 +443,23 @@ function _t(e) {
|
|
|
443
443
|
}
|
|
444
444
|
function ze(e) {
|
|
445
445
|
try {
|
|
446
|
-
return
|
|
446
|
+
return me({ dialect: "semaphor_tokens", pattern: e }), null;
|
|
447
447
|
} catch (t) {
|
|
448
448
|
return t instanceof Error ? t.message : "The pattern is invalid.";
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
function
|
|
452
|
-
const { value: t, part:
|
|
453
|
-
if ((
|
|
451
|
+
function Ft(e) {
|
|
452
|
+
const { value: t, part: a, presentation: o, preferences: r, calendar: s } = e;
|
|
453
|
+
if ((o == null ? void 0 : o.mode) === "period_label" && t.periodLabel && a === "range")
|
|
454
454
|
return { ok: !0, text: t.periodLabel };
|
|
455
|
-
const [n, l] = t.bounds, i = l === void 0 ||
|
|
455
|
+
const [n, l] = t.bounds, i = l === void 0 || a === "start" ? [{ raw: n, role: "start" }] : a === "end" ? [{ raw: l, role: "end" }] : [
|
|
456
456
|
{ raw: n, role: "start" },
|
|
457
457
|
{ raw: l, role: "end" }
|
|
458
458
|
], g = i.map(({ raw: m }) => Ze(m, s.tz));
|
|
459
459
|
if (g.some((m) => m === null))
|
|
460
460
|
return {
|
|
461
461
|
ok: !1,
|
|
462
|
-
text: i.map(({ raw: m }) => m).join(
|
|
462
|
+
text: i.map(({ raw: m }) => m).join(N),
|
|
463
463
|
diagnostic: {
|
|
464
464
|
code: "invalid_temporal_input_value",
|
|
465
465
|
message: "A date input bound is not a date or an instant."
|
|
@@ -468,89 +468,89 @@ function It(e) {
|
|
|
468
468
|
const f = t.precision === "day" ? g.map(
|
|
469
469
|
(m, d) => Ke(m, i[d].role, s.tz)
|
|
470
470
|
) : [], h = f.length > 0 && f.every((m) => m !== null) ? f : null;
|
|
471
|
-
return { ok: !0, text: h ?
|
|
471
|
+
return { ok: !0, text: h ? je(h, o, r, s) : Ge(
|
|
472
472
|
g.map((m) => We(m, s.tz)),
|
|
473
|
-
|
|
473
|
+
o,
|
|
474
474
|
r,
|
|
475
475
|
s
|
|
476
476
|
) };
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function je(e, t, a, o) {
|
|
479
479
|
const [r, s = r] = e;
|
|
480
480
|
if ((t == null ? void 0 : t.mode) === "pattern")
|
|
481
|
-
return
|
|
481
|
+
return Q(
|
|
482
482
|
e.map(
|
|
483
|
-
(c) =>
|
|
483
|
+
(c) => J(I(c), "date", t.pattern, a, o)
|
|
484
484
|
)
|
|
485
485
|
);
|
|
486
|
-
const n = (t == null ? void 0 : t.mode) === "style" ? t.dateStyle :
|
|
486
|
+
const n = (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : a.dateStyle;
|
|
487
487
|
if (!t || t.mode === "period_label") {
|
|
488
|
-
const c = Ye(r, s,
|
|
488
|
+
const c = Ye(r, s, o);
|
|
489
489
|
if (c)
|
|
490
490
|
return be({
|
|
491
491
|
value: I(r),
|
|
492
492
|
metadata: {
|
|
493
493
|
kind: "temporal_bucket",
|
|
494
494
|
granularity: c,
|
|
495
|
-
calendar: { tz:
|
|
495
|
+
calendar: { tz: o.tz, weekStart: o.weekStart ?? 1 }
|
|
496
496
|
},
|
|
497
497
|
format: Te({
|
|
498
498
|
metadata: {
|
|
499
499
|
kind: "temporal_bucket",
|
|
500
500
|
granularity: c,
|
|
501
|
-
calendar: { tz:
|
|
501
|
+
calendar: { tz: o.tz, weekStart: o.weekStart ?? 1 }
|
|
502
502
|
},
|
|
503
|
-
locale:
|
|
504
|
-
styles: { dateStyle: n, dateTime: { ...
|
|
503
|
+
locale: a.locale,
|
|
504
|
+
styles: { dateStyle: n, dateTime: { ...a.dateTime } }
|
|
505
505
|
}).format
|
|
506
506
|
});
|
|
507
507
|
}
|
|
508
|
-
const l = new Intl.DateTimeFormat(
|
|
508
|
+
const l = new Intl.DateTimeFormat(a.locale, {
|
|
509
509
|
calendar: "gregory",
|
|
510
510
|
timeZone: "UTC",
|
|
511
511
|
dateStyle: n
|
|
512
512
|
});
|
|
513
|
-
return He(r, s) ? l.format(A(r)) :
|
|
513
|
+
return He(r, s) ? l.format(A(r)) : H(l, A(r), A(s));
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function Ge(e, t, a, o) {
|
|
516
516
|
if ((t == null ? void 0 : t.mode) === "pattern")
|
|
517
|
-
return
|
|
517
|
+
return Q(
|
|
518
518
|
e.map(
|
|
519
|
-
(l) =>
|
|
519
|
+
(l) => J(
|
|
520
520
|
l.toISOString(),
|
|
521
521
|
"instant",
|
|
522
522
|
t.pattern,
|
|
523
|
-
|
|
524
|
-
|
|
523
|
+
a,
|
|
524
|
+
o
|
|
525
525
|
)
|
|
526
526
|
)
|
|
527
527
|
);
|
|
528
|
-
const r = new Intl.DateTimeFormat(
|
|
528
|
+
const r = new Intl.DateTimeFormat(a.locale, {
|
|
529
529
|
calendar: "gregory",
|
|
530
|
-
timeZone:
|
|
531
|
-
dateStyle: (t == null ? void 0 : t.mode) === "style" ? t.dateStyle :
|
|
532
|
-
timeStyle:
|
|
530
|
+
timeZone: o.tz,
|
|
531
|
+
dateStyle: (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : a.dateTime.dateStyle,
|
|
532
|
+
timeStyle: a.dateTime.timeStyle
|
|
533
533
|
}), [s, n] = e;
|
|
534
|
-
return n && n.getTime() !== s.getTime() ?
|
|
534
|
+
return n && n.getTime() !== s.getTime() ? H(r, s, n) : r.format(s);
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
const
|
|
538
|
-
return typeof
|
|
536
|
+
function H(e, t, a) {
|
|
537
|
+
const o = e;
|
|
538
|
+
return typeof o.formatRange == "function" ? o.formatRange(t, a) : `${e.format(t)}${N}${e.format(a)}`;
|
|
539
539
|
}
|
|
540
|
-
function
|
|
541
|
-
const s =
|
|
540
|
+
function J(e, t, a, o, r) {
|
|
541
|
+
const s = ue({
|
|
542
542
|
format: {
|
|
543
543
|
type: "raw_temporal",
|
|
544
|
-
presentation: { mode: "pattern", dialect: "semaphor_tokens", pattern:
|
|
544
|
+
presentation: { mode: "pattern", dialect: "semaphor_tokens", pattern: a }
|
|
545
545
|
},
|
|
546
546
|
// Temporal formatting reads no currency.
|
|
547
547
|
preferences: {
|
|
548
|
-
...
|
|
548
|
+
...o,
|
|
549
549
|
defaultCurrency: we.defaultCurrency
|
|
550
550
|
},
|
|
551
551
|
calendar: { tz: r.tz }
|
|
552
|
-
}), n = t === "date" && Xe(
|
|
553
|
-
return
|
|
552
|
+
}), n = t === "date" && Xe(a) ? "instant" : t;
|
|
553
|
+
return ce({
|
|
554
554
|
value: n === t ? e : R(`${e}T00:00:00`, r.tz).toISOString(),
|
|
555
555
|
metadata: { kind: "raw_temporal", valueKind: n },
|
|
556
556
|
format: s
|
|
@@ -559,34 +559,34 @@ function H(e, t, o, a, r) {
|
|
|
559
559
|
function Xe(e) {
|
|
560
560
|
return /HH|mm|ss/.test(e);
|
|
561
561
|
}
|
|
562
|
-
function
|
|
563
|
-
return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(
|
|
562
|
+
function Q(e) {
|
|
563
|
+
return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(N);
|
|
564
564
|
}
|
|
565
565
|
function Ze(e, t) {
|
|
566
|
-
const
|
|
567
|
-
if (
|
|
566
|
+
const a = Ue.exec(e);
|
|
567
|
+
if (a) {
|
|
568
568
|
const r = {
|
|
569
|
-
year: Number(
|
|
570
|
-
month: Number(
|
|
571
|
-
day: Number(
|
|
569
|
+
year: Number(a[1]),
|
|
570
|
+
month: Number(a[2]),
|
|
571
|
+
day: Number(a[3])
|
|
572
572
|
};
|
|
573
573
|
return Je(r) ? { kind: "date", date: r } : null;
|
|
574
574
|
}
|
|
575
|
-
const
|
|
576
|
-
return
|
|
575
|
+
const o = Be.test(e) ? new Date(e.replace(" ", "T")) : Oe.test(e) ? R(e.replace(" ", "T"), t) : null;
|
|
576
|
+
return o && !Number.isNaN(o.getTime()) ? { kind: "instant", instant: o } : null;
|
|
577
577
|
}
|
|
578
578
|
function We(e, t) {
|
|
579
579
|
return e.kind === "instant" ? e.instant : R(`${I(e.date)}T00:00:00`, t);
|
|
580
580
|
}
|
|
581
|
-
function Ke(e, t,
|
|
581
|
+
function Ke(e, t, a) {
|
|
582
582
|
if (e.kind === "date") return e.date;
|
|
583
|
-
const
|
|
584
|
-
if (
|
|
585
|
-
const n =
|
|
583
|
+
const o = Le(e.instant, a), r = { year: o.year, month: o.month, day: o.day };
|
|
584
|
+
if (o.hour === 0 && o.minute === 0 && o.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? r : qe(r, -1);
|
|
585
|
+
const n = o.hour === 23 && o.minute === 59 && o.second === 59;
|
|
586
586
|
return t === "end" && n ? r : null;
|
|
587
587
|
}
|
|
588
|
-
function Ye(e, t,
|
|
589
|
-
return
|
|
588
|
+
function Ye(e, t, a) {
|
|
589
|
+
return a.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== ee(t.year, t.month) ? null : e.month === t.month ? "month" : e.month % 3 === 1 && t.month === e.month + 2 ? "quarter" : e.month === 1 && t.month === 12 ? "year" : null;
|
|
590
590
|
}
|
|
591
591
|
function I(e) {
|
|
592
592
|
return `${String(e.year).padStart(4, "0")}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}`;
|
|
@@ -596,48 +596,53 @@ function A(e) {
|
|
|
596
596
|
return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(0, 0, 0, 0), t;
|
|
597
597
|
}
|
|
598
598
|
function qe(e, t) {
|
|
599
|
-
const
|
|
600
|
-
return
|
|
601
|
-
year:
|
|
602
|
-
month:
|
|
603
|
-
day:
|
|
599
|
+
const a = A(e);
|
|
600
|
+
return a.setUTCDate(a.getUTCDate() + t), {
|
|
601
|
+
year: a.getUTCFullYear(),
|
|
602
|
+
month: a.getUTCMonth() + 1,
|
|
603
|
+
day: a.getUTCDate()
|
|
604
604
|
};
|
|
605
605
|
}
|
|
606
606
|
function He(e, t) {
|
|
607
607
|
return e.year === t.year && e.month === t.month && e.day === t.day;
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function ee(e, t) {
|
|
610
610
|
return new Date(Date.UTC(e, t, 0)).getUTCDate();
|
|
611
611
|
}
|
|
612
612
|
function Je(e) {
|
|
613
|
-
return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <=
|
|
613
|
+
return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= ee(e.year, e.month);
|
|
614
614
|
}
|
|
615
615
|
const Qe = /^\d{4}-\d{2}-\d{2}$/;
|
|
616
|
-
function
|
|
616
|
+
function te(e) {
|
|
617
617
|
const t = e.split(".");
|
|
618
618
|
return t[t.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((r) => r.charAt(0).toUpperCase() + r.slice(1).toLowerCase()).join(" ");
|
|
619
619
|
}
|
|
620
|
-
const
|
|
621
|
-
function
|
|
622
|
-
const
|
|
623
|
-
return
|
|
620
|
+
const z = 10;
|
|
621
|
+
function P(e, t) {
|
|
622
|
+
const a = e.slice(0, z).map(t).join(", "), o = e.length - z;
|
|
623
|
+
return o > 0 ? `${a}, and ${o} more` : a;
|
|
624
624
|
}
|
|
625
625
|
function et(e) {
|
|
626
626
|
if (e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between")
|
|
627
627
|
return;
|
|
628
|
-
const t =
|
|
628
|
+
const t = F(e.relativeMeta);
|
|
629
629
|
if (t)
|
|
630
630
|
return he(t) || t.unit === "quarter" || t.unit === "year" ? t : void 0;
|
|
631
631
|
}
|
|
632
|
-
function
|
|
633
|
-
|
|
632
|
+
function tt(e, t) {
|
|
633
|
+
if (t !== "label") return et(e);
|
|
634
|
+
if (!(e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between"))
|
|
635
|
+
return F(e.relativeMeta);
|
|
636
|
+
}
|
|
637
|
+
function j(e, t = {}) {
|
|
638
|
+
const { name: a, operation: o, values: r, valueType: s } = e, n = t.label ?? te(a), l = tt(e, t.relativeDates);
|
|
634
639
|
if (l) {
|
|
635
|
-
const i =
|
|
640
|
+
const i = Se(l);
|
|
636
641
|
if (i)
|
|
637
|
-
return
|
|
642
|
+
return o === "between" ? `${n}: ${i}` : `${n} not in ${i}`;
|
|
638
643
|
}
|
|
639
644
|
if (!r || r.length === 0)
|
|
640
|
-
return
|
|
645
|
+
return o === "is null" ? `${n} is empty` : o === "is not null" ? `${n} is not empty` : "";
|
|
641
646
|
const c = (i) => {
|
|
642
647
|
if (s === "date" && i) {
|
|
643
648
|
const g = e.temporalPrecision === "minute", f = {
|
|
@@ -658,7 +663,7 @@ function z(e, t = {}) {
|
|
|
658
663
|
timeZone: "UTC"
|
|
659
664
|
}).format(new Date(Date.UTC(u, m - 1, d)));
|
|
660
665
|
}
|
|
661
|
-
if (typeof i == "string" &&
|
|
666
|
+
if (typeof i == "string" && de(i) === "wall_datetime") {
|
|
662
667
|
const [u, m, d, y, p] = i.split(/[-T :.]/).map(Number);
|
|
663
668
|
return new Intl.DateTimeFormat(void 0, {
|
|
664
669
|
...f,
|
|
@@ -678,7 +683,7 @@ function z(e, t = {}) {
|
|
|
678
683
|
}
|
|
679
684
|
return String(i);
|
|
680
685
|
};
|
|
681
|
-
switch (
|
|
686
|
+
switch (o) {
|
|
682
687
|
case "=":
|
|
683
688
|
return `${n}: ${c(r[0])}`;
|
|
684
689
|
case "!=":
|
|
@@ -694,73 +699,84 @@ function z(e, t = {}) {
|
|
|
694
699
|
case "between":
|
|
695
700
|
case "not between": {
|
|
696
701
|
const i = `${c(r[0])} - ${c(r[1])}`;
|
|
697
|
-
return
|
|
702
|
+
return o === "between" ? `${n}: ${i}` : `${n} not in ${i}`;
|
|
698
703
|
}
|
|
699
704
|
case "in":
|
|
700
|
-
return r.length === 1 ? `${n}: ${c(r[0])}` : `${n}: ${
|
|
705
|
+
return r.length === 1 ? `${n}: ${c(r[0])}` : `${n}: ${P(r, c)}`;
|
|
701
706
|
case "not in":
|
|
702
|
-
return `${n} not in (${
|
|
707
|
+
return `${n} not in (${P(r, c)})`;
|
|
703
708
|
case "like":
|
|
704
709
|
return `${n} contains "${r[0]}"`;
|
|
705
710
|
case "not like":
|
|
706
711
|
return `${n} doesn't contain "${r[0]}"`;
|
|
707
712
|
default:
|
|
708
|
-
return `${n}: ${
|
|
713
|
+
return `${n}: ${P(r, c)}`;
|
|
709
714
|
}
|
|
710
715
|
}
|
|
711
|
-
function
|
|
716
|
+
function Nt(e, t = {}) {
|
|
712
717
|
if (!e || e.length === 0)
|
|
713
718
|
return "";
|
|
714
|
-
const
|
|
719
|
+
const a = /* @__PURE__ */ new Map();
|
|
715
720
|
e.forEach((r) => {
|
|
716
|
-
const s =
|
|
717
|
-
s.push(r),
|
|
721
|
+
const s = a.get(r.name) || [];
|
|
722
|
+
s.push(r), a.set(r.name, s);
|
|
718
723
|
});
|
|
719
|
-
const
|
|
720
|
-
return
|
|
724
|
+
const o = [];
|
|
725
|
+
return a.forEach((r, s) => {
|
|
721
726
|
if (r.length === 1) {
|
|
722
|
-
const n =
|
|
723
|
-
n &&
|
|
727
|
+
const n = j(r[0], t);
|
|
728
|
+
n && o.push(n);
|
|
724
729
|
} else {
|
|
725
|
-
const n =
|
|
726
|
-
l.length > 0 &&
|
|
730
|
+
const n = te(s), l = r.map((c) => j(c, t).replace(`${n}: `, "").replace(`${n} `, "")).filter(Boolean);
|
|
731
|
+
l.length > 0 && o.push(`${n}: ${l.join(" and ")}`);
|
|
727
732
|
}
|
|
728
|
-
}),
|
|
733
|
+
}), o.join(" | ");
|
|
734
|
+
}
|
|
735
|
+
function Vt(e) {
|
|
736
|
+
return ((e == null ? void 0 : e.filterValues) ?? []).filter(rt).map(at);
|
|
729
737
|
}
|
|
730
|
-
|
|
738
|
+
function rt(e) {
|
|
739
|
+
return !!e && typeof e == "object" && typeof e.name == "string" && Array.isArray(e.values);
|
|
740
|
+
}
|
|
741
|
+
function at(e) {
|
|
742
|
+
if (!("relativeMeta" in e) || e.relativeMeta === void 0) return e;
|
|
743
|
+
const { relativeMeta: t, ...a } = e, o = F(t);
|
|
744
|
+
return o ? { ...a, relativeMeta: o } : a;
|
|
745
|
+
}
|
|
746
|
+
const ot = /* @__PURE__ */ new Set([
|
|
731
747
|
"day",
|
|
732
748
|
"week",
|
|
733
749
|
"month",
|
|
734
750
|
"quarter",
|
|
735
751
|
"year"
|
|
736
752
|
]);
|
|
737
|
-
function
|
|
753
|
+
function nt(e, t) {
|
|
738
754
|
try {
|
|
739
|
-
const
|
|
755
|
+
const a = b(
|
|
740
756
|
v(e),
|
|
741
757
|
t,
|
|
742
758
|
"yyyy-MM-dd"
|
|
743
|
-
), [
|
|
759
|
+
), [o, r, s] = a.split("-").map(Number), n = new Date(Date.UTC(o, r - 1, s));
|
|
744
760
|
return n.setUTCDate(n.getUTCDate() - 1), b(n, "UTC", "yyyy-MM-dd");
|
|
745
761
|
} catch {
|
|
746
762
|
return;
|
|
747
763
|
}
|
|
748
764
|
}
|
|
749
|
-
function
|
|
750
|
-
const r =
|
|
765
|
+
function Ut(e, t, a, o = !1) {
|
|
766
|
+
const r = st(
|
|
751
767
|
e,
|
|
752
768
|
t,
|
|
753
|
-
|
|
754
|
-
|
|
769
|
+
a,
|
|
770
|
+
o
|
|
755
771
|
);
|
|
756
772
|
return `${r.start} - ${r.end}`;
|
|
757
773
|
}
|
|
758
|
-
function
|
|
774
|
+
function st(e, t, a, o = !1) {
|
|
759
775
|
try {
|
|
760
|
-
if (
|
|
761
|
-
const r =
|
|
776
|
+
if (a && ot.has(a)) {
|
|
777
|
+
const r = nt(e.end, t);
|
|
762
778
|
if (r) {
|
|
763
|
-
const s =
|
|
779
|
+
const s = o ? "MMM d" : "MMM d, yyyy";
|
|
764
780
|
return {
|
|
765
781
|
start: b(
|
|
766
782
|
v(e.start),
|
|
@@ -775,8 +791,8 @@ function ot(e, t, o, a = !1) {
|
|
|
775
791
|
};
|
|
776
792
|
}
|
|
777
793
|
}
|
|
778
|
-
if (
|
|
779
|
-
const r =
|
|
794
|
+
if (a === "second" || a === "minute" || a === "hour") {
|
|
795
|
+
const r = o ? "MMM d, h:mm a" : "MMM d, yyyy, h:mm a";
|
|
780
796
|
return {
|
|
781
797
|
start: b(v(e.start), t, r),
|
|
782
798
|
end: `before ${b(
|
|
@@ -790,15 +806,15 @@ function ot(e, t, o, a = !1) {
|
|
|
790
806
|
}
|
|
791
807
|
return { start: e.start, end: `before ${e.end}` };
|
|
792
808
|
}
|
|
793
|
-
const
|
|
809
|
+
const lt = "__TOTAL__";
|
|
794
810
|
function $(e) {
|
|
795
811
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
796
812
|
}
|
|
797
813
|
function D(e) {
|
|
798
|
-
return e ===
|
|
814
|
+
return e === lt;
|
|
799
815
|
}
|
|
800
|
-
function
|
|
801
|
-
const t = /* @__PURE__ */ new Map(),
|
|
816
|
+
function Ot(e) {
|
|
817
|
+
const t = /* @__PURE__ */ new Map(), a = (e.groupByColumns ?? []).map((r, s) => {
|
|
802
818
|
var i, g, f;
|
|
803
819
|
if (!$(r))
|
|
804
820
|
throw new Error(`Aggregate groupByColumns[${s}] is invalid`);
|
|
@@ -808,36 +824,36 @@ function Ft(e) {
|
|
|
808
824
|
return [n, r.alias, r.name, c].forEach((h) => {
|
|
809
825
|
typeof h == "string" && h.length > 0 && t.set(h, c);
|
|
810
826
|
}), c;
|
|
811
|
-
}),
|
|
827
|
+
}), o = (e.rowAggregates ?? []).flatMap((r) => !$(r) || typeof r.function != "string" || typeof r.groupLevel != "string" ? [] : [
|
|
812
828
|
{
|
|
813
829
|
function: r.function,
|
|
814
830
|
groupLevel: r.groupLevel === "ALL" ? "ALL" : t.get(r.groupLevel) || r.groupLevel,
|
|
815
831
|
...typeof r.label == "string" ? { label: r.label } : {}
|
|
816
832
|
}
|
|
817
833
|
]);
|
|
818
|
-
return { groupColumnKeys:
|
|
834
|
+
return { groupColumnKeys: a, rowAggregates: o };
|
|
819
835
|
}
|
|
820
|
-
function
|
|
836
|
+
function re(e) {
|
|
821
837
|
return e === "SUM" ? "Total" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
|
|
822
838
|
}
|
|
823
|
-
function
|
|
824
|
-
var
|
|
839
|
+
function it(e) {
|
|
840
|
+
var a;
|
|
825
841
|
if (e.customLabel) return e.customLabel;
|
|
826
|
-
const t =
|
|
842
|
+
const t = re(e.aggregateFunction);
|
|
827
843
|
if (e.levelValue !== void 0 && !D(e.levelValue)) {
|
|
828
844
|
if (e.levelValue === null) {
|
|
829
|
-
const r = (
|
|
845
|
+
const r = (a = e.formatValue) == null ? void 0 : a.call(e, null);
|
|
830
846
|
return r ? `Subtotal ${r}` : `Subtotal ${t}`;
|
|
831
847
|
}
|
|
832
|
-
const
|
|
833
|
-
if (
|
|
848
|
+
const o = e.formatValue ? e.formatValue(e.levelValue) : String(e.levelValue);
|
|
849
|
+
if (o) return `Subtotal (${o})`;
|
|
834
850
|
}
|
|
835
851
|
return `Subtotal ${t}`;
|
|
836
852
|
}
|
|
837
|
-
function
|
|
838
|
-
return t || `Grand ${
|
|
853
|
+
function ut(e, t) {
|
|
854
|
+
return t || `Grand ${re(e)}`;
|
|
839
855
|
}
|
|
840
|
-
function
|
|
856
|
+
function Bt(e) {
|
|
841
857
|
const t = e.context.groupColumnKeys.indexOf(e.columnKey);
|
|
842
858
|
if (t < 0)
|
|
843
859
|
throw new Error(
|
|
@@ -847,21 +863,21 @@ function Nt(e) {
|
|
|
847
863
|
row: e.row,
|
|
848
864
|
previousRow: e.previousRow,
|
|
849
865
|
levelIndex: t,
|
|
850
|
-
getValue: (
|
|
866
|
+
getValue: (a, o) => a[e.context.groupColumnKeys[o]]
|
|
851
867
|
});
|
|
852
868
|
}
|
|
853
|
-
function
|
|
854
|
-
var
|
|
855
|
-
const t = e.context.groupColumnKeys,
|
|
869
|
+
function ae(e) {
|
|
870
|
+
var o, r;
|
|
871
|
+
const t = e.context.groupColumnKeys, a = typeof e.row.aggregate == "string" ? e.row.aggregate : "SUM";
|
|
856
872
|
if (e.row.isGrandTotal === !0) {
|
|
857
|
-
const s = (
|
|
873
|
+
const s = (o = e.context.rowAggregates.find(
|
|
858
874
|
(n) => n.groupLevel === "ALL"
|
|
859
|
-
)) == null ? void 0 :
|
|
875
|
+
)) == null ? void 0 : o.label;
|
|
860
876
|
return {
|
|
861
877
|
kind: "grand-total",
|
|
862
878
|
cells: t.map((n, l) => ({
|
|
863
879
|
columnKey: n,
|
|
864
|
-
text: l === 0 ?
|
|
880
|
+
text: l === 0 ? ut(a, s) : "",
|
|
865
881
|
placement: l === 0 ? "label" : "empty",
|
|
866
882
|
colSpan: l === 0 ? t.length : 1
|
|
867
883
|
}))
|
|
@@ -876,7 +892,7 @@ function re(e) {
|
|
|
876
892
|
`Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`
|
|
877
893
|
);
|
|
878
894
|
const n = $(e.row.subtotalContext) ? e.row.subtotalContext : void 0, l = $(n == null ? void 0 : n.groupByValues) ? n.groupByValues : {}, c = (r = e.context.rowAggregates.find(
|
|
879
|
-
(i) => i.groupLevel === e.row.subtotalLevel && i.function ===
|
|
895
|
+
(i) => i.groupLevel === e.row.subtotalLevel && i.function === a
|
|
880
896
|
)) == null ? void 0 : r.label;
|
|
881
897
|
return {
|
|
882
898
|
kind: "subtotal",
|
|
@@ -899,8 +915,8 @@ function re(e) {
|
|
|
899
915
|
}
|
|
900
916
|
return {
|
|
901
917
|
columnKey: i,
|
|
902
|
-
text:
|
|
903
|
-
aggregateFunction:
|
|
918
|
+
text: it({
|
|
919
|
+
aggregateFunction: a,
|
|
904
920
|
customLabel: c,
|
|
905
921
|
levelValue: l[i],
|
|
906
922
|
formatValue: (f) => e.formatLabelValue ? e.formatLabelValue(f, i) : String(e.formatValue(f, i) ?? "")
|
|
@@ -924,56 +940,57 @@ function re(e) {
|
|
|
924
940
|
})
|
|
925
941
|
};
|
|
926
942
|
}
|
|
927
|
-
function
|
|
928
|
-
const t =
|
|
929
|
-
(
|
|
943
|
+
function zt(e) {
|
|
944
|
+
const t = ae(e).cells.find(
|
|
945
|
+
(a) => a.columnKey === e.columnKey
|
|
930
946
|
);
|
|
931
947
|
if (!t)
|
|
932
948
|
throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);
|
|
933
949
|
return t.text;
|
|
934
950
|
}
|
|
935
|
-
function
|
|
936
|
-
return
|
|
951
|
+
function jt(e) {
|
|
952
|
+
return ae(e).cells.map((t) => t.text);
|
|
937
953
|
}
|
|
938
954
|
export {
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
955
|
+
lt as A,
|
|
956
|
+
D as B,
|
|
957
|
+
Ot as C,
|
|
958
|
+
Me as D,
|
|
959
|
+
it as E,
|
|
960
|
+
Ct as F,
|
|
961
|
+
ut as G,
|
|
962
|
+
Bt as H,
|
|
963
|
+
ae as I,
|
|
964
|
+
zt as J,
|
|
965
|
+
jt as K,
|
|
966
|
+
_e as L,
|
|
967
|
+
Mt as M,
|
|
968
|
+
st as N,
|
|
969
|
+
Pe as P,
|
|
970
|
+
St as a,
|
|
971
|
+
At as b,
|
|
972
|
+
kt as c,
|
|
973
|
+
_t as d,
|
|
957
974
|
De as e,
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
975
|
+
Ut as f,
|
|
976
|
+
It as g,
|
|
977
|
+
Et as h,
|
|
978
|
+
xt as i,
|
|
962
979
|
Ae as j,
|
|
963
980
|
$e as k,
|
|
964
|
-
|
|
965
|
-
|
|
981
|
+
xe as l,
|
|
982
|
+
Pt as m,
|
|
966
983
|
Fe as n,
|
|
967
984
|
Ne as o,
|
|
968
985
|
Ie as p,
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
986
|
+
Dt as q,
|
|
987
|
+
$t as r,
|
|
988
|
+
Rt as s,
|
|
989
|
+
Ft as t,
|
|
990
|
+
z as u,
|
|
974
991
|
ze as v,
|
|
975
992
|
et as w,
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
993
|
+
j as x,
|
|
994
|
+
Nt as y,
|
|
995
|
+
Vt as z
|
|
979
996
|
};
|