react-semaphor 0.1.537 → 0.1.538
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 +352 -341
- package/dist/assistant-context/index.js +10 -0
- package/dist/assistant-protocol/index.js +104 -0
- package/dist/brand-studio/index.js +35 -31
- package/dist/briefings/index.js +46 -45
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/chunks/add-to-dashboard-CxtTfISD.js +56 -0
- package/dist/chunks/aggregate-table-row-presentation-Qgpv6_G8.js +979 -0
- package/dist/chunks/analytics-base-schemas-BFAoRlkU.js +472 -0
- package/dist/chunks/apply-dashboard-operations-C-iahGka.js +402 -0
- package/dist/chunks/assistant-chat-BAqUIFp5.js +7966 -0
- package/dist/chunks/availability-Bp5Gfu1I.js +44 -0
- package/dist/chunks/{bookmark-state-B-I9BDD0.js → bookmark-state-k7y5SNGf.js} +9 -9
- package/dist/chunks/{braces-8TRlDwDw.js → braces-o9UiRQes.js} +1 -1
- package/dist/chunks/calculated-field-identity-DcBS2NPP.js +2161 -0
- package/dist/chunks/calendar-day-equality-Bpl15IBo.js +487 -0
- package/dist/chunks/class-utils-Df1OVOT1.js +2315 -0
- package/dist/chunks/{field-dependencies-CpRUwr9J.js → common-types-CUf03Htv.js} +65 -58
- package/dist/chunks/context-HD9usB1P.js +349 -0
- package/dist/chunks/conversation-sQiWYUOb.js +16 -0
- package/dist/chunks/csv-utils-GUfKyT1J.js +56 -0
- package/dist/chunks/custom-visual-inputs-BrUOIwln.js +3288 -0
- package/dist/chunks/{dashboard-BPJo-Fnd.js → dashboard-DTDDFQsS.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-A2uVpHCp.js → dashboard-briefing-launcher-Bb2QUqOa.js} +764 -740
- package/dist/chunks/{dashboard-controls-DxTuVis_.js → dashboard-controls-FpONU8QV.js} +683 -686
- package/dist/chunks/{common-types-g7yS12Cg.js → dashboard-filter-value-compatibility-D95O4nd7.js} +18 -24
- package/dist/chunks/dashboard-json-DazPhBU_.js +69 -0
- package/dist/chunks/document-dashboard-inputs-D96rlU7S.js +10678 -0
- package/dist/chunks/document-sheet-utils-C1eEldxs.js +1076 -0
- package/dist/chunks/{edit-dashboard-visual-ByV0OwSp.js → edit-dashboard-visual-CIhZodVH.js} +4744 -4746
- package/dist/chunks/editor-draft-sync-BN5qYHPF.js +15 -0
- package/dist/chunks/filter-value-text-BhWugPWE.js +163 -0
- package/dist/chunks/index-CqMiAkay.js +3164 -0
- package/dist/chunks/index-CuHybtft.js +51 -0
- package/dist/chunks/layout-grid-Bgzth8vd.js +16 -0
- package/dist/chunks/{matrix-analytical-definition-CgBTD6H8.js → matrix-analytical-definition-bcprSe4u.js} +1 -1
- package/dist/chunks/{matrix-card-CAdizkUl.js → matrix-card-CJn1hB5V.js} +13 -12
- package/dist/chunks/matrix-definition-DQDI2okF.js +206 -0
- package/dist/chunks/{matrix-formatter-DJCk8Znf.js → matrix-formatter-Bgw32tb3.js} +648 -457
- package/dist/chunks/matrix-member-presentation-BNPSDKBG.js +105 -0
- package/dist/chunks/{matrix-operation-contract-BKupLHXL.js → matrix-operation-contract-B8PBF1Gd.js} +134 -133
- package/dist/chunks/{metric-comparison-BKHyvnAy.js → metric-comparison-CojWeLqx.js} +1 -1
- package/dist/chunks/{palette-Cp1hqZtm.js → palette-D10o_yYX.js} +1 -1
- package/dist/chunks/pivot-header-presentation-MkcKnjn3.js +42 -0
- package/dist/chunks/{pivot-result-identity-Bs4tLtLo.js → pivot-result-identity-D6hhcRXi.js} +1 -1
- package/dist/chunks/pivot-result-lifecycle-8qCDmpKc.js +804 -0
- package/dist/chunks/raw-temporal-D61lr48Y.js +1464 -0
- package/dist/chunks/{raw-temporal-contract-mLFS-9wk.js → raw-temporal-contract-C51YG48G.js} +1 -1
- package/dist/chunks/report-preferences-dialog-BCGs4-AE.js +1808 -0
- package/dist/chunks/{report-runtime-context-CG_I0PPW.js → report-runtime-context-B984Nq1E.js} +8 -7
- package/dist/chunks/save-CfJpQQ68.js +21 -0
- package/dist/chunks/saved-dashboard-context-BrTkjcod.js +566 -0
- package/dist/chunks/{selection-reducer-CiDEtmAq.js → selection-reducer-vKIb_jS6.js} +2 -2
- package/dist/chunks/{semaphor-ready-indicator-CHu1L-lo.js → semaphor-ready-indicator-CHHoWhil.js} +65586 -62749
- package/dist/chunks/{shelf-drop-preview-context-i-H6DFyU.js → shelf-drop-preview-context-EsayECEC.js} +199 -196
- package/dist/chunks/{source-entity-resolution-C-oNyYMp.js → source-entity-resolution-CVA1a85c.js} +8 -8
- package/dist/chunks/switch-CvItuC1Q.js +8199 -0
- package/dist/chunks/{temporal-bucket-DlFuhCnT.js → temporal-bucket-D8JF7zKz.js} +86 -71
- package/dist/chunks/{temporal-bucket-contract-D2OuaVZ7.js → temporal-bucket-contract-DaOajRC7.js} +1 -1
- package/dist/chunks/{token-types-DtSJOUjh.js → token-types-bxUxXDX2.js} +1 -1
- package/dist/chunks/{upload-CAIpsti1.js → upload-BFX7apKV.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-Bj63WwHc.js → use-create-flow-overlay-state-BqA92GkX.js} +331 -339
- package/dist/chunks/{validators-DMSH81OM.js → validators-Ej1DdCXa.js} +1050 -1510
- package/dist/chunks/visual-choice-JiJ-_3bi.js +204 -0
- package/dist/chunks/x-4f5U2XwU.js +100 -0
- package/dist/chunks/{zoned-wall-clock-1qlWCE20.js → zoned-wall-clock-MulfA26h.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +823 -661
- package/dist/data-app-sdk/index.js +32 -30
- package/dist/data-app-sdk-adapters/index.js +23 -22
- package/dist/data-app-sdk-validation/index.js +23 -22
- package/dist/format-utils/index.js +173 -168
- package/dist/index.js +267 -258
- package/dist/layouts/index.js +236 -24
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/assistant-context.d.ts +2 -0
- package/dist/types/assistant-protocol.d.ts +2 -0
- package/dist/types/components/assistant/assistant-entry-points.d.ts +18 -0
- package/dist/types/components/assistant/assistant-provider.d.ts +19 -0
- package/dist/types/components/assistant/assistant-store.d.ts +52 -0
- package/dist/types/components/assistant/use-assistant.d.ts +38 -0
- package/dist/types/components/index.d.ts +5 -1
- package/dist/types/components/surfboard/filter/types.d.ts +5 -2
- package/dist/types/index.js +50 -51
- package/dist/types/lib/api/invalidate-token.d.ts +7 -0
- package/dist/types/lib/charts/cartesian-fields.d.ts +64 -0
- package/dist/types/lib/charts/types.d.ts +7 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +14 -2
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +5 -6
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +8 -3
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +11 -6
- package/dist/types/lib/dashboard-pagination/dashboard-card-pagination.d.ts +7 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +79 -0
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +3 -2
- package/dist/types/lib/document/document-table-data-policy.d.ts +15 -0
- package/dist/types/lib/filter-values/filter-mode.d.ts +22 -0
- package/dist/types/lib/hooks/use-calendar-context.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +7 -0
- package/dist/types/lib/print/print-inputs.d.ts +4 -2
- package/dist/types/lib/query-context/build-card-query-context.d.ts +12 -4
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +93 -0
- package/dist/types/lib/query-context/card-server-request.d.ts +72 -0
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
- package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +56 -0
- package/dist/types/lib/query-context/document-section-card-query.d.ts +45 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +17 -2
- package/dist/types/lib/stores/dashboard-store.d.ts +34 -11
- package/dist/types/lib/stores/editor-store.d.ts +4 -2
- package/dist/types/lib/types/token-types.d.ts +11 -0
- package/dist/types/lib/utils/card-type-change.d.ts +30 -0
- package/dist/types/lib/utils/comparison-window-caption.d.ts +12 -0
- package/dist/types/lib/utils/filter-default-value-utils.d.ts +13 -2
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +74 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +43 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/visual-choice.d.ts +75 -0
- package/dist/types/shared/assistant-context/index.d.ts +9 -0
- package/dist/types/shared/assistant-context/project-context.d.ts +55 -0
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +130 -0
- package/dist/types/shared/assistant-protocol/add-to-dashboard.d.ts +17 -0
- package/dist/types/shared/assistant-protocol/artifact.d.ts +63 -0
- package/dist/types/shared/assistant-protocol/availability.d.ts +39 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +952 -0
- package/dist/types/shared/assistant-protocol/conversation.d.ts +38 -0
- package/dist/types/shared/assistant-protocol/index.d.ts +16 -0
- package/dist/types/shared/assistant-protocol/limits.d.ts +53 -0
- package/dist/types/shared/assistant-protocol/parts.d.ts +131 -0
- package/dist/types/shared/assistant-protocol/request.d.ts +77 -0
- package/dist/types/shared/assistant-protocol/sources.d.ts +27 -0
- package/dist/types/shared/assistant-protocol/token-config.d.ts +32 -0
- package/dist/types/shared/assistant-protocol/transcript.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +112 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +1794 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/new-card.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/resolved-primary-date-field-validation.d.ts +16 -0
- package/dist/types/shared/format-utils/filter-detail.d.ts +70 -0
- package/dist/types/shared/format-utils/filter-value-text.d.ts +15 -0
- package/dist/types/shared/format-utils/index.d.ts +3 -0
- package/dist/types/shared/format-utils/raw-temporal.d.ts +7 -0
- package/dist/types/shared/format-utils/temporal-bucket.d.ts +7 -0
- package/dist/types/shared/layouts/frame-layouts.d.ts +23 -0
- package/dist/types/shared/layouts/index.d.ts +1 -0
- package/package.json +12 -2
- package/dist/chunks/calculated-field-identity-BptYhyOP.js +0 -1326
- package/dist/chunks/calendar-day-equality-BRjN1S9h.js +0 -383
- package/dist/chunks/card-config-utils-BOM1dxCk.js +0 -1150
- package/dist/chunks/constants-DNWVy8Y3.js +0 -9
- package/dist/chunks/dashboard-json-B1dEQu98.js +0 -65
- package/dist/chunks/field-aggregations-CoLzYHeL.js +0 -1229
- package/dist/chunks/index-DTcTAGGM.js +0 -4101
- package/dist/chunks/matrix-continuation-C4sRcjZU.js +0 -72
- package/dist/chunks/matrix-control-sources-DTqcA2_L.js +0 -636
- package/dist/chunks/matrix-definition-D9iShKZI.js +0 -87
- package/dist/chunks/matrix-member-presentation-Ct8GuxHt.js +0 -209
- package/dist/chunks/numeric-presentation-CWu3gunq.js +0 -537
- package/dist/chunks/pivot-header-presentation-CHs2GFrM.js +0 -753
- package/dist/chunks/pivot-result-lifecycle-DQz_gjGu.js +0 -789
- package/dist/chunks/raw-temporal-iMXRK-Qz.js +0 -930
- package/dist/chunks/report-preferences-dialog-DXPjteCU.js +0 -1623
- package/dist/chunks/save-kO6cIaob.js +0 -34
- package/dist/chunks/semantic-format-DiqYeKwU.js +0 -192
- package/dist/chunks/switch-DO8a0EfJ.js +0 -25004
- package/dist/chunks/temporal-input-presentation-BD7YNUzu.js +0 -195
- package/dist/chunks/x-CXDkqdur.js +0 -149
- package/dist/types/lib/class-utils.d.ts +0 -2
- package/dist/types/lib/document/document-input-runtime.d.ts +0 -26
- package/dist/types/lib/utils.d.ts +0 -51
|
@@ -1,43 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./matrix-operation-contract-
|
|
1
|
+
import { aD as he, w as j, l as ge, a4 as ye } from "./validators-Ej1DdCXa.js";
|
|
2
|
+
import "./matrix-operation-contract-B8PBF1Gd.js";
|
|
3
|
+
import { j as we } from "./analytics-base-schemas-BFAoRlkU.js";
|
|
3
4
|
import "zod";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { g as de, l as me, e as he, i as ge } from "./numeric-presentation-CWu3gunq.js";
|
|
7
|
-
import { b as we, c as G, d as I, e as W } from "./constants-DNWVy8Y3.js";
|
|
8
|
-
import { c as ye, f as be } from "./temporal-bucket-DlFuhCnT.js";
|
|
5
|
+
import { C as ae, D as ie, B as be, h as Me, i as I, z as De, q as xe, n as pe, g as Oe, k as Te } from "./raw-temporal-D61lr48Y.js";
|
|
6
|
+
import { l as ve, n as se, h as H, j as C, c as Pe, f as Se } from "./temporal-bucket-D8JF7zKz.js";
|
|
9
7
|
function h(e) {
|
|
10
8
|
const t = Object.prototype.toString.call(e);
|
|
11
9
|
return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || t === "[object Number]" || typeof e == "string" || t === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
|
|
12
10
|
}
|
|
13
|
-
function
|
|
11
|
+
function D(e, t) {
|
|
14
12
|
return e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
15
13
|
}
|
|
16
|
-
let
|
|
17
|
-
function
|
|
18
|
-
return
|
|
14
|
+
let ke = {};
|
|
15
|
+
function P() {
|
|
16
|
+
return ke;
|
|
19
17
|
}
|
|
20
|
-
function
|
|
21
|
-
var
|
|
22
|
-
const n =
|
|
23
|
-
return a.setDate(a.getDate() -
|
|
18
|
+
function W(e, t) {
|
|
19
|
+
var s, c, u, m;
|
|
20
|
+
const n = P(), 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 ?? ((m = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : m.weekStartsOn) ?? 0, a = h(e), i = a.getDay(), o = (i < r ? 7 : 0) + i - r;
|
|
21
|
+
return a.setDate(a.getDate() - o), a.setHours(0, 0, 0, 0), a;
|
|
24
22
|
}
|
|
25
23
|
function N(e) {
|
|
26
|
-
return
|
|
24
|
+
return W(e, { weekStartsOn: 1 });
|
|
27
25
|
}
|
|
28
|
-
function
|
|
29
|
-
const t = h(e), n = t.getFullYear(), r =
|
|
26
|
+
function oe(e) {
|
|
27
|
+
const t = h(e), n = t.getFullYear(), r = D(e, 0);
|
|
30
28
|
r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
|
|
31
|
-
const a = N(r),
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >=
|
|
29
|
+
const a = N(r), i = D(e, 0);
|
|
30
|
+
i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
|
|
31
|
+
const o = N(i);
|
|
32
|
+
return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >= o.getTime() ? n : n - 1;
|
|
35
33
|
}
|
|
36
|
-
function
|
|
34
|
+
function U(e) {
|
|
37
35
|
const t = h(e);
|
|
38
36
|
return t.setHours(0, 0, 0, 0), t;
|
|
39
37
|
}
|
|
40
|
-
function
|
|
38
|
+
function E(e) {
|
|
41
39
|
const t = h(e), n = new Date(
|
|
42
40
|
Date.UTC(
|
|
43
41
|
t.getFullYear(),
|
|
@@ -51,78 +49,78 @@ function C(e) {
|
|
|
51
49
|
);
|
|
52
50
|
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
53
51
|
}
|
|
54
|
-
function
|
|
55
|
-
const n =
|
|
56
|
-
return Math.round((a -
|
|
52
|
+
function We(e, t) {
|
|
53
|
+
const n = U(e), r = U(t), a = +n - E(n), i = +r - E(r);
|
|
54
|
+
return Math.round((a - i) / ve);
|
|
57
55
|
}
|
|
58
|
-
function
|
|
59
|
-
const t =
|
|
56
|
+
function Ce(e) {
|
|
57
|
+
const t = oe(e), n = D(e, 0);
|
|
60
58
|
return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), N(n);
|
|
61
59
|
}
|
|
62
60
|
function Y(e, t) {
|
|
63
61
|
const n = h(e), r = h(t), a = n.getTime() - r.getTime();
|
|
64
62
|
return a < 0 ? -1 : a > 0 ? 1 : a;
|
|
65
63
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
64
|
+
function Ye(e) {
|
|
65
|
+
return D(e, Date.now());
|
|
68
66
|
}
|
|
69
|
-
function
|
|
67
|
+
function Fe(e) {
|
|
70
68
|
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
71
69
|
}
|
|
72
|
-
function
|
|
73
|
-
if (!
|
|
70
|
+
function Ne(e) {
|
|
71
|
+
if (!Fe(e) && typeof e != "number")
|
|
74
72
|
return !1;
|
|
75
73
|
const t = h(e);
|
|
76
74
|
return !isNaN(Number(t));
|
|
77
75
|
}
|
|
78
|
-
function
|
|
79
|
-
const n = h(e), r = h(t), a = n.getFullYear() - r.getFullYear(),
|
|
80
|
-
return a * 12 +
|
|
76
|
+
function Ee(e, t) {
|
|
77
|
+
const n = h(e), r = h(t), a = n.getFullYear() - r.getFullYear(), i = n.getMonth() - r.getMonth();
|
|
78
|
+
return a * 12 + i;
|
|
81
79
|
}
|
|
82
|
-
function
|
|
80
|
+
function ze(e) {
|
|
83
81
|
return (t) => {
|
|
84
82
|
const r = (e ? Math[e] : Math.trunc)(t);
|
|
85
83
|
return r === 0 ? 0 : r;
|
|
86
84
|
};
|
|
87
85
|
}
|
|
88
|
-
function
|
|
86
|
+
function Le(e, t) {
|
|
89
87
|
return +h(e) - +h(t);
|
|
90
88
|
}
|
|
91
|
-
function
|
|
89
|
+
function Xe(e) {
|
|
92
90
|
const t = h(e);
|
|
93
91
|
return t.setHours(23, 59, 59, 999), t;
|
|
94
92
|
}
|
|
95
|
-
function
|
|
93
|
+
function _e(e) {
|
|
96
94
|
const t = h(e), n = t.getMonth();
|
|
97
95
|
return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
|
|
98
96
|
}
|
|
99
|
-
function
|
|
97
|
+
function qe(e) {
|
|
100
98
|
const t = h(e);
|
|
101
|
-
return +
|
|
99
|
+
return +Xe(t) == +_e(t);
|
|
102
100
|
}
|
|
103
|
-
function
|
|
104
|
-
const n = h(e), r = h(t), a = Y(n, r),
|
|
105
|
-
|
|
101
|
+
function Ie(e, t) {
|
|
102
|
+
const n = h(e), r = h(t), a = Y(n, r), i = Math.abs(
|
|
103
|
+
Ee(n, r)
|
|
106
104
|
);
|
|
107
|
-
let
|
|
108
|
-
if (
|
|
109
|
-
|
|
105
|
+
let o;
|
|
106
|
+
if (i < 1)
|
|
107
|
+
o = 0;
|
|
110
108
|
else {
|
|
111
|
-
n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - a *
|
|
112
|
-
let
|
|
113
|
-
|
|
109
|
+
n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - a * i);
|
|
110
|
+
let s = Y(n, r) === -a;
|
|
111
|
+
qe(h(e)) && i === 1 && Y(e, r) === 1 && (s = !1), o = a * (i - Number(s));
|
|
114
112
|
}
|
|
115
|
-
return
|
|
113
|
+
return o === 0 ? 0 : o;
|
|
116
114
|
}
|
|
117
|
-
function
|
|
118
|
-
const r =
|
|
119
|
-
return
|
|
115
|
+
function Re(e, t, n) {
|
|
116
|
+
const r = Le(e, t) / 1e3;
|
|
117
|
+
return ze(n == null ? void 0 : n.roundingMethod)(r);
|
|
120
118
|
}
|
|
121
|
-
function
|
|
122
|
-
const t = h(e), n =
|
|
119
|
+
function Ae(e) {
|
|
120
|
+
const t = h(e), n = D(e, 0);
|
|
123
121
|
return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
124
122
|
}
|
|
125
|
-
const
|
|
123
|
+
const je = {
|
|
126
124
|
lessThanXSeconds: {
|
|
127
125
|
one: "less than a second",
|
|
128
126
|
other: "less than {{count}} seconds"
|
|
@@ -184,77 +182,77 @@ const Xe = {
|
|
|
184
182
|
one: "almost 1 year",
|
|
185
183
|
other: "almost {{count}} years"
|
|
186
184
|
}
|
|
187
|
-
},
|
|
185
|
+
}, He = (e, t, n) => {
|
|
188
186
|
let r;
|
|
189
|
-
const a =
|
|
187
|
+
const a = je[e];
|
|
190
188
|
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;
|
|
191
189
|
};
|
|
192
|
-
function
|
|
190
|
+
function X(e) {
|
|
193
191
|
return (t = {}) => {
|
|
194
192
|
const n = t.width ? String(t.width) : e.defaultWidth;
|
|
195
193
|
return e.formats[n] || e.formats[e.defaultWidth];
|
|
196
194
|
};
|
|
197
195
|
}
|
|
198
|
-
const
|
|
196
|
+
const Ue = {
|
|
199
197
|
full: "EEEE, MMMM do, y",
|
|
200
198
|
long: "MMMM do, y",
|
|
201
199
|
medium: "MMM d, y",
|
|
202
200
|
short: "MM/dd/yyyy"
|
|
203
|
-
},
|
|
201
|
+
}, Be = {
|
|
204
202
|
full: "h:mm:ss a zzzz",
|
|
205
203
|
long: "h:mm:ss a z",
|
|
206
204
|
medium: "h:mm:ss a",
|
|
207
205
|
short: "h:mm a"
|
|
208
|
-
},
|
|
206
|
+
}, Ve = {
|
|
209
207
|
full: "{{date}} 'at' {{time}}",
|
|
210
208
|
long: "{{date}} 'at' {{time}}",
|
|
211
209
|
medium: "{{date}}, {{time}}",
|
|
212
210
|
short: "{{date}}, {{time}}"
|
|
213
|
-
},
|
|
214
|
-
date:
|
|
215
|
-
formats:
|
|
211
|
+
}, Ze = {
|
|
212
|
+
date: X({
|
|
213
|
+
formats: Ue,
|
|
216
214
|
defaultWidth: "full"
|
|
217
215
|
}),
|
|
218
|
-
time:
|
|
219
|
-
formats:
|
|
216
|
+
time: X({
|
|
217
|
+
formats: Be,
|
|
220
218
|
defaultWidth: "full"
|
|
221
219
|
}),
|
|
222
|
-
dateTime:
|
|
223
|
-
formats:
|
|
220
|
+
dateTime: X({
|
|
221
|
+
formats: Ve,
|
|
224
222
|
defaultWidth: "full"
|
|
225
223
|
})
|
|
226
|
-
},
|
|
224
|
+
}, $e = {
|
|
227
225
|
lastWeek: "'last' eeee 'at' p",
|
|
228
226
|
yesterday: "'yesterday at' p",
|
|
229
227
|
today: "'today at' p",
|
|
230
228
|
tomorrow: "'tomorrow at' p",
|
|
231
229
|
nextWeek: "eeee 'at' p",
|
|
232
230
|
other: "P"
|
|
233
|
-
},
|
|
234
|
-
function
|
|
231
|
+
}, Ge = (e, t, n, r) => $e[e];
|
|
232
|
+
function S(e) {
|
|
235
233
|
return (t, n) => {
|
|
236
234
|
const r = n != null && n.context ? String(n.context) : "standalone";
|
|
237
235
|
let a;
|
|
238
236
|
if (r === "formatting" && e.formattingValues) {
|
|
239
|
-
const
|
|
240
|
-
a = e.formattingValues[
|
|
237
|
+
const o = e.defaultFormattingWidth || e.defaultWidth, s = n != null && n.width ? String(n.width) : o;
|
|
238
|
+
a = e.formattingValues[s] || e.formattingValues[o];
|
|
241
239
|
} else {
|
|
242
|
-
const
|
|
243
|
-
a = e.values[
|
|
240
|
+
const o = e.defaultWidth, s = n != null && n.width ? String(n.width) : e.defaultWidth;
|
|
241
|
+
a = e.values[s] || e.values[o];
|
|
244
242
|
}
|
|
245
|
-
const
|
|
246
|
-
return a[
|
|
243
|
+
const i = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
244
|
+
return a[i];
|
|
247
245
|
};
|
|
248
246
|
}
|
|
249
|
-
const
|
|
247
|
+
const Qe = {
|
|
250
248
|
narrow: ["B", "A"],
|
|
251
249
|
abbreviated: ["BC", "AD"],
|
|
252
250
|
wide: ["Before Christ", "Anno Domini"]
|
|
253
|
-
},
|
|
251
|
+
}, Je = {
|
|
254
252
|
narrow: ["1", "2", "3", "4"],
|
|
255
253
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
256
254
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
257
|
-
},
|
|
255
|
+
}, Ke = {
|
|
258
256
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
259
257
|
abbreviated: [
|
|
260
258
|
"Jan",
|
|
@@ -284,7 +282,7 @@ const Ae = {
|
|
|
284
282
|
"November",
|
|
285
283
|
"December"
|
|
286
284
|
]
|
|
287
|
-
},
|
|
285
|
+
}, et = {
|
|
288
286
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
289
287
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
290
288
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -297,7 +295,7 @@ const Ae = {
|
|
|
297
295
|
"Friday",
|
|
298
296
|
"Saturday"
|
|
299
297
|
]
|
|
300
|
-
},
|
|
298
|
+
}, tt = {
|
|
301
299
|
narrow: {
|
|
302
300
|
am: "a",
|
|
303
301
|
pm: "p",
|
|
@@ -328,7 +326,7 @@ const Ae = {
|
|
|
328
326
|
evening: "evening",
|
|
329
327
|
night: "night"
|
|
330
328
|
}
|
|
331
|
-
},
|
|
329
|
+
}, nt = {
|
|
332
330
|
narrow: {
|
|
333
331
|
am: "a",
|
|
334
332
|
pm: "p",
|
|
@@ -359,7 +357,7 @@ const Ae = {
|
|
|
359
357
|
evening: "in the evening",
|
|
360
358
|
night: "at night"
|
|
361
359
|
}
|
|
362
|
-
},
|
|
360
|
+
}, rt = (e, t) => {
|
|
363
361
|
const n = Number(e), r = n % 100;
|
|
364
362
|
if (r > 20 || r < 10)
|
|
365
363
|
switch (r % 10) {
|
|
@@ -371,89 +369,89 @@ const Ae = {
|
|
|
371
369
|
return n + "rd";
|
|
372
370
|
}
|
|
373
371
|
return n + "th";
|
|
374
|
-
},
|
|
375
|
-
ordinalNumber:
|
|
376
|
-
era:
|
|
377
|
-
values:
|
|
372
|
+
}, at = {
|
|
373
|
+
ordinalNumber: rt,
|
|
374
|
+
era: S({
|
|
375
|
+
values: Qe,
|
|
378
376
|
defaultWidth: "wide"
|
|
379
377
|
}),
|
|
380
|
-
quarter:
|
|
381
|
-
values:
|
|
378
|
+
quarter: S({
|
|
379
|
+
values: Je,
|
|
382
380
|
defaultWidth: "wide",
|
|
383
381
|
argumentCallback: (e) => e - 1
|
|
384
382
|
}),
|
|
385
|
-
month:
|
|
386
|
-
values:
|
|
383
|
+
month: S({
|
|
384
|
+
values: Ke,
|
|
387
385
|
defaultWidth: "wide"
|
|
388
386
|
}),
|
|
389
|
-
day:
|
|
390
|
-
values:
|
|
387
|
+
day: S({
|
|
388
|
+
values: et,
|
|
391
389
|
defaultWidth: "wide"
|
|
392
390
|
}),
|
|
393
|
-
dayPeriod:
|
|
394
|
-
values:
|
|
391
|
+
dayPeriod: S({
|
|
392
|
+
values: tt,
|
|
395
393
|
defaultWidth: "wide",
|
|
396
|
-
formattingValues:
|
|
394
|
+
formattingValues: nt,
|
|
397
395
|
defaultFormattingWidth: "wide"
|
|
398
396
|
})
|
|
399
397
|
};
|
|
400
|
-
function
|
|
398
|
+
function k(e) {
|
|
401
399
|
return (t, n = {}) => {
|
|
402
|
-
const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth],
|
|
403
|
-
if (!
|
|
400
|
+
const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], i = t.match(a);
|
|
401
|
+
if (!i)
|
|
404
402
|
return null;
|
|
405
|
-
const
|
|
403
|
+
const o = i[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? st(s, (f) => f.test(o)) : (
|
|
406
404
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
407
|
-
|
|
405
|
+
it(s, (f) => f.test(o))
|
|
408
406
|
);
|
|
409
407
|
let u;
|
|
410
|
-
u = e.valueCallback ? e.valueCallback(
|
|
408
|
+
u = e.valueCallback ? e.valueCallback(c) : c, u = n.valueCallback ? (
|
|
411
409
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
412
410
|
n.valueCallback(u)
|
|
413
411
|
) : u;
|
|
414
|
-
const
|
|
415
|
-
return { value: u, rest:
|
|
412
|
+
const m = t.slice(o.length);
|
|
413
|
+
return { value: u, rest: m };
|
|
416
414
|
};
|
|
417
415
|
}
|
|
418
|
-
function
|
|
416
|
+
function it(e, t) {
|
|
419
417
|
for (const n in e)
|
|
420
418
|
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
421
419
|
return n;
|
|
422
420
|
}
|
|
423
|
-
function
|
|
421
|
+
function st(e, t) {
|
|
424
422
|
for (let n = 0; n < e.length; n++)
|
|
425
423
|
if (t(e[n]))
|
|
426
424
|
return n;
|
|
427
425
|
}
|
|
428
|
-
function
|
|
426
|
+
function ot(e) {
|
|
429
427
|
return (t, n = {}) => {
|
|
430
428
|
const r = t.match(e.matchPattern);
|
|
431
429
|
if (!r) return null;
|
|
432
|
-
const a = r[0],
|
|
433
|
-
if (!
|
|
434
|
-
let
|
|
435
|
-
|
|
436
|
-
const
|
|
437
|
-
return { value:
|
|
430
|
+
const a = r[0], i = t.match(e.parsePattern);
|
|
431
|
+
if (!i) return null;
|
|
432
|
+
let o = e.valueCallback ? e.valueCallback(i[0]) : i[0];
|
|
433
|
+
o = n.valueCallback ? n.valueCallback(o) : o;
|
|
434
|
+
const s = t.slice(a.length);
|
|
435
|
+
return { value: o, rest: s };
|
|
438
436
|
};
|
|
439
437
|
}
|
|
440
|
-
const
|
|
438
|
+
const ut = /^(\d+)(th|st|nd|rd)?/i, ct = /\d+/i, ft = {
|
|
441
439
|
narrow: /^(b|a)/i,
|
|
442
440
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
443
441
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
444
|
-
},
|
|
442
|
+
}, lt = {
|
|
445
443
|
any: [/^b/i, /^(a|c)/i]
|
|
446
|
-
},
|
|
444
|
+
}, mt = {
|
|
447
445
|
narrow: /^[1234]/i,
|
|
448
446
|
abbreviated: /^q[1234]/i,
|
|
449
447
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
450
|
-
},
|
|
448
|
+
}, dt = {
|
|
451
449
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
452
|
-
},
|
|
450
|
+
}, ht = {
|
|
453
451
|
narrow: /^[jfmasond]/i,
|
|
454
452
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
455
453
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
456
|
-
},
|
|
454
|
+
}, gt = {
|
|
457
455
|
narrow: [
|
|
458
456
|
/^j/i,
|
|
459
457
|
/^f/i,
|
|
@@ -482,18 +480,18 @@ const Ke = /^(\d+)(th|st|nd|rd)?/i, et = /\d+/i, tt = {
|
|
|
482
480
|
/^n/i,
|
|
483
481
|
/^d/i
|
|
484
482
|
]
|
|
485
|
-
},
|
|
483
|
+
}, yt = {
|
|
486
484
|
narrow: /^[smtwf]/i,
|
|
487
485
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
488
486
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
489
487
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
490
|
-
},
|
|
488
|
+
}, wt = {
|
|
491
489
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
492
490
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
493
|
-
},
|
|
491
|
+
}, bt = {
|
|
494
492
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
495
493
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
496
|
-
},
|
|
494
|
+
}, Mt = {
|
|
497
495
|
any: {
|
|
498
496
|
am: /^a/i,
|
|
499
497
|
pm: /^p/i,
|
|
@@ -504,82 +502,82 @@ const Ke = /^(\d+)(th|st|nd|rd)?/i, et = /\d+/i, tt = {
|
|
|
504
502
|
evening: /evening/i,
|
|
505
503
|
night: /night/i
|
|
506
504
|
}
|
|
507
|
-
},
|
|
508
|
-
ordinalNumber:
|
|
509
|
-
matchPattern:
|
|
510
|
-
parsePattern:
|
|
505
|
+
}, Dt = {
|
|
506
|
+
ordinalNumber: ot({
|
|
507
|
+
matchPattern: ut,
|
|
508
|
+
parsePattern: ct,
|
|
511
509
|
valueCallback: (e) => parseInt(e, 10)
|
|
512
510
|
}),
|
|
513
|
-
era:
|
|
514
|
-
matchPatterns:
|
|
511
|
+
era: k({
|
|
512
|
+
matchPatterns: ft,
|
|
515
513
|
defaultMatchWidth: "wide",
|
|
516
|
-
parsePatterns:
|
|
514
|
+
parsePatterns: lt,
|
|
517
515
|
defaultParseWidth: "any"
|
|
518
516
|
}),
|
|
519
|
-
quarter:
|
|
520
|
-
matchPatterns:
|
|
517
|
+
quarter: k({
|
|
518
|
+
matchPatterns: mt,
|
|
521
519
|
defaultMatchWidth: "wide",
|
|
522
|
-
parsePatterns:
|
|
520
|
+
parsePatterns: dt,
|
|
523
521
|
defaultParseWidth: "any",
|
|
524
522
|
valueCallback: (e) => e + 1
|
|
525
523
|
}),
|
|
526
|
-
month:
|
|
527
|
-
matchPatterns:
|
|
524
|
+
month: k({
|
|
525
|
+
matchPatterns: ht,
|
|
528
526
|
defaultMatchWidth: "wide",
|
|
529
|
-
parsePatterns:
|
|
527
|
+
parsePatterns: gt,
|
|
530
528
|
defaultParseWidth: "any"
|
|
531
529
|
}),
|
|
532
|
-
day:
|
|
533
|
-
matchPatterns:
|
|
530
|
+
day: k({
|
|
531
|
+
matchPatterns: yt,
|
|
534
532
|
defaultMatchWidth: "wide",
|
|
535
|
-
parsePatterns:
|
|
533
|
+
parsePatterns: wt,
|
|
536
534
|
defaultParseWidth: "any"
|
|
537
535
|
}),
|
|
538
|
-
dayPeriod:
|
|
539
|
-
matchPatterns:
|
|
536
|
+
dayPeriod: k({
|
|
537
|
+
matchPatterns: bt,
|
|
540
538
|
defaultMatchWidth: "any",
|
|
541
|
-
parsePatterns:
|
|
539
|
+
parsePatterns: Mt,
|
|
542
540
|
defaultParseWidth: "any"
|
|
543
541
|
})
|
|
544
|
-
},
|
|
542
|
+
}, ue = {
|
|
545
543
|
code: "en-US",
|
|
546
|
-
formatDistance:
|
|
547
|
-
formatLong:
|
|
548
|
-
formatRelative:
|
|
549
|
-
localize:
|
|
550
|
-
match:
|
|
544
|
+
formatDistance: He,
|
|
545
|
+
formatLong: Ze,
|
|
546
|
+
formatRelative: Ge,
|
|
547
|
+
localize: at,
|
|
548
|
+
match: Dt,
|
|
551
549
|
options: {
|
|
552
550
|
weekStartsOn: 0,
|
|
553
551
|
firstWeekContainsDate: 1
|
|
554
552
|
}
|
|
555
553
|
};
|
|
556
|
-
function
|
|
554
|
+
function xt(e) {
|
|
557
555
|
const t = h(e);
|
|
558
|
-
return
|
|
559
|
-
}
|
|
560
|
-
function
|
|
561
|
-
const t = h(e), n = +N(t) - +
|
|
562
|
-
return Math.round(n /
|
|
563
|
-
}
|
|
564
|
-
function
|
|
565
|
-
var
|
|
566
|
-
const n = h(e), r = n.getFullYear(), a =
|
|
567
|
-
|
|
568
|
-
const
|
|
569
|
-
|
|
570
|
-
const u =
|
|
571
|
-
return n.getTime() >=
|
|
572
|
-
}
|
|
573
|
-
function
|
|
574
|
-
var
|
|
575
|
-
const n =
|
|
576
|
-
return
|
|
577
|
-
}
|
|
578
|
-
function
|
|
579
|
-
const n = h(e), r = +
|
|
580
|
-
return Math.round(r /
|
|
581
|
-
}
|
|
582
|
-
function
|
|
556
|
+
return We(t, Ae(t)) + 1;
|
|
557
|
+
}
|
|
558
|
+
function pt(e) {
|
|
559
|
+
const t = h(e), n = +N(t) - +Ce(t);
|
|
560
|
+
return Math.round(n / se) + 1;
|
|
561
|
+
}
|
|
562
|
+
function ce(e, t) {
|
|
563
|
+
var m, f, l, g;
|
|
564
|
+
const n = h(e), r = n.getFullYear(), a = P(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((f = (m = t == null ? void 0 : t.locale) == null ? void 0 : m.options) == null ? void 0 : f.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((g = (l = a.locale) == null ? void 0 : l.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, o = D(e, 0);
|
|
565
|
+
o.setFullYear(r + 1, 0, i), o.setHours(0, 0, 0, 0);
|
|
566
|
+
const s = W(o, t), c = D(e, 0);
|
|
567
|
+
c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
|
|
568
|
+
const u = W(c, t);
|
|
569
|
+
return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= u.getTime() ? r : r - 1;
|
|
570
|
+
}
|
|
571
|
+
function Ot(e, t) {
|
|
572
|
+
var s, c, u, m;
|
|
573
|
+
const n = P(), 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 ?? ((m = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : m.firstWeekContainsDate) ?? 1, a = ce(e, t), i = D(e, 0);
|
|
574
|
+
return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), W(i, t);
|
|
575
|
+
}
|
|
576
|
+
function Tt(e, t) {
|
|
577
|
+
const n = h(e), r = +W(n, t) - +Ot(n, t);
|
|
578
|
+
return Math.round(r / se) + 1;
|
|
579
|
+
}
|
|
580
|
+
function d(e, t) {
|
|
583
581
|
const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
|
|
584
582
|
return n + r;
|
|
585
583
|
}
|
|
@@ -587,16 +585,16 @@ const M = {
|
|
|
587
585
|
// Year
|
|
588
586
|
y(e, t) {
|
|
589
587
|
const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
590
|
-
return
|
|
588
|
+
return d(t === "yy" ? r % 100 : r, t.length);
|
|
591
589
|
},
|
|
592
590
|
// Month
|
|
593
591
|
M(e, t) {
|
|
594
592
|
const n = e.getMonth();
|
|
595
|
-
return t === "M" ? String(n + 1) :
|
|
593
|
+
return t === "M" ? String(n + 1) : d(n + 1, 2);
|
|
596
594
|
},
|
|
597
595
|
// Day of the month
|
|
598
596
|
d(e, t) {
|
|
599
|
-
return
|
|
597
|
+
return d(e.getDate(), t.length);
|
|
600
598
|
},
|
|
601
599
|
// AM or PM
|
|
602
600
|
a(e, t) {
|
|
@@ -616,35 +614,35 @@ const M = {
|
|
|
616
614
|
},
|
|
617
615
|
// Hour [1-12]
|
|
618
616
|
h(e, t) {
|
|
619
|
-
return
|
|
617
|
+
return d(e.getHours() % 12 || 12, t.length);
|
|
620
618
|
},
|
|
621
619
|
// Hour [0-23]
|
|
622
620
|
H(e, t) {
|
|
623
|
-
return
|
|
621
|
+
return d(e.getHours(), t.length);
|
|
624
622
|
},
|
|
625
623
|
// Minute
|
|
626
624
|
m(e, t) {
|
|
627
|
-
return
|
|
625
|
+
return d(e.getMinutes(), t.length);
|
|
628
626
|
},
|
|
629
627
|
// Second
|
|
630
628
|
s(e, t) {
|
|
631
|
-
return
|
|
629
|
+
return d(e.getSeconds(), t.length);
|
|
632
630
|
},
|
|
633
631
|
// Fraction of second
|
|
634
632
|
S(e, t) {
|
|
635
633
|
const n = t.length, r = e.getMilliseconds(), a = Math.trunc(
|
|
636
634
|
r * Math.pow(10, n - 3)
|
|
637
635
|
);
|
|
638
|
-
return
|
|
636
|
+
return d(a, t.length);
|
|
639
637
|
}
|
|
640
|
-
},
|
|
638
|
+
}, T = {
|
|
641
639
|
midnight: "midnight",
|
|
642
640
|
noon: "noon",
|
|
643
641
|
morning: "morning",
|
|
644
642
|
afternoon: "afternoon",
|
|
645
643
|
evening: "evening",
|
|
646
644
|
night: "night"
|
|
647
|
-
},
|
|
645
|
+
}, B = {
|
|
648
646
|
// Era
|
|
649
647
|
G: function(e, t, n) {
|
|
650
648
|
const r = e.getFullYear() > 0 ? 1 : 0;
|
|
@@ -670,17 +668,17 @@ const M = {
|
|
|
670
668
|
},
|
|
671
669
|
// Local week-numbering year
|
|
672
670
|
Y: function(e, t, n, r) {
|
|
673
|
-
const a =
|
|
671
|
+
const a = ce(e, r), i = a > 0 ? a : 1 - a;
|
|
674
672
|
if (t === "YY") {
|
|
675
|
-
const
|
|
676
|
-
return
|
|
673
|
+
const o = i % 100;
|
|
674
|
+
return d(o, 2);
|
|
677
675
|
}
|
|
678
|
-
return t === "Yo" ? n.ordinalNumber(
|
|
676
|
+
return t === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : d(i, t.length);
|
|
679
677
|
},
|
|
680
678
|
// ISO week-numbering year
|
|
681
679
|
R: function(e, t) {
|
|
682
|
-
const n =
|
|
683
|
-
return
|
|
680
|
+
const n = oe(e);
|
|
681
|
+
return d(n, t.length);
|
|
684
682
|
},
|
|
685
683
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
686
684
|
// The main difference between `y` and `u` localizers are B.C. years:
|
|
@@ -693,7 +691,7 @@ const M = {
|
|
|
693
691
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
694
692
|
u: function(e, t) {
|
|
695
693
|
const n = e.getFullYear();
|
|
696
|
-
return
|
|
694
|
+
return d(n, t.length);
|
|
697
695
|
},
|
|
698
696
|
// Quarter
|
|
699
697
|
Q: function(e, t, n) {
|
|
@@ -702,7 +700,7 @@ const M = {
|
|
|
702
700
|
case "Q":
|
|
703
701
|
return String(r);
|
|
704
702
|
case "QQ":
|
|
705
|
-
return
|
|
703
|
+
return d(r, 2);
|
|
706
704
|
case "Qo":
|
|
707
705
|
return n.ordinalNumber(r, { unit: "quarter" });
|
|
708
706
|
case "QQQ":
|
|
@@ -730,7 +728,7 @@ const M = {
|
|
|
730
728
|
case "q":
|
|
731
729
|
return String(r);
|
|
732
730
|
case "qq":
|
|
733
|
-
return
|
|
731
|
+
return d(r, 2);
|
|
734
732
|
case "qo":
|
|
735
733
|
return n.ordinalNumber(r, { unit: "quarter" });
|
|
736
734
|
case "qqq":
|
|
@@ -782,7 +780,7 @@ const M = {
|
|
|
782
780
|
case "L":
|
|
783
781
|
return String(r + 1);
|
|
784
782
|
case "LL":
|
|
785
|
-
return
|
|
783
|
+
return d(r + 1, 2);
|
|
786
784
|
case "Lo":
|
|
787
785
|
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
788
786
|
case "LLL":
|
|
@@ -802,13 +800,13 @@ const M = {
|
|
|
802
800
|
},
|
|
803
801
|
// Local week of year
|
|
804
802
|
w: function(e, t, n, r) {
|
|
805
|
-
const a =
|
|
806
|
-
return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) :
|
|
803
|
+
const a = Tt(e, r);
|
|
804
|
+
return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : d(a, t.length);
|
|
807
805
|
},
|
|
808
806
|
// ISO week of year
|
|
809
807
|
I: function(e, t, n) {
|
|
810
|
-
const r =
|
|
811
|
-
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) :
|
|
808
|
+
const r = pt(e);
|
|
809
|
+
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : d(r, t.length);
|
|
812
810
|
},
|
|
813
811
|
// Day of the month
|
|
814
812
|
d: function(e, t, n) {
|
|
@@ -816,8 +814,8 @@ const M = {
|
|
|
816
814
|
},
|
|
817
815
|
// Day of year
|
|
818
816
|
D: function(e, t, n) {
|
|
819
|
-
const r =
|
|
820
|
-
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) :
|
|
817
|
+
const r = xt(e);
|
|
818
|
+
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : d(r, t.length);
|
|
821
819
|
},
|
|
822
820
|
// Day of week
|
|
823
821
|
E: function(e, t, n) {
|
|
@@ -850,14 +848,14 @@ const M = {
|
|
|
850
848
|
},
|
|
851
849
|
// Local day of week
|
|
852
850
|
e: function(e, t, n, r) {
|
|
853
|
-
const a = e.getDay(),
|
|
851
|
+
const a = e.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
854
852
|
switch (t) {
|
|
855
853
|
case "e":
|
|
856
|
-
return String(
|
|
854
|
+
return String(i);
|
|
857
855
|
case "ee":
|
|
858
|
-
return
|
|
856
|
+
return d(i, 2);
|
|
859
857
|
case "eo":
|
|
860
|
-
return n.ordinalNumber(
|
|
858
|
+
return n.ordinalNumber(i, { unit: "day" });
|
|
861
859
|
case "eee":
|
|
862
860
|
return n.day(a, {
|
|
863
861
|
width: "abbreviated",
|
|
@@ -883,14 +881,14 @@ const M = {
|
|
|
883
881
|
},
|
|
884
882
|
// Stand-alone local day of week
|
|
885
883
|
c: function(e, t, n, r) {
|
|
886
|
-
const a = e.getDay(),
|
|
884
|
+
const a = e.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
887
885
|
switch (t) {
|
|
888
886
|
case "c":
|
|
889
|
-
return String(
|
|
887
|
+
return String(i);
|
|
890
888
|
case "cc":
|
|
891
|
-
return
|
|
889
|
+
return d(i, t.length);
|
|
892
890
|
case "co":
|
|
893
|
-
return n.ordinalNumber(
|
|
891
|
+
return n.ordinalNumber(i, { unit: "day" });
|
|
894
892
|
case "ccc":
|
|
895
893
|
return n.day(a, {
|
|
896
894
|
width: "abbreviated",
|
|
@@ -921,7 +919,7 @@ const M = {
|
|
|
921
919
|
case "i":
|
|
922
920
|
return String(a);
|
|
923
921
|
case "ii":
|
|
924
|
-
return
|
|
922
|
+
return d(a, t.length);
|
|
925
923
|
case "io":
|
|
926
924
|
return n.ordinalNumber(a, { unit: "day" });
|
|
927
925
|
case "iii":
|
|
@@ -979,7 +977,7 @@ const M = {
|
|
|
979
977
|
b: function(e, t, n) {
|
|
980
978
|
const r = e.getHours();
|
|
981
979
|
let a;
|
|
982
|
-
switch (r === 12 ? a =
|
|
980
|
+
switch (r === 12 ? a = T.noon : r === 0 ? a = T.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
|
|
983
981
|
case "b":
|
|
984
982
|
case "bb":
|
|
985
983
|
return n.dayPeriod(a, {
|
|
@@ -1008,7 +1006,7 @@ const M = {
|
|
|
1008
1006
|
B: function(e, t, n) {
|
|
1009
1007
|
const r = e.getHours();
|
|
1010
1008
|
let a;
|
|
1011
|
-
switch (r >= 17 ? a =
|
|
1009
|
+
switch (r >= 17 ? a = T.evening : r >= 12 ? a = T.afternoon : r >= 4 ? a = T.morning : a = T.night, t) {
|
|
1012
1010
|
case "B":
|
|
1013
1011
|
case "BB":
|
|
1014
1012
|
case "BBB":
|
|
@@ -1044,12 +1042,12 @@ const M = {
|
|
|
1044
1042
|
// Hour [0-11]
|
|
1045
1043
|
K: function(e, t, n) {
|
|
1046
1044
|
const r = e.getHours() % 12;
|
|
1047
|
-
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) :
|
|
1045
|
+
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : d(r, t.length);
|
|
1048
1046
|
},
|
|
1049
1047
|
// Hour [1-24]
|
|
1050
1048
|
k: function(e, t, n) {
|
|
1051
1049
|
let r = e.getHours();
|
|
1052
|
-
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) :
|
|
1050
|
+
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : d(r, t.length);
|
|
1053
1051
|
},
|
|
1054
1052
|
// Minute
|
|
1055
1053
|
m: function(e, t, n) {
|
|
@@ -1070,14 +1068,14 @@ const M = {
|
|
|
1070
1068
|
return "Z";
|
|
1071
1069
|
switch (t) {
|
|
1072
1070
|
case "X":
|
|
1073
|
-
return
|
|
1071
|
+
return Z(r);
|
|
1074
1072
|
case "XXXX":
|
|
1075
1073
|
case "XX":
|
|
1076
|
-
return
|
|
1074
|
+
return p(r);
|
|
1077
1075
|
case "XXXXX":
|
|
1078
1076
|
case "XXX":
|
|
1079
1077
|
default:
|
|
1080
|
-
return
|
|
1078
|
+
return p(r, ":");
|
|
1081
1079
|
}
|
|
1082
1080
|
},
|
|
1083
1081
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
@@ -1085,14 +1083,14 @@ const M = {
|
|
|
1085
1083
|
const r = e.getTimezoneOffset();
|
|
1086
1084
|
switch (t) {
|
|
1087
1085
|
case "x":
|
|
1088
|
-
return
|
|
1086
|
+
return Z(r);
|
|
1089
1087
|
case "xxxx":
|
|
1090
1088
|
case "xx":
|
|
1091
|
-
return
|
|
1089
|
+
return p(r);
|
|
1092
1090
|
case "xxxxx":
|
|
1093
1091
|
case "xxx":
|
|
1094
1092
|
default:
|
|
1095
|
-
return
|
|
1093
|
+
return p(r, ":");
|
|
1096
1094
|
}
|
|
1097
1095
|
},
|
|
1098
1096
|
// Timezone (GMT)
|
|
@@ -1102,10 +1100,10 @@ const M = {
|
|
|
1102
1100
|
case "O":
|
|
1103
1101
|
case "OO":
|
|
1104
1102
|
case "OOO":
|
|
1105
|
-
return "GMT" +
|
|
1103
|
+
return "GMT" + V(r, ":");
|
|
1106
1104
|
case "OOOO":
|
|
1107
1105
|
default:
|
|
1108
|
-
return "GMT" +
|
|
1106
|
+
return "GMT" + p(r, ":");
|
|
1109
1107
|
}
|
|
1110
1108
|
},
|
|
1111
1109
|
// Timezone (specific non-location)
|
|
@@ -1115,35 +1113,35 @@ const M = {
|
|
|
1115
1113
|
case "z":
|
|
1116
1114
|
case "zz":
|
|
1117
1115
|
case "zzz":
|
|
1118
|
-
return "GMT" +
|
|
1116
|
+
return "GMT" + V(r, ":");
|
|
1119
1117
|
case "zzzz":
|
|
1120
1118
|
default:
|
|
1121
|
-
return "GMT" +
|
|
1119
|
+
return "GMT" + p(r, ":");
|
|
1122
1120
|
}
|
|
1123
1121
|
},
|
|
1124
1122
|
// Seconds timestamp
|
|
1125
1123
|
t: function(e, t, n) {
|
|
1126
1124
|
const r = Math.trunc(e.getTime() / 1e3);
|
|
1127
|
-
return
|
|
1125
|
+
return d(r, t.length);
|
|
1128
1126
|
},
|
|
1129
1127
|
// Milliseconds timestamp
|
|
1130
1128
|
T: function(e, t, n) {
|
|
1131
1129
|
const r = e.getTime();
|
|
1132
|
-
return
|
|
1130
|
+
return d(r, t.length);
|
|
1133
1131
|
}
|
|
1134
1132
|
};
|
|
1135
|
-
function
|
|
1136
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60),
|
|
1137
|
-
return
|
|
1133
|
+
function V(e, t = "") {
|
|
1134
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), i = r % 60;
|
|
1135
|
+
return i === 0 ? n + String(a) : n + String(a) + t + d(i, 2);
|
|
1138
1136
|
}
|
|
1139
|
-
function
|
|
1140
|
-
return e % 60 === 0 ? (e > 0 ? "-" : "+") +
|
|
1137
|
+
function Z(e, t) {
|
|
1138
|
+
return e % 60 === 0 ? (e > 0 ? "-" : "+") + d(Math.abs(e) / 60, 2) : p(e, t);
|
|
1141
1139
|
}
|
|
1142
|
-
function
|
|
1143
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a =
|
|
1144
|
-
return n + a + t +
|
|
1140
|
+
function p(e, t = "") {
|
|
1141
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = d(Math.trunc(r / 60), 2), i = d(r % 60, 2);
|
|
1142
|
+
return n + a + t + i;
|
|
1145
1143
|
}
|
|
1146
|
-
const
|
|
1144
|
+
const $ = (e, t) => {
|
|
1147
1145
|
switch (e) {
|
|
1148
1146
|
case "P":
|
|
1149
1147
|
return t.date({ width: "short" });
|
|
@@ -1155,7 +1153,7 @@ const Z = (e, t) => {
|
|
|
1155
1153
|
default:
|
|
1156
1154
|
return t.date({ width: "full" });
|
|
1157
1155
|
}
|
|
1158
|
-
},
|
|
1156
|
+
}, fe = (e, t) => {
|
|
1159
1157
|
switch (e) {
|
|
1160
1158
|
case "p":
|
|
1161
1159
|
return t.time({ width: "short" });
|
|
@@ -1167,155 +1165,155 @@ const Z = (e, t) => {
|
|
|
1167
1165
|
default:
|
|
1168
1166
|
return t.time({ width: "full" });
|
|
1169
1167
|
}
|
|
1170
|
-
},
|
|
1168
|
+
}, vt = (e, t) => {
|
|
1171
1169
|
const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1172
1170
|
if (!a)
|
|
1173
|
-
return
|
|
1174
|
-
let
|
|
1171
|
+
return $(e, t);
|
|
1172
|
+
let i;
|
|
1175
1173
|
switch (r) {
|
|
1176
1174
|
case "P":
|
|
1177
|
-
|
|
1175
|
+
i = t.dateTime({ width: "short" });
|
|
1178
1176
|
break;
|
|
1179
1177
|
case "PP":
|
|
1180
|
-
|
|
1178
|
+
i = t.dateTime({ width: "medium" });
|
|
1181
1179
|
break;
|
|
1182
1180
|
case "PPP":
|
|
1183
|
-
|
|
1181
|
+
i = t.dateTime({ width: "long" });
|
|
1184
1182
|
break;
|
|
1185
1183
|
case "PPPP":
|
|
1186
1184
|
default:
|
|
1187
|
-
|
|
1185
|
+
i = t.dateTime({ width: "full" });
|
|
1188
1186
|
break;
|
|
1189
1187
|
}
|
|
1190
|
-
return
|
|
1191
|
-
},
|
|
1192
|
-
p:
|
|
1193
|
-
P:
|
|
1194
|
-
},
|
|
1195
|
-
function
|
|
1196
|
-
return
|
|
1188
|
+
return i.replace("{{date}}", $(r, t)).replace("{{time}}", fe(a, t));
|
|
1189
|
+
}, Pt = {
|
|
1190
|
+
p: fe,
|
|
1191
|
+
P: vt
|
|
1192
|
+
}, St = /^D+$/, kt = /^Y+$/, Wt = ["D", "DD", "YY", "YYYY"];
|
|
1193
|
+
function Ct(e) {
|
|
1194
|
+
return St.test(e);
|
|
1197
1195
|
}
|
|
1198
|
-
function
|
|
1199
|
-
return
|
|
1196
|
+
function Yt(e) {
|
|
1197
|
+
return kt.test(e);
|
|
1200
1198
|
}
|
|
1201
|
-
function
|
|
1202
|
-
const r =
|
|
1203
|
-
if (console.warn(r),
|
|
1199
|
+
function Ft(e, t, n) {
|
|
1200
|
+
const r = Nt(e, t, n);
|
|
1201
|
+
if (console.warn(r), Wt.includes(e)) throw new RangeError(r);
|
|
1204
1202
|
}
|
|
1205
|
-
function
|
|
1203
|
+
function Nt(e, t, n) {
|
|
1206
1204
|
const r = e[0] === "Y" ? "years" : "days of the month";
|
|
1207
1205
|
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`;
|
|
1208
1206
|
}
|
|
1209
|
-
const
|
|
1210
|
-
function
|
|
1211
|
-
var
|
|
1212
|
-
const r =
|
|
1213
|
-
if (!
|
|
1207
|
+
const Et = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, zt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Lt = /^'([^]*?)'?$/, Xt = /''/g, _t = /[a-zA-Z]/;
|
|
1208
|
+
function le(e, t, n) {
|
|
1209
|
+
var m, f, l, g, b, O, R, A;
|
|
1210
|
+
const r = P(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? ue, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((f = (m = n == null ? void 0 : n.locale) == null ? void 0 : m.options) == null ? void 0 : f.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((g = (l = r.locale) == null ? void 0 : l.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, o = (n == null ? void 0 : n.weekStartsOn) ?? ((O = (b = n == null ? void 0 : n.locale) == null ? void 0 : b.options) == null ? void 0 : O.weekStartsOn) ?? r.weekStartsOn ?? ((A = (R = r.locale) == null ? void 0 : R.options) == null ? void 0 : A.weekStartsOn) ?? 0, s = h(e);
|
|
1211
|
+
if (!Ne(s))
|
|
1214
1212
|
throw new RangeError("Invalid time value");
|
|
1215
|
-
let
|
|
1216
|
-
const
|
|
1217
|
-
if (
|
|
1218
|
-
const
|
|
1219
|
-
return
|
|
1213
|
+
let c = t.match(zt).map((w) => {
|
|
1214
|
+
const y = w[0];
|
|
1215
|
+
if (y === "p" || y === "P") {
|
|
1216
|
+
const L = Pt[y];
|
|
1217
|
+
return L(w, a.formatLong);
|
|
1220
1218
|
}
|
|
1221
|
-
return
|
|
1222
|
-
}).join("").match(
|
|
1223
|
-
if (
|
|
1219
|
+
return w;
|
|
1220
|
+
}).join("").match(Et).map((w) => {
|
|
1221
|
+
if (w === "''")
|
|
1224
1222
|
return { isToken: !1, value: "'" };
|
|
1225
|
-
const
|
|
1226
|
-
if (
|
|
1227
|
-
return { isToken: !1, value:
|
|
1228
|
-
if (
|
|
1229
|
-
return { isToken: !0, value:
|
|
1230
|
-
if (
|
|
1223
|
+
const y = w[0];
|
|
1224
|
+
if (y === "'")
|
|
1225
|
+
return { isToken: !1, value: qt(w) };
|
|
1226
|
+
if (B[y])
|
|
1227
|
+
return { isToken: !0, value: w };
|
|
1228
|
+
if (y.match(_t))
|
|
1231
1229
|
throw new RangeError(
|
|
1232
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
1230
|
+
"Format string contains an unescaped latin alphabet character `" + y + "`"
|
|
1233
1231
|
);
|
|
1234
|
-
return { isToken: !1, value:
|
|
1232
|
+
return { isToken: !1, value: w };
|
|
1235
1233
|
});
|
|
1236
|
-
a.localize.preprocessor && (
|
|
1234
|
+
a.localize.preprocessor && (c = a.localize.preprocessor(s, c));
|
|
1237
1235
|
const u = {
|
|
1238
|
-
firstWeekContainsDate:
|
|
1239
|
-
weekStartsOn:
|
|
1236
|
+
firstWeekContainsDate: i,
|
|
1237
|
+
weekStartsOn: o,
|
|
1240
1238
|
locale: a
|
|
1241
1239
|
};
|
|
1242
|
-
return
|
|
1243
|
-
if (!
|
|
1244
|
-
const
|
|
1245
|
-
(!(n != null && n.useAdditionalWeekYearTokens) &&
|
|
1246
|
-
const
|
|
1247
|
-
return
|
|
1240
|
+
return c.map((w) => {
|
|
1241
|
+
if (!w.isToken) return w.value;
|
|
1242
|
+
const y = w.value;
|
|
1243
|
+
(!(n != null && n.useAdditionalWeekYearTokens) && Yt(y) || !(n != null && n.useAdditionalDayOfYearTokens) && Ct(y)) && Ft(y, t, String(e));
|
|
1244
|
+
const L = B[y[0]];
|
|
1245
|
+
return L(s, y, a.localize, u);
|
|
1248
1246
|
}).join("");
|
|
1249
1247
|
}
|
|
1250
|
-
function
|
|
1251
|
-
const t = e.match(
|
|
1252
|
-
return t ? t[1].replace(
|
|
1248
|
+
function qt(e) {
|
|
1249
|
+
const t = e.match(Lt);
|
|
1250
|
+
return t ? t[1].replace(Xt, "'") : e;
|
|
1253
1251
|
}
|
|
1254
|
-
function
|
|
1255
|
-
const r =
|
|
1256
|
-
if (isNaN(
|
|
1252
|
+
function It(e, t, n) {
|
|
1253
|
+
const r = P(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? ue, i = 2520, o = Y(e, t);
|
|
1254
|
+
if (isNaN(o))
|
|
1257
1255
|
throw new RangeError("Invalid time value");
|
|
1258
|
-
const
|
|
1256
|
+
const s = Object.assign({}, n, {
|
|
1259
1257
|
addSuffix: n == null ? void 0 : n.addSuffix,
|
|
1260
|
-
comparison:
|
|
1258
|
+
comparison: o
|
|
1261
1259
|
});
|
|
1262
|
-
let
|
|
1263
|
-
|
|
1264
|
-
const
|
|
1260
|
+
let c, u;
|
|
1261
|
+
o > 0 ? (c = h(t), u = h(e)) : (c = h(e), u = h(t));
|
|
1262
|
+
const m = Re(u, c), f = (E(u) - E(c)) / 1e3, l = Math.round((m - f) / 60);
|
|
1265
1263
|
let g;
|
|
1266
1264
|
if (l < 2)
|
|
1267
|
-
return n != null && n.includeSeconds ?
|
|
1265
|
+
return n != null && n.includeSeconds ? m < 5 ? a.formatDistance("lessThanXSeconds", 5, s) : m < 10 ? a.formatDistance("lessThanXSeconds", 10, s) : m < 20 ? a.formatDistance("lessThanXSeconds", 20, s) : m < 40 ? a.formatDistance("halfAMinute", 0, s) : m < 60 ? a.formatDistance("lessThanXMinutes", 1, s) : a.formatDistance("xMinutes", 1, s) : l === 0 ? a.formatDistance("lessThanXMinutes", 1, s) : a.formatDistance("xMinutes", l, s);
|
|
1268
1266
|
if (l < 45)
|
|
1269
|
-
return a.formatDistance("xMinutes", l,
|
|
1267
|
+
return a.formatDistance("xMinutes", l, s);
|
|
1270
1268
|
if (l < 90)
|
|
1271
|
-
return a.formatDistance("aboutXHours", 1,
|
|
1272
|
-
if (l <
|
|
1269
|
+
return a.formatDistance("aboutXHours", 1, s);
|
|
1270
|
+
if (l < H) {
|
|
1273
1271
|
const b = Math.round(l / 60);
|
|
1274
|
-
return a.formatDistance("aboutXHours", b,
|
|
1272
|
+
return a.formatDistance("aboutXHours", b, s);
|
|
1275
1273
|
} else {
|
|
1276
|
-
if (l <
|
|
1277
|
-
return a.formatDistance("xDays", 1,
|
|
1278
|
-
if (l <
|
|
1279
|
-
const b = Math.round(l /
|
|
1280
|
-
return a.formatDistance("xDays", b,
|
|
1281
|
-
} else if (l <
|
|
1282
|
-
return g = Math.round(l /
|
|
1274
|
+
if (l < i)
|
|
1275
|
+
return a.formatDistance("xDays", 1, s);
|
|
1276
|
+
if (l < C) {
|
|
1277
|
+
const b = Math.round(l / H);
|
|
1278
|
+
return a.formatDistance("xDays", b, s);
|
|
1279
|
+
} else if (l < C * 2)
|
|
1280
|
+
return g = Math.round(l / C), a.formatDistance("aboutXMonths", g, s);
|
|
1283
1281
|
}
|
|
1284
|
-
if (g =
|
|
1285
|
-
const b = Math.round(l /
|
|
1286
|
-
return a.formatDistance("xMonths", b,
|
|
1282
|
+
if (g = Ie(u, c), g < 12) {
|
|
1283
|
+
const b = Math.round(l / C);
|
|
1284
|
+
return a.formatDistance("xMonths", b, s);
|
|
1287
1285
|
} else {
|
|
1288
1286
|
const b = g % 12, O = Math.trunc(g / 12);
|
|
1289
|
-
return b < 3 ? a.formatDistance("aboutXYears", O,
|
|
1287
|
+
return b < 3 ? a.formatDistance("aboutXYears", O, s) : b < 9 ? a.formatDistance("overXYears", O, s) : a.formatDistance("almostXYears", O + 1, s);
|
|
1290
1288
|
}
|
|
1291
1289
|
}
|
|
1292
|
-
function
|
|
1293
|
-
return
|
|
1290
|
+
function Rt(e, t) {
|
|
1291
|
+
return It(e, Ye(e), t);
|
|
1294
1292
|
}
|
|
1295
|
-
function
|
|
1296
|
-
return Object.assign({},
|
|
1293
|
+
function At() {
|
|
1294
|
+
return Object.assign({}, P());
|
|
1297
1295
|
}
|
|
1298
|
-
function
|
|
1299
|
-
const r =
|
|
1300
|
-
return "formatToParts" in a ?
|
|
1296
|
+
function G(e, t, n) {
|
|
1297
|
+
const r = At(), a = Ut(e, n.timeZone, n.locale ?? r.locale);
|
|
1298
|
+
return "formatToParts" in a ? jt(a, t) : Ht(a, t);
|
|
1301
1299
|
}
|
|
1302
|
-
function
|
|
1300
|
+
function jt(e, t) {
|
|
1303
1301
|
const n = e.formatToParts(t);
|
|
1304
1302
|
for (let r = n.length - 1; r >= 0; --r)
|
|
1305
1303
|
if (n[r].type === "timeZoneName")
|
|
1306
1304
|
return n[r].value;
|
|
1307
1305
|
}
|
|
1308
|
-
function
|
|
1306
|
+
function Ht(e, t) {
|
|
1309
1307
|
const n = e.format(t).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
|
|
1310
1308
|
return r ? r[0].substr(1) : "";
|
|
1311
1309
|
}
|
|
1312
|
-
function
|
|
1310
|
+
function Ut(e, t, n) {
|
|
1313
1311
|
return new Intl.DateTimeFormat(n ? [n.code, "en-US"] : void 0, {
|
|
1314
1312
|
timeZone: t,
|
|
1315
1313
|
timeZoneName: e
|
|
1316
1314
|
});
|
|
1317
1315
|
}
|
|
1318
|
-
const
|
|
1316
|
+
const Bt = 60 * 1e3, Vt = {
|
|
1319
1317
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1320
1318
|
X: function(e, t, n) {
|
|
1321
1319
|
const r = _(n.timeZone, e);
|
|
@@ -1323,14 +1321,14 @@ const Ft = 60 * 1e3, qt = {
|
|
|
1323
1321
|
return "Z";
|
|
1324
1322
|
switch (t) {
|
|
1325
1323
|
case "X":
|
|
1326
|
-
return
|
|
1324
|
+
return Q(r);
|
|
1327
1325
|
case "XXXX":
|
|
1328
1326
|
case "XX":
|
|
1329
|
-
return
|
|
1327
|
+
return v(r);
|
|
1330
1328
|
case "XXXXX":
|
|
1331
1329
|
case "XXX":
|
|
1332
1330
|
default:
|
|
1333
|
-
return
|
|
1331
|
+
return v(r, ":");
|
|
1334
1332
|
}
|
|
1335
1333
|
},
|
|
1336
1334
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
@@ -1338,14 +1336,14 @@ const Ft = 60 * 1e3, qt = {
|
|
|
1338
1336
|
const r = _(n.timeZone, e);
|
|
1339
1337
|
switch (t) {
|
|
1340
1338
|
case "x":
|
|
1341
|
-
return
|
|
1339
|
+
return Q(r);
|
|
1342
1340
|
case "xxxx":
|
|
1343
1341
|
case "xx":
|
|
1344
|
-
return
|
|
1342
|
+
return v(r);
|
|
1345
1343
|
case "xxxxx":
|
|
1346
1344
|
case "xxx":
|
|
1347
1345
|
default:
|
|
1348
|
-
return
|
|
1346
|
+
return v(r, ":");
|
|
1349
1347
|
}
|
|
1350
1348
|
},
|
|
1351
1349
|
// Timezone (GMT)
|
|
@@ -1355,10 +1353,10 @@ const Ft = 60 * 1e3, qt = {
|
|
|
1355
1353
|
case "O":
|
|
1356
1354
|
case "OO":
|
|
1357
1355
|
case "OOO":
|
|
1358
|
-
return "GMT" +
|
|
1356
|
+
return "GMT" + Zt(r, ":");
|
|
1359
1357
|
case "OOOO":
|
|
1360
1358
|
default:
|
|
1361
|
-
return "GMT" +
|
|
1359
|
+
return "GMT" + v(r, ":");
|
|
1362
1360
|
}
|
|
1363
1361
|
},
|
|
1364
1362
|
// Timezone (specific non-location)
|
|
@@ -1367,79 +1365,79 @@ const Ft = 60 * 1e3, qt = {
|
|
|
1367
1365
|
case "z":
|
|
1368
1366
|
case "zz":
|
|
1369
1367
|
case "zzz":
|
|
1370
|
-
return
|
|
1368
|
+
return G("short", e, n);
|
|
1371
1369
|
case "zzzz":
|
|
1372
1370
|
default:
|
|
1373
|
-
return
|
|
1371
|
+
return G("long", e, n);
|
|
1374
1372
|
}
|
|
1375
1373
|
}
|
|
1376
1374
|
};
|
|
1377
1375
|
function _(e, t) {
|
|
1378
|
-
const n = e ?
|
|
1376
|
+
const n = e ? ae(e, t, !0) / Bt : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
|
|
1379
1377
|
if (Number.isNaN(n))
|
|
1380
1378
|
throw new RangeError("Invalid time zone specified: " + e);
|
|
1381
1379
|
return n;
|
|
1382
1380
|
}
|
|
1383
|
-
function
|
|
1381
|
+
function z(e, t) {
|
|
1384
1382
|
const n = e < 0 ? "-" : "";
|
|
1385
1383
|
let r = Math.abs(e).toString();
|
|
1386
1384
|
for (; r.length < t; )
|
|
1387
1385
|
r = "0" + r;
|
|
1388
1386
|
return n + r;
|
|
1389
1387
|
}
|
|
1390
|
-
function
|
|
1391
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a =
|
|
1392
|
-
return n + a + t +
|
|
1388
|
+
function v(e, t = "") {
|
|
1389
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = z(Math.floor(r / 60), 2), i = z(Math.floor(r % 60), 2);
|
|
1390
|
+
return n + a + t + i;
|
|
1393
1391
|
}
|
|
1394
|
-
function
|
|
1395
|
-
return e % 60 === 0 ? (e > 0 ? "-" : "+") +
|
|
1392
|
+
function Q(e, t) {
|
|
1393
|
+
return e % 60 === 0 ? (e > 0 ? "-" : "+") + z(Math.abs(e) / 60, 2) : v(e, t);
|
|
1396
1394
|
}
|
|
1397
|
-
function
|
|
1398
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.floor(r / 60),
|
|
1399
|
-
return
|
|
1395
|
+
function Zt(e, t = "") {
|
|
1396
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.floor(r / 60), i = r % 60;
|
|
1397
|
+
return i === 0 ? n + String(a) : n + String(a) + t + z(i, 2);
|
|
1400
1398
|
}
|
|
1401
|
-
const
|
|
1402
|
-
function
|
|
1399
|
+
const $t = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
|
|
1400
|
+
function Gt(e, t, n = {}) {
|
|
1403
1401
|
t = String(t);
|
|
1404
|
-
const r = t.match(
|
|
1402
|
+
const r = t.match($t);
|
|
1405
1403
|
if (r) {
|
|
1406
|
-
const a =
|
|
1407
|
-
t = r.reduce(function(
|
|
1408
|
-
if (
|
|
1409
|
-
return
|
|
1410
|
-
const
|
|
1411
|
-
return
|
|
1404
|
+
const a = ie(n.originalDate || e, n);
|
|
1405
|
+
t = r.reduce(function(i, o) {
|
|
1406
|
+
if (o[0] === "'")
|
|
1407
|
+
return i;
|
|
1408
|
+
const s = i.indexOf(o), c = i[s - 1] === "'", u = i.replace(o, "'" + Vt[o[0]](a, o, n) + "'");
|
|
1409
|
+
return c ? u.substring(0, s - 1) + u.substring(s + 1) : u;
|
|
1412
1410
|
}, t);
|
|
1413
1411
|
}
|
|
1414
|
-
return
|
|
1412
|
+
return le(e, t, n);
|
|
1415
1413
|
}
|
|
1416
|
-
function
|
|
1417
|
-
e =
|
|
1418
|
-
const r =
|
|
1419
|
-
return
|
|
1414
|
+
function Qt(e, t, n) {
|
|
1415
|
+
e = ie(e, n);
|
|
1416
|
+
const r = ae(t, e, !0), a = new Date(e.getTime() - r), i = /* @__PURE__ */ new Date(0);
|
|
1417
|
+
return i.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), i.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), i;
|
|
1420
1418
|
}
|
|
1421
|
-
function
|
|
1419
|
+
function Jt(e, t, n, r) {
|
|
1422
1420
|
return r = {
|
|
1423
1421
|
...r,
|
|
1424
1422
|
timeZone: t,
|
|
1425
1423
|
originalDate: e
|
|
1426
|
-
},
|
|
1424
|
+
}, Gt(Qt(e, t, { timeZone: r.timeZone }), n, r);
|
|
1427
1425
|
}
|
|
1428
|
-
function
|
|
1426
|
+
function Mn(e, t) {
|
|
1429
1427
|
return e && e !== "auto" ? e : t;
|
|
1430
1428
|
}
|
|
1431
|
-
function
|
|
1429
|
+
function Dn(e, t = /* @__PURE__ */ new Date()) {
|
|
1432
1430
|
try {
|
|
1433
1431
|
const n = {
|
|
1434
1432
|
timeZone: e,
|
|
1435
1433
|
timeZoneName: "short"
|
|
1436
|
-
}, a = new Intl.DateTimeFormat("en-US", n).formatToParts(t).find((
|
|
1434
|
+
}, a = new Intl.DateTimeFormat("en-US", n).formatToParts(t).find((i) => i.type === "timeZoneName");
|
|
1437
1435
|
return (a == null ? void 0 : a.value) || e;
|
|
1438
1436
|
} catch {
|
|
1439
1437
|
return e;
|
|
1440
1438
|
}
|
|
1441
1439
|
}
|
|
1442
|
-
function
|
|
1440
|
+
function xn(e) {
|
|
1443
1441
|
try {
|
|
1444
1442
|
const t = {
|
|
1445
1443
|
timeZone: e,
|
|
@@ -1452,7 +1450,7 @@ function un(e) {
|
|
|
1452
1450
|
return e;
|
|
1453
1451
|
}
|
|
1454
1452
|
}
|
|
1455
|
-
function
|
|
1453
|
+
function me(e, t = "auto") {
|
|
1456
1454
|
if (!e)
|
|
1457
1455
|
return /* @__PURE__ */ new Date(NaN);
|
|
1458
1456
|
const n = e.endsWith("Z"), r = /[+-]\d{2}:?\d{2}$/.test(e), a = /\([A-Z]{3,4}\)$/.test(e);
|
|
@@ -1460,65 +1458,65 @@ function ne(e, t = "auto") {
|
|
|
1460
1458
|
return n || r || a ? new Date(e) : /* @__PURE__ */ new Date(e + "Z");
|
|
1461
1459
|
if (t === "local") {
|
|
1462
1460
|
if (n || r) {
|
|
1463
|
-
const
|
|
1464
|
-
return new Date(
|
|
1461
|
+
const i = e.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
|
|
1462
|
+
return new Date(i);
|
|
1465
1463
|
}
|
|
1466
1464
|
return new Date(e);
|
|
1467
|
-
} else return t === "UTC" ? n ? new Date(e) : r ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : n || r || a ? new Date(e) :
|
|
1465
|
+
} else return t === "UTC" ? n ? new Date(e) : r ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : n || r || a ? new Date(e) : be(e, t);
|
|
1468
1466
|
}
|
|
1469
|
-
const
|
|
1467
|
+
const Kt = "MM/dd/yyyy", en = (e, t, n, r = "auto") => {
|
|
1470
1468
|
if (!e)
|
|
1471
1469
|
return "";
|
|
1472
1470
|
try {
|
|
1473
|
-
const a =
|
|
1471
|
+
const a = me(e, r);
|
|
1474
1472
|
if (isNaN(a.getTime()))
|
|
1475
1473
|
return e;
|
|
1476
|
-
const
|
|
1477
|
-
return n && n !== "auto" ?
|
|
1474
|
+
const o = (t && t.trim() ? t : Kt).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
|
|
1475
|
+
return n && n !== "auto" ? Jt(a, n, o) : le(a, o);
|
|
1478
1476
|
} catch (a) {
|
|
1479
1477
|
return console.error("Date formatting error:", a), e;
|
|
1480
1478
|
}
|
|
1481
|
-
},
|
|
1479
|
+
}, tn = (e, t = "auto") => {
|
|
1482
1480
|
if (!e)
|
|
1483
1481
|
return "";
|
|
1484
1482
|
try {
|
|
1485
|
-
const n =
|
|
1486
|
-
return isNaN(n.getTime()) ? e :
|
|
1483
|
+
const n = me(e, t);
|
|
1484
|
+
return isNaN(n.getTime()) ? e : Rt(n, { addSuffix: !0 });
|
|
1487
1485
|
} catch (n) {
|
|
1488
1486
|
return console.error("Relative time formatting error:", n), e;
|
|
1489
1487
|
}
|
|
1490
1488
|
};
|
|
1491
|
-
function
|
|
1492
|
-
const a = e instanceof Date ? e.toISOString() : String(e),
|
|
1489
|
+
function nn(e, t, n, r) {
|
|
1490
|
+
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;
|
|
1493
1491
|
if (t != null && t.useRelativeTime)
|
|
1494
|
-
return
|
|
1492
|
+
return tn(
|
|
1495
1493
|
a,
|
|
1496
1494
|
(t == null ? void 0 : t.sourceTimezone) || "auto"
|
|
1497
1495
|
);
|
|
1498
|
-
const
|
|
1499
|
-
return
|
|
1496
|
+
const s = t != null && t.useCustomFormat && (t != null && t.customFormat) ? t.customFormat : (t == null ? void 0 : t.format) || "MM/dd/yyyy";
|
|
1497
|
+
return en(
|
|
1500
1498
|
a,
|
|
1501
|
-
|
|
1502
|
-
t != null && t.timezone && (t == null ? void 0 : t.timezone) !== "auto" ? t.timezone :
|
|
1499
|
+
s,
|
|
1500
|
+
t != null && t.timezone && (t == null ? void 0 : t.timezone) !== "auto" ? t.timezone : o ? i : n,
|
|
1503
1501
|
(t == null ? void 0 : t.sourceTimezone) || "auto"
|
|
1504
1502
|
);
|
|
1505
1503
|
}
|
|
1506
|
-
function
|
|
1507
|
-
var
|
|
1504
|
+
function de(e, t, n) {
|
|
1505
|
+
var o, s;
|
|
1508
1506
|
if (e == null)
|
|
1509
|
-
return e === null ? ((
|
|
1510
|
-
const r =
|
|
1507
|
+
return e === null ? ((o = n.absence) == null ? void 0 : o.nullText) ?? "" : ((s = n.absence) == null ? void 0 : s.emptyText) ?? "";
|
|
1508
|
+
const r = he(e) ? e : void 0, a = r ? r.value : e, i = r ?? (typeof e == "number" ? e : void 0);
|
|
1511
1509
|
if (!n.useFormattedValues || !t)
|
|
1512
1510
|
return String(a);
|
|
1513
1511
|
switch (t.type) {
|
|
1514
1512
|
case "number":
|
|
1515
|
-
return
|
|
1516
|
-
|
|
1513
|
+
return i !== void 0 ? Me(
|
|
1514
|
+
i,
|
|
1517
1515
|
t.numberFormat,
|
|
1518
1516
|
n.locale
|
|
1519
1517
|
) : String(a);
|
|
1520
1518
|
case "date":
|
|
1521
|
-
return
|
|
1519
|
+
return nn(
|
|
1522
1520
|
a,
|
|
1523
1521
|
t.dateFormat,
|
|
1524
1522
|
n.timezone,
|
|
@@ -1528,7 +1526,7 @@ function re(e, t, n) {
|
|
|
1528
1526
|
}
|
|
1529
1527
|
);
|
|
1530
1528
|
case "progress":
|
|
1531
|
-
return
|
|
1529
|
+
return i !== void 0 ? `${a}%` : String(a);
|
|
1532
1530
|
case "badge":
|
|
1533
1531
|
case "link":
|
|
1534
1532
|
case "text":
|
|
@@ -1537,17 +1535,197 @@ function re(e, t, n) {
|
|
|
1537
1535
|
return String(a);
|
|
1538
1536
|
}
|
|
1539
1537
|
}
|
|
1540
|
-
function
|
|
1538
|
+
function pn(e, t) {
|
|
1541
1539
|
return t.visibleColumns.map((n) => {
|
|
1542
1540
|
const r = e[n], a = t.columnSettings[n];
|
|
1543
|
-
return
|
|
1541
|
+
return de(r, a, {
|
|
1544
1542
|
useFormattedValues: t.useFormattedValues,
|
|
1545
1543
|
timezone: t.timezone,
|
|
1546
1544
|
locale: t.locale
|
|
1547
1545
|
});
|
|
1548
1546
|
});
|
|
1549
1547
|
}
|
|
1550
|
-
|
|
1548
|
+
const rn = "en-US", J = [
|
|
1549
|
+
"compact",
|
|
1550
|
+
"maximumFractionDigits",
|
|
1551
|
+
"minimumFractionDigits",
|
|
1552
|
+
"negativeStyle",
|
|
1553
|
+
"type",
|
|
1554
|
+
"useGrouping"
|
|
1555
|
+
];
|
|
1556
|
+
function an(e) {
|
|
1557
|
+
if (e.type !== "currency" || Object.prototype.hasOwnProperty.call(e, "currency") || Object.prototype.hasOwnProperty.call(e, "locale"))
|
|
1558
|
+
return !1;
|
|
1559
|
+
const t = Object.keys(e).sort();
|
|
1560
|
+
return t.length === J.length && J.every(
|
|
1561
|
+
(n, r) => t[r] === n
|
|
1562
|
+
) && typeof e.minimumFractionDigits == "number" && typeof e.maximumFractionDigits == "number" && e.useGrouping === !0 && e.negativeStyle === "minus" && typeof e.compact == "boolean";
|
|
1563
|
+
}
|
|
1564
|
+
function K(e) {
|
|
1565
|
+
if (typeof e != "string")
|
|
1566
|
+
return;
|
|
1567
|
+
const t = e.trim();
|
|
1568
|
+
if (!(!t || t.toLowerCase() === "none"))
|
|
1569
|
+
return t;
|
|
1570
|
+
}
|
|
1571
|
+
function F(e) {
|
|
1572
|
+
if (!(typeof e != "number" || !Number.isFinite(e)))
|
|
1573
|
+
return Math.max(0, Math.min(10, Math.trunc(e)));
|
|
1574
|
+
}
|
|
1575
|
+
function sn(e) {
|
|
1576
|
+
return e === "currency" ? 2 : e === "percent" ? 1 : e === "scientific" ? 2 : 0;
|
|
1577
|
+
}
|
|
1578
|
+
function on(e, t, n) {
|
|
1579
|
+
const r = F(t.minimumFractionDigits), a = F(t.maximumFractionDigits);
|
|
1580
|
+
if (typeof r == "number" || typeof a == "number") {
|
|
1581
|
+
const s = r ?? 0, c = a ?? Math.max(s, 2);
|
|
1582
|
+
return {
|
|
1583
|
+
minimumFractionDigits: Math.min(s, c),
|
|
1584
|
+
maximumFractionDigits: Math.max(s, c)
|
|
1585
|
+
};
|
|
1586
|
+
}
|
|
1587
|
+
const i = F(t.decimals);
|
|
1588
|
+
if (typeof i == "number")
|
|
1589
|
+
return {
|
|
1590
|
+
minimumFractionDigits: i,
|
|
1591
|
+
maximumFractionDigits: i
|
|
1592
|
+
};
|
|
1593
|
+
if (n != null && n.preserveOmittedProperties)
|
|
1594
|
+
return {};
|
|
1595
|
+
const o = sn(e);
|
|
1596
|
+
return {
|
|
1597
|
+
minimumFractionDigits: o,
|
|
1598
|
+
maximumFractionDigits: o
|
|
1599
|
+
};
|
|
1600
|
+
}
|
|
1601
|
+
function un(e, t) {
|
|
1602
|
+
if (!(typeof t != "string" || e === "percent" && t === "%"))
|
|
1603
|
+
return t;
|
|
1604
|
+
}
|
|
1605
|
+
function ee(e) {
|
|
1606
|
+
const t = K(e.locale), n = K(e.currency), r = un(e.type, e.suffix);
|
|
1607
|
+
return {
|
|
1608
|
+
...e,
|
|
1609
|
+
...t !== e.locale ? { locale: t } : {},
|
|
1610
|
+
...n !== e.currency ? { currency: n } : {},
|
|
1611
|
+
...r !== e.suffix ? { suffix: r } : {}
|
|
1612
|
+
};
|
|
1613
|
+
}
|
|
1614
|
+
function x(e, t, n) {
|
|
1615
|
+
const r = { ...t, type: e };
|
|
1616
|
+
if ((n == null ? void 0 : n.numericInput) === "canonical" && I(r))
|
|
1617
|
+
return ee(r);
|
|
1618
|
+
const a = on(e, t, n), i = typeof t.prefix == "string" ? t.prefix : void 0, o = {
|
|
1619
|
+
type: e,
|
|
1620
|
+
locale: t.locale,
|
|
1621
|
+
minimumFractionDigits: a.minimumFractionDigits,
|
|
1622
|
+
maximumFractionDigits: a.maximumFractionDigits,
|
|
1623
|
+
useGrouping: typeof t.useGrouping == "boolean" ? t.useGrouping : typeof t.thousandsSeparator == "boolean" ? t.thousandsSeparator : !0,
|
|
1624
|
+
prefix: i,
|
|
1625
|
+
suffix: t.suffix,
|
|
1626
|
+
negativeStyle: t.negativeStyle || "minus",
|
|
1627
|
+
compact: !!t.compact,
|
|
1628
|
+
scale: typeof t.scale == "number" ? t.scale : void 0
|
|
1629
|
+
};
|
|
1630
|
+
return e === "currency" && t.currency && (o.currency = t.currency), e === "percent" && (o.percentValueMode = t.percentValueMode || "fraction"), ee(o);
|
|
1631
|
+
}
|
|
1632
|
+
function te(e) {
|
|
1633
|
+
return {
|
|
1634
|
+
type: "date",
|
|
1635
|
+
locale: e.locale || rn,
|
|
1636
|
+
pattern: e.pattern,
|
|
1637
|
+
relative: !!e.relative,
|
|
1638
|
+
timezone: e.timezone,
|
|
1639
|
+
sourceTimezone: e.sourceTimezone,
|
|
1640
|
+
prefix: e.prefix,
|
|
1641
|
+
suffix: e.suffix
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
function q(e) {
|
|
1645
|
+
return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
|
|
1646
|
+
}
|
|
1647
|
+
function ne(e) {
|
|
1648
|
+
const t = F(e.maxUnits);
|
|
1649
|
+
return {
|
|
1650
|
+
type: "duration",
|
|
1651
|
+
inputUnit: q(e.inputUnit) ? e.inputUnit : "second",
|
|
1652
|
+
outputStyle: e.outputStyle === "digital" || e.outputStyle === "long" ? e.outputStyle : "compact",
|
|
1653
|
+
largestUnit: q(e.largestUnit) ? e.largestUnit : void 0,
|
|
1654
|
+
smallestUnit: q(e.smallestUnit) ? e.smallestUnit : "second",
|
|
1655
|
+
maxUnits: t,
|
|
1656
|
+
prefix: e.prefix,
|
|
1657
|
+
suffix: e.suffix,
|
|
1658
|
+
negativeStyle: e.negativeStyle || "minus"
|
|
1659
|
+
};
|
|
1660
|
+
}
|
|
1661
|
+
function re(e) {
|
|
1662
|
+
return {
|
|
1663
|
+
type: "string",
|
|
1664
|
+
prefix: e.prefix,
|
|
1665
|
+
suffix: e.suffix
|
|
1666
|
+
};
|
|
1667
|
+
}
|
|
1668
|
+
function cn(e, t) {
|
|
1669
|
+
if (!e)
|
|
1670
|
+
return;
|
|
1671
|
+
if (typeof e == "string") {
|
|
1672
|
+
const r = e.trim().toLowerCase();
|
|
1673
|
+
return r === "currency" ? x(
|
|
1674
|
+
"currency",
|
|
1675
|
+
{ type: "currency" },
|
|
1676
|
+
t
|
|
1677
|
+
) : r === "percentage" || r === "percent" ? x(
|
|
1678
|
+
"percent",
|
|
1679
|
+
{
|
|
1680
|
+
type: "percentage",
|
|
1681
|
+
percentValueMode: "fraction"
|
|
1682
|
+
},
|
|
1683
|
+
t
|
|
1684
|
+
) : r === "scientific" ? x(
|
|
1685
|
+
"scientific",
|
|
1686
|
+
{ type: "scientific" },
|
|
1687
|
+
t
|
|
1688
|
+
) : r === "date" ? te({}) : r === "duration" ? ne({}) : r === "string" ? re({}) : r === "number" ? x(
|
|
1689
|
+
"number",
|
|
1690
|
+
{ type: "number" },
|
|
1691
|
+
t
|
|
1692
|
+
) : void 0;
|
|
1693
|
+
}
|
|
1694
|
+
if ("type" in e && e.type === "temporal_bucket") {
|
|
1695
|
+
const r = we.safeParse(e);
|
|
1696
|
+
return r.success ? r.data : void 0;
|
|
1697
|
+
}
|
|
1698
|
+
const n = e;
|
|
1699
|
+
if ((t == null ? void 0 : t.numericInput) === "canonical") {
|
|
1700
|
+
const r = n.type === "percentage" ? { ...n, type: "percent" } : n;
|
|
1701
|
+
if (I(r))
|
|
1702
|
+
return x(r.type, r, t);
|
|
1703
|
+
}
|
|
1704
|
+
if (n.type === "percentage")
|
|
1705
|
+
return x(
|
|
1706
|
+
"percent",
|
|
1707
|
+
{
|
|
1708
|
+
...n,
|
|
1709
|
+
percentValueMode: n.percentValueMode || "fraction"
|
|
1710
|
+
},
|
|
1711
|
+
t
|
|
1712
|
+
);
|
|
1713
|
+
if (n.type === "number" || n.type === "currency" || n.type === "percent" || n.type === "scientific") {
|
|
1714
|
+
const r = x(
|
|
1715
|
+
n.type,
|
|
1716
|
+
n,
|
|
1717
|
+
t
|
|
1718
|
+
);
|
|
1719
|
+
return an(n) ? { ...r, currency: "USD" } : r;
|
|
1720
|
+
}
|
|
1721
|
+
if (n.type === "date")
|
|
1722
|
+
return te(n);
|
|
1723
|
+
if (n.type === "duration")
|
|
1724
|
+
return ne(n);
|
|
1725
|
+
if (n.type === "string")
|
|
1726
|
+
return re(n);
|
|
1727
|
+
}
|
|
1728
|
+
function fn(e, t) {
|
|
1551
1729
|
var a;
|
|
1552
1730
|
const n = e[e.length - 1];
|
|
1553
1731
|
if (!n) return "";
|
|
@@ -1555,62 +1733,62 @@ function Qt(e, t) {
|
|
|
1555
1733
|
const r = n.member.value;
|
|
1556
1734
|
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));
|
|
1557
1735
|
}
|
|
1558
|
-
function
|
|
1559
|
-
return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? (n == null ? void 0 : n.split(
|
|
1736
|
+
function ln(e, t, n) {
|
|
1737
|
+
return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? (n == null ? void 0 : n.split(ye).join(t)) ?? `${t} Total` : t;
|
|
1560
1738
|
}
|
|
1561
|
-
function
|
|
1562
|
-
var
|
|
1563
|
-
const a = e[e.length - 1],
|
|
1564
|
-
return
|
|
1739
|
+
function On(e, t, n, r) {
|
|
1740
|
+
var o;
|
|
1741
|
+
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;
|
|
1742
|
+
return ln(t, fn(e, r), i);
|
|
1565
1743
|
}
|
|
1566
|
-
function
|
|
1744
|
+
function Tn(e, t, n) {
|
|
1567
1745
|
return e.kind === "value" ? (t == null ? void 0 : t(e.value)) ?? "" : e.kind === "null" ? n.nullText : n.emptyText;
|
|
1568
1746
|
}
|
|
1569
|
-
function
|
|
1570
|
-
const { path: t, previousPath: n, role: r, repeatLabels: a, levelCount:
|
|
1571
|
-
return Array.from({ length:
|
|
1572
|
-
const
|
|
1747
|
+
function vn(e) {
|
|
1748
|
+
const { path: t, previousPath: n, role: r, repeatLabels: a, levelCount: i } = e;
|
|
1749
|
+
return Array.from({ length: i }, (o, s) => {
|
|
1750
|
+
const c = t.slice(0, s + 1), u = r === "grand_total" ? s === 0 : r === "subtotal" && s === t.length - 1, m = n && n.length > s && j(n.slice(0, s + 1)) === j(c);
|
|
1573
1751
|
return {
|
|
1574
|
-
path:
|
|
1752
|
+
path: c,
|
|
1575
1753
|
total: u,
|
|
1576
|
-
visible: u || t.length >
|
|
1754
|
+
visible: u || t.length > s && (a || !m || s === t.length - 1)
|
|
1577
1755
|
};
|
|
1578
1756
|
});
|
|
1579
1757
|
}
|
|
1580
|
-
function
|
|
1581
|
-
return
|
|
1758
|
+
function mn(e, t) {
|
|
1759
|
+
return cn(e ?? t, {
|
|
1582
1760
|
preserveOmittedProperties: !0,
|
|
1583
1761
|
numericInput: "canonical"
|
|
1584
1762
|
});
|
|
1585
1763
|
}
|
|
1586
|
-
function
|
|
1587
|
-
const r = /* @__PURE__ */ new Map(), a = (
|
|
1588
|
-
const
|
|
1589
|
-
|
|
1590
|
-
isNumeric:
|
|
1764
|
+
function Pn(e, t, n) {
|
|
1765
|
+
const r = /* @__PURE__ */ new Map(), a = (i, o) => {
|
|
1766
|
+
const s = (o === "levels" ? t.levelFormats : t.measureFormats)[i.id], c = i.semanticFormat, u = mn(s, c);
|
|
1767
|
+
o === "measures" && r.set(i.id, {
|
|
1768
|
+
isNumeric: ge(i.column.dataType) === "number",
|
|
1591
1769
|
// Use normalized affixes: a redundant percent suffix is already removed.
|
|
1592
1770
|
hasTextAffixes: !!u && !!("prefix" in u && u.prefix || "suffix" in u && u.suffix)
|
|
1593
1771
|
});
|
|
1594
|
-
const
|
|
1772
|
+
const m = (f) => de(f, void 0, {
|
|
1595
1773
|
useFormattedValues: !0,
|
|
1596
1774
|
timezone: n.calendar.tz,
|
|
1597
1775
|
locale: n.valueFormat.locale,
|
|
1598
1776
|
absence: t.absence
|
|
1599
1777
|
});
|
|
1600
|
-
if (
|
|
1601
|
-
const
|
|
1602
|
-
metadata:
|
|
1603
|
-
cardFormat: (
|
|
1604
|
-
semanticFormat: (
|
|
1778
|
+
if (i.column.temporalBucket) {
|
|
1779
|
+
const f = i.column.temporalBucket, l = Pe({
|
|
1780
|
+
metadata: f,
|
|
1781
|
+
cardFormat: (s == null ? void 0 : s.type) === "temporal_bucket" ? s : void 0,
|
|
1782
|
+
semanticFormat: (c == null ? void 0 : c.type) === "temporal_bucket" ? { granularity: f.granularity, format: c } : void 0,
|
|
1605
1783
|
locale: n.valueFormat.locale,
|
|
1606
1784
|
styles: { dateStyle: n.valueFormat.dateStyle, dateTime: n.valueFormat.dateTime }
|
|
1607
1785
|
});
|
|
1608
|
-
return (g) => typeof g == "string" ?
|
|
1786
|
+
return (g) => typeof g == "string" ? Se({ value: g, metadata: f, format: l.format }) : m(g);
|
|
1609
1787
|
}
|
|
1610
|
-
if (
|
|
1611
|
-
const
|
|
1612
|
-
metadata:
|
|
1613
|
-
format:
|
|
1788
|
+
if (i.column.rawTemporal) {
|
|
1789
|
+
const f = De({
|
|
1790
|
+
metadata: i.column.rawTemporal,
|
|
1791
|
+
format: xe({
|
|
1614
1792
|
format: (u == null ? void 0 : u.type) === "date" ? {
|
|
1615
1793
|
type: "raw_temporal",
|
|
1616
1794
|
timezone: u.timezone,
|
|
@@ -1626,48 +1804,61 @@ function mn(e, t, n) {
|
|
|
1626
1804
|
})
|
|
1627
1805
|
});
|
|
1628
1806
|
return (l) => {
|
|
1629
|
-
if (typeof l != "string") return
|
|
1630
|
-
const g =
|
|
1631
|
-
return g.ok ? g.text :
|
|
1807
|
+
if (typeof l != "string") return m(l);
|
|
1808
|
+
const g = f(l);
|
|
1809
|
+
return g.ok ? g.text : m(l);
|
|
1632
1810
|
};
|
|
1633
1811
|
}
|
|
1634
|
-
if (
|
|
1635
|
-
const
|
|
1636
|
-
return (l) => typeof l == "number" || typeof l == "object" && l !== null ?
|
|
1812
|
+
if (I(u)) {
|
|
1813
|
+
const f = pe(u, n.valueFormat);
|
|
1814
|
+
return (l) => typeof l == "number" || typeof l == "object" && l !== null ? Oe(l, f) : m(l);
|
|
1637
1815
|
}
|
|
1638
|
-
return (u == null ? void 0 : u.type) === "duration" ? (
|
|
1639
|
-
typeof
|
|
1816
|
+
return (u == null ? void 0 : u.type) === "duration" ? (f) => typeof f == "number" || typeof f == "string" || typeof f == "object" && f !== null ? Te(
|
|
1817
|
+
typeof f == "object" ? f.value : f,
|
|
1640
1818
|
u
|
|
1641
|
-
) :
|
|
1819
|
+
) : m(f) : (u == null ? void 0 : u.type) === "string" ? (f) => f === null ? m(f) : `${u.prefix ?? ""}${m(f)}${u.suffix ?? ""}` : m;
|
|
1642
1820
|
};
|
|
1643
1821
|
return {
|
|
1644
1822
|
levels: new Map(
|
|
1645
|
-
e.levels.map((
|
|
1823
|
+
e.levels.map((i) => [i.id, a(i, "levels")])
|
|
1646
1824
|
),
|
|
1647
1825
|
measures: new Map(
|
|
1648
|
-
e.measures.map((
|
|
1826
|
+
e.measures.map((i) => [i.id, a(i, "measures")])
|
|
1649
1827
|
),
|
|
1650
1828
|
measureSemantics: r,
|
|
1651
1829
|
absence: t.absence
|
|
1652
1830
|
};
|
|
1653
1831
|
}
|
|
1654
1832
|
export {
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1833
|
+
x as A,
|
|
1834
|
+
K as B,
|
|
1835
|
+
mn as C,
|
|
1836
|
+
rn as D,
|
|
1837
|
+
ln as E,
|
|
1838
|
+
en as a,
|
|
1839
|
+
tn as b,
|
|
1840
|
+
xn as c,
|
|
1841
|
+
de as d,
|
|
1842
|
+
pn as e,
|
|
1843
|
+
cn as f,
|
|
1844
|
+
Dn as g,
|
|
1845
|
+
Pn as h,
|
|
1846
|
+
On as i,
|
|
1847
|
+
vn as j,
|
|
1848
|
+
Tn as k,
|
|
1849
|
+
Jt as l,
|
|
1850
|
+
fn as m,
|
|
1851
|
+
le as n,
|
|
1852
|
+
P as o,
|
|
1853
|
+
me as p,
|
|
1854
|
+
ue as q,
|
|
1855
|
+
Mn as r,
|
|
1856
|
+
Y as s,
|
|
1857
|
+
h as t,
|
|
1858
|
+
ze as u,
|
|
1859
|
+
E as v,
|
|
1860
|
+
Ye as w,
|
|
1861
|
+
Rt as x,
|
|
1862
|
+
te as y,
|
|
1863
|
+
ne as z
|
|
1673
1864
|
};
|