react-semaphor 0.1.541 → 0.1.542
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.js +75 -75
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +3 -3
- package/dist/briefings/index.js +51 -49
- package/dist/chunks/apply-dashboard-operations-Btbp2-6v.js +2260 -0
- package/dist/chunks/{assistant-chat-D1fDZD6O.js → assistant-chat-oHF5lTjA.js} +12 -12
- package/dist/chunks/bookmark-state-CXw7lZ50.js +118 -0
- package/dist/chunks/{calendar-day-equality-Bpl15IBo.js → calendar-day-equality-BmJAWduY.js} +180 -207
- package/dist/chunks/comparison-window-caption-ChIyd_-L.js +1618 -0
- package/dist/chunks/custom-visual-inputs-DUtpYZOk.js +323 -0
- package/dist/chunks/{dashboard-briefing-launcher-DwjFpewq.js → dashboard-briefing-launcher-B-cm719R.js} +18 -18
- package/dist/chunks/{dashboard-controls-C_BI28ME.js → dashboard-controls-CIn22Qgp.js} +69 -70
- package/dist/chunks/{dashboard-filter-value-compatibility-D95O4nd7.js → dashboard-filter-value-compatibility-CwQ_iSNb.js} +2 -2
- package/dist/chunks/{dashboard-json-DDY15Trn.js → dashboard-json-ZUYsIExq.js} +4 -4
- package/dist/chunks/{dashboard-B6IrON_Q.js → dashboard-s5WJBcK8.js} +1 -1
- package/dist/chunks/{document-dashboard-inputs-DP_Op5mu.js → document-dashboard-inputs-C6MJVyoI.js} +2382 -4975
- package/dist/chunks/document-sheet-utils-BsZUnHRl.js +3619 -0
- package/dist/chunks/{edit-dashboard-visual-CH2dzWW-.js → edit-dashboard-visual-DLdereA7.js} +728 -728
- package/dist/chunks/{filter-value-text-BhWugPWE.js → filter-value-text-CYsVYPuD.js} +18 -19
- package/dist/chunks/{index-DaQlghLY.js → index-CV5rHq5D.js} +824 -1351
- package/dist/chunks/{matrix-analytical-definition-bcprSe4u.js → matrix-analytical-definition-C7Gb0e12.js} +1 -1
- package/dist/chunks/{matrix-card-CJn1hB5V.js → matrix-card-DjwWcCo8.js} +2 -2
- package/dist/chunks/{matrix-formatter-DQ8avoIQ.js → matrix-formatter-BnsTX90d.js} +430 -417
- package/dist/chunks/{matrix-member-presentation-BNPSDKBG.js → matrix-member-presentation-CQGdVks6.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-B8PBF1Gd.js → matrix-operation-contract-8OIO4gob.js} +65 -65
- package/dist/chunks/metric-comparison-DEwi9uc2.js +498 -0
- package/dist/chunks/numeric-presentation-BSAqPpHt.js +5227 -0
- package/dist/chunks/{pivot-header-presentation-MkcKnjn3.js → pivot-header-presentation-DHcx1XGQ.js} +1 -1
- package/dist/chunks/{pivot-result-identity-D6hhcRXi.js → pivot-result-identity-DJhXXcns.js} +1 -1
- package/dist/chunks/pivot-result-lifecycle-BBlAfBA0.js +1155 -0
- package/dist/chunks/raw-temporal-presentation-CZ2r0Vb_.js +585 -0
- package/dist/chunks/{report-preferences-dialog-DpNkFfQO.js → report-preferences-dialog-MRUWpMcJ.js} +75 -75
- package/dist/chunks/{report-runtime-context-B984Nq1E.js → report-runtime-context-Dq8XyODK.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-CJ2WpoMF.js → saved-dashboard-context-DjPqgFly.js} +233 -206
- package/dist/chunks/{selection-reducer-vKIb_jS6.js → selection-reducer-Dj_8xD69.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-KT598QJq.js → semaphor-ready-indicator-BWSpRsPj.js} +37489 -39476
- package/dist/chunks/{shelf-drop-preview-context-BxV3Fl8h.js → shelf-drop-preview-context-CQbFLm3q.js} +6 -6
- package/dist/chunks/sort-target-MT1WK1vX.js +29 -0
- package/dist/chunks/{source-entity-resolution-CVA1a85c.js → source-entity-resolution-BYn9giz3.js} +1 -1
- package/dist/chunks/{switch-DWEWiv1J.js → switch-C3jLxlG0.js} +2 -2
- package/dist/chunks/table-export-sheet-BHSnuZHd.js +949 -0
- package/dist/chunks/table-settings-CLZocegs.js +501 -0
- package/dist/chunks/temporal-bucket-D7NBrrtL.js +2071 -0
- package/dist/chunks/{token-types-bxUxXDX2.js → token-types-DBbZVQsm.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-DdD12SMY.js → use-create-flow-overlay-state-BJDNqdOh.js} +151 -151
- package/dist/chunks/{validators-Ej1DdCXa.js → validators-DMHTpf7a.js} +73 -73
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +462 -457
- package/dist/data-app-sdk/index.js +5 -5
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.js +9 -9
- package/dist/format-utils/index.js +346 -241
- package/dist/index.js +174 -175
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/briefings/attachments.d.ts +17 -1
- package/dist/types/briefings/index.d.ts +5 -3
- package/dist/types/index.js +48 -48
- package/dist/types/lib/api/exports-api.d.ts +11 -65
- package/dist/types/lib/dashboard-inputs/control-contract-overrides.d.ts +17 -0
- package/dist/types/lib/dashboard-viewer/export-table-view.d.ts +2 -0
- package/dist/types/lib/hooks/use-dashboard.d.ts +3 -6
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +8 -2
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +8 -6
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +50 -0
- package/dist/types/lib/types/explorer-types.d.ts +6 -0
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +3 -3
- package/dist/types/shared/assistant-context/index.d.ts +1 -1
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +23 -6
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +173 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +4 -3
- package/dist/types/shared/format-utils/exporters/export-cells.d.ts +90 -0
- package/dist/types/shared/format-utils/exporters/export-file-format.d.ts +44 -0
- package/dist/types/shared/format-utils/exporters/index.d.ts +6 -0
- package/dist/types/shared/format-utils/exporters/xlsx-file.d.ts +90 -0
- package/dist/types/shared/format-utils/formatters/date-formatter.d.ts +8 -12
- package/dist/types/shared/format-utils/formatters/index.d.ts +1 -1
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +2 -0
- package/dist/types/shared/format-utils/index.d.ts +2 -0
- package/dist/types/shared/format-utils/matrix-continuation.d.ts +55 -9
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +21 -1
- package/dist/types/shared/format-utils/matrix-export-xlsx.d.ts +27 -0
- package/dist/types/shared/format-utils/presentation-execution.d.ts +27 -2
- package/dist/types/shared/format-utils/raw-temporal.d.ts +8 -0
- package/dist/types/shared/format-utils/table-export/index.d.ts +8 -0
- package/dist/types/shared/format-utils/table-export/prepare-table-export.d.ts +50 -0
- package/dist/types/shared/format-utils/table-export/table-export-formatting.d.ts +47 -0
- package/dist/types/shared/format-utils/table-export/table-export-raw-temporal.d.ts +40 -0
- package/dist/types/shared/format-utils/table-export/table-export-result.d.ts +31 -0
- package/dist/types/shared/format-utils/table-export/table-export-sheet.d.ts +38 -0
- package/dist/types/shared/format-utils/temporal-bucket.d.ts +9 -0
- package/package.json +2 -1
- package/dist/chunks/aggregate-table-row-presentation-B_vQjYR3.js +0 -996
- package/dist/chunks/apply-dashboard-operations-C-iahGka.js +0 -402
- package/dist/chunks/bookmark-state-k7y5SNGf.js +0 -331
- package/dist/chunks/calculated-field-identity-DcBS2NPP.js +0 -2161
- package/dist/chunks/canonical-result-keys-CEQefvdO.js +0 -33
- package/dist/chunks/common-types-CUf03Htv.js +0 -288
- package/dist/chunks/csv-utils-GUfKyT1J.js +0 -56
- package/dist/chunks/custom-visual-inputs-BrUOIwln.js +0 -3288
- package/dist/chunks/document-sheet-utils-C1eEldxs.js +0 -1076
- package/dist/chunks/matrix-definition-DQDI2okF.js +0 -206
- package/dist/chunks/metric-comparison-CojWeLqx.js +0 -392
- package/dist/chunks/pivot-result-lifecycle-8qCDmpKc.js +0 -804
- package/dist/chunks/raw-temporal-D61lr48Y.js +0 -1464
- package/dist/chunks/temporal-bucket-D8JF7zKz.js +0 -575
- package/dist/chunks/temporal-bucket-contract-DaOajRC7.js +0 -108
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { C as
|
|
7
|
-
import {
|
|
8
|
-
import { af as
|
|
1
|
+
var _e = Object.defineProperty;
|
|
2
|
+
var Oe = (e, n, t) => n in e ? _e(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
+
var L = (e, n, t) => Oe(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { r as ae, q as de, j as Fe } from "./temporal-bucket-D7NBrrtL.js";
|
|
5
|
+
import { a8 as J, l as Ne, t as Re } from "./validators-DMHTpf7a.js";
|
|
6
|
+
import { n as Be, a1 as Me, L as Le, C as Ue, K as Pe, P as B } from "./pivot-result-lifecycle-BBlAfBA0.js";
|
|
7
|
+
import { z as y } from "zod";
|
|
8
|
+
import { af as Ve, ah as ze, V as je } from "./matrix-operation-contract-8OIO4gob.js";
|
|
9
9
|
import "./analytics-base-schemas-BFAoRlkU.js";
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import { r as
|
|
13
|
-
import {
|
|
14
|
-
import { r as
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
import { v as ge } from "./raw-temporal-contract-C51YG48G.js";
|
|
18
|
-
import "./calculated-field-identity-DcBS2NPP.js";
|
|
19
|
-
import { r as ht, a as yt, b as gt } from "./canonical-result-keys-CEQefvdO.js";
|
|
20
|
-
const vt = /* @__PURE__ */ new Set([
|
|
10
|
+
import "../value-format-preferences/index.js";
|
|
11
|
+
import { aa as qe, ab as Ke, ac as He, r as Ge, n as We } from "./numeric-presentation-BSAqPpHt.js";
|
|
12
|
+
import { r as Xe } from "./matrix-card-DjwWcCo8.js";
|
|
13
|
+
import { x as Ze } from "./table-settings-CLZocegs.js";
|
|
14
|
+
import { r as Ye, a as Je, b as Qe, c as et, d as tt } from "./raw-temporal-presentation-CZ2r0Vb_.js";
|
|
15
|
+
import { f as nt, r as rt, b as ot, g as at } from "./custom-visual-inputs-DUtpYZOk.js";
|
|
16
|
+
const it = /* @__PURE__ */ new Set([
|
|
21
17
|
"table",
|
|
22
18
|
"aggregateTable",
|
|
23
19
|
"pivotTable",
|
|
24
20
|
"detailTable"
|
|
25
|
-
]),
|
|
21
|
+
]), ct = /* @__PURE__ */ new Set([
|
|
26
22
|
"bar",
|
|
27
23
|
"horizontalBar",
|
|
28
24
|
"line",
|
|
@@ -53,43 +49,53 @@ const vt = /* @__PURE__ */ new Set([
|
|
|
53
49
|
"treemap",
|
|
54
50
|
"custom"
|
|
55
51
|
]);
|
|
56
|
-
function
|
|
52
|
+
function Pn(e) {
|
|
57
53
|
var o, a, i;
|
|
58
|
-
const n =
|
|
54
|
+
const n = ct.has(e.type) && (e.type !== "custom" || !!((o = e.customCardPreferences) != null && o.url));
|
|
59
55
|
let t = !1;
|
|
60
56
|
try {
|
|
61
|
-
t = !!
|
|
57
|
+
t = !!Xe(e);
|
|
62
58
|
} catch {
|
|
63
59
|
return { formats: [], defaultFormat: null };
|
|
64
60
|
}
|
|
65
|
-
return e.type === "text" || !n || !t &&
|
|
66
|
-
formats:
|
|
61
|
+
return e.type === "text" || !n || !t && qe(e) ? { formats: [], defaultFormat: null } : {
|
|
62
|
+
formats: lt({
|
|
67
63
|
cardType: e.type,
|
|
68
64
|
allowDownload: (a = e.preferences) == null ? void 0 : a.allowDownload
|
|
69
|
-
}),
|
|
70
|
-
defaultFormat:
|
|
65
|
+
}).filter((c) => c !== "xlsx" || e.type !== "matrixTable" || t),
|
|
66
|
+
defaultFormat: dt({
|
|
71
67
|
cardType: e.type,
|
|
72
68
|
allowDownload: (i = e.preferences) == null ? void 0 : i.allowDownload
|
|
73
69
|
})
|
|
74
70
|
};
|
|
75
71
|
}
|
|
76
|
-
function
|
|
77
|
-
return e
|
|
72
|
+
function Q(e) {
|
|
73
|
+
return e === "table" || e === "detailTable";
|
|
74
|
+
}
|
|
75
|
+
function Vn(e) {
|
|
76
|
+
var n, t;
|
|
77
|
+
return e.type !== "card" || e.format === "pdf" ? !1 : !!((n = e.settings) != null && n.matrix) || Q((t = e.settings) == null ? void 0 : t.cardType);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
return
|
|
79
|
+
function lt(e) {
|
|
80
|
+
return e.allowDownload === !1 ? ["pdf"] : e.cardType === "matrixTable" || Q(e.cardType) ? ["pdf", "csv", "xlsx"] : ["pdf", "csv"];
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
|
|
82
|
+
function zn(e) {
|
|
83
|
+
return e === "pdf" ? "PDF" : Be(e).label;
|
|
84
|
+
}
|
|
85
|
+
function dt(e) {
|
|
86
|
+
return it.has(e.cardType) && e.allowDownload !== !1 ? "csv" : "pdf";
|
|
87
|
+
}
|
|
88
|
+
function jn(e) {
|
|
89
|
+
const { config: n } = e, t = Me({
|
|
84
90
|
spec: n.spec,
|
|
85
91
|
presentation: n.presentation,
|
|
86
92
|
defaults: n.defaultView,
|
|
87
93
|
session: e.purpose === "manual" ? e.session : void 0
|
|
88
94
|
});
|
|
89
|
-
return
|
|
95
|
+
return J.parse({
|
|
90
96
|
spec: t.spec,
|
|
91
97
|
presentation: t.presentation,
|
|
92
|
-
...e.content === "flat" ? { mode: "flat", format: "csv" } : {
|
|
98
|
+
...e.content === "flat" ? { mode: "flat", format: e.format === "xlsx" ? "xlsx" : "csv" } : {
|
|
93
99
|
mode: "layout",
|
|
94
100
|
format: e.format,
|
|
95
101
|
expansion: e.content === "all" ? { kind: "all" } : {
|
|
@@ -100,37 +106,37 @@ function dr(e) {
|
|
|
100
106
|
}
|
|
101
107
|
});
|
|
102
108
|
}
|
|
103
|
-
const
|
|
104
|
-
connection_id:
|
|
105
|
-
cardType:
|
|
106
|
-
resultOwner:
|
|
107
|
-
sql:
|
|
108
|
-
python:
|
|
109
|
-
tableStructure:
|
|
110
|
-
cardDataSource:
|
|
111
|
-
connectionId:
|
|
112
|
-
connectionType:
|
|
113
|
-
mode:
|
|
114
|
-
selectedEntities:
|
|
115
|
-
semanticDomainId:
|
|
109
|
+
const st = y.object({
|
|
110
|
+
connection_id: y.string().min(1),
|
|
111
|
+
cardType: y.literal("matrixTable"),
|
|
112
|
+
resultOwner: y.literal("config"),
|
|
113
|
+
sql: y.literal("").optional(),
|
|
114
|
+
python: y.literal("").optional(),
|
|
115
|
+
tableStructure: y.never().optional(),
|
|
116
|
+
cardDataSource: y.object({
|
|
117
|
+
connectionId: y.string().min(1),
|
|
118
|
+
connectionType: y.string().min(1),
|
|
119
|
+
mode: y.enum(["database", "semanticDomain"]),
|
|
120
|
+
selectedEntities: y.array(y.unknown()),
|
|
121
|
+
semanticDomainId: y.string().optional()
|
|
116
122
|
}).passthrough(),
|
|
117
|
-
active_filters:
|
|
118
|
-
}).passthrough(),
|
|
119
|
-
dashboardId:
|
|
120
|
-
cardId:
|
|
121
|
-
formatOptions:
|
|
122
|
-
matrix:
|
|
123
|
-
acquisition:
|
|
124
|
-
presentationExecutionSnapshot:
|
|
123
|
+
active_filters: y.array(y.unknown()).default([])
|
|
124
|
+
}).passthrough(), qn = st.extend({
|
|
125
|
+
dashboardId: y.string().min(1),
|
|
126
|
+
cardId: y.string().min(1),
|
|
127
|
+
formatOptions: y.object({
|
|
128
|
+
matrix: J,
|
|
129
|
+
acquisition: y.literal("continuation").optional(),
|
|
130
|
+
presentationExecutionSnapshot: y.unknown()
|
|
125
131
|
}).passthrough().superRefine((e, n) => {
|
|
126
|
-
e.matrix.format
|
|
127
|
-
code:
|
|
132
|
+
e.matrix.format !== "pdf" != (e.acquisition === "continuation") && n.addIssue({
|
|
133
|
+
code: y.ZodIssueCode.custom,
|
|
128
134
|
path: ["acquisition"],
|
|
129
|
-
message: "CSV
|
|
135
|
+
message: "CSV and Excel require continuation acquisition; PDF must not specify acquisition."
|
|
130
136
|
});
|
|
131
137
|
})
|
|
132
138
|
});
|
|
133
|
-
function
|
|
139
|
+
function Kn(e) {
|
|
134
140
|
return {
|
|
135
141
|
...e.controls,
|
|
136
142
|
type: "card",
|
|
@@ -150,7 +156,7 @@ function ur(e) {
|
|
|
150
156
|
},
|
|
151
157
|
active_filters: e.activeFilters,
|
|
152
158
|
formatOptions: {
|
|
153
|
-
...e.matrix.format
|
|
159
|
+
...e.matrix.format !== "pdf" ? {
|
|
154
160
|
acquisition: "continuation",
|
|
155
161
|
...e.csvEncoding ? { csvEncoding: e.csvEncoding } : {}
|
|
156
162
|
} : {},
|
|
@@ -158,582 +164,54 @@ function ur(e) {
|
|
|
158
164
|
delimiter: e.delimiter,
|
|
159
165
|
includeHeaders: e.includeHeaders,
|
|
160
166
|
timezone: e.reportContext.calendar.tz,
|
|
161
|
-
presentationExecutionSnapshot:
|
|
167
|
+
presentationExecutionSnapshot: Le({
|
|
162
168
|
reportContext: e.reportContext,
|
|
163
169
|
resolvedFormats: []
|
|
164
170
|
})
|
|
165
171
|
}
|
|
166
172
|
};
|
|
167
173
|
}
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
status:
|
|
171
|
-
request:
|
|
172
|
-
layout:
|
|
173
|
-
rows:
|
|
174
|
-
usage:
|
|
174
|
+
const K = y.number().int().nonnegative(), Hn = y.discriminatedUnion("status", [
|
|
175
|
+
y.object({
|
|
176
|
+
status: y.literal("ok"),
|
|
177
|
+
request: J,
|
|
178
|
+
layout: Ve,
|
|
179
|
+
rows: y.array(ze).readonly(),
|
|
180
|
+
usage: y.object({ rows: K, cells: K, bytes: K }).strict()
|
|
175
181
|
}).strict(),
|
|
176
|
-
|
|
177
|
-
status:
|
|
178
|
-
failure:
|
|
179
|
-
code:
|
|
180
|
-
limit:
|
|
181
|
-
message:
|
|
182
|
-
retryable:
|
|
182
|
+
y.object({
|
|
183
|
+
status: y.literal("failed"),
|
|
184
|
+
failure: y.object({
|
|
185
|
+
code: y.enum(je),
|
|
186
|
+
limit: y.enum(["rows", "bytes"]).optional(),
|
|
187
|
+
message: y.string().min(1),
|
|
188
|
+
retryable: y.boolean()
|
|
183
189
|
}).strict()
|
|
184
190
|
}).strict()
|
|
185
191
|
]);
|
|
186
|
-
function
|
|
192
|
+
function ie(e) {
|
|
187
193
|
return !e || typeof e != "object" ? !1 : Array.isArray(e.cards);
|
|
188
194
|
}
|
|
189
|
-
function
|
|
195
|
+
function mt(e) {
|
|
190
196
|
if (!e)
|
|
191
197
|
return null;
|
|
192
198
|
if (typeof e == "string")
|
|
193
199
|
try {
|
|
194
200
|
const n = JSON.parse(e);
|
|
195
|
-
return
|
|
201
|
+
return ie(n) ? n : null;
|
|
196
202
|
} catch {
|
|
197
203
|
return null;
|
|
198
204
|
}
|
|
199
|
-
return
|
|
205
|
+
return ie(e) ? e : null;
|
|
200
206
|
}
|
|
201
|
-
function
|
|
207
|
+
function se(e) {
|
|
202
208
|
var n;
|
|
203
209
|
return (n = e == null ? void 0 : e.cards) != null && n.length ? e.activeCardId && e.cards.find((t) => t.id === e.activeCardId) || e.cards[0] : null;
|
|
204
210
|
}
|
|
205
|
-
function
|
|
211
|
+
function Gn(e) {
|
|
206
212
|
var t;
|
|
207
213
|
const n = (e == null ? void 0 : e.frameObject) ?? ((t = e == null ? void 0 : e.visual) == null ? void 0 : t.frameObject);
|
|
208
|
-
return
|
|
209
|
-
}
|
|
210
|
-
class E extends Error {
|
|
211
|
-
constructor(n, t, r) {
|
|
212
|
-
super(`${n}: ${t}`), this.code = n, this.context = r, Object.setPrototypeOf(this, E.prototype), this.name = "RawTemporalPresentationBoundaryError";
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
function be() {
|
|
216
|
-
return { type: "raw_temporal", presentation: { mode: "auto" } };
|
|
217
|
-
}
|
|
218
|
-
function Et(e) {
|
|
219
|
-
if (e.locale || e.relative || e.timezone && e.timezone !== "auto" || e.sourceTimezone && e.sourceTimezone !== "auto" || e.prefix || e.suffix)
|
|
220
|
-
throw new E(
|
|
221
|
-
"invalid_raw_temporal_format",
|
|
222
|
-
"Activated raw temporal presentation contains unsupported locale, relative-time, timezone, prefix, or suffix settings."
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
function Ie(e) {
|
|
226
|
-
const n = e.format;
|
|
227
|
-
if ((n == null ? void 0 : n.type) === "date" && (Et(n), n.pattern))
|
|
228
|
-
return {
|
|
229
|
-
type: "raw_temporal",
|
|
230
|
-
presentation: {
|
|
231
|
-
mode: "pattern",
|
|
232
|
-
dialect: "semaphor_tokens",
|
|
233
|
-
pattern: n.pattern
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
if (n)
|
|
237
|
-
throw new E(
|
|
238
|
-
"invalid_raw_temporal_format",
|
|
239
|
-
`Raw temporal detail field "${e.id}" has an incompatible authored format.`,
|
|
240
|
-
{ fieldId: e.id }
|
|
241
|
-
);
|
|
242
|
-
if (e.dateFormat === "custom") {
|
|
243
|
-
if (!e.customFormat)
|
|
244
|
-
throw new E(
|
|
245
|
-
"invalid_raw_temporal_format",
|
|
246
|
-
`Raw temporal detail field "${e.id}" selects a custom pattern but has no customFormat.`,
|
|
247
|
-
{ fieldId: e.id }
|
|
248
|
-
);
|
|
249
|
-
return {
|
|
250
|
-
type: "raw_temporal",
|
|
251
|
-
presentation: {
|
|
252
|
-
mode: "pattern",
|
|
253
|
-
dialect: "semaphor_tokens",
|
|
254
|
-
pattern: e.customFormat
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
return e.dateFormat ? {
|
|
259
|
-
type: "raw_temporal",
|
|
260
|
-
presentation: {
|
|
261
|
-
mode: "pattern",
|
|
262
|
-
dialect: "semaphor_tokens",
|
|
263
|
-
pattern: e.dateFormat
|
|
264
|
-
}
|
|
265
|
-
} : be();
|
|
266
|
-
}
|
|
267
|
-
function ie(e) {
|
|
268
|
-
var i;
|
|
269
|
-
if (e != null && e.useRelativeTime) return;
|
|
270
|
-
if (!e) return be();
|
|
271
|
-
if (e.useCustomFormat && !((i = e.customFormat) != null && i.trim()))
|
|
272
|
-
throw new E(
|
|
273
|
-
"invalid_raw_temporal_format",
|
|
274
|
-
"Declared SQL temporal presentation selects a custom pattern but has no customFormat.",
|
|
275
|
-
{ reason: "missing_declared_sql_custom_date_format" }
|
|
276
|
-
);
|
|
277
|
-
const n = e.useCustomFormat && e.customFormat ? e.customFormat : e.format, t = e.timezone, r = e.sourceTimezone, o = t && t !== "auto" ? { timezone: t } : void 0, a = {
|
|
278
|
-
sourceTimezone: r && r !== "auto" ? r : "UTC"
|
|
279
|
-
};
|
|
280
|
-
return n ? {
|
|
281
|
-
type: "raw_temporal",
|
|
282
|
-
...o,
|
|
283
|
-
...a,
|
|
284
|
-
presentation: {
|
|
285
|
-
mode: "pattern",
|
|
286
|
-
dialect: "date_fns",
|
|
287
|
-
pattern: n
|
|
288
|
-
}
|
|
289
|
-
} : {
|
|
290
|
-
type: "raw_temporal",
|
|
291
|
-
...o,
|
|
292
|
-
...a,
|
|
293
|
-
presentation: { mode: "auto" }
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
function hr(e) {
|
|
297
|
-
return e === "instant" ? "yyyy-MM-dd'T'HH:mm:ssXXX" : e === "wall_datetime" ? "yyyy-MM-dd'T'HH:mm:ss" : "yyyy-MM-dd";
|
|
298
|
-
}
|
|
299
|
-
function yr(e) {
|
|
300
|
-
je({
|
|
301
|
-
dialect: "date_fns",
|
|
302
|
-
pattern: e.pattern,
|
|
303
|
-
valueKind: e.valueKind
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
function Tt(e) {
|
|
307
|
-
const n = ie(e.settings);
|
|
308
|
-
if (!n)
|
|
309
|
-
throw new E(
|
|
310
|
-
"invalid_raw_temporal_format",
|
|
311
|
-
"Relative-time SQL presentation does not have an absolute date preview."
|
|
312
|
-
);
|
|
313
|
-
const t = e.valueKind ?? (n.presentation.mode === "pattern" ? "instant" : "date"), r = {
|
|
314
|
-
kind: "raw_temporal",
|
|
315
|
-
valueKind: t
|
|
316
|
-
}, o = e.value ?? (t === "date" ? "2023-05-15" : t === "wall_datetime" ? "2023-05-15T14:30:45" : "2023-05-15T14:30:45Z"), a = H({
|
|
317
|
-
metadata: r,
|
|
318
|
-
format: z({
|
|
319
|
-
format: n,
|
|
320
|
-
preferences: e.preferences,
|
|
321
|
-
calendar: { tz: e.calendarTimezone }
|
|
322
|
-
})
|
|
323
|
-
})(o);
|
|
324
|
-
if (!a.ok)
|
|
325
|
-
throw new E(
|
|
326
|
-
"invalid_raw_temporal_format",
|
|
327
|
-
a.diagnostic.message
|
|
328
|
-
);
|
|
329
|
-
return a.text;
|
|
330
|
-
}
|
|
331
|
-
function gr(e) {
|
|
332
|
-
try {
|
|
333
|
-
return { ok: !0, text: Tt(e) };
|
|
334
|
-
} catch (n) {
|
|
335
|
-
return {
|
|
336
|
-
ok: !1,
|
|
337
|
-
message: n instanceof Error ? n.message : "Invalid SQL temporal presentation."
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
function we(e) {
|
|
342
|
-
var t;
|
|
343
|
-
const n = e.effectiveCardConfig ?? e.card.config;
|
|
344
|
-
return G(e.card, n) === "freeform" && !!((t = e.card.sql) != null && t.trim()) && !ae(e.card.python || "").trim();
|
|
345
|
-
}
|
|
346
|
-
function xt(e) {
|
|
347
|
-
var n, t;
|
|
348
|
-
return e.type !== "table" && e.type !== "detailTable" || !we({ card: e }) ? !1 : Object.values(
|
|
349
|
-
((t = (n = e.preferences) == null ? void 0 : n.tablePrefs) == null ? void 0 : t.columnSettingsMap) || {}
|
|
350
|
-
).some(
|
|
351
|
-
(r) => {
|
|
352
|
-
var o, a, i;
|
|
353
|
-
return r.type === "date" && ((o = r.dateFormat) == null ? void 0 : o.useRelativeTime) !== !0 && ((a = r.dateFormat) == null ? void 0 : a.useCustomFormat) === !0 && !((i = r.dateFormat.customFormat) != null && i.trim());
|
|
354
|
-
}
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
function vr(e) {
|
|
358
|
-
var t, r, o;
|
|
359
|
-
if (!xt(e)) return e;
|
|
360
|
-
const n = ((r = (t = e.preferences) == null ? void 0 : t.tablePrefs) == null ? void 0 : r.columnSettingsMap) || {};
|
|
361
|
-
return {
|
|
362
|
-
...e,
|
|
363
|
-
preferences: {
|
|
364
|
-
...e.preferences,
|
|
365
|
-
tablePrefs: {
|
|
366
|
-
...(o = e.preferences) == null ? void 0 : o.tablePrefs,
|
|
367
|
-
columnSettingsMap: Object.fromEntries(
|
|
368
|
-
Object.entries(n).map(([a, i]) => {
|
|
369
|
-
var c, l, s;
|
|
370
|
-
return [
|
|
371
|
-
a,
|
|
372
|
-
i.type === "date" && ((c = i.dateFormat) == null ? void 0 : c.useRelativeTime) !== !0 && ((l = i.dateFormat) == null ? void 0 : l.useCustomFormat) === !0 && !((s = i.dateFormat.customFormat) != null && s.trim()) ? {
|
|
373
|
-
...i,
|
|
374
|
-
dateFormat: {
|
|
375
|
-
...i.dateFormat,
|
|
376
|
-
format: "",
|
|
377
|
-
useCustomFormat: !1,
|
|
378
|
-
customFormat: ""
|
|
379
|
-
}
|
|
380
|
-
} : i
|
|
381
|
-
];
|
|
382
|
-
})
|
|
383
|
-
)
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
function St() {
|
|
389
|
-
return {
|
|
390
|
-
activatedColumnKeys: /* @__PURE__ */ new Set(),
|
|
391
|
-
byColumnKey: /* @__PURE__ */ new Map(),
|
|
392
|
-
byFieldId: /* @__PURE__ */ new Map()
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
function te(e, n) {
|
|
396
|
-
return e === void 0 ? { kind: "invalid", error: n } : {
|
|
397
|
-
kind: "invalid",
|
|
398
|
-
error: e instanceof E ? e : e instanceof qe ? new E(
|
|
399
|
-
e.code,
|
|
400
|
-
e.message,
|
|
401
|
-
n.context
|
|
402
|
-
) : new E(
|
|
403
|
-
n.code,
|
|
404
|
-
e instanceof Error ? e.message : n.message,
|
|
405
|
-
n.context
|
|
406
|
-
)
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
function kt(e) {
|
|
410
|
-
var o;
|
|
411
|
-
if (e.cardType !== "detailTable" || e.resultOwner !== "config")
|
|
412
|
-
return { kind: "inactive" };
|
|
413
|
-
if (!e.result) return { kind: "loading" };
|
|
414
|
-
const { records: n, columns: t, columnKeyMap: r } = e.result;
|
|
415
|
-
if (!Array.isArray(n) || !Array.isArray(t) || !r)
|
|
416
|
-
return te(
|
|
417
|
-
void 0,
|
|
418
|
-
new E(
|
|
419
|
-
"missing_raw_temporal_result_contract",
|
|
420
|
-
"Activated raw temporal detail results require records, columns, and columnKeyMap atomically."
|
|
421
|
-
)
|
|
422
|
-
);
|
|
423
|
-
try {
|
|
424
|
-
const a = t.filter((m) => m.rawTemporal);
|
|
425
|
-
if (a.length === 0) return { kind: "inactive" };
|
|
426
|
-
const i = new Map(
|
|
427
|
-
(((o = e.effectiveCardConfig) == null ? void 0 : o.detailColumns) || []).map((m) => [
|
|
428
|
-
m.id,
|
|
429
|
-
m
|
|
430
|
-
])
|
|
431
|
-
), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
432
|
-
for (const m of a) {
|
|
433
|
-
const p = Array.from(i).flatMap(
|
|
434
|
-
([T, Z]) => {
|
|
435
|
-
const O = pt(
|
|
436
|
-
r,
|
|
437
|
-
T,
|
|
438
|
-
"detail"
|
|
439
|
-
);
|
|
440
|
-
return O && O.role === "detail" && (O.outputKey ?? O.rawKey) === m.key ? [{ field: Z, binding: O }] : [];
|
|
441
|
-
}
|
|
442
|
-
), f = p.length === 1 ? p[0] : null;
|
|
443
|
-
if (!f || typeof f.binding.rawKey != "string" || f.binding.rawKey.trim().length === 0 || f.binding.outputKey !== void 0 && (typeof f.binding.outputKey != "string" || f.binding.outputKey.trim().length === 0))
|
|
444
|
-
throw new E(
|
|
445
|
-
"missing_raw_temporal_column_binding",
|
|
446
|
-
`Raw temporal result column "${m.key}" does not have one valid exact detail result binding.`,
|
|
447
|
-
{ columnKey: m.key }
|
|
448
|
-
);
|
|
449
|
-
const { field: h, binding: I } = f, w = I.outputKey ?? I.rawKey, x = ge(m, {
|
|
450
|
-
metadataRequired: !0
|
|
451
|
-
});
|
|
452
|
-
if (!x)
|
|
453
|
-
throw new E(
|
|
454
|
-
"invalid_raw_temporal_metadata",
|
|
455
|
-
`Raw temporal result column "${w}" has no metadata.`,
|
|
456
|
-
{ fieldId: h.id, columnKey: w }
|
|
457
|
-
);
|
|
458
|
-
const k = z({
|
|
459
|
-
format: Ie(h),
|
|
460
|
-
preferences: e.preferences,
|
|
461
|
-
calendar: e.calendar
|
|
462
|
-
}), $ = {
|
|
463
|
-
fieldId: h.id,
|
|
464
|
-
columnKey: w,
|
|
465
|
-
metadata: x,
|
|
466
|
-
format: k,
|
|
467
|
-
formatValue: H({ metadata: x, format: k })
|
|
468
|
-
};
|
|
469
|
-
for (let T = 0; T < n.length; T += 1)
|
|
470
|
-
if (!Object.prototype.hasOwnProperty.call(n[T], w) || n[T][w] === void 0)
|
|
471
|
-
throw new E(
|
|
472
|
-
"missing_raw_temporal_result_contract",
|
|
473
|
-
`Raw temporal result row ${T} is missing column "${w}".`,
|
|
474
|
-
{ fieldId: h.id, columnKey: w }
|
|
475
|
-
);
|
|
476
|
-
c.set(w, $), l.set(h.id, $);
|
|
477
|
-
}
|
|
478
|
-
const s = {
|
|
479
|
-
activatedColumnKeys: new Set(c.keys()),
|
|
480
|
-
byColumnKey: c,
|
|
481
|
-
byFieldId: l
|
|
482
|
-
};
|
|
483
|
-
return n.length === 0 ? { kind: "loaded_empty", presentation: s } : { kind: "loaded_valid", presentation: s };
|
|
484
|
-
} catch (a) {
|
|
485
|
-
return te(
|
|
486
|
-
a,
|
|
487
|
-
new E(
|
|
488
|
-
"invalid_raw_temporal_metadata",
|
|
489
|
-
"Activated raw temporal result metadata is invalid."
|
|
490
|
-
)
|
|
491
|
-
);
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
function _t(e) {
|
|
495
|
-
var r, o, a;
|
|
496
|
-
const n = e.effectiveCardConfig ?? e.card.config, t = G(
|
|
497
|
-
e.card,
|
|
498
|
-
n
|
|
499
|
-
);
|
|
500
|
-
if (e.card.type === "detailTable" && t === "config") {
|
|
501
|
-
const i = !!((r = e.columns) != null && r.some((c) => c.rawTemporal));
|
|
502
|
-
return i && e.records !== void 0 && !e.columnKeyMap ? {
|
|
503
|
-
kind: "invalid",
|
|
504
|
-
error: new E(
|
|
505
|
-
"missing_raw_temporal_result_contract",
|
|
506
|
-
"Activated raw temporal detail results require records, columns, and columnKeyMap atomically."
|
|
507
|
-
)
|
|
508
|
-
} : e.records !== void 0 && !i ? { kind: "inactive" } : fe(
|
|
509
|
-
kt({
|
|
510
|
-
cardType: e.card.type,
|
|
511
|
-
resultOwner: t,
|
|
512
|
-
effectiveCardConfig: n,
|
|
513
|
-
result: e.records === void 0 || !e.columns || !e.columnKeyMap ? void 0 : {
|
|
514
|
-
records: e.records,
|
|
515
|
-
columns: e.columns,
|
|
516
|
-
columnKeyMap: e.columnKeyMap
|
|
517
|
-
},
|
|
518
|
-
preferences: e.preferences,
|
|
519
|
-
calendar: e.calendar
|
|
520
|
-
}),
|
|
521
|
-
e
|
|
522
|
-
);
|
|
523
|
-
}
|
|
524
|
-
return fe(
|
|
525
|
-
At({
|
|
526
|
-
resultOwner: t,
|
|
527
|
-
sql: e.card.sql,
|
|
528
|
-
normalizedPython: ae(
|
|
529
|
-
e.card.python || ""
|
|
530
|
-
),
|
|
531
|
-
records: e.records,
|
|
532
|
-
columns: e.columns,
|
|
533
|
-
columnSettings: (a = (o = e.card.preferences) == null ? void 0 : o.tablePrefs) == null ? void 0 : a.columnSettingsMap,
|
|
534
|
-
preferences: e.preferences,
|
|
535
|
-
calendar: e.calendar
|
|
536
|
-
}),
|
|
537
|
-
e
|
|
538
|
-
);
|
|
539
|
-
}
|
|
540
|
-
function br(e) {
|
|
541
|
-
var r, o, a;
|
|
542
|
-
const n = e.effectiveCardConfig ?? e.card.config, t = G(
|
|
543
|
-
e.card,
|
|
544
|
-
n
|
|
545
|
-
);
|
|
546
|
-
return e.card.type === "detailTable" && t === "config" ? !!((r = e.columns) != null && r.some((i) => i.rawTemporal)) : we(e) ? Object.values(
|
|
547
|
-
((a = (o = e.card.preferences) == null ? void 0 : o.tablePrefs) == null ? void 0 : a.columnSettingsMap) || {}
|
|
548
|
-
).some(
|
|
549
|
-
(i) => {
|
|
550
|
-
var c;
|
|
551
|
-
return i.type === "date" && !((c = i.dateFormat) != null && c.useRelativeTime);
|
|
552
|
-
}
|
|
553
|
-
) : !1;
|
|
554
|
-
}
|
|
555
|
-
function fe(e, n) {
|
|
556
|
-
if (!n.executionSnapshot || e.kind === "inactive" || e.kind === "loading" || e.kind === "invalid")
|
|
557
|
-
return e;
|
|
558
|
-
if (!n.dashboardId)
|
|
559
|
-
return {
|
|
560
|
-
kind: "invalid",
|
|
561
|
-
error: new E(
|
|
562
|
-
"missing_raw_temporal_result_contract",
|
|
563
|
-
"A dashboard ID is required to resolve the captured raw temporal presentation."
|
|
564
|
-
)
|
|
565
|
-
};
|
|
566
|
-
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
567
|
-
for (const o of e.presentation.activatedColumnKeys) {
|
|
568
|
-
const a = Ye({
|
|
569
|
-
snapshot: n.executionSnapshot,
|
|
570
|
-
scope: {
|
|
571
|
-
dashboardId: n.dashboardId,
|
|
572
|
-
cardId: n.card.id,
|
|
573
|
-
...n.attachmentIndex !== void 0 ? { attachmentIndex: n.attachmentIndex } : {}
|
|
574
|
-
},
|
|
575
|
-
target: { kind: "column", columnKey: o }
|
|
576
|
-
});
|
|
577
|
-
if (!a)
|
|
578
|
-
return {
|
|
579
|
-
kind: "invalid",
|
|
580
|
-
error: new Qe(o)
|
|
581
|
-
};
|
|
582
|
-
const i = e.presentation.byColumnKey.get(o);
|
|
583
|
-
if (!i) continue;
|
|
584
|
-
const c = {
|
|
585
|
-
...i,
|
|
586
|
-
format: a,
|
|
587
|
-
formatValue: H({
|
|
588
|
-
metadata: i.metadata,
|
|
589
|
-
format: a
|
|
590
|
-
})
|
|
591
|
-
};
|
|
592
|
-
t.set(i.columnKey, c), i.fieldId && r.set(i.fieldId, c);
|
|
593
|
-
}
|
|
594
|
-
return {
|
|
595
|
-
...e,
|
|
596
|
-
presentation: {
|
|
597
|
-
activatedColumnKeys: e.presentation.activatedColumnKeys,
|
|
598
|
-
byColumnKey: t,
|
|
599
|
-
byFieldId: r
|
|
600
|
-
}
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
function At(e) {
|
|
604
|
-
var t, r;
|
|
605
|
-
if (e.resultOwner !== "freeform" || !((t = e.sql) != null && t.trim()) || (r = e.normalizedPython) != null && r.trim())
|
|
606
|
-
return { kind: "inactive" };
|
|
607
|
-
const n = Object.entries(
|
|
608
|
-
e.columnSettings || {}
|
|
609
|
-
).filter(
|
|
610
|
-
([, o]) => {
|
|
611
|
-
var a;
|
|
612
|
-
return o.type === "date" && !((a = o.dateFormat) != null && a.useRelativeTime);
|
|
613
|
-
}
|
|
614
|
-
);
|
|
615
|
-
if (n.length === 0) return { kind: "inactive" };
|
|
616
|
-
if (!e.records) return { kind: "loading" };
|
|
617
|
-
try {
|
|
618
|
-
const o = /* @__PURE__ */ new Map(), a = new Set(
|
|
619
|
-
n.map(([s]) => s)
|
|
620
|
-
), i = /* @__PURE__ */ new Map(), c = [...e.columns || []];
|
|
621
|
-
for (const [s, m] of n) {
|
|
622
|
-
const p = ie(
|
|
623
|
-
m.dateFormat
|
|
624
|
-
);
|
|
625
|
-
if (!p) continue;
|
|
626
|
-
const f = Ve({
|
|
627
|
-
columnKey: s,
|
|
628
|
-
values: e.records.map((x) => {
|
|
629
|
-
if (!Object.prototype.hasOwnProperty.call(x, s))
|
|
630
|
-
throw new E(
|
|
631
|
-
"missing_raw_temporal_result_contract",
|
|
632
|
-
`Declared SQL temporal column "${s}" is absent from a physical result row.`,
|
|
633
|
-
{ columnKey: s }
|
|
634
|
-
);
|
|
635
|
-
const k = x[s];
|
|
636
|
-
return k === null || typeof k == "string" ? k : String(k);
|
|
637
|
-
})
|
|
638
|
-
});
|
|
639
|
-
if (i.set(s, f), f.status !== "classified") continue;
|
|
640
|
-
let h = c.findIndex(
|
|
641
|
-
(x) => x.key === s
|
|
642
|
-
);
|
|
643
|
-
if (e.columns && h < 0)
|
|
644
|
-
throw new E(
|
|
645
|
-
"missing_raw_temporal_result_contract",
|
|
646
|
-
`Classified SQL temporal column "${s}" is absent from result columns.`,
|
|
647
|
-
{ columnKey: s }
|
|
648
|
-
);
|
|
649
|
-
h < 0 && (h = c.length, c.push({
|
|
650
|
-
key: s,
|
|
651
|
-
name: s,
|
|
652
|
-
label: s,
|
|
653
|
-
role: "dimension",
|
|
654
|
-
dataType: "string"
|
|
655
|
-
}));
|
|
656
|
-
const I = {
|
|
657
|
-
...c[h],
|
|
658
|
-
role: "date",
|
|
659
|
-
dataType: f.metadata.valueKind === "date" ? "date" : "datetime",
|
|
660
|
-
rawTemporal: f.metadata
|
|
661
|
-
};
|
|
662
|
-
ge(I, {
|
|
663
|
-
metadataRequired: !0
|
|
664
|
-
}), c[h] = I;
|
|
665
|
-
const w = z({
|
|
666
|
-
format: p,
|
|
667
|
-
preferences: e.preferences,
|
|
668
|
-
calendar: e.calendar
|
|
669
|
-
});
|
|
670
|
-
o.set(s, {
|
|
671
|
-
columnKey: s,
|
|
672
|
-
metadata: f.metadata,
|
|
673
|
-
format: w,
|
|
674
|
-
formatValue: H({
|
|
675
|
-
metadata: f.metadata,
|
|
676
|
-
format: w
|
|
677
|
-
})
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
const l = {
|
|
681
|
-
...St(),
|
|
682
|
-
activatedColumnKeys: a,
|
|
683
|
-
byColumnKey: o
|
|
684
|
-
};
|
|
685
|
-
return e.records.length === 0 ? {
|
|
686
|
-
kind: "loaded_empty",
|
|
687
|
-
presentation: l,
|
|
688
|
-
adaptedColumns: c,
|
|
689
|
-
sqlClassifications: i
|
|
690
|
-
} : {
|
|
691
|
-
kind: "loaded_valid",
|
|
692
|
-
presentation: l,
|
|
693
|
-
adaptedColumns: c,
|
|
694
|
-
sqlClassifications: i
|
|
695
|
-
};
|
|
696
|
-
} catch (o) {
|
|
697
|
-
return te(
|
|
698
|
-
o,
|
|
699
|
-
new E(
|
|
700
|
-
"invalid_raw_temporal_format",
|
|
701
|
-
"Declared SQL raw temporal presentation is invalid."
|
|
702
|
-
)
|
|
703
|
-
);
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
function Ir(e) {
|
|
707
|
-
if (e.value !== null && typeof e.value != "string")
|
|
708
|
-
return {
|
|
709
|
-
value: e.value,
|
|
710
|
-
label: String(e.value),
|
|
711
|
-
result: {
|
|
712
|
-
ok: !1,
|
|
713
|
-
text: String(e.value),
|
|
714
|
-
diagnostic: {
|
|
715
|
-
code: "invalid_raw_temporal_value",
|
|
716
|
-
message: `Raw temporal column "${e.presentation.columnKey}" must contain a string or null.`
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
};
|
|
720
|
-
const n = e.presentation.formatValue(e.value);
|
|
721
|
-
return { value: e.value, label: n.text, result: n };
|
|
722
|
-
}
|
|
723
|
-
function wr(e) {
|
|
724
|
-
if (!e.result || typeof e.result != "object") return !1;
|
|
725
|
-
const n = e.result;
|
|
726
|
-
if (e.expectedResultOwner !== void 0 && n.resultOwner !== e.expectedResultOwner || !Array.isArray(n.records)) return !1;
|
|
727
|
-
const t = _t({
|
|
728
|
-
card: e.card,
|
|
729
|
-
effectiveCardConfig: e.effectiveCardConfig,
|
|
730
|
-
records: n.records,
|
|
731
|
-
columns: n.columns,
|
|
732
|
-
columnKeyMap: n.columnKeyMap,
|
|
733
|
-
preferences: rt,
|
|
734
|
-
calendar: { tz: "UTC" }
|
|
735
|
-
});
|
|
736
|
-
return t.kind === "inactive" || t.kind === "loaded_empty" || t.kind === "loaded_valid";
|
|
214
|
+
return se(mt(n));
|
|
737
215
|
}
|
|
738
216
|
class U extends Error {
|
|
739
217
|
constructor(t) {
|
|
@@ -741,12 +219,12 @@ class U extends Error {
|
|
|
741
219
|
super(
|
|
742
220
|
`Unable to resolve ${r} while capturing report presentation. Refresh the authoring page and select the attachment again.`
|
|
743
221
|
);
|
|
744
|
-
|
|
745
|
-
|
|
222
|
+
L(this, "code", "temporal_snapshot_target_not_found");
|
|
223
|
+
L(this, "selection");
|
|
746
224
|
this.name = "TemporalSnapshotSelectionError", this.selection = t;
|
|
747
225
|
}
|
|
748
226
|
}
|
|
749
|
-
function
|
|
227
|
+
function ft(e, n) {
|
|
750
228
|
var o;
|
|
751
229
|
const t = [], r = /* @__PURE__ */ new Map();
|
|
752
230
|
for (const a of n) {
|
|
@@ -759,26 +237,26 @@ function Dt(e, n) {
|
|
|
759
237
|
throw new U(a);
|
|
760
238
|
let c = !a.cardId;
|
|
761
239
|
for (const l of i) {
|
|
762
|
-
const
|
|
763
|
-
(
|
|
764
|
-
),
|
|
765
|
-
(
|
|
240
|
+
const m = (((o = l.document) == null ? void 0 : o.sections) || []).flatMap(
|
|
241
|
+
(h) => Ze(h)
|
|
242
|
+
), s = (l.frames || []).flatMap(
|
|
243
|
+
(h) => ut(h, a.cardId)
|
|
766
244
|
);
|
|
767
|
-
|
|
768
|
-
const
|
|
769
|
-
...
|
|
245
|
+
s.length > 0 && (c = !0);
|
|
246
|
+
const u = [
|
|
247
|
+
...s,
|
|
770
248
|
...(l.cards || []).filter(
|
|
771
|
-
(
|
|
249
|
+
(h) => !a.cardId || a.cardId === h.id
|
|
772
250
|
),
|
|
773
|
-
...
|
|
774
|
-
(
|
|
251
|
+
...m.filter(
|
|
252
|
+
(h) => !a.cardId || a.cardId === h.id
|
|
775
253
|
)
|
|
776
254
|
];
|
|
777
|
-
for (const
|
|
255
|
+
for (const h of u) {
|
|
778
256
|
c = !0;
|
|
779
|
-
const
|
|
780
|
-
|
|
781
|
-
card:
|
|
257
|
+
const g = r.get(a.attachmentIndex) ?? /* @__PURE__ */ new Set();
|
|
258
|
+
g.has(h.id) || (g.add(h.id), r.set(a.attachmentIndex, g), t.push({
|
|
259
|
+
card: h,
|
|
782
260
|
...a.attachmentIndex !== void 0 ? { attachmentIndex: a.attachmentIndex } : {}
|
|
783
261
|
}));
|
|
784
262
|
}
|
|
@@ -788,55 +266,55 @@ function Dt(e, n) {
|
|
|
788
266
|
}
|
|
789
267
|
return t;
|
|
790
268
|
}
|
|
791
|
-
function
|
|
269
|
+
function ut(e, n) {
|
|
792
270
|
var i;
|
|
793
|
-
const t = n ? (i = e.cards) == null ? void 0 : i.find((c) => c.id === n) :
|
|
271
|
+
const t = n ? (i = e.cards) == null ? void 0 : i.find((c) => c.id === n) : se(e);
|
|
794
272
|
if (!t) return [];
|
|
795
|
-
const r =
|
|
273
|
+
const r = nt(e, t), o = (e.cards || []).filter(
|
|
796
274
|
(c) => {
|
|
797
275
|
var l;
|
|
798
276
|
return typeof ((l = c.customCardPreferences) == null ? void 0 : l.slotIndex) == "number";
|
|
799
277
|
}
|
|
800
|
-
).length > 1, a = r != null && (
|
|
801
|
-
return !r || !a ? [t] :
|
|
802
|
-
|
|
278
|
+
).length > 1, a = r != null && (rt(r) === "multiple" || o);
|
|
279
|
+
return !r || !a ? [t] : ot(
|
|
280
|
+
at({
|
|
803
281
|
frame: e,
|
|
804
282
|
configCard: r,
|
|
805
283
|
isMultiInputVisual: !0
|
|
806
284
|
})
|
|
807
285
|
).filter((c) => c !== null);
|
|
808
286
|
}
|
|
809
|
-
function
|
|
810
|
-
return
|
|
287
|
+
function Wn(e) {
|
|
288
|
+
return ft(e.dashboard, e.selections).flatMap(
|
|
811
289
|
({ card: n, attachmentIndex: t }) => {
|
|
812
|
-
var
|
|
813
|
-
const r = ((
|
|
290
|
+
var s, u, h, g;
|
|
291
|
+
const r = ((s = e.resolveCardConfig) == null ? void 0 : s.call(e, n)) ?? n.config, o = Ke({
|
|
814
292
|
card: n,
|
|
815
293
|
cardConfig: r
|
|
816
294
|
}), a = {
|
|
817
295
|
dashboardId: e.dashboard.id,
|
|
818
296
|
cardId: n.id,
|
|
819
297
|
...t !== void 0 ? { attachmentIndex: t } : {}
|
|
820
|
-
}, i = o ? o.fields.map((
|
|
298
|
+
}, i = o ? o.fields.map((E) => ({
|
|
821
299
|
scope: a,
|
|
822
300
|
target: {
|
|
823
301
|
kind: "field",
|
|
824
|
-
fieldId:
|
|
825
|
-
role:
|
|
302
|
+
fieldId: E.id,
|
|
303
|
+
role: E.role
|
|
826
304
|
},
|
|
827
|
-
format:
|
|
828
|
-
|
|
305
|
+
format: He(
|
|
306
|
+
E,
|
|
829
307
|
{
|
|
830
308
|
dateStyle: e.valueFormatPreferences.dateStyle,
|
|
831
309
|
dateTime: { ...e.valueFormatPreferences.dateTime }
|
|
832
310
|
},
|
|
833
311
|
e.valueFormatPreferences.locale
|
|
834
312
|
)
|
|
835
|
-
})) : [], c = [], l =
|
|
313
|
+
})) : [], c = [], l = Ge(n, r), m = We(
|
|
836
314
|
n.python || ""
|
|
837
315
|
);
|
|
838
316
|
if (n.type === "detailTable" && l === "config") {
|
|
839
|
-
const
|
|
317
|
+
const E = (r == null ? void 0 : r.detailColumns) || [], x = [
|
|
840
318
|
...((r == null ? void 0 : r.groupByColumns) || []).map(($) => ({
|
|
841
319
|
field: $,
|
|
842
320
|
role: "groupby"
|
|
@@ -849,52 +327,52 @@ function Cr(e) {
|
|
|
849
327
|
field: $,
|
|
850
328
|
role: "pivotby"
|
|
851
329
|
})),
|
|
852
|
-
...
|
|
330
|
+
...E.map(($) => ({
|
|
853
331
|
field: $,
|
|
854
332
|
role: "detail"
|
|
855
333
|
}))
|
|
856
|
-
],
|
|
857
|
-
|
|
858
|
-
({ field: $, role: T }) =>
|
|
334
|
+
], _ = /* @__PURE__ */ new Map(), M = new Set(
|
|
335
|
+
x.map(
|
|
336
|
+
({ field: $, role: T }) => Ye($, T)
|
|
859
337
|
)
|
|
860
338
|
);
|
|
861
|
-
for (const { field: $ } of
|
|
339
|
+
for (const { field: $ } of x) {
|
|
862
340
|
const T = $.label;
|
|
863
|
-
T &&
|
|
341
|
+
T && _.set(T, (_.get(T) || 0) + 1);
|
|
864
342
|
}
|
|
865
|
-
for (const $ of
|
|
866
|
-
const T =
|
|
343
|
+
for (const $ of E) {
|
|
344
|
+
const T = Ne($.dataType);
|
|
867
345
|
if (T !== "date" && T !== "datetime") continue;
|
|
868
|
-
const
|
|
869
|
-
label:
|
|
870
|
-
labelCount:
|
|
871
|
-
rawKey:
|
|
872
|
-
rawKeys:
|
|
346
|
+
const De = Je($), q = $.label, oe = Qe({
|
|
347
|
+
label: q,
|
|
348
|
+
labelCount: q && _.get(q) || 0,
|
|
349
|
+
rawKey: De,
|
|
350
|
+
rawKeys: M
|
|
873
351
|
});
|
|
874
|
-
if (!
|
|
352
|
+
if (!oe) throw new U(a);
|
|
875
353
|
c.push({
|
|
876
354
|
scope: a,
|
|
877
|
-
target: { kind: "column", columnKey:
|
|
878
|
-
format:
|
|
879
|
-
format:
|
|
355
|
+
target: { kind: "column", columnKey: oe },
|
|
356
|
+
format: ae({
|
|
357
|
+
format: et($),
|
|
880
358
|
preferences: e.valueFormatPreferences,
|
|
881
359
|
calendar: e.calendar
|
|
882
360
|
})
|
|
883
361
|
});
|
|
884
362
|
}
|
|
885
|
-
} else if (l === "freeform" && ((
|
|
886
|
-
for (const [
|
|
887
|
-
((
|
|
363
|
+
} else if (l === "freeform" && ((u = n.sql) != null && u.trim()) && !m.trim())
|
|
364
|
+
for (const [E, x] of Object.entries(
|
|
365
|
+
((g = (h = n.preferences) == null ? void 0 : h.tablePrefs) == null ? void 0 : g.columnSettingsMap) || {}
|
|
888
366
|
)) {
|
|
889
|
-
if (
|
|
890
|
-
const
|
|
891
|
-
|
|
367
|
+
if (x.type !== "date") continue;
|
|
368
|
+
const _ = tt(
|
|
369
|
+
x.dateFormat
|
|
892
370
|
);
|
|
893
|
-
|
|
371
|
+
_ && c.push({
|
|
894
372
|
scope: a,
|
|
895
|
-
target: { kind: "column", columnKey:
|
|
896
|
-
format:
|
|
897
|
-
format:
|
|
373
|
+
target: { kind: "column", columnKey: E },
|
|
374
|
+
format: ae({
|
|
375
|
+
format: _,
|
|
898
376
|
preferences: e.valueFormatPreferences,
|
|
899
377
|
calendar: e.calendar
|
|
900
378
|
})
|
|
@@ -904,13 +382,13 @@ function Cr(e) {
|
|
|
904
382
|
}
|
|
905
383
|
);
|
|
906
384
|
}
|
|
907
|
-
function
|
|
385
|
+
function pt(e) {
|
|
908
386
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
909
387
|
}
|
|
910
|
-
function
|
|
911
|
-
return
|
|
388
|
+
function A(e, n, t) {
|
|
389
|
+
return pt(e) ? e : (t.push({ field: n, message: "Expected an object." }), {});
|
|
912
390
|
}
|
|
913
|
-
function
|
|
391
|
+
function w(e, n, t, r) {
|
|
914
392
|
const o = new Set(t);
|
|
915
393
|
Object.keys(e).forEach((a) => {
|
|
916
394
|
o.has(a) || r.push({
|
|
@@ -919,7 +397,7 @@ function F(e, n, t, r) {
|
|
|
919
397
|
});
|
|
920
398
|
});
|
|
921
399
|
}
|
|
922
|
-
function
|
|
400
|
+
function F(e, n, t, r, o = {}) {
|
|
923
401
|
if (e == null)
|
|
924
402
|
return;
|
|
925
403
|
if (typeof e != "string") {
|
|
@@ -940,8 +418,8 @@ function N(e, n, t, r, o = {}) {
|
|
|
940
418
|
}
|
|
941
419
|
return a;
|
|
942
420
|
}
|
|
943
|
-
function
|
|
944
|
-
const r =
|
|
421
|
+
function ee(e, n, t) {
|
|
422
|
+
const r = F(e, n, 2e3, t);
|
|
945
423
|
if (r)
|
|
946
424
|
try {
|
|
947
425
|
return new URL(r), r;
|
|
@@ -950,13 +428,13 @@ function ce(e, n, t) {
|
|
|
950
428
|
return;
|
|
951
429
|
}
|
|
952
430
|
}
|
|
953
|
-
function
|
|
954
|
-
const r =
|
|
955
|
-
|
|
431
|
+
function ce(e, n, t) {
|
|
432
|
+
const r = A(e, n, t);
|
|
433
|
+
w(r, n, ["tokens", "components"], t);
|
|
956
434
|
const o = {};
|
|
957
435
|
if (r.tokens !== void 0) {
|
|
958
|
-
const a =
|
|
959
|
-
|
|
436
|
+
const a = A(r.tokens, `${n}.tokens`, t);
|
|
437
|
+
w(
|
|
960
438
|
a,
|
|
961
439
|
`${n}.tokens`,
|
|
962
440
|
["color", "typography"],
|
|
@@ -964,7 +442,7 @@ function pe(e, n, t) {
|
|
|
964
442
|
);
|
|
965
443
|
const i = {};
|
|
966
444
|
if (a.color !== void 0) {
|
|
967
|
-
const c =
|
|
445
|
+
const c = A(
|
|
968
446
|
a.color,
|
|
969
447
|
`${n}.tokens.color`,
|
|
970
448
|
t
|
|
@@ -981,37 +459,37 @@ function pe(e, n, t) {
|
|
|
981
459
|
"warning",
|
|
982
460
|
"info"
|
|
983
461
|
];
|
|
984
|
-
|
|
985
|
-
const
|
|
986
|
-
l.forEach((
|
|
987
|
-
const
|
|
988
|
-
c[
|
|
989
|
-
`${n}.tokens.color.${
|
|
462
|
+
w(c, `${n}.tokens.color`, l, t);
|
|
463
|
+
const m = {};
|
|
464
|
+
l.forEach((s) => {
|
|
465
|
+
const u = F(
|
|
466
|
+
c[s],
|
|
467
|
+
`${n}.tokens.color.${s}`,
|
|
990
468
|
120,
|
|
991
469
|
t
|
|
992
470
|
);
|
|
993
|
-
|
|
994
|
-
}), i.color =
|
|
471
|
+
u !== void 0 && (m[s] = u);
|
|
472
|
+
}), i.color = m;
|
|
995
473
|
}
|
|
996
474
|
if (a.typography !== void 0) {
|
|
997
|
-
const c =
|
|
475
|
+
const c = A(
|
|
998
476
|
a.typography,
|
|
999
477
|
`${n}.tokens.typography`,
|
|
1000
478
|
t
|
|
1001
479
|
);
|
|
1002
|
-
|
|
480
|
+
w(
|
|
1003
481
|
c,
|
|
1004
482
|
`${n}.tokens.typography`,
|
|
1005
483
|
["fontFamily", "monoFontFamily"],
|
|
1006
484
|
t
|
|
1007
485
|
);
|
|
1008
|
-
const l =
|
|
486
|
+
const l = F(
|
|
1009
487
|
c.fontFamily,
|
|
1010
488
|
`${n}.tokens.typography.fontFamily`,
|
|
1011
489
|
500,
|
|
1012
490
|
t,
|
|
1013
491
|
{ allowEmpty: !0 }
|
|
1014
|
-
),
|
|
492
|
+
), m = F(
|
|
1015
493
|
c.monoFontFamily,
|
|
1016
494
|
`${n}.tokens.typography.monoFontFamily`,
|
|
1017
495
|
500,
|
|
@@ -1020,32 +498,32 @@ function pe(e, n, t) {
|
|
|
1020
498
|
);
|
|
1021
499
|
i.typography = {
|
|
1022
500
|
...l !== void 0 ? { fontFamily: l } : {},
|
|
1023
|
-
...
|
|
501
|
+
...m !== void 0 ? { monoFontFamily: m } : {}
|
|
1024
502
|
};
|
|
1025
503
|
}
|
|
1026
504
|
o.tokens = i;
|
|
1027
505
|
}
|
|
1028
506
|
if (r.components !== void 0) {
|
|
1029
|
-
const a =
|
|
507
|
+
const a = A(
|
|
1030
508
|
r.components,
|
|
1031
509
|
`${n}.components`,
|
|
1032
510
|
t
|
|
1033
511
|
);
|
|
1034
|
-
if (
|
|
1035
|
-
const i =
|
|
512
|
+
if (w(a, `${n}.components`, ["chart"], t), a.chart !== void 0) {
|
|
513
|
+
const i = A(
|
|
1036
514
|
a.chart,
|
|
1037
515
|
`${n}.components.chart`,
|
|
1038
516
|
t
|
|
1039
517
|
);
|
|
1040
|
-
|
|
518
|
+
w(i, `${n}.components.chart`, ["palette"], t);
|
|
1041
519
|
let c;
|
|
1042
520
|
i.palette !== void 0 && (Array.isArray(i.palette) ? i.palette.length > 20 ? t.push({
|
|
1043
521
|
field: `${n}.components.chart.palette`,
|
|
1044
522
|
message: "Expected 20 colors or fewer."
|
|
1045
523
|
}) : c = i.palette.map(
|
|
1046
|
-
(l,
|
|
524
|
+
(l, m) => F(
|
|
1047
525
|
l,
|
|
1048
|
-
`${n}.components.chart.palette.${
|
|
526
|
+
`${n}.components.chart.palette.${m}`,
|
|
1049
527
|
120,
|
|
1050
528
|
t
|
|
1051
529
|
)
|
|
@@ -1059,22 +537,22 @@ function pe(e, n, t) {
|
|
|
1059
537
|
}
|
|
1060
538
|
return o;
|
|
1061
539
|
}
|
|
1062
|
-
function
|
|
1063
|
-
const t = "presentation.appearance", r =
|
|
1064
|
-
|
|
540
|
+
function ht(e, n) {
|
|
541
|
+
const t = "presentation.appearance", r = A(e, t, n);
|
|
542
|
+
w(r, t, ["version", "schemes"], n);
|
|
1065
543
|
const o = {};
|
|
1066
544
|
if (r.version !== void 0 && (typeof r.version != "number" || !Number.isFinite(r.version) ? n.push({ field: `${t}.version`, message: "Expected a number." }) : o.version = r.version), r.schemes !== void 0) {
|
|
1067
|
-
const a =
|
|
1068
|
-
|
|
545
|
+
const a = A(r.schemes, `${t}.schemes`, n);
|
|
546
|
+
w(a, `${t}.schemes`, ["light", "dark"], n), o.schemes = {
|
|
1069
547
|
...a.light !== void 0 ? {
|
|
1070
|
-
light:
|
|
548
|
+
light: ce(
|
|
1071
549
|
a.light,
|
|
1072
550
|
`${t}.schemes.light`,
|
|
1073
551
|
n
|
|
1074
552
|
)
|
|
1075
553
|
} : {},
|
|
1076
554
|
...a.dark !== void 0 ? {
|
|
1077
|
-
dark:
|
|
555
|
+
dark: ce(
|
|
1078
556
|
a.dark,
|
|
1079
557
|
`${t}.schemes.dark`,
|
|
1080
558
|
n
|
|
@@ -1084,23 +562,23 @@ function Ot(e, n) {
|
|
|
1084
562
|
}
|
|
1085
563
|
return o;
|
|
1086
564
|
}
|
|
1087
|
-
function
|
|
1088
|
-
const t = "presentation.brandOverrides", r =
|
|
1089
|
-
|
|
1090
|
-
const o =
|
|
565
|
+
function yt(e, n) {
|
|
566
|
+
const t = "presentation.brandOverrides", r = A(e, t, n);
|
|
567
|
+
w(r, t, ["brandName", "logoUrl", "link"], n);
|
|
568
|
+
const o = F(
|
|
1091
569
|
r.brandName,
|
|
1092
570
|
`${t}.brandName`,
|
|
1093
571
|
200,
|
|
1094
572
|
n
|
|
1095
|
-
), a =
|
|
573
|
+
), a = ee(r.logoUrl, `${t}.logoUrl`, n), i = F(r.link, `${t}.link`, 120, n);
|
|
1096
574
|
return {
|
|
1097
575
|
...o !== void 0 ? { brandName: o } : {},
|
|
1098
576
|
...a !== void 0 ? { logoUrl: a } : {},
|
|
1099
577
|
...i !== void 0 ? { link: i } : {}
|
|
1100
578
|
};
|
|
1101
579
|
}
|
|
1102
|
-
function
|
|
1103
|
-
const t = "presentation.fragments", r =
|
|
580
|
+
function gt(e, n) {
|
|
581
|
+
const t = "presentation.fragments", r = A(e, t, n), o = [
|
|
1104
582
|
"preHeaderText",
|
|
1105
583
|
"headerBannerHtml",
|
|
1106
584
|
"signatureHtml",
|
|
@@ -1108,10 +586,10 @@ function Nt(e, n) {
|
|
|
1108
586
|
"disclaimerHtml",
|
|
1109
587
|
"unsubscribeUrl"
|
|
1110
588
|
];
|
|
1111
|
-
|
|
589
|
+
w(r, t, o, n);
|
|
1112
590
|
const a = {};
|
|
1113
591
|
return o.forEach((i) => {
|
|
1114
|
-
const c = i === "unsubscribeUrl" ?
|
|
592
|
+
const c = i === "unsubscribeUrl" ? ee(r[i], `${t}.${i}`, n) : F(
|
|
1115
593
|
r[i],
|
|
1116
594
|
`${t}.${i}`,
|
|
1117
595
|
i === "preHeaderText" ? 200 : 5e3,
|
|
@@ -1121,15 +599,15 @@ function Nt(e, n) {
|
|
|
1121
599
|
c !== void 0 && (a[i] = c);
|
|
1122
600
|
}), a;
|
|
1123
601
|
}
|
|
1124
|
-
function
|
|
602
|
+
function bt(e) {
|
|
1125
603
|
const n = [], t = {};
|
|
1126
|
-
if (e.appearance !== void 0 && (t.appearance =
|
|
1127
|
-
const r =
|
|
604
|
+
if (e.appearance !== void 0 && (t.appearance = ht(e.appearance, n)), e.brandOverrides !== void 0 && (t.brandOverrides = yt(e.brandOverrides, n)), e.fragments !== void 0 && (t.fragments = gt(e.fragments, n)), e.viewUrl !== void 0) {
|
|
605
|
+
const r = ee(e.viewUrl, "presentation.viewUrl", n);
|
|
1128
606
|
r !== void 0 && (t.viewUrl = r);
|
|
1129
607
|
}
|
|
1130
608
|
return { value: t, issues: n };
|
|
1131
609
|
}
|
|
1132
|
-
const
|
|
610
|
+
const P = [
|
|
1133
611
|
"SUN",
|
|
1134
612
|
"MON",
|
|
1135
613
|
"TUE",
|
|
@@ -1137,21 +615,21 @@ const V = [
|
|
|
1137
615
|
"THU",
|
|
1138
616
|
"FRI",
|
|
1139
617
|
"SAT"
|
|
1140
|
-
],
|
|
1141
|
-
|
|
1142
|
-
),
|
|
618
|
+
], me = new Map(
|
|
619
|
+
P.map((e, n) => [e, n])
|
|
620
|
+
), z = [1, 2, 3, 4, 5], fe = [1, 2, 3, 6, 12], ue = {
|
|
1143
621
|
1: "first",
|
|
1144
622
|
2: "second",
|
|
1145
623
|
3: "third",
|
|
1146
624
|
4: "fourth",
|
|
1147
625
|
[-1]: "last"
|
|
1148
|
-
},
|
|
626
|
+
}, Xn = {
|
|
1149
627
|
frequency: "weekly",
|
|
1150
628
|
hour: 9,
|
|
1151
629
|
minute: 0,
|
|
1152
630
|
weekdays: [1]
|
|
1153
|
-
},
|
|
1154
|
-
function
|
|
631
|
+
}, S = { ok: !1, issue: "Choose a supported schedule." };
|
|
632
|
+
function It(e) {
|
|
1155
633
|
if (typeof e != "string" || e.length === 0 || e !== e.trim() || /^(?:(?:UTC|GMT)[+-]|[+-]\d{2}:\d{2}$)/.test(e))
|
|
1156
634
|
return !1;
|
|
1157
635
|
try {
|
|
@@ -1160,17 +638,17 @@ function Lt(e) {
|
|
|
1160
638
|
return !1;
|
|
1161
639
|
}
|
|
1162
640
|
}
|
|
1163
|
-
function
|
|
641
|
+
function vt(e) {
|
|
1164
642
|
return Number.isInteger(e.minute) && e.minute >= 0 && e.minute <= 59 && Number.isInteger(e.hour) && e.hour >= 0 && e.hour <= 23;
|
|
1165
643
|
}
|
|
1166
|
-
function
|
|
644
|
+
function pe(e) {
|
|
1167
645
|
if (e.length === 0) return null;
|
|
1168
646
|
const n = [...e].sort((t, r) => t - r);
|
|
1169
647
|
return n.some(
|
|
1170
648
|
(t, r) => !Number.isInteger(t) || t < 0 || t > 6 || r > 0 && t === n[r - 1]
|
|
1171
649
|
) ? null : n;
|
|
1172
650
|
}
|
|
1173
|
-
function
|
|
651
|
+
function he(e) {
|
|
1174
652
|
const t = [...e.filter((o) => o !== "last")].sort((o, a) => o - a);
|
|
1175
653
|
if (t.some(
|
|
1176
654
|
(o, a) => !Number.isInteger(o) || o < 1 || o > 31 || a > 0 && o === t[a - 1]
|
|
@@ -1179,146 +657,146 @@ function xe(e) {
|
|
|
1179
657
|
const r = e.includes("last") ? [...t, "last"] : t;
|
|
1180
658
|
return r.length > 0 ? r : null;
|
|
1181
659
|
}
|
|
1182
|
-
function
|
|
660
|
+
function R(e, n) {
|
|
1183
661
|
const t = [];
|
|
1184
662
|
for (let r = 0; r < 12 / e; r += 1)
|
|
1185
663
|
t.push((n + r * e) % 12);
|
|
1186
664
|
return t.sort((r, o) => r - o);
|
|
1187
665
|
}
|
|
1188
|
-
function
|
|
1189
|
-
return e === 1 ? "*" :
|
|
666
|
+
function Et(e, n) {
|
|
667
|
+
return e === 1 ? "*" : R(e, n).map((t) => t + 1).join(",");
|
|
1190
668
|
}
|
|
1191
|
-
function
|
|
1192
|
-
return e.every((t) =>
|
|
669
|
+
function ye(e, n) {
|
|
670
|
+
return e.every((t) => wt(t, n));
|
|
1193
671
|
}
|
|
1194
|
-
function
|
|
1195
|
-
if (!
|
|
672
|
+
function Zn(e) {
|
|
673
|
+
if (!vt(e))
|
|
1196
674
|
throw new Error("Choose a valid schedule time.");
|
|
1197
675
|
const n = `${e.minute} ${e.hour}`;
|
|
1198
676
|
switch (e.frequency) {
|
|
1199
677
|
case "daily":
|
|
1200
|
-
return e.weekdaysOnly ? `${n} * * ${
|
|
678
|
+
return e.weekdaysOnly ? `${n} * * ${z.map((t) => P[t]).join(",")}` : `${n} * * *`;
|
|
1201
679
|
case "weekly": {
|
|
1202
|
-
const t =
|
|
680
|
+
const t = pe(e.weekdays);
|
|
1203
681
|
if (!t) throw new Error("Choose at least one weekday.");
|
|
1204
|
-
return `${n} * * ${t.map((r) =>
|
|
682
|
+
return `${n} * * ${t.map((r) => P[r]).join(",")}`;
|
|
1205
683
|
}
|
|
1206
684
|
case "monthly": {
|
|
1207
|
-
if (
|
|
685
|
+
if (!fe.includes(e.interval) || !Number.isInteger(e.startMonth) || e.startMonth < 0 || e.startMonth >= e.interval)
|
|
1208
686
|
throw new Error("Choose a valid month cycle.");
|
|
1209
|
-
const t =
|
|
687
|
+
const t = Et(e.interval, e.startMonth);
|
|
1210
688
|
if (e.on.type === "days") {
|
|
1211
|
-
const i =
|
|
689
|
+
const i = he(e.on.days);
|
|
1212
690
|
if (!i) throw new Error("Choose at least one day of the month.");
|
|
1213
|
-
const c =
|
|
1214
|
-
if (!
|
|
691
|
+
const c = R(e.interval, e.startMonth);
|
|
692
|
+
if (!ye(i, c))
|
|
1215
693
|
throw new Error("Choose a day that occurs in the chosen months.");
|
|
1216
|
-
const l = i.map((
|
|
694
|
+
const l = i.map((m) => m === "last" ? "L" : String(m)).join(",");
|
|
1217
695
|
return `${n} ${l} ${t} *`;
|
|
1218
696
|
}
|
|
1219
697
|
const { ordinal: r, weekday: o } = e.on;
|
|
1220
|
-
if (!Number.isInteger(o) || o < 0 || o > 6 || !(r in
|
|
698
|
+
if (!Number.isInteger(o) || o < 0 || o > 6 || !(r in ue))
|
|
1221
699
|
throw new Error("Choose a valid weekday.");
|
|
1222
|
-
const a =
|
|
700
|
+
const a = P[o];
|
|
1223
701
|
return `${n} * ${t} ${r === -1 ? `${a}L` : `${a}#${r}`}`;
|
|
1224
702
|
}
|
|
1225
703
|
}
|
|
1226
704
|
}
|
|
1227
|
-
function
|
|
705
|
+
function $t(e) {
|
|
1228
706
|
if (e === "*") return { interval: 1, startMonth: 0 };
|
|
1229
707
|
const n = e.split(",");
|
|
1230
708
|
if (n.some((i) => !/^([1-9]|1[0-2])$/.test(i))) return null;
|
|
1231
709
|
const t = n.map((i) => Number(i) - 1), r = 12 / t.length;
|
|
1232
|
-
if (
|
|
710
|
+
if (!fe.includes(r))
|
|
1233
711
|
return null;
|
|
1234
|
-
const o = t[0], a =
|
|
712
|
+
const o = t[0], a = R(
|
|
1235
713
|
r,
|
|
1236
714
|
o
|
|
1237
715
|
);
|
|
1238
716
|
return o >= r || a.length !== t.length || a.some((i, c) => i !== t[c]) ? null : { interval: r, startMonth: o };
|
|
1239
717
|
}
|
|
1240
|
-
function
|
|
718
|
+
function Ct(e) {
|
|
1241
719
|
const n = e.split(",");
|
|
1242
720
|
if (n.some((o) => !/^(L|[1-9]|[12]\d|3[01])$/.test(o))) return null;
|
|
1243
721
|
const t = n.map(
|
|
1244
722
|
(o) => o === "L" ? "last" : Number(o)
|
|
1245
|
-
), r =
|
|
723
|
+
), r = he(t);
|
|
1246
724
|
return !r || r.some((o, a) => o !== t[a]) ? null : r;
|
|
1247
725
|
}
|
|
1248
|
-
function
|
|
726
|
+
function xt(e) {
|
|
1249
727
|
const n = /^([A-Z]{3})(?:#([1-4])|(L))$/.exec(e);
|
|
1250
728
|
if (!n) return null;
|
|
1251
|
-
const t =
|
|
729
|
+
const t = me.get(n[1]);
|
|
1252
730
|
return t === void 0 ? null : {
|
|
1253
731
|
weekday: t,
|
|
1254
732
|
ordinal: n[3] ? -1 : Number(n[2])
|
|
1255
733
|
};
|
|
1256
734
|
}
|
|
1257
|
-
function
|
|
735
|
+
function ge(e) {
|
|
1258
736
|
if (typeof e != "string" || e.length === 0 || e !== e.trim() || e.includes(" "))
|
|
1259
|
-
return
|
|
737
|
+
return S;
|
|
1260
738
|
const n = e.split(" ");
|
|
1261
|
-
if (n.length !== 5) return
|
|
739
|
+
if (n.length !== 5) return S;
|
|
1262
740
|
const [t, r, o, a, i] = n;
|
|
1263
741
|
if (!/^(0|[1-9]\d?)$/.test(t) || !/^(0|[1-9]\d?)$/.test(r))
|
|
1264
|
-
return
|
|
742
|
+
return S;
|
|
1265
743
|
const c = Number(t), l = Number(r);
|
|
1266
|
-
if (c > 59 || l > 23) return
|
|
744
|
+
if (c > 59 || l > 23) return S;
|
|
1267
745
|
if (a === "*" && o === "*" && i === "*")
|
|
1268
746
|
return {
|
|
1269
747
|
ok: !0,
|
|
1270
748
|
value: { frequency: "daily", hour: l, minute: c, weekdaysOnly: !1 }
|
|
1271
749
|
};
|
|
1272
750
|
if (a === "*" && o === "*" && !i.includes("#") && !i.endsWith("L")) {
|
|
1273
|
-
const
|
|
1274
|
-
if (
|
|
1275
|
-
const
|
|
1276
|
-
return !
|
|
751
|
+
const u = i.split(",").map((E) => me.get(E));
|
|
752
|
+
if (u.some((E) => E === void 0)) return S;
|
|
753
|
+
const h = u, g = pe(h);
|
|
754
|
+
return !g || g.some((E, x) => E !== h[x]) ? S : g.length === z.length && g.every((E, x) => E === z[x]) ? {
|
|
1277
755
|
ok: !0,
|
|
1278
756
|
value: { frequency: "daily", hour: l, minute: c, weekdaysOnly: !0 }
|
|
1279
757
|
} : {
|
|
1280
758
|
ok: !0,
|
|
1281
|
-
value: { frequency: "weekly", hour: l, minute: c, weekdays:
|
|
759
|
+
value: { frequency: "weekly", hour: l, minute: c, weekdays: g }
|
|
1282
760
|
};
|
|
1283
761
|
}
|
|
1284
|
-
const
|
|
1285
|
-
if (!
|
|
762
|
+
const m = $t(a);
|
|
763
|
+
if (!m) return S;
|
|
1286
764
|
if (o !== "*" && i === "*") {
|
|
1287
|
-
const
|
|
1288
|
-
return !
|
|
765
|
+
const s = Ct(o), u = R(m.interval, m.startMonth);
|
|
766
|
+
return !s || !ye(s, u) ? S : {
|
|
1289
767
|
ok: !0,
|
|
1290
768
|
value: {
|
|
1291
769
|
frequency: "monthly",
|
|
1292
770
|
hour: l,
|
|
1293
771
|
minute: c,
|
|
1294
|
-
...
|
|
1295
|
-
on: { type: "days", days:
|
|
772
|
+
...m,
|
|
773
|
+
on: { type: "days", days: s }
|
|
1296
774
|
}
|
|
1297
775
|
};
|
|
1298
776
|
}
|
|
1299
777
|
if (o === "*" && i !== "*") {
|
|
1300
|
-
const
|
|
1301
|
-
return
|
|
778
|
+
const s = xt(i);
|
|
779
|
+
return s ? {
|
|
1302
780
|
ok: !0,
|
|
1303
781
|
value: {
|
|
1304
782
|
frequency: "monthly",
|
|
1305
783
|
hour: l,
|
|
1306
784
|
minute: c,
|
|
1307
|
-
...
|
|
1308
|
-
on: { type: "weekday", ...
|
|
785
|
+
...m,
|
|
786
|
+
on: { type: "weekday", ...s }
|
|
1309
787
|
}
|
|
1310
|
-
} :
|
|
788
|
+
} : S;
|
|
1311
789
|
}
|
|
1312
|
-
return
|
|
790
|
+
return S;
|
|
1313
791
|
}
|
|
1314
|
-
function
|
|
792
|
+
function Tt(e, n, t) {
|
|
1315
793
|
return new Intl.DateTimeFormat(t, {
|
|
1316
794
|
hour: "numeric",
|
|
1317
795
|
minute: "2-digit",
|
|
1318
796
|
timeZone: "UTC"
|
|
1319
797
|
}).format(new Date(Date.UTC(2020, 0, 1, e, n)));
|
|
1320
798
|
}
|
|
1321
|
-
function
|
|
799
|
+
function St(e, n) {
|
|
1322
800
|
var t;
|
|
1323
801
|
if (e === "UTC") return "UTC";
|
|
1324
802
|
try {
|
|
@@ -1330,29 +808,29 @@ function jt(e, n) {
|
|
|
1330
808
|
return null;
|
|
1331
809
|
}
|
|
1332
810
|
}
|
|
1333
|
-
function
|
|
811
|
+
function le(e) {
|
|
1334
812
|
return e.length <= 1 ? e.join("") : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
|
|
1335
813
|
}
|
|
1336
|
-
function
|
|
814
|
+
function kt(e) {
|
|
1337
815
|
const n = e % 100;
|
|
1338
816
|
return n >= 11 && n <= 13 ? `${e}th` : `${e}${["th", "st", "nd", "rd"][e % 10] ?? "th"}`;
|
|
1339
817
|
}
|
|
1340
|
-
function
|
|
818
|
+
function At(e, n, t) {
|
|
1341
819
|
const r = (a, i) => new Intl.DateTimeFormat(t, { month: i, timeZone: "UTC" }).format(
|
|
1342
820
|
new Date(Date.UTC(2020, a, 1))
|
|
1343
821
|
);
|
|
1344
822
|
if (e === 1) return "every month";
|
|
1345
823
|
if (e === 12) return `${r(n, "long")} each year`;
|
|
1346
|
-
const o =
|
|
824
|
+
const o = R(e, n).map((a) => r(a, "short")).join(", ");
|
|
1347
825
|
return e === 3 ? `each quarter (${o})` : `every ${e} months (${o})`;
|
|
1348
826
|
}
|
|
1349
|
-
function
|
|
1350
|
-
const r =
|
|
827
|
+
function Yn(e, n, t = "en-US") {
|
|
828
|
+
const r = ge(e);
|
|
1351
829
|
if (!r.ok) return null;
|
|
1352
830
|
try {
|
|
1353
|
-
const o = r.value, a =
|
|
831
|
+
const o = r.value, a = St(n, t);
|
|
1354
832
|
if (!a) return null;
|
|
1355
|
-
const i = `at ${
|
|
833
|
+
const i = `at ${Tt(o.hour, o.minute, t)} ${a}`, c = (l) => new Intl.DateTimeFormat(t, {
|
|
1356
834
|
weekday: "long",
|
|
1357
835
|
timeZone: "UTC"
|
|
1358
836
|
}).format(new Date(Date.UTC(2023, 0, 1 + l)));
|
|
@@ -1360,57 +838,57 @@ function Tr(e, n, t = "en-US") {
|
|
|
1360
838
|
case "daily":
|
|
1361
839
|
return o.weekdaysOnly ? `Every weekday, Monday to Friday, ${i}` : `Every day ${i}`;
|
|
1362
840
|
case "weekly":
|
|
1363
|
-
return `Every ${
|
|
841
|
+
return `Every ${le(o.weekdays.map(c))} ${i}`;
|
|
1364
842
|
case "monthly": {
|
|
1365
|
-
const l =
|
|
843
|
+
const l = At(o.interval, o.startMonth, t);
|
|
1366
844
|
if (o.on.type === "weekday")
|
|
1367
|
-
return `On the ${
|
|
1368
|
-
const
|
|
1369
|
-
(
|
|
845
|
+
return `On the ${ue[o.on.ordinal]} ${c(o.on.weekday)} of ${l} ${i}`;
|
|
846
|
+
const m = o.on.days.map(
|
|
847
|
+
(s) => s === "last" ? "last day" : kt(s)
|
|
1370
848
|
);
|
|
1371
|
-
return `On the ${
|
|
849
|
+
return `On the ${le(m)} of ${l} ${i}`;
|
|
1372
850
|
}
|
|
1373
851
|
}
|
|
1374
852
|
} catch {
|
|
1375
853
|
return null;
|
|
1376
854
|
}
|
|
1377
855
|
}
|
|
1378
|
-
const
|
|
1379
|
-
function
|
|
1380
|
-
return e === "last" || n.some((t) => e <=
|
|
856
|
+
const be = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
857
|
+
function wt(e, n) {
|
|
858
|
+
return e === "last" || n.some((t) => e <= be[t]);
|
|
1381
859
|
}
|
|
1382
|
-
function
|
|
860
|
+
function Jn(e) {
|
|
1383
861
|
if (e.frequency !== "monthly" || e.on.type !== "days") return null;
|
|
1384
862
|
const n = e.on.days.filter((o) => o !== "last");
|
|
1385
863
|
if (n.length === 0) return null;
|
|
1386
|
-
const t = Math.max(...n), r =
|
|
1387
|
-
(o) => t > (o === 1 ? 28 :
|
|
864
|
+
const t = Math.max(...n), r = R(e.interval, e.startMonth).filter(
|
|
865
|
+
(o) => t > (o === 1 ? 28 : be[o])
|
|
1388
866
|
);
|
|
1389
867
|
return r.length > 0 ? { day: t, months: r } : null;
|
|
1390
868
|
}
|
|
1391
|
-
function
|
|
869
|
+
function Dt(e, n) {
|
|
1392
870
|
return new Date(Date.UTC(e, n + 1, 0)).getUTCDate();
|
|
1393
871
|
}
|
|
1394
|
-
function
|
|
872
|
+
function _t(e, n, t, r) {
|
|
1395
873
|
const o = new Date(Date.UTC(n, t, r)).getUTCDay();
|
|
1396
874
|
switch (e.frequency) {
|
|
1397
875
|
case "daily":
|
|
1398
|
-
return !e.weekdaysOnly ||
|
|
876
|
+
return !e.weekdaysOnly || z.includes(o);
|
|
1399
877
|
case "weekly":
|
|
1400
878
|
return e.weekdays.includes(o);
|
|
1401
879
|
case "monthly": {
|
|
1402
|
-
if (!
|
|
880
|
+
if (!R(e.interval, e.startMonth).includes(t))
|
|
1403
881
|
return !1;
|
|
1404
|
-
const a =
|
|
882
|
+
const a = Dt(n, t);
|
|
1405
883
|
return e.on.type === "days" ? e.on.days.some(
|
|
1406
884
|
(i) => i === "last" ? r === a : i === r
|
|
1407
885
|
) : o !== e.on.weekday ? !1 : e.on.ordinal === -1 ? r + 7 > a : Math.ceil(r / 7) === e.on.ordinal;
|
|
1408
886
|
}
|
|
1409
887
|
}
|
|
1410
888
|
}
|
|
1411
|
-
function
|
|
1412
|
-
const o =
|
|
1413
|
-
if (!o.ok || !
|
|
889
|
+
function Qn(e, n, t, r) {
|
|
890
|
+
const o = ge(e);
|
|
891
|
+
if (!o.ok || !It(n)) return [];
|
|
1414
892
|
const a = o.value, i = new Intl.DateTimeFormat("en-US", {
|
|
1415
893
|
timeZone: n,
|
|
1416
894
|
hourCycle: "h23",
|
|
@@ -1419,17 +897,17 @@ function Sr(e, n, t, r) {
|
|
|
1419
897
|
day: "numeric",
|
|
1420
898
|
hour: "numeric",
|
|
1421
899
|
minute: "numeric"
|
|
1422
|
-
}).formatToParts(t), c = (
|
|
1423
|
-
var
|
|
1424
|
-
return Number((
|
|
900
|
+
}).formatToParts(t), c = (s) => {
|
|
901
|
+
var u;
|
|
902
|
+
return Number((u = i.find((h) => h.type === s)) == null ? void 0 : u.value);
|
|
1425
903
|
}, l = new Date(Date.UTC(c("year"), c("month") - 1, c("day")));
|
|
1426
904
|
c("hour") * 60 + c("minute") >= a.hour * 60 + a.minute && l.setUTCDate(l.getUTCDate() + 1);
|
|
1427
|
-
const
|
|
1428
|
-
for (let
|
|
1429
|
-
|
|
1430
|
-
return
|
|
905
|
+
const m = [];
|
|
906
|
+
for (let s = 0; s < 366 * 4 * (r + 1) && m.length < r; s += 1)
|
|
907
|
+
_t(a, l.getUTCFullYear(), l.getUTCMonth(), l.getUTCDate()) && m.push(l.toISOString().slice(0, 10)), l.setUTCDate(l.getUTCDate() + 1);
|
|
908
|
+
return m;
|
|
1431
909
|
}
|
|
1432
|
-
const
|
|
910
|
+
const Ot = Object.freeze([
|
|
1433
911
|
"PDF_ROW_LIMIT_EXCEEDED",
|
|
1434
912
|
"PDF_SIZE_LIMIT_EXCEEDED",
|
|
1435
913
|
"TABLE_COMPLETENESS_UNVERIFIED",
|
|
@@ -1437,15 +915,20 @@ const Yt = Object.freeze([
|
|
|
1437
915
|
"RENDER_NOT_READY",
|
|
1438
916
|
"RENDER_TIMED_OUT",
|
|
1439
917
|
"EXPORT_JOB_FAILED",
|
|
1440
|
-
"ATTACHMENT_UNAVAILABLE"
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
918
|
+
"ATTACHMENT_UNAVAILABLE",
|
|
919
|
+
// A Table or Detail Table export the server starts (Excel exports Phase 6).
|
|
920
|
+
"EXCEL_LIMIT_EXCEEDED",
|
|
921
|
+
"EXPORT_ROW_LIMIT_EXCEEDED",
|
|
922
|
+
"EXPORT_COUNT_UNAVAILABLE",
|
|
923
|
+
"EXPORT_NO_ROWS"
|
|
924
|
+
]), Ft = new Set(Ot);
|
|
925
|
+
function Nt(e) {
|
|
926
|
+
return typeof e == "string" && Ft.has(e);
|
|
1444
927
|
}
|
|
1445
|
-
function
|
|
928
|
+
function Rt(e) {
|
|
1446
929
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1447
930
|
const n = e;
|
|
1448
|
-
return typeof n.index != "number" || !Number.isInteger(n.index) || n.index < 0 || typeof n.title != "string" || n.format !== "pdf" && n.format !== "csv" || !
|
|
931
|
+
return typeof n.index != "number" || !Number.isInteger(n.index) || n.index < 0 || typeof n.title != "string" || n.format !== "pdf" && n.format !== "csv" && n.format !== "xlsx" || !Nt(n.code) || typeof n.reason != "string" || typeof n.diagnostic != "string" ? null : {
|
|
1449
932
|
index: n.index,
|
|
1450
933
|
title: n.title,
|
|
1451
934
|
format: n.format,
|
|
@@ -1454,39 +937,39 @@ function en(e) {
|
|
|
1454
937
|
diagnostic: n.diagnostic
|
|
1455
938
|
};
|
|
1456
939
|
}
|
|
1457
|
-
function
|
|
940
|
+
function er(e) {
|
|
1458
941
|
if (!e || typeof e != "object" || Array.isArray(e)) return [];
|
|
1459
942
|
const n = e.omittedAttachments;
|
|
1460
943
|
return Array.isArray(n) ? n.flatMap((t) => {
|
|
1461
|
-
const r =
|
|
944
|
+
const r = Rt(t);
|
|
1462
945
|
return r ? [r] : [];
|
|
1463
946
|
}) : [];
|
|
1464
947
|
}
|
|
1465
|
-
function
|
|
948
|
+
function tr(e) {
|
|
1466
949
|
return e != null && e.role ? e.type === "tenant" ? e.role === "POWER_USER" : ["AUTHOR", "ADMIN", "SUPER_ADMIN"].includes(e.role) : !1;
|
|
1467
950
|
}
|
|
1468
|
-
function
|
|
951
|
+
function nr(e) {
|
|
1469
952
|
return e.canCreate ? [
|
|
1470
953
|
...e.scheduledReportAvailable ? ["scheduled_report"] : [],
|
|
1471
954
|
...e.analyticalBriefingsEnabled ? ["analytical_briefing"] : []
|
|
1472
955
|
] : [];
|
|
1473
956
|
}
|
|
1474
|
-
function
|
|
957
|
+
function Bt(e) {
|
|
1475
958
|
const n = (e == null ? void 0 : e.channels) ?? [];
|
|
1476
959
|
return n.length === 1 && n[0] === "EMAIL";
|
|
1477
960
|
}
|
|
1478
|
-
function
|
|
1479
|
-
return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 &&
|
|
961
|
+
function Mt(e) {
|
|
962
|
+
return e.body.type === "generated_analysis" ? "Analytical briefing" : e.body.type === "custom_message" && e.attachments.length > 0 && Bt(e.deliveryConfig) ? e.scheduleExpr ? "Scheduled report" : "On-demand report" : "Plain briefing";
|
|
1480
963
|
}
|
|
1481
|
-
function
|
|
1482
|
-
const n =
|
|
964
|
+
function rr(e) {
|
|
965
|
+
const n = Mt(e), t = n === "Scheduled report" || n === "On-demand report" ? "report" : "briefing";
|
|
1483
966
|
return {
|
|
1484
967
|
typeLabel: n,
|
|
1485
968
|
noun: t,
|
|
1486
969
|
pluralNoun: t === "report" ? "reports" : "briefings"
|
|
1487
970
|
};
|
|
1488
971
|
}
|
|
1489
|
-
const
|
|
972
|
+
const Z = "BRIEFING", Lt = ["markdown", "html"], Y = ["markdown"], H = 20, f = {
|
|
1490
973
|
name: 500,
|
|
1491
974
|
description: 2e3,
|
|
1492
975
|
instruction: 5e4,
|
|
@@ -1502,20 +985,20 @@ const ne = "BRIEFING", rn = ["markdown", "html"], re = ["markdown"], Y = 20, u =
|
|
|
1502
985
|
presentationTone: 500,
|
|
1503
986
|
presentationFormat: 2e3,
|
|
1504
987
|
id: 500
|
|
1505
|
-
},
|
|
988
|
+
}, C = {
|
|
1506
989
|
maxBlocks: 50,
|
|
1507
990
|
maxTableRows: 100,
|
|
1508
991
|
maxTableColumns: 20,
|
|
1509
|
-
maxTableCellCharacters:
|
|
1510
|
-
maxParagraphCharacters:
|
|
1511
|
-
maxFindingCharacters:
|
|
992
|
+
maxTableCellCharacters: f.contentCell,
|
|
993
|
+
maxParagraphCharacters: f.contentText,
|
|
994
|
+
maxFindingCharacters: f.contentText,
|
|
1512
995
|
maxListItems: 100,
|
|
1513
996
|
// A kpi_grid is rendered as a 2-up tile arrangement in emails. Cap at 8 so
|
|
1514
997
|
// the visual stays at most 4 rows (4 columns wide on desktop would force
|
|
1515
998
|
// tiny tiles in narrow client panels; 2-up was the chosen layout).
|
|
1516
999
|
maxKpiTiles: 8
|
|
1517
1000
|
};
|
|
1518
|
-
function
|
|
1001
|
+
function Ut(e) {
|
|
1519
1002
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
1520
1003
|
return !1;
|
|
1521
1004
|
const n = e;
|
|
@@ -1525,60 +1008,60 @@ function on(e) {
|
|
|
1525
1008
|
if (t === null || typeof t != "object" || Array.isArray(t))
|
|
1526
1009
|
return !1;
|
|
1527
1010
|
const r = t;
|
|
1528
|
-
return (r.kind === "metric" && typeof r.metricId == "string" && !!r.metricId.trim() || r.kind === "column" && typeof r.columnKey == "string" && !!r.columnKey.trim() || r.kind === "matrix_measure" && typeof r.measureId == "string" && !!r.measureId.trim()) &&
|
|
1011
|
+
return (r.kind === "metric" && typeof r.metricId == "string" && !!r.metricId.trim() || r.kind === "column" && typeof r.columnKey == "string" && !!r.columnKey.trim() || r.kind === "matrix_measure" && typeof r.measureId == "string" && !!r.measureId.trim()) && de(n.format).ok;
|
|
1529
1012
|
}
|
|
1530
|
-
function
|
|
1531
|
-
return e == null ? "" :
|
|
1013
|
+
function Pt(e) {
|
|
1014
|
+
return e == null ? "" : Ut(e) ? Fe(e.value, e.format) : String(e);
|
|
1532
1015
|
}
|
|
1533
|
-
function
|
|
1016
|
+
function or(e) {
|
|
1534
1017
|
return [e.delta, e.percentChange].filter(
|
|
1535
1018
|
(n) => n != null
|
|
1536
|
-
).map(
|
|
1019
|
+
).map(Pt).filter(Boolean).join(" / ");
|
|
1537
1020
|
}
|
|
1538
|
-
const
|
|
1021
|
+
const Ie = new Set(Lt), Vt = /* @__PURE__ */ new Set([
|
|
1539
1022
|
"EMAIL",
|
|
1540
1023
|
"WEBHOOK",
|
|
1541
1024
|
"SLACK",
|
|
1542
1025
|
"IN_APP",
|
|
1543
1026
|
"TELEGRAM"
|
|
1544
|
-
]),
|
|
1027
|
+
]), G = {
|
|
1545
1028
|
maxToolCalls: { min: 1, max: 100 },
|
|
1546
1029
|
maxPlanningIterations: { min: 1, max: 10 },
|
|
1547
1030
|
maxRows: { min: 1, max: 1e5 },
|
|
1548
1031
|
timeoutMs: { min: 1e3, max: 30 * 6e4 }
|
|
1549
|
-
},
|
|
1032
|
+
}, zt = /* @__PURE__ */ new Set([
|
|
1550
1033
|
"letter",
|
|
1551
1034
|
"legal",
|
|
1552
1035
|
"a4",
|
|
1553
1036
|
"a3",
|
|
1554
1037
|
"tabloid"
|
|
1555
|
-
]),
|
|
1038
|
+
]), jt = /* @__PURE__ */ new Set([
|
|
1556
1039
|
"portrait",
|
|
1557
1040
|
"landscape"
|
|
1558
|
-
]),
|
|
1041
|
+
]), qt = /* @__PURE__ */ new Set([",", ";", " "]), Kt = new Set(Ue), Ht = /* @__PURE__ */ new Set([
|
|
1559
1042
|
"current",
|
|
1560
1043
|
"all"
|
|
1561
|
-
]),
|
|
1044
|
+
]), Gt = /* @__PURE__ */ new Set([
|
|
1562
1045
|
"concise",
|
|
1563
1046
|
"balanced",
|
|
1564
1047
|
"detailed"
|
|
1565
|
-
]),
|
|
1048
|
+
]), Wt = /* @__PURE__ */ new Set([
|
|
1566
1049
|
"info",
|
|
1567
1050
|
"positive",
|
|
1568
1051
|
"warning",
|
|
1569
1052
|
"critical"
|
|
1570
|
-
]),
|
|
1053
|
+
]), Xt = /* @__PURE__ */ new Set([
|
|
1571
1054
|
"text",
|
|
1572
1055
|
"number",
|
|
1573
1056
|
"currency",
|
|
1574
1057
|
"percent",
|
|
1575
1058
|
"date",
|
|
1576
1059
|
"boolean"
|
|
1577
|
-
]),
|
|
1060
|
+
]), Zt = /* @__PURE__ */ new Set([
|
|
1578
1061
|
"left",
|
|
1579
1062
|
"center",
|
|
1580
1063
|
"right"
|
|
1581
|
-
]),
|
|
1064
|
+
]), Yt = [
|
|
1582
1065
|
"matrix",
|
|
1583
1066
|
"pageSize",
|
|
1584
1067
|
"orientation",
|
|
@@ -1609,23 +1092,23 @@ const Ae = new Set(rn), cn = /* @__PURE__ */ new Set([
|
|
|
1609
1092
|
"allowDownload",
|
|
1610
1093
|
"theme"
|
|
1611
1094
|
];
|
|
1612
|
-
class
|
|
1095
|
+
class j extends Error {
|
|
1613
1096
|
constructor(t) {
|
|
1614
1097
|
super(t.map((r) => `${r.field}: ${r.message}`).join("; "));
|
|
1615
|
-
|
|
1098
|
+
L(this, "issues");
|
|
1616
1099
|
this.name = "BriefingContractError", this.issues = t;
|
|
1617
1100
|
}
|
|
1618
1101
|
}
|
|
1619
|
-
function
|
|
1102
|
+
function ve(e) {
|
|
1620
1103
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1621
1104
|
}
|
|
1622
1105
|
function d(e, n, t) {
|
|
1623
1106
|
e.push({ field: n, message: t });
|
|
1624
1107
|
}
|
|
1625
|
-
function
|
|
1626
|
-
return
|
|
1108
|
+
function v(e, n, t) {
|
|
1109
|
+
return ve(e) ? e : (d(t, n, "Expected an object."), {});
|
|
1627
1110
|
}
|
|
1628
|
-
function
|
|
1111
|
+
function p(e, n, t, r) {
|
|
1629
1112
|
const o = new Set(t);
|
|
1630
1113
|
Object.keys(e).forEach((a) => {
|
|
1631
1114
|
o.has(a) || d(
|
|
@@ -1635,13 +1118,13 @@ function y(e, n, t, r) {
|
|
|
1635
1118
|
);
|
|
1636
1119
|
});
|
|
1637
1120
|
}
|
|
1638
|
-
function
|
|
1121
|
+
function b(e, n, t, r) {
|
|
1639
1122
|
if (typeof e != "string")
|
|
1640
1123
|
return d(r, n, "Expected a string."), "";
|
|
1641
1124
|
const o = e.trim();
|
|
1642
1125
|
return o ? (o.length > t && d(r, n, `Must be ${t} characters or fewer.`), o) : (d(r, n, "Required value cannot be empty."), "");
|
|
1643
1126
|
}
|
|
1644
|
-
function
|
|
1127
|
+
function I(e, n, t, r) {
|
|
1645
1128
|
if (e == null)
|
|
1646
1129
|
return;
|
|
1647
1130
|
if (typeof e != "string") {
|
|
@@ -1652,13 +1135,13 @@ function b(e, n, t, r) {
|
|
|
1652
1135
|
if (o)
|
|
1653
1136
|
return o.length > t && d(r, n, `Must be ${t} characters or fewer.`), o;
|
|
1654
1137
|
}
|
|
1655
|
-
function
|
|
1138
|
+
function Jt(e, n, t, r) {
|
|
1656
1139
|
if (typeof e != "string")
|
|
1657
1140
|
return d(r, n, "Expected a string."), "";
|
|
1658
1141
|
const o = e.trim();
|
|
1659
1142
|
return o.length > t && d(r, n, `Must be ${t} characters or fewer.`), o;
|
|
1660
1143
|
}
|
|
1661
|
-
function
|
|
1144
|
+
function Qt(e, n, t) {
|
|
1662
1145
|
if (e != null) {
|
|
1663
1146
|
if (!Number.isInteger(e) || Number(e) < 0) {
|
|
1664
1147
|
d(t, n, "Expected a non-negative integer.");
|
|
@@ -1667,74 +1150,74 @@ function bn(e, n, t) {
|
|
|
1667
1150
|
return Number(e);
|
|
1668
1151
|
}
|
|
1669
1152
|
}
|
|
1670
|
-
function
|
|
1153
|
+
function k(e, n, t, r = {}) {
|
|
1671
1154
|
if (e == null)
|
|
1672
1155
|
return r.required ? (d(t, n, "Expected at least one evidence id."), []) : void 0;
|
|
1673
1156
|
if (!Array.isArray(e))
|
|
1674
1157
|
return d(t, n, "Expected an array."), r.required ? [] : void 0;
|
|
1675
1158
|
const o = [];
|
|
1676
1159
|
return e.forEach((a, i) => {
|
|
1677
|
-
const c =
|
|
1160
|
+
const c = b(
|
|
1678
1161
|
a,
|
|
1679
1162
|
`${n}.${i}`,
|
|
1680
|
-
|
|
1163
|
+
f.id,
|
|
1681
1164
|
t
|
|
1682
1165
|
);
|
|
1683
1166
|
c && !o.includes(c) && o.push(c);
|
|
1684
1167
|
}), r.required && o.length === 0 && d(t, n, "Expected at least one evidence id."), o.length > 0 || r.required ? o : void 0;
|
|
1685
1168
|
}
|
|
1686
|
-
function
|
|
1169
|
+
function N(e, n, t, r) {
|
|
1687
1170
|
return e == null ? n : typeof e != "boolean" ? (d(r, t, "Expected a boolean."), n) : e;
|
|
1688
1171
|
}
|
|
1689
|
-
function
|
|
1172
|
+
function en(e, n) {
|
|
1690
1173
|
return e == null ? "ACTIVE" : e === "ACTIVE" || e === "PAUSED" || e === "DISABLED" ? e : (d(n, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
|
|
1691
1174
|
}
|
|
1692
|
-
function
|
|
1175
|
+
function tn(e) {
|
|
1693
1176
|
return e.includes("@") && e.includes(".") && !e.includes(" ");
|
|
1694
1177
|
}
|
|
1695
|
-
function
|
|
1178
|
+
function Ee(e, n) {
|
|
1696
1179
|
if (e == null)
|
|
1697
1180
|
return { type: "project" };
|
|
1698
|
-
const t =
|
|
1699
|
-
return r === "project" ? (
|
|
1181
|
+
const t = v(e, "source", n), r = t.type;
|
|
1182
|
+
return r === "project" ? (p(t, "source", ["type"], n), { type: "project" }) : r === "dashboard" ? (p(t, "source", ["type", "dashboardId"], n), {
|
|
1700
1183
|
type: "dashboard",
|
|
1701
|
-
dashboardId:
|
|
1184
|
+
dashboardId: b(
|
|
1702
1185
|
t.dashboardId,
|
|
1703
1186
|
"source.dashboardId",
|
|
1704
|
-
|
|
1187
|
+
f.id,
|
|
1705
1188
|
n
|
|
1706
1189
|
)
|
|
1707
1190
|
}) : (d(n, "source.type", "Expected project or dashboard."), { type: "project" });
|
|
1708
1191
|
}
|
|
1709
|
-
function
|
|
1710
|
-
const t =
|
|
1711
|
-
return r === "generated_analysis" ? (
|
|
1192
|
+
function $e(e, n) {
|
|
1193
|
+
const t = v(e, "body", n), r = t.type;
|
|
1194
|
+
return r === "generated_analysis" ? (p(t, "body", ["type", "instruction"], n), {
|
|
1712
1195
|
type: "generated_analysis",
|
|
1713
|
-
instruction:
|
|
1196
|
+
instruction: b(
|
|
1714
1197
|
t.instruction,
|
|
1715
1198
|
"body.instruction",
|
|
1716
|
-
|
|
1199
|
+
f.instruction,
|
|
1717
1200
|
n
|
|
1718
1201
|
)
|
|
1719
|
-
}) : r === "custom_message" ? (
|
|
1202
|
+
}) : r === "custom_message" ? (p(t, "body", ["type", "message"], n), {
|
|
1720
1203
|
type: "custom_message",
|
|
1721
|
-
message:
|
|
1204
|
+
message: Jt(
|
|
1722
1205
|
t.message,
|
|
1723
1206
|
"body.message",
|
|
1724
|
-
|
|
1207
|
+
f.customMessage,
|
|
1725
1208
|
n
|
|
1726
1209
|
)
|
|
1727
|
-
}) : r === "none" ? (
|
|
1210
|
+
}) : r === "none" ? (p(t, "body", ["type"], n), { type: "none" }) : (d(
|
|
1728
1211
|
n,
|
|
1729
1212
|
"body.type",
|
|
1730
1213
|
"Expected generated_analysis, custom_message, or none."
|
|
1731
1214
|
), { type: "none" });
|
|
1732
1215
|
}
|
|
1733
|
-
function
|
|
1216
|
+
function nn(e, n) {
|
|
1734
1217
|
if (e == null)
|
|
1735
|
-
return [...
|
|
1218
|
+
return [...Y];
|
|
1736
1219
|
if (!Array.isArray(e))
|
|
1737
|
-
return d(n, "presentation.artifactFormats", "Expected an array."), [...
|
|
1220
|
+
return d(n, "presentation.artifactFormats", "Expected an array."), [...Y];
|
|
1738
1221
|
if (e.length === 0)
|
|
1739
1222
|
return d(
|
|
1740
1223
|
n,
|
|
@@ -1743,7 +1226,7 @@ function Cn(e, n) {
|
|
|
1743
1226
|
), [];
|
|
1744
1227
|
const t = [];
|
|
1745
1228
|
return e.forEach((r, o) => {
|
|
1746
|
-
if (typeof r != "string" || !
|
|
1229
|
+
if (typeof r != "string" || !Ie.has(r)) {
|
|
1747
1230
|
d(
|
|
1748
1231
|
n,
|
|
1749
1232
|
`presentation.artifactFormats.${o}`,
|
|
@@ -1754,15 +1237,15 @@ function Cn(e, n) {
|
|
|
1754
1237
|
t.includes(r) || t.push(r);
|
|
1755
1238
|
}), t;
|
|
1756
1239
|
}
|
|
1757
|
-
function
|
|
1240
|
+
function Ce(e, n) {
|
|
1758
1241
|
if (e == null)
|
|
1759
1242
|
return {
|
|
1760
|
-
artifactFormats: [...
|
|
1243
|
+
artifactFormats: [...Y],
|
|
1761
1244
|
includeEvidence: !0,
|
|
1762
1245
|
includeSql: !0
|
|
1763
1246
|
};
|
|
1764
|
-
const t =
|
|
1765
|
-
|
|
1247
|
+
const t = v(e, "presentation", n);
|
|
1248
|
+
p(
|
|
1766
1249
|
t,
|
|
1767
1250
|
"presentation",
|
|
1768
1251
|
[
|
|
@@ -1780,82 +1263,82 @@ function Oe(e, n) {
|
|
|
1780
1263
|
n
|
|
1781
1264
|
);
|
|
1782
1265
|
const r = {
|
|
1783
|
-
artifactFormats:
|
|
1784
|
-
includeEvidence:
|
|
1266
|
+
artifactFormats: nn(t.artifactFormats, n),
|
|
1267
|
+
includeEvidence: N(
|
|
1785
1268
|
t.includeEvidence,
|
|
1786
1269
|
!0,
|
|
1787
1270
|
"presentation.includeEvidence",
|
|
1788
1271
|
n
|
|
1789
1272
|
),
|
|
1790
|
-
includeSql:
|
|
1273
|
+
includeSql: N(
|
|
1791
1274
|
t.includeSql,
|
|
1792
1275
|
!0,
|
|
1793
1276
|
"presentation.includeSql",
|
|
1794
1277
|
n
|
|
1795
1278
|
)
|
|
1796
|
-
}, o =
|
|
1279
|
+
}, o = I(
|
|
1797
1280
|
t.audience,
|
|
1798
1281
|
"presentation.audience",
|
|
1799
|
-
|
|
1282
|
+
f.presentationAudience,
|
|
1800
1283
|
n
|
|
1801
|
-
), a =
|
|
1284
|
+
), a = I(
|
|
1802
1285
|
t.tone,
|
|
1803
1286
|
"presentation.tone",
|
|
1804
|
-
|
|
1287
|
+
f.presentationTone,
|
|
1805
1288
|
n
|
|
1806
|
-
), i =
|
|
1289
|
+
), i = I(
|
|
1807
1290
|
t.format,
|
|
1808
1291
|
"presentation.format",
|
|
1809
|
-
|
|
1292
|
+
f.presentationFormat,
|
|
1810
1293
|
n
|
|
1811
1294
|
);
|
|
1812
1295
|
o && (r.audience = o), a && (r.tone = a), i && (r.format = i);
|
|
1813
|
-
const c =
|
|
1296
|
+
const c = bt(t);
|
|
1814
1297
|
return c.issues.forEach((l) => d(n, l.field, l.message)), Object.assign(r, c.value), r;
|
|
1815
1298
|
}
|
|
1816
|
-
function
|
|
1817
|
-
return Array.isArray(e) ? (e.length === 0 && d(t, n, "Expected at least one item."), e.length >
|
|
1299
|
+
function rn(e, n, t) {
|
|
1300
|
+
return Array.isArray(e) ? (e.length === 0 && d(t, n, "Expected at least one item."), e.length > C.maxListItems && d(
|
|
1818
1301
|
t,
|
|
1819
1302
|
n,
|
|
1820
|
-
`Must have ${
|
|
1821
|
-
), e.slice(0,
|
|
1822
|
-
(r, o) =>
|
|
1303
|
+
`Must have ${C.maxListItems} items or fewer.`
|
|
1304
|
+
), e.slice(0, C.maxListItems).map(
|
|
1305
|
+
(r, o) => b(
|
|
1823
1306
|
r,
|
|
1824
1307
|
`${n}.${o}`,
|
|
1825
|
-
|
|
1308
|
+
f.contentItem,
|
|
1826
1309
|
t
|
|
1827
1310
|
)
|
|
1828
1311
|
).filter(Boolean)) : (d(t, n, "Expected an array."), []);
|
|
1829
1312
|
}
|
|
1830
|
-
function
|
|
1831
|
-
const r =
|
|
1313
|
+
function on(e, n, t) {
|
|
1314
|
+
const r = v(e, n, t);
|
|
1832
1315
|
if (r.kind === "metric")
|
|
1833
|
-
return
|
|
1316
|
+
return p(r, n, ["kind", "metricId"], t), {
|
|
1834
1317
|
kind: "metric",
|
|
1835
|
-
metricId:
|
|
1318
|
+
metricId: b(
|
|
1836
1319
|
r.metricId,
|
|
1837
1320
|
`${n}.metricId`,
|
|
1838
|
-
|
|
1321
|
+
f.id,
|
|
1839
1322
|
t
|
|
1840
1323
|
)
|
|
1841
1324
|
};
|
|
1842
1325
|
if (r.kind === "column")
|
|
1843
|
-
return
|
|
1326
|
+
return p(r, n, ["kind", "columnKey"], t), {
|
|
1844
1327
|
kind: "column",
|
|
1845
|
-
columnKey:
|
|
1328
|
+
columnKey: b(
|
|
1846
1329
|
r.columnKey,
|
|
1847
1330
|
`${n}.columnKey`,
|
|
1848
|
-
|
|
1331
|
+
f.id,
|
|
1849
1332
|
t
|
|
1850
1333
|
)
|
|
1851
1334
|
};
|
|
1852
1335
|
if (r.kind === "matrix_measure")
|
|
1853
|
-
return
|
|
1336
|
+
return p(r, n, ["kind", "measureId"], t), {
|
|
1854
1337
|
kind: "matrix_measure",
|
|
1855
|
-
measureId:
|
|
1338
|
+
measureId: b(
|
|
1856
1339
|
r.measureId,
|
|
1857
1340
|
`${n}.measureId`,
|
|
1858
|
-
|
|
1341
|
+
f.id,
|
|
1859
1342
|
t
|
|
1860
1343
|
)
|
|
1861
1344
|
};
|
|
@@ -1865,18 +1348,18 @@ function En(e, n, t) {
|
|
|
1865
1348
|
"Expected metric, column, or matrix_measure."
|
|
1866
1349
|
);
|
|
1867
1350
|
}
|
|
1868
|
-
function
|
|
1351
|
+
function xe(e, n, t) {
|
|
1869
1352
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
1870
1353
|
return;
|
|
1871
|
-
const r =
|
|
1354
|
+
const r = v(e, n, t);
|
|
1872
1355
|
if (!Object.prototype.hasOwnProperty.call(r, "target") && !Object.prototype.hasOwnProperty.call(r, "format"))
|
|
1873
1356
|
return;
|
|
1874
|
-
|
|
1875
|
-
const o =
|
|
1357
|
+
p(r, n, ["value", "target", "format"], t), (typeof r.value != "number" || !Number.isFinite(r.value)) && d(t, `${n}.value`, "Expected a finite number.");
|
|
1358
|
+
const o = on(
|
|
1876
1359
|
r.target,
|
|
1877
1360
|
`${n}.target`,
|
|
1878
1361
|
t
|
|
1879
|
-
), a =
|
|
1362
|
+
), a = de(r.format);
|
|
1880
1363
|
if (a.ok || a.issues.forEach(
|
|
1881
1364
|
(i) => d(
|
|
1882
1365
|
t,
|
|
@@ -1886,7 +1369,7 @@ function Me(e, n, t) {
|
|
|
1886
1369
|
), !(typeof r.value != "number" || !Number.isFinite(r.value) || !o || !a.ok))
|
|
1887
1370
|
return { value: r.value, target: o, format: a.value };
|
|
1888
1371
|
}
|
|
1889
|
-
function
|
|
1372
|
+
function O(e, n, t) {
|
|
1890
1373
|
if (typeof e == "string")
|
|
1891
1374
|
return e;
|
|
1892
1375
|
if (typeof e == "number") {
|
|
@@ -1896,7 +1379,7 @@ function M(e, n, t) {
|
|
|
1896
1379
|
}
|
|
1897
1380
|
return e;
|
|
1898
1381
|
}
|
|
1899
|
-
const r =
|
|
1382
|
+
const r = xe(e, n, t);
|
|
1900
1383
|
if (r) return r;
|
|
1901
1384
|
d(
|
|
1902
1385
|
t,
|
|
@@ -1904,99 +1387,99 @@ function M(e, n, t) {
|
|
|
1904
1387
|
"Expected a string, number, or structured numeric value."
|
|
1905
1388
|
);
|
|
1906
1389
|
}
|
|
1907
|
-
function
|
|
1390
|
+
function an(e, n, t) {
|
|
1908
1391
|
if (e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean")
|
|
1909
|
-
return typeof e == "string" && e.length >
|
|
1392
|
+
return typeof e == "string" && e.length > f.contentCell ? (d(
|
|
1910
1393
|
t,
|
|
1911
1394
|
n,
|
|
1912
|
-
`Must be ${
|
|
1913
|
-
), e.slice(0,
|
|
1914
|
-
const r =
|
|
1395
|
+
`Must be ${f.contentCell} characters or fewer.`
|
|
1396
|
+
), e.slice(0, f.contentCell)) : typeof e == "number" && !Number.isFinite(e) ? (d(t, n, "Expected a finite number."), null) : e;
|
|
1397
|
+
const r = xe(e, n, t);
|
|
1915
1398
|
return r || (d(
|
|
1916
1399
|
t,
|
|
1917
1400
|
n,
|
|
1918
1401
|
"Expected a string, number, boolean, structured numeric value, or null."
|
|
1919
1402
|
), null);
|
|
1920
1403
|
}
|
|
1921
|
-
function
|
|
1404
|
+
function cn(e, n, t) {
|
|
1922
1405
|
if (!Array.isArray(e))
|
|
1923
1406
|
return d(t, n, "Expected an array."), [];
|
|
1924
|
-
e.length === 0 && d(t, n, "Expected at least one column."), e.length >
|
|
1407
|
+
e.length === 0 && d(t, n, "Expected at least one column."), e.length > C.maxTableColumns && d(
|
|
1925
1408
|
t,
|
|
1926
1409
|
n,
|
|
1927
|
-
`Must have ${
|
|
1410
|
+
`Must have ${C.maxTableColumns} columns or fewer.`
|
|
1928
1411
|
);
|
|
1929
1412
|
const r = /* @__PURE__ */ new Set();
|
|
1930
|
-
return e.slice(0,
|
|
1931
|
-
const i = `${n}.${a}`, c =
|
|
1932
|
-
|
|
1933
|
-
const l =
|
|
1413
|
+
return e.slice(0, C.maxTableColumns).map((o, a) => {
|
|
1414
|
+
const i = `${n}.${a}`, c = v(o, i, t);
|
|
1415
|
+
p(c, i, ["key", "label", "kind", "align"], t);
|
|
1416
|
+
const l = b(
|
|
1934
1417
|
c.key,
|
|
1935
1418
|
`${i}.key`,
|
|
1936
|
-
|
|
1419
|
+
f.id,
|
|
1937
1420
|
t
|
|
1938
1421
|
);
|
|
1939
1422
|
l && (r.has(l) && d(t, `${i}.key`, "Column key must be unique."), r.add(l));
|
|
1940
|
-
const
|
|
1423
|
+
const m = b(
|
|
1941
1424
|
c.label,
|
|
1942
1425
|
`${i}.label`,
|
|
1943
|
-
|
|
1426
|
+
f.contentTitle,
|
|
1944
1427
|
t
|
|
1945
|
-
),
|
|
1428
|
+
), s = D(
|
|
1946
1429
|
c.kind,
|
|
1947
1430
|
`${i}.kind`,
|
|
1948
|
-
|
|
1431
|
+
Xt,
|
|
1949
1432
|
"text, number, currency, percent, date, or boolean",
|
|
1950
1433
|
t
|
|
1951
|
-
),
|
|
1434
|
+
), u = D(
|
|
1952
1435
|
c.align,
|
|
1953
1436
|
`${i}.align`,
|
|
1954
|
-
|
|
1437
|
+
Zt,
|
|
1955
1438
|
"left, center, or right",
|
|
1956
1439
|
t
|
|
1957
1440
|
);
|
|
1958
1441
|
return {
|
|
1959
1442
|
key: l,
|
|
1960
|
-
label:
|
|
1961
|
-
...
|
|
1962
|
-
...
|
|
1443
|
+
label: m,
|
|
1444
|
+
...s ? { kind: s } : {},
|
|
1445
|
+
...u ? { align: u } : {}
|
|
1963
1446
|
};
|
|
1964
1447
|
});
|
|
1965
1448
|
}
|
|
1966
|
-
function
|
|
1449
|
+
function ln(e, n, t, r) {
|
|
1967
1450
|
if (!Array.isArray(e))
|
|
1968
1451
|
return d(r, n, "Expected an array."), [];
|
|
1969
|
-
e.length >
|
|
1452
|
+
e.length > C.maxTableRows && d(
|
|
1970
1453
|
r,
|
|
1971
1454
|
n,
|
|
1972
|
-
`Must have ${
|
|
1455
|
+
`Must have ${C.maxTableRows} rows or fewer.`
|
|
1973
1456
|
);
|
|
1974
1457
|
const o = new Set(t.map((a) => a.key).filter(Boolean));
|
|
1975
|
-
return e.slice(0,
|
|
1976
|
-
const c = `${n}.${i}`, l =
|
|
1977
|
-
return Object.keys(l).forEach((
|
|
1978
|
-
o.has(
|
|
1458
|
+
return e.slice(0, C.maxTableRows).map((a, i) => {
|
|
1459
|
+
const c = `${n}.${i}`, l = v(a, c, r);
|
|
1460
|
+
return Object.keys(l).forEach((m) => {
|
|
1461
|
+
o.has(m) || d(r, `${c}.${m}`, `Unexpected table cell "${m}".`);
|
|
1979
1462
|
}), Object.fromEntries(
|
|
1980
|
-
t.map((
|
|
1981
|
-
|
|
1982
|
-
|
|
1463
|
+
t.map((m) => [
|
|
1464
|
+
m.key,
|
|
1465
|
+
an(l[m.key] ?? null, `${c}.${m.key}`, r)
|
|
1983
1466
|
])
|
|
1984
1467
|
);
|
|
1985
1468
|
});
|
|
1986
1469
|
}
|
|
1987
|
-
function
|
|
1988
|
-
const r = `content.blocks.${n}`, o =
|
|
1470
|
+
function dn(e, n, t) {
|
|
1471
|
+
const r = `content.blocks.${n}`, o = v(e, r, t), a = o.type;
|
|
1989
1472
|
if (a === "heading") {
|
|
1990
|
-
|
|
1473
|
+
p(o, r, ["type", "text", "level", "evidenceIds"], t);
|
|
1991
1474
|
const i = o.level === void 0 || o.level === null ? void 0 : o.level === 2 || o.level === 3 ? o.level : void 0;
|
|
1992
1475
|
o.level !== void 0 && o.level !== null && i === void 0 && d(t, `${r}.level`, "Expected 2 or 3.");
|
|
1993
|
-
const c =
|
|
1476
|
+
const c = k(o.evidenceIds, `${r}.evidenceIds`, t);
|
|
1994
1477
|
return {
|
|
1995
1478
|
type: "heading",
|
|
1996
|
-
text:
|
|
1479
|
+
text: b(
|
|
1997
1480
|
o.text,
|
|
1998
1481
|
`${r}.text`,
|
|
1999
|
-
|
|
1482
|
+
f.contentTitle,
|
|
2000
1483
|
t
|
|
2001
1484
|
),
|
|
2002
1485
|
...i ? { level: i } : {},
|
|
@@ -2004,65 +1487,65 @@ function kn(e, n, t) {
|
|
|
2004
1487
|
};
|
|
2005
1488
|
}
|
|
2006
1489
|
if (a === "paragraph") {
|
|
2007
|
-
|
|
2008
|
-
const i =
|
|
1490
|
+
p(o, r, ["type", "text", "evidenceIds"], t);
|
|
1491
|
+
const i = k(o.evidenceIds, `${r}.evidenceIds`, t);
|
|
2009
1492
|
return {
|
|
2010
1493
|
type: "paragraph",
|
|
2011
|
-
text:
|
|
1494
|
+
text: b(
|
|
2012
1495
|
o.text,
|
|
2013
1496
|
`${r}.text`,
|
|
2014
|
-
|
|
1497
|
+
f.contentText,
|
|
2015
1498
|
t
|
|
2016
1499
|
),
|
|
2017
1500
|
...i ? { evidenceIds: i } : {}
|
|
2018
1501
|
};
|
|
2019
1502
|
}
|
|
2020
1503
|
if (a === "finding") {
|
|
2021
|
-
|
|
2022
|
-
const i =
|
|
1504
|
+
p(o, r, ["type", "title", "text", "severity", "evidenceIds"], t);
|
|
1505
|
+
const i = I(
|
|
2023
1506
|
o.title,
|
|
2024
1507
|
`${r}.title`,
|
|
2025
|
-
|
|
1508
|
+
f.contentTitle,
|
|
2026
1509
|
t
|
|
2027
|
-
), c =
|
|
1510
|
+
), c = D(
|
|
2028
1511
|
o.severity,
|
|
2029
1512
|
`${r}.severity`,
|
|
2030
|
-
|
|
1513
|
+
Wt,
|
|
2031
1514
|
"info, positive, warning, or critical",
|
|
2032
1515
|
t
|
|
2033
1516
|
);
|
|
2034
1517
|
return {
|
|
2035
1518
|
type: "finding",
|
|
2036
1519
|
...i ? { title: i } : {},
|
|
2037
|
-
text:
|
|
1520
|
+
text: b(
|
|
2038
1521
|
o.text,
|
|
2039
1522
|
`${r}.text`,
|
|
2040
|
-
|
|
1523
|
+
f.contentText,
|
|
2041
1524
|
t
|
|
2042
1525
|
),
|
|
2043
1526
|
...c ? { severity: c } : {},
|
|
2044
|
-
evidenceIds:
|
|
1527
|
+
evidenceIds: k(o.evidenceIds, `${r}.evidenceIds`, t, {
|
|
2045
1528
|
required: !0
|
|
2046
1529
|
}) ?? []
|
|
2047
1530
|
};
|
|
2048
1531
|
}
|
|
2049
1532
|
if (a === "bullets" || a === "actions" || a === "limitations") {
|
|
2050
|
-
|
|
2051
|
-
const i =
|
|
1533
|
+
p(o, r, ["type", "title", "items", "evidenceIds"], t);
|
|
1534
|
+
const i = I(
|
|
2052
1535
|
o.title,
|
|
2053
1536
|
`${r}.title`,
|
|
2054
|
-
|
|
1537
|
+
f.contentTitle,
|
|
2055
1538
|
t
|
|
2056
|
-
), c =
|
|
1539
|
+
), c = k(o.evidenceIds, `${r}.evidenceIds`, t);
|
|
2057
1540
|
return {
|
|
2058
1541
|
type: a,
|
|
2059
1542
|
...i ? { title: i } : {},
|
|
2060
|
-
items:
|
|
1543
|
+
items: rn(o.items, `${r}.items`, t),
|
|
2061
1544
|
...c ? { evidenceIds: c } : {}
|
|
2062
1545
|
};
|
|
2063
1546
|
}
|
|
2064
1547
|
if (a === "metric") {
|
|
2065
|
-
|
|
1548
|
+
p(
|
|
2066
1549
|
o,
|
|
2067
1550
|
r,
|
|
2068
1551
|
[
|
|
@@ -2077,64 +1560,64 @@ function kn(e, n, t) {
|
|
|
2077
1560
|
],
|
|
2078
1561
|
t
|
|
2079
1562
|
);
|
|
2080
|
-
const i =
|
|
1563
|
+
const i = O(o.value, `${r}.value`, t) ?? "";
|
|
2081
1564
|
i === "" && d(
|
|
2082
1565
|
t,
|
|
2083
1566
|
`${r}.value`,
|
|
2084
1567
|
"Expected a non-empty string, number, or structured numeric value."
|
|
2085
1568
|
);
|
|
2086
|
-
const c = o.previousValue === void 0 || o.previousValue === null ? o.previousValue :
|
|
1569
|
+
const c = o.previousValue === void 0 || o.previousValue === null ? o.previousValue : O(
|
|
2087
1570
|
o.previousValue,
|
|
2088
1571
|
`${r}.previousValue`,
|
|
2089
1572
|
t
|
|
2090
|
-
), l = o.delta === void 0 || o.delta === null ? o.delta :
|
|
1573
|
+
), l = o.delta === void 0 || o.delta === null ? o.delta : O(
|
|
2091
1574
|
o.delta,
|
|
2092
1575
|
`${r}.delta`,
|
|
2093
1576
|
t
|
|
2094
|
-
),
|
|
1577
|
+
), m = o.percentChange === void 0 || o.percentChange === null ? o.percentChange : O(
|
|
2095
1578
|
o.percentChange,
|
|
2096
1579
|
`${r}.percentChange`,
|
|
2097
1580
|
t
|
|
2098
|
-
),
|
|
1581
|
+
), s = I(
|
|
2099
1582
|
o.unit,
|
|
2100
1583
|
`${r}.unit`,
|
|
2101
|
-
|
|
1584
|
+
f.contentTitle,
|
|
2102
1585
|
t
|
|
2103
|
-
),
|
|
1586
|
+
), u = k(o.evidenceIds, `${r}.evidenceIds`, t);
|
|
2104
1587
|
return {
|
|
2105
1588
|
type: "metric",
|
|
2106
|
-
label:
|
|
1589
|
+
label: b(
|
|
2107
1590
|
o.label,
|
|
2108
1591
|
`${r}.label`,
|
|
2109
|
-
|
|
1592
|
+
f.contentTitle,
|
|
2110
1593
|
t
|
|
2111
1594
|
),
|
|
2112
1595
|
value: i,
|
|
2113
1596
|
...c !== void 0 ? { previousValue: c } : {},
|
|
2114
1597
|
...l !== void 0 ? { delta: l } : {},
|
|
2115
|
-
...
|
|
2116
|
-
...
|
|
2117
|
-
...
|
|
1598
|
+
...m !== void 0 ? { percentChange: m } : {},
|
|
1599
|
+
...s ? { unit: s } : {},
|
|
1600
|
+
...u ? { evidenceIds: u } : {}
|
|
2118
1601
|
};
|
|
2119
1602
|
}
|
|
2120
1603
|
if (a === "kpi_grid") {
|
|
2121
|
-
|
|
2122
|
-
const i =
|
|
1604
|
+
p(o, r, ["type", "title", "tiles", "evidenceIds"], t);
|
|
1605
|
+
const i = I(
|
|
2123
1606
|
o.title,
|
|
2124
1607
|
`${r}.title`,
|
|
2125
|
-
|
|
1608
|
+
f.contentTitle,
|
|
2126
1609
|
t
|
|
2127
1610
|
), c = Array.isArray(o.tiles) ? o.tiles : [];
|
|
2128
|
-
Array.isArray(o.tiles) || d(t, `${r}.tiles`, "Expected an array."), c.length === 0 && d(t, `${r}.tiles`, "Expected at least one tile."), c.length >
|
|
1611
|
+
Array.isArray(o.tiles) || d(t, `${r}.tiles`, "Expected an array."), c.length === 0 && d(t, `${r}.tiles`, "Expected at least one tile."), c.length > C.maxKpiTiles && d(
|
|
2129
1612
|
t,
|
|
2130
1613
|
`${r}.tiles`,
|
|
2131
|
-
`Must have ${
|
|
1614
|
+
`Must have ${C.maxKpiTiles} tiles or fewer.`
|
|
2132
1615
|
);
|
|
2133
|
-
const l = c.slice(0,
|
|
2134
|
-
const
|
|
2135
|
-
|
|
1616
|
+
const l = c.slice(0, C.maxKpiTiles).map((s, u) => {
|
|
1617
|
+
const h = `${r}.tiles.${u}`, g = v(s, h, t);
|
|
1618
|
+
p(
|
|
1619
|
+
g,
|
|
2136
1620
|
h,
|
|
2137
|
-
f,
|
|
2138
1621
|
[
|
|
2139
1622
|
"label",
|
|
2140
1623
|
"value",
|
|
@@ -2146,53 +1629,53 @@ function kn(e, n, t) {
|
|
|
2146
1629
|
],
|
|
2147
1630
|
t
|
|
2148
1631
|
);
|
|
2149
|
-
const
|
|
2150
|
-
|
|
2151
|
-
`${
|
|
1632
|
+
const E = O(
|
|
1633
|
+
g.value,
|
|
1634
|
+
`${h}.value`,
|
|
2152
1635
|
t
|
|
2153
1636
|
) ?? "";
|
|
2154
|
-
|
|
1637
|
+
E === "" && d(
|
|
2155
1638
|
t,
|
|
2156
|
-
`${
|
|
1639
|
+
`${h}.value`,
|
|
2157
1640
|
"Expected a non-empty string, number, or structured numeric value."
|
|
2158
1641
|
);
|
|
2159
|
-
const
|
|
2160
|
-
|
|
2161
|
-
`${
|
|
1642
|
+
const x = g.previousValue === void 0 || g.previousValue === null ? g.previousValue : O(
|
|
1643
|
+
g.previousValue,
|
|
1644
|
+
`${h}.previousValue`,
|
|
2162
1645
|
t
|
|
2163
|
-
),
|
|
2164
|
-
|
|
2165
|
-
`${
|
|
1646
|
+
), _ = g.delta === void 0 || g.delta === null ? g.delta : O(
|
|
1647
|
+
g.delta,
|
|
1648
|
+
`${h}.delta`,
|
|
2166
1649
|
t
|
|
2167
|
-
),
|
|
2168
|
-
|
|
2169
|
-
`${
|
|
1650
|
+
), M = g.percentChange === void 0 || g.percentChange === null ? g.percentChange : O(
|
|
1651
|
+
g.percentChange,
|
|
1652
|
+
`${h}.percentChange`,
|
|
2170
1653
|
t
|
|
2171
|
-
), $ =
|
|
2172
|
-
|
|
2173
|
-
`${
|
|
2174
|
-
|
|
1654
|
+
), $ = I(
|
|
1655
|
+
g.unit,
|
|
1656
|
+
`${h}.unit`,
|
|
1657
|
+
f.contentTitle,
|
|
2175
1658
|
t
|
|
2176
|
-
), T =
|
|
2177
|
-
|
|
2178
|
-
`${
|
|
1659
|
+
), T = k(
|
|
1660
|
+
g.evidenceIds,
|
|
1661
|
+
`${h}.evidenceIds`,
|
|
2179
1662
|
t
|
|
2180
1663
|
);
|
|
2181
1664
|
return {
|
|
2182
|
-
label:
|
|
2183
|
-
|
|
2184
|
-
`${
|
|
2185
|
-
|
|
1665
|
+
label: b(
|
|
1666
|
+
g.label,
|
|
1667
|
+
`${h}.label`,
|
|
1668
|
+
f.contentTitle,
|
|
2186
1669
|
t
|
|
2187
1670
|
),
|
|
2188
|
-
value:
|
|
2189
|
-
...
|
|
2190
|
-
...
|
|
2191
|
-
...
|
|
1671
|
+
value: E,
|
|
1672
|
+
...x !== void 0 ? { previousValue: x } : {},
|
|
1673
|
+
..._ !== void 0 ? { delta: _ } : {},
|
|
1674
|
+
...M !== void 0 ? { percentChange: M } : {},
|
|
2192
1675
|
...$ ? { unit: $ } : {},
|
|
2193
1676
|
...T ? { evidenceIds: T } : {}
|
|
2194
1677
|
};
|
|
2195
|
-
}),
|
|
1678
|
+
}), m = k(
|
|
2196
1679
|
o.evidenceIds,
|
|
2197
1680
|
`${r}.evidenceIds`,
|
|
2198
1681
|
t
|
|
@@ -2201,25 +1684,25 @@ function kn(e, n, t) {
|
|
|
2201
1684
|
type: "kpi_grid",
|
|
2202
1685
|
...i ? { title: i } : {},
|
|
2203
1686
|
tiles: l,
|
|
2204
|
-
...
|
|
1687
|
+
...m ? { evidenceIds: m } : {}
|
|
2205
1688
|
};
|
|
2206
1689
|
}
|
|
2207
1690
|
if (a === "progress") {
|
|
2208
|
-
|
|
1691
|
+
p(o, r, ["type", "label", "value", "detail", "evidenceIds"], t);
|
|
2209
1692
|
const i = typeof o.value == "number" && Number.isFinite(o.value) ? o.value : 0;
|
|
2210
1693
|
(typeof o.value != "number" || !Number.isFinite(o.value)) && d(t, `${r}.value`, "Expected a finite number.");
|
|
2211
|
-
const c =
|
|
1694
|
+
const c = I(
|
|
2212
1695
|
o.detail,
|
|
2213
1696
|
`${r}.detail`,
|
|
2214
|
-
|
|
1697
|
+
f.contentText,
|
|
2215
1698
|
t
|
|
2216
|
-
), l =
|
|
1699
|
+
), l = k(o.evidenceIds, `${r}.evidenceIds`, t);
|
|
2217
1700
|
return {
|
|
2218
1701
|
type: "progress",
|
|
2219
|
-
label:
|
|
1702
|
+
label: b(
|
|
2220
1703
|
o.label,
|
|
2221
1704
|
`${r}.label`,
|
|
2222
|
-
|
|
1705
|
+
f.contentTitle,
|
|
2223
1706
|
t
|
|
2224
1707
|
),
|
|
2225
1708
|
value: i,
|
|
@@ -2228,72 +1711,72 @@ function kn(e, n, t) {
|
|
|
2228
1711
|
};
|
|
2229
1712
|
}
|
|
2230
1713
|
if (a === "table") {
|
|
2231
|
-
|
|
1714
|
+
p(
|
|
2232
1715
|
o,
|
|
2233
1716
|
r,
|
|
2234
1717
|
["type", "id", "title", "columns", "rows", "caption", "totalRows", "evidenceIds"],
|
|
2235
1718
|
t
|
|
2236
1719
|
);
|
|
2237
|
-
const i =
|
|
1720
|
+
const i = cn(o.columns, `${r}.columns`, t), c = I(
|
|
2238
1721
|
o.title,
|
|
2239
1722
|
`${r}.title`,
|
|
2240
|
-
|
|
1723
|
+
f.contentTitle,
|
|
2241
1724
|
t
|
|
2242
|
-
), l =
|
|
1725
|
+
), l = I(
|
|
2243
1726
|
o.id,
|
|
2244
1727
|
`${r}.id`,
|
|
2245
|
-
|
|
1728
|
+
f.id,
|
|
2246
1729
|
t
|
|
2247
|
-
),
|
|
1730
|
+
), m = I(
|
|
2248
1731
|
o.caption,
|
|
2249
1732
|
`${r}.caption`,
|
|
2250
|
-
|
|
1733
|
+
f.contentItem,
|
|
2251
1734
|
t
|
|
2252
|
-
),
|
|
1735
|
+
), s = Qt(
|
|
2253
1736
|
o.totalRows,
|
|
2254
1737
|
`${r}.totalRows`,
|
|
2255
1738
|
t
|
|
2256
|
-
),
|
|
1739
|
+
), u = k(o.evidenceIds, `${r}.evidenceIds`, t);
|
|
2257
1740
|
return {
|
|
2258
1741
|
type: "table",
|
|
2259
1742
|
...l ? { id: l } : {},
|
|
2260
1743
|
...c ? { title: c } : {},
|
|
2261
1744
|
columns: i,
|
|
2262
|
-
rows:
|
|
2263
|
-
...
|
|
2264
|
-
...
|
|
2265
|
-
...
|
|
1745
|
+
rows: ln(o.rows, `${r}.rows`, i, t),
|
|
1746
|
+
...m ? { caption: m } : {},
|
|
1747
|
+
...s !== void 0 ? { totalRows: s } : {},
|
|
1748
|
+
...u ? { evidenceIds: u } : {}
|
|
2266
1749
|
};
|
|
2267
1750
|
}
|
|
2268
1751
|
if (a === "evidence_appendix") {
|
|
2269
|
-
|
|
2270
|
-
const i =
|
|
1752
|
+
p(o, r, ["type", "title", "evidenceIds"], t);
|
|
1753
|
+
const i = I(
|
|
2271
1754
|
o.title,
|
|
2272
1755
|
`${r}.title`,
|
|
2273
|
-
|
|
1756
|
+
f.contentTitle,
|
|
2274
1757
|
t
|
|
2275
1758
|
);
|
|
2276
1759
|
return {
|
|
2277
1760
|
type: "evidence_appendix",
|
|
2278
1761
|
...i ? { title: i } : {},
|
|
2279
|
-
evidenceIds:
|
|
1762
|
+
evidenceIds: k(o.evidenceIds, `${r}.evidenceIds`, t, {
|
|
2280
1763
|
required: !0
|
|
2281
1764
|
}) ?? []
|
|
2282
1765
|
};
|
|
2283
1766
|
}
|
|
2284
1767
|
if (a === "sql") {
|
|
2285
|
-
|
|
2286
|
-
const i =
|
|
1768
|
+
p(o, r, ["type", "title", "sql", "evidenceIds"], t);
|
|
1769
|
+
const i = I(
|
|
2287
1770
|
o.title,
|
|
2288
1771
|
`${r}.title`,
|
|
2289
|
-
|
|
1772
|
+
f.contentTitle,
|
|
2290
1773
|
t
|
|
2291
|
-
), c =
|
|
1774
|
+
), c = b(
|
|
2292
1775
|
o.sql,
|
|
2293
1776
|
`${r}.sql`,
|
|
2294
|
-
|
|
1777
|
+
f.contentSql,
|
|
2295
1778
|
t
|
|
2296
|
-
), l =
|
|
1779
|
+
), l = k(o.evidenceIds, `${r}.evidenceIds`, t);
|
|
2297
1780
|
return {
|
|
2298
1781
|
type: "sql",
|
|
2299
1782
|
...i ? { title: i } : {},
|
|
@@ -2310,59 +1793,59 @@ function kn(e, n, t) {
|
|
|
2310
1793
|
text: ""
|
|
2311
1794
|
};
|
|
2312
1795
|
}
|
|
2313
|
-
function
|
|
2314
|
-
const n = [], t =
|
|
2315
|
-
|
|
2316
|
-
const r =
|
|
1796
|
+
function sn(e) {
|
|
1797
|
+
const n = [], t = v(e, "content", n);
|
|
1798
|
+
p(t, "content", ["version", "title", "summary", "blocks"], n), t.version !== 1 && d(n, "content.version", "Expected version 1.");
|
|
1799
|
+
const r = I(
|
|
2317
1800
|
t.title,
|
|
2318
1801
|
"content.title",
|
|
2319
|
-
|
|
1802
|
+
f.contentTitle,
|
|
2320
1803
|
n
|
|
2321
|
-
), o =
|
|
1804
|
+
), o = I(
|
|
2322
1805
|
t.summary,
|
|
2323
1806
|
"content.summary",
|
|
2324
|
-
|
|
1807
|
+
f.contentSummary,
|
|
2325
1808
|
n
|
|
2326
1809
|
);
|
|
2327
1810
|
Array.isArray(t.blocks) || d(n, "content.blocks", "Expected an array.");
|
|
2328
1811
|
const a = Array.isArray(t.blocks) ? t.blocks : [];
|
|
2329
|
-
a.length === 0 && d(n, "content.blocks", "Expected at least one block."), a.length >
|
|
1812
|
+
a.length === 0 && d(n, "content.blocks", "Expected at least one block."), a.length > C.maxBlocks && d(
|
|
2330
1813
|
n,
|
|
2331
1814
|
"content.blocks",
|
|
2332
|
-
`Must have ${
|
|
1815
|
+
`Must have ${C.maxBlocks} blocks or fewer.`
|
|
2333
1816
|
);
|
|
2334
|
-
const i = a.slice(0,
|
|
2335
|
-
return
|
|
1817
|
+
const i = a.slice(0, C.maxBlocks).map((c, l) => dn(c, l, n));
|
|
1818
|
+
return te(n), {
|
|
2336
1819
|
version: 1,
|
|
2337
1820
|
...r ? { title: r } : {},
|
|
2338
1821
|
...o ? { summary: o } : {},
|
|
2339
1822
|
blocks: i
|
|
2340
1823
|
};
|
|
2341
1824
|
}
|
|
2342
|
-
function
|
|
1825
|
+
function ar(e) {
|
|
2343
1826
|
try {
|
|
2344
1827
|
return {
|
|
2345
1828
|
valid: !0,
|
|
2346
|
-
value:
|
|
1829
|
+
value: sn(e),
|
|
2347
1830
|
issues: []
|
|
2348
1831
|
};
|
|
2349
1832
|
} catch (n) {
|
|
2350
|
-
if (n instanceof
|
|
1833
|
+
if (n instanceof j)
|
|
2351
1834
|
return { valid: !1, issues: n.issues };
|
|
2352
1835
|
throw n;
|
|
2353
1836
|
}
|
|
2354
1837
|
}
|
|
2355
|
-
function
|
|
1838
|
+
function V(e, n, t, r) {
|
|
2356
1839
|
return typeof e == "string" && t.includes(e) ? e : (d(r, n, `Expected ${t.join(" or ")}.`), t[0]);
|
|
2357
1840
|
}
|
|
2358
|
-
function
|
|
1841
|
+
function D(e, n, t, r, o) {
|
|
2359
1842
|
if (e != null) {
|
|
2360
1843
|
if (typeof e == "string" && t.has(e))
|
|
2361
1844
|
return e;
|
|
2362
1845
|
d(o, n, `Expected ${r}.`);
|
|
2363
1846
|
}
|
|
2364
1847
|
}
|
|
2365
|
-
function
|
|
1848
|
+
function mn(e, n, t) {
|
|
2366
1849
|
if (e != null) {
|
|
2367
1850
|
if (!Array.isArray(e)) {
|
|
2368
1851
|
d(t, n, "Expected an array.");
|
|
@@ -2371,97 +1854,97 @@ function An(e, n, t) {
|
|
|
2371
1854
|
return e;
|
|
2372
1855
|
}
|
|
2373
1856
|
}
|
|
2374
|
-
function
|
|
1857
|
+
function fn(e, n, t) {
|
|
2375
1858
|
if (e != null) {
|
|
2376
|
-
if (!
|
|
1859
|
+
if (!ve(e)) {
|
|
2377
1860
|
d(t, n, "Expected an object.");
|
|
2378
1861
|
return;
|
|
2379
1862
|
}
|
|
2380
1863
|
return e;
|
|
2381
1864
|
}
|
|
2382
1865
|
}
|
|
2383
|
-
function
|
|
1866
|
+
function un(e, n, t) {
|
|
2384
1867
|
if (e == null)
|
|
2385
1868
|
return;
|
|
2386
|
-
const r =
|
|
2387
|
-
|
|
1869
|
+
const r = v(e, n, t);
|
|
1870
|
+
p(r, n, Yt, t);
|
|
2388
1871
|
const o = {};
|
|
2389
1872
|
if (r.matrix !== void 0) {
|
|
2390
|
-
const
|
|
2391
|
-
|
|
2392
|
-
const
|
|
2393
|
-
|
|
2394
|
-
const
|
|
2395
|
-
|
|
1873
|
+
const s = v(r.matrix, `${n}.matrix`, t);
|
|
1874
|
+
p(s, `${n}.matrix`, ["config", "content"], t);
|
|
1875
|
+
const u = Re.safeParse(s.config);
|
|
1876
|
+
u.success || d(t, `${n}.matrix.config`, "Expected a valid Matrix definition.");
|
|
1877
|
+
const h = D(
|
|
1878
|
+
s.content,
|
|
2396
1879
|
`${n}.matrix.content`,
|
|
2397
1880
|
/* @__PURE__ */ new Set(["current", "all", "flat"]),
|
|
2398
1881
|
"current, all, or flat",
|
|
2399
1882
|
t
|
|
2400
1883
|
);
|
|
2401
|
-
|
|
1884
|
+
h || d(t, `${n}.matrix.content`, "Choose Matrix export content."), u.success && h && (o.matrix = { config: u.data, content: h });
|
|
2402
1885
|
}
|
|
2403
|
-
const a =
|
|
1886
|
+
const a = D(
|
|
2404
1887
|
r.pageSize,
|
|
2405
1888
|
`${n}.pageSize`,
|
|
2406
|
-
|
|
1889
|
+
zt,
|
|
2407
1890
|
"letter, legal, a4, a3, or tabloid",
|
|
2408
1891
|
t
|
|
2409
|
-
), i =
|
|
1892
|
+
), i = D(
|
|
2410
1893
|
r.orientation,
|
|
2411
1894
|
`${n}.orientation`,
|
|
2412
|
-
|
|
1895
|
+
jt,
|
|
2413
1896
|
"portrait or landscape",
|
|
2414
1897
|
t
|
|
2415
|
-
), c =
|
|
1898
|
+
), c = D(
|
|
2416
1899
|
r.delimiter,
|
|
2417
1900
|
`${n}.delimiter`,
|
|
2418
|
-
|
|
1901
|
+
qt,
|
|
2419
1902
|
"comma, semicolon, or tab",
|
|
2420
1903
|
t
|
|
2421
|
-
), l =
|
|
1904
|
+
), l = D(
|
|
2422
1905
|
r.csvEncoding,
|
|
2423
1906
|
`${n}.csvEncoding`,
|
|
2424
|
-
|
|
1907
|
+
Kt,
|
|
2425
1908
|
"utf-8-bom or utf-8",
|
|
2426
1909
|
t
|
|
2427
|
-
),
|
|
1910
|
+
), m = D(
|
|
2428
1911
|
r.sheetSelection,
|
|
2429
1912
|
`${n}.sheetSelection`,
|
|
2430
|
-
|
|
1913
|
+
Ht,
|
|
2431
1914
|
"current or all",
|
|
2432
1915
|
t
|
|
2433
1916
|
);
|
|
2434
|
-
a && (o.pageSize = a), i && (o.orientation = i), c && (o.delimiter = c), l && (o.csvEncoding = l),
|
|
2435
|
-
for (const
|
|
1917
|
+
a && (o.pageSize = a), i && (o.orientation = i), c && (o.delimiter = c), l && (o.csvEncoding = l), m && (o.sheetSelection = m);
|
|
1918
|
+
for (const s of [
|
|
2436
1919
|
"includeFilters",
|
|
2437
1920
|
"includeTimestamp",
|
|
2438
1921
|
"includeHeaders",
|
|
2439
1922
|
"useFormattedValues",
|
|
2440
1923
|
"allowDownload"
|
|
2441
1924
|
])
|
|
2442
|
-
if (!(r[
|
|
2443
|
-
if (typeof r[
|
|
2444
|
-
d(t, `${n}.${
|
|
1925
|
+
if (!(r[s] === void 0 || r[s] === null)) {
|
|
1926
|
+
if (typeof r[s] != "boolean") {
|
|
1927
|
+
d(t, `${n}.${s}`, "Expected a boolean.");
|
|
2445
1928
|
continue;
|
|
2446
1929
|
}
|
|
2447
|
-
o[
|
|
1930
|
+
o[s] = r[s];
|
|
2448
1931
|
}
|
|
2449
|
-
for (const
|
|
1932
|
+
for (const s of [
|
|
2450
1933
|
"currentSheetId",
|
|
2451
1934
|
"currentSheetName",
|
|
2452
1935
|
"selectedSheetId",
|
|
2453
1936
|
"cardType",
|
|
2454
1937
|
"theme"
|
|
2455
1938
|
]) {
|
|
2456
|
-
const
|
|
2457
|
-
r[
|
|
2458
|
-
`${n}.${
|
|
2459
|
-
|
|
1939
|
+
const u = I(
|
|
1940
|
+
r[s],
|
|
1941
|
+
`${n}.${s}`,
|
|
1942
|
+
f.id,
|
|
2460
1943
|
t
|
|
2461
1944
|
);
|
|
2462
|
-
|
|
1945
|
+
u && (o[s] = u);
|
|
2463
1946
|
}
|
|
2464
|
-
for (const
|
|
1947
|
+
for (const s of [
|
|
2465
1948
|
"filterValues",
|
|
2466
1949
|
"inlineFilterValues",
|
|
2467
1950
|
"sheetFilterValues",
|
|
@@ -2469,119 +1952,119 @@ function Fn(e, n, t) {
|
|
|
2469
1952
|
"cardControlDefinitions",
|
|
2470
1953
|
"controlBindings"
|
|
2471
1954
|
]) {
|
|
2472
|
-
const
|
|
2473
|
-
|
|
1955
|
+
const u = mn(r[s], `${n}.${s}`, t);
|
|
1956
|
+
u && (o[s] = u);
|
|
2474
1957
|
}
|
|
2475
|
-
for (const
|
|
1958
|
+
for (const s of [
|
|
2476
1959
|
"controlValues",
|
|
2477
1960
|
"tablePreferences",
|
|
2478
1961
|
"dashboardInputExecutionSnapshot",
|
|
2479
1962
|
"printInputCapture"
|
|
2480
1963
|
]) {
|
|
2481
|
-
const
|
|
2482
|
-
|
|
1964
|
+
const u = fn(r[s], `${n}.${s}`, t);
|
|
1965
|
+
u && (o[s] = u);
|
|
2483
1966
|
}
|
|
2484
1967
|
return Object.keys(o).length > 0 ? o : void 0;
|
|
2485
1968
|
}
|
|
2486
|
-
function
|
|
2487
|
-
const o =
|
|
1969
|
+
function W(e, n, t, r) {
|
|
1970
|
+
const o = I(
|
|
2488
1971
|
n,
|
|
2489
1972
|
t,
|
|
2490
|
-
|
|
1973
|
+
f.attachmentTitle,
|
|
2491
1974
|
r
|
|
2492
1975
|
);
|
|
2493
1976
|
return o && (e.title = o), e;
|
|
2494
1977
|
}
|
|
2495
|
-
function
|
|
2496
|
-
const o =
|
|
1978
|
+
function X(e, n, t, r) {
|
|
1979
|
+
const o = un(n, t, r);
|
|
2497
1980
|
return o != null && o.printInputCapture && e.type !== "dashboard" && d(
|
|
2498
1981
|
r,
|
|
2499
1982
|
`${t}.printInputCapture`,
|
|
2500
1983
|
"Only a full dashboard attachment can carry printInputCapture."
|
|
2501
1984
|
), o && (e.settings = o), e;
|
|
2502
1985
|
}
|
|
2503
|
-
function
|
|
2504
|
-
const r = `attachments.${n}`, o =
|
|
1986
|
+
function pn(e, n, t) {
|
|
1987
|
+
const r = `attachments.${n}`, o = v(e, r, t), a = o.type;
|
|
2505
1988
|
if (a === "dashboard") {
|
|
2506
|
-
|
|
1989
|
+
p(
|
|
2507
1990
|
o,
|
|
2508
1991
|
r,
|
|
2509
1992
|
["type", "dashboardId", "format", "title", "settings"],
|
|
2510
1993
|
t
|
|
2511
1994
|
);
|
|
2512
|
-
const i =
|
|
1995
|
+
const i = W(
|
|
2513
1996
|
{
|
|
2514
1997
|
type: "dashboard",
|
|
2515
|
-
dashboardId:
|
|
1998
|
+
dashboardId: b(
|
|
2516
1999
|
o.dashboardId,
|
|
2517
2000
|
`${r}.dashboardId`,
|
|
2518
|
-
|
|
2001
|
+
f.id,
|
|
2519
2002
|
t
|
|
2520
2003
|
),
|
|
2521
|
-
format:
|
|
2004
|
+
format: V(o.format, `${r}.format`, ["pdf"], t)
|
|
2522
2005
|
},
|
|
2523
2006
|
o.title,
|
|
2524
2007
|
`${r}.title`,
|
|
2525
2008
|
t
|
|
2526
2009
|
);
|
|
2527
|
-
return
|
|
2010
|
+
return X(i, o.settings, `${r}.settings`, t);
|
|
2528
2011
|
}
|
|
2529
2012
|
if (a === "dashboard_sheet" || a === "document_sheet") {
|
|
2530
|
-
|
|
2013
|
+
p(
|
|
2531
2014
|
o,
|
|
2532
2015
|
r,
|
|
2533
2016
|
["type", "dashboardId", "sheetId", "format", "title", "settings"],
|
|
2534
2017
|
t
|
|
2535
2018
|
);
|
|
2536
|
-
const i =
|
|
2019
|
+
const i = W(
|
|
2537
2020
|
{
|
|
2538
2021
|
type: a,
|
|
2539
|
-
dashboardId:
|
|
2022
|
+
dashboardId: b(
|
|
2540
2023
|
o.dashboardId,
|
|
2541
2024
|
`${r}.dashboardId`,
|
|
2542
|
-
|
|
2025
|
+
f.id,
|
|
2543
2026
|
t
|
|
2544
2027
|
),
|
|
2545
|
-
sheetId:
|
|
2028
|
+
sheetId: b(
|
|
2546
2029
|
o.sheetId,
|
|
2547
2030
|
`${r}.sheetId`,
|
|
2548
|
-
|
|
2031
|
+
f.id,
|
|
2549
2032
|
t
|
|
2550
2033
|
),
|
|
2551
|
-
format:
|
|
2034
|
+
format: V(o.format, `${r}.format`, ["pdf"], t)
|
|
2552
2035
|
},
|
|
2553
2036
|
o.title,
|
|
2554
2037
|
`${r}.title`,
|
|
2555
2038
|
t
|
|
2556
2039
|
);
|
|
2557
|
-
return
|
|
2040
|
+
return X(i, o.settings, `${r}.settings`, t);
|
|
2558
2041
|
}
|
|
2559
2042
|
if (a === "card") {
|
|
2560
|
-
|
|
2043
|
+
p(
|
|
2561
2044
|
o,
|
|
2562
2045
|
r,
|
|
2563
2046
|
["type", "dashboardId", "cardId", "format", "title", "settings"],
|
|
2564
2047
|
t
|
|
2565
2048
|
);
|
|
2566
|
-
const i =
|
|
2049
|
+
const i = W(
|
|
2567
2050
|
{
|
|
2568
2051
|
type: "card",
|
|
2569
|
-
dashboardId:
|
|
2052
|
+
dashboardId: b(
|
|
2570
2053
|
o.dashboardId,
|
|
2571
2054
|
`${r}.dashboardId`,
|
|
2572
|
-
|
|
2055
|
+
f.id,
|
|
2573
2056
|
t
|
|
2574
2057
|
),
|
|
2575
|
-
cardId:
|
|
2058
|
+
cardId: b(
|
|
2576
2059
|
o.cardId,
|
|
2577
2060
|
`${r}.cardId`,
|
|
2578
|
-
|
|
2061
|
+
f.id,
|
|
2579
2062
|
t
|
|
2580
2063
|
),
|
|
2581
|
-
format:
|
|
2064
|
+
format: V(
|
|
2582
2065
|
o.format,
|
|
2583
2066
|
`${r}.format`,
|
|
2584
|
-
["csv", "pdf"],
|
|
2067
|
+
["csv", "pdf", "xlsx"],
|
|
2585
2068
|
t
|
|
2586
2069
|
)
|
|
2587
2070
|
},
|
|
@@ -2589,7 +2072,7 @@ function Rn(e, n, t) {
|
|
|
2589
2072
|
`${r}.title`,
|
|
2590
2073
|
t
|
|
2591
2074
|
);
|
|
2592
|
-
return
|
|
2075
|
+
return X(i, o.settings, `${r}.settings`, t);
|
|
2593
2076
|
}
|
|
2594
2077
|
return d(
|
|
2595
2078
|
t,
|
|
@@ -2597,7 +2080,7 @@ function Rn(e, n, t) {
|
|
|
2597
2080
|
"Expected dashboard, dashboard_sheet, document_sheet, or card."
|
|
2598
2081
|
), { type: "dashboard", dashboardId: "", format: "pdf" };
|
|
2599
2082
|
}
|
|
2600
|
-
function
|
|
2083
|
+
function hn(e) {
|
|
2601
2084
|
switch (e.type) {
|
|
2602
2085
|
case "dashboard":
|
|
2603
2086
|
return `${e.type}:${e.dashboardId}:${e.format}`;
|
|
@@ -2608,35 +2091,35 @@ function On(e) {
|
|
|
2608
2091
|
return `${e.type}:${e.dashboardId}:${e.cardId}:${e.format}`;
|
|
2609
2092
|
}
|
|
2610
2093
|
}
|
|
2611
|
-
function
|
|
2094
|
+
function Te(e, n) {
|
|
2612
2095
|
if (e == null)
|
|
2613
2096
|
return [];
|
|
2614
2097
|
if (!Array.isArray(e))
|
|
2615
2098
|
return d(n, "attachments", "Expected an array."), [];
|
|
2616
|
-
e.length >
|
|
2099
|
+
e.length > H && d(
|
|
2617
2100
|
n,
|
|
2618
2101
|
"attachments",
|
|
2619
|
-
`Choose ${
|
|
2102
|
+
`Choose ${H} attachments or fewer.`
|
|
2620
2103
|
);
|
|
2621
|
-
const t = e.slice(0,
|
|
2104
|
+
const t = e.slice(0, H).map((o, a) => pn(o, a, n)), r = /* @__PURE__ */ new Set();
|
|
2622
2105
|
return t.forEach((o, a) => {
|
|
2623
|
-
var c;
|
|
2624
|
-
(c = o.settings) != null && c.matrix && (o.type !== "card" || o.settings.cardType !== "matrixTable" || o.settings.matrix.content === "flat" && o.format
|
|
2625
|
-
const i =
|
|
2106
|
+
var c, l, m;
|
|
2107
|
+
(c = o.settings) != null && c.matrix && (o.type !== "card" || o.settings.cardType !== "matrixTable" || o.settings.matrix.content === "flat" && o.format === "pdf") && d(n, `attachments.${a}.settings.matrix`, "Matrix settings require a matrixTable card attachment; flat content requires CSV or Excel."), o.format === "xlsx" && !((l = o.settings) != null && l.matrix) && !Q((m = o.settings) == null ? void 0 : m.cardType) && d(n, `attachments.${a}.format`, "Excel attachments require a Table, Detail Table or Matrix card.");
|
|
2108
|
+
const i = hn(o);
|
|
2626
2109
|
r.has(i) && d(n, `attachments.${a}`, "Duplicate attachment."), r.add(i);
|
|
2627
2110
|
}), t;
|
|
2628
2111
|
}
|
|
2629
|
-
function
|
|
2112
|
+
function Se(e, n) {
|
|
2630
2113
|
if (e == null)
|
|
2631
2114
|
return;
|
|
2632
|
-
const t =
|
|
2633
|
-
|
|
2115
|
+
const t = v(e, "limits", n);
|
|
2116
|
+
p(t, "limits", Object.keys(G), n);
|
|
2634
2117
|
const r = {};
|
|
2635
|
-
return Object.keys(
|
|
2118
|
+
return Object.keys(G).forEach((o) => {
|
|
2636
2119
|
const a = t[o];
|
|
2637
2120
|
if (a == null)
|
|
2638
2121
|
return;
|
|
2639
|
-
const i =
|
|
2122
|
+
const i = G[o];
|
|
2640
2123
|
if (typeof a != "number" || !Number.isInteger(a) || a < i.min || a > i.max) {
|
|
2641
2124
|
d(
|
|
2642
2125
|
n,
|
|
@@ -2648,42 +2131,42 @@ function Be(e, n) {
|
|
|
2648
2131
|
r[o] = a;
|
|
2649
2132
|
}), Object.keys(r).length > 0 ? r : void 0;
|
|
2650
2133
|
}
|
|
2651
|
-
function
|
|
2134
|
+
function te(e) {
|
|
2652
2135
|
if (e.length > 0)
|
|
2653
|
-
throw new
|
|
2136
|
+
throw new j(e);
|
|
2654
2137
|
}
|
|
2655
|
-
function
|
|
2138
|
+
function ke(e, n, t) {
|
|
2656
2139
|
!(e.type === "generated_analysis" || e.type === "custom_message" && !!e.message.trim()) && n.length === 0 && d(
|
|
2657
2140
|
t,
|
|
2658
2141
|
"body",
|
|
2659
2142
|
"Add briefing instructions, a custom message, or at least one attachment."
|
|
2660
2143
|
);
|
|
2661
2144
|
}
|
|
2662
|
-
function
|
|
2145
|
+
function yn(e, n, t) {
|
|
2663
2146
|
e == null || e.forEach((r, o) => {
|
|
2664
2147
|
const a = `${t}.${o}.scope`, i = r.scope.attachmentIndex;
|
|
2665
2148
|
if (i === void 0)
|
|
2666
|
-
throw new
|
|
2149
|
+
throw new B(
|
|
2667
2150
|
`${a}.attachmentIndex must identify the attachment that owns this presentation entry.`
|
|
2668
2151
|
);
|
|
2669
2152
|
const c = n[i];
|
|
2670
2153
|
if (!c)
|
|
2671
|
-
throw new
|
|
2154
|
+
throw new B(
|
|
2672
2155
|
`${a}.attachmentIndex must identify an existing attachment.`
|
|
2673
2156
|
);
|
|
2674
2157
|
if (r.scope.dashboardId !== c.dashboardId)
|
|
2675
|
-
throw new
|
|
2158
|
+
throw new B(
|
|
2676
2159
|
`${a}.dashboardId must match the dashboard selected by the referenced attachment.`
|
|
2677
2160
|
);
|
|
2678
2161
|
if (c.type === "card" && r.scope.cardId !== c.cardId)
|
|
2679
|
-
throw new
|
|
2162
|
+
throw new B(
|
|
2680
2163
|
`${a}.cardId must match the card selected by the referenced attachment.`
|
|
2681
2164
|
);
|
|
2682
2165
|
});
|
|
2683
2166
|
}
|
|
2684
|
-
function
|
|
2685
|
-
const n = [], t =
|
|
2686
|
-
|
|
2167
|
+
function Ae(e) {
|
|
2168
|
+
const n = [], t = v(e, "jobConfig", n);
|
|
2169
|
+
p(
|
|
2687
2170
|
t,
|
|
2688
2171
|
"jobConfig",
|
|
2689
2172
|
[
|
|
@@ -2696,28 +2179,28 @@ function Pe(e) {
|
|
|
2696
2179
|
"limits"
|
|
2697
2180
|
],
|
|
2698
2181
|
n
|
|
2699
|
-
), t.kind !==
|
|
2182
|
+
), t.kind !== Z && d(n, "kind", "Expected BRIEFING.");
|
|
2700
2183
|
let r;
|
|
2701
2184
|
try {
|
|
2702
|
-
r =
|
|
2185
|
+
r = Pe(
|
|
2703
2186
|
t.presentationExecutionSnapshot
|
|
2704
2187
|
);
|
|
2705
|
-
} catch (
|
|
2706
|
-
if (
|
|
2707
|
-
throw
|
|
2188
|
+
} catch (m) {
|
|
2189
|
+
if (m instanceof B)
|
|
2190
|
+
throw m;
|
|
2708
2191
|
d(
|
|
2709
2192
|
n,
|
|
2710
2193
|
"jobConfig.presentationExecutionSnapshot",
|
|
2711
|
-
|
|
2194
|
+
m instanceof Error ? m.message : "Invalid presentation snapshot."
|
|
2712
2195
|
);
|
|
2713
2196
|
}
|
|
2714
|
-
const o =
|
|
2715
|
-
return
|
|
2197
|
+
const o = Ee(t.source, n), a = $e(t.body, n), i = Te(t.attachments, n), c = Ce(t.presentation, n), l = Se(t.limits, n);
|
|
2198
|
+
return ke(a, i, n), yn(
|
|
2716
2199
|
r == null ? void 0 : r.resolvedFormats,
|
|
2717
2200
|
i,
|
|
2718
2201
|
"jobConfig.presentationExecutionSnapshot.resolvedFormats"
|
|
2719
|
-
),
|
|
2720
|
-
kind:
|
|
2202
|
+
), te(n), {
|
|
2203
|
+
kind: Z,
|
|
2721
2204
|
presentationExecutionSnapshot: r,
|
|
2722
2205
|
source: o,
|
|
2723
2206
|
body: a,
|
|
@@ -2726,55 +2209,55 @@ function Pe(e) {
|
|
|
2726
2209
|
...l ? { limits: l } : {}
|
|
2727
2210
|
};
|
|
2728
2211
|
}
|
|
2729
|
-
function
|
|
2730
|
-
return
|
|
2212
|
+
function ir(e) {
|
|
2213
|
+
return Ae({
|
|
2731
2214
|
...e,
|
|
2732
|
-
kind:
|
|
2215
|
+
kind: Z
|
|
2733
2216
|
});
|
|
2734
2217
|
}
|
|
2735
|
-
function
|
|
2736
|
-
const o = `${r}.${n}`, a =
|
|
2218
|
+
function ne(e, n, t, r = "deliveryConfig.recipients") {
|
|
2219
|
+
const o = `${r}.${n}`, a = v(e, o, t), i = a.type;
|
|
2737
2220
|
if (i === "email") {
|
|
2738
|
-
|
|
2739
|
-
const c =
|
|
2221
|
+
p(a, o, ["type", "address", "name"], t);
|
|
2222
|
+
const c = b(
|
|
2740
2223
|
a.address,
|
|
2741
2224
|
`${o}.address`,
|
|
2742
|
-
|
|
2225
|
+
f.id,
|
|
2743
2226
|
t
|
|
2744
|
-
), l =
|
|
2227
|
+
), l = I(
|
|
2745
2228
|
a.name,
|
|
2746
2229
|
`${o}.name`,
|
|
2747
|
-
|
|
2230
|
+
f.attachmentTitle,
|
|
2748
2231
|
t
|
|
2749
2232
|
);
|
|
2750
|
-
return c && !
|
|
2233
|
+
return c && !tn(c) && d(t, `${o}.address`, "Email address is invalid."), {
|
|
2751
2234
|
type: "email",
|
|
2752
2235
|
address: c,
|
|
2753
2236
|
...l ? { name: l } : {}
|
|
2754
2237
|
};
|
|
2755
2238
|
}
|
|
2756
|
-
return i === "user" ? (
|
|
2239
|
+
return i === "user" ? (p(a, o, ["type", "userId"], t), {
|
|
2757
2240
|
type: "user",
|
|
2758
|
-
userId:
|
|
2241
|
+
userId: b(
|
|
2759
2242
|
a.userId,
|
|
2760
2243
|
`${o}.userId`,
|
|
2761
|
-
|
|
2244
|
+
f.id,
|
|
2762
2245
|
t
|
|
2763
2246
|
)
|
|
2764
|
-
}) : i === "tenant_user" ? (
|
|
2247
|
+
}) : i === "tenant_user" ? (p(a, o, ["type", "tenantUserId"], t), {
|
|
2765
2248
|
type: "tenant_user",
|
|
2766
|
-
tenantUserId:
|
|
2249
|
+
tenantUserId: b(
|
|
2767
2250
|
a.tenantUserId,
|
|
2768
2251
|
`${o}.tenantUserId`,
|
|
2769
|
-
|
|
2252
|
+
f.id,
|
|
2770
2253
|
t
|
|
2771
2254
|
)
|
|
2772
|
-
}) : i === "group" ? (
|
|
2255
|
+
}) : i === "group" ? (p(a, o, ["type", "groupId"], t), {
|
|
2773
2256
|
type: "group",
|
|
2774
|
-
groupId:
|
|
2257
|
+
groupId: b(
|
|
2775
2258
|
a.groupId,
|
|
2776
2259
|
`${o}.groupId`,
|
|
2777
|
-
|
|
2260
|
+
f.id,
|
|
2778
2261
|
t
|
|
2779
2262
|
)
|
|
2780
2263
|
}) : (d(
|
|
@@ -2783,17 +2266,17 @@ function se(e, n, t, r = "deliveryConfig.recipients") {
|
|
|
2783
2266
|
"Expected email, user, tenant_user, or group."
|
|
2784
2267
|
), { type: "email", address: "" });
|
|
2785
2268
|
}
|
|
2786
|
-
function
|
|
2269
|
+
function gn(e, n) {
|
|
2787
2270
|
return e == null ? [] : Array.isArray(e) ? e.map(
|
|
2788
|
-
(t, r) =>
|
|
2271
|
+
(t, r) => ne(t, r, n)
|
|
2789
2272
|
) : (d(n, "deliveryConfig.recipients", "Expected an array."), []);
|
|
2790
2273
|
}
|
|
2791
|
-
function
|
|
2274
|
+
function bn(e, n) {
|
|
2792
2275
|
if (!Array.isArray(e))
|
|
2793
2276
|
return d(n, "deliveryConfig.channels", "Expected an array."), [];
|
|
2794
2277
|
const t = [];
|
|
2795
2278
|
return e.forEach((r, o) => {
|
|
2796
|
-
if (!
|
|
2279
|
+
if (!we(r)) {
|
|
2797
2280
|
d(
|
|
2798
2281
|
n,
|
|
2799
2282
|
`deliveryConfig.channels.${o}`,
|
|
@@ -2804,10 +2287,10 @@ function Bn(e, n) {
|
|
|
2804
2287
|
t.includes(r) || t.push(r);
|
|
2805
2288
|
}), t;
|
|
2806
2289
|
}
|
|
2807
|
-
function
|
|
2290
|
+
function In(e, n, t) {
|
|
2808
2291
|
if (e == null)
|
|
2809
2292
|
return;
|
|
2810
|
-
const r =
|
|
2293
|
+
const r = v(e, n, t), o = {};
|
|
2811
2294
|
return Object.entries(r).forEach(([a, i]) => {
|
|
2812
2295
|
if (typeof i != "string") {
|
|
2813
2296
|
d(t, `${n}.${a}`, "Expected a string.");
|
|
@@ -2816,44 +2299,44 @@ function Ln(e, n, t) {
|
|
|
2816
2299
|
o[a] = i.trim();
|
|
2817
2300
|
}), Object.keys(o).length > 0 ? o : void 0;
|
|
2818
2301
|
}
|
|
2819
|
-
function
|
|
2302
|
+
function vn(e, n, t) {
|
|
2820
2303
|
if (e == null)
|
|
2821
2304
|
return;
|
|
2822
|
-
const r =
|
|
2823
|
-
|
|
2305
|
+
const r = v(e, n, t);
|
|
2306
|
+
p(
|
|
2824
2307
|
r,
|
|
2825
2308
|
n,
|
|
2826
2309
|
["url", "method", "headers", "secretEncrypted"],
|
|
2827
2310
|
t
|
|
2828
2311
|
);
|
|
2829
|
-
const o = r.method === void 0 || r.method === null ? void 0 :
|
|
2312
|
+
const o = r.method === void 0 || r.method === null ? void 0 : V(r.method, `${n}.method`, ["POST", "PUT"], t), a = In(r.headers, `${n}.headers`, t), i = I(
|
|
2830
2313
|
r.secretEncrypted,
|
|
2831
2314
|
`${n}.secretEncrypted`,
|
|
2832
2315
|
2e3,
|
|
2833
2316
|
t
|
|
2834
2317
|
);
|
|
2835
2318
|
return {
|
|
2836
|
-
url:
|
|
2319
|
+
url: b(r.url, `${n}.url`, 2e3, t),
|
|
2837
2320
|
...o ? { method: o } : {},
|
|
2838
2321
|
...a ? { headers: a } : {},
|
|
2839
2322
|
...i ? { secretEncrypted: i } : {}
|
|
2840
2323
|
};
|
|
2841
2324
|
}
|
|
2842
|
-
function
|
|
2843
|
-
const r =
|
|
2325
|
+
function En(e, n, t) {
|
|
2326
|
+
const r = v(e, n, t), o = r.type;
|
|
2844
2327
|
if (o === "channel") {
|
|
2845
|
-
|
|
2328
|
+
p(
|
|
2846
2329
|
r,
|
|
2847
2330
|
n,
|
|
2848
2331
|
["type", "channelId", "channelName", "isPrivate"],
|
|
2849
2332
|
t
|
|
2850
2333
|
);
|
|
2851
|
-
const a =
|
|
2334
|
+
const a = I(
|
|
2852
2335
|
r.channelName,
|
|
2853
2336
|
`${n}.channelName`,
|
|
2854
|
-
|
|
2337
|
+
f.attachmentTitle,
|
|
2855
2338
|
t
|
|
2856
|
-
), i = r.isPrivate === void 0 || r.isPrivate === null ? void 0 :
|
|
2339
|
+
), i = r.isPrivate === void 0 || r.isPrivate === null ? void 0 : N(
|
|
2857
2340
|
r.isPrivate,
|
|
2858
2341
|
!1,
|
|
2859
2342
|
`${n}.isPrivate`,
|
|
@@ -2861,26 +2344,26 @@ function zn(e, n, t) {
|
|
|
2861
2344
|
);
|
|
2862
2345
|
return {
|
|
2863
2346
|
type: "channel",
|
|
2864
|
-
channelId:
|
|
2347
|
+
channelId: b(
|
|
2865
2348
|
r.channelId,
|
|
2866
2349
|
`${n}.channelId`,
|
|
2867
|
-
|
|
2350
|
+
f.id,
|
|
2868
2351
|
t
|
|
2869
2352
|
),
|
|
2870
2353
|
...a ? { channelName: a } : {},
|
|
2871
2354
|
...i !== void 0 ? { isPrivate: i } : {}
|
|
2872
2355
|
};
|
|
2873
2356
|
}
|
|
2874
|
-
return o === "dm" ? (
|
|
2357
|
+
return o === "dm" ? (p(r, n, ["type", "recipient"], t), d(
|
|
2875
2358
|
t,
|
|
2876
2359
|
`${n}.type`,
|
|
2877
2360
|
"Slack DM delivery is not supported in V1."
|
|
2878
2361
|
), {
|
|
2879
2362
|
type: "dm",
|
|
2880
|
-
recipient:
|
|
2363
|
+
recipient: ne(r.recipient, 0, t, `${n}.recipient`)
|
|
2881
2364
|
}) : (d(t, `${n}.type`, "Expected channel."), { type: "channel", channelId: "" });
|
|
2882
2365
|
}
|
|
2883
|
-
function
|
|
2366
|
+
function $n(e, n, t) {
|
|
2884
2367
|
if (e == null)
|
|
2885
2368
|
return;
|
|
2886
2369
|
if (!Array.isArray(e)) {
|
|
@@ -2888,15 +2371,15 @@ function Kn(e, n, t) {
|
|
|
2888
2371
|
return;
|
|
2889
2372
|
}
|
|
2890
2373
|
const r = e.map(
|
|
2891
|
-
(o, a) =>
|
|
2374
|
+
(o, a) => ne(o, a, t, n)
|
|
2892
2375
|
);
|
|
2893
2376
|
return r.length > 0 ? r : void 0;
|
|
2894
2377
|
}
|
|
2895
|
-
function
|
|
2378
|
+
function Cn(e, n, t) {
|
|
2896
2379
|
if (e == null)
|
|
2897
2380
|
return;
|
|
2898
|
-
const r =
|
|
2899
|
-
|
|
2381
|
+
const r = v(e, n, t);
|
|
2382
|
+
p(
|
|
2900
2383
|
r,
|
|
2901
2384
|
n,
|
|
2902
2385
|
[
|
|
@@ -2908,28 +2391,28 @@ function Un(e, n, t) {
|
|
|
2908
2391
|
],
|
|
2909
2392
|
t
|
|
2910
2393
|
);
|
|
2911
|
-
const o =
|
|
2394
|
+
const o = $n(
|
|
2912
2395
|
r.threadMentions,
|
|
2913
2396
|
`${n}.threadMentions`,
|
|
2914
2397
|
t
|
|
2915
|
-
), a =
|
|
2398
|
+
), a = N(
|
|
2916
2399
|
r.postThreadDetail,
|
|
2917
2400
|
!0,
|
|
2918
2401
|
`${n}.postThreadDetail`,
|
|
2919
2402
|
t
|
|
2920
|
-
), i =
|
|
2403
|
+
), i = N(
|
|
2921
2404
|
r.includeDashboardLink,
|
|
2922
2405
|
!0,
|
|
2923
2406
|
`${n}.includeDashboardLink`,
|
|
2924
2407
|
t
|
|
2925
|
-
), c =
|
|
2408
|
+
), c = N(
|
|
2926
2409
|
r.includeBriefingLink,
|
|
2927
2410
|
!0,
|
|
2928
2411
|
`${n}.includeBriefingLink`,
|
|
2929
2412
|
t
|
|
2930
2413
|
);
|
|
2931
2414
|
return {
|
|
2932
|
-
destination:
|
|
2415
|
+
destination: En(
|
|
2933
2416
|
r.destination,
|
|
2934
2417
|
`${n}.destination`,
|
|
2935
2418
|
t
|
|
@@ -2940,9 +2423,9 @@ function Un(e, n, t) {
|
|
|
2940
2423
|
...r.includeBriefingLink !== void 0 ? { includeBriefingLink: c } : {}
|
|
2941
2424
|
};
|
|
2942
2425
|
}
|
|
2943
|
-
function
|
|
2944
|
-
const r =
|
|
2945
|
-
|
|
2426
|
+
function xn(e, n, t) {
|
|
2427
|
+
const r = v(e, n, t);
|
|
2428
|
+
p(
|
|
2946
2429
|
r,
|
|
2947
2430
|
n,
|
|
2948
2431
|
[
|
|
@@ -2956,37 +2439,37 @@ function Vn(e, n, t) {
|
|
|
2956
2439
|
],
|
|
2957
2440
|
t
|
|
2958
2441
|
);
|
|
2959
|
-
const o =
|
|
2442
|
+
const o = D(
|
|
2960
2443
|
r.formatProfile,
|
|
2961
2444
|
`${n}.formatProfile`,
|
|
2962
|
-
|
|
2445
|
+
Gt,
|
|
2963
2446
|
"concise, balanced, or detailed",
|
|
2964
2447
|
t
|
|
2965
|
-
), a =
|
|
2448
|
+
), a = I(
|
|
2966
2449
|
r.subjectOverride,
|
|
2967
2450
|
`${n}.subjectOverride`,
|
|
2968
2451
|
500,
|
|
2969
2452
|
t
|
|
2970
|
-
), i =
|
|
2453
|
+
), i = I(
|
|
2971
2454
|
r.titleOverride,
|
|
2972
2455
|
`${n}.titleOverride`,
|
|
2973
2456
|
500,
|
|
2974
2457
|
t
|
|
2975
|
-
), c =
|
|
2458
|
+
), c = I(
|
|
2976
2459
|
r.summaryOverride,
|
|
2977
2460
|
`${n}.summaryOverride`,
|
|
2978
2461
|
2e3,
|
|
2979
2462
|
t
|
|
2980
|
-
), l =
|
|
2463
|
+
), l = N(
|
|
2981
2464
|
r.actionBlockVisible,
|
|
2982
2465
|
!0,
|
|
2983
2466
|
`${n}.actionBlockVisible`,
|
|
2984
2467
|
t
|
|
2985
|
-
),
|
|
2468
|
+
), m = vn(
|
|
2986
2469
|
r.webhookConfig,
|
|
2987
2470
|
`${n}.webhookConfig`,
|
|
2988
2471
|
t
|
|
2989
|
-
),
|
|
2472
|
+
), s = Cn(
|
|
2990
2473
|
r.slackConfig,
|
|
2991
2474
|
`${n}.slackConfig`,
|
|
2992
2475
|
t
|
|
@@ -2997,16 +2480,16 @@ function Vn(e, n, t) {
|
|
|
2997
2480
|
...i ? { titleOverride: i } : {},
|
|
2998
2481
|
...c ? { summaryOverride: c } : {},
|
|
2999
2482
|
...r.actionBlockVisible !== void 0 ? { actionBlockVisible: l } : {},
|
|
3000
|
-
...
|
|
3001
|
-
...
|
|
2483
|
+
...s ? { slackConfig: s } : {},
|
|
2484
|
+
...m ? { webhookConfig: m } : {}
|
|
3002
2485
|
};
|
|
3003
2486
|
}
|
|
3004
|
-
function
|
|
2487
|
+
function Tn(e, n) {
|
|
3005
2488
|
if (e == null)
|
|
3006
2489
|
return;
|
|
3007
|
-
const t =
|
|
2490
|
+
const t = v(e, "deliveryConfig.channelConfigs", n), r = {};
|
|
3008
2491
|
return Object.entries(t).forEach(([o, a]) => {
|
|
3009
|
-
if (!
|
|
2492
|
+
if (!we(o)) {
|
|
3010
2493
|
d(
|
|
3011
2494
|
n,
|
|
3012
2495
|
`deliveryConfig.channelConfigs.${o}`,
|
|
@@ -3014,27 +2497,27 @@ function qn(e, n) {
|
|
|
3014
2497
|
);
|
|
3015
2498
|
return;
|
|
3016
2499
|
}
|
|
3017
|
-
r[o] =
|
|
2500
|
+
r[o] = xn(
|
|
3018
2501
|
a,
|
|
3019
2502
|
`deliveryConfig.channelConfigs.${o}`,
|
|
3020
2503
|
n
|
|
3021
2504
|
);
|
|
3022
2505
|
}), Object.keys(r).length > 0 ? r : void 0;
|
|
3023
2506
|
}
|
|
3024
|
-
function
|
|
3025
|
-
var l,
|
|
2507
|
+
function Sn(e, n) {
|
|
2508
|
+
var l, m, s;
|
|
3026
2509
|
if (e == null)
|
|
3027
2510
|
return null;
|
|
3028
|
-
const t =
|
|
3029
|
-
|
|
2511
|
+
const t = v(e, "deliveryConfig", n);
|
|
2512
|
+
p(
|
|
3030
2513
|
t,
|
|
3031
2514
|
"deliveryConfig",
|
|
3032
2515
|
["recipients", "channels", "channelConfigs"],
|
|
3033
2516
|
n
|
|
3034
2517
|
);
|
|
3035
|
-
const r =
|
|
2518
|
+
const r = Tn(t.channelConfigs, n), o = gn(t.recipients, n), a = bn(t.channels, n), i = ((m = (l = r == null ? void 0 : r.SLACK) == null ? void 0 : l.slackConfig) == null ? void 0 : m.destination.type) === "channel" && !!r.SLACK.slackConfig.destination.channelId.trim();
|
|
3036
2519
|
return a.some(
|
|
3037
|
-
(
|
|
2520
|
+
(u) => u !== "SLACK"
|
|
3038
2521
|
) && o.length === 0 && d(
|
|
3039
2522
|
n,
|
|
3040
2523
|
"deliveryConfig.recipients",
|
|
@@ -3047,7 +2530,7 @@ function jn(e, n) {
|
|
|
3047
2530
|
n,
|
|
3048
2531
|
"deliveryConfig.channelConfigs.SLACK.slackConfig.destination.channelId",
|
|
3049
2532
|
"Choose a Slack channel destination."
|
|
3050
|
-
), !a.includes("SLACK") && ((
|
|
2533
|
+
), !a.includes("SLACK") && ((s = r == null ? void 0 : r.SLACK) != null && s.slackConfig) && d(
|
|
3051
2534
|
n,
|
|
3052
2535
|
"deliveryConfig.channelConfigs.SLACK",
|
|
3053
2536
|
"Slack config requires SLACK in deliveryConfig.channels."
|
|
@@ -3057,9 +2540,9 @@ function jn(e, n) {
|
|
|
3057
2540
|
...r ? { channelConfigs: r } : {}
|
|
3058
2541
|
};
|
|
3059
2542
|
}
|
|
3060
|
-
function
|
|
3061
|
-
const n = [], t =
|
|
3062
|
-
|
|
2543
|
+
function re(e) {
|
|
2544
|
+
const n = [], t = v(e, "draft", n);
|
|
2545
|
+
p(
|
|
3063
2546
|
t,
|
|
3064
2547
|
"draft",
|
|
3065
2548
|
[
|
|
@@ -3077,124 +2560,114 @@ function de(e) {
|
|
|
3077
2560
|
],
|
|
3078
2561
|
n
|
|
3079
2562
|
);
|
|
3080
|
-
const r =
|
|
2563
|
+
const r = b(
|
|
3081
2564
|
t.name,
|
|
3082
2565
|
"name",
|
|
3083
|
-
|
|
2566
|
+
f.name,
|
|
3084
2567
|
n
|
|
3085
|
-
), o =
|
|
2568
|
+
), o = I(
|
|
3086
2569
|
t.description,
|
|
3087
2570
|
"description",
|
|
3088
|
-
|
|
2571
|
+
f.description,
|
|
3089
2572
|
n
|
|
3090
|
-
) ?? null, a =
|
|
3091
|
-
return
|
|
2573
|
+
) ?? null, a = I(t.scheduleExpr, "scheduleExpr", 500, n) ?? null, i = I(t.timezone, "timezone", 200, n) ?? "UTC", c = en(t.status, n), l = Ee(t.source, n), m = $e(t.body, n), s = Te(t.attachments, n), u = Ce(t.presentation, n), h = Se(t.limits, n), g = Sn(t.deliveryConfig, n);
|
|
2574
|
+
return ke(m, s, n), te(n), {
|
|
3092
2575
|
name: r,
|
|
3093
2576
|
description: o,
|
|
3094
2577
|
status: c,
|
|
3095
2578
|
scheduleExpr: a,
|
|
3096
2579
|
timezone: i,
|
|
3097
2580
|
source: l,
|
|
3098
|
-
body:
|
|
3099
|
-
attachments:
|
|
3100
|
-
presentation:
|
|
3101
|
-
...
|
|
3102
|
-
deliveryConfig:
|
|
2581
|
+
body: m,
|
|
2582
|
+
attachments: s,
|
|
2583
|
+
presentation: u,
|
|
2584
|
+
...h ? { limits: h } : {},
|
|
2585
|
+
deliveryConfig: g
|
|
3103
2586
|
};
|
|
3104
2587
|
}
|
|
3105
|
-
function
|
|
3106
|
-
return
|
|
2588
|
+
function cr(e) {
|
|
2589
|
+
return re(e);
|
|
3107
2590
|
}
|
|
3108
|
-
function
|
|
3109
|
-
return
|
|
2591
|
+
function lr(e) {
|
|
2592
|
+
return re(e);
|
|
3110
2593
|
}
|
|
3111
|
-
function
|
|
2594
|
+
function dr(e) {
|
|
3112
2595
|
try {
|
|
3113
|
-
return { valid: !0, value:
|
|
2596
|
+
return { valid: !0, value: re(e), issues: [] };
|
|
3114
2597
|
} catch (n) {
|
|
3115
|
-
if (n instanceof
|
|
2598
|
+
if (n instanceof j)
|
|
3116
2599
|
return { valid: !1, issues: n.issues };
|
|
3117
2600
|
throw n;
|
|
3118
2601
|
}
|
|
3119
2602
|
}
|
|
3120
|
-
function
|
|
2603
|
+
function sr(e) {
|
|
3121
2604
|
try {
|
|
3122
|
-
return { valid: !0, value:
|
|
2605
|
+
return { valid: !0, value: Ae(e), issues: [] };
|
|
3123
2606
|
} catch (n) {
|
|
3124
|
-
if (n instanceof
|
|
2607
|
+
if (n instanceof j)
|
|
3125
2608
|
return { valid: !1, issues: n.issues };
|
|
3126
2609
|
throw n;
|
|
3127
2610
|
}
|
|
3128
2611
|
}
|
|
3129
|
-
function
|
|
3130
|
-
return typeof e == "string" &&
|
|
2612
|
+
function mr(e) {
|
|
2613
|
+
return typeof e == "string" && Ie.has(e);
|
|
3131
2614
|
}
|
|
3132
|
-
function
|
|
3133
|
-
return typeof e == "string" &&
|
|
2615
|
+
function we(e) {
|
|
2616
|
+
return typeof e == "string" && Vt.has(e);
|
|
3134
2617
|
}
|
|
3135
2618
|
export {
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
sr as q,
|
|
3191
|
-
_t as r,
|
|
3192
|
-
Lt as s,
|
|
3193
|
-
ke as t,
|
|
3194
|
-
Er as u,
|
|
3195
|
-
yr as v,
|
|
3196
|
-
L as w,
|
|
3197
|
-
xr as x,
|
|
3198
|
-
Wt as y,
|
|
3199
|
-
Sr as z
|
|
2619
|
+
Mt as $,
|
|
2620
|
+
f as A,
|
|
2621
|
+
Z as B,
|
|
2622
|
+
C,
|
|
2623
|
+
Xn as D,
|
|
2624
|
+
Ut as E,
|
|
2625
|
+
Pt as F,
|
|
2626
|
+
or as G,
|
|
2627
|
+
j as H,
|
|
2628
|
+
sn as I,
|
|
2629
|
+
ar as J,
|
|
2630
|
+
Ae as K,
|
|
2631
|
+
ir as L,
|
|
2632
|
+
H as M,
|
|
2633
|
+
re as N,
|
|
2634
|
+
cr as O,
|
|
2635
|
+
lr as P,
|
|
2636
|
+
dr as Q,
|
|
2637
|
+
sr as R,
|
|
2638
|
+
mr as S,
|
|
2639
|
+
we as T,
|
|
2640
|
+
qn as U,
|
|
2641
|
+
st as V,
|
|
2642
|
+
Vn as W,
|
|
2643
|
+
dt as X,
|
|
2644
|
+
Q as Y,
|
|
2645
|
+
Ot as Z,
|
|
2646
|
+
Nt as _,
|
|
2647
|
+
nr as a,
|
|
2648
|
+
lt as b,
|
|
2649
|
+
jn as c,
|
|
2650
|
+
Yn as d,
|
|
2651
|
+
Kn as e,
|
|
2652
|
+
Wn as f,
|
|
2653
|
+
rr as g,
|
|
2654
|
+
Pn as h,
|
|
2655
|
+
zn as i,
|
|
2656
|
+
It as j,
|
|
2657
|
+
Zn as k,
|
|
2658
|
+
R as l,
|
|
2659
|
+
Jn as m,
|
|
2660
|
+
wt as n,
|
|
2661
|
+
Qn as o,
|
|
2662
|
+
ge as p,
|
|
2663
|
+
he as q,
|
|
2664
|
+
Bt as r,
|
|
2665
|
+
er as s,
|
|
2666
|
+
tr as t,
|
|
2667
|
+
mt as u,
|
|
2668
|
+
se as v,
|
|
2669
|
+
Gn as w,
|
|
2670
|
+
Hn as x,
|
|
2671
|
+
Lt as y,
|
|
2672
|
+
Y as z
|
|
3200
2673
|
};
|