react-semaphor 0.1.582 → 0.1.584
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 +183 -178
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +7 -7
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/aggregate-measure-field-DsFXETpI.js +22 -0
- package/dist/chunks/{assistant-chat-CVtxjVEH.js → assistant-chat-nmycV1Se.js} +12 -12
- package/dist/chunks/{bookmark-impact-BDSeeRy7.js → bookmark-impact-CI3gmxi0.js} +2 -2
- package/dist/chunks/{bookmark-state-BEl_G9vr.js → bookmark-state-D9-RFkDg.js} +22 -22
- package/dist/chunks/{card-filter-builder-CMZ5nwdC.js → card-filter-builder-C7QyPqRy.js} +145 -145
- package/dist/chunks/{comparison-window-caption-sRFtnX1q.js → comparison-window-caption-BAnsTI8y.js} +291 -305
- package/dist/chunks/{dashboard-briefing-launcher-C9wf8KhD.js → dashboard-briefing-launcher-DXs0XA1O.js} +13 -13
- package/dist/chunks/{dashboard-controls-PDb9Gap5.js → dashboard-controls-6Zoo8d8Y.js} +84 -84
- package/dist/chunks/{dashboard-BNn7fpDY.js → dashboard-inJy_V78.js} +1 -1
- package/dist/chunks/{dashboard-json-CvtVy2UH.js → dashboard-json-D5eJhVA9.js} +4 -4
- package/dist/chunks/{dates-B42fboJU.js → dates-B3_GWc_Y.js} +8 -8
- package/dist/chunks/{edit-dashboard-visual-Cat0RWPp.js → edit-dashboard-visual-DR03SYeW.js} +17 -17
- package/dist/chunks/{filter-reach-copy-C-RH1rVx.js → filter-reach-copy-CZwzrxBp.js} +1403 -1240
- package/dist/chunks/{filter-value-text-DXGYypEd.js → filter-value-text-DtOvqcjn.js} +8 -8
- package/dist/chunks/{index-JWLo4R_t.js → index-BgT1L0p5.js} +5 -5
- package/dist/chunks/{layout-grid-8rR-LPTk.js → layout-grid-9nSS2SL-.js} +1 -1
- package/dist/chunks/{list-filter-C1-uTgjR.js → list-filter-CfMPI6v4.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-dkS8szLM.js → matrix-analytical-definition-Cs2v43FM.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-DRa-9e6Q.js → matrix-member-presentation-BKDyxJho.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-DCVinw1o.js → matrix-operation-contract-BM5TveR3.js} +153 -147
- package/dist/chunks/{metric-comparison-n9NsIa-2.js → metric-comparison-Be4uS3Ql.js} +1 -1
- package/dist/chunks/{paintbrush-aR17Z3C9.js → paintbrush-LzAje2ff.js} +1 -1
- package/dist/chunks/{palette-a5FCZKFI.js → palette-DicJG0TC.js} +1 -1
- package/dist/chunks/{pivot-header-presentation-MvvlxtIB.js → pivot-header-presentation-uH06jiZD.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-8tuNjRvG.js → pivot-result-contract-expectations-DvZY4eJM.js} +779 -765
- package/dist/chunks/{pivot-result-identity-B89X5xjb.js → pivot-result-identity-BZexMfmL.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-CwbsD6t6.js → report-preferences-dialog-DWeVe2so.js} +171 -170
- package/dist/chunks/{report-runtime-context-BhPzLTbS.js → report-runtime-context-NlOXwyRB.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-6FP1-7aU.js → resolve-dashboard-input-context-uATCuOP7.js} +5083 -4973
- package/dist/chunks/{save-D985VvYp.js → save-0wu1Z1U7.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-D2G0uLji.js → saved-dashboard-context-DSVV9iqW.js} +6 -6
- package/dist/chunks/selection-filter-compiler-BReJy-uv.js +92 -0
- package/dist/chunks/{semaphor-ready-indicator-UhNS27Gy.js → semaphor-ready-indicator-B9vvRMnJ.js} +46773 -45614
- package/dist/chunks/{shelf-drop-preview-context-DPksW68k.js → shelf-drop-preview-context-BHOnp5Bo.js} +5 -5
- package/dist/chunks/{stored-dashboard-KpTy4umJ.js → stored-dashboard-xc5iidHL.js} +210 -221
- package/dist/chunks/{style-sheet-parts-C7qGZuH1.js → style-sheet-parts-_dGSFzDi.js} +2 -2
- package/dist/chunks/{table-export-sheet-wBkk17aa.js → table-export-sheet-Cv_94obr.js} +1 -1
- package/dist/chunks/{token-types-iKMplaBL.js → token-types-DEe_FP4l.js} +1 -1
- package/dist/chunks/{upload-CiGNKJ_0.js → upload-CtyOkU_B.js} +1 -1
- package/dist/chunks/{validators-B8fpdinG.js → validators-CJ8Jh0E8.js} +2 -2
- package/dist/chunks/{variable-draft-CP5I66_J.js → variable-draft-C3CjhsJQ.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1391 -1364
- package/dist/format-utils/index.js +140 -140
- package/dist/index.js +234 -231
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/ui-custom/date-range-presets.d.ts +7 -0
- package/dist/types/components/visual/data-table/types/data-table.d.ts +3 -0
- package/dist/types/components/visual/matrix-table/matrix-interaction-actions.d.ts +24 -3
- package/dist/types/index.js +5 -5
- package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +9 -0
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +8 -3
- package/dist/types/lib/query-context/compile-selection-filters.d.ts +1 -5
- package/dist/types/lib/see-records/click.d.ts +79 -0
- package/dist/types/lib/see-records/see-records-offer.d.ts +25 -0
- package/dist/types/lib/see-records/use-see-records-offer.d.ts +16 -0
- package/dist/types/lib/types/common-types.d.ts +6 -0
- package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +7 -0
- package/dist/types/shared/analytics-protocol/aggregate-measure-field.d.ts +13 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
- package/dist/types/shared/analytics-protocol/selection-filter-compiler.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/see-records/availability.d.ts +30 -0
- package/dist/types/shared/dashboard-authoring/see-records/click.d.ts +37 -0
- package/dist/types/shared/dashboard-authoring/see-records/index.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/see-records/limits.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/see-records/measure-kind.d.ts +46 -0
- package/dist/types/shared/dashboard-authoring/see-records/request.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +61 -0
- package/dist/types/shared/usage-events/envelope.d.ts +4 -4
- package/package.json +1 -1
- package/dist/chunks/selection-filter-compiler-CUDRnUxc.js +0 -80
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var $ = (e, t, n) =>
|
|
1
|
+
var Cn = Object.defineProperty;
|
|
2
|
+
var Pn = (e, t, n) => t in e ? Cn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var $ = (e, t, n) => Pn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { z as w } from "zod";
|
|
5
|
-
import { E as
|
|
6
|
-
import { a$ as Wt, b0 as
|
|
7
|
-
import "./matrix-operation-contract-
|
|
8
|
-
import { k as
|
|
9
|
-
import { b as
|
|
10
|
-
import { canonicalizeSupportedLocale as Q, canonicalizeSupportedCurrencyCode as
|
|
11
|
-
import { p as
|
|
12
|
-
import { r as
|
|
5
|
+
import { E as Ut, l as Lt } from "./export-file-format-C-tJsxsf.js";
|
|
6
|
+
import { a$ as Wt, b0 as Yn, aU as zn, m as nt, a5 as An, M as Rn, b1 as Un, b2 as Ln, R as Wn, I as X, S as jn } from "./validators-CJ8Jh0E8.js";
|
|
7
|
+
import "./matrix-operation-contract-BM5TveR3.js";
|
|
8
|
+
import { k as Hn, i as he } from "./analytics-base-schemas-BaIQrEzX.js";
|
|
9
|
+
import { b as qn } from "./report-runtime-context-NlOXwyRB.js";
|
|
10
|
+
import { canonicalizeSupportedLocale as Q, canonicalizeSupportedCurrencyCode as Ae, DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as Zn } from "../value-format-preferences/index.js";
|
|
11
|
+
import { p as Xn, a as Vn, c as Kn, b as Bn } from "./raw-temporal-value-DdT0s47W.js";
|
|
12
|
+
import { r as Gn } from "./metric-comparison-Be4uS3Ql.js";
|
|
13
13
|
function J(e) {
|
|
14
14
|
if (!e || typeof e != "object") return !1;
|
|
15
15
|
const t = e.type;
|
|
16
16
|
return t === "number" || t === "currency" || t === "percent" || t === "scientific";
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Ss(e) {
|
|
19
19
|
return J(e) || !!e && typeof e == "object" && e.type === "duration";
|
|
20
20
|
}
|
|
21
21
|
const jt = [
|
|
@@ -24,61 +24,61 @@ const jt = [
|
|
|
24
24
|
"minute",
|
|
25
25
|
"second",
|
|
26
26
|
"millisecond"
|
|
27
|
-
],
|
|
27
|
+
], Re = {
|
|
28
28
|
day: 864e5,
|
|
29
29
|
hour: 36e5,
|
|
30
30
|
minute: 6e4,
|
|
31
31
|
second: 1e3,
|
|
32
32
|
millisecond: 1
|
|
33
|
-
},
|
|
33
|
+
}, Qn = {
|
|
34
34
|
day: "d",
|
|
35
35
|
hour: "hr",
|
|
36
36
|
minute: "min",
|
|
37
37
|
second: "s",
|
|
38
38
|
millisecond: "ms"
|
|
39
|
-
},
|
|
39
|
+
}, Jn = {
|
|
40
40
|
day: ["day", "days"],
|
|
41
41
|
hour: ["hour", "hours"],
|
|
42
42
|
minute: ["minute", "minutes"],
|
|
43
43
|
second: ["second", "seconds"],
|
|
44
44
|
millisecond: ["millisecond", "milliseconds"]
|
|
45
45
|
};
|
|
46
|
-
function
|
|
46
|
+
function er(e) {
|
|
47
47
|
return e === "day" || e === "hour" || e === "minute" || e === "second" || e === "millisecond";
|
|
48
48
|
}
|
|
49
49
|
function Ht(e, t) {
|
|
50
|
-
return
|
|
50
|
+
return er(e) ? e : t;
|
|
51
51
|
}
|
|
52
52
|
function rt(e, t) {
|
|
53
53
|
return jt.indexOf(Ht(e, t));
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function tr(e, t) {
|
|
56
56
|
const n = rt(e, "day"), r = rt(t, "second"), a = Math.min(n, r), i = Math.max(n, r);
|
|
57
57
|
return jt.slice(a, i + 1);
|
|
58
58
|
}
|
|
59
|
-
function tr(e, t) {
|
|
60
|
-
return e * Ae[Ht(t, "second")];
|
|
61
|
-
}
|
|
62
59
|
function nr(e, t) {
|
|
63
|
-
|
|
60
|
+
return e * Re[Ht(t, "second")];
|
|
61
|
+
}
|
|
62
|
+
function rr(e, t) {
|
|
63
|
+
const n = tr(t.largestUnit, t.smallestUnit), r = n[n.length - 1], a = Re[r];
|
|
64
64
|
let i = Math.round(e / a) * a;
|
|
65
65
|
return n.map((o) => {
|
|
66
|
-
const s =
|
|
66
|
+
const s = Re[o], c = Math.floor(i / s);
|
|
67
67
|
return i -= c * s, { unit: o, value: c };
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function ar(e, t) {
|
|
71
71
|
const n = e.filter((i) => i.value !== 0), r = n.length > 0 ? n : [e[e.length - 1]], a = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : r.length;
|
|
72
|
-
return r.slice(0, a).map((i) => `${i.value}${
|
|
72
|
+
return r.slice(0, a).map((i) => `${i.value}${Qn[i.unit]}`).join(" ");
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function ir(e, t) {
|
|
75
75
|
const n = e.filter((i) => i.value !== 0), r = n.length > 0 ? n : [e[e.length - 1]], a = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : r.length;
|
|
76
76
|
return r.slice(0, a).map((i) => {
|
|
77
|
-
const [o, s] =
|
|
77
|
+
const [o, s] = Jn[i.unit];
|
|
78
78
|
return `${i.value} ${i.value === 1 ? o : s}`;
|
|
79
79
|
}).join(" ");
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function or(e) {
|
|
82
82
|
const t = e.some(
|
|
83
83
|
(c) => c.unit === "day" && c.value !== 0
|
|
84
84
|
), n = e.some((c) => c.unit === "millisecond"), r = e.findIndex((c) => c.value !== 0), a = Math.max(0, e.length - 2), i = t ? 0 : r === -1 ? a : Math.min(r, a), o = r === -1 ? e.slice(a) : e.slice(i);
|
|
@@ -87,7 +87,7 @@ function ir(e) {
|
|
|
87
87
|
const s = o.map((c, u) => c.unit === "millisecond" ? String(c.value).padStart(3, "0") : u === 0 ? String(c.value) : String(c.value).padStart(2, "0")).join(":");
|
|
88
88
|
return n ? s.replace(/:(\d{3})$/, ".$1") : s;
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function sr(e, t, n) {
|
|
91
91
|
const r = `${n.prefix || ""}${e}${n.suffix || ""}`;
|
|
92
92
|
return t ? n.negativeInParentheses ? `(${r})` : `-${r}` : r;
|
|
93
93
|
}
|
|
@@ -97,8 +97,8 @@ function qt(e, t = {}) {
|
|
|
97
97
|
const n = typeof e == "number" ? e : typeof e == "string" && e.trim() ? Number(e) : NaN;
|
|
98
98
|
if (!Number.isFinite(n))
|
|
99
99
|
return "";
|
|
100
|
-
const r = t.inputUnit || "second", a = t.outputStyle === "digital" || t.outputStyle === "long" ? t.outputStyle : "compact", i = n < 0, o = Math.abs(
|
|
101
|
-
return
|
|
100
|
+
const r = t.inputUnit || "second", a = t.outputStyle === "digital" || t.outputStyle === "long" ? t.outputStyle : "compact", i = n < 0, o = Math.abs(nr(n, r)), s = rr(o, t), c = a === "digital" ? or(s) : a === "long" ? ir(s, t.maxUnits) : ar(s, t.maxUnits);
|
|
101
|
+
return sr(c, i, t);
|
|
102
102
|
}
|
|
103
103
|
function Zt(e, t) {
|
|
104
104
|
return qt(
|
|
@@ -120,7 +120,7 @@ function it(e, t) {
|
|
|
120
120
|
const n = e.format;
|
|
121
121
|
return n(t);
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function cr(e, t) {
|
|
124
124
|
if (at ?? (at = it(
|
|
125
125
|
new Intl.NumberFormat("en-US", { useGrouping: !1, maximumFractionDigits: 6 }),
|
|
126
126
|
"9007199254740993.000009"
|
|
@@ -137,10 +137,10 @@ function ee(e) {
|
|
|
137
137
|
function V(e) {
|
|
138
138
|
return typeof e == "number" ? Math.abs(e) : ee(e) ? { ...e, value: e.value.slice(1) } : e;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function ur(e) {
|
|
141
141
|
return typeof e == "number" ? e === 0 : /^-?0*(\.0*)?$/.test(e.value);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function Xt(e, t) {
|
|
144
144
|
return typeof e == "number" ? e * t : {
|
|
145
145
|
kind: "exact_number",
|
|
146
146
|
type: "decimal",
|
|
@@ -154,8 +154,8 @@ function ge(e, t) {
|
|
|
154
154
|
value: Wt(e.value, `1e-${t}`)
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
return typeof e == "number" ? t.format(e) :
|
|
157
|
+
function A(e, t) {
|
|
158
|
+
return typeof e == "number" ? t.format(e) : cr(e.value, t);
|
|
159
159
|
}
|
|
160
160
|
function ot(e) {
|
|
161
161
|
if (!e) return !1;
|
|
@@ -163,10 +163,10 @@ function ot(e) {
|
|
|
163
163
|
return t === "en-in" || t.startsWith("en-in-");
|
|
164
164
|
}
|
|
165
165
|
function st(e, t) {
|
|
166
|
-
const n = V(e), r = (a) => typeof n == "number" ? n >= a :
|
|
166
|
+
const n = V(e), r = (a) => typeof n == "number" ? n >= a : Yn(n.value, String(a)) >= 0;
|
|
167
167
|
return r(1e12) ? { power: 12, suffix: "T" } : r(1e9) ? { power: 9, suffix: "B" } : ot(t) && r(1e7) ? { power: 7, suffix: "Cr" } : r(1e6) ? { power: 6, suffix: "M" } : ot(t) && r(1e5) ? { power: 5, suffix: "L" } : r(1e3) ? { power: 3, suffix: "K" } : { power: 0, suffix: "" };
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function Ue(e, t) {
|
|
170
170
|
try {
|
|
171
171
|
const n = W(t);
|
|
172
172
|
return st(e, n);
|
|
@@ -180,7 +180,7 @@ function _(e, t = {}) {
|
|
|
180
180
|
let r = re.get(n);
|
|
181
181
|
return r || (r = new Intl.NumberFormat(e, t), re.size >= Vt && re.clear(), re.set(n, r)), r;
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function lr(e) {
|
|
184
184
|
let t = ae.get(e);
|
|
185
185
|
if (t === void 0) {
|
|
186
186
|
try {
|
|
@@ -193,24 +193,24 @@ function ur(e) {
|
|
|
193
193
|
return t;
|
|
194
194
|
}
|
|
195
195
|
function W(e) {
|
|
196
|
-
return e &&
|
|
196
|
+
return e && lr(e) ? e : "en-US";
|
|
197
197
|
}
|
|
198
198
|
function qe(e, t) {
|
|
199
199
|
if (e == null || Number.isNaN(e))
|
|
200
200
|
return "";
|
|
201
201
|
const n = W(t == null ? void 0 : t.locale);
|
|
202
202
|
let r = e;
|
|
203
|
-
if (t != null && t.multiplyBy && (r =
|
|
204
|
-
const { power: i, suffix: o } =
|
|
203
|
+
if (t != null && t.multiplyBy && (r = Xt(r, t.multiplyBy)), t != null && t.useSuffix) {
|
|
204
|
+
const { power: i, suffix: o } = Ue(r, n);
|
|
205
205
|
r = ge(r, i);
|
|
206
|
-
const s =
|
|
206
|
+
const s = A(r, _(n, {
|
|
207
207
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
208
208
|
maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2,
|
|
209
209
|
useGrouping: (t == null ? void 0 : t.useGrouping) ?? !0
|
|
210
210
|
}));
|
|
211
211
|
return `${(t == null ? void 0 : t.prefix) ?? ""}${s}${o}${(t == null ? void 0 : t.suffix) ?? ""}`;
|
|
212
212
|
}
|
|
213
|
-
const a =
|
|
213
|
+
const a = A(r, _(n, {
|
|
214
214
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
215
215
|
maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2,
|
|
216
216
|
useGrouping: (t == null ? void 0 : t.useGrouping) ?? !0
|
|
@@ -221,13 +221,13 @@ function qe(e, t) {
|
|
|
221
221
|
}
|
|
222
222
|
return `${(t == null ? void 0 : t.prefix) ?? ""}${a}${(t == null ? void 0 : t.suffix) ?? ""}`;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Kt(e, t) {
|
|
225
225
|
if (e == null || Number.isNaN(e))
|
|
226
226
|
return "";
|
|
227
227
|
const n = W(t == null ? void 0 : t.locale), r = (t == null ? void 0 : t.currency) || "USD", a = ee(e), i = !!(t != null && t.negativeInParentheses && a), o = i ? V(e) : e;
|
|
228
228
|
try {
|
|
229
229
|
if (t != null && t.useSuffix) {
|
|
230
|
-
const { power: c, suffix: u } =
|
|
230
|
+
const { power: c, suffix: u } = Ue(o, n), l = ge(o, c), m = `${A(l, _(n, {
|
|
231
231
|
style: "currency",
|
|
232
232
|
currency: r,
|
|
233
233
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
@@ -236,7 +236,7 @@ function Bt(e, t) {
|
|
|
236
236
|
}))}${u}`;
|
|
237
237
|
return i ? `(${m})` : m;
|
|
238
238
|
}
|
|
239
|
-
const s =
|
|
239
|
+
const s = A(o, _(n, {
|
|
240
240
|
style: "currency",
|
|
241
241
|
currency: r,
|
|
242
242
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
@@ -245,7 +245,7 @@ function Bt(e, t) {
|
|
|
245
245
|
}));
|
|
246
246
|
return i ? `(${s})` : s;
|
|
247
247
|
} catch {
|
|
248
|
-
const s = V(e), c = t != null && t.useSuffix ?
|
|
248
|
+
const s = V(e), c = t != null && t.useSuffix ? Ue(s, n) : { power: 0, suffix: "" }, u = qe(
|
|
249
249
|
ge(s, c.power),
|
|
250
250
|
{
|
|
251
251
|
locale: n,
|
|
@@ -257,11 +257,11 @@ function Bt(e, t) {
|
|
|
257
257
|
return a ? t != null && t.negativeInParentheses ? `(${l})` : `-${l}` : l;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function Bt(e, t) {
|
|
261
261
|
if (e == null || Number.isNaN(e))
|
|
262
262
|
return "";
|
|
263
263
|
const n = W(t == null ? void 0 : t.locale), a = (t == null ? void 0 : t.alreadyPercent) ?? (t == null ? void 0 : t.percentValueMode) === "whole" ? ge(e, 2) : e;
|
|
264
|
-
return
|
|
264
|
+
return A(a, _(n, {
|
|
265
265
|
style: "percent",
|
|
266
266
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
267
267
|
maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2,
|
|
@@ -272,17 +272,17 @@ function Gt(e, t) {
|
|
|
272
272
|
if (e == null || Number.isNaN(e))
|
|
273
273
|
return "";
|
|
274
274
|
const n = W(t == null ? void 0 : t.locale);
|
|
275
|
-
return
|
|
275
|
+
return A(e, _(n, {
|
|
276
276
|
notation: "scientific",
|
|
277
277
|
minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
|
|
278
278
|
maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2
|
|
279
279
|
}));
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
const n = t ?? "auto", r = n === "never" ? V(e) : e, a = !ee(r) && (n === "always" || n === "exceptZero" && !
|
|
281
|
+
function mr(e, t) {
|
|
282
|
+
const n = t ?? "auto", r = n === "never" ? V(e) : e, a = !ee(r) && (n === "always" || n === "exceptZero" && !ur(r));
|
|
283
283
|
return { value: r, plus: a };
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function Ms(e) {
|
|
286
286
|
if (!e || !("signDisplay" in e)) return e;
|
|
287
287
|
const { signDisplay: t, ...n } = e;
|
|
288
288
|
return n;
|
|
@@ -290,7 +290,7 @@ function vs(e) {
|
|
|
290
290
|
function Ze(e, t) {
|
|
291
291
|
if (e == null || Number.isNaN(e))
|
|
292
292
|
return "";
|
|
293
|
-
const n = t.scale === void 0 ? e :
|
|
293
|
+
const n = t.scale === void 0 ? e : Xt(e, t.scale), r = mr(n, t.signDisplay), a = r.value, i = r.plus ? "+" : "", o = t.negativeStyle === "parentheses" && ee(a), s = o ? V(a) : a, c = {
|
|
294
294
|
style: t.type === "number" ? "decimal" : t.type,
|
|
295
295
|
locale: t.locale,
|
|
296
296
|
currency: t.currency,
|
|
@@ -303,10 +303,10 @@ function Ze(e, t) {
|
|
|
303
303
|
let u;
|
|
304
304
|
switch (t.type) {
|
|
305
305
|
case "currency":
|
|
306
|
-
u =
|
|
306
|
+
u = Kt(s, c);
|
|
307
307
|
break;
|
|
308
308
|
case "percent":
|
|
309
|
-
u =
|
|
309
|
+
u = Bt(s, c);
|
|
310
310
|
break;
|
|
311
311
|
case "scientific":
|
|
312
312
|
u = Gt(s, c);
|
|
@@ -318,10 +318,10 @@ function Ze(e, t) {
|
|
|
318
318
|
const l = `${t.prefix ?? ""}${i}${u}${t.suffix ?? ""}`;
|
|
319
319
|
return o ? `(${l})` : l;
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function ks(e, t) {
|
|
322
322
|
return t.type === "duration" ? e == null ? "" : Zt(e, t) : Ze(e, t);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function fr(e, t, n = "en-US") {
|
|
325
325
|
if (e == null || typeof e == "number" && isNaN(e))
|
|
326
326
|
return "";
|
|
327
327
|
if ((t == null ? void 0 : t.style) === "duration")
|
|
@@ -350,7 +350,7 @@ function mr(e, t, n = "en-US") {
|
|
|
350
350
|
suffix: t == null ? void 0 : t.suffix
|
|
351
351
|
});
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function _s(e, t, n) {
|
|
354
354
|
const r = {
|
|
355
355
|
style: t === "currency" ? "currency" : t === "percent" ? "percent" : "decimal",
|
|
356
356
|
locale: n == null ? void 0 : n.locale,
|
|
@@ -365,9 +365,9 @@ function Ms(e, t, n) {
|
|
|
365
365
|
};
|
|
366
366
|
switch (t) {
|
|
367
367
|
case "currency":
|
|
368
|
-
return
|
|
368
|
+
return Kt(e, r);
|
|
369
369
|
case "percent":
|
|
370
|
-
return
|
|
370
|
+
return Bt(e, r);
|
|
371
371
|
case "scientific":
|
|
372
372
|
return Gt(e, r);
|
|
373
373
|
default:
|
|
@@ -381,18 +381,18 @@ function p(e) {
|
|
|
381
381
|
function N(e, t) {
|
|
382
382
|
return e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
383
383
|
}
|
|
384
|
-
const Qt = 6048e5,
|
|
385
|
-
let
|
|
384
|
+
const Qt = 6048e5, dr = 864e5, Jt = 6e4, en = 36e5, Ns = 525600, ie = 43200, ct = 1440;
|
|
385
|
+
let hr = {};
|
|
386
386
|
function j() {
|
|
387
|
-
return
|
|
387
|
+
return hr;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function K(e, t) {
|
|
390
390
|
var s, c, u, l;
|
|
391
391
|
const n = j(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = p(e), i = a.getDay(), o = (i < r ? 7 : 0) + i - r;
|
|
392
392
|
return a.setDate(a.getDate() - o), a.setHours(0, 0, 0, 0), a;
|
|
393
393
|
}
|
|
394
394
|
function ye(e) {
|
|
395
|
-
return
|
|
395
|
+
return K(e, { weekStartsOn: 1 });
|
|
396
396
|
}
|
|
397
397
|
function tn(e) {
|
|
398
398
|
const t = p(e), n = t.getFullYear(), r = N(e, 0);
|
|
@@ -420,11 +420,11 @@ function pe(e) {
|
|
|
420
420
|
);
|
|
421
421
|
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function gr(e, t) {
|
|
424
424
|
const n = ut(e), r = ut(t), a = +n - pe(n), i = +r - pe(r);
|
|
425
|
-
return Math.round((a - i) /
|
|
425
|
+
return Math.round((a - i) / dr);
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function yr(e) {
|
|
428
428
|
const t = tn(e), n = N(e, 0);
|
|
429
429
|
return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), ye(n);
|
|
430
430
|
}
|
|
@@ -432,23 +432,23 @@ function ue(e, t) {
|
|
|
432
432
|
const n = p(e), r = p(t), a = n.getTime() - r.getTime();
|
|
433
433
|
return a < 0 ? -1 : a > 0 ? 1 : a;
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function pr(e) {
|
|
436
436
|
return N(e, Date.now());
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function wr(e) {
|
|
439
439
|
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
440
440
|
}
|
|
441
|
-
function
|
|
442
|
-
if (!
|
|
441
|
+
function Tr(e) {
|
|
442
|
+
if (!wr(e) && typeof e != "number")
|
|
443
443
|
return !1;
|
|
444
444
|
const t = p(e);
|
|
445
445
|
return !isNaN(Number(t));
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function Dr(e, t) {
|
|
448
448
|
const n = p(e), r = p(t), a = n.getFullYear() - r.getFullYear(), i = n.getMonth() - r.getMonth();
|
|
449
449
|
return a * 12 + i;
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function br(e) {
|
|
452
452
|
return (t) => {
|
|
453
453
|
const r = (e ? Math[e] : Math.trunc)(t);
|
|
454
454
|
return r === 0 ? 0 : r;
|
|
@@ -457,21 +457,21 @@ function Dr(e) {
|
|
|
457
457
|
function xr(e, t) {
|
|
458
458
|
return +p(e) - +p(t);
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function vr(e) {
|
|
461
461
|
const t = p(e);
|
|
462
462
|
return t.setHours(23, 59, 59, 999), t;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function Sr(e) {
|
|
465
465
|
const t = p(e), n = t.getMonth();
|
|
466
466
|
return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function Mr(e) {
|
|
469
469
|
const t = p(e);
|
|
470
|
-
return +
|
|
470
|
+
return +vr(t) == +Sr(t);
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function kr(e, t) {
|
|
473
473
|
const n = p(e), r = p(t), a = ue(n, r), i = Math.abs(
|
|
474
|
-
|
|
474
|
+
Dr(n, r)
|
|
475
475
|
);
|
|
476
476
|
let o;
|
|
477
477
|
if (i < 1)
|
|
@@ -479,19 +479,19 @@ function Mr(e, t) {
|
|
|
479
479
|
else {
|
|
480
480
|
n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - a * i);
|
|
481
481
|
let s = ue(n, r) === -a;
|
|
482
|
-
|
|
482
|
+
Mr(p(e)) && i === 1 && ue(e, r) === 1 && (s = !1), o = a * (i - Number(s));
|
|
483
483
|
}
|
|
484
484
|
return o === 0 ? 0 : o;
|
|
485
485
|
}
|
|
486
|
-
function
|
|
486
|
+
function _r(e, t, n) {
|
|
487
487
|
const r = xr(e, t) / 1e3;
|
|
488
|
-
return
|
|
488
|
+
return br(n == null ? void 0 : n.roundingMethod)(r);
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function Nr(e) {
|
|
491
491
|
const t = p(e), n = N(e, 0);
|
|
492
492
|
return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
493
493
|
}
|
|
494
|
-
const
|
|
494
|
+
const $r = {
|
|
495
495
|
lessThanXSeconds: {
|
|
496
496
|
one: "less than a second",
|
|
497
497
|
other: "less than {{count}} seconds"
|
|
@@ -553,9 +553,9 @@ const Nr = {
|
|
|
553
553
|
one: "almost 1 year",
|
|
554
554
|
other: "almost {{count}} years"
|
|
555
555
|
}
|
|
556
|
-
},
|
|
556
|
+
}, Er = (e, t, n) => {
|
|
557
557
|
let r;
|
|
558
|
-
const a =
|
|
558
|
+
const a = $r[e];
|
|
559
559
|
return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
560
560
|
};
|
|
561
561
|
function ke(e) {
|
|
@@ -564,42 +564,42 @@ function ke(e) {
|
|
|
564
564
|
return e.formats[n] || e.formats[e.defaultWidth];
|
|
565
565
|
};
|
|
566
566
|
}
|
|
567
|
-
const
|
|
567
|
+
const Or = {
|
|
568
568
|
full: "EEEE, MMMM do, y",
|
|
569
569
|
long: "MMMM do, y",
|
|
570
570
|
medium: "MMM d, y",
|
|
571
571
|
short: "MM/dd/yyyy"
|
|
572
|
-
},
|
|
572
|
+
}, Ir = {
|
|
573
573
|
full: "h:mm:ss a zzzz",
|
|
574
574
|
long: "h:mm:ss a z",
|
|
575
575
|
medium: "h:mm:ss a",
|
|
576
576
|
short: "h:mm a"
|
|
577
|
-
},
|
|
577
|
+
}, Fr = {
|
|
578
578
|
full: "{{date}} 'at' {{time}}",
|
|
579
579
|
long: "{{date}} 'at' {{time}}",
|
|
580
580
|
medium: "{{date}}, {{time}}",
|
|
581
581
|
short: "{{date}}, {{time}}"
|
|
582
|
-
},
|
|
582
|
+
}, Cr = {
|
|
583
583
|
date: ke({
|
|
584
|
-
formats:
|
|
584
|
+
formats: Or,
|
|
585
585
|
defaultWidth: "full"
|
|
586
586
|
}),
|
|
587
587
|
time: ke({
|
|
588
|
-
formats:
|
|
588
|
+
formats: Ir,
|
|
589
589
|
defaultWidth: "full"
|
|
590
590
|
}),
|
|
591
591
|
dateTime: ke({
|
|
592
|
-
formats:
|
|
592
|
+
formats: Fr,
|
|
593
593
|
defaultWidth: "full"
|
|
594
594
|
})
|
|
595
|
-
},
|
|
595
|
+
}, Pr = {
|
|
596
596
|
lastWeek: "'last' eeee 'at' p",
|
|
597
597
|
yesterday: "'yesterday at' p",
|
|
598
598
|
today: "'today at' p",
|
|
599
599
|
tomorrow: "'tomorrow at' p",
|
|
600
600
|
nextWeek: "eeee 'at' p",
|
|
601
601
|
other: "P"
|
|
602
|
-
},
|
|
602
|
+
}, Yr = (e, t, n, r) => Pr[e];
|
|
603
603
|
function H(e) {
|
|
604
604
|
return (t, n) => {
|
|
605
605
|
const r = n != null && n.context ? String(n.context) : "standalone";
|
|
@@ -615,15 +615,15 @@ function H(e) {
|
|
|
615
615
|
return a[i];
|
|
616
616
|
};
|
|
617
617
|
}
|
|
618
|
-
const
|
|
618
|
+
const zr = {
|
|
619
619
|
narrow: ["B", "A"],
|
|
620
620
|
abbreviated: ["BC", "AD"],
|
|
621
621
|
wide: ["Before Christ", "Anno Domini"]
|
|
622
|
-
},
|
|
622
|
+
}, Ar = {
|
|
623
623
|
narrow: ["1", "2", "3", "4"],
|
|
624
624
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
625
625
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
626
|
-
},
|
|
626
|
+
}, Rr = {
|
|
627
627
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
628
628
|
abbreviated: [
|
|
629
629
|
"Jan",
|
|
@@ -653,7 +653,7 @@ const Yr = {
|
|
|
653
653
|
"November",
|
|
654
654
|
"December"
|
|
655
655
|
]
|
|
656
|
-
},
|
|
656
|
+
}, Ur = {
|
|
657
657
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
658
658
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
659
659
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -666,7 +666,7 @@ const Yr = {
|
|
|
666
666
|
"Friday",
|
|
667
667
|
"Saturday"
|
|
668
668
|
]
|
|
669
|
-
},
|
|
669
|
+
}, Lr = {
|
|
670
670
|
narrow: {
|
|
671
671
|
am: "a",
|
|
672
672
|
pm: "p",
|
|
@@ -697,7 +697,7 @@ const Yr = {
|
|
|
697
697
|
evening: "evening",
|
|
698
698
|
night: "night"
|
|
699
699
|
}
|
|
700
|
-
},
|
|
700
|
+
}, Wr = {
|
|
701
701
|
narrow: {
|
|
702
702
|
am: "a",
|
|
703
703
|
pm: "p",
|
|
@@ -728,7 +728,7 @@ const Yr = {
|
|
|
728
728
|
evening: "in the evening",
|
|
729
729
|
night: "at night"
|
|
730
730
|
}
|
|
731
|
-
},
|
|
731
|
+
}, jr = (e, t) => {
|
|
732
732
|
const n = Number(e), r = n % 100;
|
|
733
733
|
if (r > 20 || r < 10)
|
|
734
734
|
switch (r % 10) {
|
|
@@ -740,29 +740,29 @@ const Yr = {
|
|
|
740
740
|
return n + "rd";
|
|
741
741
|
}
|
|
742
742
|
return n + "th";
|
|
743
|
-
},
|
|
744
|
-
ordinalNumber:
|
|
743
|
+
}, Hr = {
|
|
744
|
+
ordinalNumber: jr,
|
|
745
745
|
era: H({
|
|
746
|
-
values:
|
|
746
|
+
values: zr,
|
|
747
747
|
defaultWidth: "wide"
|
|
748
748
|
}),
|
|
749
749
|
quarter: H({
|
|
750
|
-
values:
|
|
750
|
+
values: Ar,
|
|
751
751
|
defaultWidth: "wide",
|
|
752
752
|
argumentCallback: (e) => e - 1
|
|
753
753
|
}),
|
|
754
754
|
month: H({
|
|
755
|
-
values:
|
|
755
|
+
values: Rr,
|
|
756
756
|
defaultWidth: "wide"
|
|
757
757
|
}),
|
|
758
758
|
day: H({
|
|
759
|
-
values:
|
|
759
|
+
values: Ur,
|
|
760
760
|
defaultWidth: "wide"
|
|
761
761
|
}),
|
|
762
762
|
dayPeriod: H({
|
|
763
|
-
values:
|
|
763
|
+
values: Lr,
|
|
764
764
|
defaultWidth: "wide",
|
|
765
|
-
formattingValues:
|
|
765
|
+
formattingValues: Wr,
|
|
766
766
|
defaultFormattingWidth: "wide"
|
|
767
767
|
})
|
|
768
768
|
};
|
|
@@ -771,9 +771,9 @@ function q(e) {
|
|
|
771
771
|
const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], i = t.match(a);
|
|
772
772
|
if (!i)
|
|
773
773
|
return null;
|
|
774
|
-
const o = i[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ?
|
|
774
|
+
const o = i[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? Zr(s, (f) => f.test(o)) : (
|
|
775
775
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
776
|
-
|
|
776
|
+
qr(s, (f) => f.test(o))
|
|
777
777
|
);
|
|
778
778
|
let u;
|
|
779
779
|
u = e.valueCallback ? e.valueCallback(c) : c, u = n.valueCallback ? (
|
|
@@ -784,17 +784,17 @@ function q(e) {
|
|
|
784
784
|
return { value: u, rest: l };
|
|
785
785
|
};
|
|
786
786
|
}
|
|
787
|
-
function
|
|
787
|
+
function qr(e, t) {
|
|
788
788
|
for (const n in e)
|
|
789
789
|
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
790
790
|
return n;
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function Zr(e, t) {
|
|
793
793
|
for (let n = 0; n < e.length; n++)
|
|
794
794
|
if (t(e[n]))
|
|
795
795
|
return n;
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function Xr(e) {
|
|
798
798
|
return (t, n = {}) => {
|
|
799
799
|
const r = t.match(e.matchPattern);
|
|
800
800
|
if (!r) return null;
|
|
@@ -806,23 +806,23 @@ function Zr(e) {
|
|
|
806
806
|
return { value: o, rest: s };
|
|
807
807
|
};
|
|
808
808
|
}
|
|
809
|
-
const
|
|
809
|
+
const Vr = /^(\d+)(th|st|nd|rd)?/i, Kr = /\d+/i, Br = {
|
|
810
810
|
narrow: /^(b|a)/i,
|
|
811
811
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
812
812
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
813
|
-
}, Xr = {
|
|
814
|
-
any: [/^b/i, /^(a|c)/i]
|
|
815
813
|
}, Gr = {
|
|
814
|
+
any: [/^b/i, /^(a|c)/i]
|
|
815
|
+
}, Qr = {
|
|
816
816
|
narrow: /^[1234]/i,
|
|
817
817
|
abbreviated: /^q[1234]/i,
|
|
818
818
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
819
|
-
}, Qr = {
|
|
820
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
821
819
|
}, Jr = {
|
|
820
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
821
|
+
}, ea = {
|
|
822
822
|
narrow: /^[jfmasond]/i,
|
|
823
823
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
824
824
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
825
|
-
},
|
|
825
|
+
}, ta = {
|
|
826
826
|
narrow: [
|
|
827
827
|
/^j/i,
|
|
828
828
|
/^f/i,
|
|
@@ -851,18 +851,18 @@ const Kr = /^(\d+)(th|st|nd|rd)?/i, Vr = /\d+/i, Br = {
|
|
|
851
851
|
/^n/i,
|
|
852
852
|
/^d/i
|
|
853
853
|
]
|
|
854
|
-
},
|
|
854
|
+
}, na = {
|
|
855
855
|
narrow: /^[smtwf]/i,
|
|
856
856
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
857
857
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
858
858
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
859
|
-
},
|
|
859
|
+
}, ra = {
|
|
860
860
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
861
861
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
862
|
-
},
|
|
862
|
+
}, aa = {
|
|
863
863
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
864
864
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
865
|
-
},
|
|
865
|
+
}, ia = {
|
|
866
866
|
any: {
|
|
867
867
|
am: /^a/i,
|
|
868
868
|
pm: /^p/i,
|
|
@@ -873,79 +873,79 @@ const Kr = /^(\d+)(th|st|nd|rd)?/i, Vr = /\d+/i, Br = {
|
|
|
873
873
|
evening: /evening/i,
|
|
874
874
|
night: /night/i
|
|
875
875
|
}
|
|
876
|
-
},
|
|
877
|
-
ordinalNumber:
|
|
878
|
-
matchPattern:
|
|
879
|
-
parsePattern:
|
|
876
|
+
}, oa = {
|
|
877
|
+
ordinalNumber: Xr({
|
|
878
|
+
matchPattern: Vr,
|
|
879
|
+
parsePattern: Kr,
|
|
880
880
|
valueCallback: (e) => parseInt(e, 10)
|
|
881
881
|
}),
|
|
882
882
|
era: q({
|
|
883
883
|
matchPatterns: Br,
|
|
884
884
|
defaultMatchWidth: "wide",
|
|
885
|
-
parsePatterns:
|
|
885
|
+
parsePatterns: Gr,
|
|
886
886
|
defaultParseWidth: "any"
|
|
887
887
|
}),
|
|
888
888
|
quarter: q({
|
|
889
|
-
matchPatterns:
|
|
889
|
+
matchPatterns: Qr,
|
|
890
890
|
defaultMatchWidth: "wide",
|
|
891
|
-
parsePatterns:
|
|
891
|
+
parsePatterns: Jr,
|
|
892
892
|
defaultParseWidth: "any",
|
|
893
893
|
valueCallback: (e) => e + 1
|
|
894
894
|
}),
|
|
895
895
|
month: q({
|
|
896
|
-
matchPatterns:
|
|
896
|
+
matchPatterns: ea,
|
|
897
897
|
defaultMatchWidth: "wide",
|
|
898
|
-
parsePatterns:
|
|
898
|
+
parsePatterns: ta,
|
|
899
899
|
defaultParseWidth: "any"
|
|
900
900
|
}),
|
|
901
901
|
day: q({
|
|
902
|
-
matchPatterns:
|
|
902
|
+
matchPatterns: na,
|
|
903
903
|
defaultMatchWidth: "wide",
|
|
904
|
-
parsePatterns:
|
|
904
|
+
parsePatterns: ra,
|
|
905
905
|
defaultParseWidth: "any"
|
|
906
906
|
}),
|
|
907
907
|
dayPeriod: q({
|
|
908
|
-
matchPatterns:
|
|
908
|
+
matchPatterns: aa,
|
|
909
909
|
defaultMatchWidth: "any",
|
|
910
|
-
parsePatterns:
|
|
910
|
+
parsePatterns: ia,
|
|
911
911
|
defaultParseWidth: "any"
|
|
912
912
|
})
|
|
913
913
|
}, nn = {
|
|
914
914
|
code: "en-US",
|
|
915
|
-
formatDistance:
|
|
916
|
-
formatLong:
|
|
917
|
-
formatRelative:
|
|
918
|
-
localize:
|
|
919
|
-
match:
|
|
915
|
+
formatDistance: Er,
|
|
916
|
+
formatLong: Cr,
|
|
917
|
+
formatRelative: Yr,
|
|
918
|
+
localize: Hr,
|
|
919
|
+
match: oa,
|
|
920
920
|
options: {
|
|
921
921
|
weekStartsOn: 0,
|
|
922
922
|
firstWeekContainsDate: 1
|
|
923
923
|
}
|
|
924
924
|
};
|
|
925
|
-
function
|
|
925
|
+
function sa(e) {
|
|
926
926
|
const t = p(e);
|
|
927
|
-
return
|
|
927
|
+
return gr(t, Nr(t)) + 1;
|
|
928
928
|
}
|
|
929
|
-
function
|
|
930
|
-
const t = p(e), n = +ye(t) - +
|
|
929
|
+
function ca(e) {
|
|
930
|
+
const t = p(e), n = +ye(t) - +yr(t);
|
|
931
931
|
return Math.round(n / Qt) + 1;
|
|
932
932
|
}
|
|
933
933
|
function rn(e, t) {
|
|
934
934
|
var l, f, m, h;
|
|
935
935
|
const n = p(e), r = n.getFullYear(), a = j(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((f = (l = t == null ? void 0 : t.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((h = (m = a.locale) == null ? void 0 : m.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, o = N(e, 0);
|
|
936
936
|
o.setFullYear(r + 1, 0, i), o.setHours(0, 0, 0, 0);
|
|
937
|
-
const s =
|
|
937
|
+
const s = K(o, t), c = N(e, 0);
|
|
938
938
|
c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
|
|
939
|
-
const u =
|
|
939
|
+
const u = K(c, t);
|
|
940
940
|
return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= u.getTime() ? r : r - 1;
|
|
941
941
|
}
|
|
942
|
-
function
|
|
942
|
+
function ua(e, t) {
|
|
943
943
|
var s, c, u, l;
|
|
944
944
|
const n = j(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((c = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, a = rn(e, t), i = N(e, 0);
|
|
945
|
-
return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0),
|
|
945
|
+
return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), K(i, t);
|
|
946
946
|
}
|
|
947
|
-
function
|
|
948
|
-
const n = p(e), r = +
|
|
947
|
+
function la(e, t) {
|
|
948
|
+
const n = p(e), r = +K(n, t) - +ua(n, t);
|
|
949
949
|
return Math.round(r / Qt) + 1;
|
|
950
950
|
}
|
|
951
951
|
function y(e, t) {
|
|
@@ -1006,7 +1006,7 @@ const k = {
|
|
|
1006
1006
|
);
|
|
1007
1007
|
return y(a, t.length);
|
|
1008
1008
|
}
|
|
1009
|
-
},
|
|
1009
|
+
}, F = {
|
|
1010
1010
|
midnight: "midnight",
|
|
1011
1011
|
noon: "noon",
|
|
1012
1012
|
morning: "morning",
|
|
@@ -1171,12 +1171,12 @@ const k = {
|
|
|
1171
1171
|
},
|
|
1172
1172
|
// Local week of year
|
|
1173
1173
|
w: function(e, t, n, r) {
|
|
1174
|
-
const a =
|
|
1174
|
+
const a = la(e, r);
|
|
1175
1175
|
return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : y(a, t.length);
|
|
1176
1176
|
},
|
|
1177
1177
|
// ISO week of year
|
|
1178
1178
|
I: function(e, t, n) {
|
|
1179
|
-
const r =
|
|
1179
|
+
const r = ca(e);
|
|
1180
1180
|
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : y(r, t.length);
|
|
1181
1181
|
},
|
|
1182
1182
|
// Day of the month
|
|
@@ -1185,7 +1185,7 @@ const k = {
|
|
|
1185
1185
|
},
|
|
1186
1186
|
// Day of year
|
|
1187
1187
|
D: function(e, t, n) {
|
|
1188
|
-
const r =
|
|
1188
|
+
const r = sa(e);
|
|
1189
1189
|
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : y(r, t.length);
|
|
1190
1190
|
},
|
|
1191
1191
|
// Day of week
|
|
@@ -1348,7 +1348,7 @@ const k = {
|
|
|
1348
1348
|
b: function(e, t, n) {
|
|
1349
1349
|
const r = e.getHours();
|
|
1350
1350
|
let a;
|
|
1351
|
-
switch (r === 12 ? a =
|
|
1351
|
+
switch (r === 12 ? a = F.noon : r === 0 ? a = F.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
|
|
1352
1352
|
case "b":
|
|
1353
1353
|
case "bb":
|
|
1354
1354
|
return n.dayPeriod(a, {
|
|
@@ -1377,7 +1377,7 @@ const k = {
|
|
|
1377
1377
|
B: function(e, t, n) {
|
|
1378
1378
|
const r = e.getHours();
|
|
1379
1379
|
let a;
|
|
1380
|
-
switch (r >= 17 ? a =
|
|
1380
|
+
switch (r >= 17 ? a = F.evening : r >= 12 ? a = F.afternoon : r >= 4 ? a = F.morning : a = F.night, t) {
|
|
1381
1381
|
case "B":
|
|
1382
1382
|
case "BB":
|
|
1383
1383
|
case "BBB":
|
|
@@ -1536,7 +1536,7 @@ const dt = (e, t) => {
|
|
|
1536
1536
|
default:
|
|
1537
1537
|
return t.time({ width: "full" });
|
|
1538
1538
|
}
|
|
1539
|
-
},
|
|
1539
|
+
}, ma = (e, t) => {
|
|
1540
1540
|
const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1541
1541
|
if (!a)
|
|
1542
1542
|
return dt(e, t);
|
|
@@ -1557,48 +1557,48 @@ const dt = (e, t) => {
|
|
|
1557
1557
|
break;
|
|
1558
1558
|
}
|
|
1559
1559
|
return i.replace("{{date}}", dt(r, t)).replace("{{time}}", an(a, t));
|
|
1560
|
-
},
|
|
1560
|
+
}, fa = {
|
|
1561
1561
|
p: an,
|
|
1562
|
-
P:
|
|
1563
|
-
},
|
|
1564
|
-
function ga(e) {
|
|
1565
|
-
return fa.test(e);
|
|
1566
|
-
}
|
|
1562
|
+
P: ma
|
|
1563
|
+
}, da = /^D+$/, ha = /^Y+$/, ga = ["D", "DD", "YY", "YYYY"];
|
|
1567
1564
|
function ya(e) {
|
|
1568
1565
|
return da.test(e);
|
|
1569
1566
|
}
|
|
1570
|
-
function pa(e
|
|
1571
|
-
|
|
1572
|
-
if (console.warn(r), ha.includes(e)) throw new RangeError(r);
|
|
1567
|
+
function pa(e) {
|
|
1568
|
+
return ha.test(e);
|
|
1573
1569
|
}
|
|
1574
1570
|
function wa(e, t, n) {
|
|
1571
|
+
const r = Ta(e, t, n);
|
|
1572
|
+
if (console.warn(r), ga.includes(e)) throw new RangeError(r);
|
|
1573
|
+
}
|
|
1574
|
+
function Ta(e, t, n) {
|
|
1575
1575
|
const r = e[0] === "Y" ? "years" : "days of the month";
|
|
1576
1576
|
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1577
1577
|
}
|
|
1578
|
-
const
|
|
1579
|
-
function
|
|
1578
|
+
const Da = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ba = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, xa = /^'([^]*?)'?$/, va = /''/g, Sa = /[a-zA-Z]/;
|
|
1579
|
+
function Xe(e, t, n) {
|
|
1580
1580
|
var l, f, m, h, d, S, et, tt;
|
|
1581
1581
|
const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? nn, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((f = (l = n == null ? void 0 : n.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((h = (m = r.locale) == null ? void 0 : m.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, o = (n == null ? void 0 : n.weekStartsOn) ?? ((S = (d = n == null ? void 0 : n.locale) == null ? void 0 : d.options) == null ? void 0 : S.weekStartsOn) ?? r.weekStartsOn ?? ((tt = (et = r.locale) == null ? void 0 : et.options) == null ? void 0 : tt.weekStartsOn) ?? 0, s = p(e);
|
|
1582
|
-
if (!
|
|
1582
|
+
if (!Tr(s))
|
|
1583
1583
|
throw new RangeError("Invalid time value");
|
|
1584
|
-
let c = t.match(
|
|
1585
|
-
const
|
|
1586
|
-
if (
|
|
1587
|
-
const Me =
|
|
1584
|
+
let c = t.match(ba).map((v) => {
|
|
1585
|
+
const x = v[0];
|
|
1586
|
+
if (x === "p" || x === "P") {
|
|
1587
|
+
const Me = fa[x];
|
|
1588
1588
|
return Me(v, a.formatLong);
|
|
1589
1589
|
}
|
|
1590
1590
|
return v;
|
|
1591
|
-
}).join("").match(
|
|
1591
|
+
}).join("").match(Da).map((v) => {
|
|
1592
1592
|
if (v === "''")
|
|
1593
1593
|
return { isToken: !1, value: "'" };
|
|
1594
|
-
const
|
|
1595
|
-
if (
|
|
1596
|
-
return { isToken: !1, value:
|
|
1597
|
-
if (lt[
|
|
1594
|
+
const x = v[0];
|
|
1595
|
+
if (x === "'")
|
|
1596
|
+
return { isToken: !1, value: Ma(v) };
|
|
1597
|
+
if (lt[x])
|
|
1598
1598
|
return { isToken: !0, value: v };
|
|
1599
|
-
if (
|
|
1599
|
+
if (x.match(Sa))
|
|
1600
1600
|
throw new RangeError(
|
|
1601
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
1601
|
+
"Format string contains an unescaped latin alphabet character `" + x + "`"
|
|
1602
1602
|
);
|
|
1603
1603
|
return { isToken: !1, value: v };
|
|
1604
1604
|
});
|
|
@@ -1610,17 +1610,17 @@ function Ke(e, t, n) {
|
|
|
1610
1610
|
};
|
|
1611
1611
|
return c.map((v) => {
|
|
1612
1612
|
if (!v.isToken) return v.value;
|
|
1613
|
-
const
|
|
1614
|
-
(!(n != null && n.useAdditionalWeekYearTokens) &&
|
|
1615
|
-
const Me = lt[
|
|
1616
|
-
return Me(s,
|
|
1613
|
+
const x = v.value;
|
|
1614
|
+
(!(n != null && n.useAdditionalWeekYearTokens) && pa(x) || !(n != null && n.useAdditionalDayOfYearTokens) && ya(x)) && wa(x, t, String(e));
|
|
1615
|
+
const Me = lt[x[0]];
|
|
1616
|
+
return Me(s, x, a.localize, u);
|
|
1617
1617
|
}).join("");
|
|
1618
1618
|
}
|
|
1619
|
-
function
|
|
1619
|
+
function Ma(e) {
|
|
1620
1620
|
const t = e.match(xa);
|
|
1621
|
-
return t ? t[1].replace(
|
|
1621
|
+
return t ? t[1].replace(va, "'") : e;
|
|
1622
1622
|
}
|
|
1623
|
-
function
|
|
1623
|
+
function ka(e, t, n) {
|
|
1624
1624
|
const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? nn, i = 2520, o = ue(e, t);
|
|
1625
1625
|
if (isNaN(o))
|
|
1626
1626
|
throw new RangeError("Invalid time value");
|
|
@@ -1630,7 +1630,7 @@ function Ma(e, t, n) {
|
|
|
1630
1630
|
});
|
|
1631
1631
|
let c, u;
|
|
1632
1632
|
o > 0 ? (c = p(t), u = p(e)) : (c = p(e), u = p(t));
|
|
1633
|
-
const l =
|
|
1633
|
+
const l = _r(u, c), f = (pe(u) - pe(c)) / 1e3, m = Math.round((l - f) / 60);
|
|
1634
1634
|
let h;
|
|
1635
1635
|
if (m < 2)
|
|
1636
1636
|
return n != null && n.includeSeconds ? l < 5 ? a.formatDistance("lessThanXSeconds", 5, s) : l < 10 ? a.formatDistance("lessThanXSeconds", 10, s) : l < 20 ? a.formatDistance("lessThanXSeconds", 20, s) : l < 40 ? a.formatDistance("halfAMinute", 0, s) : l < 60 ? a.formatDistance("lessThanXMinutes", 1, s) : a.formatDistance("xMinutes", 1, s) : m === 0 ? a.formatDistance("lessThanXMinutes", 1, s) : a.formatDistance("xMinutes", m, s);
|
|
@@ -1650,7 +1650,7 @@ function Ma(e, t, n) {
|
|
|
1650
1650
|
} else if (m < ie * 2)
|
|
1651
1651
|
return h = Math.round(m / ie), a.formatDistance("aboutXMonths", h, s);
|
|
1652
1652
|
}
|
|
1653
|
-
if (h =
|
|
1653
|
+
if (h = kr(u, c), h < 12) {
|
|
1654
1654
|
const d = Math.round(m / ie);
|
|
1655
1655
|
return a.formatDistance("xMonths", d, s);
|
|
1656
1656
|
} else {
|
|
@@ -1658,27 +1658,27 @@ function Ma(e, t, n) {
|
|
|
1658
1658
|
return d < 3 ? a.formatDistance("aboutXYears", S, s) : d < 9 ? a.formatDistance("overXYears", S, s) : a.formatDistance("almostXYears", S + 1, s);
|
|
1659
1659
|
}
|
|
1660
1660
|
}
|
|
1661
|
-
function
|
|
1662
|
-
return
|
|
1661
|
+
function _a(e, t) {
|
|
1662
|
+
return ka(e, pr(e), t);
|
|
1663
1663
|
}
|
|
1664
|
-
function
|
|
1664
|
+
function Na() {
|
|
1665
1665
|
return Object.assign({}, j());
|
|
1666
1666
|
}
|
|
1667
|
-
function
|
|
1668
|
-
const r =
|
|
1667
|
+
function $s(e, t) {
|
|
1668
|
+
const r = Ia(e);
|
|
1669
1669
|
let a;
|
|
1670
1670
|
if (r.date) {
|
|
1671
|
-
const c =
|
|
1672
|
-
a =
|
|
1671
|
+
const c = Fa(r.date, 2);
|
|
1672
|
+
a = Ca(c.restDateString, c.year);
|
|
1673
1673
|
}
|
|
1674
1674
|
if (!a || isNaN(a.getTime()))
|
|
1675
1675
|
return /* @__PURE__ */ new Date(NaN);
|
|
1676
1676
|
const i = a.getTime();
|
|
1677
1677
|
let o = 0, s;
|
|
1678
|
-
if (r.time && (o =
|
|
1678
|
+
if (r.time && (o = Pa(r.time), isNaN(o)))
|
|
1679
1679
|
return /* @__PURE__ */ new Date(NaN);
|
|
1680
1680
|
if (r.timezone) {
|
|
1681
|
-
if (s =
|
|
1681
|
+
if (s = Ya(r.timezone), isNaN(s))
|
|
1682
1682
|
return /* @__PURE__ */ new Date(NaN);
|
|
1683
1683
|
} else {
|
|
1684
1684
|
const c = new Date(i + o), u = /* @__PURE__ */ new Date(0);
|
|
@@ -1699,8 +1699,8 @@ const oe = {
|
|
|
1699
1699
|
dateTimeDelimiter: /[T ]/,
|
|
1700
1700
|
timeZoneDelimiter: /[Z ]/i,
|
|
1701
1701
|
timezone: /([Z+-].*)$/
|
|
1702
|
-
},
|
|
1703
|
-
function
|
|
1702
|
+
}, $a = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, Ea = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, Oa = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
1703
|
+
function Ia(e) {
|
|
1704
1704
|
const t = {}, n = e.split(oe.dateTimeDelimiter);
|
|
1705
1705
|
let r;
|
|
1706
1706
|
if (n.length > 2)
|
|
@@ -1714,7 +1714,7 @@ function Oa(e) {
|
|
|
1714
1714
|
}
|
|
1715
1715
|
return t;
|
|
1716
1716
|
}
|
|
1717
|
-
function
|
|
1717
|
+
function Fa(e, t) {
|
|
1718
1718
|
const n = new RegExp(
|
|
1719
1719
|
"^(?:(\\d{4}|[+-]\\d{" + (4 + t) + "})|(\\d{2}|[+-]\\d{" + (2 + t) + "})$)"
|
|
1720
1720
|
), r = e.match(n);
|
|
@@ -1725,87 +1725,87 @@ function Ia(e, t) {
|
|
|
1725
1725
|
restDateString: e.slice((r[1] || r[2]).length)
|
|
1726
1726
|
};
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1728
|
+
function Ca(e, t) {
|
|
1729
1729
|
if (t === null) return /* @__PURE__ */ new Date(NaN);
|
|
1730
|
-
const n = e.match(
|
|
1730
|
+
const n = e.match($a);
|
|
1731
1731
|
if (!n) return /* @__PURE__ */ new Date(NaN);
|
|
1732
1732
|
const r = !!n[4], a = Z(n[1]), i = Z(n[2]) - 1, o = Z(n[3]), s = Z(n[4]), c = Z(n[5]) - 1;
|
|
1733
1733
|
if (r)
|
|
1734
|
-
return
|
|
1734
|
+
return La(t, s, c) ? za(t, s, c) : /* @__PURE__ */ new Date(NaN);
|
|
1735
1735
|
{
|
|
1736
1736
|
const u = /* @__PURE__ */ new Date(0);
|
|
1737
|
-
return !
|
|
1737
|
+
return !Ra(t, i, o) || !Ua(t, a) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(t, i, Math.max(a, o)), u);
|
|
1738
1738
|
}
|
|
1739
1739
|
}
|
|
1740
1740
|
function Z(e) {
|
|
1741
1741
|
return e ? parseInt(e) : 1;
|
|
1742
1742
|
}
|
|
1743
|
-
function
|
|
1744
|
-
const t = e.match(
|
|
1743
|
+
function Pa(e) {
|
|
1744
|
+
const t = e.match(Ea);
|
|
1745
1745
|
if (!t) return NaN;
|
|
1746
1746
|
const n = _e(t[1]), r = _e(t[2]), a = _e(t[3]);
|
|
1747
|
-
return
|
|
1747
|
+
return Wa(n, r, a) ? n * en + r * Jt + a * 1e3 : NaN;
|
|
1748
1748
|
}
|
|
1749
1749
|
function _e(e) {
|
|
1750
1750
|
return e && parseFloat(e.replace(",", ".")) || 0;
|
|
1751
1751
|
}
|
|
1752
|
-
function
|
|
1752
|
+
function Ya(e) {
|
|
1753
1753
|
if (e === "Z") return 0;
|
|
1754
|
-
const t = e.match(
|
|
1754
|
+
const t = e.match(Oa);
|
|
1755
1755
|
if (!t) return 0;
|
|
1756
1756
|
const n = t[1] === "+" ? -1 : 1, r = parseInt(t[2]), a = t[3] && parseInt(t[3]) || 0;
|
|
1757
|
-
return
|
|
1757
|
+
return ja(r, a) ? n * (r * en + a * Jt) : NaN;
|
|
1758
1758
|
}
|
|
1759
|
-
function
|
|
1759
|
+
function za(e, t, n) {
|
|
1760
1760
|
const r = /* @__PURE__ */ new Date(0);
|
|
1761
1761
|
r.setUTCFullYear(e, 0, 4);
|
|
1762
1762
|
const a = r.getUTCDay() || 7, i = (t - 1) * 7 + n + 1 - a;
|
|
1763
1763
|
return r.setUTCDate(r.getUTCDate() + i), r;
|
|
1764
1764
|
}
|
|
1765
|
-
const
|
|
1765
|
+
const Aa = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
1766
1766
|
function on(e) {
|
|
1767
1767
|
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
1768
1768
|
}
|
|
1769
|
-
function
|
|
1770
|
-
return t >= 0 && t <= 11 && n >= 1 && n <= (
|
|
1769
|
+
function Ra(e, t, n) {
|
|
1770
|
+
return t >= 0 && t <= 11 && n >= 1 && n <= (Aa[t] || (on(e) ? 29 : 28));
|
|
1771
1771
|
}
|
|
1772
|
-
function
|
|
1772
|
+
function Ua(e, t) {
|
|
1773
1773
|
return t >= 1 && t <= (on(e) ? 366 : 365);
|
|
1774
1774
|
}
|
|
1775
|
-
function
|
|
1775
|
+
function La(e, t, n) {
|
|
1776
1776
|
return t >= 1 && t <= 53 && n >= 0 && n <= 6;
|
|
1777
1777
|
}
|
|
1778
|
-
function
|
|
1778
|
+
function Wa(e, t, n) {
|
|
1779
1779
|
return e === 24 ? t === 0 && n === 0 : n >= 0 && n < 60 && t >= 0 && t < 60 && e >= 0 && e < 25;
|
|
1780
1780
|
}
|
|
1781
|
-
function
|
|
1781
|
+
function ja(e, t) {
|
|
1782
1782
|
return t >= 0 && t <= 59;
|
|
1783
1783
|
}
|
|
1784
1784
|
function ht(e, t, n) {
|
|
1785
|
-
const r =
|
|
1786
|
-
return "formatToParts" in a ?
|
|
1785
|
+
const r = Na(), a = Za(e, n.timeZone, n.locale ?? r.locale);
|
|
1786
|
+
return "formatToParts" in a ? Ha(a, t) : qa(a, t);
|
|
1787
1787
|
}
|
|
1788
|
-
function
|
|
1788
|
+
function Ha(e, t) {
|
|
1789
1789
|
const n = e.formatToParts(t);
|
|
1790
1790
|
for (let r = n.length - 1; r >= 0; --r)
|
|
1791
1791
|
if (n[r].type === "timeZoneName")
|
|
1792
1792
|
return n[r].value;
|
|
1793
1793
|
}
|
|
1794
|
-
function
|
|
1794
|
+
function qa(e, t) {
|
|
1795
1795
|
const n = e.format(t).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
|
|
1796
1796
|
return r ? r[0].substr(1) : "";
|
|
1797
1797
|
}
|
|
1798
|
-
function
|
|
1798
|
+
function Za(e, t, n) {
|
|
1799
1799
|
return new Intl.DateTimeFormat(n ? [n.code, "en-US"] : void 0, {
|
|
1800
1800
|
timeZone: t,
|
|
1801
1801
|
timeZoneName: e
|
|
1802
1802
|
});
|
|
1803
1803
|
}
|
|
1804
|
-
function
|
|
1805
|
-
const n =
|
|
1806
|
-
return "formatToParts" in n ?
|
|
1804
|
+
function Xa(e, t) {
|
|
1805
|
+
const n = Qa(t);
|
|
1806
|
+
return "formatToParts" in n ? Ka(n, e) : Ba(n, e);
|
|
1807
1807
|
}
|
|
1808
|
-
const
|
|
1808
|
+
const Va = {
|
|
1809
1809
|
year: 0,
|
|
1810
1810
|
month: 1,
|
|
1811
1811
|
day: 2,
|
|
@@ -1813,11 +1813,11 @@ const Ka = {
|
|
|
1813
1813
|
minute: 4,
|
|
1814
1814
|
second: 5
|
|
1815
1815
|
};
|
|
1816
|
-
function
|
|
1816
|
+
function Ka(e, t) {
|
|
1817
1817
|
try {
|
|
1818
1818
|
const n = e.formatToParts(t), r = [];
|
|
1819
1819
|
for (let a = 0; a < n.length; a++) {
|
|
1820
|
-
const i =
|
|
1820
|
+
const i = Va[n[a].type];
|
|
1821
1821
|
i !== void 0 && (r[i] = parseInt(n[a].value, 10));
|
|
1822
1822
|
}
|
|
1823
1823
|
return r;
|
|
@@ -1847,9 +1847,9 @@ const Ne = {}, gt = new Intl.DateTimeFormat("en-US", {
|
|
|
1847
1847
|
hour: "2-digit",
|
|
1848
1848
|
minute: "2-digit",
|
|
1849
1849
|
second: "2-digit"
|
|
1850
|
-
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")),
|
|
1851
|
-
function
|
|
1852
|
-
return Ne[e] || (Ne[e] =
|
|
1850
|
+
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), Ga = gt === "06/25/2014, 00:00:00" || gt === "06/25/2014 00:00:00";
|
|
1851
|
+
function Qa(e) {
|
|
1852
|
+
return Ne[e] || (Ne[e] = Ga ? new Intl.DateTimeFormat("en-US", {
|
|
1853
1853
|
hourCycle: "h23",
|
|
1854
1854
|
timeZone: e,
|
|
1855
1855
|
year: "numeric",
|
|
@@ -1873,7 +1873,7 @@ function Ve(e, t, n, r, a, i, o) {
|
|
|
1873
1873
|
const s = /* @__PURE__ */ new Date(0);
|
|
1874
1874
|
return s.setUTCFullYear(e, t, n), s.setUTCHours(r, a, i, o), s;
|
|
1875
1875
|
}
|
|
1876
|
-
const yt = 36e5,
|
|
1876
|
+
const yt = 36e5, Ja = 6e4, $e = {
|
|
1877
1877
|
timezoneZ: /^(Z)$/,
|
|
1878
1878
|
timezoneHH: /^([+-]\d{2})$/,
|
|
1879
1879
|
timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
|
|
@@ -1890,25 +1890,25 @@ function ve(e, t, n) {
|
|
|
1890
1890
|
if (r = $e.timezoneHHMM.exec(e), r) {
|
|
1891
1891
|
a = parseInt(r[2], 10);
|
|
1892
1892
|
const o = parseInt(r[3], 10);
|
|
1893
|
-
return pt(a, o) ? (i = Math.abs(a) * yt + o *
|
|
1893
|
+
return pt(a, o) ? (i = Math.abs(a) * yt + o * Ja, r[1] === "+" ? -i : i) : NaN;
|
|
1894
1894
|
}
|
|
1895
|
-
if (
|
|
1895
|
+
if (ni(e)) {
|
|
1896
1896
|
t = new Date(t || Date.now());
|
|
1897
|
-
const o = n ? t :
|
|
1898
|
-
return -(n ? s :
|
|
1897
|
+
const o = n ? t : ei(t), s = Le(o, e);
|
|
1898
|
+
return -(n ? s : ti(t, s, e));
|
|
1899
1899
|
}
|
|
1900
1900
|
return NaN;
|
|
1901
1901
|
}
|
|
1902
|
-
function
|
|
1902
|
+
function ei(e) {
|
|
1903
1903
|
return Ve(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
|
|
1904
1904
|
}
|
|
1905
1905
|
function Le(e, t) {
|
|
1906
|
-
const n =
|
|
1906
|
+
const n = Xa(e, t), r = Ve(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
|
|
1907
1907
|
let a = e.getTime();
|
|
1908
1908
|
const i = a % 1e3;
|
|
1909
1909
|
return a -= i >= 0 ? i : 1e3 + i, r - a;
|
|
1910
1910
|
}
|
|
1911
|
-
function
|
|
1911
|
+
function ti(e, t, n) {
|
|
1912
1912
|
let a = e.getTime() - t;
|
|
1913
1913
|
const i = Le(new Date(a), n);
|
|
1914
1914
|
if (t === i)
|
|
@@ -1921,7 +1921,7 @@ function pt(e, t) {
|
|
|
1921
1921
|
return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
|
|
1922
1922
|
}
|
|
1923
1923
|
const wt = {};
|
|
1924
|
-
function
|
|
1924
|
+
function ni(e) {
|
|
1925
1925
|
if (wt[e])
|
|
1926
1926
|
return !0;
|
|
1927
1927
|
try {
|
|
@@ -1930,10 +1930,10 @@ function ti(e) {
|
|
|
1930
1930
|
return !1;
|
|
1931
1931
|
}
|
|
1932
1932
|
}
|
|
1933
|
-
const
|
|
1933
|
+
const ri = 60 * 1e3, ai = {
|
|
1934
1934
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1935
1935
|
X: function(e, t, n) {
|
|
1936
|
-
const r =
|
|
1936
|
+
const r = Ee(n.timeZone, e);
|
|
1937
1937
|
if (r === 0)
|
|
1938
1938
|
return "Z";
|
|
1939
1939
|
switch (t) {
|
|
@@ -1950,7 +1950,7 @@ const ni = 60 * 1e3, ri = {
|
|
|
1950
1950
|
},
|
|
1951
1951
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1952
1952
|
x: function(e, t, n) {
|
|
1953
|
-
const r =
|
|
1953
|
+
const r = Ee(n.timeZone, e);
|
|
1954
1954
|
switch (t) {
|
|
1955
1955
|
case "x":
|
|
1956
1956
|
return Tt(r);
|
|
@@ -1965,12 +1965,12 @@ const ni = 60 * 1e3, ri = {
|
|
|
1965
1965
|
},
|
|
1966
1966
|
// Timezone (GMT)
|
|
1967
1967
|
O: function(e, t, n) {
|
|
1968
|
-
const r =
|
|
1968
|
+
const r = Ee(n.timeZone, e);
|
|
1969
1969
|
switch (t) {
|
|
1970
1970
|
case "O":
|
|
1971
1971
|
case "OO":
|
|
1972
1972
|
case "OOO":
|
|
1973
|
-
return "GMT" +
|
|
1973
|
+
return "GMT" + ii(r, ":");
|
|
1974
1974
|
case "OOOO":
|
|
1975
1975
|
default:
|
|
1976
1976
|
return "GMT" + C(r, ":");
|
|
@@ -1989,8 +1989,8 @@ const ni = 60 * 1e3, ri = {
|
|
|
1989
1989
|
}
|
|
1990
1990
|
}
|
|
1991
1991
|
};
|
|
1992
|
-
function
|
|
1993
|
-
const n = e ? ve(e, t, !0) /
|
|
1992
|
+
function Ee(e, t) {
|
|
1993
|
+
const n = e ? ve(e, t, !0) / ri : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
|
|
1994
1994
|
if (Number.isNaN(n))
|
|
1995
1995
|
throw new RangeError("Invalid time zone specified: " + e);
|
|
1996
1996
|
return n;
|
|
@@ -2009,7 +2009,7 @@ function C(e, t = "") {
|
|
|
2009
2009
|
function Tt(e, t) {
|
|
2010
2010
|
return e % 60 === 0 ? (e > 0 ? "-" : "+") + we(Math.abs(e) / 60, 2) : C(e, t);
|
|
2011
2011
|
}
|
|
2012
|
-
function
|
|
2012
|
+
function ii(e, t = "") {
|
|
2013
2013
|
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.floor(r / 60), i = r % 60;
|
|
2014
2014
|
return i === 0 ? n + String(a) : n + String(a) + t + we(i, 2);
|
|
2015
2015
|
}
|
|
@@ -2017,7 +2017,7 @@ function Dt(e) {
|
|
|
2017
2017
|
const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
|
|
2018
2018
|
return t.setUTCFullYear(e.getFullYear()), +e - +t;
|
|
2019
2019
|
}
|
|
2020
|
-
const sn = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, Oe = 36e5,
|
|
2020
|
+
const sn = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, Oe = 36e5, bt = 6e4, oi = 2, b = {
|
|
2021
2021
|
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
|
|
2022
2022
|
datePattern: /^([0-9W+-]+)(.*)/,
|
|
2023
2023
|
// year tokens
|
|
@@ -2056,7 +2056,7 @@ function Te(e, t = {}) {
|
|
|
2056
2056
|
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
2057
2057
|
if (e === null)
|
|
2058
2058
|
return /* @__PURE__ */ new Date(NaN);
|
|
2059
|
-
const n = t.additionalDigits == null ?
|
|
2059
|
+
const n = t.additionalDigits == null ? oi : Number(t.additionalDigits);
|
|
2060
2060
|
if (n !== 2 && n !== 1 && n !== 0)
|
|
2061
2061
|
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
2062
2062
|
if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
|
|
@@ -2065,13 +2065,13 @@ function Te(e, t = {}) {
|
|
|
2065
2065
|
return new Date(e);
|
|
2066
2066
|
if (Object.prototype.toString.call(e) !== "[object String]")
|
|
2067
2067
|
return /* @__PURE__ */ new Date(NaN);
|
|
2068
|
-
const r =
|
|
2068
|
+
const r = si(e), { year: a, restDateString: i } = ci(r.date, n), o = ui(i, a);
|
|
2069
2069
|
if (o === null || isNaN(o.getTime()))
|
|
2070
2070
|
return /* @__PURE__ */ new Date(NaN);
|
|
2071
2071
|
if (o) {
|
|
2072
2072
|
const s = o.getTime();
|
|
2073
2073
|
let c = 0, u;
|
|
2074
|
-
if (r.time && (c =
|
|
2074
|
+
if (r.time && (c = li(r.time), c === null || isNaN(c)))
|
|
2075
2075
|
return /* @__PURE__ */ new Date(NaN);
|
|
2076
2076
|
if (r.timeZone || t.timeZone) {
|
|
2077
2077
|
if (u = ve(r.timeZone || t.timeZone, new Date(s + c)), isNaN(u))
|
|
@@ -2082,19 +2082,19 @@ function Te(e, t = {}) {
|
|
|
2082
2082
|
} else
|
|
2083
2083
|
return /* @__PURE__ */ new Date(NaN);
|
|
2084
2084
|
}
|
|
2085
|
-
function
|
|
2085
|
+
function si(e) {
|
|
2086
2086
|
const t = {};
|
|
2087
|
-
let n =
|
|
2088
|
-
if (n ? (t.date = n[1], r = n[3]) : (n =
|
|
2089
|
-
const a =
|
|
2087
|
+
let n = b.dateTimePattern.exec(e), r;
|
|
2088
|
+
if (n ? (t.date = n[1], r = n[3]) : (n = b.datePattern.exec(e), n ? (t.date = n[1], r = n[2]) : (t.date = null, r = e)), r) {
|
|
2089
|
+
const a = b.timeZone.exec(r);
|
|
2090
2090
|
a ? (t.time = r.replace(a[1], ""), t.timeZone = a[1].trim()) : t.time = r;
|
|
2091
2091
|
}
|
|
2092
2092
|
return t;
|
|
2093
2093
|
}
|
|
2094
|
-
function
|
|
2094
|
+
function ci(e, t) {
|
|
2095
2095
|
if (e) {
|
|
2096
|
-
const n =
|
|
2097
|
-
let a =
|
|
2096
|
+
const n = b.YYY[t], r = b.YYYYY[t];
|
|
2097
|
+
let a = b.YYYY.exec(e) || r.exec(e);
|
|
2098
2098
|
if (a) {
|
|
2099
2099
|
const i = a[1];
|
|
2100
2100
|
return {
|
|
@@ -2102,7 +2102,7 @@ function si(e, t) {
|
|
|
2102
2102
|
restDateString: e.slice(i.length)
|
|
2103
2103
|
};
|
|
2104
2104
|
}
|
|
2105
|
-
if (a =
|
|
2105
|
+
if (a = b.YY.exec(e) || n.exec(e), a) {
|
|
2106
2106
|
const i = a[1];
|
|
2107
2107
|
return {
|
|
2108
2108
|
year: parseInt(i, 10) * 100,
|
|
@@ -2114,55 +2114,55 @@ function si(e, t) {
|
|
|
2114
2114
|
year: null
|
|
2115
2115
|
};
|
|
2116
2116
|
}
|
|
2117
|
-
function
|
|
2117
|
+
function ui(e, t) {
|
|
2118
2118
|
if (t === null)
|
|
2119
2119
|
return null;
|
|
2120
2120
|
let n, r, a;
|
|
2121
2121
|
if (!e || !e.length)
|
|
2122
2122
|
return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(t), n;
|
|
2123
|
-
let i =
|
|
2123
|
+
let i = b.MM.exec(e);
|
|
2124
2124
|
if (i)
|
|
2125
2125
|
return n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1, vt(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
|
|
2126
|
-
if (i =
|
|
2126
|
+
if (i = b.DDD.exec(e), i) {
|
|
2127
2127
|
n = /* @__PURE__ */ new Date(0);
|
|
2128
2128
|
const o = parseInt(i[1], 10);
|
|
2129
|
-
return
|
|
2129
|
+
return di(t, o) ? (n.setUTCFullYear(t, 0, o), n) : /* @__PURE__ */ new Date(NaN);
|
|
2130
2130
|
}
|
|
2131
|
-
if (i =
|
|
2131
|
+
if (i = b.MMDD.exec(e), i) {
|
|
2132
2132
|
n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1;
|
|
2133
2133
|
const o = parseInt(i[2], 10);
|
|
2134
2134
|
return vt(t, r, o) ? (n.setUTCFullYear(t, r, o), n) : /* @__PURE__ */ new Date(NaN);
|
|
2135
2135
|
}
|
|
2136
|
-
if (i =
|
|
2137
|
-
return a = parseInt(i[1], 10) - 1, St(a) ?
|
|
2138
|
-
if (i =
|
|
2136
|
+
if (i = b.Www.exec(e), i)
|
|
2137
|
+
return a = parseInt(i[1], 10) - 1, St(a) ? xt(t, a) : /* @__PURE__ */ new Date(NaN);
|
|
2138
|
+
if (i = b.WwwD.exec(e), i) {
|
|
2139
2139
|
a = parseInt(i[1], 10) - 1;
|
|
2140
2140
|
const o = parseInt(i[2], 10) - 1;
|
|
2141
|
-
return St(a, o) ?
|
|
2141
|
+
return St(a, o) ? xt(t, a, o) : /* @__PURE__ */ new Date(NaN);
|
|
2142
2142
|
}
|
|
2143
2143
|
return null;
|
|
2144
2144
|
}
|
|
2145
|
-
function
|
|
2146
|
-
let t, n, r =
|
|
2145
|
+
function li(e) {
|
|
2146
|
+
let t, n, r = b.HH.exec(e);
|
|
2147
2147
|
if (r)
|
|
2148
2148
|
return t = parseFloat(r[1].replace(",", ".")), Ie(t) ? t % 24 * Oe : NaN;
|
|
2149
|
-
if (r =
|
|
2150
|
-
return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), Ie(t, n) ? t % 24 * Oe + n *
|
|
2151
|
-
if (r =
|
|
2149
|
+
if (r = b.HHMM.exec(e), r)
|
|
2150
|
+
return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), Ie(t, n) ? t % 24 * Oe + n * bt : NaN;
|
|
2151
|
+
if (r = b.HHMMSS.exec(e), r) {
|
|
2152
2152
|
t = parseInt(r[1], 10), n = parseInt(r[2], 10);
|
|
2153
2153
|
const a = parseFloat(r[3].replace(",", "."));
|
|
2154
|
-
return Ie(t, n, a) ? t % 24 * Oe + n *
|
|
2154
|
+
return Ie(t, n, a) ? t % 24 * Oe + n * bt + a * 1e3 : NaN;
|
|
2155
2155
|
}
|
|
2156
2156
|
return null;
|
|
2157
2157
|
}
|
|
2158
|
-
function
|
|
2158
|
+
function xt(e, t, n) {
|
|
2159
2159
|
t = t || 0, n = n || 0;
|
|
2160
2160
|
const r = /* @__PURE__ */ new Date(0);
|
|
2161
2161
|
r.setUTCFullYear(e, 0, 4);
|
|
2162
2162
|
const a = r.getUTCDay() || 7, i = t * 7 + n + 1 - a;
|
|
2163
2163
|
return r.setUTCDate(r.getUTCDate() + i), r;
|
|
2164
2164
|
}
|
|
2165
|
-
const
|
|
2165
|
+
const mi = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], fi = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
2166
2166
|
function cn(e) {
|
|
2167
2167
|
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
2168
2168
|
}
|
|
@@ -2173,12 +2173,12 @@ function vt(e, t, n) {
|
|
|
2173
2173
|
if (n < 1)
|
|
2174
2174
|
return !1;
|
|
2175
2175
|
const r = cn(e);
|
|
2176
|
-
if (r && n >
|
|
2176
|
+
if (r && n > fi[t] || !r && n > mi[t])
|
|
2177
2177
|
return !1;
|
|
2178
2178
|
}
|
|
2179
2179
|
return !0;
|
|
2180
2180
|
}
|
|
2181
|
-
function
|
|
2181
|
+
function di(e, t) {
|
|
2182
2182
|
if (t < 1)
|
|
2183
2183
|
return !1;
|
|
2184
2184
|
const n = cn(e);
|
|
@@ -2190,22 +2190,22 @@ function St(e, t) {
|
|
|
2190
2190
|
function Ie(e, t, n) {
|
|
2191
2191
|
return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || n != null && (n < 0 || n >= 60));
|
|
2192
2192
|
}
|
|
2193
|
-
const
|
|
2194
|
-
function
|
|
2193
|
+
const hi = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
|
|
2194
|
+
function gi(e, t, n = {}) {
|
|
2195
2195
|
t = String(t);
|
|
2196
|
-
const r = t.match(
|
|
2196
|
+
const r = t.match(hi);
|
|
2197
2197
|
if (r) {
|
|
2198
2198
|
const a = Te(n.originalDate || e, n);
|
|
2199
2199
|
t = r.reduce(function(i, o) {
|
|
2200
2200
|
if (o[0] === "'")
|
|
2201
2201
|
return i;
|
|
2202
|
-
const s = i.indexOf(o), c = i[s - 1] === "'", u = i.replace(o, "'" +
|
|
2202
|
+
const s = i.indexOf(o), c = i[s - 1] === "'", u = i.replace(o, "'" + ai[o[0]](a, o, n) + "'");
|
|
2203
2203
|
return c ? u.substring(0, s - 1) + u.substring(s + 1) : u;
|
|
2204
2204
|
}, t);
|
|
2205
2205
|
}
|
|
2206
|
-
return
|
|
2206
|
+
return Xe(e, t, n);
|
|
2207
2207
|
}
|
|
2208
|
-
function
|
|
2208
|
+
function yi(e, t, n) {
|
|
2209
2209
|
e = Te(e, n);
|
|
2210
2210
|
const r = ve(t, e, !0), a = new Date(e.getTime() - r), i = /* @__PURE__ */ new Date(0);
|
|
2211
2211
|
return i.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), i.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), i;
|
|
@@ -2215,7 +2215,7 @@ function un(e, t, n, r) {
|
|
|
2215
2215
|
...r,
|
|
2216
2216
|
timeZone: t,
|
|
2217
2217
|
originalDate: e
|
|
2218
|
-
},
|
|
2218
|
+
}, gi(yi(e, t, { timeZone: r.timeZone }), n, r);
|
|
2219
2219
|
}
|
|
2220
2220
|
function te(e, t, n) {
|
|
2221
2221
|
if (typeof e == "string" && !e.match(sn))
|
|
@@ -2224,10 +2224,10 @@ function te(e, t, n) {
|
|
|
2224
2224
|
const r = Ve(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), a = ve(t, new Date(r));
|
|
2225
2225
|
return new Date(r + a);
|
|
2226
2226
|
}
|
|
2227
|
-
function
|
|
2227
|
+
function Es(e, t) {
|
|
2228
2228
|
return e && e !== "auto" ? e : t;
|
|
2229
2229
|
}
|
|
2230
|
-
function
|
|
2230
|
+
function Os(e, t = /* @__PURE__ */ new Date()) {
|
|
2231
2231
|
try {
|
|
2232
2232
|
const n = {
|
|
2233
2233
|
timeZone: e,
|
|
@@ -2238,7 +2238,7 @@ function $s(e, t = /* @__PURE__ */ new Date()) {
|
|
|
2238
2238
|
return e;
|
|
2239
2239
|
}
|
|
2240
2240
|
}
|
|
2241
|
-
function
|
|
2241
|
+
function Is(e) {
|
|
2242
2242
|
try {
|
|
2243
2243
|
const t = {
|
|
2244
2244
|
timeZone: e,
|
|
@@ -2251,7 +2251,7 @@ function Fs(e) {
|
|
|
2251
2251
|
return e;
|
|
2252
2252
|
}
|
|
2253
2253
|
}
|
|
2254
|
-
function
|
|
2254
|
+
function Ke(e, t = "auto") {
|
|
2255
2255
|
if (!e)
|
|
2256
2256
|
return /* @__PURE__ */ new Date(NaN);
|
|
2257
2257
|
const n = e.endsWith("Z"), r = /[+-]\d{2}:?\d{2}$/.test(e), a = /\([A-Z]{3,4}\)$/.test(e);
|
|
@@ -2265,49 +2265,49 @@ function Be(e, t = "auto") {
|
|
|
2265
2265
|
return new Date(e);
|
|
2266
2266
|
} else return t === "UTC" ? n ? new Date(e) : r ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : n || r || a ? new Date(e) : te(e, t);
|
|
2267
2267
|
}
|
|
2268
|
-
const
|
|
2268
|
+
const pi = "MM/dd/yyyy", wi = (e, t, n, r = "auto") => {
|
|
2269
2269
|
if (!e)
|
|
2270
2270
|
return "";
|
|
2271
2271
|
try {
|
|
2272
|
-
const a =
|
|
2272
|
+
const a = Ke(e, r);
|
|
2273
2273
|
if (isNaN(a.getTime()))
|
|
2274
2274
|
return e;
|
|
2275
|
-
const o = (t && t.trim() ? t :
|
|
2276
|
-
return n && n !== "auto" ? un(a, n, o) :
|
|
2275
|
+
const o = (t && t.trim() ? t : pi).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
|
|
2276
|
+
return n && n !== "auto" ? un(a, n, o) : Xe(a, o);
|
|
2277
2277
|
} catch (a) {
|
|
2278
2278
|
return console.error("Date formatting error:", a), e;
|
|
2279
2279
|
}
|
|
2280
2280
|
};
|
|
2281
|
-
function
|
|
2281
|
+
function Fs(e, t, n = "auto") {
|
|
2282
2282
|
if (e)
|
|
2283
2283
|
try {
|
|
2284
|
-
const r =
|
|
2284
|
+
const r = Ke(e, n);
|
|
2285
2285
|
if (isNaN(r.getTime())) return;
|
|
2286
|
-
const a = "yyyy M d H m s", i = t && t !== "auto" ? un(r, t, a) :
|
|
2286
|
+
const a = "yyyy M d H m s", i = t && t !== "auto" ? un(r, t, a) : Xe(r, a), [o, s, c, u, l, f] = i.split(" ").map(Number);
|
|
2287
2287
|
return { year: o, month: s, day: c, hour: u, minute: l, second: f };
|
|
2288
2288
|
} catch {
|
|
2289
2289
|
return;
|
|
2290
2290
|
}
|
|
2291
2291
|
}
|
|
2292
|
-
const
|
|
2292
|
+
const Ti = (e, t = "auto") => {
|
|
2293
2293
|
if (!e)
|
|
2294
2294
|
return "";
|
|
2295
2295
|
try {
|
|
2296
|
-
const n =
|
|
2297
|
-
return isNaN(n.getTime()) ? e :
|
|
2296
|
+
const n = Ke(e, t);
|
|
2297
|
+
return isNaN(n.getTime()) ? e : _a(n, { addSuffix: !0 });
|
|
2298
2298
|
} catch (n) {
|
|
2299
2299
|
return console.error("Relative time formatting error:", n), e;
|
|
2300
2300
|
}
|
|
2301
2301
|
};
|
|
2302
|
-
function
|
|
2302
|
+
function Di(e, t, n, r) {
|
|
2303
2303
|
const a = e instanceof Date ? e.toISOString() : String(e), i = (r == null ? void 0 : r.browserTimezone) || n, o = (r == null ? void 0 : r.isSqlCard) ?? !1;
|
|
2304
2304
|
if (t != null && t.useRelativeTime)
|
|
2305
|
-
return
|
|
2305
|
+
return Ti(
|
|
2306
2306
|
a,
|
|
2307
2307
|
(t == null ? void 0 : t.sourceTimezone) || "auto"
|
|
2308
2308
|
);
|
|
2309
2309
|
const s = t != null && t.useCustomFormat && (t != null && t.customFormat) ? t.customFormat : (t == null ? void 0 : t.format) || "MM/dd/yyyy";
|
|
2310
|
-
return
|
|
2310
|
+
return wi(
|
|
2311
2311
|
a,
|
|
2312
2312
|
s,
|
|
2313
2313
|
t != null && t.timezone && (t == null ? void 0 : t.timezone) !== "auto" ? t.timezone : o ? i : n,
|
|
@@ -2318,18 +2318,18 @@ function ln(e, t, n) {
|
|
|
2318
2318
|
var o, s;
|
|
2319
2319
|
if (e == null)
|
|
2320
2320
|
return e === null ? ((o = n.absence) == null ? void 0 : o.nullText) ?? "" : ((s = n.absence) == null ? void 0 : s.emptyText) ?? "";
|
|
2321
|
-
const r =
|
|
2321
|
+
const r = zn(e) ? e : void 0, a = r ? r.value : e, i = r ?? (typeof e == "number" ? e : void 0);
|
|
2322
2322
|
if (!n.useFormattedValues || !t)
|
|
2323
2323
|
return String(a);
|
|
2324
2324
|
switch (t.type) {
|
|
2325
2325
|
case "number":
|
|
2326
|
-
return i !== void 0 ?
|
|
2326
|
+
return i !== void 0 ? fr(
|
|
2327
2327
|
i,
|
|
2328
2328
|
t.numberFormat,
|
|
2329
2329
|
n.locale
|
|
2330
2330
|
) : String(a);
|
|
2331
2331
|
case "date":
|
|
2332
|
-
return
|
|
2332
|
+
return Di(
|
|
2333
2333
|
a,
|
|
2334
2334
|
t.dateFormat,
|
|
2335
2335
|
n.timezone,
|
|
@@ -2348,7 +2348,7 @@ function ln(e, t, n) {
|
|
|
2348
2348
|
return String(a);
|
|
2349
2349
|
}
|
|
2350
2350
|
}
|
|
2351
|
-
function
|
|
2351
|
+
function Cs(e, t) {
|
|
2352
2352
|
return t.visibleColumns.map((n) => {
|
|
2353
2353
|
const r = e[n], a = t.columnSettings[n];
|
|
2354
2354
|
return ln(r, a, {
|
|
@@ -2358,43 +2358,50 @@ function Is(e, t) {
|
|
|
2358
2358
|
});
|
|
2359
2359
|
});
|
|
2360
2360
|
}
|
|
2361
|
-
const
|
|
2361
|
+
const mn = 1e4, bi = 1e6, Ps = 5e6, Ys = 1024 ** 3, zs = 1024 ** 3;
|
|
2362
|
+
function As(e) {
|
|
2363
|
+
return e > mn;
|
|
2364
|
+
}
|
|
2365
|
+
function Rs(e) {
|
|
2366
|
+
return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= mn ? "direct" : e.loadedRowCount <= bi ? "background" : "blocked";
|
|
2367
|
+
}
|
|
2368
|
+
const xi = 5 * 1024 * 1024, Us = 64 * 1024 * 1024, De = w.number().int().positive().max(Number.MAX_SAFE_INTEGER), le = w.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER), be = le.refine((e) => e > 0), vi = (e) => !!e && e !== "." && e !== ".." && !e.includes("/") && !e.includes("\\");
|
|
2362
2369
|
function P(e, t) {
|
|
2363
2370
|
const n = t.split("/");
|
|
2364
|
-
if (n.length !== 5 || n[0] !== "exports" || n[1] !== e || n[2] !== "attempts" || !n.every(
|
|
2371
|
+
if (n.length !== 5 || n[0] !== "exports" || n[1] !== e || n[2] !== "attempts" || !n.every(vi))
|
|
2365
2372
|
throw new Error("Invalid Matrix export artifact namespace.");
|
|
2366
2373
|
return { attemptId: n[3], filename: n[4] };
|
|
2367
2374
|
}
|
|
2368
|
-
function
|
|
2375
|
+
function Ls(e, t, n) {
|
|
2369
2376
|
const r = `exports/${e}/attempts/${t}/${n}`;
|
|
2370
2377
|
return P(e, r), r;
|
|
2371
2378
|
}
|
|
2372
|
-
const
|
|
2379
|
+
const Ws = w.object({
|
|
2373
2380
|
acquisition: w.literal("continuation"),
|
|
2374
2381
|
jobId: w.string().min(1),
|
|
2375
|
-
sequence:
|
|
2382
|
+
sequence: be,
|
|
2376
2383
|
deadlineAt: De
|
|
2377
|
-
}),
|
|
2384
|
+
}), Si = [
|
|
2378
2385
|
"application/json",
|
|
2379
|
-
...
|
|
2380
|
-
],
|
|
2386
|
+
...Ut.map((e) => Lt(e).partContentType)
|
|
2387
|
+
], Mi = w.object({
|
|
2381
2388
|
key: w.string(),
|
|
2382
2389
|
content: w.string(),
|
|
2383
|
-
contentType: w.enum(
|
|
2390
|
+
contentType: w.enum(Si),
|
|
2384
2391
|
encoding: w.literal("gzip-base64").optional()
|
|
2385
2392
|
// Transport-only compression: JSON (layout, sheet layout) and Excel rows. CSV travels as it always has.
|
|
2386
|
-
}).refine((e) => !e.encoding || e.contentType === "application/json" || e.contentType === Lt("xlsx").partContentType, "Unsupported Matrix artifact encoding."),
|
|
2387
|
-
w.object({ kind: w.literal("work"), sequence:
|
|
2388
|
-
w.object({ kind: w.literal("committed"), sequence:
|
|
2393
|
+
}).refine((e) => !e.encoding || e.contentType === "application/json" || e.contentType === Lt("xlsx").partContentType, "Unsupported Matrix artifact encoding."), ki = w.discriminatedUnion("kind", [
|
|
2394
|
+
w.object({ kind: w.literal("work"), sequence: be, checkpointKey: w.string(), objects: w.array(Mi).min(2).max(4), deadlineAt: De }),
|
|
2395
|
+
w.object({ kind: w.literal("committed"), sequence: be, done: w.boolean(), deadlineAt: De })
|
|
2389
2396
|
]);
|
|
2390
|
-
function
|
|
2397
|
+
function _i(e) {
|
|
2391
2398
|
const t = JSON.stringify(e);
|
|
2392
|
-
if (t === void 0 || new TextEncoder().encode(t).byteLength >
|
|
2399
|
+
if (t === void 0 || new TextEncoder().encode(t).byteLength > xi)
|
|
2393
2400
|
throw new RangeError("Matrix export batch exceeds its transport byte limit.");
|
|
2394
2401
|
}
|
|
2395
|
-
function
|
|
2396
|
-
const n =
|
|
2397
|
-
if (
|
|
2402
|
+
function js(e, t) {
|
|
2403
|
+
const n = ki.parse(e);
|
|
2404
|
+
if (_i(e), n.deadlineAt !== t.deadlineAt) throw new Error("Matrix deadline does not match the job.");
|
|
2398
2405
|
if (n.sequence !== t.sequence + (n.kind === "committed" ? 1 : 0))
|
|
2399
2406
|
throw new Error("Invalid Matrix batch sequence.");
|
|
2400
2407
|
if (n.kind === "work") {
|
|
@@ -2404,28 +2411,28 @@ function Ys(e, t) {
|
|
|
2404
2411
|
}
|
|
2405
2412
|
return n;
|
|
2406
2413
|
}
|
|
2407
|
-
const
|
|
2414
|
+
const Ni = w.object({
|
|
2408
2415
|
acquisition: w.literal("continuation"),
|
|
2409
2416
|
deadlineAt: De,
|
|
2410
|
-
chunks: w.array(w.object({ chunkNumber:
|
|
2417
|
+
chunks: w.array(w.object({ chunkNumber: be, dataKey: w.string() })).min(1),
|
|
2411
2418
|
totalRows: le,
|
|
2412
2419
|
totalBytes: le,
|
|
2413
2420
|
fileKey: w.string().min(1).optional(),
|
|
2414
2421
|
fileSize: le.optional(),
|
|
2415
2422
|
/** The file the job writes; absent means CSV (manifests from before Excel). */
|
|
2416
|
-
format: w.enum(
|
|
2423
|
+
format: w.enum(Ut).optional(),
|
|
2417
2424
|
/** Excel only: the sheet layout the layout batch stored, which compaction wraps the rows in. */
|
|
2418
2425
|
sheetKey: w.string().min(1).optional()
|
|
2419
2426
|
}).refine((e) => e.fileKey === void 0 == (e.fileSize === void 0), "Incomplete published Matrix artifact.").refine((e) => e.format === "xlsx" == (e.sheetKey !== void 0), "An Excel Matrix manifest names its sheet layout, and only it does.");
|
|
2420
|
-
function
|
|
2421
|
-
const r =
|
|
2427
|
+
function Hs(e, t, n) {
|
|
2428
|
+
const r = Ni.parse(e);
|
|
2422
2429
|
if (r.deadlineAt !== n) throw new Error("Matrix deadline does not match the job.");
|
|
2423
2430
|
return r.chunks.forEach((a, i) => {
|
|
2424
2431
|
if (a.chunkNumber !== i + 1) throw new Error("Invalid committed Matrix chunk order.");
|
|
2425
2432
|
P(t, a.dataKey);
|
|
2426
2433
|
}), r.fileKey !== void 0 && P(t, r.fileKey), r.sheetKey !== void 0 && P(t, r.sheetKey), r;
|
|
2427
2434
|
}
|
|
2428
|
-
const
|
|
2435
|
+
const $i = "en-US", Mt = [
|
|
2429
2436
|
"compact",
|
|
2430
2437
|
"maximumFractionDigits",
|
|
2431
2438
|
"minimumFractionDigits",
|
|
@@ -2433,7 +2440,7 @@ const _i = "en-US", Mt = [
|
|
|
2433
2440
|
"type",
|
|
2434
2441
|
"useGrouping"
|
|
2435
2442
|
];
|
|
2436
|
-
function
|
|
2443
|
+
function Ei(e) {
|
|
2437
2444
|
if (e.type !== "currency" || Object.prototype.hasOwnProperty.call(e, "currency") || Object.prototype.hasOwnProperty.call(e, "locale"))
|
|
2438
2445
|
return !1;
|
|
2439
2446
|
const t = Object.keys(e).sort();
|
|
@@ -2452,10 +2459,10 @@ function me(e) {
|
|
|
2452
2459
|
if (!(typeof e != "number" || !Number.isFinite(e)))
|
|
2453
2460
|
return Math.max(0, Math.min(10, Math.trunc(e)));
|
|
2454
2461
|
}
|
|
2455
|
-
function
|
|
2462
|
+
function Oi(e) {
|
|
2456
2463
|
return e === "currency" ? 2 : e === "percent" ? 1 : e === "scientific" ? 2 : 0;
|
|
2457
2464
|
}
|
|
2458
|
-
function
|
|
2465
|
+
function Ii(e, t, n) {
|
|
2459
2466
|
const r = me(t.minimumFractionDigits), a = me(t.maximumFractionDigits);
|
|
2460
2467
|
if (typeof r == "number" || typeof a == "number") {
|
|
2461
2468
|
const s = r ?? 0, c = a ?? Math.max(s, 2);
|
|
@@ -2472,18 +2479,18 @@ function Fi(e, t, n) {
|
|
|
2472
2479
|
};
|
|
2473
2480
|
if (n != null && n.preserveOmittedProperties)
|
|
2474
2481
|
return {};
|
|
2475
|
-
const o =
|
|
2482
|
+
const o = Oi(e);
|
|
2476
2483
|
return {
|
|
2477
2484
|
minimumFractionDigits: o,
|
|
2478
2485
|
maximumFractionDigits: o
|
|
2479
2486
|
};
|
|
2480
2487
|
}
|
|
2481
|
-
function
|
|
2488
|
+
function Fi(e, t) {
|
|
2482
2489
|
if (!(typeof t != "string" || e === "percent" && t === "%"))
|
|
2483
2490
|
return t;
|
|
2484
2491
|
}
|
|
2485
2492
|
function _t(e) {
|
|
2486
|
-
const t = kt(e.locale), n = kt(e.currency), r =
|
|
2493
|
+
const t = kt(e.locale), n = kt(e.currency), r = Fi(e.type, e.suffix);
|
|
2487
2494
|
return {
|
|
2488
2495
|
...e,
|
|
2489
2496
|
...t !== e.locale ? { locale: t } : {},
|
|
@@ -2491,11 +2498,11 @@ function _t(e) {
|
|
|
2491
2498
|
...r !== e.suffix ? { suffix: r } : {}
|
|
2492
2499
|
};
|
|
2493
2500
|
}
|
|
2494
|
-
function
|
|
2501
|
+
function E(e, t, n) {
|
|
2495
2502
|
const r = { ...t, type: e };
|
|
2496
2503
|
if ((n == null ? void 0 : n.numericInput) === "canonical" && J(r))
|
|
2497
2504
|
return _t(r);
|
|
2498
|
-
const a =
|
|
2505
|
+
const a = Ii(e, t, n), i = typeof t.prefix == "string" ? t.prefix : void 0, o = {
|
|
2499
2506
|
type: e,
|
|
2500
2507
|
locale: t.locale,
|
|
2501
2508
|
minimumFractionDigits: a.minimumFractionDigits,
|
|
@@ -2513,7 +2520,7 @@ function F(e, t, n) {
|
|
|
2513
2520
|
function Nt(e) {
|
|
2514
2521
|
return {
|
|
2515
2522
|
type: "date",
|
|
2516
|
-
locale: e.locale ||
|
|
2523
|
+
locale: e.locale || $i,
|
|
2517
2524
|
pattern: e.pattern,
|
|
2518
2525
|
// A stored pattern's token set and a preset carry to every reader (column formats ledger P5-45).
|
|
2519
2526
|
...e.dialect ? { dialect: e.dialect } : {},
|
|
@@ -2525,68 +2532,68 @@ function Nt(e) {
|
|
|
2525
2532
|
suffix: e.suffix
|
|
2526
2533
|
};
|
|
2527
2534
|
}
|
|
2528
|
-
function
|
|
2535
|
+
function Fe(e) {
|
|
2529
2536
|
return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
|
|
2530
2537
|
}
|
|
2531
2538
|
function $t(e) {
|
|
2532
2539
|
const t = me(e.maxUnits);
|
|
2533
2540
|
return {
|
|
2534
2541
|
type: "duration",
|
|
2535
|
-
inputUnit:
|
|
2542
|
+
inputUnit: Fe(e.inputUnit) ? e.inputUnit : "second",
|
|
2536
2543
|
outputStyle: e.outputStyle === "digital" || e.outputStyle === "long" ? e.outputStyle : "compact",
|
|
2537
|
-
largestUnit:
|
|
2538
|
-
smallestUnit:
|
|
2544
|
+
largestUnit: Fe(e.largestUnit) ? e.largestUnit : void 0,
|
|
2545
|
+
smallestUnit: Fe(e.smallestUnit) ? e.smallestUnit : "second",
|
|
2539
2546
|
maxUnits: t,
|
|
2540
2547
|
prefix: e.prefix,
|
|
2541
2548
|
suffix: e.suffix,
|
|
2542
2549
|
negativeStyle: e.negativeStyle || "minus"
|
|
2543
2550
|
};
|
|
2544
2551
|
}
|
|
2545
|
-
function
|
|
2552
|
+
function Et(e) {
|
|
2546
2553
|
return {
|
|
2547
2554
|
type: "string",
|
|
2548
2555
|
prefix: e.prefix,
|
|
2549
2556
|
suffix: e.suffix
|
|
2550
2557
|
};
|
|
2551
2558
|
}
|
|
2552
|
-
function
|
|
2559
|
+
function Ci(e, t) {
|
|
2553
2560
|
if (!e)
|
|
2554
2561
|
return;
|
|
2555
2562
|
if (typeof e == "string") {
|
|
2556
2563
|
const r = e.trim().toLowerCase();
|
|
2557
|
-
return r === "currency" ?
|
|
2564
|
+
return r === "currency" ? E(
|
|
2558
2565
|
"currency",
|
|
2559
2566
|
{ type: "currency" },
|
|
2560
2567
|
t
|
|
2561
|
-
) : r === "percentage" || r === "percent" ?
|
|
2568
|
+
) : r === "percentage" || r === "percent" ? E(
|
|
2562
2569
|
"percent",
|
|
2563
2570
|
{
|
|
2564
2571
|
type: "percentage",
|
|
2565
2572
|
percentValueMode: "fraction"
|
|
2566
2573
|
},
|
|
2567
2574
|
t
|
|
2568
|
-
) : r === "scientific" ?
|
|
2575
|
+
) : r === "scientific" ? E(
|
|
2569
2576
|
"scientific",
|
|
2570
2577
|
{ type: "scientific" },
|
|
2571
2578
|
t
|
|
2572
|
-
) : r === "date" ? Nt({}) : r === "duration" ? $t({}) : r === "string" ?
|
|
2579
|
+
) : r === "date" ? Nt({}) : r === "duration" ? $t({}) : r === "string" ? Et({}) : r === "number" ? E(
|
|
2573
2580
|
"number",
|
|
2574
2581
|
{ type: "number" },
|
|
2575
2582
|
t
|
|
2576
2583
|
) : void 0;
|
|
2577
2584
|
}
|
|
2578
2585
|
if ("type" in e && e.type === "temporal_bucket") {
|
|
2579
|
-
const r =
|
|
2586
|
+
const r = Hn.safeParse(e);
|
|
2580
2587
|
return r.success ? r.data : void 0;
|
|
2581
2588
|
}
|
|
2582
2589
|
const n = e;
|
|
2583
2590
|
if ((t == null ? void 0 : t.numericInput) === "canonical") {
|
|
2584
2591
|
const r = n.type === "percentage" ? { ...n, type: "percent" } : n;
|
|
2585
2592
|
if (J(r))
|
|
2586
|
-
return
|
|
2593
|
+
return E(r.type, r, t);
|
|
2587
2594
|
}
|
|
2588
2595
|
if (n.type === "percentage")
|
|
2589
|
-
return
|
|
2596
|
+
return E(
|
|
2590
2597
|
"percent",
|
|
2591
2598
|
{
|
|
2592
2599
|
...n,
|
|
@@ -2595,22 +2602,22 @@ function Ii(e, t) {
|
|
|
2595
2602
|
t
|
|
2596
2603
|
);
|
|
2597
2604
|
if (n.type === "number" || n.type === "currency" || n.type === "percent" || n.type === "scientific") {
|
|
2598
|
-
const r =
|
|
2605
|
+
const r = E(
|
|
2599
2606
|
n.type,
|
|
2600
2607
|
n,
|
|
2601
2608
|
t
|
|
2602
2609
|
);
|
|
2603
|
-
return
|
|
2610
|
+
return Ei(n) ? { ...r, currency: "USD" } : r;
|
|
2604
2611
|
}
|
|
2605
2612
|
if (n.type === "date")
|
|
2606
2613
|
return Nt(n);
|
|
2607
2614
|
if (n.type === "duration")
|
|
2608
2615
|
return $t(n);
|
|
2609
2616
|
if (n.type === "string")
|
|
2610
|
-
return
|
|
2617
|
+
return Et(n);
|
|
2611
2618
|
}
|
|
2612
|
-
const
|
|
2613
|
-
function
|
|
2619
|
+
const Pi = Object.freeze({ source: "automatic" });
|
|
2620
|
+
function Yi(e, t) {
|
|
2614
2621
|
var r, a;
|
|
2615
2622
|
const n = e.preferences;
|
|
2616
2623
|
switch (t) {
|
|
@@ -2633,11 +2640,11 @@ function Ot(e, t) {
|
|
|
2633
2640
|
...n.pivotByColumns ?? []
|
|
2634
2641
|
].find((r) => r.id === t);
|
|
2635
2642
|
}
|
|
2636
|
-
function
|
|
2643
|
+
function zi(e, t) {
|
|
2637
2644
|
if (t.kind === "field") return Ot(e, t.fieldId);
|
|
2638
2645
|
if (t.kind === "pivot") return Ot(e, t.metricId);
|
|
2639
2646
|
}
|
|
2640
|
-
function
|
|
2647
|
+
function Ai(e, t, n) {
|
|
2641
2648
|
var r, a, i, o, s, c, u, l, f;
|
|
2642
2649
|
switch (t.kind) {
|
|
2643
2650
|
case "field":
|
|
@@ -2653,50 +2660,50 @@ function Yi(e, t, n) {
|
|
|
2653
2660
|
return (f = (l = e.config) == null ? void 0 : l.matrix) == null ? void 0 : f.presentation.levelFormats[t.levelId];
|
|
2654
2661
|
}
|
|
2655
2662
|
}
|
|
2656
|
-
function
|
|
2663
|
+
function Ri(e) {
|
|
2657
2664
|
if (!e) return;
|
|
2658
2665
|
if (e.format && e.formatOrigin !== "override") return e.format;
|
|
2659
2666
|
const t = e.semanticTemporalPresentation;
|
|
2660
2667
|
return t && t.granularity === e.granularity ? t.format : void 0;
|
|
2661
2668
|
}
|
|
2662
|
-
function
|
|
2663
|
-
return e.surface ? { format: e.surface, source: "surface" } : e.override ? { format: e.override, source: "override" } : e.model ? { format: e.model, source: "model" } : e.snapshot ? { format: e.snapshot, source: "snapshot" } :
|
|
2669
|
+
function Be(e) {
|
|
2670
|
+
return e.surface ? { format: e.surface, source: "surface" } : e.override ? { format: e.override, source: "override" } : e.model ? { format: e.model, source: "model" } : e.snapshot ? { format: e.snapshot, source: "snapshot" } : Pi;
|
|
2664
2671
|
}
|
|
2665
2672
|
function Ui(e) {
|
|
2666
2673
|
var o;
|
|
2667
|
-
const { card: t, column: n, surface: r } = e, a =
|
|
2668
|
-
return
|
|
2669
|
-
surface: r ?
|
|
2670
|
-
override:
|
|
2674
|
+
const { card: t, column: n, surface: r } = e, a = zi(t, n), i = n.kind === "field" ? n.fieldId : n.kind === "pivot" ? n.metricId : void 0;
|
|
2675
|
+
return Be({
|
|
2676
|
+
surface: r ? Yi(t, r) : void 0,
|
|
2677
|
+
override: Ai(t, n, a),
|
|
2671
2678
|
model: (i !== void 0 ? (o = e.modelFormats) == null ? void 0 : o[i] : void 0) ?? e.catalogFormat,
|
|
2672
|
-
snapshot:
|
|
2679
|
+
snapshot: Ri(a)
|
|
2673
2680
|
});
|
|
2674
2681
|
}
|
|
2675
|
-
function
|
|
2682
|
+
function Li(e, t) {
|
|
2676
2683
|
const n = (r) => r && typeof r == "object" && !Array.isArray(r) ? Object.fromEntries(
|
|
2677
2684
|
Object.keys(r).sort().map((a) => [a, n(r[a])])
|
|
2678
2685
|
) : r;
|
|
2679
2686
|
return JSON.stringify(n(e)) === JSON.stringify(n(t));
|
|
2680
2687
|
}
|
|
2681
|
-
const
|
|
2682
|
-
function
|
|
2688
|
+
const Wi = ["metricColumns", "groupByColumns", "detailColumns", "pivotByColumns"], It = /* @__PURE__ */ new WeakMap();
|
|
2689
|
+
function qs(e, t) {
|
|
2683
2690
|
const n = t == null ? void 0 : t.modelFormats;
|
|
2684
2691
|
if (!e || !n || Object.keys(n).length === 0) return e;
|
|
2685
2692
|
let r = It.get(e);
|
|
2686
2693
|
if (r || It.set(e, r = /* @__PURE__ */ new WeakMap()), r.has(n)) return r.get(n);
|
|
2687
|
-
const a =
|
|
2694
|
+
const a = ji(e, n);
|
|
2688
2695
|
return r.set(n, a), a;
|
|
2689
2696
|
}
|
|
2690
|
-
function
|
|
2697
|
+
function ji(e, t) {
|
|
2691
2698
|
const n = { config: e };
|
|
2692
2699
|
let r;
|
|
2693
|
-
for (const a of
|
|
2700
|
+
for (const a of Wi) {
|
|
2694
2701
|
const i = e[a];
|
|
2695
2702
|
if (!(i != null && i.length)) continue;
|
|
2696
2703
|
let o = !1;
|
|
2697
2704
|
const s = i.map((c) => {
|
|
2698
2705
|
const u = Ui({ card: n, column: { kind: "field", fieldId: c.id }, modelFormats: t });
|
|
2699
|
-
return u.source !== "model" ||
|
|
2706
|
+
return u.source !== "model" || Li(u.format, c.format) ? c : (o = !0, { ...c, format: u.format });
|
|
2700
2707
|
});
|
|
2701
2708
|
o && ((r ?? (r = { ...e }))[a] = s);
|
|
2702
2709
|
}
|
|
@@ -2713,7 +2720,7 @@ function T(e) {
|
|
|
2713
2720
|
) ? t.constructor : void 0;
|
|
2714
2721
|
return typeof n == "function" && Function.prototype.toString.call(n) === Function.prototype.toString.call(Object);
|
|
2715
2722
|
}
|
|
2716
|
-
const
|
|
2723
|
+
const Hi = [
|
|
2717
2724
|
"type",
|
|
2718
2725
|
"locale",
|
|
2719
2726
|
"minimumFractionDigits",
|
|
@@ -2728,13 +2735,13 @@ const Wi = [
|
|
|
2728
2735
|
"percentValueMode",
|
|
2729
2736
|
"signDisplay"
|
|
2730
2737
|
];
|
|
2731
|
-
function
|
|
2738
|
+
function qi(e) {
|
|
2732
2739
|
if (!T(e))
|
|
2733
2740
|
return {
|
|
2734
2741
|
ok: !1,
|
|
2735
2742
|
issues: [{ path: "$", message: "Numeric format must be an object." }]
|
|
2736
2743
|
};
|
|
2737
|
-
const t = [], n = new Set(
|
|
2744
|
+
const t = [], n = new Set(Hi);
|
|
2738
2745
|
Object.keys(e).filter((i) => !n.has(i)).forEach(
|
|
2739
2746
|
(i) => t.push({ path: i, message: `Unknown property "${i}".` })
|
|
2740
2747
|
), e.type !== "number" && e.type !== "currency" && e.type !== "percent" && e.type !== "scientific" && t.push({
|
|
@@ -2743,7 +2750,7 @@ function ji(e) {
|
|
|
2743
2750
|
});
|
|
2744
2751
|
const r = e.locale === void 0 ? void 0 : Q(e.locale);
|
|
2745
2752
|
e.locale !== void 0 && !r && t.push({ path: "locale", message: "Expected a supported BCP 47 locale." });
|
|
2746
|
-
const a = e.currency === void 0 ? void 0 :
|
|
2753
|
+
const a = e.currency === void 0 ? void 0 : Ae(e.currency);
|
|
2747
2754
|
e.currency !== void 0 && !a && t.push({
|
|
2748
2755
|
path: "currency",
|
|
2749
2756
|
message: "Expected a supported ISO 4217 currency code."
|
|
@@ -2797,8 +2804,8 @@ function ji(e) {
|
|
|
2797
2804
|
}
|
|
2798
2805
|
};
|
|
2799
2806
|
}
|
|
2800
|
-
function
|
|
2801
|
-
const t =
|
|
2807
|
+
function Zi(e) {
|
|
2808
|
+
const t = qi(e);
|
|
2802
2809
|
if (!t.ok)
|
|
2803
2810
|
return t;
|
|
2804
2811
|
const n = [];
|
|
@@ -2816,7 +2823,7 @@ function Hi(e) {
|
|
|
2816
2823
|
message: "Resolved currency formats require an explicit currency."
|
|
2817
2824
|
}), n.length > 0 ? { ok: !1, issues: n } : t;
|
|
2818
2825
|
}
|
|
2819
|
-
function
|
|
2826
|
+
function Zs(e) {
|
|
2820
2827
|
var r;
|
|
2821
2828
|
const t = /* @__PURE__ */ new Set();
|
|
2822
2829
|
if (e.snapshot.resolvedFormats.forEach((a, i) => {
|
|
@@ -2853,7 +2860,7 @@ function As(e) {
|
|
|
2853
2860
|
`resolvedFormats is missing visible export column "${n}"`
|
|
2854
2861
|
);
|
|
2855
2862
|
}
|
|
2856
|
-
function
|
|
2863
|
+
function Xi(e, t) {
|
|
2857
2864
|
const n = new Intl.NumberFormat(e, {
|
|
2858
2865
|
style: "currency",
|
|
2859
2866
|
currency: t
|
|
@@ -2863,7 +2870,7 @@ function qi(e, t) {
|
|
|
2863
2870
|
maximumFractionDigits: n.maximumFractionDigits
|
|
2864
2871
|
};
|
|
2865
2872
|
}
|
|
2866
|
-
function
|
|
2873
|
+
function Vi(e) {
|
|
2867
2874
|
if (e.minimumFractionDigits !== void 0 || e.maximumFractionDigits !== void 0) {
|
|
2868
2875
|
const n = e.minimumFractionDigits ?? 0;
|
|
2869
2876
|
return {
|
|
@@ -2878,14 +2885,14 @@ function Zi(e) {
|
|
|
2878
2885
|
};
|
|
2879
2886
|
}
|
|
2880
2887
|
function Ki(e, t, n) {
|
|
2881
|
-
const r = Q(e.locale) ?? t.locale, a = e.type === "number" || e.type === "currency" ?
|
|
2888
|
+
const r = Q(e.locale) ?? t.locale, a = e.type === "number" || e.type === "currency" ? Ae(n) : void 0;
|
|
2882
2889
|
if (!(e.type === "currency" || a !== void 0))
|
|
2883
2890
|
return {
|
|
2884
2891
|
...e,
|
|
2885
2892
|
locale: r,
|
|
2886
|
-
...
|
|
2893
|
+
...Vi(e)
|
|
2887
2894
|
};
|
|
2888
|
-
const o = a ??
|
|
2895
|
+
const o = a ?? Ae(e.currency) ?? t.defaultCurrency, s = Xi(
|
|
2889
2896
|
r,
|
|
2890
2897
|
o
|
|
2891
2898
|
), c = s.minimumFractionDigits ?? 0, u = s.maximumFractionDigits ?? c, l = e.minimumFractionDigits ?? Math.min(
|
|
@@ -2904,7 +2911,7 @@ function Ki(e, t, n) {
|
|
|
2904
2911
|
maximumFractionDigits: f
|
|
2905
2912
|
};
|
|
2906
2913
|
}
|
|
2907
|
-
const
|
|
2914
|
+
const Bi = [
|
|
2908
2915
|
"YYYY",
|
|
2909
2916
|
"MMMM",
|
|
2910
2917
|
"MMM",
|
|
@@ -2914,13 +2921,13 @@ const Vi = [
|
|
|
2914
2921
|
"HH",
|
|
2915
2922
|
"mm",
|
|
2916
2923
|
"ss"
|
|
2917
|
-
],
|
|
2924
|
+
], Gi = /* @__PURE__ */ new Set([" ", "-", "/", ":", ".", ",", "T"]), se = [
|
|
2918
2925
|
"day",
|
|
2919
2926
|
"week",
|
|
2920
2927
|
"month",
|
|
2921
2928
|
"quarter",
|
|
2922
2929
|
"year"
|
|
2923
|
-
],
|
|
2930
|
+
], fn = {
|
|
2924
2931
|
week_of_short: ["week"],
|
|
2925
2932
|
week_of_long: ["week"],
|
|
2926
2933
|
quarter_short: ["quarter"],
|
|
@@ -2932,11 +2939,11 @@ const Vi = [
|
|
|
2932
2939
|
numeric: se,
|
|
2933
2940
|
iso: se
|
|
2934
2941
|
};
|
|
2935
|
-
function
|
|
2936
|
-
return typeof e == "string" && Object.prototype.hasOwnProperty.call(
|
|
2942
|
+
function Qi(e) {
|
|
2943
|
+
return typeof e == "string" && Object.prototype.hasOwnProperty.call(fn, e);
|
|
2937
2944
|
}
|
|
2938
|
-
function
|
|
2939
|
-
return
|
|
2945
|
+
function Ji(e, t) {
|
|
2946
|
+
return Bi.find(
|
|
2940
2947
|
(n) => e.startsWith(n, t)
|
|
2941
2948
|
);
|
|
2942
2949
|
}
|
|
@@ -2951,7 +2958,7 @@ function ne(e) {
|
|
|
2951
2958
|
const t = [];
|
|
2952
2959
|
let n = 0, r = !1;
|
|
2953
2960
|
for (; n < e.length; ) {
|
|
2954
|
-
const i =
|
|
2961
|
+
const i = Ji(e, n);
|
|
2955
2962
|
if (i) {
|
|
2956
2963
|
if (r)
|
|
2957
2964
|
return {
|
|
@@ -2963,7 +2970,7 @@ function ne(e) {
|
|
|
2963
2970
|
continue;
|
|
2964
2971
|
}
|
|
2965
2972
|
const o = e[n];
|
|
2966
|
-
if (!
|
|
2973
|
+
if (!Gi.has(o))
|
|
2967
2974
|
return {
|
|
2968
2975
|
ok: !1,
|
|
2969
2976
|
code: "invalid_temporal_bucket_pattern",
|
|
@@ -2984,23 +2991,23 @@ function ne(e) {
|
|
|
2984
2991
|
message: "Temporal bucket patterns cannot end with a separator."
|
|
2985
2992
|
} : { ok: !0, segments: t };
|
|
2986
2993
|
}
|
|
2987
|
-
function
|
|
2994
|
+
function eo(e) {
|
|
2988
2995
|
return e.flatMap(
|
|
2989
2996
|
(t) => t.kind === "token" ? [t.value] : []
|
|
2990
2997
|
);
|
|
2991
2998
|
}
|
|
2992
|
-
function
|
|
2999
|
+
function Ft(e, t) {
|
|
2993
3000
|
return e.filter((n) => t.includes(n)).length === 1;
|
|
2994
3001
|
}
|
|
2995
3002
|
function ce(e, t) {
|
|
2996
3003
|
return e.some((n) => t.includes(n));
|
|
2997
3004
|
}
|
|
2998
|
-
function
|
|
3005
|
+
function to(e) {
|
|
2999
3006
|
return new Set(e).size !== e.length;
|
|
3000
3007
|
}
|
|
3001
|
-
function
|
|
3002
|
-
if (
|
|
3003
|
-
const n = ["YYYY", "YY"], r = ["MMMM", "MMM", "MM"], a = ["HH", "mm", "ss"], i =
|
|
3008
|
+
function no(e, t) {
|
|
3009
|
+
if (to(e)) return !1;
|
|
3010
|
+
const n = ["YYYY", "YY"], r = ["MMMM", "MMM", "MM"], a = ["HH", "mm", "ss"], i = Ft(e, n), o = Ft(e, r), s = e.includes("DD"), c = ce(e, a);
|
|
3004
3011
|
switch (t) {
|
|
3005
3012
|
case "second":
|
|
3006
3013
|
return e.includes("HH") && e.includes("mm") && e.includes("ss") && (!ce(e, [...n, ...r, "DD"]) || i && o && s);
|
|
@@ -3019,11 +3026,11 @@ function eo(e, t) {
|
|
|
3019
3026
|
return i && !o && !s && !c;
|
|
3020
3027
|
}
|
|
3021
3028
|
}
|
|
3022
|
-
function
|
|
3029
|
+
function dn(e, t) {
|
|
3023
3030
|
if (e.presentation.mode === "auto")
|
|
3024
3031
|
return { ok: !0 };
|
|
3025
3032
|
if (e.presentation.mode === "preset") {
|
|
3026
|
-
const r =
|
|
3033
|
+
const r = fn[e.presentation.preset];
|
|
3027
3034
|
return r.includes(t) ? { ok: !0 } : {
|
|
3028
3035
|
ok: !1,
|
|
3029
3036
|
code: "incompatible_temporal_bucket_preset",
|
|
@@ -3031,8 +3038,8 @@ function fn(e, t) {
|
|
|
3031
3038
|
};
|
|
3032
3039
|
}
|
|
3033
3040
|
const n = ne(e.presentation.pattern);
|
|
3034
|
-
return n.ok ?
|
|
3035
|
-
|
|
3041
|
+
return n.ok ? no(
|
|
3042
|
+
eo(n.segments),
|
|
3036
3043
|
t
|
|
3037
3044
|
) ? { ok: !0, segments: n.segments } : {
|
|
3038
3045
|
ok: !1,
|
|
@@ -3040,21 +3047,21 @@ function fn(e, t) {
|
|
|
3040
3047
|
message: `Pattern ${e.presentation.pattern} is not compatible with ${t} granularity.`
|
|
3041
3048
|
} : n;
|
|
3042
3049
|
}
|
|
3043
|
-
function
|
|
3050
|
+
function Xs(e, t) {
|
|
3044
3051
|
if (!(!e || !t))
|
|
3045
|
-
return
|
|
3052
|
+
return dn(e, t).ok ? e : void 0;
|
|
3046
3053
|
}
|
|
3047
|
-
function
|
|
3054
|
+
function ro(e) {
|
|
3048
3055
|
return e.preset ? { mode: "preset", preset: e.preset } : e.pattern ? { mode: "pattern", dialect: e.dialect ?? "semaphor_tokens", pattern: e.pattern } : { mode: "auto" };
|
|
3049
3056
|
}
|
|
3050
|
-
class
|
|
3057
|
+
class R extends Error {
|
|
3051
3058
|
constructor(n, r) {
|
|
3052
3059
|
super(r);
|
|
3053
3060
|
$(this, "code");
|
|
3054
3061
|
this.name = "RawTemporalFormatContractError", this.code = n;
|
|
3055
3062
|
}
|
|
3056
3063
|
}
|
|
3057
|
-
const
|
|
3064
|
+
const ao = [
|
|
3058
3065
|
"SSSSSSSSS",
|
|
3059
3066
|
"SSSSSSSS",
|
|
3060
3067
|
"SSSSSSS",
|
|
@@ -3064,7 +3071,7 @@ const no = [
|
|
|
3064
3071
|
"SSS",
|
|
3065
3072
|
"SS",
|
|
3066
3073
|
"S"
|
|
3067
|
-
],
|
|
3074
|
+
], io = [
|
|
3068
3075
|
"yyyy",
|
|
3069
3076
|
"MMMM",
|
|
3070
3077
|
"LLLL",
|
|
@@ -3086,7 +3093,7 @@ const no = [
|
|
|
3086
3093
|
"m",
|
|
3087
3094
|
"s",
|
|
3088
3095
|
"a"
|
|
3089
|
-
],
|
|
3096
|
+
], oo = /* @__PURE__ */ new Set([
|
|
3090
3097
|
"HH",
|
|
3091
3098
|
"H",
|
|
3092
3099
|
"hh",
|
|
@@ -3096,18 +3103,18 @@ const no = [
|
|
|
3096
3103
|
"ss",
|
|
3097
3104
|
"s",
|
|
3098
3105
|
"a",
|
|
3099
|
-
...
|
|
3100
|
-
]),
|
|
3106
|
+
...ao
|
|
3107
|
+
]), so = /* @__PURE__ */ new Set(["zzz", "XXX"]), Ce = /* @__PURE__ */ new Set(["short", "medium", "long"]);
|
|
3101
3108
|
function M(e, t) {
|
|
3102
3109
|
return Object.keys(e).length === t.length && t.every((r) => r in e);
|
|
3103
3110
|
}
|
|
3104
3111
|
function g(e) {
|
|
3105
|
-
throw new
|
|
3112
|
+
throw new R(
|
|
3106
3113
|
"invalid_raw_temporal_format",
|
|
3107
3114
|
e
|
|
3108
3115
|
);
|
|
3109
3116
|
}
|
|
3110
|
-
function
|
|
3117
|
+
function hn(e) {
|
|
3111
3118
|
if (!e || e.trim() !== e || e.length > 256)
|
|
3112
3119
|
return g(
|
|
3113
3120
|
"date_fns patterns must be non-empty, trimmed, and at most 256 characters."
|
|
@@ -3154,7 +3161,7 @@ function dn(e) {
|
|
|
3154
3161
|
}), r = o;
|
|
3155
3162
|
continue;
|
|
3156
3163
|
}
|
|
3157
|
-
const a =
|
|
3164
|
+
const a = io.find(
|
|
3158
3165
|
(o) => e.startsWith(o, r)
|
|
3159
3166
|
);
|
|
3160
3167
|
if (a) {
|
|
@@ -3170,15 +3177,15 @@ function dn(e) {
|
|
|
3170
3177
|
}
|
|
3171
3178
|
return t.some((a) => a.kind === "token") ? t : g("date_fns patterns must contain at least one token.");
|
|
3172
3179
|
}
|
|
3173
|
-
function
|
|
3180
|
+
function gn(e, t) {
|
|
3174
3181
|
if (e === "semaphor_tokens") {
|
|
3175
3182
|
const n = ne(t);
|
|
3176
3183
|
n.ok || g(n.message);
|
|
3177
3184
|
return;
|
|
3178
3185
|
}
|
|
3179
|
-
|
|
3186
|
+
hn(t);
|
|
3180
3187
|
}
|
|
3181
|
-
function
|
|
3188
|
+
function co(e) {
|
|
3182
3189
|
return !T(e) || !M(e, ["dateStyle", "dateTime"]) ? g("Automatic raw temporal styles are incomplete.") : Ce.has(e.dateStyle) ? !T(e.dateTime) || !M(e.dateTime, ["dateStyle", "timeStyle"]) || !Ce.has(e.dateTime.dateStyle) || !Ce.has(e.dateTime.timeStyle) ? g(
|
|
3183
3190
|
"Automatic dateTime styles are incomplete or invalid."
|
|
3184
3191
|
) : {
|
|
@@ -3205,11 +3212,11 @@ function Ge(e) {
|
|
|
3205
3212
|
...e.sourceTimezone ? { sourceTimezone: e.sourceTimezone } : {},
|
|
3206
3213
|
presentation: {
|
|
3207
3214
|
mode: "auto",
|
|
3208
|
-
styles:
|
|
3215
|
+
styles: co(e.presentation.styles)
|
|
3209
3216
|
}
|
|
3210
3217
|
} : g(
|
|
3211
3218
|
"Automatic raw temporal presentation has unknown fields."
|
|
3212
|
-
) : e.presentation.mode === "preset" ? !M(e.presentation, ["mode", "preset"]) || !
|
|
3219
|
+
) : e.presentation.mode === "preset" ? !M(e.presentation, ["mode", "preset"]) || !Dn(e.presentation.preset) ? g("Preset raw temporal presentation has an invalid shape.") : {
|
|
3213
3220
|
type: "raw_temporal",
|
|
3214
3221
|
locale: r,
|
|
3215
3222
|
calendarTimezone: e.calendarTimezone,
|
|
@@ -3217,7 +3224,7 @@ function Ge(e) {
|
|
|
3217
3224
|
presentation: { mode: "preset", preset: e.presentation.preset }
|
|
3218
3225
|
} : e.presentation.mode !== "pattern" || !M(e.presentation, ["mode", "dialect", "pattern"]) || e.presentation.dialect !== "semaphor_tokens" && e.presentation.dialect !== "date_fns" || typeof e.presentation.pattern != "string" ? g(
|
|
3219
3226
|
"Pattern raw temporal presentation has an invalid shape."
|
|
3220
|
-
) : (
|
|
3227
|
+
) : (gn(e.presentation.dialect, e.presentation.pattern), {
|
|
3221
3228
|
type: "raw_temporal",
|
|
3222
3229
|
locale: r,
|
|
3223
3230
|
calendarTimezone: e.calendarTimezone,
|
|
@@ -3229,7 +3236,7 @@ function Ge(e) {
|
|
|
3229
3236
|
}
|
|
3230
3237
|
}) : g("Raw temporal presentation must be an object.") : g("Raw temporal locale is invalid or unsupported.");
|
|
3231
3238
|
}
|
|
3232
|
-
function
|
|
3239
|
+
function yn(e) {
|
|
3233
3240
|
var s, c, u;
|
|
3234
3241
|
if (e.format) {
|
|
3235
3242
|
if (!T(e.format))
|
|
@@ -3250,14 +3257,14 @@ function gn(e) {
|
|
|
3250
3257
|
"Automatic authored raw temporal format has unknown fields."
|
|
3251
3258
|
);
|
|
3252
3259
|
} else if (f.mode === "preset") {
|
|
3253
|
-
if (!M(f, ["mode", "preset"]) || !
|
|
3260
|
+
if (!M(f, ["mode", "preset"]) || !Dn(f.preset))
|
|
3254
3261
|
return g("Authored raw temporal preset has an invalid shape.");
|
|
3255
3262
|
} else {
|
|
3256
3263
|
if (f.mode !== "pattern" || !M(f, ["mode", "dialect", "pattern"]) || f.dialect !== "semaphor_tokens" && f.dialect !== "date_fns" || typeof f.pattern != "string")
|
|
3257
3264
|
return g(
|
|
3258
3265
|
"Authored raw temporal pattern has an invalid shape."
|
|
3259
3266
|
);
|
|
3260
|
-
|
|
3267
|
+
gn(f.dialect, f.pattern);
|
|
3261
3268
|
}
|
|
3262
3269
|
}
|
|
3263
3270
|
const t = (s = e.format) == null ? void 0 : s.timezone, n = (c = e.format) == null ? void 0 : c.sourceTimezone, r = t && t !== "auto" ? t : e.calendar.tz, a = n && n !== "auto" ? n === "local" ? Intl.DateTimeFormat().resolvedOptions().timeZone : n : void 0;
|
|
@@ -3278,19 +3285,19 @@ function gn(e) {
|
|
|
3278
3285
|
};
|
|
3279
3286
|
return Ge(o);
|
|
3280
3287
|
}
|
|
3281
|
-
function
|
|
3288
|
+
function Vs(e) {
|
|
3282
3289
|
const t = /* @__PURE__ */ new Set();
|
|
3283
3290
|
let n = !1;
|
|
3284
3291
|
for (const r of e.values) {
|
|
3285
3292
|
if (r === null) continue;
|
|
3286
3293
|
n = !0;
|
|
3287
|
-
const a =
|
|
3294
|
+
const a = Kn(r);
|
|
3288
3295
|
a && t.add(a);
|
|
3289
3296
|
}
|
|
3290
3297
|
if (!n) return { status: "empty" };
|
|
3291
3298
|
if (t.size === 0) return { status: "invalid_only" };
|
|
3292
3299
|
if (t.size > 1)
|
|
3293
|
-
throw new
|
|
3300
|
+
throw new R(
|
|
3294
3301
|
"mixed_sql_temporal_semantics",
|
|
3295
3302
|
`Declared SQL temporal column "${e.columnKey}" mixes date, wall-datetime, or instant semantics. Normalize it to one kind.`
|
|
3296
3303
|
);
|
|
@@ -3302,7 +3309,7 @@ function Ls(e) {
|
|
|
3302
3309
|
}
|
|
3303
3310
|
};
|
|
3304
3311
|
}
|
|
3305
|
-
function
|
|
3312
|
+
function Ks(e) {
|
|
3306
3313
|
return {
|
|
3307
3314
|
version: 1,
|
|
3308
3315
|
columns: Object.fromEntries(
|
|
@@ -3313,9 +3320,9 @@ function Ws(e) {
|
|
|
3313
3320
|
)
|
|
3314
3321
|
};
|
|
3315
3322
|
}
|
|
3316
|
-
function
|
|
3323
|
+
function uo(e) {
|
|
3317
3324
|
if (!T(e) || e.version !== 1 || !T(e.columns) || Object.keys(e).some((r) => r !== "version" && r !== "columns"))
|
|
3318
|
-
throw new
|
|
3325
|
+
throw new R(
|
|
3319
3326
|
"invalid_raw_temporal_format",
|
|
3320
3327
|
"Raw temporal chunk classification evidence is malformed."
|
|
3321
3328
|
);
|
|
@@ -3328,7 +3335,7 @@ function so(e) {
|
|
|
3328
3335
|
]);
|
|
3329
3336
|
for (const [r, a] of Object.entries(e.columns)) {
|
|
3330
3337
|
if (!r.trim() || !n.has(a))
|
|
3331
|
-
throw new
|
|
3338
|
+
throw new R(
|
|
3332
3339
|
"invalid_raw_temporal_format",
|
|
3333
3340
|
"Raw temporal chunk classification evidence contains an invalid column or status."
|
|
3334
3341
|
);
|
|
@@ -3336,13 +3343,13 @@ function so(e) {
|
|
|
3336
3343
|
}
|
|
3337
3344
|
return { version: 1, columns: t };
|
|
3338
3345
|
}
|
|
3339
|
-
function
|
|
3346
|
+
function Bs(e) {
|
|
3340
3347
|
if (e.length === 0) return;
|
|
3341
|
-
const t = e.map(
|
|
3348
|
+
const t = e.map(uo), n = Object.keys(t[0].columns).sort();
|
|
3342
3349
|
for (let r = 1; r < t.length; r += 1) {
|
|
3343
3350
|
const a = Object.keys(t[r].columns).sort();
|
|
3344
3351
|
if (a.length !== n.length || a.some((i, o) => i !== n[o]))
|
|
3345
|
-
throw new
|
|
3352
|
+
throw new R(
|
|
3346
3353
|
"invalid_raw_temporal_format",
|
|
3347
3354
|
"Raw temporal chunk classification evidence has inconsistent columns."
|
|
3348
3355
|
);
|
|
@@ -3353,7 +3360,7 @@ function js(e) {
|
|
|
3353
3360
|
(i) => i !== "empty" && i !== "invalid_only"
|
|
3354
3361
|
)
|
|
3355
3362
|
).size > 1)
|
|
3356
|
-
throw new
|
|
3363
|
+
throw new R(
|
|
3357
3364
|
"mixed_sql_temporal_semantics",
|
|
3358
3365
|
`Declared SQL temporal column "${r}" has inconsistent semantics across export chunks. Normalize it to one kind.`
|
|
3359
3366
|
);
|
|
@@ -3369,7 +3376,7 @@ function Qe(e, t) {
|
|
|
3369
3376
|
t
|
|
3370
3377
|
);
|
|
3371
3378
|
}
|
|
3372
|
-
function
|
|
3379
|
+
function pn(e, t) {
|
|
3373
3380
|
const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
3374
3381
|
let a, i, o, s;
|
|
3375
3382
|
return {
|
|
@@ -3454,7 +3461,7 @@ function yn(e, t) {
|
|
|
3454
3461
|
}
|
|
3455
3462
|
};
|
|
3456
3463
|
}
|
|
3457
|
-
function
|
|
3464
|
+
function lo(e, t, n, r, a) {
|
|
3458
3465
|
if (/^S{1,9}$/.test(e)) {
|
|
3459
3466
|
const i = t.fraction.padEnd(e.length, "0").slice(0, e.length);
|
|
3460
3467
|
return r.number(Number(i), e.length);
|
|
@@ -3515,32 +3522,32 @@ function co(e, t, n, r, a) {
|
|
|
3515
3522
|
);
|
|
3516
3523
|
}
|
|
3517
3524
|
}
|
|
3518
|
-
function
|
|
3525
|
+
function mo(e, t, n, r) {
|
|
3519
3526
|
const a = We(t);
|
|
3520
3527
|
return e.map(
|
|
3521
|
-
(i) => i.kind === "literal" ? i.value :
|
|
3528
|
+
(i) => i.kind === "literal" ? i.value : lo(i.value, t, a, n, r)
|
|
3522
3529
|
).join("");
|
|
3523
3530
|
}
|
|
3524
|
-
function
|
|
3525
|
-
const r = t === "date_fns" ?
|
|
3531
|
+
function wn(e, t, n) {
|
|
3532
|
+
const r = t === "date_fns" ? hn(n) : (() => {
|
|
3526
3533
|
const i = ne(n);
|
|
3527
3534
|
return i.ok ? i.segments : g(i.message);
|
|
3528
3535
|
})(), a = r.filter((i) => i.kind === "token").map((i) => i.value);
|
|
3529
|
-
return e === "date" && a.some((i) =>
|
|
3536
|
+
return e === "date" && a.some((i) => oo.has(i)) ? g("Date patterns cannot contain time tokens.") : e !== "instant" && a.some((i) => so.has(i)) ? g("Timezone pattern tokens require an instant value.") : r;
|
|
3530
3537
|
}
|
|
3531
|
-
function
|
|
3532
|
-
|
|
3538
|
+
function fo(e) {
|
|
3539
|
+
wn(
|
|
3533
3540
|
e.valueKind ?? "instant",
|
|
3534
3541
|
e.dialect,
|
|
3535
3542
|
e.pattern
|
|
3536
3543
|
);
|
|
3537
3544
|
}
|
|
3538
|
-
function
|
|
3539
|
-
const a =
|
|
3545
|
+
function ho(e, t, n, r) {
|
|
3546
|
+
const a = wn(
|
|
3540
3547
|
e.valueKind,
|
|
3541
3548
|
n,
|
|
3542
3549
|
r
|
|
3543
|
-
), i =
|
|
3550
|
+
), i = pn(t.locale, t.calendarTimezone);
|
|
3544
3551
|
return (o) => {
|
|
3545
3552
|
const s = e.valueKind === "wall_datetime" && t.sourceTimezone ? Qe(o.fields, t.sourceTimezone) : void 0, c = e.valueKind === "instant" ? {
|
|
3546
3553
|
...i.instantFields(o.instant),
|
|
@@ -3549,11 +3556,11 @@ function mo(e, t, n, r) {
|
|
|
3549
3556
|
...i.instantFields(s),
|
|
3550
3557
|
fraction: o.fields.fraction
|
|
3551
3558
|
} : o.fields;
|
|
3552
|
-
return
|
|
3559
|
+
return mo(a, c, i, o.instant ?? s);
|
|
3553
3560
|
};
|
|
3554
3561
|
}
|
|
3555
|
-
function
|
|
3556
|
-
const n =
|
|
3562
|
+
function Tn(e, t) {
|
|
3563
|
+
const n = pn(t.locale, t.calendarTimezone);
|
|
3557
3564
|
return (r) => {
|
|
3558
3565
|
const a = e.valueKind === "instant" ? n.instantFields(r.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? n.instantFields(Qe(r.fields, t.sourceTimezone)) : r.fields;
|
|
3559
3566
|
return {
|
|
@@ -3566,12 +3573,12 @@ function wn(e, t) {
|
|
|
3566
3573
|
};
|
|
3567
3574
|
};
|
|
3568
3575
|
}
|
|
3569
|
-
const
|
|
3570
|
-
function
|
|
3571
|
-
return typeof e == "string" &&
|
|
3576
|
+
const go = /* @__PURE__ */ new Set(["short", "long", "numeric", "iso"]);
|
|
3577
|
+
function Dn(e) {
|
|
3578
|
+
return typeof e == "string" && go.has(e);
|
|
3572
3579
|
}
|
|
3573
|
-
function
|
|
3574
|
-
const r =
|
|
3580
|
+
function yo(e, t, n) {
|
|
3581
|
+
const r = Tn(e, t), a = e.valueKind !== "date", i = (s, c = 2) => String(s).padStart(c, "0");
|
|
3575
3582
|
if (n === "iso")
|
|
3576
3583
|
return (s) => {
|
|
3577
3584
|
const c = r(s), u = `${i(c.year, 4)}-${i(c.month)}-${i(c.day)}`;
|
|
@@ -3590,7 +3597,7 @@ function ho(e, t, n) {
|
|
|
3590
3597
|
return u.setUTCFullYear(c.year, c.month - 1, c.day), u.setUTCHours(c.hour, c.minute, c.second, 0), o.format(u);
|
|
3591
3598
|
};
|
|
3592
3599
|
}
|
|
3593
|
-
function
|
|
3600
|
+
function po(e, t) {
|
|
3594
3601
|
const n = t.presentation.mode === "auto" ? t.presentation.styles : g("Automatic raw temporal formatting requires styles.");
|
|
3595
3602
|
if (e.valueKind === "date") {
|
|
3596
3603
|
const o = new Intl.DateTimeFormat(t.locale, {
|
|
@@ -3618,17 +3625,17 @@ function Ct(e, t, n) {
|
|
|
3618
3625
|
}
|
|
3619
3626
|
};
|
|
3620
3627
|
}
|
|
3621
|
-
function
|
|
3622
|
-
const t =
|
|
3628
|
+
function bn(e) {
|
|
3629
|
+
const t = Xn(e.metadata), n = Ge(e.format), r = n.presentation.mode === "auto" ? po(t, n) : n.presentation.mode === "preset" ? yo(t, n, n.presentation.preset) : ho(
|
|
3623
3630
|
t,
|
|
3624
3631
|
n,
|
|
3625
3632
|
n.presentation.dialect,
|
|
3626
3633
|
n.presentation.pattern
|
|
3627
|
-
), a =
|
|
3634
|
+
), a = Tn(t, n);
|
|
3628
3635
|
return (i) => {
|
|
3629
3636
|
if (i === null)
|
|
3630
3637
|
return { ok: !0, text: "", status: "empty" };
|
|
3631
|
-
const o =
|
|
3638
|
+
const o = Vn(i, t.valueKind);
|
|
3632
3639
|
return o.status === "invalid_shape" ? Ct(i, t, "invalid_raw_temporal_value") : o.status === "out_of_range" ? Ct(i, t, "out_of_range_raw_temporal_value") : {
|
|
3633
3640
|
ok: !0,
|
|
3634
3641
|
text: r(o),
|
|
@@ -3637,17 +3644,17 @@ function Dn(e) {
|
|
|
3637
3644
|
};
|
|
3638
3645
|
};
|
|
3639
3646
|
}
|
|
3640
|
-
function
|
|
3641
|
-
return
|
|
3647
|
+
function wo(e) {
|
|
3648
|
+
return bn({
|
|
3642
3649
|
metadata: e.metadata,
|
|
3643
3650
|
format: e.format
|
|
3644
3651
|
})(e.value);
|
|
3645
3652
|
}
|
|
3646
|
-
function
|
|
3647
|
-
const t =
|
|
3648
|
-
return { format: t, formatValue:
|
|
3653
|
+
function To(e) {
|
|
3654
|
+
const t = yn({ format: e.authored, preferences: e.preferences, calendar: e.calendar });
|
|
3655
|
+
return { format: t, formatValue: bn({ metadata: e.metadata, format: t }) };
|
|
3649
3656
|
}
|
|
3650
|
-
const
|
|
3657
|
+
const Do = {
|
|
3651
3658
|
dateStyle: "short",
|
|
3652
3659
|
dateTime: { dateStyle: "short", timeStyle: "short" }
|
|
3653
3660
|
};
|
|
@@ -3658,7 +3665,7 @@ class fe extends Error {
|
|
|
3658
3665
|
this.name = "TemporalBucketContractError", this.code = n;
|
|
3659
3666
|
}
|
|
3660
3667
|
}
|
|
3661
|
-
const
|
|
3668
|
+
const bo = [
|
|
3662
3669
|
"Jan",
|
|
3663
3670
|
"Feb",
|
|
3664
3671
|
"Mar",
|
|
@@ -3671,7 +3678,7 @@ const To = [
|
|
|
3671
3678
|
"Oct",
|
|
3672
3679
|
"Nov",
|
|
3673
3680
|
"Dec"
|
|
3674
|
-
],
|
|
3681
|
+
], xo = [
|
|
3675
3682
|
"January",
|
|
3676
3683
|
"February",
|
|
3677
3684
|
"March",
|
|
@@ -3691,13 +3698,13 @@ function Pe(e) {
|
|
|
3691
3698
|
error: { code: "invalid_temporal_bucket_value", message: e }
|
|
3692
3699
|
};
|
|
3693
3700
|
}
|
|
3694
|
-
function
|
|
3701
|
+
function vo(e) {
|
|
3695
3702
|
return e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0);
|
|
3696
3703
|
}
|
|
3697
|
-
function
|
|
3698
|
-
return t === 2 ?
|
|
3704
|
+
function So(e, t) {
|
|
3705
|
+
return t === 2 ? vo(e) ? 29 : 28 : [4, 6, 9, 11].includes(t) ? 30 : 31;
|
|
3699
3706
|
}
|
|
3700
|
-
function
|
|
3707
|
+
function Mo(e, t, n) {
|
|
3701
3708
|
const r = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4], a = t < 3 ? e - 1 : e;
|
|
3702
3709
|
return (a + Math.floor(a / 4) - Math.floor(a / 100) + Math.floor(a / 400) + r[t - 1] + n) % 7;
|
|
3703
3710
|
}
|
|
@@ -3705,10 +3712,10 @@ function Se(e) {
|
|
|
3705
3712
|
var t;
|
|
3706
3713
|
return (t = e.calendar.fiscalCalendar) == null ? void 0 : t.yearStartMonth;
|
|
3707
3714
|
}
|
|
3708
|
-
function
|
|
3715
|
+
function ko(e, t) {
|
|
3709
3716
|
return (e - t + 12) % 12 % 3 === 0;
|
|
3710
3717
|
}
|
|
3711
|
-
function
|
|
3718
|
+
function _o(e, t) {
|
|
3712
3719
|
const { granularity: n } = t, r = Se(t) ?? 1;
|
|
3713
3720
|
switch (n) {
|
|
3714
3721
|
case "second":
|
|
@@ -3720,11 +3727,11 @@ function Mo(e, t) {
|
|
|
3720
3727
|
case "day":
|
|
3721
3728
|
return !0;
|
|
3722
3729
|
case "week":
|
|
3723
|
-
return
|
|
3730
|
+
return Mo(e.year, e.month, e.day) === t.calendar.weekStart;
|
|
3724
3731
|
case "month":
|
|
3725
3732
|
return e.day === 1;
|
|
3726
3733
|
case "quarter":
|
|
3727
|
-
return e.day === 1 &&
|
|
3734
|
+
return e.day === 1 && ko(e.month, r);
|
|
3728
3735
|
case "year":
|
|
3729
3736
|
return e.day === 1 && e.month === r;
|
|
3730
3737
|
}
|
|
@@ -3744,17 +3751,17 @@ function xn(e, t) {
|
|
|
3744
3751
|
minute: n ? Number(r[5]) : 0,
|
|
3745
3752
|
second: n ? Number(r[6]) : 0
|
|
3746
3753
|
};
|
|
3747
|
-
return a.year < 1 || a.month < 1 || a.month > 12 || a.day < 1 || a.day >
|
|
3754
|
+
return a.year < 1 || a.month < 1 || a.month > 12 || a.day < 1 || a.day > So(a.year, a.month) || a.hour > 23 || a.minute > 59 || a.second > 59 ? Pe(`Invalid canonical ${t.granularity} bucket value ${e}.`) : _o(a, t) ? { ok: !0, value: a } : Pe(
|
|
3748
3755
|
`Canonical value ${e} is not aligned to ${t.granularity} granularity and its governed Calendar.`
|
|
3749
3756
|
);
|
|
3750
3757
|
}
|
|
3751
|
-
function
|
|
3758
|
+
function Gs(e) {
|
|
3752
3759
|
const { granularity: t, calendar: n } = e, r = (o, s) => new Intl.DateTimeFormat("en-US", { ...o, timeZone: "UTC" }).format(s), a = [`by ${t} in the ${n.tz} calendar`];
|
|
3753
3760
|
t === "week" && a.push(`weeks starting on ${r({ weekday: "long" }, new Date(Date.UTC(2023, 0, 1 + n.weekStart)))}`);
|
|
3754
3761
|
const i = Se(e);
|
|
3755
3762
|
return i && (t === "quarter" || t === "year") && a.push(`the fiscal year starting in ${r({ month: "long" }, new Date(Date.UTC(2e3, i - 1, 1)))}`), `${a.join(", ")}; each value is a bucket's start`;
|
|
3756
3763
|
}
|
|
3757
|
-
function
|
|
3764
|
+
function vn(e) {
|
|
3758
3765
|
if (!T(e))
|
|
3759
3766
|
return {
|
|
3760
3767
|
ok: !1,
|
|
@@ -3775,7 +3782,7 @@ function bn(e) {
|
|
|
3775
3782
|
message: `Unknown property "${c}".`
|
|
3776
3783
|
});
|
|
3777
3784
|
if (o === "preset")
|
|
3778
|
-
|
|
3785
|
+
Qi(r.preset) || t.push({ path: "presentation.preset", message: "Expected a supported preset." });
|
|
3779
3786
|
else if (o === "pattern")
|
|
3780
3787
|
if (typeof r.pattern != "string" || !r.pattern)
|
|
3781
3788
|
t.push({ path: "presentation.pattern", message: "Expected a non-empty pattern." });
|
|
@@ -3841,18 +3848,18 @@ function bn(e) {
|
|
|
3841
3848
|
}
|
|
3842
3849
|
};
|
|
3843
3850
|
}
|
|
3844
|
-
function
|
|
3851
|
+
function No(e, t) {
|
|
3845
3852
|
const n = !!t.calendar.fiscalCalendar;
|
|
3846
|
-
return e === "fiscal_quarter_short" || e === "fiscal_year" ? n : e === "quarter_short" || e === "quarter_long" ||
|
|
3853
|
+
return e === "fiscal_quarter_short" || e === "fiscal_year" ? n : e === "quarter_short" || e === "quarter_long" || Nn(e) && (t.granularity === "quarter" || t.granularity === "year") ? !n : !0;
|
|
3847
3854
|
}
|
|
3848
|
-
function
|
|
3849
|
-
return
|
|
3855
|
+
function Sn(e, t) {
|
|
3856
|
+
return dn(e, t.granularity).ok ? e.presentation.mode === "preset" ? No(e.presentation.preset, t) : !(e.presentation.mode === "pattern" && t.calendar.fiscalCalendar && (t.granularity === "quarter" || t.granularity === "year")) : !1;
|
|
3850
3857
|
}
|
|
3851
3858
|
function Pt(e, t) {
|
|
3852
3859
|
if (!(!e || e.presentation.mode === "auto"))
|
|
3853
|
-
return
|
|
3860
|
+
return Sn(e, t) ? { type: "temporal_bucket", presentation: e.presentation } : void 0;
|
|
3854
3861
|
}
|
|
3855
|
-
function
|
|
3862
|
+
function Mn(e) {
|
|
3856
3863
|
var a;
|
|
3857
3864
|
const t = Q(e.locale);
|
|
3858
3865
|
if (!t)
|
|
@@ -3870,7 +3877,7 @@ function Sn(e) {
|
|
|
3870
3877
|
locale: t,
|
|
3871
3878
|
presentation: {
|
|
3872
3879
|
mode: "auto",
|
|
3873
|
-
styles: e.styles ??
|
|
3880
|
+
styles: e.styles ?? Do
|
|
3874
3881
|
}
|
|
3875
3882
|
},
|
|
3876
3883
|
source: "automatic"
|
|
@@ -3879,9 +3886,9 @@ function Sn(e) {
|
|
|
3879
3886
|
function D(e, t = 2) {
|
|
3880
3887
|
return String(e).padStart(t, "0");
|
|
3881
3888
|
}
|
|
3882
|
-
function
|
|
3889
|
+
function B(e, t, n) {
|
|
3883
3890
|
if (t === "en-US")
|
|
3884
|
-
return (n === "short" ?
|
|
3891
|
+
return (n === "short" ? bo : xo)[e - 1];
|
|
3885
3892
|
const r = new Date(Date.UTC(2e3, e - 1, 15));
|
|
3886
3893
|
return new Intl.DateTimeFormat(t, {
|
|
3887
3894
|
calendar: "gregory",
|
|
@@ -3889,7 +3896,7 @@ function X(e, t, n) {
|
|
|
3889
3896
|
timeZone: "UTC"
|
|
3890
3897
|
}).format(r);
|
|
3891
3898
|
}
|
|
3892
|
-
function
|
|
3899
|
+
function $o(e, t, n) {
|
|
3893
3900
|
return t.map((r) => {
|
|
3894
3901
|
if (r.kind === "literal") return r.value;
|
|
3895
3902
|
switch (r.value) {
|
|
@@ -3898,9 +3905,9 @@ function _o(e, t, n) {
|
|
|
3898
3905
|
case "YY":
|
|
3899
3906
|
return D(e.year % 100);
|
|
3900
3907
|
case "MMMM":
|
|
3901
|
-
return
|
|
3908
|
+
return B(e.month, n, "long");
|
|
3902
3909
|
case "MMM":
|
|
3903
|
-
return
|
|
3910
|
+
return B(e.month, n, "short");
|
|
3904
3911
|
case "MM":
|
|
3905
3912
|
return D(e.month);
|
|
3906
3913
|
case "DD":
|
|
@@ -3932,7 +3939,7 @@ function zt(e, t, n) {
|
|
|
3932
3939
|
timeZone: "UTC"
|
|
3933
3940
|
}).format(G(e));
|
|
3934
3941
|
}
|
|
3935
|
-
function
|
|
3942
|
+
function Eo(e, t, n) {
|
|
3936
3943
|
return Y(t, {
|
|
3937
3944
|
calendar: "gregory",
|
|
3938
3945
|
dateStyle: n.dateStyle,
|
|
@@ -3942,7 +3949,7 @@ function No(e, t, n) {
|
|
|
3942
3949
|
timeZone: "UTC"
|
|
3943
3950
|
}).format(G(e));
|
|
3944
3951
|
}
|
|
3945
|
-
function
|
|
3952
|
+
function Oo(e, t, n) {
|
|
3946
3953
|
var a;
|
|
3947
3954
|
if (n === "short") {
|
|
3948
3955
|
const i = G(e), o = Y(t, {
|
|
@@ -3967,16 +3974,16 @@ function $o(e, t, n) {
|
|
|
3967
3974
|
year: "numeric"
|
|
3968
3975
|
}).format(G(e));
|
|
3969
3976
|
}
|
|
3970
|
-
function
|
|
3977
|
+
function kn(e, t) {
|
|
3971
3978
|
return Math.floor((e.month - t + 12) % 12 / 3) + 1;
|
|
3972
3979
|
}
|
|
3973
|
-
function
|
|
3980
|
+
function At(e, t) {
|
|
3974
3981
|
return t === 1 || e.month < t ? e.year : e.year + 1;
|
|
3975
3982
|
}
|
|
3976
|
-
function
|
|
3983
|
+
function _n(e) {
|
|
3977
3984
|
return e === 1 ? "1st" : e === 2 ? "2nd" : e === 3 ? "3rd" : `${e}th`;
|
|
3978
3985
|
}
|
|
3979
|
-
function
|
|
3986
|
+
function Nn(e) {
|
|
3980
3987
|
return e === "short" || e === "long" || e === "numeric" || e === "iso";
|
|
3981
3988
|
}
|
|
3982
3989
|
function Ye(e, t, n) {
|
|
@@ -3988,15 +3995,15 @@ function Ye(e, t, n) {
|
|
|
3988
3995
|
timeZone: "UTC"
|
|
3989
3996
|
}).format(G(e));
|
|
3990
3997
|
}
|
|
3991
|
-
function
|
|
3992
|
-
const a =
|
|
3998
|
+
function Io(e, t, n, r) {
|
|
3999
|
+
const a = kn(e, 1);
|
|
3993
4000
|
switch (r) {
|
|
3994
4001
|
case "week":
|
|
3995
4002
|
return t === "numeric" || t === "iso" ? Ye(e, t, n) : `Week of ${Ye(e, t, n)}`;
|
|
3996
4003
|
case "month":
|
|
3997
|
-
return t === "iso" ? `${D(e.year, 4)}-${D(e.month)}` : t === "numeric" ? `${D(e.month)}/${D(e.year, 4)}` : `${
|
|
4004
|
+
return t === "iso" ? `${D(e.year, 4)}-${D(e.month)}` : t === "numeric" ? `${D(e.month)}/${D(e.year, 4)}` : `${B(e.month, n, t === "long" ? "long" : "short")} ${e.year}`;
|
|
3998
4005
|
case "quarter":
|
|
3999
|
-
return t === "iso" ? `${D(e.year, 4)}-Q${a}` : t === "long" ? `${
|
|
4006
|
+
return t === "iso" ? `${D(e.year, 4)}-Q${a}` : t === "long" ? `${_n(a)} Quarter ${e.year}` : `Q${a} ${e.year}`;
|
|
4000
4007
|
case "year":
|
|
4001
4008
|
return String(e.year);
|
|
4002
4009
|
default:
|
|
@@ -4004,37 +4011,37 @@ function Fo(e, t, n, r) {
|
|
|
4004
4011
|
}
|
|
4005
4012
|
}
|
|
4006
4013
|
function je(e, t, n, r) {
|
|
4007
|
-
if (
|
|
4008
|
-
return
|
|
4009
|
-
const a = Se(r) ?? 1, i =
|
|
4014
|
+
if (Nn(t))
|
|
4015
|
+
return Io(e, t, n, r.granularity);
|
|
4016
|
+
const a = Se(r) ?? 1, i = kn(e, a);
|
|
4010
4017
|
switch (t) {
|
|
4011
4018
|
case "week_of_short":
|
|
4012
|
-
return `Week of ${
|
|
4019
|
+
return `Week of ${B(e.month, n, "short")} ${e.day}, ${e.year}`;
|
|
4013
4020
|
case "week_of_long":
|
|
4014
|
-
return `Week of ${
|
|
4021
|
+
return `Week of ${B(e.month, n, "long")} ${e.day}, ${e.year}`;
|
|
4015
4022
|
case "quarter_short":
|
|
4016
4023
|
return `Q${i} ${e.year}`;
|
|
4017
4024
|
case "quarter_long":
|
|
4018
|
-
return `${
|
|
4025
|
+
return `${_n(i)} Quarter ${e.year}`;
|
|
4019
4026
|
case "fiscal_quarter_short":
|
|
4020
|
-
return `Q${i} FY${
|
|
4027
|
+
return `Q${i} FY${At(e, a)}`;
|
|
4021
4028
|
case "fiscal_year":
|
|
4022
|
-
return `FY${
|
|
4029
|
+
return `FY${At(e, a)}`;
|
|
4023
4030
|
}
|
|
4024
4031
|
}
|
|
4025
|
-
function
|
|
4032
|
+
function Fo(e, t, n, r) {
|
|
4026
4033
|
const a = Se(t);
|
|
4027
4034
|
switch (t.granularity) {
|
|
4028
4035
|
case "second":
|
|
4029
4036
|
case "minute":
|
|
4030
4037
|
case "hour":
|
|
4031
|
-
return
|
|
4038
|
+
return Eo(e, n, r.dateTime);
|
|
4032
4039
|
case "day":
|
|
4033
4040
|
return zt(e, n, r.dateStyle);
|
|
4034
4041
|
case "week":
|
|
4035
4042
|
return `Week of ${zt(e, n, r.dateStyle)}`;
|
|
4036
4043
|
case "month":
|
|
4037
|
-
return
|
|
4044
|
+
return Oo(e, n, r.dateStyle);
|
|
4038
4045
|
case "quarter":
|
|
4039
4046
|
return je(
|
|
4040
4047
|
e,
|
|
@@ -4046,7 +4053,7 @@ function Oo(e, t, n, r) {
|
|
|
4046
4053
|
return a ? je(e, "fiscal_year", n, t) : String(e.year);
|
|
4047
4054
|
}
|
|
4048
4055
|
}
|
|
4049
|
-
function
|
|
4056
|
+
function Qs(e, t) {
|
|
4050
4057
|
if (t.granularity !== "second" && t.granularity !== "minute" && t.granularity !== "hour" && t.granularity !== "day" && t.granularity !== "month")
|
|
4051
4058
|
return;
|
|
4052
4059
|
const n = xn(e, t);
|
|
@@ -4054,9 +4061,9 @@ function qs(e, t) {
|
|
|
4054
4061
|
const { year: r, month: a, day: i, hour: o, minute: s, second: c } = n.value;
|
|
4055
4062
|
return { year: r, month: a, day: i, hour: o, minute: s, second: c };
|
|
4056
4063
|
}
|
|
4057
|
-
function
|
|
4058
|
-
const t =
|
|
4059
|
-
if (!t.ok || !
|
|
4064
|
+
function $n(e) {
|
|
4065
|
+
const t = vn(e.format);
|
|
4066
|
+
if (!t.ok || !Sn(t.value, e.metadata))
|
|
4060
4067
|
throw new fe(
|
|
4061
4068
|
"invalid_temporal_bucket_format",
|
|
4062
4069
|
"Resolved temporal bucket format is invalid or inapplicable to its metadata."
|
|
@@ -4070,7 +4077,7 @@ function Nn(e) {
|
|
|
4070
4077
|
if (n.value === null) return "(Blank)";
|
|
4071
4078
|
const { presentation: r, locale: a } = t.value;
|
|
4072
4079
|
if (r.mode === "auto")
|
|
4073
|
-
return
|
|
4080
|
+
return Fo(
|
|
4074
4081
|
n.value,
|
|
4075
4082
|
e.metadata,
|
|
4076
4083
|
a,
|
|
@@ -4089,9 +4096,9 @@ function Nn(e) {
|
|
|
4089
4096
|
"invalid_temporal_bucket_format",
|
|
4090
4097
|
i.message
|
|
4091
4098
|
);
|
|
4092
|
-
return
|
|
4099
|
+
return $o(n.value, i.segments, a);
|
|
4093
4100
|
}
|
|
4094
|
-
function
|
|
4101
|
+
function Co(e, t) {
|
|
4095
4102
|
var a;
|
|
4096
4103
|
const n = e[e.length - 1];
|
|
4097
4104
|
if (!n) return "";
|
|
@@ -4099,18 +4106,18 @@ function Io(e, t) {
|
|
|
4099
4106
|
const r = n.member.value;
|
|
4100
4107
|
return r === null ? "(Blank)" : ((a = t == null ? void 0 : t.get(n.levelId)) == null ? void 0 : a(r)) ?? (typeof r == "object" ? r.value : String(r));
|
|
4101
4108
|
}
|
|
4102
|
-
function
|
|
4103
|
-
return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? (n == null ? void 0 : n.split(
|
|
4109
|
+
function Po(e, t, n) {
|
|
4110
|
+
return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? (n == null ? void 0 : n.split(Rn).join(t)) ?? `${t} Total` : t;
|
|
4104
4111
|
}
|
|
4105
|
-
function
|
|
4112
|
+
function Js(e, t, n, r) {
|
|
4106
4113
|
var o;
|
|
4107
4114
|
const a = e[e.length - 1], i = t === "grand_total" ? n.grand.label : a ? (o = n.levels[a.levelId]) == null ? void 0 : o.label : void 0;
|
|
4108
|
-
return
|
|
4115
|
+
return Po(t, Co(e, r), i);
|
|
4109
4116
|
}
|
|
4110
|
-
function
|
|
4117
|
+
function ec(e, t, n) {
|
|
4111
4118
|
return e.kind === "value" ? (t == null ? void 0 : t(e.value)) ?? "" : e.kind === "null" ? n.nullText : n.emptyText;
|
|
4112
4119
|
}
|
|
4113
|
-
function
|
|
4120
|
+
function tc(e) {
|
|
4114
4121
|
const { path: t, previousPath: n, role: r, repeatLabels: a, levelCount: i } = e;
|
|
4115
4122
|
return Array.from({ length: i }, (o, s) => {
|
|
4116
4123
|
const c = t.slice(0, s + 1), u = r === "grand_total" ? s === 0 : r === "subtotal" && s === t.length - 1, l = n && n.length > s && nt(n.slice(0, s + 1)) === nt(c);
|
|
@@ -4121,20 +4128,20 @@ function Vs(e) {
|
|
|
4121
4128
|
};
|
|
4122
4129
|
});
|
|
4123
4130
|
}
|
|
4124
|
-
function
|
|
4125
|
-
return (e == null ? void 0 : e.type) === "date" ? { type: "raw_temporal", timezone: e.timezone, sourceTimezone: e.sourceTimezone, presentation:
|
|
4131
|
+
function Yo(e) {
|
|
4132
|
+
return (e == null ? void 0 : e.type) === "date" ? { type: "raw_temporal", timezone: e.timezone, sourceTimezone: e.sourceTimezone, presentation: ro(e) } : void 0;
|
|
4126
4133
|
}
|
|
4127
|
-
function
|
|
4128
|
-
return
|
|
4134
|
+
function zo(e, t) {
|
|
4135
|
+
return Ci(Be({ override: e, model: t }).format, {
|
|
4129
4136
|
preserveOmittedProperties: !0,
|
|
4130
4137
|
numericInput: "canonical"
|
|
4131
4138
|
});
|
|
4132
4139
|
}
|
|
4133
|
-
function
|
|
4140
|
+
function nc(e, t, n) {
|
|
4134
4141
|
const r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = (o, s) => {
|
|
4135
|
-
const c = (s === "levels" ? t.levelFormats : t.measureFormats)[o.id], u = o.semanticFormat, l =
|
|
4142
|
+
const c = (s === "levels" ? t.levelFormats : t.measureFormats)[o.id], u = o.semanticFormat, l = zo(c, u);
|
|
4136
4143
|
s === "measures" && r.set(o.id, {
|
|
4137
|
-
isNumeric:
|
|
4144
|
+
isNumeric: An(o.column.dataType) === "number",
|
|
4138
4145
|
// Use normalized affixes: a redundant percent suffix is already removed.
|
|
4139
4146
|
hasTextAffixes: !!l && !!("prefix" in l && l.prefix || "suffix" in l && l.suffix)
|
|
4140
4147
|
});
|
|
@@ -4145,18 +4152,18 @@ function Bs(e, t, n) {
|
|
|
4145
4152
|
absence: t.absence
|
|
4146
4153
|
});
|
|
4147
4154
|
if (o.column.temporalBucket) {
|
|
4148
|
-
const m = o.column.temporalBucket, h =
|
|
4155
|
+
const m = o.column.temporalBucket, h = Mn({
|
|
4149
4156
|
metadata: m,
|
|
4150
4157
|
cardFormat: (c == null ? void 0 : c.type) === "temporal_bucket" ? c : void 0,
|
|
4151
4158
|
semanticFormat: (u == null ? void 0 : u.type) === "temporal_bucket" ? { granularity: m.granularity, format: u } : void 0,
|
|
4152
4159
|
locale: n.valueFormat.locale,
|
|
4153
4160
|
styles: { dateStyle: n.valueFormat.dateStyle, dateTime: n.valueFormat.dateTime }
|
|
4154
4161
|
});
|
|
4155
|
-
return (d) => typeof d == "string" ?
|
|
4162
|
+
return (d) => typeof d == "string" ? $n({ value: d, metadata: m, format: h.format }) : f(d);
|
|
4156
4163
|
}
|
|
4157
4164
|
if (o.column.rawTemporal) {
|
|
4158
|
-
const m =
|
|
4159
|
-
authored:
|
|
4165
|
+
const m = Be({ override: c, model: u }).format, { formatValue: h } = To({
|
|
4166
|
+
authored: Yo(m),
|
|
4160
4167
|
metadata: o.column.rawTemporal,
|
|
4161
4168
|
preferences: n.valueFormat,
|
|
4162
4169
|
calendar: n.calendar
|
|
@@ -4188,17 +4195,17 @@ function Bs(e, t, n) {
|
|
|
4188
4195
|
absence: t.absence
|
|
4189
4196
|
};
|
|
4190
4197
|
}
|
|
4191
|
-
function
|
|
4198
|
+
function rc(e, t) {
|
|
4192
4199
|
return t.levelLabels[e.id] ?? e.field.label ?? e.field.name;
|
|
4193
4200
|
}
|
|
4194
|
-
function
|
|
4201
|
+
function ac(e, t) {
|
|
4195
4202
|
return t.measureLabels[e.id] ?? (e.kind === "aggregate" ? e.field.label ?? e.field.name : e.definition.label);
|
|
4196
4203
|
}
|
|
4197
|
-
function
|
|
4198
|
-
return
|
|
4204
|
+
function ic(e) {
|
|
4205
|
+
return jn.parse(Ao(e));
|
|
4199
4206
|
}
|
|
4200
|
-
function
|
|
4201
|
-
const t =
|
|
4207
|
+
function Ao(e) {
|
|
4208
|
+
const t = Un.parse(e), n = (r) => ({
|
|
4202
4209
|
grand: { visible: !0, position: "after" },
|
|
4203
4210
|
levels: Object.fromEntries(
|
|
4204
4211
|
r.map((a) => [
|
|
@@ -4207,7 +4214,7 @@ function Yo(e) {
|
|
|
4207
4214
|
])
|
|
4208
4215
|
)
|
|
4209
4216
|
});
|
|
4210
|
-
return
|
|
4217
|
+
return Ln.parse({
|
|
4211
4218
|
version: 1,
|
|
4212
4219
|
spec: t,
|
|
4213
4220
|
presentation: {
|
|
@@ -4225,14 +4232,14 @@ function Yo(e) {
|
|
|
4225
4232
|
}
|
|
4226
4233
|
});
|
|
4227
4234
|
}
|
|
4228
|
-
function
|
|
4229
|
-
const n = new Map(e.map((r) => [
|
|
4230
|
-
for (const r of t ?? []) n.set(
|
|
4235
|
+
function Ro(e, t) {
|
|
4236
|
+
const n = new Map(e.map((r) => [X(r), r]));
|
|
4237
|
+
for (const r of t ?? []) n.set(X(r), r);
|
|
4231
4238
|
return [...n.values()];
|
|
4232
4239
|
}
|
|
4233
|
-
function
|
|
4234
|
-
const { spec: t, presentation: n, defaults: r, session: a } =
|
|
4235
|
-
|
|
4240
|
+
function oc(e) {
|
|
4241
|
+
const { spec: t, presentation: n, defaults: r, session: a } = Wn.parse(e), i = new Map(
|
|
4242
|
+
Ro(t.sorts, a == null ? void 0 : a.sorts).map((s) => [X(s), s])
|
|
4236
4243
|
);
|
|
4237
4244
|
for (const s of ["rows", "columns"])
|
|
4238
4245
|
for (const c of t[s]) {
|
|
@@ -4244,7 +4251,7 @@ function Js(e) {
|
|
|
4244
4251
|
direction: "asc",
|
|
4245
4252
|
nulls: "last"
|
|
4246
4253
|
};
|
|
4247
|
-
i.has(
|
|
4254
|
+
i.has(X(u)) || i.set(X(u), u);
|
|
4248
4255
|
}
|
|
4249
4256
|
const o = (s, c) => ({
|
|
4250
4257
|
depth: Math.min(s.depth, Math.max(0, c - 1)),
|
|
@@ -4266,7 +4273,7 @@ function Js(e) {
|
|
|
4266
4273
|
}
|
|
4267
4274
|
};
|
|
4268
4275
|
}
|
|
4269
|
-
class
|
|
4276
|
+
class Rt extends Error {
|
|
4270
4277
|
constructor(n) {
|
|
4271
4278
|
super(
|
|
4272
4279
|
`invalid_presentation_execution_snapshot: ${n} Resave this report before running it again.`
|
|
@@ -4276,7 +4283,7 @@ class At extends Error {
|
|
|
4276
4283
|
this.name = "PresentationExecutionSnapshotError";
|
|
4277
4284
|
}
|
|
4278
4285
|
}
|
|
4279
|
-
class
|
|
4286
|
+
class sc extends Error {
|
|
4280
4287
|
constructor(n) {
|
|
4281
4288
|
super(
|
|
4282
4289
|
`missing_resolved_raw_temporal_format: Column "${n}" has no captured presentation. Resave this report before running it again.`
|
|
@@ -4340,7 +4347,7 @@ function ze(e, t) {
|
|
|
4340
4347
|
if (a) return { kind: "matrix_measure", measureId: a };
|
|
4341
4348
|
throw new Error(`${t} is not a valid numeric presentation target`);
|
|
4342
4349
|
}
|
|
4343
|
-
const
|
|
4350
|
+
const Lo = [
|
|
4344
4351
|
"type",
|
|
4345
4352
|
"inputUnit",
|
|
4346
4353
|
"outputStyle",
|
|
@@ -4351,12 +4358,12 @@ const Ao = [
|
|
|
4351
4358
|
"suffix",
|
|
4352
4359
|
"negativeStyle"
|
|
4353
4360
|
];
|
|
4354
|
-
function
|
|
4361
|
+
function Wo(e) {
|
|
4355
4362
|
return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
|
|
4356
4363
|
}
|
|
4357
|
-
const
|
|
4358
|
-
function
|
|
4359
|
-
if (I(e,
|
|
4364
|
+
const jo = ["type", "locale", "pattern", "timezone", "sourceTimezone"];
|
|
4365
|
+
function Ho(e, t) {
|
|
4366
|
+
if (I(e, jo, t), typeof e.locale != "string" || !e.locale.trim())
|
|
4360
4367
|
throw new Error(`${t}.locale must be a non-empty string`);
|
|
4361
4368
|
for (const n of ["pattern", "timezone", "sourceTimezone"])
|
|
4362
4369
|
if (e[n] !== void 0 && typeof e[n] != "string")
|
|
@@ -4369,10 +4376,10 @@ function Wo(e, t) {
|
|
|
4369
4376
|
...typeof e.sourceTimezone == "string" ? { sourceTimezone: e.sourceTimezone } : {}
|
|
4370
4377
|
};
|
|
4371
4378
|
}
|
|
4372
|
-
function
|
|
4373
|
-
I(e,
|
|
4379
|
+
function qo(e, t) {
|
|
4380
|
+
I(e, Lo, t);
|
|
4374
4381
|
for (const i of ["inputUnit", "largestUnit", "smallestUnit"])
|
|
4375
|
-
if (e[i] !== void 0 && !
|
|
4382
|
+
if (e[i] !== void 0 && !Wo(e[i]))
|
|
4376
4383
|
throw new Error(`${t}.${i} must be a duration unit`);
|
|
4377
4384
|
const n = e.outputStyle;
|
|
4378
4385
|
if (n !== void 0 && n !== "compact" && n !== "digital" && n !== "long")
|
|
@@ -4398,7 +4405,7 @@ function jo(e, t) {
|
|
|
4398
4405
|
...a !== void 0 ? { negativeStyle: a } : {}
|
|
4399
4406
|
};
|
|
4400
4407
|
}
|
|
4401
|
-
function
|
|
4408
|
+
function Zo(e, t) {
|
|
4402
4409
|
if (!T(e))
|
|
4403
4410
|
throw new Error(`${t} must be an object`);
|
|
4404
4411
|
if (e.kind === "field") {
|
|
@@ -4426,7 +4433,7 @@ function Ho(e, t) {
|
|
|
4426
4433
|
if (r) return { kind: "matrix_axis", axisInstanceId: r };
|
|
4427
4434
|
throw new Error(`${t} is not a valid temporal bucket presentation target`);
|
|
4428
4435
|
}
|
|
4429
|
-
function
|
|
4436
|
+
function Xo(e, t) {
|
|
4430
4437
|
if (!T(e))
|
|
4431
4438
|
throw new Error(`${t} must be an object`);
|
|
4432
4439
|
const n = z(e, "column", "columnKey", t);
|
|
@@ -4434,14 +4441,14 @@ function qo(e, t) {
|
|
|
4434
4441
|
throw new Error(`${t} must identify a column`);
|
|
4435
4442
|
return { kind: "column", columnKey: n };
|
|
4436
4443
|
}
|
|
4437
|
-
function
|
|
4444
|
+
function Vo(e) {
|
|
4438
4445
|
return [
|
|
4439
4446
|
e.dashboardId,
|
|
4440
4447
|
e.cardId ?? null,
|
|
4441
4448
|
e.attachmentIndex ?? null
|
|
4442
4449
|
];
|
|
4443
4450
|
}
|
|
4444
|
-
function
|
|
4451
|
+
function xe(e) {
|
|
4445
4452
|
switch (e.kind) {
|
|
4446
4453
|
case "metric":
|
|
4447
4454
|
return [e.kind, e.metricId];
|
|
@@ -4455,11 +4462,11 @@ function be(e) {
|
|
|
4455
4462
|
return [e.kind, e.axisInstanceId];
|
|
4456
4463
|
}
|
|
4457
4464
|
}
|
|
4458
|
-
function
|
|
4465
|
+
function U(e, t) {
|
|
4459
4466
|
return e.dashboardId === t.dashboardId && e.cardId === t.cardId && e.attachmentIndex === t.attachmentIndex;
|
|
4460
4467
|
}
|
|
4461
4468
|
function L(e, t) {
|
|
4462
|
-
const n =
|
|
4469
|
+
const n = xe(e), r = xe(t);
|
|
4463
4470
|
return n.length === r.length && n.every((a, i) => a === r[i]);
|
|
4464
4471
|
}
|
|
4465
4472
|
function Ko(e) {
|
|
@@ -4478,14 +4485,14 @@ function Ko(e) {
|
|
|
4478
4485
|
let o;
|
|
4479
4486
|
switch (n.format.type) {
|
|
4480
4487
|
case "temporal_bucket": {
|
|
4481
|
-
const l =
|
|
4488
|
+
const l = vn(n.format);
|
|
4482
4489
|
if (!l.ok)
|
|
4483
4490
|
throw new Error(
|
|
4484
4491
|
`${a}.format is invalid: ${((c = l.issues[0]) == null ? void 0 : c.message) ?? "invalid value"}`
|
|
4485
4492
|
);
|
|
4486
4493
|
o = {
|
|
4487
4494
|
scope: i,
|
|
4488
|
-
target:
|
|
4495
|
+
target: Zo(n.target, `${a}.target`),
|
|
4489
4496
|
format: l.value
|
|
4490
4497
|
};
|
|
4491
4498
|
break;
|
|
@@ -4493,7 +4500,7 @@ function Ko(e) {
|
|
|
4493
4500
|
case "raw_temporal":
|
|
4494
4501
|
o = {
|
|
4495
4502
|
scope: i,
|
|
4496
|
-
target:
|
|
4503
|
+
target: Xo(n.target, `${a}.target`),
|
|
4497
4504
|
format: Ge(n.format)
|
|
4498
4505
|
};
|
|
4499
4506
|
break;
|
|
@@ -4501,7 +4508,7 @@ function Ko(e) {
|
|
|
4501
4508
|
case "currency":
|
|
4502
4509
|
case "percent":
|
|
4503
4510
|
case "scientific": {
|
|
4504
|
-
const l =
|
|
4511
|
+
const l = Zi(n.format);
|
|
4505
4512
|
if (!l.ok)
|
|
4506
4513
|
throw new Error(
|
|
4507
4514
|
`${a}.format is invalid: ${((u = l.issues[0]) == null ? void 0 : u.message) ?? "invalid value"}`
|
|
@@ -4520,7 +4527,7 @@ function Ko(e) {
|
|
|
4520
4527
|
o = {
|
|
4521
4528
|
scope: i,
|
|
4522
4529
|
target: l,
|
|
4523
|
-
format:
|
|
4530
|
+
format: Ho(n.format, `${a}.format`)
|
|
4524
4531
|
};
|
|
4525
4532
|
break;
|
|
4526
4533
|
}
|
|
@@ -4528,7 +4535,7 @@ function Ko(e) {
|
|
|
4528
4535
|
o = {
|
|
4529
4536
|
scope: i,
|
|
4530
4537
|
target: ze(n.target, `${a}.target`),
|
|
4531
|
-
format:
|
|
4538
|
+
format: qo(
|
|
4532
4539
|
n.format,
|
|
4533
4540
|
`${a}.format`
|
|
4534
4541
|
)
|
|
@@ -4538,8 +4545,8 @@ function Ko(e) {
|
|
|
4538
4545
|
throw new Error(`${a}.format.type is unsupported`);
|
|
4539
4546
|
}
|
|
4540
4547
|
const s = JSON.stringify([
|
|
4541
|
-
...
|
|
4542
|
-
...
|
|
4548
|
+
...Vo(o.scope),
|
|
4549
|
+
...xe(o.target)
|
|
4543
4550
|
]);
|
|
4544
4551
|
if (t.has(s))
|
|
4545
4552
|
throw new Error(
|
|
@@ -4548,7 +4555,7 @@ function Ko(e) {
|
|
|
4548
4555
|
return t.add(s), o;
|
|
4549
4556
|
});
|
|
4550
4557
|
}
|
|
4551
|
-
function
|
|
4558
|
+
function Bo(e) {
|
|
4552
4559
|
try {
|
|
4553
4560
|
if (!T(e))
|
|
4554
4561
|
throw new Error("presentation execution snapshot must be an object");
|
|
@@ -4558,7 +4565,7 @@ function Vo(e) {
|
|
|
4558
4565
|
"presentation execution snapshot"
|
|
4559
4566
|
), e.version !== 1)
|
|
4560
4567
|
throw new Error("presentation execution snapshot version must be 1");
|
|
4561
|
-
const t =
|
|
4568
|
+
const t = qn(e.reportContext);
|
|
4562
4569
|
if (!t.ok) {
|
|
4563
4570
|
const n = t.issues[0];
|
|
4564
4571
|
throw new Error(
|
|
@@ -4571,61 +4578,61 @@ function Vo(e) {
|
|
|
4571
4578
|
resolvedFormats: Ko(e.resolvedFormats)
|
|
4572
4579
|
};
|
|
4573
4580
|
} catch (t) {
|
|
4574
|
-
throw t instanceof
|
|
4581
|
+
throw t instanceof Rt ? t : new Rt(
|
|
4575
4582
|
t instanceof Error ? t.message : "Snapshot is invalid."
|
|
4576
4583
|
);
|
|
4577
4584
|
}
|
|
4578
4585
|
}
|
|
4579
|
-
function
|
|
4580
|
-
return
|
|
4586
|
+
function Go(e) {
|
|
4587
|
+
return Bo({
|
|
4581
4588
|
version: 1,
|
|
4582
4589
|
reportContext: e.reportContext,
|
|
4583
4590
|
resolvedFormats: [...e.resolvedFormats]
|
|
4584
4591
|
});
|
|
4585
4592
|
}
|
|
4586
|
-
function
|
|
4593
|
+
function cc(e, t) {
|
|
4587
4594
|
const n = t.filter(
|
|
4588
4595
|
(r, a) => !e.resolvedFormats.some(
|
|
4589
|
-
(i) =>
|
|
4596
|
+
(i) => U(i.scope, r.scope) && L(i.target, r.target)
|
|
4590
4597
|
) && // One entry per target, as the snapshot's parser requires.
|
|
4591
4598
|
t.findIndex(
|
|
4592
|
-
(i) =>
|
|
4599
|
+
(i) => U(i.scope, r.scope) && L(i.target, r.target)
|
|
4593
4600
|
) === a
|
|
4594
4601
|
);
|
|
4595
|
-
return n.length === 0 ? e :
|
|
4602
|
+
return n.length === 0 ? e : Go({
|
|
4596
4603
|
reportContext: e.reportContext,
|
|
4597
4604
|
resolvedFormats: [...e.resolvedFormats, ...n]
|
|
4598
4605
|
});
|
|
4599
4606
|
}
|
|
4600
|
-
function
|
|
4601
|
-
const t =
|
|
4607
|
+
function uc(e) {
|
|
4608
|
+
const t = Qo(e);
|
|
4602
4609
|
return J(t) ? t : void 0;
|
|
4603
4610
|
}
|
|
4604
|
-
function
|
|
4611
|
+
function Qo(e) {
|
|
4605
4612
|
const t = e.snapshot.resolvedFormats.find(
|
|
4606
|
-
(n) => n.format.type !== "temporal_bucket" && n.format.type !== "raw_temporal" && n.format.type !== "date" &&
|
|
4613
|
+
(n) => n.format.type !== "temporal_bucket" && n.format.type !== "raw_temporal" && n.format.type !== "date" && U(n.scope, e.scope) && L(n.target, e.target)
|
|
4607
4614
|
);
|
|
4608
4615
|
return t == null ? void 0 : t.format;
|
|
4609
4616
|
}
|
|
4610
|
-
function
|
|
4617
|
+
function lc(e) {
|
|
4611
4618
|
const t = e.snapshot.resolvedFormats.find(
|
|
4612
|
-
(n) => n.format.type === "date" &&
|
|
4619
|
+
(n) => n.format.type === "date" && U(n.scope, e.scope) && L(n.target, e.target)
|
|
4613
4620
|
);
|
|
4614
4621
|
return t == null ? void 0 : t.format;
|
|
4615
4622
|
}
|
|
4616
|
-
function
|
|
4623
|
+
function mc(e) {
|
|
4617
4624
|
const t = e.snapshot.resolvedFormats.find(
|
|
4618
|
-
(n) => n.format.type === "raw_temporal" &&
|
|
4625
|
+
(n) => n.format.type === "raw_temporal" && U(n.scope, e.scope) && L(n.target, e.target)
|
|
4619
4626
|
);
|
|
4620
4627
|
return t == null ? void 0 : t.format;
|
|
4621
4628
|
}
|
|
4622
|
-
function
|
|
4629
|
+
function fc(e) {
|
|
4623
4630
|
const t = e.snapshot.resolvedFormats.find(
|
|
4624
|
-
(n) => n.format.type === "temporal_bucket" &&
|
|
4631
|
+
(n) => n.format.type === "temporal_bucket" && U(n.scope, e.scope) && L(n.target, e.target)
|
|
4625
4632
|
);
|
|
4626
4633
|
return t == null ? void 0 : t.format;
|
|
4627
4634
|
}
|
|
4628
|
-
function
|
|
4635
|
+
function dc(e) {
|
|
4629
4636
|
var a;
|
|
4630
4637
|
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
4631
4638
|
if (e.snapshot.resolvedFormats.forEach((i, o) => {
|
|
@@ -4638,7 +4645,7 @@ function oc(e) {
|
|
|
4638
4645
|
`resolvedFormats.${o}.scope must match the executing dashboard/card`
|
|
4639
4646
|
);
|
|
4640
4647
|
if (i.target.kind === "field" && i.format.type === "temporal_bucket") {
|
|
4641
|
-
const s = JSON.stringify(
|
|
4648
|
+
const s = JSON.stringify(xe(i.target));
|
|
4642
4649
|
if (n.has(s))
|
|
4643
4650
|
throw new Error(
|
|
4644
4651
|
`resolvedFormats.${o} duplicates export field "${i.target.fieldId}"`
|
|
@@ -4666,36 +4673,36 @@ function oc(e) {
|
|
|
4666
4673
|
`resolvedFormats is missing visible export column "${r}"`
|
|
4667
4674
|
);
|
|
4668
4675
|
}
|
|
4669
|
-
const
|
|
4670
|
-
function
|
|
4676
|
+
const Jo = /* @__PURE__ */ new Set(["short", "medium", "long"]), es = /^(\d{4})-(\d{2})-(\d{2})$/, ts = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, ns = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, Je = " – ";
|
|
4677
|
+
function hc(e) {
|
|
4671
4678
|
if (!T(e)) return;
|
|
4672
4679
|
const t = Object.keys(e);
|
|
4673
4680
|
if (e.mode === "period_label" && t.length === 1)
|
|
4674
4681
|
return { mode: "period_label" };
|
|
4675
|
-
if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" &&
|
|
4682
|
+
if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && Jo.has(e.dateStyle))
|
|
4676
4683
|
return { mode: "style", dateStyle: e.dateStyle };
|
|
4677
|
-
if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" &&
|
|
4684
|
+
if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" && rs(e.pattern) === null)
|
|
4678
4685
|
return {
|
|
4679
4686
|
mode: "pattern",
|
|
4680
4687
|
dialect: "semaphor_tokens",
|
|
4681
4688
|
pattern: e.pattern
|
|
4682
4689
|
};
|
|
4683
4690
|
}
|
|
4684
|
-
function
|
|
4691
|
+
function rs(e) {
|
|
4685
4692
|
try {
|
|
4686
|
-
return
|
|
4693
|
+
return fo({ dialect: "semaphor_tokens", pattern: e }), null;
|
|
4687
4694
|
} catch (t) {
|
|
4688
4695
|
return t instanceof Error ? t.message : "The pattern is invalid.";
|
|
4689
4696
|
}
|
|
4690
4697
|
}
|
|
4691
|
-
function
|
|
4698
|
+
function gc(e) {
|
|
4692
4699
|
const { value: t, part: n, presentation: r, preferences: a, calendar: i } = e;
|
|
4693
4700
|
if ((r == null ? void 0 : r.mode) === "period_label" && t.periodLabel && n === "range")
|
|
4694
4701
|
return { ok: !0, text: t.periodLabel };
|
|
4695
4702
|
const [o, s] = t.bounds, u = s === void 0 || n === "start" ? [{ raw: o, role: "start" }] : n === "end" ? [{ raw: s, role: "end" }] : [
|
|
4696
4703
|
{ raw: o, role: "start" },
|
|
4697
4704
|
{ raw: s, role: "end" }
|
|
4698
|
-
], l = u.map(({ raw: d }) =>
|
|
4705
|
+
], l = u.map(({ raw: d }) => ss(d, i.tz));
|
|
4699
4706
|
if (l.some((d) => d === null))
|
|
4700
4707
|
return {
|
|
4701
4708
|
ok: !1,
|
|
@@ -4706,35 +4713,35 @@ function cc(e) {
|
|
|
4706
4713
|
}
|
|
4707
4714
|
};
|
|
4708
4715
|
const f = t.precision === "day" ? l.map(
|
|
4709
|
-
(d, S) =>
|
|
4716
|
+
(d, S) => us(d, u[S].role, i.tz)
|
|
4710
4717
|
) : [], m = f.length > 0 && f.every((d) => d !== null) ? f : null;
|
|
4711
|
-
return { ok: !0, text: m ?
|
|
4712
|
-
l.map((d) =>
|
|
4718
|
+
return { ok: !0, text: m ? as(m, r, a, i) : is(
|
|
4719
|
+
l.map((d) => cs(d, i.tz)),
|
|
4713
4720
|
r,
|
|
4714
4721
|
a,
|
|
4715
4722
|
i
|
|
4716
4723
|
) };
|
|
4717
4724
|
}
|
|
4718
|
-
function
|
|
4725
|
+
function as(e, t, n, r) {
|
|
4719
4726
|
const [a, i = a] = e;
|
|
4720
4727
|
if ((t == null ? void 0 : t.mode) === "pattern")
|
|
4721
|
-
return
|
|
4728
|
+
return In(
|
|
4722
4729
|
e.map(
|
|
4723
|
-
(c) =>
|
|
4730
|
+
(c) => On(He(c), "date", t.pattern, n, r)
|
|
4724
4731
|
)
|
|
4725
4732
|
);
|
|
4726
4733
|
const o = (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : n.dateStyle;
|
|
4727
4734
|
if (!t || t.mode === "period_label") {
|
|
4728
|
-
const c =
|
|
4735
|
+
const c = ls(a, i, r);
|
|
4729
4736
|
if (c)
|
|
4730
|
-
return
|
|
4737
|
+
return $n({
|
|
4731
4738
|
value: He(a),
|
|
4732
4739
|
metadata: {
|
|
4733
4740
|
kind: "temporal_bucket",
|
|
4734
4741
|
granularity: c,
|
|
4735
4742
|
calendar: { tz: r.tz, weekStart: r.weekStart ?? 1 }
|
|
4736
4743
|
},
|
|
4737
|
-
format:
|
|
4744
|
+
format: Mn({
|
|
4738
4745
|
metadata: {
|
|
4739
4746
|
kind: "temporal_bucket",
|
|
4740
4747
|
granularity: c,
|
|
@@ -4750,13 +4757,13 @@ function ns(e, t, n, r) {
|
|
|
4750
4757
|
timeZone: "UTC",
|
|
4751
4758
|
dateStyle: o
|
|
4752
4759
|
});
|
|
4753
|
-
return
|
|
4760
|
+
return fs(a, i) ? s.format(de(a)) : En(s, de(a), de(i));
|
|
4754
4761
|
}
|
|
4755
|
-
function
|
|
4762
|
+
function is(e, t, n, r) {
|
|
4756
4763
|
if ((t == null ? void 0 : t.mode) === "pattern")
|
|
4757
|
-
return
|
|
4764
|
+
return In(
|
|
4758
4765
|
e.map(
|
|
4759
|
-
(s) =>
|
|
4766
|
+
(s) => On(
|
|
4760
4767
|
s.toISOString(),
|
|
4761
4768
|
"instant",
|
|
4762
4769
|
t.pattern,
|
|
@@ -4771,14 +4778,14 @@ function rs(e, t, n, r) {
|
|
|
4771
4778
|
dateStyle: (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : n.dateTime.dateStyle,
|
|
4772
4779
|
timeStyle: n.dateTime.timeStyle
|
|
4773
4780
|
}), [i, o] = e;
|
|
4774
|
-
return o && o.getTime() !== i.getTime() ?
|
|
4781
|
+
return o && o.getTime() !== i.getTime() ? En(a, i, o) : a.format(i);
|
|
4775
4782
|
}
|
|
4776
|
-
function
|
|
4783
|
+
function En(e, t, n) {
|
|
4777
4784
|
const r = e;
|
|
4778
4785
|
return typeof r.formatRange == "function" ? r.formatRange(t, n) : `${e.format(t)}${Je}${e.format(n)}`;
|
|
4779
4786
|
}
|
|
4780
|
-
function
|
|
4781
|
-
const i =
|
|
4787
|
+
function On(e, t, n, r, a) {
|
|
4788
|
+
const i = yn({
|
|
4782
4789
|
format: {
|
|
4783
4790
|
type: "raw_temporal",
|
|
4784
4791
|
presentation: { mode: "pattern", dialect: "semaphor_tokens", pattern: n }
|
|
@@ -4786,47 +4793,47 @@ function Fn(e, t, n, r, a) {
|
|
|
4786
4793
|
// Temporal formatting reads no currency.
|
|
4787
4794
|
preferences: {
|
|
4788
4795
|
...r,
|
|
4789
|
-
defaultCurrency:
|
|
4796
|
+
defaultCurrency: Zn.defaultCurrency
|
|
4790
4797
|
},
|
|
4791
4798
|
calendar: { tz: a.tz }
|
|
4792
|
-
}), o = t === "date" &&
|
|
4793
|
-
return
|
|
4799
|
+
}), o = t === "date" && os(n) ? "instant" : t;
|
|
4800
|
+
return wo({
|
|
4794
4801
|
value: o === t ? e : te(`${e}T00:00:00`, a.tz).toISOString(),
|
|
4795
4802
|
metadata: { kind: "raw_temporal", valueKind: o },
|
|
4796
4803
|
format: i
|
|
4797
4804
|
}).text;
|
|
4798
4805
|
}
|
|
4799
|
-
function
|
|
4806
|
+
function os(e) {
|
|
4800
4807
|
return /HH|mm|ss/.test(e);
|
|
4801
4808
|
}
|
|
4802
|
-
function
|
|
4809
|
+
function In(e) {
|
|
4803
4810
|
return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(Je);
|
|
4804
4811
|
}
|
|
4805
|
-
function
|
|
4806
|
-
const n =
|
|
4812
|
+
function ss(e, t) {
|
|
4813
|
+
const n = es.exec(e);
|
|
4807
4814
|
if (n) {
|
|
4808
4815
|
const a = {
|
|
4809
4816
|
year: Number(n[1]),
|
|
4810
4817
|
month: Number(n[2]),
|
|
4811
4818
|
day: Number(n[3])
|
|
4812
4819
|
};
|
|
4813
|
-
return
|
|
4820
|
+
return ds(a) ? { kind: "date", date: a } : null;
|
|
4814
4821
|
}
|
|
4815
|
-
const r =
|
|
4822
|
+
const r = ns.test(e) ? new Date(e.replace(" ", "T")) : ts.test(e) ? te(e.replace(" ", "T"), t) : null;
|
|
4816
4823
|
return r && !Number.isNaN(r.getTime()) ? { kind: "instant", instant: r } : null;
|
|
4817
4824
|
}
|
|
4818
|
-
function
|
|
4825
|
+
function cs(e, t) {
|
|
4819
4826
|
return e.kind === "instant" ? e.instant : te(`${He(e.date)}T00:00:00`, t);
|
|
4820
4827
|
}
|
|
4821
|
-
function
|
|
4828
|
+
function us(e, t, n) {
|
|
4822
4829
|
if (e.kind === "date") return e.date;
|
|
4823
4830
|
const r = Bn(e.instant, n), a = { year: r.year, month: r.month, day: r.day };
|
|
4824
|
-
if (r.hour === 0 && r.minute === 0 && r.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? a :
|
|
4831
|
+
if (r.hour === 0 && r.minute === 0 && r.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? a : ms(a, -1);
|
|
4825
4832
|
const o = r.hour === 23 && r.minute === 59 && r.second === 59;
|
|
4826
4833
|
return t === "end" && o ? a : null;
|
|
4827
4834
|
}
|
|
4828
|
-
function
|
|
4829
|
-
return n.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !==
|
|
4835
|
+
function ls(e, t, n) {
|
|
4836
|
+
return n.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== Fn(t.year, t.month) ? null : e.month === t.month ? "month" : e.month % 3 === 1 && t.month === e.month + 2 ? "quarter" : e.month === 1 && t.month === 12 ? "year" : null;
|
|
4830
4837
|
}
|
|
4831
4838
|
function He(e) {
|
|
4832
4839
|
return `${String(e.year).padStart(4, "0")}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}`;
|
|
@@ -4835,7 +4842,7 @@ function de(e) {
|
|
|
4835
4842
|
const t = /* @__PURE__ */ new Date(0);
|
|
4836
4843
|
return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(0, 0, 0, 0), t;
|
|
4837
4844
|
}
|
|
4838
|
-
function
|
|
4845
|
+
function ms(e, t) {
|
|
4839
4846
|
const n = de(e);
|
|
4840
4847
|
return n.setUTCDate(n.getUTCDate() + t), {
|
|
4841
4848
|
year: n.getUTCFullYear(),
|
|
@@ -4843,143 +4850,150 @@ function us(e, t) {
|
|
|
4843
4850
|
day: n.getUTCDate()
|
|
4844
4851
|
};
|
|
4845
4852
|
}
|
|
4846
|
-
function
|
|
4853
|
+
function fs(e, t) {
|
|
4847
4854
|
return e.year === t.year && e.month === t.month && e.day === t.day;
|
|
4848
4855
|
}
|
|
4849
|
-
function
|
|
4856
|
+
function Fn(e, t) {
|
|
4850
4857
|
return new Date(Date.UTC(e, t, 0)).getUTCDate();
|
|
4851
4858
|
}
|
|
4852
|
-
function
|
|
4853
|
-
return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <=
|
|
4859
|
+
function ds(e) {
|
|
4860
|
+
return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= Fn(e.year, e.month);
|
|
4854
4861
|
}
|
|
4855
|
-
function
|
|
4862
|
+
function yc(e) {
|
|
4856
4863
|
const t = /* @__PURE__ */ new Map();
|
|
4857
4864
|
return e.forEach((n) => {
|
|
4858
4865
|
n.id && t.set(n.id, (t.get(n.id) ?? 0) + 1);
|
|
4859
4866
|
}), e.flatMap(
|
|
4860
|
-
(n) => n.id && (t.get(n.id) ?? 0) > 1 ? [
|
|
4867
|
+
(n) => n.id && (t.get(n.id) ?? 0) > 1 ? [Gn(n)] : []
|
|
4861
4868
|
);
|
|
4862
4869
|
}
|
|
4863
4870
|
export {
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4871
|
+
Uo as $,
|
|
4872
|
+
Cs as A,
|
|
4873
|
+
Ys as B,
|
|
4874
|
+
zs as C,
|
|
4875
|
+
mn as D,
|
|
4876
|
+
As as E,
|
|
4877
|
+
bi as F,
|
|
4878
|
+
Rs as G,
|
|
4879
|
+
xi as H,
|
|
4880
|
+
Us as I,
|
|
4881
|
+
De as J,
|
|
4882
|
+
P as K,
|
|
4883
|
+
Ls as L,
|
|
4884
|
+
Ps as M,
|
|
4885
|
+
Ws as N,
|
|
4886
|
+
ki as O,
|
|
4887
|
+
_i as P,
|
|
4888
|
+
js as Q,
|
|
4889
|
+
Ni as R,
|
|
4890
|
+
Hs as S,
|
|
4891
|
+
nc as T,
|
|
4892
|
+
qi as U,
|
|
4893
|
+
Zi as V,
|
|
4894
|
+
Zs as W,
|
|
4895
|
+
Xi as X,
|
|
4896
|
+
Ki as Y,
|
|
4897
|
+
Rt as Z,
|
|
4898
|
+
sc as _,
|
|
4899
|
+
Qo as a,
|
|
4900
|
+
ka as a$,
|
|
4901
|
+
Ko as a0,
|
|
4902
|
+
Bo as a1,
|
|
4903
|
+
Go as a2,
|
|
4904
|
+
cc as a3,
|
|
4905
|
+
uc as a4,
|
|
4906
|
+
lc as a5,
|
|
4907
|
+
mc as a6,
|
|
4908
|
+
fc as a7,
|
|
4909
|
+
dc as a8,
|
|
4910
|
+
Bi as a9,
|
|
4911
|
+
yc as aA,
|
|
4912
|
+
oc as aB,
|
|
4913
|
+
Ms as aC,
|
|
4914
|
+
Co as aD,
|
|
4915
|
+
Js as aE,
|
|
4916
|
+
tc as aF,
|
|
4917
|
+
ec as aG,
|
|
4918
|
+
rc as aH,
|
|
4919
|
+
un as aI,
|
|
4920
|
+
$s as aJ,
|
|
4921
|
+
Ei as aK,
|
|
4922
|
+
ac as aL,
|
|
4923
|
+
ic as aM,
|
|
4924
|
+
Ao as aN,
|
|
4925
|
+
Ro as aO,
|
|
4926
|
+
Xe as aP,
|
|
4927
|
+
j as aQ,
|
|
4928
|
+
nn as aR,
|
|
4929
|
+
ue as aS,
|
|
4930
|
+
p as aT,
|
|
4931
|
+
br as aU,
|
|
4932
|
+
pe as aV,
|
|
4933
|
+
ct as aW,
|
|
4934
|
+
ie as aX,
|
|
4935
|
+
Ns as aY,
|
|
4936
|
+
Jt as aZ,
|
|
4937
|
+
pr as a_,
|
|
4938
|
+
Qi as aa,
|
|
4939
|
+
ne as ab,
|
|
4940
|
+
dn as ac,
|
|
4941
|
+
Xs as ad,
|
|
4942
|
+
Do as ae,
|
|
4943
|
+
fe as af,
|
|
4944
|
+
xn as ag,
|
|
4945
|
+
Gs as ah,
|
|
4946
|
+
vn as ai,
|
|
4947
|
+
Mn as aj,
|
|
4948
|
+
Qs as ak,
|
|
4949
|
+
ro as al,
|
|
4950
|
+
R as am,
|
|
4951
|
+
Ge as an,
|
|
4952
|
+
yn as ao,
|
|
4953
|
+
Vs as ap,
|
|
4954
|
+
Ks as aq,
|
|
4955
|
+
uo as ar,
|
|
4956
|
+
Bs as as,
|
|
4957
|
+
fo as at,
|
|
4958
|
+
bn as au,
|
|
4959
|
+
wo as av,
|
|
4960
|
+
To as aw,
|
|
4961
|
+
hc as ax,
|
|
4962
|
+
rs as ay,
|
|
4963
|
+
gc as az,
|
|
4964
|
+
ks as b,
|
|
4965
|
+
$i as b0,
|
|
4966
|
+
mr as b1,
|
|
4967
|
+
zo as b2,
|
|
4968
|
+
$t as b3,
|
|
4969
|
+
E as b4,
|
|
4970
|
+
Nt as b5,
|
|
4971
|
+
kt as b6,
|
|
4972
|
+
Yo as b7,
|
|
4973
|
+
Po as b8,
|
|
4974
|
+
te as b9,
|
|
4975
|
+
Ci as c,
|
|
4976
|
+
Ss as d,
|
|
4963
4977
|
qe as e,
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4978
|
+
$n as f,
|
|
4979
|
+
Kt as g,
|
|
4980
|
+
Bt as h,
|
|
4967
4981
|
J as i,
|
|
4968
4982
|
Gt as j,
|
|
4969
4983
|
Ze as k,
|
|
4970
|
-
|
|
4971
|
-
|
|
4984
|
+
fr as l,
|
|
4985
|
+
_s as m,
|
|
4972
4986
|
qt as n,
|
|
4973
4987
|
Zt as o,
|
|
4974
|
-
|
|
4975
|
-
|
|
4988
|
+
Be as p,
|
|
4989
|
+
wi as q,
|
|
4976
4990
|
Ui as r,
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4991
|
+
Ti as s,
|
|
4992
|
+
Fs as t,
|
|
4993
|
+
Es as u,
|
|
4994
|
+
Os as v,
|
|
4995
|
+
qs as w,
|
|
4996
|
+
Is as x,
|
|
4997
|
+
Ke as y,
|
|
4984
4998
|
ln as z
|
|
4985
4999
|
};
|