react-semaphor 0.1.579 → 0.1.581
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 +52 -50
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/add-to-dashboard-DhP8wVtM.js +291 -0
- package/dist/chunks/{assistant-chat-DBuKmREJ.js → assistant-chat-CUwGURJj.js} +2261 -2184
- package/dist/chunks/{bookmark-impact-MH4Dr-Ya.js → bookmark-impact-BNyR-yDX.js} +1 -1
- package/dist/chunks/{card-filter-builder-B9vtXVIZ.js → card-filter-builder-k9yqDSw8.js} +168 -180
- package/dist/chunks/{comparison-window-caption-PtcDWvkN.js → comparison-window-caption-DdLqMgiG.js} +180 -183
- package/dist/chunks/{dashboard-C4fyqxvV.js → dashboard-DvcAk8uJ.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-A9CLFv0s.js → dashboard-briefing-launcher-DBgS97ZH.js} +154 -154
- package/dist/chunks/{dashboard-controls-oKDW-835.js → dashboard-controls-BiZ1rlNC.js} +7 -7
- package/dist/chunks/{dashboard-json-Bej2NBkS.js → dashboard-json-B25xzYcJ.js} +1 -1
- package/dist/chunks/{dates-BhL-mimk.js → dates-3Pah03_l.js} +4 -4
- package/dist/chunks/{edit-dashboard-visual-BFsCY2GP.js → edit-dashboard-visual-DYuO3mEU.js} +8 -9
- package/dist/chunks/{filter-reach-copy-Xus3MfSo.js → filter-reach-copy-CzLt96tq.js} +124 -124
- package/dist/chunks/{index-CwlaI-UP.js → index-BMZq6JT6.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-CcekIvkV.js → report-preferences-dialog-DpAetrdY.js} +7 -7
- package/dist/chunks/{resolve-dashboard-input-context-DoZHMivF.js → resolve-dashboard-input-context-CNxtkCzj.js} +6265 -6190
- package/dist/chunks/{saved-dashboard-context-LiDPCJ3r.js → saved-dashboard-context-Bnt0H7mi.js} +2 -2
- package/dist/chunks/{semaphor-ready-indicator-cAOfbBuc.js → semaphor-ready-indicator-Dwmvmf0S.js} +15009 -14989
- package/dist/chunks/{shelf-drop-preview-context-CwoYR7v1.js → shelf-drop-preview-context-CiveteBS.js} +2 -2
- package/dist/chunks/{stored-dashboard-CjnPEWO-.js → stored-dashboard-D3gu-D7A.js} +66 -66
- package/dist/chunks/{table-export-sheet-CP8zSOhj.js → table-export-sheet-BNGSJA2N.js} +1 -1
- package/dist/chunks/{variable-draft-T4EOBvcu.js → variable-draft-C3_RL2gI.js} +2 -2
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +356 -349
- package/dist/format-utils/index.js +4 -4
- package/dist/index.js +11 -11
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/shared/assistant-protocol/model-change.d.ts +23 -3
- package/dist/types/shared/assistant-protocol/parts.d.ts +10 -1
- package/dist/types/shared/dashboard-authoring/changes/aggregates.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +9 -58
- package/dist/types/shared/dashboard-authoring/changes/domain-change.d.ts +1738 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/add-to-dashboard-DQFuDA5R.js +0 -271
package/dist/chunks/{comparison-window-caption-PtcDWvkN.js → comparison-window-caption-DdLqMgiG.js}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { au as
|
|
2
|
-
import { h as W, e as
|
|
3
|
-
import { aU as K, a5 as
|
|
1
|
+
import { au as Ye, i as Ze, j, m as Je, K as De, av as ie, aw as Ae, ax as Qe, ay as ke, az as Re, ai as et, an as tt, aj as rt, f as nt, a as B, $ as pe, ab as ot, Z as at, ac as st, ad as it, o as he, s as ct, R as be, T as lt, V as ut, a0 as mt, aA as A, aB as U } from "./temporal-input-presentation-CqbJjIuu.js";
|
|
2
|
+
import { h as W, e as dt, p as ft, k as pt } from "./export-file-format-C-tJsxsf.js";
|
|
3
|
+
import { aU as K, a5 as ht, m as G, aT as bt, j as yt, r as Y } from "./validators-B8fpdinG.js";
|
|
4
4
|
import "./matrix-operation-contract-DCVinw1o.js";
|
|
5
5
|
import "./analytics-base-schemas-BaIQrEzX.js";
|
|
6
|
-
import { readPdfCapacityFacts as
|
|
7
|
-
import { p as
|
|
8
|
-
import { c as
|
|
9
|
-
import { v as
|
|
10
|
-
import { a as
|
|
6
|
+
import { readPdfCapacityFacts as gt, PDF_SAFETY_LIMIT_EXCEEDED as ce, PDF_CAPACITY as D, PDF_NUMBER_COLUMN_TOO_WIDE as Ne, getUtf8ByteLength as wt, FAST_PDF_POLICY as Ct, isPdfCapacityRefusalCode as vt } from "../pdf-export-policy/index.js";
|
|
7
|
+
import { p as _t } from "./pivot-result-contract-expectations-C-HnUKYe.js";
|
|
8
|
+
import { c as xt, b as ye } from "./pivot-result-identity-B89X5xjb.js";
|
|
9
|
+
import { v as Tt, c as Et } from "./raw-temporal-value-DdT0s47W.js";
|
|
10
|
+
import { a as Oe } from "./metric-comparison-n9NsIa-2.js";
|
|
11
11
|
import "../value-format-preferences/index.js";
|
|
12
|
-
function
|
|
12
|
+
function $t(e, t, r) {
|
|
13
13
|
const n = {
|
|
14
14
|
...t,
|
|
15
15
|
locale: t.locale ?? r
|
|
@@ -23,12 +23,12 @@ function Et(e, t, r) {
|
|
|
23
23
|
})}${c ?? ""}`;
|
|
24
24
|
}
|
|
25
25
|
function ee(e, t, r) {
|
|
26
|
-
return e === null ? { value: e, text: null } : !t || !
|
|
26
|
+
return e === null ? { value: e, text: null } : !t || !Ze(t) && t.type !== "duration" ? {
|
|
27
27
|
value: e,
|
|
28
28
|
text: j(e, { type: "number", locale: r })
|
|
29
29
|
} : t.type === "duration" ? {
|
|
30
30
|
value: e,
|
|
31
|
-
text:
|
|
31
|
+
text: Je(e, {
|
|
32
32
|
inputUnit: t.inputUnit,
|
|
33
33
|
outputStyle: t.outputStyle,
|
|
34
34
|
largestUnit: t.largestUnit,
|
|
@@ -38,7 +38,7 @@ function ee(e, t, r) {
|
|
|
38
38
|
suffix: t.suffix,
|
|
39
39
|
negativeInParentheses: t.negativeStyle === "parentheses"
|
|
40
40
|
})
|
|
41
|
-
} : { value: e, text:
|
|
41
|
+
} : { value: e, text: $t(e, t, r) };
|
|
42
42
|
}
|
|
43
43
|
function ge(e, t, r, n) {
|
|
44
44
|
return e === null ? { value: e, text: null } : n === "percent" ? {
|
|
@@ -83,7 +83,7 @@ function Or(e, t) {
|
|
|
83
83
|
};
|
|
84
84
|
return (t.displayMode === "difference" || t.displayMode === "both") && (r.difference = ee(
|
|
85
85
|
e.delta,
|
|
86
|
-
|
|
86
|
+
Ye(t.metricFormat),
|
|
87
87
|
t.locale
|
|
88
88
|
)), (t.displayMode === "percent_change" || t.displayMode === "both") && (r.percentChange = ge(
|
|
89
89
|
e.percentChange,
|
|
@@ -97,19 +97,19 @@ function Or(e, t) {
|
|
|
97
97
|
"ratio"
|
|
98
98
|
)), r;
|
|
99
99
|
}
|
|
100
|
-
const
|
|
101
|
-
function
|
|
100
|
+
const Ft = /* @__PURE__ */ new Set(["second", "minute", "hour", "day", "month"]);
|
|
101
|
+
function St(e) {
|
|
102
102
|
const { presentation: t } = e;
|
|
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" ?
|
|
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" ? Ft.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";
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Lt(e) {
|
|
106
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));
|
|
107
107
|
return n === 0 ? "" : `.${"0".repeat(n)}`;
|
|
108
108
|
}
|
|
109
109
|
function te(e) {
|
|
110
110
|
return `"${e.replace(/"/g, "")}"`;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function Pt(e) {
|
|
113
113
|
let t;
|
|
114
114
|
try {
|
|
115
115
|
t = new Intl.NumberFormat(e.locale ?? "en-US", {
|
|
@@ -127,25 +127,25 @@ function Lt(e) {
|
|
|
127
127
|
text: o(n + 1, r) + t[r].value
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
|
-
function
|
|
131
|
-
const t =
|
|
130
|
+
function It(e) {
|
|
131
|
+
const t = Lt(e);
|
|
132
132
|
let r;
|
|
133
133
|
if (e.type === "scientific")
|
|
134
134
|
r = `0${t}E+00`;
|
|
135
135
|
else {
|
|
136
136
|
const n = `${e.useGrouping === !1 ? "0" : "#,##0"}${t}`;
|
|
137
137
|
if (e.type === "currency") {
|
|
138
|
-
const o =
|
|
138
|
+
const o = Pt(e);
|
|
139
139
|
r = o ? o.side === "before" ? `${te(o.text)}${n}` : `${n}${te(o.text)}` : n;
|
|
140
140
|
} else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${n}${te("%")}` : `${n}%` : r = n;
|
|
141
141
|
}
|
|
142
142
|
return e.negativeStyle === "parentheses" ? `${r};(${r})` : r;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function Mt(e, t) {
|
|
145
145
|
if (!e.formattedValues) return;
|
|
146
146
|
const { presentation: r } = e;
|
|
147
147
|
if (t === "number" || t === "by_value")
|
|
148
|
-
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 : It(r.format);
|
|
149
149
|
if (t === "date") {
|
|
150
150
|
if ((r == null ? void 0 : r.kind) === "temporal_bucket")
|
|
151
151
|
return r.grain === "day" ? "yyyy-mm-dd" : r.grain === "month" ? "mmm yyyy" : "yyyy-mm-dd hh:mm";
|
|
@@ -154,7 +154,7 @@ function It(e, t) {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
function Ce(e) {
|
|
157
|
-
const t =
|
|
157
|
+
const t = St(e), r = Mt(e, t);
|
|
158
158
|
return Object.freeze({
|
|
159
159
|
key: e.key,
|
|
160
160
|
label: e.label,
|
|
@@ -162,18 +162,18 @@ function Ce(e) {
|
|
|
162
162
|
...r === void 0 ? {} : { numberFormat: r }
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
|
-
const
|
|
166
|
-
function
|
|
167
|
-
return
|
|
165
|
+
const Dt = 15, At = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
|
|
166
|
+
function Ue(e) {
|
|
167
|
+
return At.test(e) ? e : void 0;
|
|
168
168
|
}
|
|
169
169
|
function ve(e) {
|
|
170
170
|
const r = e.replace(/^-/, "").replace(/[eE].*$/, "").replace(".", "").replace(/^0+/, "").replace(/0+$/, "");
|
|
171
|
-
if (r.length >
|
|
171
|
+
if (r.length > Dt) return !1;
|
|
172
172
|
const n = Number(e);
|
|
173
173
|
return Number.isFinite(n) && (n !== 0 || r.length === 0);
|
|
174
174
|
}
|
|
175
|
-
const
|
|
176
|
-
function
|
|
175
|
+
const kt = Date.UTC(1900, 2, 1), Rt = Date.UTC(1e4, 0, 1), Nt = Date.UTC(1899, 11, 30), Ot = 864e5;
|
|
176
|
+
function Ut(e) {
|
|
177
177
|
const t = Date.UTC(
|
|
178
178
|
e.year,
|
|
179
179
|
e.month - 1,
|
|
@@ -182,8 +182,8 @@ function Ot(e) {
|
|
|
182
182
|
e.minute,
|
|
183
183
|
e.second
|
|
184
184
|
);
|
|
185
|
-
if (!(e.year < 1900 || !Number.isFinite(t)) && !(t <
|
|
186
|
-
return (t -
|
|
185
|
+
if (!(e.year < 1900 || !Number.isFinite(t)) && !(t < kt || t >= Rt))
|
|
186
|
+
return (t - Nt) / Ot;
|
|
187
187
|
}
|
|
188
188
|
function _e(e, t, r) {
|
|
189
189
|
if (typeof e == "number")
|
|
@@ -191,7 +191,7 @@ function _e(e, t, r) {
|
|
|
191
191
|
if (K(e))
|
|
192
192
|
return ve(e.value) ? { kind: "number", text: t, value: e } : void 0;
|
|
193
193
|
if (r && typeof e == "string") {
|
|
194
|
-
const n =
|
|
194
|
+
const n = Ue(e);
|
|
195
195
|
return n !== void 0 && ve(n) ? { kind: "number", text: t, value: n } : void 0;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
@@ -203,7 +203,7 @@ function X(e) {
|
|
|
203
203
|
case "text":
|
|
204
204
|
return o;
|
|
205
205
|
case "date": {
|
|
206
|
-
const c = e.wallClock ?
|
|
206
|
+
const c = e.wallClock ? Ut(e.wallClock) : void 0;
|
|
207
207
|
return c === void 0 ? o : { kind: "date", text: r, serial: c };
|
|
208
208
|
}
|
|
209
209
|
case "number":
|
|
@@ -217,12 +217,12 @@ function X(e) {
|
|
|
217
217
|
function Ur(e) {
|
|
218
218
|
return e.kind === "empty" ? "" : e.text;
|
|
219
219
|
}
|
|
220
|
-
const
|
|
220
|
+
const je = 1e4, jt = 1e6, jr = 5e6, Kr = 1024 ** 3, Vr = 1024 ** 3;
|
|
221
221
|
function Br(e) {
|
|
222
|
-
return e >
|
|
222
|
+
return e > je;
|
|
223
223
|
}
|
|
224
224
|
function Xr(e) {
|
|
225
|
-
return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <=
|
|
225
|
+
return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= je ? "direct" : e.loadedRowCount <= jt ? "background" : "blocked";
|
|
226
226
|
}
|
|
227
227
|
const zr = {
|
|
228
228
|
rowLabels: "tabular",
|
|
@@ -247,13 +247,13 @@ function Hr(e, t) {
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
const
|
|
251
|
-
function
|
|
250
|
+
const Kt = 2;
|
|
251
|
+
function Vt(e) {
|
|
252
252
|
return typeof e == "number" ? Number.isInteger(e) : K(e) ? !e.value.includes(".") : !0;
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function Bt(e, t, r) {
|
|
255
255
|
const n = e.descriptors.measures.filter(
|
|
256
|
-
(s) => r.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 &&
|
|
256
|
+
(s) => r.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 && ht(s.column.dataType) === "number"
|
|
257
257
|
);
|
|
258
258
|
if (n.length === 0) return r;
|
|
259
259
|
const o = /* @__PURE__ */ new Set();
|
|
@@ -261,7 +261,7 @@ function Vt(e, t, r) {
|
|
|
261
261
|
if (!(s.kind !== "measure" || o.has(s.measureId)))
|
|
262
262
|
for (const f of t) {
|
|
263
263
|
const h = f.values[l];
|
|
264
|
-
if ((h == null ? void 0 : h.kind) === "value" && !
|
|
264
|
+
if ((h == null ? void 0 : h.kind) === "value" && !Vt(h.value)) {
|
|
265
265
|
o.add(s.measureId);
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
@@ -269,7 +269,7 @@ function Vt(e, t, r) {
|
|
|
269
269
|
});
|
|
270
270
|
const c = { ...r.measureFormats };
|
|
271
271
|
for (const { id: s } of n) {
|
|
272
|
-
const l = o.has(s) ?
|
|
272
|
+
const l = o.has(s) ? Kt : 0;
|
|
273
273
|
c[s] = {
|
|
274
274
|
type: "number",
|
|
275
275
|
minimumFractionDigits: l,
|
|
@@ -282,35 +282,35 @@ function Vt(e, t, r) {
|
|
|
282
282
|
function z(e) {
|
|
283
283
|
return G(e.slice(0, -1));
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function Xt(e, t) {
|
|
286
286
|
return t.length > e.length && G(t.slice(0, e.length)) === G(e);
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function zt(e) {
|
|
289
289
|
return e.map((t, r) => {
|
|
290
290
|
if (r === 0 || t.kind !== "layout") return !1;
|
|
291
291
|
const n = e[r - 1];
|
|
292
292
|
if (n.kind !== "layout") return !1;
|
|
293
|
-
if (t.role !== "member" ||
|
|
293
|
+
if (t.role !== "member" || Xt(n.rowPath, t.rowPath)) return !0;
|
|
294
294
|
const o = e[r - 2];
|
|
295
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);
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
|
-
const
|
|
299
|
-
function
|
|
298
|
+
const Ht = "pdf-group-continuation";
|
|
299
|
+
function Ke(e, t, r) {
|
|
300
300
|
return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || K(t.value)) ? e : W(e);
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
const n =
|
|
302
|
+
function Gt(e, t, r) {
|
|
303
|
+
const n = De(e.descriptors, t.presentation, r), o = e.columns.map((u) => {
|
|
304
304
|
var a;
|
|
305
305
|
return u.kind === "measure" && ((a = n.measureSemantics.get(u.measureId)) == null ? void 0 : a.isNumeric) === !0;
|
|
306
|
-
}), c = (u) => ie([u], n.levels), s = (u, a, m) =>
|
|
306
|
+
}), c = (u) => ie([u], n.levels), s = (u, a, m) => Ae(u, a, t.presentation.totals[m], n.levels), l = e.columns.map((u) => {
|
|
307
307
|
if (u.kind !== "measure") return u.label;
|
|
308
308
|
const a = u.columnPath.map(c);
|
|
309
309
|
return u.role !== "member" && a.push(s(u.columnPath, u.role, "columns")), [...a, u.label].join(" / ");
|
|
310
310
|
}), f = Math.min(t.spec.columns.length, Math.max(
|
|
311
311
|
0,
|
|
312
312
|
...e.columns.map((u) => u.kind === "measure" ? u.columnPath.length + (u.role !== "member" ? 1 : 0) : 0)
|
|
313
|
-
)), h = 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") : "")), d = (u, a) =>
|
|
313
|
+
)), h = 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") : "")), d = (u, a) => Qe({
|
|
314
314
|
path: u.rowPath,
|
|
315
315
|
role: u.kind === "layout" ? u.role : "member",
|
|
316
316
|
levelCount: Math.max(1, t.spec.rows.length),
|
|
@@ -330,11 +330,11 @@ function Ht(e, t, r) {
|
|
|
330
330
|
const v = u.values[b], w = n.measures.get(y.measureId);
|
|
331
331
|
if (v.kind === "value" && !w)
|
|
332
332
|
throw new Error("Matrix value is missing its measure descriptor.");
|
|
333
|
-
return
|
|
333
|
+
return ke(v, w, t.presentation.absence);
|
|
334
334
|
});
|
|
335
335
|
}, x = (u, a) => p(u, a).map((m, y) => {
|
|
336
336
|
const b = e.columns[y];
|
|
337
|
-
return b.kind === "measure" ?
|
|
337
|
+
return b.kind === "measure" ? Ke(m, u.values[y], n.measureSemantics.get(b.measureId)) : W(m);
|
|
338
338
|
});
|
|
339
339
|
return {
|
|
340
340
|
headers: l,
|
|
@@ -376,12 +376,12 @@ function Gr(e) {
|
|
|
376
376
|
return e.columns.map((t) => W(t.label));
|
|
377
377
|
}
|
|
378
378
|
function qr(e, t, r) {
|
|
379
|
-
return
|
|
379
|
+
return qt(e, t, r).map((n, o) => {
|
|
380
380
|
const c = t.columns[o];
|
|
381
|
-
return c.kind === "measure" ?
|
|
381
|
+
return c.kind === "measure" ? Ke(n, e.values[o], r.measureSemantics.get(c.measureId)) : W(n);
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function qt(e, t, r) {
|
|
385
385
|
if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
|
|
386
386
|
if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
|
|
387
387
|
const n = [...e.rowPath, ...e.columnPath];
|
|
@@ -389,15 +389,15 @@ function Gt(e, t, r) {
|
|
|
389
389
|
if (o.kind === "measure") {
|
|
390
390
|
const l = e.values[c], f = r.measures.get(o.measureId);
|
|
391
391
|
if (l.kind === "value" && !f) throw new Error("Matrix value is missing its measure descriptor.");
|
|
392
|
-
return
|
|
392
|
+
return ke(l, f, r.absence);
|
|
393
393
|
}
|
|
394
394
|
const s = o.kind === "level" ? n.find((l) => l.levelId === o.levelId) : void 0;
|
|
395
395
|
if (!s) throw new Error("Flat Matrix row does not match its frozen layout.");
|
|
396
396
|
return ie([s], r.levels);
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
|
-
function
|
|
400
|
-
const t =
|
|
399
|
+
function Wt(e) {
|
|
400
|
+
const t = Gt(e.layout, e.request, e.report), r = e.layout.columns.map((s, l) => ({
|
|
401
401
|
index: l,
|
|
402
402
|
columnId: `matrix:${l}`,
|
|
403
403
|
label: t.headers[l],
|
|
@@ -418,7 +418,7 @@ function qt(e) {
|
|
|
418
418
|
cells: [
|
|
419
419
|
...c ? [{ ...n("", 0, !0), colspan: c }] : [],
|
|
420
420
|
{
|
|
421
|
-
...n(e.request.spec.columns.map((s) =>
|
|
421
|
+
...n(e.request.spec.columns.map((s) => Re(s, e.request.presentation)).join(" / "), c, !0),
|
|
422
422
|
colspan: e.layout.columns.length - c,
|
|
423
423
|
isNumeric: !1,
|
|
424
424
|
className: ""
|
|
@@ -442,7 +442,7 @@ function qt(e) {
|
|
|
442
442
|
subtotalLevel: String(s.rowPath.length),
|
|
443
443
|
// A tabular layout prints each label once unless it repeats them; the
|
|
444
444
|
// blank cell continues its group, so a grid draws no rule above it.
|
|
445
|
-
cells: t.row(s, e.rows[l - 1]).map((h, d) => f.has(d) ? { ...n(h, d, !1), className:
|
|
445
|
+
cells: t.row(s, e.rows[l - 1]).map((h, d) => f.has(d) ? { ...n(h, d, !1), className: Ht } : n(h, d, !1))
|
|
446
446
|
};
|
|
447
447
|
}),
|
|
448
448
|
grandTotal: null,
|
|
@@ -459,25 +459,25 @@ function qt(e) {
|
|
|
459
459
|
}
|
|
460
460
|
};
|
|
461
461
|
}
|
|
462
|
-
function
|
|
463
|
-
const { levels: n } =
|
|
462
|
+
function Yt(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((h, d) => {
|
|
464
464
|
if (h.kind !== "measure") return null;
|
|
465
465
|
const p = o ? `${h.role}:${G(h.columnPath)}` : `measure:${d}`;
|
|
466
466
|
let x = c.indexOf(p);
|
|
467
|
-
return x < 0 && (x = c.push(p) - 1, s.push(o ?
|
|
467
|
+
return x < 0 && (x = c.push(p) - 1, s.push(o ? Ae(h.columnPath, h.role, t.presentation.totals.columns, n) : h.label)), x;
|
|
468
468
|
}), f = t.spec.columns[t.spec.columns.length - 1];
|
|
469
469
|
return {
|
|
470
470
|
columnGroups: l,
|
|
471
471
|
groupLabels: s,
|
|
472
472
|
/** What bands name their groups by: the innermost column level, or "Measures". */
|
|
473
|
-
groupLevelLabel: f ?
|
|
473
|
+
groupLevelLabel: f ? Re(f, t.presentation) : "Measures"
|
|
474
474
|
};
|
|
475
475
|
}
|
|
476
476
|
function Wr(e) {
|
|
477
477
|
const { layout: t, rows: r, report: n } = e, o = {
|
|
478
478
|
...e.request,
|
|
479
|
-
presentation:
|
|
480
|
-
}, c =
|
|
479
|
+
presentation: Bt(t, r, e.request.presentation)
|
|
480
|
+
}, c = Wt({ layout: t, rows: r, request: o, report: n }), s = zt(r), l = Yt(t, o, n), f = {
|
|
481
481
|
...c,
|
|
482
482
|
rows: c.rows.map((h, d) => ({ ...h, keepWithPrevious: s[d] })),
|
|
483
483
|
metadata: { ...c.metadata, ...l }
|
|
@@ -486,7 +486,7 @@ function Wr(e) {
|
|
|
486
486
|
}
|
|
487
487
|
const F = (e) => e.toLocaleString("en-US"), H = (e) => `${F(Math.ceil(e / 1048576))} MB`, re = "export the data as CSV or Excel";
|
|
488
488
|
function Yr(e) {
|
|
489
|
-
const t =
|
|
489
|
+
const t = gt(e.facts), r = e.dataExport ? `Add a filter to narrow it, or ${re}.` : "Add a filter to narrow it, then export again.";
|
|
490
490
|
switch (e.code) {
|
|
491
491
|
case "PDF_ROW_LIMIT_EXCEEDED": {
|
|
492
492
|
const n = e.subject ?? "This table", o = t.rowLimit ?? D.maxTableRows;
|
|
@@ -502,7 +502,7 @@ function Yr(e) {
|
|
|
502
502
|
}
|
|
503
503
|
case "PDF_CAPTURE_TOO_TALL":
|
|
504
504
|
return `${e.subject ?? "This dashboard"} is too long to print as one PDF. Print one sheet or fewer cards${e.dataExport ? `, or ${re}` : ""}.`;
|
|
505
|
-
case
|
|
505
|
+
case Ne:
|
|
506
506
|
return `A number in this table is too wide for its column in a PDF. Use landscape or fewer columns${e.dataExport ? `, or ${re}` : ""}.`;
|
|
507
507
|
case ce:
|
|
508
508
|
return `This PDF is over what a PDF holds: ${F(D.maxTableRows)} rows per table, ${F(
|
|
@@ -510,13 +510,13 @@ function Yr(e) {
|
|
|
510
510
|
)} pages and ${H(D.maxFileBytes)}. ${r}`;
|
|
511
511
|
}
|
|
512
512
|
}
|
|
513
|
-
class
|
|
513
|
+
class Zt extends Error {
|
|
514
514
|
constructor(t, r = ce) {
|
|
515
515
|
super(t), this.code = r;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
function
|
|
519
|
-
return
|
|
518
|
+
function Jt(e) {
|
|
519
|
+
return vt(e) || e === ce || e === Ne;
|
|
520
520
|
}
|
|
521
521
|
function xe(e) {
|
|
522
522
|
if (!e || typeof e != "object")
|
|
@@ -526,7 +526,7 @@ function xe(e) {
|
|
|
526
526
|
if (typeof o == "string" && o.trim())
|
|
527
527
|
return o.trim();
|
|
528
528
|
}
|
|
529
|
-
async function
|
|
529
|
+
async function Qt(e) {
|
|
530
530
|
const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), r = e.headers.get("content-type") || "";
|
|
531
531
|
try {
|
|
532
532
|
if (r.includes("application/json")) {
|
|
@@ -551,7 +551,7 @@ async function Jt(e) {
|
|
|
551
551
|
}
|
|
552
552
|
async function Zr(e) {
|
|
553
553
|
if (!e.token) throw new Error("Missing auth token for PDF export");
|
|
554
|
-
if (
|
|
554
|
+
if (wt(e.serializedPayload) > Ct.maxRequestBytes)
|
|
555
555
|
throw new Error("Fast-path PDF request exceeds the structured body limit");
|
|
556
556
|
const t = await (e.fetchImpl ?? fetch)(e.url, {
|
|
557
557
|
method: "POST",
|
|
@@ -560,8 +560,8 @@ async function Zr(e) {
|
|
|
560
560
|
signal: e.signal
|
|
561
561
|
});
|
|
562
562
|
if (!t.ok) {
|
|
563
|
-
const n = await
|
|
564
|
-
throw
|
|
563
|
+
const n = await Qt(t);
|
|
564
|
+
throw Jt(n.code) ? new Zt(n.message, n.code) : new Error(n.message);
|
|
565
565
|
}
|
|
566
566
|
const r = await t.json();
|
|
567
567
|
if (r != null && r.error) throw new Error(r.error);
|
|
@@ -569,7 +569,7 @@ async function Zr(e) {
|
|
|
569
569
|
throw new Error("Fast-path PDF response missing download URL");
|
|
570
570
|
return r;
|
|
571
571
|
}
|
|
572
|
-
const Jr = 1,
|
|
572
|
+
const Jr = 1, Ve = ["loading", "measuring", "checking", "laidOut"], er = [
|
|
573
573
|
// Already emitted before these contracts; names kept.
|
|
574
574
|
"document_matrix_too_large",
|
|
575
575
|
"document_matrix_unavailable",
|
|
@@ -590,9 +590,9 @@ const Jr = 1, Ke = ["loading", "measuring", "checking", "laidOut"], Qt = [
|
|
|
590
590
|
"document_page_limit_exceeded"
|
|
591
591
|
];
|
|
592
592
|
function Qr(e) {
|
|
593
|
-
return
|
|
593
|
+
return er.includes(e);
|
|
594
594
|
}
|
|
595
|
-
const
|
|
595
|
+
const tr = 64, rr = 120, nr = 3, or = 80, ar = [...Ve, "noPageStack", "unknown"];
|
|
596
596
|
function ne(e, t) {
|
|
597
597
|
return typeof e != "string" ? void 0 : e.trim().slice(0, t).trim() || void 0;
|
|
598
598
|
}
|
|
@@ -602,7 +602,7 @@ function $(e, t) {
|
|
|
602
602
|
function oe(e, t) {
|
|
603
603
|
return t.includes(e) ? e : void 0;
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function sr(e) {
|
|
606
606
|
let t = e;
|
|
607
607
|
if (typeof e == "string")
|
|
608
608
|
try {
|
|
@@ -611,9 +611,9 @@ function ar(e) {
|
|
|
611
611
|
return {};
|
|
612
612
|
}
|
|
613
613
|
if (!t || typeof t != "object" || Array.isArray(t)) return {};
|
|
614
|
-
const r = t, n = Array.isArray(r.inputLabels) ? r.inputLabels.map((c) => ne(c,
|
|
615
|
-
sectionId: ne(r.sectionId,
|
|
616
|
-
sectionTitle: ne(r.sectionTitle,
|
|
614
|
+
const r = t, n = Array.isArray(r.inputLabels) ? r.inputLabels.map((c) => ne(c, or)).filter((c) => c !== void 0).slice(0, nr) : [], o = {
|
|
615
|
+
sectionId: ne(r.sectionId, tr),
|
|
616
|
+
sectionTitle: ne(r.sectionTitle, rr),
|
|
617
617
|
pageNumber: $(r.pageNumber, 1),
|
|
618
618
|
rowCount: $(r.rowCount, 0),
|
|
619
619
|
rowLimit: $(r.rowLimit, 1),
|
|
@@ -621,7 +621,7 @@ function ar(e) {
|
|
|
621
621
|
overflowAxis: oe(r.overflowAxis, ["height", "width"]),
|
|
622
622
|
overflowPx: $(r.overflowPx, 0),
|
|
623
623
|
matrixLimit: oe(r.matrixLimit, ["rows", "bytes"]),
|
|
624
|
-
layoutStage: oe(r.layoutStage,
|
|
624
|
+
layoutStage: oe(r.layoutStage, ar),
|
|
625
625
|
loadingSectionCount: $(r.loadingSectionCount, 0),
|
|
626
626
|
measuredRowCount: $(r.measuredRowCount, 0),
|
|
627
627
|
totalRowCount: $(r.totalRowCount, 0),
|
|
@@ -633,7 +633,7 @@ function ar(e) {
|
|
|
633
633
|
);
|
|
634
634
|
}
|
|
635
635
|
function en(e) {
|
|
636
|
-
const t =
|
|
636
|
+
const t = sr(e.facts), r = t.sectionTitle ? `Section "${t.sectionTitle}"` : t.sectionId ? `Section ${t.sectionId}` : "A section", n = t.pageNumber !== void 0 ? ` on page ${t.pageNumber}` : "";
|
|
637
637
|
switch (e.code) {
|
|
638
638
|
case "document_section_setup":
|
|
639
639
|
return `${r} is not set up to print.`;
|
|
@@ -673,8 +673,8 @@ function en(e) {
|
|
|
673
673
|
].join("");
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
|
-
function
|
|
677
|
-
return
|
|
676
|
+
function ir(e) {
|
|
677
|
+
return Ve.includes(e);
|
|
678
678
|
}
|
|
679
679
|
function ae(e) {
|
|
680
680
|
return typeof e == "number" && Number.isInteger(e) && e >= 0;
|
|
@@ -689,27 +689,27 @@ function tn(e) {
|
|
|
689
689
|
}
|
|
690
690
|
if (!t || typeof t != "object" || Array.isArray(t)) return;
|
|
691
691
|
const { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: c } = t;
|
|
692
|
-
if (!(!
|
|
692
|
+
if (!(!ir(r) || !ae(n) || o !== null && !ae(o) || c !== null && !ae(c)))
|
|
693
693
|
return { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: c };
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function cr(e, t) {
|
|
696
696
|
return e.dashboardId === t.dashboardId && e.cardId === t.cardId && e.attachmentIndex === void 0;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Be(e) {
|
|
699
699
|
return new Map(
|
|
700
700
|
e.presentationExecutionSnapshot.resolvedFormats.flatMap(
|
|
701
|
-
(t) => t.format.type === "raw_temporal" && t.target.kind === "column" &&
|
|
701
|
+
(t) => t.format.type === "raw_temporal" && t.target.kind === "column" && cr(t.scope, e.scope) ? [[t.target.columnKey, t.format]] : []
|
|
702
702
|
)
|
|
703
703
|
);
|
|
704
704
|
}
|
|
705
|
-
function
|
|
705
|
+
function Xe(e) {
|
|
706
706
|
const t = e == null ? void 0 : e.sql, r = e == null ? void 0 : e.python;
|
|
707
707
|
return (e == null ? void 0 : e.resultOwner) === "freeform" && typeof t == "string" && !!t.trim() && (typeof r != "string" || !r.trim());
|
|
708
708
|
}
|
|
709
709
|
function rn(e) {
|
|
710
|
-
return e.formatting.useFormattedValues !== !1 &&
|
|
710
|
+
return e.formatting.useFormattedValues !== !1 && Xe(e.queryPayload) && Be(e.formatting).size > 0;
|
|
711
711
|
}
|
|
712
|
-
function
|
|
712
|
+
function lr(e, t) {
|
|
713
713
|
return e.map((r, n) => {
|
|
714
714
|
if (!Object.prototype.hasOwnProperty.call(r, t) || r[t] === void 0)
|
|
715
715
|
throw new Error(
|
|
@@ -719,13 +719,13 @@ function cr(e, t) {
|
|
|
719
719
|
return o === null || typeof o == "string" ? o : String(o);
|
|
720
720
|
});
|
|
721
721
|
}
|
|
722
|
-
function
|
|
722
|
+
function ur(e) {
|
|
723
723
|
if (e.formatting.useFormattedValues === !1)
|
|
724
724
|
return {
|
|
725
725
|
activatedColumnKeys: /* @__PURE__ */ new Set(),
|
|
726
726
|
byColumnKey: /* @__PURE__ */ new Map()
|
|
727
727
|
};
|
|
728
|
-
const t =
|
|
728
|
+
const t = Be(e.formatting), r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
|
|
729
729
|
if (t.size === 0)
|
|
730
730
|
return { activatedColumnKeys: r, byColumnKey: n };
|
|
731
731
|
const o = new Map(
|
|
@@ -733,19 +733,19 @@ function lr(e) {
|
|
|
733
733
|
const f = l.key || l.field;
|
|
734
734
|
return f ? [[f, l]] : [];
|
|
735
735
|
})
|
|
736
|
-
), c =
|
|
736
|
+
), c = Xe(e.queryPayload), s = /* @__PURE__ */ new Map();
|
|
737
737
|
for (const [l, f] of t) {
|
|
738
738
|
const h = o.get(l);
|
|
739
739
|
let d;
|
|
740
740
|
if (h != null && h.rawTemporal)
|
|
741
|
-
d =
|
|
741
|
+
d = Tt(h, {
|
|
742
742
|
metadataRequired: !0
|
|
743
743
|
}), r.add(l);
|
|
744
744
|
else if (c) {
|
|
745
745
|
r.add(l);
|
|
746
|
-
const p =
|
|
746
|
+
const p = et({
|
|
747
747
|
columnKey: l,
|
|
748
|
-
values:
|
|
748
|
+
values: lr(e.records, l)
|
|
749
749
|
});
|
|
750
750
|
s.set(l, p), p.status === "classified" && (d = p.metadata);
|
|
751
751
|
} else
|
|
@@ -753,18 +753,18 @@ function lr(e) {
|
|
|
753
753
|
d && n.set(l, {
|
|
754
754
|
metadata: d,
|
|
755
755
|
format: f,
|
|
756
|
-
formatValue:
|
|
756
|
+
formatValue: tt({ metadata: d, format: f })
|
|
757
757
|
});
|
|
758
758
|
}
|
|
759
759
|
return {
|
|
760
760
|
activatedColumnKeys: r,
|
|
761
761
|
byColumnKey: n,
|
|
762
762
|
...c ? {
|
|
763
|
-
sqlChunkEvidence:
|
|
763
|
+
sqlChunkEvidence: rt(s)
|
|
764
764
|
} : {}
|
|
765
765
|
};
|
|
766
766
|
}
|
|
767
|
-
function
|
|
767
|
+
function mr(e) {
|
|
768
768
|
if (!e.resolution.activatedColumnKeys.has(e.columnKey))
|
|
769
769
|
return;
|
|
770
770
|
if (e.value === void 0)
|
|
@@ -783,7 +783,7 @@ function Te(e, t) {
|
|
|
783
783
|
const r = e.byColumnKey.get(t);
|
|
784
784
|
return r ? r.metadata.valueKind === "date" : void 0;
|
|
785
785
|
}
|
|
786
|
-
const
|
|
786
|
+
const dr = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime"]), fr = /^\d{4}-\d{2}-\d{2}|^\d{2}\/\d{2}\/\d{4}/, pr = /^\d{4}-\d{2}-\d{2}$/, ze = "MM/dd/yyyy";
|
|
787
787
|
function q(e) {
|
|
788
788
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
789
789
|
}
|
|
@@ -800,34 +800,34 @@ function $e(e, t) {
|
|
|
800
800
|
return q(r.dateFormat) ? r.dateFormat : {};
|
|
801
801
|
}
|
|
802
802
|
function Fe(e) {
|
|
803
|
-
return e.useCustomFormat && e.customFormat ? e.customFormat : e.format ||
|
|
803
|
+
return e.useCustomFormat && e.customFormat ? e.customFormat : e.format || ze;
|
|
804
804
|
}
|
|
805
805
|
function Se(e, t) {
|
|
806
806
|
return e && e !== "auto" ? e : t;
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function hr(e) {
|
|
809
809
|
return !/[HhKkmsSa]/.test(e.replace(/'[^']*'/g, ""));
|
|
810
810
|
}
|
|
811
|
-
function
|
|
811
|
+
function br(e) {
|
|
812
812
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
813
813
|
if (typeof e != "string" || !e.trim()) return null;
|
|
814
814
|
const t = Number(e);
|
|
815
815
|
return Number.isFinite(t) ? t : null;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
818
|
-
const t =
|
|
817
|
+
function yr(e) {
|
|
818
|
+
const t = Ue(e);
|
|
819
819
|
if (t !== void 0)
|
|
820
820
|
try {
|
|
821
|
-
return
|
|
821
|
+
return bt(t, /[.eE]/.test(t) ? "decimal" : "integer");
|
|
822
822
|
} catch {
|
|
823
823
|
return;
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function gr(e) {
|
|
827
827
|
return e.calendar.fiscalCalendar && (e.granularity === "quarter" || e.granularity === "year") ? "fiscal" : e.granularity;
|
|
828
828
|
}
|
|
829
829
|
function nn(e) {
|
|
830
|
-
const { formatting: t, queryPayload: r } = e, n = t.useFormattedValues, o = t.scope, c = (a) =>
|
|
830
|
+
const { formatting: t, queryPayload: r } = e, n = t.useFormattedValues, o = t.scope, c = (a) => nt({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } }), s = (a) => at({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } });
|
|
831
831
|
function l(a) {
|
|
832
832
|
var y;
|
|
833
833
|
if ((y = t.visibleColumns) != null && y.length) return t.visibleColumns;
|
|
@@ -841,7 +841,7 @@ function nn(e) {
|
|
|
841
841
|
const y = a == null ? void 0 : a.pivotIdentity;
|
|
842
842
|
if (!y || !y.members || y.members.length === 0) return;
|
|
843
843
|
const b = ye({ identity: y, columnKey: (a == null ? void 0 : a.key) || (a == null ? void 0 : a.field) || "" });
|
|
844
|
-
return
|
|
844
|
+
return _t({
|
|
845
845
|
members: b,
|
|
846
846
|
metricLabel: (a == null ? void 0 : a.label) || (a == null ? void 0 : a.headerName),
|
|
847
847
|
mode: n ? "formatted" : "canonical",
|
|
@@ -858,7 +858,7 @@ function nn(e) {
|
|
|
858
858
|
}).flattenedLabel;
|
|
859
859
|
}
|
|
860
860
|
function d(a, m) {
|
|
861
|
-
return
|
|
861
|
+
return ot({
|
|
862
862
|
metadata: a,
|
|
863
863
|
cardFormat: m,
|
|
864
864
|
locale: m.locale,
|
|
@@ -869,7 +869,7 @@ function nn(e) {
|
|
|
869
869
|
const { records: y, columns: b } = a, v = q(r.cardConfig) ? r.cardConfig : void 0, w = v == null ? void 0 : v.pivotByColumns, C = Array.isArray(w) ? w.flatMap(
|
|
870
870
|
(i) => q(i) && typeof i.id == "string" && i.id ? [i.id] : []
|
|
871
871
|
) : [];
|
|
872
|
-
|
|
872
|
+
xt(
|
|
873
873
|
b.map((i) => ({ key: O(i) || "<unknown>", pivotIdentity: i.pivotIdentity })),
|
|
874
874
|
{ expectedPivotFieldIds: C }
|
|
875
875
|
);
|
|
@@ -878,7 +878,7 @@ function nn(e) {
|
|
|
878
878
|
const g = O(i);
|
|
879
879
|
return g ? [[g, i]] : [];
|
|
880
880
|
})
|
|
881
|
-
),
|
|
881
|
+
), Ge = new Map(a.resultColumns.map((i) => [i.key, i.dataType])), I = ur({
|
|
882
882
|
records: y,
|
|
883
883
|
columns: b,
|
|
884
884
|
formatting: t,
|
|
@@ -902,7 +902,7 @@ function nn(e) {
|
|
|
902
902
|
g && T && ue.set(i, d(T, g));
|
|
903
903
|
}
|
|
904
904
|
const J = _.map((i) => {
|
|
905
|
-
const g =
|
|
905
|
+
const g = Ge.get(i), T = g && dr.has(g) ? g : "unknown", E = n ? x(i, I, Z) : void 0, P = f(i, S.get(i)), k = n && I.activatedColumnKeys.has(i) && Te(I, i) === void 0;
|
|
906
906
|
return {
|
|
907
907
|
key: i,
|
|
908
908
|
label: P,
|
|
@@ -912,9 +912,9 @@ function nn(e) {
|
|
|
912
912
|
...k ? { xlsxPending: !0 } : {}
|
|
913
913
|
};
|
|
914
914
|
});
|
|
915
|
-
function
|
|
915
|
+
function qe(i, g, T, E) {
|
|
916
916
|
if (!n) return { text: Ee(i), value: i };
|
|
917
|
-
const P =
|
|
917
|
+
const P = mr({ value: i, columnKey: g, rowIndex: T, resolution: I });
|
|
918
918
|
if (P !== void 0) return { text: P.text, value: i, ...P.wallClock ? { wallClock: P.wallClock } : {} };
|
|
919
919
|
const k = Z.get(g);
|
|
920
920
|
if (k) {
|
|
@@ -922,9 +922,9 @@ function nn(e) {
|
|
|
922
922
|
if (!L) throw new Error(`Missing resolved temporal presentation for column "${g}"`);
|
|
923
923
|
if (i != null && typeof i != "string")
|
|
924
924
|
throw new Error(`Canonical temporal column "${g}" must contain a string or null`);
|
|
925
|
-
const R = i ?? null, N =
|
|
925
|
+
const R = i ?? null, N = st(R, k);
|
|
926
926
|
return {
|
|
927
|
-
text:
|
|
927
|
+
text: it({ value: R, metadata: k, format: L }),
|
|
928
928
|
value: i,
|
|
929
929
|
...N ? { wallClock: N } : {}
|
|
930
930
|
};
|
|
@@ -935,7 +935,7 @@ function nn(e) {
|
|
|
935
935
|
return {
|
|
936
936
|
text: he(
|
|
937
937
|
new Date(i).toISOString(),
|
|
938
|
-
Q.pattern ||
|
|
938
|
+
Q.pattern || ze,
|
|
939
939
|
Se(Q.timezone, t.timezone),
|
|
940
940
|
"UTC"
|
|
941
941
|
),
|
|
@@ -947,8 +947,8 @@ function nn(e) {
|
|
|
947
947
|
if (K(i))
|
|
948
948
|
return { text: M ? B(i, M) : i.value, value: i };
|
|
949
949
|
const V = $e(t, g);
|
|
950
|
-
if (V && (i instanceof Date || typeof i == "string" &&
|
|
951
|
-
const L = i instanceof Date ? i.toISOString() : i, R = typeof i == "string" &&
|
|
950
|
+
if (V && (i instanceof Date || typeof i == "string" && fr.test(i))) {
|
|
951
|
+
const L = i instanceof Date ? i.toISOString() : i, R = typeof i == "string" && pr.test(i), N = R ? "UTC" : Se(V.timezone, t.timezone), de = R ? "UTC" : V.sourceTimezone || "auto", fe = ct(L, N, de);
|
|
952
952
|
return {
|
|
953
953
|
text: he(L, Fe(V), N, de),
|
|
954
954
|
value: i,
|
|
@@ -956,14 +956,14 @@ function nn(e) {
|
|
|
956
956
|
};
|
|
957
957
|
}
|
|
958
958
|
if (typeof i == "string" && M && E.dataType === "number") {
|
|
959
|
-
const L =
|
|
959
|
+
const L = yr(i);
|
|
960
960
|
if (L) return { text: B(L, M), value: i };
|
|
961
961
|
}
|
|
962
962
|
return { text: Ee(i), value: i };
|
|
963
963
|
}
|
|
964
|
-
const
|
|
964
|
+
const We = y.map(
|
|
965
965
|
(i, g) => J.map((T) => {
|
|
966
|
-
const E =
|
|
966
|
+
const E = qe(i[T.key], T.key, g, T);
|
|
967
967
|
return X({ value: E.value, text: E.text, column: T.xlsx, wallClock: E.wallClock });
|
|
968
968
|
})
|
|
969
969
|
), me = (m == null ? void 0 : m.withHeader) !== !1 && t.includeHeaders;
|
|
@@ -975,7 +975,7 @@ function nn(e) {
|
|
|
975
975
|
return {
|
|
976
976
|
...me ? { header: J.map((i) => i.label) } : {},
|
|
977
977
|
columns: J,
|
|
978
|
-
rows:
|
|
978
|
+
rows: We,
|
|
979
979
|
...I.sqlChunkEvidence ? { rawTemporalClassification: I.sqlChunkEvidence } : {}
|
|
980
980
|
};
|
|
981
981
|
}
|
|
@@ -985,10 +985,10 @@ function nn(e) {
|
|
|
985
985
|
return C === void 0 ? { kind: "text" } : { kind: "datetime", dateOnly: C };
|
|
986
986
|
}
|
|
987
987
|
const b = y.get(a);
|
|
988
|
-
if (b) return { kind: "temporal_bucket", grain:
|
|
988
|
+
if (b) return { kind: "temporal_bucket", grain: gr(b) };
|
|
989
989
|
if (s(a)) return { kind: "text" };
|
|
990
990
|
const v = $e(t, a);
|
|
991
|
-
if (v) return { kind: "datetime", dateOnly:
|
|
991
|
+
if (v) return { kind: "datetime", dateOnly: hr(Fe(v)) };
|
|
992
992
|
const w = c(a);
|
|
993
993
|
return w ? { kind: "measure", format: w } : void 0;
|
|
994
994
|
}
|
|
@@ -1005,13 +1005,13 @@ function nn(e) {
|
|
|
1005
1005
|
});
|
|
1006
1006
|
if (w == null) return { kind: "empty" };
|
|
1007
1007
|
if (!n) return X({ value: w, text: String(w), column: _ });
|
|
1008
|
-
const S = C ?
|
|
1008
|
+
const S = C ? br(w) : null;
|
|
1009
1009
|
return X(C && S !== null ? { value: S, text: B(S, C), column: _ } : { value: w, text: String(w), column: _ });
|
|
1010
1010
|
});
|
|
1011
1011
|
}
|
|
1012
1012
|
return { format: p, totals: u };
|
|
1013
1013
|
}
|
|
1014
|
-
const
|
|
1014
|
+
const wr = /* @__PURE__ */ new Set([
|
|
1015
1015
|
"scope",
|
|
1016
1016
|
"useFormattedValues",
|
|
1017
1017
|
"timezone",
|
|
@@ -1046,23 +1046,23 @@ function on(e) {
|
|
|
1046
1046
|
throw new be(
|
|
1047
1047
|
`formatting.${t} is retired; formatting.presentationExecutionSnapshot is authoritative.`
|
|
1048
1048
|
);
|
|
1049
|
-
const r = Object.keys(e).find((a) => !
|
|
1049
|
+
const r = Object.keys(e).find((a) => !wr.has(a));
|
|
1050
1050
|
if (r)
|
|
1051
1051
|
throw new Error(`formatting contains unknown property "${r}"`);
|
|
1052
1052
|
const n = typeof e.timezone == "string" ? e.timezone.trim() : "";
|
|
1053
1053
|
if (!n)
|
|
1054
1054
|
throw new Error("formatting.timezone must be a non-empty string");
|
|
1055
|
-
const o =
|
|
1055
|
+
const o = dt(e.delimiter);
|
|
1056
1056
|
if (!o)
|
|
1057
1057
|
throw new Error("formatting.delimiter must be a comma, semicolon or tab");
|
|
1058
|
-
const c =
|
|
1058
|
+
const c = ft(e.csvEncoding);
|
|
1059
1059
|
if (!c)
|
|
1060
1060
|
throw new Error("formatting.csvEncoding must be 'utf-8-bom' or 'utf-8'");
|
|
1061
1061
|
if (typeof e.includeHeaders != "boolean")
|
|
1062
1062
|
throw new Error("formatting.includeHeaders must be a boolean");
|
|
1063
1063
|
if (e.useFormattedValues !== void 0 && typeof e.useFormattedValues != "boolean")
|
|
1064
1064
|
throw new Error("formatting.useFormattedValues must be a boolean");
|
|
1065
|
-
const s = e.fileFormat === void 0 ? void 0 :
|
|
1065
|
+
const s = e.fileFormat === void 0 ? void 0 : pt(e.fileFormat);
|
|
1066
1066
|
if (e.fileFormat !== void 0 && !s)
|
|
1067
1067
|
throw new Error("formatting.fileFormat must be 'csv' or 'xlsx'");
|
|
1068
1068
|
if (e.title !== void 0 && typeof e.title != "string")
|
|
@@ -1078,16 +1078,16 @@ function on(e) {
|
|
|
1078
1078
|
throw new Error("formatting.tableTotalsLabelColumnKey must be a non-empty string");
|
|
1079
1079
|
if (d && !(l != null && l.includes(d)))
|
|
1080
1080
|
throw new Error("formatting.tableTotalsLabelColumnKey must identify a visible column");
|
|
1081
|
-
const p =
|
|
1081
|
+
const p = lt(e.scope, "formatting.scope");
|
|
1082
1082
|
if (!p.cardId || p.attachmentIndex !== void 0)
|
|
1083
1083
|
throw new Error("formatting.scope must identify exactly one dashboard card");
|
|
1084
|
-
const x = e.useFormattedValues !== !1, u =
|
|
1084
|
+
const x = e.useFormattedValues !== !1, u = ut(e.presentationExecutionSnapshot);
|
|
1085
1085
|
if (n !== u.reportContext.calendar.tz)
|
|
1086
1086
|
throw new Error(
|
|
1087
1087
|
"formatting.timezone must equal presentationExecutionSnapshot.reportContext.calendar.tz"
|
|
1088
1088
|
);
|
|
1089
1089
|
try {
|
|
1090
|
-
|
|
1090
|
+
mt({
|
|
1091
1091
|
snapshot: u,
|
|
1092
1092
|
expectedScope: { dashboardId: p.dashboardId, cardId: p.cardId },
|
|
1093
1093
|
visibleColumns: l,
|
|
@@ -1132,8 +1132,8 @@ function an(e) {
|
|
|
1132
1132
|
...typeof e.title == "string" ? { title: e.title } : {}
|
|
1133
1133
|
};
|
|
1134
1134
|
}
|
|
1135
|
-
const
|
|
1136
|
-
function
|
|
1135
|
+
const Cr = /^\d{4}-\d{2}-\d{2}$/;
|
|
1136
|
+
function He(e) {
|
|
1137
1137
|
const t = e.split(".");
|
|
1138
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(" ");
|
|
1139
1139
|
}
|
|
@@ -1142,27 +1142,27 @@ function se(e, t) {
|
|
|
1142
1142
|
const r = e.slice(0, Pe).map(t).join(", "), n = e.length - Pe;
|
|
1143
1143
|
return n > 0 ? `${r}, and ${n} more` : r;
|
|
1144
1144
|
}
|
|
1145
|
-
function
|
|
1145
|
+
function vr(e) {
|
|
1146
1146
|
if (e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between")
|
|
1147
1147
|
return;
|
|
1148
1148
|
const t = Y(e.relativeMeta);
|
|
1149
|
-
return t &&
|
|
1149
|
+
return t && Oe(t).printsByName ? t : void 0;
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1152
|
-
if (t !== "label") return
|
|
1151
|
+
function _r(e, t) {
|
|
1152
|
+
if (t !== "label") return vr(e);
|
|
1153
1153
|
if (!(e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between"))
|
|
1154
1154
|
return Y(e.relativeMeta);
|
|
1155
1155
|
}
|
|
1156
1156
|
function Ie(e, t = {}) {
|
|
1157
|
-
const { name: r, operation: n, values: o, valueType: c } = e, s = t.label ??
|
|
1157
|
+
const { name: r, operation: n, values: o, valueType: c } = e, s = t.label ?? He(r), l = _r(e, t.relativeDates);
|
|
1158
1158
|
if (l) {
|
|
1159
|
-
const p =
|
|
1159
|
+
const p = yt(l).label;
|
|
1160
1160
|
if (p)
|
|
1161
1161
|
return n === "between" ? `${s}: ${p}` : `${s} not in ${p}`;
|
|
1162
1162
|
}
|
|
1163
1163
|
if (!o || o.length === 0)
|
|
1164
1164
|
return n === "is null" ? `${s} is empty` : n === "is not null" ? `${s} is not empty` : "";
|
|
1165
|
-
const f = Y(e.relativeMeta), h = e.temporalPrecision === "minute" || !!(f &&
|
|
1165
|
+
const f = Y(e.relativeMeta), h = e.temporalPrecision === "minute" || !!(f && Oe(f).subDay), d = (p) => {
|
|
1166
1166
|
if (c === "date" && p) {
|
|
1167
1167
|
const x = {
|
|
1168
1168
|
year: "numeric",
|
|
@@ -1173,7 +1173,7 @@ function Ie(e, t = {}) {
|
|
|
1173
1173
|
minute: "2-digit"
|
|
1174
1174
|
} : {}
|
|
1175
1175
|
};
|
|
1176
|
-
if (typeof p == "string" &&
|
|
1176
|
+
if (typeof p == "string" && Cr.test(p)) {
|
|
1177
1177
|
const [a, m, y] = p.split("-").map(Number);
|
|
1178
1178
|
return new Intl.DateTimeFormat(void 0, {
|
|
1179
1179
|
year: "numeric",
|
|
@@ -1182,7 +1182,7 @@ function Ie(e, t = {}) {
|
|
|
1182
1182
|
timeZone: "UTC"
|
|
1183
1183
|
}).format(new Date(Date.UTC(a, m - 1, y)));
|
|
1184
1184
|
}
|
|
1185
|
-
if (typeof p == "string" &&
|
|
1185
|
+
if (typeof p == "string" && Et(p) === "wall_datetime") {
|
|
1186
1186
|
const [a, m, y, b, v] = p.split(/[-T :.]/).map(Number);
|
|
1187
1187
|
return new Intl.DateTimeFormat(void 0, {
|
|
1188
1188
|
...x,
|
|
@@ -1246,30 +1246,30 @@ function sn(e, t = {}) {
|
|
|
1246
1246
|
const s = Ie(o[0], t);
|
|
1247
1247
|
s && n.push(s);
|
|
1248
1248
|
} else {
|
|
1249
|
-
const s =
|
|
1249
|
+
const s = He(c), l = o.map((f) => Ie(f, t).replace(`${s}: `, "").replace(`${s} `, "")).filter(Boolean);
|
|
1250
1250
|
l.length > 0 && n.push(`${s}: ${l.join(" and ")}`);
|
|
1251
1251
|
}
|
|
1252
1252
|
}), n.join(" | ");
|
|
1253
1253
|
}
|
|
1254
1254
|
function cn(e) {
|
|
1255
|
-
return ((e == null ? void 0 : e.filterValues) ?? []).filter(
|
|
1255
|
+
return ((e == null ? void 0 : e.filterValues) ?? []).filter(xr).map(Tr);
|
|
1256
1256
|
}
|
|
1257
|
-
function
|
|
1257
|
+
function xr(e) {
|
|
1258
1258
|
return !!e && typeof e == "object" && typeof e.name == "string" && Array.isArray(e.values);
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function Tr(e) {
|
|
1261
1261
|
if (!("relativeMeta" in e) || e.relativeMeta === void 0) return e;
|
|
1262
1262
|
const { relativeMeta: t, ...r } = e, n = Y(t);
|
|
1263
1263
|
return n ? { ...r, relativeMeta: n } : r;
|
|
1264
1264
|
}
|
|
1265
|
-
const
|
|
1265
|
+
const Er = /* @__PURE__ */ new Set([
|
|
1266
1266
|
"day",
|
|
1267
1267
|
"week",
|
|
1268
1268
|
"month",
|
|
1269
1269
|
"quarter",
|
|
1270
1270
|
"year"
|
|
1271
1271
|
]);
|
|
1272
|
-
function
|
|
1272
|
+
function $r(e, t) {
|
|
1273
1273
|
try {
|
|
1274
1274
|
const r = A(
|
|
1275
1275
|
U(e),
|
|
@@ -1282,18 +1282,15 @@ function Er(e, t) {
|
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
1284
|
function ln(e, t, r, n = !1) {
|
|
1285
|
-
const o =
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
n
|
|
1290
|
-
);
|
|
1291
|
-
return `${o.start} - ${o.end}`;
|
|
1285
|
+
const o = Me(e, t, r);
|
|
1286
|
+
if (o.start === o.end) return o.end;
|
|
1287
|
+
const c = n ? Me(e, t, r, !0) : o;
|
|
1288
|
+
return `${c.start} – ${c.end}`;
|
|
1292
1289
|
}
|
|
1293
|
-
function
|
|
1290
|
+
function Me(e, t, r, n = !1) {
|
|
1294
1291
|
try {
|
|
1295
|
-
if (r &&
|
|
1296
|
-
const o =
|
|
1292
|
+
if (r && Er.has(r)) {
|
|
1293
|
+
const o = $r(e.end, t);
|
|
1297
1294
|
if (o) {
|
|
1298
1295
|
const c = n ? "MMM d" : "MMM d, yyyy";
|
|
1299
1296
|
return {
|
|
@@ -1326,12 +1323,12 @@ function $r(e, t, r, n = !1) {
|
|
|
1326
1323
|
return { start: e.start, end: `before ${e.end}` };
|
|
1327
1324
|
}
|
|
1328
1325
|
export {
|
|
1329
|
-
|
|
1326
|
+
er as A,
|
|
1330
1327
|
Qr as B,
|
|
1331
|
-
|
|
1332
|
-
|
|
1328
|
+
sr as C,
|
|
1329
|
+
je as D,
|
|
1333
1330
|
en as E,
|
|
1334
|
-
|
|
1331
|
+
jt as F,
|
|
1335
1332
|
tn as G,
|
|
1336
1333
|
nn as H,
|
|
1337
1334
|
on as I,
|
|
@@ -1339,12 +1336,12 @@ export {
|
|
|
1339
1336
|
rn as K,
|
|
1340
1337
|
Pe as L,
|
|
1341
1338
|
jr as M,
|
|
1342
|
-
|
|
1339
|
+
vr as N,
|
|
1343
1340
|
Ie as O,
|
|
1344
|
-
|
|
1341
|
+
Ht as P,
|
|
1345
1342
|
sn as Q,
|
|
1346
1343
|
cn as R,
|
|
1347
|
-
|
|
1344
|
+
Me as S,
|
|
1348
1345
|
Or as a,
|
|
1349
1346
|
Kr as b,
|
|
1350
1347
|
Vr as c,
|
|
@@ -1354,21 +1351,21 @@ export {
|
|
|
1354
1351
|
Xr as g,
|
|
1355
1352
|
Gr as h,
|
|
1356
1353
|
qr as i,
|
|
1357
|
-
|
|
1354
|
+
Wt as j,
|
|
1358
1355
|
Wr as k,
|
|
1359
1356
|
zr as l,
|
|
1360
|
-
|
|
1357
|
+
qt as m,
|
|
1361
1358
|
Hr as n,
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1359
|
+
Kt as o,
|
|
1360
|
+
Gt as p,
|
|
1361
|
+
Bt as q,
|
|
1365
1362
|
Ce as r,
|
|
1366
|
-
|
|
1363
|
+
zt as s,
|
|
1367
1364
|
X as t,
|
|
1368
1365
|
Yr as u,
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1366
|
+
Zt as v,
|
|
1367
|
+
Jt as w,
|
|
1368
|
+
Qt as x,
|
|
1372
1369
|
Zr as y,
|
|
1373
1370
|
Jr as z
|
|
1374
1371
|
};
|