react-semaphor 0.1.560 → 0.1.562
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 +450 -423
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +9 -9
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{analytics-base-schemas-CHLxsPfX.js → analytics-base-schemas-BaIQrEzX.js} +221 -188
- package/dist/chunks/{assistant-chat-Bu2fFm_I.js → assistant-chat-R_yT8xH4.js} +116 -117
- package/dist/chunks/bookmark-impact-D4Kl4amw.js +75 -0
- package/dist/chunks/bookmark-state-CWeoGbrx.js +743 -0
- package/dist/chunks/{braces-Da41xfUd.js → braces-DzgoQC64.js} +1 -1
- package/dist/chunks/{comparison-window-caption-4FNkMrzE.js → comparison-window-caption-D1EUXzaR.js} +550 -425
- package/dist/chunks/{context-BgPDzLHZ.js → context-R31TSL5V.js} +1 -1
- package/dist/chunks/{dashboard-_MeBuy67.js → dashboard-Bp1y5oun.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CEi4Pr_v.js → dashboard-briefing-launcher-S5FB3aUW.js} +236 -236
- package/dist/chunks/dashboard-controls-CfC_6Ztn.js +2277 -0
- package/dist/chunks/{dashboard-json-B1mU_OMa.js → dashboard-json-gYZT7ZQY.js} +5 -5
- package/dist/chunks/dates-DFY7Gfss.js +91 -0
- package/dist/chunks/{edit-dashboard-visual-0CJN31Y3.js → edit-dashboard-visual-u7OI_g8Q.js} +7119 -7198
- package/dist/chunks/filter-reach-copy-CvV7W5dd.js +3965 -0
- package/dist/chunks/{filter-value-text-CRC-K_l_.js → filter-value-text-CPwFkrMz.js} +11 -10
- package/dist/chunks/global-date-filter-utils-N1kcsOFE.js +16722 -0
- package/dist/chunks/{index-DtHidOPV.js → index-CNGkfUp4.js} +269 -264
- package/dist/chunks/{layout-grid-BvsH4RY2.js → layout-grid-BM65viQh.js} +1 -1
- package/dist/chunks/{list-filter-Dg0otx5E.js → list-filter-BoeLBfL3.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-CM18W8w6.js → matrix-analytical-definition-hEucouWM.js} +4 -4
- package/dist/chunks/{matrix-card-HPskLaPy.js → matrix-card-CCh9JjP1.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-Bbrfrke4.js → matrix-member-presentation-DsAUbuoL.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-WPv4R-H_.js → matrix-operation-contract-DsLdFdSa.js} +365 -349
- package/dist/chunks/{metric-comparison-ljMKYZKa.js → metric-comparison-Bnso1cm1.js} +6 -6
- package/dist/chunks/{model-change-Ccn1zaxl.js → model-change-T1cRkh3m.js} +1 -1
- package/dist/chunks/{palette-Bsh376zO.js → palette-p1XSJFgB.js} +1 -1
- package/dist/chunks/pivot-result-contract-expectations-B53jqszr.js +56 -0
- package/dist/chunks/{pivot-result-identity-vS9TSh4f.js → pivot-result-identity-Dq5jm-EC.js} +1 -1
- package/dist/chunks/{zoned-wall-clock-B1n_WjW3.js → raw-temporal-value-Bqz8wc7L.js} +97 -46
- package/dist/chunks/{report-preferences-dialog-BV8L0SeS.js → report-preferences-dialog-C4RAR8u5.js} +68 -63
- package/dist/chunks/{report-runtime-context-BZQh9ywy.js → report-runtime-context-BITkNSDa.js} +2 -2
- package/dist/chunks/resolve-dashboard-input-context-DaDrZGuA.js +8214 -0
- package/dist/chunks/{save-B5EAsgQF.js → save-CHV1B1fL.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-n2Wn11cV.js → saved-dashboard-context-DFYBrE6O.js} +93 -94
- package/dist/chunks/{selection-filter-compiler-BKXmyLrS.js → selection-filter-compiler-CUDRnUxc.js} +19 -18
- package/dist/chunks/{selection-reducer-D0YnaAD9.js → selection-reducer-Bz5aywT4.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-XLBLOJ2V.js → semaphor-ready-indicator-Cfuafnem.js} +38188 -40344
- package/dist/chunks/{shelf-drop-preview-context-DHMa54a-.js → shelf-drop-preview-context-BR2GEYog.js} +81 -82
- package/dist/chunks/{source-entity-resolution-dUG5VWRm.js → source-entity-resolution-DdDVXFB8.js} +6 -6
- package/dist/chunks/{switch-ByxH4M7t.js → switch-BW4yXSYs.js} +3 -3
- package/dist/chunks/{table-export-sheet-C_GdeTYU.js → table-export-sheet-bSXxGn-v.js} +1 -1
- package/dist/chunks/temporal-input-presentation-sk9gqLi6.js +4960 -0
- package/dist/chunks/{token-types-CQtXUVMy.js → token-types-BUK06hU2.js} +1 -1
- package/dist/chunks/{upload-wbR-NVzq.js → upload-BnmuyPqW.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CEBaLOKC.js → use-create-flow-overlay-state-DyzhWvRJ.js} +6 -6
- package/dist/chunks/{validators-CXTneCA4.js → validators-BIM0FE31.js} +774 -895
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2477 -2685
- package/dist/data-app-sdk/index.js +30 -30
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +25 -25
- package/dist/format-utils/index.js +274 -267
- package/dist/index.js +59 -59
- 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/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/components/dashboard/dashboard-create-dialog.d.ts +23 -0
- package/dist/types/components/dashboard/summary-number-formatter.d.ts +6 -0
- package/dist/types/components/index.d.ts +1 -2
- package/dist/types/components/surfboard/filter/types.d.ts +3 -1
- package/dist/types/index.js +50 -51
- package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
- package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +59 -2
- package/dist/types/lib/interactions/get-click-context-from-matrix.d.ts +5 -0
- package/dist/types/lib/interactions/get-click-context-from-table.d.ts +45 -0
- package/dist/types/lib/print/print-inputs.d.ts +2 -1
- package/dist/types/lib/query-context/assemble-card-query.d.ts +2 -0
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +5 -0
- package/dist/types/lib/selection/selection-from-click-context.d.ts +41 -0
- package/dist/types/lib/stores/editor-store.d.ts +9 -1
- package/dist/types/lib/stores/table-actions.d.ts +0 -2
- package/dist/types/lib/types/common-types.d.ts +6 -0
- package/dist/types/lib/types/explorer-types.d.ts +7 -1
- package/dist/types/lib/types/interaction-types.d.ts +3 -1
- package/dist/types/lib/types/token-types.d.ts +0 -1
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +13 -1
- package/dist/types/shared/analytics-protocol/contracts.d.ts +9 -40
- package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
- package/dist/types/shared/analytics-protocol/selection-contract.d.ts +12 -2
- package/dist/types/shared/analytics-protocol/validators.d.ts +1 -2
- package/dist/types/shared/assistant-protocol/context.d.ts +8 -8
- package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +7 -1
- package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +76 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-polarity-write.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +17 -0
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +117 -0
- package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +51 -0
- package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +30 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +3402 -4313
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +49 -8
- package/dist/types/shared/dashboard-authoring/changes/field-ref.d.ts +91 -0
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +52 -2
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-create.d.ts +26 -0
- package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +2 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +1 -8
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +20 -20
- package/dist/types/shared/dashboard-authoring/detail-date-presentation.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +11 -6
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/apply.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +16 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +41 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +17 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +63 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +16 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +79 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +934 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/sentences.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/set.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/transform.d.ts +63 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/window-transforms.d.ts +60 -0
- package/dist/types/shared/dashboard-authoring/new-card.d.ts +12 -1
- package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +2 -1
- package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +46 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +73 -3
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +21 -3
- package/dist/types/shared/dashboard-authoring/text-card-words/blocks.d.ts +58 -0
- package/dist/types/shared/dashboard-authoring/text-card-words/index.d.ts +55 -0
- package/dist/types/shared/dashboard-authoring/text-card-words/rich-content.d.ts +18 -0
- package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
- package/dist/types/shared/format-utils/document-print.d.ts +82 -0
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +8 -1
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/raw-temporal.d.ts +18 -7
- package/dist/types/shared/temporal/index.d.ts +1 -0
- package/dist/types/shared/temporal/raw-temporal-equality.d.ts +19 -0
- package/dist/types/shared/temporal/raw-temporal-value.d.ts +29 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +6 -0
- package/package.json +2 -2
- package/dist/chunks/bookmark-state-BFY9oNmr.js +0 -111
- package/dist/chunks/custom-visual-inputs-Dz-enUNR.js +0 -292
- package/dist/chunks/dashboard-controls-Bi7fyG-4.js +0 -2339
- package/dist/chunks/document-dashboard-inputs-CkWfDB8c.js +0 -3010
- package/dist/chunks/filter-reach-copy-BF4w4kI2.js +0 -3738
- package/dist/chunks/global-date-filter-utils-D8365uPH.js +0 -12889
- package/dist/chunks/pivot-result-contract-expectations-Bl5suy4-.js +0 -1832
- package/dist/chunks/raw-temporal-presentation-BHm7s-hz.js +0 -540
- package/dist/chunks/resolve-dashboard-input-context-CAMiWvyR.js +0 -5280
- package/dist/chunks/table-settings-Imz0FgWi.js +0 -637
- package/dist/chunks/temporal-input-presentation-uvNK_tM0.js +0 -3228
- package/dist/types/components/dashboard/ai-dashboard-create-dialog.d.ts +0 -38
- package/dist/types/components/dashboard/dashboard-create-template.d.ts +0 -10
- package/dist/types/lib/hooks/use-dashboard-authoring.d.ts +0 -49
- package/dist/types/shared/dashboard-authoring/artifact-compiler.d.ts +0 -6
- package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -106
- package/dist/types/shared/dashboard-authoring/protocol-adapter.d.ts +0 -7
- package/dist/types/shared/dashboard-authoring/source-matching.d.ts +0 -34
- package/dist/types/shared/dashboard-authoring/validators.d.ts +0 -2
|
@@ -1,1832 +0,0 @@
|
|
|
1
|
-
var fe = Object.defineProperty;
|
|
2
|
-
var le = (e, t, n) => t in e ? fe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var z = (e, t, n) => le(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { aW as me, t as j, aj as de, _ as he } from "./validators-CXTneCA4.js";
|
|
5
|
-
import "./matrix-operation-contract-WPv4R-H_.js";
|
|
6
|
-
import "./analytics-base-schemas-CHLxsPfX.js";
|
|
7
|
-
import "zod";
|
|
8
|
-
import { au as ge, av as ee, aq as H, ar as W, aw as te, ax as ne, ay as we, m as ye, d as be, a3 as Me, a5 as re, p as ve, r as Oe, s as Te, i as xe, J as De, l as Pe, o as pe } from "./temporal-input-presentation-uvNK_tM0.js";
|
|
9
|
-
import { r as ke } from "./metric-comparison-ljMKYZKa.js";
|
|
10
|
-
function d(e) {
|
|
11
|
-
const t = Object.prototype.toString.call(e);
|
|
12
|
-
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);
|
|
13
|
-
}
|
|
14
|
-
function O(e, t) {
|
|
15
|
-
return e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
16
|
-
}
|
|
17
|
-
let Se = {};
|
|
18
|
-
function P() {
|
|
19
|
-
return Se;
|
|
20
|
-
}
|
|
21
|
-
function S(e, t) {
|
|
22
|
-
var i, f, l, c;
|
|
23
|
-
const n = P(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((f = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : f.weekStartsOn) ?? n.weekStartsOn ?? ((c = (l = n.locale) == null ? void 0 : l.options) == null ? void 0 : c.weekStartsOn) ?? 0, a = d(e), s = a.getDay(), o = (s < r ? 7 : 0) + s - r;
|
|
24
|
-
return a.setDate(a.getDate() - o), a.setHours(0, 0, 0, 0), a;
|
|
25
|
-
}
|
|
26
|
-
function N(e) {
|
|
27
|
-
return S(e, { weekStartsOn: 1 });
|
|
28
|
-
}
|
|
29
|
-
function ae(e) {
|
|
30
|
-
const t = d(e), n = t.getFullYear(), r = O(e, 0);
|
|
31
|
-
r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
|
|
32
|
-
const a = N(r), s = O(e, 0);
|
|
33
|
-
s.setFullYear(n, 0, 4), s.setHours(0, 0, 0, 0);
|
|
34
|
-
const o = N(s);
|
|
35
|
-
return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >= o.getTime() ? n : n - 1;
|
|
36
|
-
}
|
|
37
|
-
function B(e) {
|
|
38
|
-
const t = d(e);
|
|
39
|
-
return t.setHours(0, 0, 0, 0), t;
|
|
40
|
-
}
|
|
41
|
-
function Y(e) {
|
|
42
|
-
const t = d(e), n = new Date(
|
|
43
|
-
Date.UTC(
|
|
44
|
-
t.getFullYear(),
|
|
45
|
-
t.getMonth(),
|
|
46
|
-
t.getDate(),
|
|
47
|
-
t.getHours(),
|
|
48
|
-
t.getMinutes(),
|
|
49
|
-
t.getSeconds(),
|
|
50
|
-
t.getMilliseconds()
|
|
51
|
-
)
|
|
52
|
-
);
|
|
53
|
-
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
54
|
-
}
|
|
55
|
-
function We(e, t) {
|
|
56
|
-
const n = B(e), r = B(t), a = +n - Y(n), s = +r - Y(r);
|
|
57
|
-
return Math.round((a - s) / ge);
|
|
58
|
-
}
|
|
59
|
-
function Ce(e) {
|
|
60
|
-
const t = ae(e), n = O(e, 0);
|
|
61
|
-
return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), N(n);
|
|
62
|
-
}
|
|
63
|
-
function C(e, t) {
|
|
64
|
-
const n = d(e), r = d(t), a = n.getTime() - r.getTime();
|
|
65
|
-
return a < 0 ? -1 : a > 0 ? 1 : a;
|
|
66
|
-
}
|
|
67
|
-
function Ne(e) {
|
|
68
|
-
return O(e, Date.now());
|
|
69
|
-
}
|
|
70
|
-
function Ye(e) {
|
|
71
|
-
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
72
|
-
}
|
|
73
|
-
function Ee(e) {
|
|
74
|
-
if (!Ye(e) && typeof e != "number")
|
|
75
|
-
return !1;
|
|
76
|
-
const t = d(e);
|
|
77
|
-
return !isNaN(Number(t));
|
|
78
|
-
}
|
|
79
|
-
function Fe(e, t) {
|
|
80
|
-
const n = d(e), r = d(t), a = n.getFullYear() - r.getFullYear(), s = n.getMonth() - r.getMonth();
|
|
81
|
-
return a * 12 + s;
|
|
82
|
-
}
|
|
83
|
-
function Le(e) {
|
|
84
|
-
return (t) => {
|
|
85
|
-
const r = (e ? Math[e] : Math.trunc)(t);
|
|
86
|
-
return r === 0 ? 0 : r;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function Xe(e, t) {
|
|
90
|
-
return +d(e) - +d(t);
|
|
91
|
-
}
|
|
92
|
-
function Ie(e) {
|
|
93
|
-
const t = d(e);
|
|
94
|
-
return t.setHours(23, 59, 59, 999), t;
|
|
95
|
-
}
|
|
96
|
-
function _e(e) {
|
|
97
|
-
const t = d(e), n = t.getMonth();
|
|
98
|
-
return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
|
|
99
|
-
}
|
|
100
|
-
function qe(e) {
|
|
101
|
-
const t = d(e);
|
|
102
|
-
return +Ie(t) == +_e(t);
|
|
103
|
-
}
|
|
104
|
-
function Ae(e, t) {
|
|
105
|
-
const n = d(e), r = d(t), a = C(n, r), s = Math.abs(
|
|
106
|
-
Fe(n, r)
|
|
107
|
-
);
|
|
108
|
-
let o;
|
|
109
|
-
if (s < 1)
|
|
110
|
-
o = 0;
|
|
111
|
-
else {
|
|
112
|
-
n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - a * s);
|
|
113
|
-
let i = C(n, r) === -a;
|
|
114
|
-
qe(d(e)) && s === 1 && C(e, r) === 1 && (i = !1), o = a * (s - Number(i));
|
|
115
|
-
}
|
|
116
|
-
return o === 0 ? 0 : o;
|
|
117
|
-
}
|
|
118
|
-
function Re(e, t, n) {
|
|
119
|
-
const r = Xe(e, t) / 1e3;
|
|
120
|
-
return Le(n == null ? void 0 : n.roundingMethod)(r);
|
|
121
|
-
}
|
|
122
|
-
function ze(e) {
|
|
123
|
-
const t = d(e), n = O(e, 0);
|
|
124
|
-
return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
125
|
-
}
|
|
126
|
-
const je = {
|
|
127
|
-
lessThanXSeconds: {
|
|
128
|
-
one: "less than a second",
|
|
129
|
-
other: "less than {{count}} seconds"
|
|
130
|
-
},
|
|
131
|
-
xSeconds: {
|
|
132
|
-
one: "1 second",
|
|
133
|
-
other: "{{count}} seconds"
|
|
134
|
-
},
|
|
135
|
-
halfAMinute: "half a minute",
|
|
136
|
-
lessThanXMinutes: {
|
|
137
|
-
one: "less than a minute",
|
|
138
|
-
other: "less than {{count}} minutes"
|
|
139
|
-
},
|
|
140
|
-
xMinutes: {
|
|
141
|
-
one: "1 minute",
|
|
142
|
-
other: "{{count}} minutes"
|
|
143
|
-
},
|
|
144
|
-
aboutXHours: {
|
|
145
|
-
one: "about 1 hour",
|
|
146
|
-
other: "about {{count}} hours"
|
|
147
|
-
},
|
|
148
|
-
xHours: {
|
|
149
|
-
one: "1 hour",
|
|
150
|
-
other: "{{count}} hours"
|
|
151
|
-
},
|
|
152
|
-
xDays: {
|
|
153
|
-
one: "1 day",
|
|
154
|
-
other: "{{count}} days"
|
|
155
|
-
},
|
|
156
|
-
aboutXWeeks: {
|
|
157
|
-
one: "about 1 week",
|
|
158
|
-
other: "about {{count}} weeks"
|
|
159
|
-
},
|
|
160
|
-
xWeeks: {
|
|
161
|
-
one: "1 week",
|
|
162
|
-
other: "{{count}} weeks"
|
|
163
|
-
},
|
|
164
|
-
aboutXMonths: {
|
|
165
|
-
one: "about 1 month",
|
|
166
|
-
other: "about {{count}} months"
|
|
167
|
-
},
|
|
168
|
-
xMonths: {
|
|
169
|
-
one: "1 month",
|
|
170
|
-
other: "{{count}} months"
|
|
171
|
-
},
|
|
172
|
-
aboutXYears: {
|
|
173
|
-
one: "about 1 year",
|
|
174
|
-
other: "about {{count}} years"
|
|
175
|
-
},
|
|
176
|
-
xYears: {
|
|
177
|
-
one: "1 year",
|
|
178
|
-
other: "{{count}} years"
|
|
179
|
-
},
|
|
180
|
-
overXYears: {
|
|
181
|
-
one: "over 1 year",
|
|
182
|
-
other: "over {{count}} years"
|
|
183
|
-
},
|
|
184
|
-
almostXYears: {
|
|
185
|
-
one: "almost 1 year",
|
|
186
|
-
other: "almost {{count}} years"
|
|
187
|
-
}
|
|
188
|
-
}, He = (e, t, n) => {
|
|
189
|
-
let r;
|
|
190
|
-
const a = je[e];
|
|
191
|
-
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;
|
|
192
|
-
};
|
|
193
|
-
function L(e) {
|
|
194
|
-
return (t = {}) => {
|
|
195
|
-
const n = t.width ? String(t.width) : e.defaultWidth;
|
|
196
|
-
return e.formats[n] || e.formats[e.defaultWidth];
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
const Be = {
|
|
200
|
-
full: "EEEE, MMMM do, y",
|
|
201
|
-
long: "MMMM do, y",
|
|
202
|
-
medium: "MMM d, y",
|
|
203
|
-
short: "MM/dd/yyyy"
|
|
204
|
-
}, $e = {
|
|
205
|
-
full: "h:mm:ss a zzzz",
|
|
206
|
-
long: "h:mm:ss a z",
|
|
207
|
-
medium: "h:mm:ss a",
|
|
208
|
-
short: "h:mm a"
|
|
209
|
-
}, Ze = {
|
|
210
|
-
full: "{{date}} 'at' {{time}}",
|
|
211
|
-
long: "{{date}} 'at' {{time}}",
|
|
212
|
-
medium: "{{date}}, {{time}}",
|
|
213
|
-
short: "{{date}}, {{time}}"
|
|
214
|
-
}, Ve = {
|
|
215
|
-
date: L({
|
|
216
|
-
formats: Be,
|
|
217
|
-
defaultWidth: "full"
|
|
218
|
-
}),
|
|
219
|
-
time: L({
|
|
220
|
-
formats: $e,
|
|
221
|
-
defaultWidth: "full"
|
|
222
|
-
}),
|
|
223
|
-
dateTime: L({
|
|
224
|
-
formats: Ze,
|
|
225
|
-
defaultWidth: "full"
|
|
226
|
-
})
|
|
227
|
-
}, Qe = {
|
|
228
|
-
lastWeek: "'last' eeee 'at' p",
|
|
229
|
-
yesterday: "'yesterday at' p",
|
|
230
|
-
today: "'today at' p",
|
|
231
|
-
tomorrow: "'tomorrow at' p",
|
|
232
|
-
nextWeek: "eeee 'at' p",
|
|
233
|
-
other: "P"
|
|
234
|
-
}, Ge = (e, t, n, r) => Qe[e];
|
|
235
|
-
function p(e) {
|
|
236
|
-
return (t, n) => {
|
|
237
|
-
const r = n != null && n.context ? String(n.context) : "standalone";
|
|
238
|
-
let a;
|
|
239
|
-
if (r === "formatting" && e.formattingValues) {
|
|
240
|
-
const o = e.defaultFormattingWidth || e.defaultWidth, i = n != null && n.width ? String(n.width) : o;
|
|
241
|
-
a = e.formattingValues[i] || e.formattingValues[o];
|
|
242
|
-
} else {
|
|
243
|
-
const o = e.defaultWidth, i = n != null && n.width ? String(n.width) : e.defaultWidth;
|
|
244
|
-
a = e.values[i] || e.values[o];
|
|
245
|
-
}
|
|
246
|
-
const s = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
247
|
-
return a[s];
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
const Ue = {
|
|
251
|
-
narrow: ["B", "A"],
|
|
252
|
-
abbreviated: ["BC", "AD"],
|
|
253
|
-
wide: ["Before Christ", "Anno Domini"]
|
|
254
|
-
}, Je = {
|
|
255
|
-
narrow: ["1", "2", "3", "4"],
|
|
256
|
-
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
257
|
-
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
258
|
-
}, Ke = {
|
|
259
|
-
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
260
|
-
abbreviated: [
|
|
261
|
-
"Jan",
|
|
262
|
-
"Feb",
|
|
263
|
-
"Mar",
|
|
264
|
-
"Apr",
|
|
265
|
-
"May",
|
|
266
|
-
"Jun",
|
|
267
|
-
"Jul",
|
|
268
|
-
"Aug",
|
|
269
|
-
"Sep",
|
|
270
|
-
"Oct",
|
|
271
|
-
"Nov",
|
|
272
|
-
"Dec"
|
|
273
|
-
],
|
|
274
|
-
wide: [
|
|
275
|
-
"January",
|
|
276
|
-
"February",
|
|
277
|
-
"March",
|
|
278
|
-
"April",
|
|
279
|
-
"May",
|
|
280
|
-
"June",
|
|
281
|
-
"July",
|
|
282
|
-
"August",
|
|
283
|
-
"September",
|
|
284
|
-
"October",
|
|
285
|
-
"November",
|
|
286
|
-
"December"
|
|
287
|
-
]
|
|
288
|
-
}, et = {
|
|
289
|
-
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
290
|
-
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
291
|
-
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
292
|
-
wide: [
|
|
293
|
-
"Sunday",
|
|
294
|
-
"Monday",
|
|
295
|
-
"Tuesday",
|
|
296
|
-
"Wednesday",
|
|
297
|
-
"Thursday",
|
|
298
|
-
"Friday",
|
|
299
|
-
"Saturday"
|
|
300
|
-
]
|
|
301
|
-
}, tt = {
|
|
302
|
-
narrow: {
|
|
303
|
-
am: "a",
|
|
304
|
-
pm: "p",
|
|
305
|
-
midnight: "mi",
|
|
306
|
-
noon: "n",
|
|
307
|
-
morning: "morning",
|
|
308
|
-
afternoon: "afternoon",
|
|
309
|
-
evening: "evening",
|
|
310
|
-
night: "night"
|
|
311
|
-
},
|
|
312
|
-
abbreviated: {
|
|
313
|
-
am: "AM",
|
|
314
|
-
pm: "PM",
|
|
315
|
-
midnight: "midnight",
|
|
316
|
-
noon: "noon",
|
|
317
|
-
morning: "morning",
|
|
318
|
-
afternoon: "afternoon",
|
|
319
|
-
evening: "evening",
|
|
320
|
-
night: "night"
|
|
321
|
-
},
|
|
322
|
-
wide: {
|
|
323
|
-
am: "a.m.",
|
|
324
|
-
pm: "p.m.",
|
|
325
|
-
midnight: "midnight",
|
|
326
|
-
noon: "noon",
|
|
327
|
-
morning: "morning",
|
|
328
|
-
afternoon: "afternoon",
|
|
329
|
-
evening: "evening",
|
|
330
|
-
night: "night"
|
|
331
|
-
}
|
|
332
|
-
}, nt = {
|
|
333
|
-
narrow: {
|
|
334
|
-
am: "a",
|
|
335
|
-
pm: "p",
|
|
336
|
-
midnight: "mi",
|
|
337
|
-
noon: "n",
|
|
338
|
-
morning: "in the morning",
|
|
339
|
-
afternoon: "in the afternoon",
|
|
340
|
-
evening: "in the evening",
|
|
341
|
-
night: "at night"
|
|
342
|
-
},
|
|
343
|
-
abbreviated: {
|
|
344
|
-
am: "AM",
|
|
345
|
-
pm: "PM",
|
|
346
|
-
midnight: "midnight",
|
|
347
|
-
noon: "noon",
|
|
348
|
-
morning: "in the morning",
|
|
349
|
-
afternoon: "in the afternoon",
|
|
350
|
-
evening: "in the evening",
|
|
351
|
-
night: "at night"
|
|
352
|
-
},
|
|
353
|
-
wide: {
|
|
354
|
-
am: "a.m.",
|
|
355
|
-
pm: "p.m.",
|
|
356
|
-
midnight: "midnight",
|
|
357
|
-
noon: "noon",
|
|
358
|
-
morning: "in the morning",
|
|
359
|
-
afternoon: "in the afternoon",
|
|
360
|
-
evening: "in the evening",
|
|
361
|
-
night: "at night"
|
|
362
|
-
}
|
|
363
|
-
}, rt = (e, t) => {
|
|
364
|
-
const n = Number(e), r = n % 100;
|
|
365
|
-
if (r > 20 || r < 10)
|
|
366
|
-
switch (r % 10) {
|
|
367
|
-
case 1:
|
|
368
|
-
return n + "st";
|
|
369
|
-
case 2:
|
|
370
|
-
return n + "nd";
|
|
371
|
-
case 3:
|
|
372
|
-
return n + "rd";
|
|
373
|
-
}
|
|
374
|
-
return n + "th";
|
|
375
|
-
}, at = {
|
|
376
|
-
ordinalNumber: rt,
|
|
377
|
-
era: p({
|
|
378
|
-
values: Ue,
|
|
379
|
-
defaultWidth: "wide"
|
|
380
|
-
}),
|
|
381
|
-
quarter: p({
|
|
382
|
-
values: Je,
|
|
383
|
-
defaultWidth: "wide",
|
|
384
|
-
argumentCallback: (e) => e - 1
|
|
385
|
-
}),
|
|
386
|
-
month: p({
|
|
387
|
-
values: Ke,
|
|
388
|
-
defaultWidth: "wide"
|
|
389
|
-
}),
|
|
390
|
-
day: p({
|
|
391
|
-
values: et,
|
|
392
|
-
defaultWidth: "wide"
|
|
393
|
-
}),
|
|
394
|
-
dayPeriod: p({
|
|
395
|
-
values: tt,
|
|
396
|
-
defaultWidth: "wide",
|
|
397
|
-
formattingValues: nt,
|
|
398
|
-
defaultFormattingWidth: "wide"
|
|
399
|
-
})
|
|
400
|
-
};
|
|
401
|
-
function k(e) {
|
|
402
|
-
return (t, n = {}) => {
|
|
403
|
-
const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], s = t.match(a);
|
|
404
|
-
if (!s)
|
|
405
|
-
return null;
|
|
406
|
-
const o = s[0], i = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], f = Array.isArray(i) ? ot(i, (h) => h.test(o)) : (
|
|
407
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
408
|
-
st(i, (h) => h.test(o))
|
|
409
|
-
);
|
|
410
|
-
let l;
|
|
411
|
-
l = e.valueCallback ? e.valueCallback(f) : f, l = n.valueCallback ? (
|
|
412
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
413
|
-
n.valueCallback(l)
|
|
414
|
-
) : l;
|
|
415
|
-
const c = t.slice(o.length);
|
|
416
|
-
return { value: l, rest: c };
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
function st(e, t) {
|
|
420
|
-
for (const n in e)
|
|
421
|
-
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
422
|
-
return n;
|
|
423
|
-
}
|
|
424
|
-
function ot(e, t) {
|
|
425
|
-
for (let n = 0; n < e.length; n++)
|
|
426
|
-
if (t(e[n]))
|
|
427
|
-
return n;
|
|
428
|
-
}
|
|
429
|
-
function it(e) {
|
|
430
|
-
return (t, n = {}) => {
|
|
431
|
-
const r = t.match(e.matchPattern);
|
|
432
|
-
if (!r) return null;
|
|
433
|
-
const a = r[0], s = t.match(e.parsePattern);
|
|
434
|
-
if (!s) return null;
|
|
435
|
-
let o = e.valueCallback ? e.valueCallback(s[0]) : s[0];
|
|
436
|
-
o = n.valueCallback ? n.valueCallback(o) : o;
|
|
437
|
-
const i = t.slice(a.length);
|
|
438
|
-
return { value: o, rest: i };
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
const ut = /^(\d+)(th|st|nd|rd)?/i, ct = /\d+/i, ft = {
|
|
442
|
-
narrow: /^(b|a)/i,
|
|
443
|
-
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
444
|
-
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
445
|
-
}, lt = {
|
|
446
|
-
any: [/^b/i, /^(a|c)/i]
|
|
447
|
-
}, mt = {
|
|
448
|
-
narrow: /^[1234]/i,
|
|
449
|
-
abbreviated: /^q[1234]/i,
|
|
450
|
-
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
451
|
-
}, dt = {
|
|
452
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
453
|
-
}, ht = {
|
|
454
|
-
narrow: /^[jfmasond]/i,
|
|
455
|
-
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
456
|
-
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
457
|
-
}, gt = {
|
|
458
|
-
narrow: [
|
|
459
|
-
/^j/i,
|
|
460
|
-
/^f/i,
|
|
461
|
-
/^m/i,
|
|
462
|
-
/^a/i,
|
|
463
|
-
/^m/i,
|
|
464
|
-
/^j/i,
|
|
465
|
-
/^j/i,
|
|
466
|
-
/^a/i,
|
|
467
|
-
/^s/i,
|
|
468
|
-
/^o/i,
|
|
469
|
-
/^n/i,
|
|
470
|
-
/^d/i
|
|
471
|
-
],
|
|
472
|
-
any: [
|
|
473
|
-
/^ja/i,
|
|
474
|
-
/^f/i,
|
|
475
|
-
/^mar/i,
|
|
476
|
-
/^ap/i,
|
|
477
|
-
/^may/i,
|
|
478
|
-
/^jun/i,
|
|
479
|
-
/^jul/i,
|
|
480
|
-
/^au/i,
|
|
481
|
-
/^s/i,
|
|
482
|
-
/^o/i,
|
|
483
|
-
/^n/i,
|
|
484
|
-
/^d/i
|
|
485
|
-
]
|
|
486
|
-
}, wt = {
|
|
487
|
-
narrow: /^[smtwf]/i,
|
|
488
|
-
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
489
|
-
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
490
|
-
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
491
|
-
}, yt = {
|
|
492
|
-
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
493
|
-
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
494
|
-
}, bt = {
|
|
495
|
-
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
496
|
-
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
497
|
-
}, Mt = {
|
|
498
|
-
any: {
|
|
499
|
-
am: /^a/i,
|
|
500
|
-
pm: /^p/i,
|
|
501
|
-
midnight: /^mi/i,
|
|
502
|
-
noon: /^no/i,
|
|
503
|
-
morning: /morning/i,
|
|
504
|
-
afternoon: /afternoon/i,
|
|
505
|
-
evening: /evening/i,
|
|
506
|
-
night: /night/i
|
|
507
|
-
}
|
|
508
|
-
}, vt = {
|
|
509
|
-
ordinalNumber: it({
|
|
510
|
-
matchPattern: ut,
|
|
511
|
-
parsePattern: ct,
|
|
512
|
-
valueCallback: (e) => parseInt(e, 10)
|
|
513
|
-
}),
|
|
514
|
-
era: k({
|
|
515
|
-
matchPatterns: ft,
|
|
516
|
-
defaultMatchWidth: "wide",
|
|
517
|
-
parsePatterns: lt,
|
|
518
|
-
defaultParseWidth: "any"
|
|
519
|
-
}),
|
|
520
|
-
quarter: k({
|
|
521
|
-
matchPatterns: mt,
|
|
522
|
-
defaultMatchWidth: "wide",
|
|
523
|
-
parsePatterns: dt,
|
|
524
|
-
defaultParseWidth: "any",
|
|
525
|
-
valueCallback: (e) => e + 1
|
|
526
|
-
}),
|
|
527
|
-
month: k({
|
|
528
|
-
matchPatterns: ht,
|
|
529
|
-
defaultMatchWidth: "wide",
|
|
530
|
-
parsePatterns: gt,
|
|
531
|
-
defaultParseWidth: "any"
|
|
532
|
-
}),
|
|
533
|
-
day: k({
|
|
534
|
-
matchPatterns: wt,
|
|
535
|
-
defaultMatchWidth: "wide",
|
|
536
|
-
parsePatterns: yt,
|
|
537
|
-
defaultParseWidth: "any"
|
|
538
|
-
}),
|
|
539
|
-
dayPeriod: k({
|
|
540
|
-
matchPatterns: bt,
|
|
541
|
-
defaultMatchWidth: "any",
|
|
542
|
-
parsePatterns: Mt,
|
|
543
|
-
defaultParseWidth: "any"
|
|
544
|
-
})
|
|
545
|
-
}, se = {
|
|
546
|
-
code: "en-US",
|
|
547
|
-
formatDistance: He,
|
|
548
|
-
formatLong: Ve,
|
|
549
|
-
formatRelative: Ge,
|
|
550
|
-
localize: at,
|
|
551
|
-
match: vt,
|
|
552
|
-
options: {
|
|
553
|
-
weekStartsOn: 0,
|
|
554
|
-
firstWeekContainsDate: 1
|
|
555
|
-
}
|
|
556
|
-
};
|
|
557
|
-
function Ot(e) {
|
|
558
|
-
const t = d(e);
|
|
559
|
-
return We(t, ze(t)) + 1;
|
|
560
|
-
}
|
|
561
|
-
function Tt(e) {
|
|
562
|
-
const t = d(e), n = +N(t) - +Ce(t);
|
|
563
|
-
return Math.round(n / ee) + 1;
|
|
564
|
-
}
|
|
565
|
-
function oe(e, t) {
|
|
566
|
-
var c, h, u, g;
|
|
567
|
-
const n = d(e), r = n.getFullYear(), a = P(), s = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((h = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : h.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((g = (u = a.locale) == null ? void 0 : u.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, o = O(e, 0);
|
|
568
|
-
o.setFullYear(r + 1, 0, s), o.setHours(0, 0, 0, 0);
|
|
569
|
-
const i = S(o, t), f = O(e, 0);
|
|
570
|
-
f.setFullYear(r, 0, s), f.setHours(0, 0, 0, 0);
|
|
571
|
-
const l = S(f, t);
|
|
572
|
-
return n.getTime() >= i.getTime() ? r + 1 : n.getTime() >= l.getTime() ? r : r - 1;
|
|
573
|
-
}
|
|
574
|
-
function xt(e, t) {
|
|
575
|
-
var i, f, l, c;
|
|
576
|
-
const n = P(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((f = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : f.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((c = (l = n.locale) == null ? void 0 : l.options) == null ? void 0 : c.firstWeekContainsDate) ?? 1, a = oe(e, t), s = O(e, 0);
|
|
577
|
-
return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0), S(s, t);
|
|
578
|
-
}
|
|
579
|
-
function Dt(e, t) {
|
|
580
|
-
const n = d(e), r = +S(n, t) - +xt(n, t);
|
|
581
|
-
return Math.round(r / ee) + 1;
|
|
582
|
-
}
|
|
583
|
-
function m(e, t) {
|
|
584
|
-
const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
|
|
585
|
-
return n + r;
|
|
586
|
-
}
|
|
587
|
-
const v = {
|
|
588
|
-
// Year
|
|
589
|
-
y(e, t) {
|
|
590
|
-
const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
591
|
-
return m(t === "yy" ? r % 100 : r, t.length);
|
|
592
|
-
},
|
|
593
|
-
// Month
|
|
594
|
-
M(e, t) {
|
|
595
|
-
const n = e.getMonth();
|
|
596
|
-
return t === "M" ? String(n + 1) : m(n + 1, 2);
|
|
597
|
-
},
|
|
598
|
-
// Day of the month
|
|
599
|
-
d(e, t) {
|
|
600
|
-
return m(e.getDate(), t.length);
|
|
601
|
-
},
|
|
602
|
-
// AM or PM
|
|
603
|
-
a(e, t) {
|
|
604
|
-
const n = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
605
|
-
switch (t) {
|
|
606
|
-
case "a":
|
|
607
|
-
case "aa":
|
|
608
|
-
return n.toUpperCase();
|
|
609
|
-
case "aaa":
|
|
610
|
-
return n;
|
|
611
|
-
case "aaaaa":
|
|
612
|
-
return n[0];
|
|
613
|
-
case "aaaa":
|
|
614
|
-
default:
|
|
615
|
-
return n === "am" ? "a.m." : "p.m.";
|
|
616
|
-
}
|
|
617
|
-
},
|
|
618
|
-
// Hour [1-12]
|
|
619
|
-
h(e, t) {
|
|
620
|
-
return m(e.getHours() % 12 || 12, t.length);
|
|
621
|
-
},
|
|
622
|
-
// Hour [0-23]
|
|
623
|
-
H(e, t) {
|
|
624
|
-
return m(e.getHours(), t.length);
|
|
625
|
-
},
|
|
626
|
-
// Minute
|
|
627
|
-
m(e, t) {
|
|
628
|
-
return m(e.getMinutes(), t.length);
|
|
629
|
-
},
|
|
630
|
-
// Second
|
|
631
|
-
s(e, t) {
|
|
632
|
-
return m(e.getSeconds(), t.length);
|
|
633
|
-
},
|
|
634
|
-
// Fraction of second
|
|
635
|
-
S(e, t) {
|
|
636
|
-
const n = t.length, r = e.getMilliseconds(), a = Math.trunc(
|
|
637
|
-
r * Math.pow(10, n - 3)
|
|
638
|
-
);
|
|
639
|
-
return m(a, t.length);
|
|
640
|
-
}
|
|
641
|
-
}, x = {
|
|
642
|
-
midnight: "midnight",
|
|
643
|
-
noon: "noon",
|
|
644
|
-
morning: "morning",
|
|
645
|
-
afternoon: "afternoon",
|
|
646
|
-
evening: "evening",
|
|
647
|
-
night: "night"
|
|
648
|
-
}, $ = {
|
|
649
|
-
// Era
|
|
650
|
-
G: function(e, t, n) {
|
|
651
|
-
const r = e.getFullYear() > 0 ? 1 : 0;
|
|
652
|
-
switch (t) {
|
|
653
|
-
case "G":
|
|
654
|
-
case "GG":
|
|
655
|
-
case "GGG":
|
|
656
|
-
return n.era(r, { width: "abbreviated" });
|
|
657
|
-
case "GGGGG":
|
|
658
|
-
return n.era(r, { width: "narrow" });
|
|
659
|
-
case "GGGG":
|
|
660
|
-
default:
|
|
661
|
-
return n.era(r, { width: "wide" });
|
|
662
|
-
}
|
|
663
|
-
},
|
|
664
|
-
// Year
|
|
665
|
-
y: function(e, t, n) {
|
|
666
|
-
if (t === "yo") {
|
|
667
|
-
const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
668
|
-
return n.ordinalNumber(a, { unit: "year" });
|
|
669
|
-
}
|
|
670
|
-
return v.y(e, t);
|
|
671
|
-
},
|
|
672
|
-
// Local week-numbering year
|
|
673
|
-
Y: function(e, t, n, r) {
|
|
674
|
-
const a = oe(e, r), s = a > 0 ? a : 1 - a;
|
|
675
|
-
if (t === "YY") {
|
|
676
|
-
const o = s % 100;
|
|
677
|
-
return m(o, 2);
|
|
678
|
-
}
|
|
679
|
-
return t === "Yo" ? n.ordinalNumber(s, { unit: "year" }) : m(s, t.length);
|
|
680
|
-
},
|
|
681
|
-
// ISO week-numbering year
|
|
682
|
-
R: function(e, t) {
|
|
683
|
-
const n = ae(e);
|
|
684
|
-
return m(n, t.length);
|
|
685
|
-
},
|
|
686
|
-
// Extended year. This is a single number designating the year of this calendar system.
|
|
687
|
-
// The main difference between `y` and `u` localizers are B.C. years:
|
|
688
|
-
// | Year | `y` | `u` |
|
|
689
|
-
// |------|-----|-----|
|
|
690
|
-
// | AC 1 | 1 | 1 |
|
|
691
|
-
// | BC 1 | 1 | 0 |
|
|
692
|
-
// | BC 2 | 2 | -1 |
|
|
693
|
-
// Also `yy` always returns the last two digits of a year,
|
|
694
|
-
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
695
|
-
u: function(e, t) {
|
|
696
|
-
const n = e.getFullYear();
|
|
697
|
-
return m(n, t.length);
|
|
698
|
-
},
|
|
699
|
-
// Quarter
|
|
700
|
-
Q: function(e, t, n) {
|
|
701
|
-
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
702
|
-
switch (t) {
|
|
703
|
-
case "Q":
|
|
704
|
-
return String(r);
|
|
705
|
-
case "QQ":
|
|
706
|
-
return m(r, 2);
|
|
707
|
-
case "Qo":
|
|
708
|
-
return n.ordinalNumber(r, { unit: "quarter" });
|
|
709
|
-
case "QQQ":
|
|
710
|
-
return n.quarter(r, {
|
|
711
|
-
width: "abbreviated",
|
|
712
|
-
context: "formatting"
|
|
713
|
-
});
|
|
714
|
-
case "QQQQQ":
|
|
715
|
-
return n.quarter(r, {
|
|
716
|
-
width: "narrow",
|
|
717
|
-
context: "formatting"
|
|
718
|
-
});
|
|
719
|
-
case "QQQQ":
|
|
720
|
-
default:
|
|
721
|
-
return n.quarter(r, {
|
|
722
|
-
width: "wide",
|
|
723
|
-
context: "formatting"
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
},
|
|
727
|
-
// Stand-alone quarter
|
|
728
|
-
q: function(e, t, n) {
|
|
729
|
-
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
730
|
-
switch (t) {
|
|
731
|
-
case "q":
|
|
732
|
-
return String(r);
|
|
733
|
-
case "qq":
|
|
734
|
-
return m(r, 2);
|
|
735
|
-
case "qo":
|
|
736
|
-
return n.ordinalNumber(r, { unit: "quarter" });
|
|
737
|
-
case "qqq":
|
|
738
|
-
return n.quarter(r, {
|
|
739
|
-
width: "abbreviated",
|
|
740
|
-
context: "standalone"
|
|
741
|
-
});
|
|
742
|
-
case "qqqqq":
|
|
743
|
-
return n.quarter(r, {
|
|
744
|
-
width: "narrow",
|
|
745
|
-
context: "standalone"
|
|
746
|
-
});
|
|
747
|
-
case "qqqq":
|
|
748
|
-
default:
|
|
749
|
-
return n.quarter(r, {
|
|
750
|
-
width: "wide",
|
|
751
|
-
context: "standalone"
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
|
-
},
|
|
755
|
-
// Month
|
|
756
|
-
M: function(e, t, n) {
|
|
757
|
-
const r = e.getMonth();
|
|
758
|
-
switch (t) {
|
|
759
|
-
case "M":
|
|
760
|
-
case "MM":
|
|
761
|
-
return v.M(e, t);
|
|
762
|
-
case "Mo":
|
|
763
|
-
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
764
|
-
case "MMM":
|
|
765
|
-
return n.month(r, {
|
|
766
|
-
width: "abbreviated",
|
|
767
|
-
context: "formatting"
|
|
768
|
-
});
|
|
769
|
-
case "MMMMM":
|
|
770
|
-
return n.month(r, {
|
|
771
|
-
width: "narrow",
|
|
772
|
-
context: "formatting"
|
|
773
|
-
});
|
|
774
|
-
case "MMMM":
|
|
775
|
-
default:
|
|
776
|
-
return n.month(r, { width: "wide", context: "formatting" });
|
|
777
|
-
}
|
|
778
|
-
},
|
|
779
|
-
// Stand-alone month
|
|
780
|
-
L: function(e, t, n) {
|
|
781
|
-
const r = e.getMonth();
|
|
782
|
-
switch (t) {
|
|
783
|
-
case "L":
|
|
784
|
-
return String(r + 1);
|
|
785
|
-
case "LL":
|
|
786
|
-
return m(r + 1, 2);
|
|
787
|
-
case "Lo":
|
|
788
|
-
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
789
|
-
case "LLL":
|
|
790
|
-
return n.month(r, {
|
|
791
|
-
width: "abbreviated",
|
|
792
|
-
context: "standalone"
|
|
793
|
-
});
|
|
794
|
-
case "LLLLL":
|
|
795
|
-
return n.month(r, {
|
|
796
|
-
width: "narrow",
|
|
797
|
-
context: "standalone"
|
|
798
|
-
});
|
|
799
|
-
case "LLLL":
|
|
800
|
-
default:
|
|
801
|
-
return n.month(r, { width: "wide", context: "standalone" });
|
|
802
|
-
}
|
|
803
|
-
},
|
|
804
|
-
// Local week of year
|
|
805
|
-
w: function(e, t, n, r) {
|
|
806
|
-
const a = Dt(e, r);
|
|
807
|
-
return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : m(a, t.length);
|
|
808
|
-
},
|
|
809
|
-
// ISO week of year
|
|
810
|
-
I: function(e, t, n) {
|
|
811
|
-
const r = Tt(e);
|
|
812
|
-
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : m(r, t.length);
|
|
813
|
-
},
|
|
814
|
-
// Day of the month
|
|
815
|
-
d: function(e, t, n) {
|
|
816
|
-
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : v.d(e, t);
|
|
817
|
-
},
|
|
818
|
-
// Day of year
|
|
819
|
-
D: function(e, t, n) {
|
|
820
|
-
const r = Ot(e);
|
|
821
|
-
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : m(r, t.length);
|
|
822
|
-
},
|
|
823
|
-
// Day of week
|
|
824
|
-
E: function(e, t, n) {
|
|
825
|
-
const r = e.getDay();
|
|
826
|
-
switch (t) {
|
|
827
|
-
case "E":
|
|
828
|
-
case "EE":
|
|
829
|
-
case "EEE":
|
|
830
|
-
return n.day(r, {
|
|
831
|
-
width: "abbreviated",
|
|
832
|
-
context: "formatting"
|
|
833
|
-
});
|
|
834
|
-
case "EEEEE":
|
|
835
|
-
return n.day(r, {
|
|
836
|
-
width: "narrow",
|
|
837
|
-
context: "formatting"
|
|
838
|
-
});
|
|
839
|
-
case "EEEEEE":
|
|
840
|
-
return n.day(r, {
|
|
841
|
-
width: "short",
|
|
842
|
-
context: "formatting"
|
|
843
|
-
});
|
|
844
|
-
case "EEEE":
|
|
845
|
-
default:
|
|
846
|
-
return n.day(r, {
|
|
847
|
-
width: "wide",
|
|
848
|
-
context: "formatting"
|
|
849
|
-
});
|
|
850
|
-
}
|
|
851
|
-
},
|
|
852
|
-
// Local day of week
|
|
853
|
-
e: function(e, t, n, r) {
|
|
854
|
-
const a = e.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
855
|
-
switch (t) {
|
|
856
|
-
case "e":
|
|
857
|
-
return String(s);
|
|
858
|
-
case "ee":
|
|
859
|
-
return m(s, 2);
|
|
860
|
-
case "eo":
|
|
861
|
-
return n.ordinalNumber(s, { unit: "day" });
|
|
862
|
-
case "eee":
|
|
863
|
-
return n.day(a, {
|
|
864
|
-
width: "abbreviated",
|
|
865
|
-
context: "formatting"
|
|
866
|
-
});
|
|
867
|
-
case "eeeee":
|
|
868
|
-
return n.day(a, {
|
|
869
|
-
width: "narrow",
|
|
870
|
-
context: "formatting"
|
|
871
|
-
});
|
|
872
|
-
case "eeeeee":
|
|
873
|
-
return n.day(a, {
|
|
874
|
-
width: "short",
|
|
875
|
-
context: "formatting"
|
|
876
|
-
});
|
|
877
|
-
case "eeee":
|
|
878
|
-
default:
|
|
879
|
-
return n.day(a, {
|
|
880
|
-
width: "wide",
|
|
881
|
-
context: "formatting"
|
|
882
|
-
});
|
|
883
|
-
}
|
|
884
|
-
},
|
|
885
|
-
// Stand-alone local day of week
|
|
886
|
-
c: function(e, t, n, r) {
|
|
887
|
-
const a = e.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
888
|
-
switch (t) {
|
|
889
|
-
case "c":
|
|
890
|
-
return String(s);
|
|
891
|
-
case "cc":
|
|
892
|
-
return m(s, t.length);
|
|
893
|
-
case "co":
|
|
894
|
-
return n.ordinalNumber(s, { unit: "day" });
|
|
895
|
-
case "ccc":
|
|
896
|
-
return n.day(a, {
|
|
897
|
-
width: "abbreviated",
|
|
898
|
-
context: "standalone"
|
|
899
|
-
});
|
|
900
|
-
case "ccccc":
|
|
901
|
-
return n.day(a, {
|
|
902
|
-
width: "narrow",
|
|
903
|
-
context: "standalone"
|
|
904
|
-
});
|
|
905
|
-
case "cccccc":
|
|
906
|
-
return n.day(a, {
|
|
907
|
-
width: "short",
|
|
908
|
-
context: "standalone"
|
|
909
|
-
});
|
|
910
|
-
case "cccc":
|
|
911
|
-
default:
|
|
912
|
-
return n.day(a, {
|
|
913
|
-
width: "wide",
|
|
914
|
-
context: "standalone"
|
|
915
|
-
});
|
|
916
|
-
}
|
|
917
|
-
},
|
|
918
|
-
// ISO day of week
|
|
919
|
-
i: function(e, t, n) {
|
|
920
|
-
const r = e.getDay(), a = r === 0 ? 7 : r;
|
|
921
|
-
switch (t) {
|
|
922
|
-
case "i":
|
|
923
|
-
return String(a);
|
|
924
|
-
case "ii":
|
|
925
|
-
return m(a, t.length);
|
|
926
|
-
case "io":
|
|
927
|
-
return n.ordinalNumber(a, { unit: "day" });
|
|
928
|
-
case "iii":
|
|
929
|
-
return n.day(r, {
|
|
930
|
-
width: "abbreviated",
|
|
931
|
-
context: "formatting"
|
|
932
|
-
});
|
|
933
|
-
case "iiiii":
|
|
934
|
-
return n.day(r, {
|
|
935
|
-
width: "narrow",
|
|
936
|
-
context: "formatting"
|
|
937
|
-
});
|
|
938
|
-
case "iiiiii":
|
|
939
|
-
return n.day(r, {
|
|
940
|
-
width: "short",
|
|
941
|
-
context: "formatting"
|
|
942
|
-
});
|
|
943
|
-
case "iiii":
|
|
944
|
-
default:
|
|
945
|
-
return n.day(r, {
|
|
946
|
-
width: "wide",
|
|
947
|
-
context: "formatting"
|
|
948
|
-
});
|
|
949
|
-
}
|
|
950
|
-
},
|
|
951
|
-
// AM or PM
|
|
952
|
-
a: function(e, t, n) {
|
|
953
|
-
const a = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
954
|
-
switch (t) {
|
|
955
|
-
case "a":
|
|
956
|
-
case "aa":
|
|
957
|
-
return n.dayPeriod(a, {
|
|
958
|
-
width: "abbreviated",
|
|
959
|
-
context: "formatting"
|
|
960
|
-
});
|
|
961
|
-
case "aaa":
|
|
962
|
-
return n.dayPeriod(a, {
|
|
963
|
-
width: "abbreviated",
|
|
964
|
-
context: "formatting"
|
|
965
|
-
}).toLowerCase();
|
|
966
|
-
case "aaaaa":
|
|
967
|
-
return n.dayPeriod(a, {
|
|
968
|
-
width: "narrow",
|
|
969
|
-
context: "formatting"
|
|
970
|
-
});
|
|
971
|
-
case "aaaa":
|
|
972
|
-
default:
|
|
973
|
-
return n.dayPeriod(a, {
|
|
974
|
-
width: "wide",
|
|
975
|
-
context: "formatting"
|
|
976
|
-
});
|
|
977
|
-
}
|
|
978
|
-
},
|
|
979
|
-
// AM, PM, midnight, noon
|
|
980
|
-
b: function(e, t, n) {
|
|
981
|
-
const r = e.getHours();
|
|
982
|
-
let a;
|
|
983
|
-
switch (r === 12 ? a = x.noon : r === 0 ? a = x.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
|
|
984
|
-
case "b":
|
|
985
|
-
case "bb":
|
|
986
|
-
return n.dayPeriod(a, {
|
|
987
|
-
width: "abbreviated",
|
|
988
|
-
context: "formatting"
|
|
989
|
-
});
|
|
990
|
-
case "bbb":
|
|
991
|
-
return n.dayPeriod(a, {
|
|
992
|
-
width: "abbreviated",
|
|
993
|
-
context: "formatting"
|
|
994
|
-
}).toLowerCase();
|
|
995
|
-
case "bbbbb":
|
|
996
|
-
return n.dayPeriod(a, {
|
|
997
|
-
width: "narrow",
|
|
998
|
-
context: "formatting"
|
|
999
|
-
});
|
|
1000
|
-
case "bbbb":
|
|
1001
|
-
default:
|
|
1002
|
-
return n.dayPeriod(a, {
|
|
1003
|
-
width: "wide",
|
|
1004
|
-
context: "formatting"
|
|
1005
|
-
});
|
|
1006
|
-
}
|
|
1007
|
-
},
|
|
1008
|
-
// in the morning, in the afternoon, in the evening, at night
|
|
1009
|
-
B: function(e, t, n) {
|
|
1010
|
-
const r = e.getHours();
|
|
1011
|
-
let a;
|
|
1012
|
-
switch (r >= 17 ? a = x.evening : r >= 12 ? a = x.afternoon : r >= 4 ? a = x.morning : a = x.night, t) {
|
|
1013
|
-
case "B":
|
|
1014
|
-
case "BB":
|
|
1015
|
-
case "BBB":
|
|
1016
|
-
return n.dayPeriod(a, {
|
|
1017
|
-
width: "abbreviated",
|
|
1018
|
-
context: "formatting"
|
|
1019
|
-
});
|
|
1020
|
-
case "BBBBB":
|
|
1021
|
-
return n.dayPeriod(a, {
|
|
1022
|
-
width: "narrow",
|
|
1023
|
-
context: "formatting"
|
|
1024
|
-
});
|
|
1025
|
-
case "BBBB":
|
|
1026
|
-
default:
|
|
1027
|
-
return n.dayPeriod(a, {
|
|
1028
|
-
width: "wide",
|
|
1029
|
-
context: "formatting"
|
|
1030
|
-
});
|
|
1031
|
-
}
|
|
1032
|
-
},
|
|
1033
|
-
// Hour [1-12]
|
|
1034
|
-
h: function(e, t, n) {
|
|
1035
|
-
if (t === "ho") {
|
|
1036
|
-
let r = e.getHours() % 12;
|
|
1037
|
-
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1038
|
-
}
|
|
1039
|
-
return v.h(e, t);
|
|
1040
|
-
},
|
|
1041
|
-
// Hour [0-23]
|
|
1042
|
-
H: function(e, t, n) {
|
|
1043
|
-
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : v.H(e, t);
|
|
1044
|
-
},
|
|
1045
|
-
// Hour [0-11]
|
|
1046
|
-
K: function(e, t, n) {
|
|
1047
|
-
const r = e.getHours() % 12;
|
|
1048
|
-
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : m(r, t.length);
|
|
1049
|
-
},
|
|
1050
|
-
// Hour [1-24]
|
|
1051
|
-
k: function(e, t, n) {
|
|
1052
|
-
let r = e.getHours();
|
|
1053
|
-
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : m(r, t.length);
|
|
1054
|
-
},
|
|
1055
|
-
// Minute
|
|
1056
|
-
m: function(e, t, n) {
|
|
1057
|
-
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : v.m(e, t);
|
|
1058
|
-
},
|
|
1059
|
-
// Second
|
|
1060
|
-
s: function(e, t, n) {
|
|
1061
|
-
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : v.s(e, t);
|
|
1062
|
-
},
|
|
1063
|
-
// Fraction of second
|
|
1064
|
-
S: function(e, t) {
|
|
1065
|
-
return v.S(e, t);
|
|
1066
|
-
},
|
|
1067
|
-
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1068
|
-
X: function(e, t, n) {
|
|
1069
|
-
const r = e.getTimezoneOffset();
|
|
1070
|
-
if (r === 0)
|
|
1071
|
-
return "Z";
|
|
1072
|
-
switch (t) {
|
|
1073
|
-
case "X":
|
|
1074
|
-
return V(r);
|
|
1075
|
-
case "XXXX":
|
|
1076
|
-
case "XX":
|
|
1077
|
-
return T(r);
|
|
1078
|
-
case "XXXXX":
|
|
1079
|
-
case "XXX":
|
|
1080
|
-
default:
|
|
1081
|
-
return T(r, ":");
|
|
1082
|
-
}
|
|
1083
|
-
},
|
|
1084
|
-
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1085
|
-
x: function(e, t, n) {
|
|
1086
|
-
const r = e.getTimezoneOffset();
|
|
1087
|
-
switch (t) {
|
|
1088
|
-
case "x":
|
|
1089
|
-
return V(r);
|
|
1090
|
-
case "xxxx":
|
|
1091
|
-
case "xx":
|
|
1092
|
-
return T(r);
|
|
1093
|
-
case "xxxxx":
|
|
1094
|
-
case "xxx":
|
|
1095
|
-
default:
|
|
1096
|
-
return T(r, ":");
|
|
1097
|
-
}
|
|
1098
|
-
},
|
|
1099
|
-
// Timezone (GMT)
|
|
1100
|
-
O: function(e, t, n) {
|
|
1101
|
-
const r = e.getTimezoneOffset();
|
|
1102
|
-
switch (t) {
|
|
1103
|
-
case "O":
|
|
1104
|
-
case "OO":
|
|
1105
|
-
case "OOO":
|
|
1106
|
-
return "GMT" + Z(r, ":");
|
|
1107
|
-
case "OOOO":
|
|
1108
|
-
default:
|
|
1109
|
-
return "GMT" + T(r, ":");
|
|
1110
|
-
}
|
|
1111
|
-
},
|
|
1112
|
-
// Timezone (specific non-location)
|
|
1113
|
-
z: function(e, t, n) {
|
|
1114
|
-
const r = e.getTimezoneOffset();
|
|
1115
|
-
switch (t) {
|
|
1116
|
-
case "z":
|
|
1117
|
-
case "zz":
|
|
1118
|
-
case "zzz":
|
|
1119
|
-
return "GMT" + Z(r, ":");
|
|
1120
|
-
case "zzzz":
|
|
1121
|
-
default:
|
|
1122
|
-
return "GMT" + T(r, ":");
|
|
1123
|
-
}
|
|
1124
|
-
},
|
|
1125
|
-
// Seconds timestamp
|
|
1126
|
-
t: function(e, t, n) {
|
|
1127
|
-
const r = Math.trunc(e.getTime() / 1e3);
|
|
1128
|
-
return m(r, t.length);
|
|
1129
|
-
},
|
|
1130
|
-
// Milliseconds timestamp
|
|
1131
|
-
T: function(e, t, n) {
|
|
1132
|
-
const r = e.getTime();
|
|
1133
|
-
return m(r, t.length);
|
|
1134
|
-
}
|
|
1135
|
-
};
|
|
1136
|
-
function Z(e, t = "") {
|
|
1137
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), s = r % 60;
|
|
1138
|
-
return s === 0 ? n + String(a) : n + String(a) + t + m(s, 2);
|
|
1139
|
-
}
|
|
1140
|
-
function V(e, t) {
|
|
1141
|
-
return e % 60 === 0 ? (e > 0 ? "-" : "+") + m(Math.abs(e) / 60, 2) : T(e, t);
|
|
1142
|
-
}
|
|
1143
|
-
function T(e, t = "") {
|
|
1144
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = m(Math.trunc(r / 60), 2), s = m(r % 60, 2);
|
|
1145
|
-
return n + a + t + s;
|
|
1146
|
-
}
|
|
1147
|
-
const Q = (e, t) => {
|
|
1148
|
-
switch (e) {
|
|
1149
|
-
case "P":
|
|
1150
|
-
return t.date({ width: "short" });
|
|
1151
|
-
case "PP":
|
|
1152
|
-
return t.date({ width: "medium" });
|
|
1153
|
-
case "PPP":
|
|
1154
|
-
return t.date({ width: "long" });
|
|
1155
|
-
case "PPPP":
|
|
1156
|
-
default:
|
|
1157
|
-
return t.date({ width: "full" });
|
|
1158
|
-
}
|
|
1159
|
-
}, ie = (e, t) => {
|
|
1160
|
-
switch (e) {
|
|
1161
|
-
case "p":
|
|
1162
|
-
return t.time({ width: "short" });
|
|
1163
|
-
case "pp":
|
|
1164
|
-
return t.time({ width: "medium" });
|
|
1165
|
-
case "ppp":
|
|
1166
|
-
return t.time({ width: "long" });
|
|
1167
|
-
case "pppp":
|
|
1168
|
-
default:
|
|
1169
|
-
return t.time({ width: "full" });
|
|
1170
|
-
}
|
|
1171
|
-
}, Pt = (e, t) => {
|
|
1172
|
-
const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1173
|
-
if (!a)
|
|
1174
|
-
return Q(e, t);
|
|
1175
|
-
let s;
|
|
1176
|
-
switch (r) {
|
|
1177
|
-
case "P":
|
|
1178
|
-
s = t.dateTime({ width: "short" });
|
|
1179
|
-
break;
|
|
1180
|
-
case "PP":
|
|
1181
|
-
s = t.dateTime({ width: "medium" });
|
|
1182
|
-
break;
|
|
1183
|
-
case "PPP":
|
|
1184
|
-
s = t.dateTime({ width: "long" });
|
|
1185
|
-
break;
|
|
1186
|
-
case "PPPP":
|
|
1187
|
-
default:
|
|
1188
|
-
s = t.dateTime({ width: "full" });
|
|
1189
|
-
break;
|
|
1190
|
-
}
|
|
1191
|
-
return s.replace("{{date}}", Q(r, t)).replace("{{time}}", ie(a, t));
|
|
1192
|
-
}, pt = {
|
|
1193
|
-
p: ie,
|
|
1194
|
-
P: Pt
|
|
1195
|
-
}, kt = /^D+$/, St = /^Y+$/, Wt = ["D", "DD", "YY", "YYYY"];
|
|
1196
|
-
function Ct(e) {
|
|
1197
|
-
return kt.test(e);
|
|
1198
|
-
}
|
|
1199
|
-
function Nt(e) {
|
|
1200
|
-
return St.test(e);
|
|
1201
|
-
}
|
|
1202
|
-
function Yt(e, t, n) {
|
|
1203
|
-
const r = Et(e, t, n);
|
|
1204
|
-
if (console.warn(r), Wt.includes(e)) throw new RangeError(r);
|
|
1205
|
-
}
|
|
1206
|
-
function Et(e, t, n) {
|
|
1207
|
-
const r = e[0] === "Y" ? "years" : "days of the month";
|
|
1208
|
-
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`;
|
|
1209
|
-
}
|
|
1210
|
-
const Ft = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Lt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Xt = /^'([^]*?)'?$/, It = /''/g, _t = /[a-zA-Z]/;
|
|
1211
|
-
function I(e, t, n) {
|
|
1212
|
-
var c, h, u, g, w, M, A, R;
|
|
1213
|
-
const r = P(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? se, s = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((h = (c = n == null ? void 0 : n.locale) == null ? void 0 : c.options) == null ? void 0 : h.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((g = (u = r.locale) == null ? void 0 : u.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, o = (n == null ? void 0 : n.weekStartsOn) ?? ((M = (w = n == null ? void 0 : n.locale) == null ? void 0 : w.options) == null ? void 0 : M.weekStartsOn) ?? r.weekStartsOn ?? ((R = (A = r.locale) == null ? void 0 : A.options) == null ? void 0 : R.weekStartsOn) ?? 0, i = d(e);
|
|
1214
|
-
if (!Ee(i))
|
|
1215
|
-
throw new RangeError("Invalid time value");
|
|
1216
|
-
let f = t.match(Lt).map((b) => {
|
|
1217
|
-
const y = b[0];
|
|
1218
|
-
if (y === "p" || y === "P") {
|
|
1219
|
-
const F = pt[y];
|
|
1220
|
-
return F(b, a.formatLong);
|
|
1221
|
-
}
|
|
1222
|
-
return b;
|
|
1223
|
-
}).join("").match(Ft).map((b) => {
|
|
1224
|
-
if (b === "''")
|
|
1225
|
-
return { isToken: !1, value: "'" };
|
|
1226
|
-
const y = b[0];
|
|
1227
|
-
if (y === "'")
|
|
1228
|
-
return { isToken: !1, value: qt(b) };
|
|
1229
|
-
if ($[y])
|
|
1230
|
-
return { isToken: !0, value: b };
|
|
1231
|
-
if (y.match(_t))
|
|
1232
|
-
throw new RangeError(
|
|
1233
|
-
"Format string contains an unescaped latin alphabet character `" + y + "`"
|
|
1234
|
-
);
|
|
1235
|
-
return { isToken: !1, value: b };
|
|
1236
|
-
});
|
|
1237
|
-
a.localize.preprocessor && (f = a.localize.preprocessor(i, f));
|
|
1238
|
-
const l = {
|
|
1239
|
-
firstWeekContainsDate: s,
|
|
1240
|
-
weekStartsOn: o,
|
|
1241
|
-
locale: a
|
|
1242
|
-
};
|
|
1243
|
-
return f.map((b) => {
|
|
1244
|
-
if (!b.isToken) return b.value;
|
|
1245
|
-
const y = b.value;
|
|
1246
|
-
(!(n != null && n.useAdditionalWeekYearTokens) && Nt(y) || !(n != null && n.useAdditionalDayOfYearTokens) && Ct(y)) && Yt(y, t, String(e));
|
|
1247
|
-
const F = $[y[0]];
|
|
1248
|
-
return F(i, y, a.localize, l);
|
|
1249
|
-
}).join("");
|
|
1250
|
-
}
|
|
1251
|
-
function qt(e) {
|
|
1252
|
-
const t = e.match(Xt);
|
|
1253
|
-
return t ? t[1].replace(It, "'") : e;
|
|
1254
|
-
}
|
|
1255
|
-
function At(e, t, n) {
|
|
1256
|
-
const r = P(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? se, s = 2520, o = C(e, t);
|
|
1257
|
-
if (isNaN(o))
|
|
1258
|
-
throw new RangeError("Invalid time value");
|
|
1259
|
-
const i = Object.assign({}, n, {
|
|
1260
|
-
addSuffix: n == null ? void 0 : n.addSuffix,
|
|
1261
|
-
comparison: o
|
|
1262
|
-
});
|
|
1263
|
-
let f, l;
|
|
1264
|
-
o > 0 ? (f = d(t), l = d(e)) : (f = d(e), l = d(t));
|
|
1265
|
-
const c = Re(l, f), h = (Y(l) - Y(f)) / 1e3, u = Math.round((c - h) / 60);
|
|
1266
|
-
let g;
|
|
1267
|
-
if (u < 2)
|
|
1268
|
-
return n != null && n.includeSeconds ? c < 5 ? a.formatDistance("lessThanXSeconds", 5, i) : c < 10 ? a.formatDistance("lessThanXSeconds", 10, i) : c < 20 ? a.formatDistance("lessThanXSeconds", 20, i) : c < 40 ? a.formatDistance("halfAMinute", 0, i) : c < 60 ? a.formatDistance("lessThanXMinutes", 1, i) : a.formatDistance("xMinutes", 1, i) : u === 0 ? a.formatDistance("lessThanXMinutes", 1, i) : a.formatDistance("xMinutes", u, i);
|
|
1269
|
-
if (u < 45)
|
|
1270
|
-
return a.formatDistance("xMinutes", u, i);
|
|
1271
|
-
if (u < 90)
|
|
1272
|
-
return a.formatDistance("aboutXHours", 1, i);
|
|
1273
|
-
if (u < H) {
|
|
1274
|
-
const w = Math.round(u / 60);
|
|
1275
|
-
return a.formatDistance("aboutXHours", w, i);
|
|
1276
|
-
} else {
|
|
1277
|
-
if (u < s)
|
|
1278
|
-
return a.formatDistance("xDays", 1, i);
|
|
1279
|
-
if (u < W) {
|
|
1280
|
-
const w = Math.round(u / H);
|
|
1281
|
-
return a.formatDistance("xDays", w, i);
|
|
1282
|
-
} else if (u < W * 2)
|
|
1283
|
-
return g = Math.round(u / W), a.formatDistance("aboutXMonths", g, i);
|
|
1284
|
-
}
|
|
1285
|
-
if (g = Ae(l, f), g < 12) {
|
|
1286
|
-
const w = Math.round(u / W);
|
|
1287
|
-
return a.formatDistance("xMonths", w, i);
|
|
1288
|
-
} else {
|
|
1289
|
-
const w = g % 12, M = Math.trunc(g / 12);
|
|
1290
|
-
return w < 3 ? a.formatDistance("aboutXYears", M, i) : w < 9 ? a.formatDistance("overXYears", M, i) : a.formatDistance("almostXYears", M + 1, i);
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
function Rt(e, t) {
|
|
1294
|
-
return At(e, Ne(e), t);
|
|
1295
|
-
}
|
|
1296
|
-
function zt() {
|
|
1297
|
-
return Object.assign({}, P());
|
|
1298
|
-
}
|
|
1299
|
-
function G(e, t, n) {
|
|
1300
|
-
const r = zt(), a = Bt(e, n.timeZone, n.locale ?? r.locale);
|
|
1301
|
-
return "formatToParts" in a ? jt(a, t) : Ht(a, t);
|
|
1302
|
-
}
|
|
1303
|
-
function jt(e, t) {
|
|
1304
|
-
const n = e.formatToParts(t);
|
|
1305
|
-
for (let r = n.length - 1; r >= 0; --r)
|
|
1306
|
-
if (n[r].type === "timeZoneName")
|
|
1307
|
-
return n[r].value;
|
|
1308
|
-
}
|
|
1309
|
-
function Ht(e, t) {
|
|
1310
|
-
const n = e.format(t).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
|
|
1311
|
-
return r ? r[0].substr(1) : "";
|
|
1312
|
-
}
|
|
1313
|
-
function Bt(e, t, n) {
|
|
1314
|
-
return new Intl.DateTimeFormat(n ? [n.code, "en-US"] : void 0, {
|
|
1315
|
-
timeZone: t,
|
|
1316
|
-
timeZoneName: e
|
|
1317
|
-
});
|
|
1318
|
-
}
|
|
1319
|
-
const $t = 60 * 1e3, Zt = {
|
|
1320
|
-
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1321
|
-
X: function(e, t, n) {
|
|
1322
|
-
const r = X(n.timeZone, e);
|
|
1323
|
-
if (r === 0)
|
|
1324
|
-
return "Z";
|
|
1325
|
-
switch (t) {
|
|
1326
|
-
case "X":
|
|
1327
|
-
return U(r);
|
|
1328
|
-
case "XXXX":
|
|
1329
|
-
case "XX":
|
|
1330
|
-
return D(r);
|
|
1331
|
-
case "XXXXX":
|
|
1332
|
-
case "XXX":
|
|
1333
|
-
default:
|
|
1334
|
-
return D(r, ":");
|
|
1335
|
-
}
|
|
1336
|
-
},
|
|
1337
|
-
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1338
|
-
x: function(e, t, n) {
|
|
1339
|
-
const r = X(n.timeZone, e);
|
|
1340
|
-
switch (t) {
|
|
1341
|
-
case "x":
|
|
1342
|
-
return U(r);
|
|
1343
|
-
case "xxxx":
|
|
1344
|
-
case "xx":
|
|
1345
|
-
return D(r);
|
|
1346
|
-
case "xxxxx":
|
|
1347
|
-
case "xxx":
|
|
1348
|
-
default:
|
|
1349
|
-
return D(r, ":");
|
|
1350
|
-
}
|
|
1351
|
-
},
|
|
1352
|
-
// Timezone (GMT)
|
|
1353
|
-
O: function(e, t, n) {
|
|
1354
|
-
const r = X(n.timeZone, e);
|
|
1355
|
-
switch (t) {
|
|
1356
|
-
case "O":
|
|
1357
|
-
case "OO":
|
|
1358
|
-
case "OOO":
|
|
1359
|
-
return "GMT" + Vt(r, ":");
|
|
1360
|
-
case "OOOO":
|
|
1361
|
-
default:
|
|
1362
|
-
return "GMT" + D(r, ":");
|
|
1363
|
-
}
|
|
1364
|
-
},
|
|
1365
|
-
// Timezone (specific non-location)
|
|
1366
|
-
z: function(e, t, n) {
|
|
1367
|
-
switch (t) {
|
|
1368
|
-
case "z":
|
|
1369
|
-
case "zz":
|
|
1370
|
-
case "zzz":
|
|
1371
|
-
return G("short", e, n);
|
|
1372
|
-
case "zzzz":
|
|
1373
|
-
default:
|
|
1374
|
-
return G("long", e, n);
|
|
1375
|
-
}
|
|
1376
|
-
}
|
|
1377
|
-
};
|
|
1378
|
-
function X(e, t) {
|
|
1379
|
-
const n = e ? te(e, t, !0) / $t : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
|
|
1380
|
-
if (Number.isNaN(n))
|
|
1381
|
-
throw new RangeError("Invalid time zone specified: " + e);
|
|
1382
|
-
return n;
|
|
1383
|
-
}
|
|
1384
|
-
function E(e, t) {
|
|
1385
|
-
const n = e < 0 ? "-" : "";
|
|
1386
|
-
let r = Math.abs(e).toString();
|
|
1387
|
-
for (; r.length < t; )
|
|
1388
|
-
r = "0" + r;
|
|
1389
|
-
return n + r;
|
|
1390
|
-
}
|
|
1391
|
-
function D(e, t = "") {
|
|
1392
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = E(Math.floor(r / 60), 2), s = E(Math.floor(r % 60), 2);
|
|
1393
|
-
return n + a + t + s;
|
|
1394
|
-
}
|
|
1395
|
-
function U(e, t) {
|
|
1396
|
-
return e % 60 === 0 ? (e > 0 ? "-" : "+") + E(Math.abs(e) / 60, 2) : D(e, t);
|
|
1397
|
-
}
|
|
1398
|
-
function Vt(e, t = "") {
|
|
1399
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.floor(r / 60), s = r % 60;
|
|
1400
|
-
return s === 0 ? n + String(a) : n + String(a) + t + E(s, 2);
|
|
1401
|
-
}
|
|
1402
|
-
const Qt = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
|
|
1403
|
-
function Gt(e, t, n = {}) {
|
|
1404
|
-
t = String(t);
|
|
1405
|
-
const r = t.match(Qt);
|
|
1406
|
-
if (r) {
|
|
1407
|
-
const a = ne(n.originalDate || e, n);
|
|
1408
|
-
t = r.reduce(function(s, o) {
|
|
1409
|
-
if (o[0] === "'")
|
|
1410
|
-
return s;
|
|
1411
|
-
const i = s.indexOf(o), f = s[i - 1] === "'", l = s.replace(o, "'" + Zt[o[0]](a, o, n) + "'");
|
|
1412
|
-
return f ? l.substring(0, i - 1) + l.substring(i + 1) : l;
|
|
1413
|
-
}, t);
|
|
1414
|
-
}
|
|
1415
|
-
return I(e, t, n);
|
|
1416
|
-
}
|
|
1417
|
-
function Ut(e, t, n) {
|
|
1418
|
-
e = ne(e, n);
|
|
1419
|
-
const r = te(t, e, !0), a = new Date(e.getTime() - r), s = /* @__PURE__ */ new Date(0);
|
|
1420
|
-
return s.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), s.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), s;
|
|
1421
|
-
}
|
|
1422
|
-
function ue(e, t, n, r) {
|
|
1423
|
-
return r = {
|
|
1424
|
-
...r,
|
|
1425
|
-
timeZone: t,
|
|
1426
|
-
originalDate: e
|
|
1427
|
-
}, Gt(Ut(e, t, { timeZone: r.timeZone }), n, r);
|
|
1428
|
-
}
|
|
1429
|
-
function xn(e, t) {
|
|
1430
|
-
return e && e !== "auto" ? e : t;
|
|
1431
|
-
}
|
|
1432
|
-
function Dn(e, t = /* @__PURE__ */ new Date()) {
|
|
1433
|
-
try {
|
|
1434
|
-
const n = {
|
|
1435
|
-
timeZone: e,
|
|
1436
|
-
timeZoneName: "short"
|
|
1437
|
-
}, a = new Intl.DateTimeFormat("en-US", n).formatToParts(t).find((s) => s.type === "timeZoneName");
|
|
1438
|
-
return (a == null ? void 0 : a.value) || e;
|
|
1439
|
-
} catch {
|
|
1440
|
-
return e;
|
|
1441
|
-
}
|
|
1442
|
-
}
|
|
1443
|
-
function Pn(e) {
|
|
1444
|
-
try {
|
|
1445
|
-
const t = {
|
|
1446
|
-
timeZone: e,
|
|
1447
|
-
timeZoneName: "long"
|
|
1448
|
-
}, r = new Intl.DateTimeFormat("en-US", t).formatToParts(
|
|
1449
|
-
/* @__PURE__ */ new Date()
|
|
1450
|
-
).find((a) => a.type === "timeZoneName");
|
|
1451
|
-
return (r == null ? void 0 : r.value) || e;
|
|
1452
|
-
} catch {
|
|
1453
|
-
return e;
|
|
1454
|
-
}
|
|
1455
|
-
}
|
|
1456
|
-
function _(e, t = "auto") {
|
|
1457
|
-
if (!e)
|
|
1458
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
1459
|
-
const n = e.endsWith("Z"), r = /[+-]\d{2}:?\d{2}$/.test(e), a = /\([A-Z]{3,4}\)$/.test(e);
|
|
1460
|
-
if (t === "auto")
|
|
1461
|
-
return n || r || a ? new Date(e) : /* @__PURE__ */ new Date(e + "Z");
|
|
1462
|
-
if (t === "local") {
|
|
1463
|
-
if (n || r) {
|
|
1464
|
-
const s = e.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
|
|
1465
|
-
return new Date(s);
|
|
1466
|
-
}
|
|
1467
|
-
return new Date(e);
|
|
1468
|
-
} else return t === "UTC" ? n ? new Date(e) : r ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : n || r || a ? new Date(e) : we(e, t);
|
|
1469
|
-
}
|
|
1470
|
-
const Jt = "MM/dd/yyyy", Kt = (e, t, n, r = "auto") => {
|
|
1471
|
-
if (!e)
|
|
1472
|
-
return "";
|
|
1473
|
-
try {
|
|
1474
|
-
const a = _(e, r);
|
|
1475
|
-
if (isNaN(a.getTime()))
|
|
1476
|
-
return e;
|
|
1477
|
-
const o = (t && t.trim() ? t : Jt).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
|
|
1478
|
-
return n && n !== "auto" ? ue(a, n, o) : I(a, o);
|
|
1479
|
-
} catch (a) {
|
|
1480
|
-
return console.error("Date formatting error:", a), e;
|
|
1481
|
-
}
|
|
1482
|
-
};
|
|
1483
|
-
function pn(e, t, n = "auto") {
|
|
1484
|
-
if (e)
|
|
1485
|
-
try {
|
|
1486
|
-
const r = _(e, n);
|
|
1487
|
-
if (isNaN(r.getTime())) return;
|
|
1488
|
-
const a = "yyyy M d H m s", s = t && t !== "auto" ? ue(r, t, a) : I(r, a), [o, i, f, l, c, h] = s.split(" ").map(Number);
|
|
1489
|
-
return { year: o, month: i, day: f, hour: l, minute: c, second: h };
|
|
1490
|
-
} catch {
|
|
1491
|
-
return;
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
const en = (e, t = "auto") => {
|
|
1495
|
-
if (!e)
|
|
1496
|
-
return "";
|
|
1497
|
-
try {
|
|
1498
|
-
const n = _(e, t);
|
|
1499
|
-
return isNaN(n.getTime()) ? e : Rt(n, { addSuffix: !0 });
|
|
1500
|
-
} catch (n) {
|
|
1501
|
-
return console.error("Relative time formatting error:", n), e;
|
|
1502
|
-
}
|
|
1503
|
-
};
|
|
1504
|
-
function tn(e, t, n, r) {
|
|
1505
|
-
const a = e instanceof Date ? e.toISOString() : String(e), s = (r == null ? void 0 : r.browserTimezone) || n, o = (r == null ? void 0 : r.isSqlCard) ?? !1;
|
|
1506
|
-
if (t != null && t.useRelativeTime)
|
|
1507
|
-
return en(
|
|
1508
|
-
a,
|
|
1509
|
-
(t == null ? void 0 : t.sourceTimezone) || "auto"
|
|
1510
|
-
);
|
|
1511
|
-
const i = t != null && t.useCustomFormat && (t != null && t.customFormat) ? t.customFormat : (t == null ? void 0 : t.format) || "MM/dd/yyyy";
|
|
1512
|
-
return Kt(
|
|
1513
|
-
a,
|
|
1514
|
-
i,
|
|
1515
|
-
t != null && t.timezone && (t == null ? void 0 : t.timezone) !== "auto" ? t.timezone : o ? s : n,
|
|
1516
|
-
(t == null ? void 0 : t.sourceTimezone) || "auto"
|
|
1517
|
-
);
|
|
1518
|
-
}
|
|
1519
|
-
function ce(e, t, n) {
|
|
1520
|
-
var o, i;
|
|
1521
|
-
if (e == null)
|
|
1522
|
-
return e === null ? ((o = n.absence) == null ? void 0 : o.nullText) ?? "" : ((i = n.absence) == null ? void 0 : i.emptyText) ?? "";
|
|
1523
|
-
const r = me(e) ? e : void 0, a = r ? r.value : e, s = r ?? (typeof e == "number" ? e : void 0);
|
|
1524
|
-
if (!n.useFormattedValues || !t)
|
|
1525
|
-
return String(a);
|
|
1526
|
-
switch (t.type) {
|
|
1527
|
-
case "number":
|
|
1528
|
-
return s !== void 0 ? ye(
|
|
1529
|
-
s,
|
|
1530
|
-
t.numberFormat,
|
|
1531
|
-
n.locale
|
|
1532
|
-
) : String(a);
|
|
1533
|
-
case "date":
|
|
1534
|
-
return tn(
|
|
1535
|
-
a,
|
|
1536
|
-
t.dateFormat,
|
|
1537
|
-
n.timezone,
|
|
1538
|
-
{
|
|
1539
|
-
browserTimezone: n.browserTimezone,
|
|
1540
|
-
isSqlCard: n.isSqlCard
|
|
1541
|
-
}
|
|
1542
|
-
);
|
|
1543
|
-
case "progress":
|
|
1544
|
-
return s !== void 0 ? `${a}%` : String(a);
|
|
1545
|
-
case "badge":
|
|
1546
|
-
case "link":
|
|
1547
|
-
case "text":
|
|
1548
|
-
case "none":
|
|
1549
|
-
default:
|
|
1550
|
-
return String(a);
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
function kn(e, t) {
|
|
1554
|
-
return t.visibleColumns.map((n) => {
|
|
1555
|
-
const r = e[n], a = t.columnSettings[n];
|
|
1556
|
-
return ce(r, a, {
|
|
1557
|
-
useFormattedValues: t.useFormattedValues,
|
|
1558
|
-
timezone: t.timezone,
|
|
1559
|
-
locale: t.locale
|
|
1560
|
-
});
|
|
1561
|
-
});
|
|
1562
|
-
}
|
|
1563
|
-
const nn = Object.freeze({ source: "automatic" });
|
|
1564
|
-
function rn(e, t) {
|
|
1565
|
-
var r, a;
|
|
1566
|
-
const n = e.preferences;
|
|
1567
|
-
switch (t) {
|
|
1568
|
-
case "tooltip":
|
|
1569
|
-
return (r = n == null ? void 0 : n.tooltipConfig) == null ? void 0 : r.valueFormat;
|
|
1570
|
-
case "dataLabel":
|
|
1571
|
-
case "pieLabel":
|
|
1572
|
-
return (a = n == null ? void 0 : n.dataLabelsConfig) == null ? void 0 : a.valueFormat;
|
|
1573
|
-
default:
|
|
1574
|
-
return;
|
|
1575
|
-
}
|
|
1576
|
-
}
|
|
1577
|
-
function J(e, t) {
|
|
1578
|
-
const n = e.config;
|
|
1579
|
-
if (n)
|
|
1580
|
-
return [
|
|
1581
|
-
...n.metricColumns ?? [],
|
|
1582
|
-
...n.groupByColumns ?? [],
|
|
1583
|
-
...n.detailColumns ?? [],
|
|
1584
|
-
...n.pivotByColumns ?? []
|
|
1585
|
-
].find((r) => r.id === t);
|
|
1586
|
-
}
|
|
1587
|
-
function an(e, t) {
|
|
1588
|
-
if (t.kind === "field") return J(e, t.fieldId);
|
|
1589
|
-
if (t.kind === "pivot") return J(e, t.metricId);
|
|
1590
|
-
}
|
|
1591
|
-
function sn(e, t, n) {
|
|
1592
|
-
var r, a, s, o, i, f, l, c, h;
|
|
1593
|
-
switch (t.kind) {
|
|
1594
|
-
case "field":
|
|
1595
|
-
case "pivot":
|
|
1596
|
-
return n != null && n.format && n.formatOrigin === "override" ? n.format : void 0;
|
|
1597
|
-
case "result":
|
|
1598
|
-
return (s = (a = (r = e.preferences) == null ? void 0 : r.sqlColumns) == null ? void 0 : a[t.key]) == null ? void 0 : s.format;
|
|
1599
|
-
case "sqlKpiValue":
|
|
1600
|
-
return (i = (o = e.preferences) == null ? void 0 : o.sqlKpiValue) == null ? void 0 : i.format;
|
|
1601
|
-
case "matrixMeasure":
|
|
1602
|
-
return (l = (f = e.config) == null ? void 0 : f.matrix) == null ? void 0 : l.presentation.measureFormats[t.measureId];
|
|
1603
|
-
case "matrixLevel":
|
|
1604
|
-
return (h = (c = e.config) == null ? void 0 : c.matrix) == null ? void 0 : h.presentation.levelFormats[t.levelId];
|
|
1605
|
-
}
|
|
1606
|
-
}
|
|
1607
|
-
function on(e) {
|
|
1608
|
-
if (!e) return;
|
|
1609
|
-
if (e.format && e.formatOrigin !== "override") return e.format;
|
|
1610
|
-
const t = e.semanticTemporalPresentation;
|
|
1611
|
-
return t && t.granularity === e.granularity ? t.format : void 0;
|
|
1612
|
-
}
|
|
1613
|
-
function q(e) {
|
|
1614
|
-
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" } : nn;
|
|
1615
|
-
}
|
|
1616
|
-
function un(e) {
|
|
1617
|
-
var o;
|
|
1618
|
-
const { card: t, column: n, surface: r } = e, a = an(t, n), s = n.kind === "field" ? n.fieldId : n.kind === "pivot" ? n.metricId : void 0;
|
|
1619
|
-
return q({
|
|
1620
|
-
surface: r ? rn(t, r) : void 0,
|
|
1621
|
-
override: sn(t, n, a),
|
|
1622
|
-
model: (s !== void 0 ? (o = e.modelFormats) == null ? void 0 : o[s] : void 0) ?? e.catalogFormat,
|
|
1623
|
-
snapshot: on(a)
|
|
1624
|
-
});
|
|
1625
|
-
}
|
|
1626
|
-
function cn(e, t) {
|
|
1627
|
-
const n = (r) => r && typeof r == "object" && !Array.isArray(r) ? Object.fromEntries(
|
|
1628
|
-
Object.keys(r).sort().map((a) => [a, n(r[a])])
|
|
1629
|
-
) : r;
|
|
1630
|
-
return JSON.stringify(n(e)) === JSON.stringify(n(t));
|
|
1631
|
-
}
|
|
1632
|
-
const fn = ["metricColumns", "groupByColumns", "detailColumns", "pivotByColumns"], K = /* @__PURE__ */ new WeakMap();
|
|
1633
|
-
function Sn(e, t) {
|
|
1634
|
-
const n = t == null ? void 0 : t.modelFormats;
|
|
1635
|
-
if (!e || !n || Object.keys(n).length === 0) return e;
|
|
1636
|
-
let r = K.get(e);
|
|
1637
|
-
if (r || K.set(e, r = /* @__PURE__ */ new WeakMap()), r.has(n)) return r.get(n);
|
|
1638
|
-
const a = ln(e, n);
|
|
1639
|
-
return r.set(n, a), a;
|
|
1640
|
-
}
|
|
1641
|
-
function ln(e, t) {
|
|
1642
|
-
const n = { config: e };
|
|
1643
|
-
let r;
|
|
1644
|
-
for (const a of fn) {
|
|
1645
|
-
const s = e[a];
|
|
1646
|
-
if (!(s != null && s.length)) continue;
|
|
1647
|
-
let o = !1;
|
|
1648
|
-
const i = s.map((f) => {
|
|
1649
|
-
const l = un({ card: n, column: { kind: "field", fieldId: f.id }, modelFormats: t });
|
|
1650
|
-
return l.source !== "model" || cn(l.format, f.format) ? f : (o = !0, { ...f, format: l.format });
|
|
1651
|
-
});
|
|
1652
|
-
o && ((r ?? (r = { ...e }))[a] = i);
|
|
1653
|
-
}
|
|
1654
|
-
return r ?? e;
|
|
1655
|
-
}
|
|
1656
|
-
function mn(e, t) {
|
|
1657
|
-
var a;
|
|
1658
|
-
const n = e[e.length - 1];
|
|
1659
|
-
if (!n) return "";
|
|
1660
|
-
if (n.member.kind === "others") return "Others";
|
|
1661
|
-
const r = n.member.value;
|
|
1662
|
-
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));
|
|
1663
|
-
}
|
|
1664
|
-
function dn(e, t, n) {
|
|
1665
|
-
return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? (n == null ? void 0 : n.split(he).join(t)) ?? `${t} Total` : t;
|
|
1666
|
-
}
|
|
1667
|
-
function Wn(e, t, n, r) {
|
|
1668
|
-
var o;
|
|
1669
|
-
const a = e[e.length - 1], s = t === "grand_total" ? n.grand.label : a ? (o = n.levels[a.levelId]) == null ? void 0 : o.label : void 0;
|
|
1670
|
-
return dn(t, mn(e, r), s);
|
|
1671
|
-
}
|
|
1672
|
-
function Cn(e, t, n) {
|
|
1673
|
-
return e.kind === "value" ? (t == null ? void 0 : t(e.value)) ?? "" : e.kind === "null" ? n.nullText : n.emptyText;
|
|
1674
|
-
}
|
|
1675
|
-
function Nn(e) {
|
|
1676
|
-
const { path: t, previousPath: n, role: r, repeatLabels: a, levelCount: s } = e;
|
|
1677
|
-
return Array.from({ length: s }, (o, i) => {
|
|
1678
|
-
const f = t.slice(0, i + 1), l = r === "grand_total" ? i === 0 : r === "subtotal" && i === t.length - 1, c = n && n.length > i && j(n.slice(0, i + 1)) === j(f);
|
|
1679
|
-
return {
|
|
1680
|
-
path: f,
|
|
1681
|
-
total: l,
|
|
1682
|
-
visible: l || t.length > i && (a || !c || i === t.length - 1)
|
|
1683
|
-
};
|
|
1684
|
-
});
|
|
1685
|
-
}
|
|
1686
|
-
function hn(e, t) {
|
|
1687
|
-
return be(q({ override: e, model: t }).format, {
|
|
1688
|
-
preserveOmittedProperties: !0,
|
|
1689
|
-
numericInput: "canonical"
|
|
1690
|
-
});
|
|
1691
|
-
}
|
|
1692
|
-
function Yn(e, t, n) {
|
|
1693
|
-
const r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), s = (o, i) => {
|
|
1694
|
-
const f = (i === "levels" ? t.levelFormats : t.measureFormats)[o.id], l = o.semanticFormat, c = hn(f, l);
|
|
1695
|
-
i === "measures" && r.set(o.id, {
|
|
1696
|
-
isNumeric: de(o.column.dataType) === "number",
|
|
1697
|
-
// Use normalized affixes: a redundant percent suffix is already removed.
|
|
1698
|
-
hasTextAffixes: !!c && !!("prefix" in c && c.prefix || "suffix" in c && c.suffix)
|
|
1699
|
-
});
|
|
1700
|
-
const h = (u) => ce(u, void 0, {
|
|
1701
|
-
useFormattedValues: !0,
|
|
1702
|
-
timezone: n.calendar.tz,
|
|
1703
|
-
locale: n.valueFormat.locale,
|
|
1704
|
-
absence: t.absence
|
|
1705
|
-
});
|
|
1706
|
-
if (o.column.temporalBucket) {
|
|
1707
|
-
const u = o.column.temporalBucket, g = Me({
|
|
1708
|
-
metadata: u,
|
|
1709
|
-
cardFormat: (f == null ? void 0 : f.type) === "temporal_bucket" ? f : void 0,
|
|
1710
|
-
semanticFormat: (l == null ? void 0 : l.type) === "temporal_bucket" ? { granularity: u.granularity, format: l } : void 0,
|
|
1711
|
-
locale: n.valueFormat.locale,
|
|
1712
|
-
styles: { dateStyle: n.valueFormat.dateStyle, dateTime: n.valueFormat.dateTime }
|
|
1713
|
-
});
|
|
1714
|
-
return (w) => typeof w == "string" ? re({ value: w, metadata: u, format: g.format }) : h(w);
|
|
1715
|
-
}
|
|
1716
|
-
if (o.column.rawTemporal) {
|
|
1717
|
-
const u = q({ override: f, model: l }).format, g = ve({
|
|
1718
|
-
metadata: o.column.rawTemporal,
|
|
1719
|
-
format: Oe({
|
|
1720
|
-
format: (u == null ? void 0 : u.type) === "date" ? {
|
|
1721
|
-
type: "raw_temporal",
|
|
1722
|
-
timezone: u.timezone,
|
|
1723
|
-
sourceTimezone: u.sourceTimezone,
|
|
1724
|
-
presentation: Te(u)
|
|
1725
|
-
} : void 0,
|
|
1726
|
-
preferences: n.valueFormat,
|
|
1727
|
-
calendar: n.calendar
|
|
1728
|
-
})
|
|
1729
|
-
});
|
|
1730
|
-
return (w) => {
|
|
1731
|
-
if (typeof w != "string") return h(w);
|
|
1732
|
-
const M = g(w);
|
|
1733
|
-
return M.ok ? M.text : h(w);
|
|
1734
|
-
};
|
|
1735
|
-
}
|
|
1736
|
-
if (xe(c)) {
|
|
1737
|
-
const u = De(c, n.valueFormat);
|
|
1738
|
-
return i === "measures" && a.set(o.id, u), (g) => typeof g == "number" || typeof g == "object" && g !== null ? Pe(g, u) : h(g);
|
|
1739
|
-
}
|
|
1740
|
-
return (c == null ? void 0 : c.type) === "duration" && i === "measures" && a.set(o.id, c), (c == null ? void 0 : c.type) === "duration" ? (u) => typeof u == "number" || typeof u == "string" || typeof u == "object" && u !== null ? pe(
|
|
1741
|
-
typeof u == "object" ? u.value : u,
|
|
1742
|
-
c
|
|
1743
|
-
) : h(u) : (c == null ? void 0 : c.type) === "string" ? (u) => u === null ? h(u) : `${c.prefix ?? ""}${h(u)}${c.suffix ?? ""}` : h;
|
|
1744
|
-
};
|
|
1745
|
-
return {
|
|
1746
|
-
levels: new Map(
|
|
1747
|
-
e.levels.map((o) => [o.id, s(o, "levels")])
|
|
1748
|
-
),
|
|
1749
|
-
measures: new Map(
|
|
1750
|
-
e.measures.map((o) => [o.id, s(o, "measures")])
|
|
1751
|
-
),
|
|
1752
|
-
measureSemantics: r,
|
|
1753
|
-
measureFormats: a,
|
|
1754
|
-
absence: t.absence
|
|
1755
|
-
};
|
|
1756
|
-
}
|
|
1757
|
-
class gn extends Error {
|
|
1758
|
-
constructor(n, r) {
|
|
1759
|
-
super(`${n}: ${r}`);
|
|
1760
|
-
z(this, "deliveryBlocking", !0);
|
|
1761
|
-
this.code = n, this.name = "PivotHeaderPresentationError";
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
function En(e) {
|
|
1765
|
-
var a;
|
|
1766
|
-
const t = e.mode ?? "formatted", n = e.members.map((s) => {
|
|
1767
|
-
var i;
|
|
1768
|
-
if (t === "canonical" || !s.temporalBucket)
|
|
1769
|
-
return s.value === null ? "" : String(s.value);
|
|
1770
|
-
const o = (i = e.resolveTemporalFormat) == null ? void 0 : i.call(e, s.fieldId);
|
|
1771
|
-
if (!o)
|
|
1772
|
-
throw new gn(
|
|
1773
|
-
"missing_resolved_temporal_format",
|
|
1774
|
-
`Missing resolved temporal presentation for pivot field "${s.fieldId}"`
|
|
1775
|
-
);
|
|
1776
|
-
return re({
|
|
1777
|
-
value: s.value,
|
|
1778
|
-
metadata: s.temporalBucket,
|
|
1779
|
-
format: o
|
|
1780
|
-
});
|
|
1781
|
-
}), r = ((a = e.metricLabel) == null ? void 0 : a.trim()) || void 0;
|
|
1782
|
-
return {
|
|
1783
|
-
memberLabels: n,
|
|
1784
|
-
...r ? { metricLabel: r } : {},
|
|
1785
|
-
flattenedLabel: [
|
|
1786
|
-
...n,
|
|
1787
|
-
...r ? [r] : []
|
|
1788
|
-
].join(" / ")
|
|
1789
|
-
};
|
|
1790
|
-
}
|
|
1791
|
-
function Fn(e) {
|
|
1792
|
-
const t = /* @__PURE__ */ new Map();
|
|
1793
|
-
return e.forEach((n) => {
|
|
1794
|
-
n.id && t.set(n.id, (t.get(n.id) ?? 0) + 1);
|
|
1795
|
-
}), e.flatMap(
|
|
1796
|
-
(n) => n.id && (t.get(n.id) ?? 0) > 1 ? [ke(n)] : []
|
|
1797
|
-
);
|
|
1798
|
-
}
|
|
1799
|
-
export {
|
|
1800
|
-
Le as A,
|
|
1801
|
-
Y as B,
|
|
1802
|
-
Ne as C,
|
|
1803
|
-
hn as D,
|
|
1804
|
-
dn as E,
|
|
1805
|
-
gn as P,
|
|
1806
|
-
en as a,
|
|
1807
|
-
xn as b,
|
|
1808
|
-
Pn as c,
|
|
1809
|
-
pn as d,
|
|
1810
|
-
_ as e,
|
|
1811
|
-
Kt as f,
|
|
1812
|
-
Dn as g,
|
|
1813
|
-
ce as h,
|
|
1814
|
-
kn as i,
|
|
1815
|
-
Yn as j,
|
|
1816
|
-
En as k,
|
|
1817
|
-
Fn as l,
|
|
1818
|
-
mn as m,
|
|
1819
|
-
Wn as n,
|
|
1820
|
-
Nn as o,
|
|
1821
|
-
q as p,
|
|
1822
|
-
Cn as q,
|
|
1823
|
-
un as r,
|
|
1824
|
-
ue as s,
|
|
1825
|
-
I as t,
|
|
1826
|
-
At as u,
|
|
1827
|
-
P as v,
|
|
1828
|
-
Sn as w,
|
|
1829
|
-
se as x,
|
|
1830
|
-
C as y,
|
|
1831
|
-
d as z
|
|
1832
|
-
};
|