@purpurds/date-field 0.0.1
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/LICENSE.txt +74 -0
- package/dist/date-field.cjs.js +42 -0
- package/dist/date-field.cjs.js.map +1 -0
- package/dist/date-field.d.ts +12 -0
- package/dist/date-field.d.ts.map +1 -0
- package/dist/date-field.es.js +3882 -0
- package/dist/date-field.es.js.map +1 -0
- package/dist/metadata.js +7 -0
- package/dist/styles.css +1 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -0
- package/eslint.config.mjs +2 -0
- package/package.json +76 -0
- package/src/date-field.module.scss +18 -0
- package/src/date-field.stories.tsx +71 -0
- package/src/date-field.test.tsx +63 -0
- package/src/date-field.tsx +138 -0
- package/src/global.d.ts +4 -0
- package/src/utils.ts +30 -0
|
@@ -0,0 +1,3882 @@
|
|
|
1
|
+
var vt = Object.defineProperty;
|
|
2
|
+
var Pt = (t, n, e) => n in t ? vt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
|
+
var u = (t, n, e) => Pt(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { jsxs as j, jsx as p, Fragment as Ot } from "react/jsx-runtime";
|
|
5
|
+
import * as N from "react";
|
|
6
|
+
import { forwardRef as pe, useId as Mt, useRef as Ue, useState as _e, useEffect as kt, useLayoutEffect as Dt } from "react";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
const Tt = {
|
|
9
|
+
LG: "lg"
|
|
10
|
+
};
|
|
11
|
+
function qt(t) {
|
|
12
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
13
|
+
}
|
|
14
|
+
var ge = { exports: {} };
|
|
15
|
+
/*!
|
|
16
|
+
Copyright (c) 2018 Jed Watson.
|
|
17
|
+
Licensed under the MIT License (MIT), see
|
|
18
|
+
http://jedwatson.github.io/classnames
|
|
19
|
+
*/
|
|
20
|
+
var be;
|
|
21
|
+
function Nt() {
|
|
22
|
+
return be || (be = 1, function(t) {
|
|
23
|
+
(function() {
|
|
24
|
+
var n = {}.hasOwnProperty;
|
|
25
|
+
function e() {
|
|
26
|
+
for (var i = "", s = 0; s < arguments.length; s++) {
|
|
27
|
+
var o = arguments[s];
|
|
28
|
+
o && (i = a(i, r.call(this, o)));
|
|
29
|
+
}
|
|
30
|
+
return i;
|
|
31
|
+
}
|
|
32
|
+
function r(i) {
|
|
33
|
+
if (typeof i == "string" || typeof i == "number")
|
|
34
|
+
return this && this[i] || i;
|
|
35
|
+
if (typeof i != "object")
|
|
36
|
+
return "";
|
|
37
|
+
if (Array.isArray(i))
|
|
38
|
+
return e.apply(this, i);
|
|
39
|
+
if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
|
|
40
|
+
return i.toString();
|
|
41
|
+
var s = "";
|
|
42
|
+
for (var o in i)
|
|
43
|
+
n.call(i, o) && i[o] && (s = a(s, this && this[o] || o));
|
|
44
|
+
return s;
|
|
45
|
+
}
|
|
46
|
+
function a(i, s) {
|
|
47
|
+
return s ? i ? i + " " + s : i + s : i;
|
|
48
|
+
}
|
|
49
|
+
t.exports ? (e.default = e, t.exports = e) : window.classNames = e;
|
|
50
|
+
})();
|
|
51
|
+
}(ge)), ge.exports;
|
|
52
|
+
}
|
|
53
|
+
var Yt = Nt();
|
|
54
|
+
const Et = /* @__PURE__ */ qt(Yt), Wt = "_rotate_12t9p_1", $t = "_dash_12t9p_1", Ht = {
|
|
55
|
+
"purpur-spinner": "_purpur-spinner_12t9p_2",
|
|
56
|
+
rotate: Wt,
|
|
57
|
+
"purpur-spinner--xxs": "_purpur-spinner--xxs_12t9p_6",
|
|
58
|
+
"purpur-spinner--xs": "_purpur-spinner--xs_12t9p_10",
|
|
59
|
+
"purpur-spinner--sm": "_purpur-spinner--sm_12t9p_14",
|
|
60
|
+
"purpur-spinner--md": "_purpur-spinner--md_12t9p_18",
|
|
61
|
+
"purpur-spinner--lg": "_purpur-spinner--lg_12t9p_22",
|
|
62
|
+
"purpur-spinner__circle": "_purpur-spinner__circle_12t9p_26",
|
|
63
|
+
dash: $t,
|
|
64
|
+
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_12t9p_41",
|
|
65
|
+
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_12t9p_44"
|
|
66
|
+
}, xe = Et.bind(Ht), z = "purpur-spinner", Ct = {
|
|
67
|
+
SM: "sm"
|
|
68
|
+
}, Lt = ({
|
|
69
|
+
disabled: t = !1,
|
|
70
|
+
negative: n = !1,
|
|
71
|
+
size: e = Ct.SM,
|
|
72
|
+
...r
|
|
73
|
+
}) => /* @__PURE__ */ p("div", { className: xe(z, `${z}--${e}`), ...r, children: /* @__PURE__ */ p("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ p(
|
|
74
|
+
"circle",
|
|
75
|
+
{
|
|
76
|
+
className: xe(`${z}__circle`, {
|
|
77
|
+
[`${z}__circle--disabled`]: t,
|
|
78
|
+
[`${z}__circle--negative`]: n
|
|
79
|
+
}),
|
|
80
|
+
cx: "25",
|
|
81
|
+
cy: "25",
|
|
82
|
+
r: "20"
|
|
83
|
+
}
|
|
84
|
+
) }) });
|
|
85
|
+
function Ft(t) {
|
|
86
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
87
|
+
}
|
|
88
|
+
var ve = { exports: {} };
|
|
89
|
+
/*!
|
|
90
|
+
Copyright (c) 2018 Jed Watson.
|
|
91
|
+
Licensed under the MIT License (MIT), see
|
|
92
|
+
http://jedwatson.github.io/classnames
|
|
93
|
+
*/
|
|
94
|
+
var Pe;
|
|
95
|
+
function It() {
|
|
96
|
+
return Pe || (Pe = 1, function(t) {
|
|
97
|
+
(function() {
|
|
98
|
+
var n = {}.hasOwnProperty;
|
|
99
|
+
function e() {
|
|
100
|
+
for (var i = "", s = 0; s < arguments.length; s++) {
|
|
101
|
+
var o = arguments[s];
|
|
102
|
+
o && (i = a(i, r.call(this, o)));
|
|
103
|
+
}
|
|
104
|
+
return i;
|
|
105
|
+
}
|
|
106
|
+
function r(i) {
|
|
107
|
+
if (typeof i == "string" || typeof i == "number")
|
|
108
|
+
return this && this[i] || i;
|
|
109
|
+
if (typeof i != "object")
|
|
110
|
+
return "";
|
|
111
|
+
if (Array.isArray(i))
|
|
112
|
+
return e.apply(this, i);
|
|
113
|
+
if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
|
|
114
|
+
return i.toString();
|
|
115
|
+
var s = "";
|
|
116
|
+
for (var o in i)
|
|
117
|
+
n.call(i, o) && i[o] && (s = a(s, this && this[o] || o));
|
|
118
|
+
return s;
|
|
119
|
+
}
|
|
120
|
+
function a(i, s) {
|
|
121
|
+
return s ? i ? i + " " + s : i + s : i;
|
|
122
|
+
}
|
|
123
|
+
t.exports ? (e.default = e, t.exports = e) : window.classNames = e;
|
|
124
|
+
})();
|
|
125
|
+
}(ve)), ve.exports;
|
|
126
|
+
}
|
|
127
|
+
var jt = It();
|
|
128
|
+
const Rt = /* @__PURE__ */ Ft(jt), At = {
|
|
129
|
+
"purpur-button": "_purpur-button_w455q_1",
|
|
130
|
+
"purpur-button--xs": "_purpur-button--xs_w455q_33",
|
|
131
|
+
"purpur-button--icon-only": "_purpur-button--icon-only_w455q_36",
|
|
132
|
+
"purpur-button--sm": "_purpur-button--sm_w455q_39",
|
|
133
|
+
"purpur-button--md": "_purpur-button--md_w455q_45",
|
|
134
|
+
"purpur-button--lg": "_purpur-button--lg_w455q_51",
|
|
135
|
+
"purpur-button--full-width": "_purpur-button--full-width_w455q_57",
|
|
136
|
+
"purpur-button--primary": "_purpur-button--primary_w455q_60",
|
|
137
|
+
"purpur-button--disabled": "_purpur-button--disabled_w455q_64",
|
|
138
|
+
"purpur-button--primary-negative": "_purpur-button--primary-negative_w455q_70",
|
|
139
|
+
"purpur-button--secondary": "_purpur-button--secondary_w455q_82",
|
|
140
|
+
"purpur-button--secondary-negative": "_purpur-button--secondary-negative_w455q_93",
|
|
141
|
+
"purpur-button--expressive": "_purpur-button--expressive_w455q_104",
|
|
142
|
+
"purpur-button--expressive-negative": "_purpur-button--expressive-negative_w455q_114",
|
|
143
|
+
"purpur-button--negative": "_purpur-button--negative_w455q_126",
|
|
144
|
+
"purpur-button--destructive": "_purpur-button--destructive_w455q_133",
|
|
145
|
+
"purpur-button--destructive-negative": "_purpur-button--destructive-negative_w455q_143",
|
|
146
|
+
"purpur-button--tertiary-purple": "_purpur-button--tertiary-purple_w455q_153",
|
|
147
|
+
"purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_w455q_166",
|
|
148
|
+
"purpur-button--text-negative": "_purpur-button--text-negative_w455q_181",
|
|
149
|
+
"purpur-button--text": "_purpur-button--text_w455q_181"
|
|
150
|
+
}, Qt = Rt.bind(At), A = "purpur-button", et = pe(
|
|
151
|
+
({
|
|
152
|
+
children: t,
|
|
153
|
+
className: n,
|
|
154
|
+
disabled: e = !1,
|
|
155
|
+
fullWidth: r = !1,
|
|
156
|
+
iconOnly: a,
|
|
157
|
+
loading: i = !1,
|
|
158
|
+
negative: s = !1,
|
|
159
|
+
onClick: o,
|
|
160
|
+
size: c = "md",
|
|
161
|
+
variant: h,
|
|
162
|
+
type: y = "button",
|
|
163
|
+
...b
|
|
164
|
+
}, k) => {
|
|
165
|
+
if (a && h === "destructive")
|
|
166
|
+
return null;
|
|
167
|
+
const T = Qt(
|
|
168
|
+
[
|
|
169
|
+
A,
|
|
170
|
+
`${A}--${s ? `${h}-negative` : h}`,
|
|
171
|
+
`${A}--${c}`
|
|
172
|
+
],
|
|
173
|
+
{
|
|
174
|
+
[`${A}--icon-only`]: a,
|
|
175
|
+
[`${A}--negative`]: s,
|
|
176
|
+
[`${A}--full-width`]: r,
|
|
177
|
+
[`${A}--disabled`]: e || i
|
|
178
|
+
},
|
|
179
|
+
n
|
|
180
|
+
), l = (_) => {
|
|
181
|
+
e || i ? _.preventDefault() : o && o(_);
|
|
182
|
+
}, d = !!b["aria-disabled"] || e || i;
|
|
183
|
+
return /* @__PURE__ */ j(
|
|
184
|
+
"button",
|
|
185
|
+
{
|
|
186
|
+
className: T,
|
|
187
|
+
type: y,
|
|
188
|
+
ref: k,
|
|
189
|
+
"aria-disabled": d,
|
|
190
|
+
onClick: l,
|
|
191
|
+
...b,
|
|
192
|
+
children: [
|
|
193
|
+
i && /* @__PURE__ */ p(
|
|
194
|
+
Lt,
|
|
195
|
+
{
|
|
196
|
+
size: c === Tt.LG ? "xs" : "xxs",
|
|
197
|
+
negative: s,
|
|
198
|
+
disabled: d
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
" ",
|
|
202
|
+
t
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
et.displayName = "Button";
|
|
209
|
+
function Bt(t) {
|
|
210
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
211
|
+
}
|
|
212
|
+
var Oe = { exports: {} };
|
|
213
|
+
/*!
|
|
214
|
+
Copyright (c) 2018 Jed Watson.
|
|
215
|
+
Licensed under the MIT License (MIT), see
|
|
216
|
+
http://jedwatson.github.io/classnames
|
|
217
|
+
*/
|
|
218
|
+
var Me;
|
|
219
|
+
function St() {
|
|
220
|
+
return Me || (Me = 1, function(t) {
|
|
221
|
+
(function() {
|
|
222
|
+
var n = {}.hasOwnProperty;
|
|
223
|
+
function e() {
|
|
224
|
+
for (var i = "", s = 0; s < arguments.length; s++) {
|
|
225
|
+
var o = arguments[s];
|
|
226
|
+
o && (i = a(i, r.call(this, o)));
|
|
227
|
+
}
|
|
228
|
+
return i;
|
|
229
|
+
}
|
|
230
|
+
function r(i) {
|
|
231
|
+
if (typeof i == "string" || typeof i == "number")
|
|
232
|
+
return this && this[i] || i;
|
|
233
|
+
if (typeof i != "object")
|
|
234
|
+
return "";
|
|
235
|
+
if (Array.isArray(i))
|
|
236
|
+
return e.apply(this, i);
|
|
237
|
+
if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
|
|
238
|
+
return i.toString();
|
|
239
|
+
var s = "";
|
|
240
|
+
for (var o in i)
|
|
241
|
+
n.call(i, o) && i[o] && (s = a(s, this && this[o] || o));
|
|
242
|
+
return s;
|
|
243
|
+
}
|
|
244
|
+
function a(i, s) {
|
|
245
|
+
return s ? i ? i + " " + s : i + s : i;
|
|
246
|
+
}
|
|
247
|
+
t.exports ? (e.default = e, t.exports = e) : window.classNames = e;
|
|
248
|
+
})();
|
|
249
|
+
}(Oe)), Oe.exports;
|
|
250
|
+
}
|
|
251
|
+
var Xt = St();
|
|
252
|
+
const Gt = /* @__PURE__ */ Bt(Xt), Vt = {
|
|
253
|
+
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
254
|
+
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
255
|
+
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
256
|
+
"purpur-icon--sm": "_purpur-icon--sm_8u1lq_12",
|
|
257
|
+
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
258
|
+
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
259
|
+
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
260
|
+
}, zt = Gt.bind(Vt), ke = "purpur-icon", Zt = "md", Jt = (t) => t.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Kt = ({ content: t = "", title: n } = {}) => {
|
|
261
|
+
const e = [
|
|
262
|
+
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
263
|
+
{ name: "fill", value: "currentColor" },
|
|
264
|
+
{ name: "viewBox", value: "0 0 24 24" },
|
|
265
|
+
n ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
266
|
+
], r = n ? `<title>${n}</title>` : "";
|
|
267
|
+
return `<svg ${Jt(e)}>${r}${t}</svg>`;
|
|
268
|
+
}, Ut = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), tt = ({ svg: t, allyTitle: n, className: e, size: r = Zt, ...a }) => {
|
|
269
|
+
const i = Kt({
|
|
270
|
+
content: Ut(t.svg),
|
|
271
|
+
title: n
|
|
272
|
+
}), s = zt(e, ke, `${ke}--${r}`);
|
|
273
|
+
return /* @__PURE__ */ p("span", { className: s, dangerouslySetInnerHTML: { __html: i }, ...a });
|
|
274
|
+
};
|
|
275
|
+
tt.displayName = "Icon";
|
|
276
|
+
const er = {
|
|
277
|
+
name: "error-filled",
|
|
278
|
+
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 24" fill="currentColor"><path fill-rule="evenodd" d="M14.268 3.5c-.77-1.333-2.694-1.333-3.464 0l-8.66 15c-.77 1.333.192 3 1.732 3h17.32c1.54 0 2.502-1.667 1.733-3l-8.66-15Zm-.694 5.067-.247 6.876h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.917c0 .649-.585 1.234-1.25 1.234-.648 0-1.25-.585-1.25-1.234 0-.633.602-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z" clip-rule="evenodd"/></svg>',
|
|
279
|
+
keywords: ["error-filled"],
|
|
280
|
+
category: "status"
|
|
281
|
+
};
|
|
282
|
+
function tr(t) {
|
|
283
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
284
|
+
}
|
|
285
|
+
var De = { exports: {} };
|
|
286
|
+
/*!
|
|
287
|
+
Copyright (c) 2018 Jed Watson.
|
|
288
|
+
Licensed under the MIT License (MIT), see
|
|
289
|
+
http://jedwatson.github.io/classnames
|
|
290
|
+
*/
|
|
291
|
+
var Te;
|
|
292
|
+
function rr() {
|
|
293
|
+
return Te || (Te = 1, function(t) {
|
|
294
|
+
(function() {
|
|
295
|
+
var n = {}.hasOwnProperty;
|
|
296
|
+
function e() {
|
|
297
|
+
for (var i = "", s = 0; s < arguments.length; s++) {
|
|
298
|
+
var o = arguments[s];
|
|
299
|
+
o && (i = a(i, r.call(this, o)));
|
|
300
|
+
}
|
|
301
|
+
return i;
|
|
302
|
+
}
|
|
303
|
+
function r(i) {
|
|
304
|
+
if (typeof i == "string" || typeof i == "number")
|
|
305
|
+
return this && this[i] || i;
|
|
306
|
+
if (typeof i != "object")
|
|
307
|
+
return "";
|
|
308
|
+
if (Array.isArray(i))
|
|
309
|
+
return e.apply(this, i);
|
|
310
|
+
if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
|
|
311
|
+
return i.toString();
|
|
312
|
+
var s = "";
|
|
313
|
+
for (var o in i)
|
|
314
|
+
n.call(i, o) && i[o] && (s = a(s, this && this[o] || o));
|
|
315
|
+
return s;
|
|
316
|
+
}
|
|
317
|
+
function a(i, s) {
|
|
318
|
+
return s ? i ? i + " " + s : i + s : i;
|
|
319
|
+
}
|
|
320
|
+
t.exports ? (e.default = e, t.exports = e) : window.classNames = e;
|
|
321
|
+
})();
|
|
322
|
+
}(De)), De.exports;
|
|
323
|
+
}
|
|
324
|
+
var nr = rr();
|
|
325
|
+
const ar = /* @__PURE__ */ tr(nr), ir = {
|
|
326
|
+
"purpur-field-error-text": "_purpur-field-error-text_1lj7e_1",
|
|
327
|
+
"purpur-field-error-text__icon": "_purpur-field-error-text__icon_1lj7e_11"
|
|
328
|
+
}, qe = ar.bind(ir), Ne = "purpur-field-error-text", sr = ({
|
|
329
|
+
children: t,
|
|
330
|
+
className: n,
|
|
331
|
+
["aria-relevant"]: e = "additions text",
|
|
332
|
+
...r
|
|
333
|
+
}) => /* @__PURE__ */ j(
|
|
334
|
+
"div",
|
|
335
|
+
{
|
|
336
|
+
className: qe(n, Ne),
|
|
337
|
+
"aria-live": "assertive",
|
|
338
|
+
"aria-relevant": e,
|
|
339
|
+
...r,
|
|
340
|
+
children: [
|
|
341
|
+
/* @__PURE__ */ p(tt, { svg: er, size: "xs", className: qe(`${Ne}__icon`) }),
|
|
342
|
+
t
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
);
|
|
346
|
+
function or(t) {
|
|
347
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
348
|
+
}
|
|
349
|
+
var Ye = { exports: {} };
|
|
350
|
+
/*!
|
|
351
|
+
Copyright (c) 2018 Jed Watson.
|
|
352
|
+
Licensed under the MIT License (MIT), see
|
|
353
|
+
http://jedwatson.github.io/classnames
|
|
354
|
+
*/
|
|
355
|
+
var Ee;
|
|
356
|
+
function ur() {
|
|
357
|
+
return Ee || (Ee = 1, function(t) {
|
|
358
|
+
(function() {
|
|
359
|
+
var n = {}.hasOwnProperty;
|
|
360
|
+
function e() {
|
|
361
|
+
for (var i = "", s = 0; s < arguments.length; s++) {
|
|
362
|
+
var o = arguments[s];
|
|
363
|
+
o && (i = a(i, r.call(this, o)));
|
|
364
|
+
}
|
|
365
|
+
return i;
|
|
366
|
+
}
|
|
367
|
+
function r(i) {
|
|
368
|
+
if (typeof i == "string" || typeof i == "number")
|
|
369
|
+
return this && this[i] || i;
|
|
370
|
+
if (typeof i != "object")
|
|
371
|
+
return "";
|
|
372
|
+
if (Array.isArray(i))
|
|
373
|
+
return e.apply(this, i);
|
|
374
|
+
if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
|
|
375
|
+
return i.toString();
|
|
376
|
+
var s = "";
|
|
377
|
+
for (var o in i)
|
|
378
|
+
n.call(i, o) && i[o] && (s = a(s, this && this[o] || o));
|
|
379
|
+
return s;
|
|
380
|
+
}
|
|
381
|
+
function a(i, s) {
|
|
382
|
+
return s ? i ? i + " " + s : i + s : i;
|
|
383
|
+
}
|
|
384
|
+
t.exports ? (e.default = e, t.exports = e) : window.classNames = e;
|
|
385
|
+
})();
|
|
386
|
+
}(Ye)), Ye.exports;
|
|
387
|
+
}
|
|
388
|
+
var cr = ur();
|
|
389
|
+
const lr = /* @__PURE__ */ or(cr), dr = {
|
|
390
|
+
"purpur-field-helper-text": "_purpur-field-helper-text_atw6b_1",
|
|
391
|
+
"purpur-field-helper-text--disabled": "_purpur-field-helper-text--disabled_atw6b_9"
|
|
392
|
+
}, fr = lr.bind(dr), We = "purpur-field-helper-text", pr = ({
|
|
393
|
+
children: t,
|
|
394
|
+
className: n,
|
|
395
|
+
disabled: e,
|
|
396
|
+
id: r,
|
|
397
|
+
...a
|
|
398
|
+
}) => {
|
|
399
|
+
const i = fr(n, We, {
|
|
400
|
+
[`${We}--disabled`]: e
|
|
401
|
+
});
|
|
402
|
+
return /* @__PURE__ */ p("span", { id: r, className: i, ...a, children: t });
|
|
403
|
+
};
|
|
404
|
+
function hr(t) {
|
|
405
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
406
|
+
}
|
|
407
|
+
var $e = { exports: {} };
|
|
408
|
+
/*!
|
|
409
|
+
Copyright (c) 2018 Jed Watson.
|
|
410
|
+
Licensed under the MIT License (MIT), see
|
|
411
|
+
http://jedwatson.github.io/classnames
|
|
412
|
+
*/
|
|
413
|
+
var He;
|
|
414
|
+
function mr() {
|
|
415
|
+
return He || (He = 1, function(t) {
|
|
416
|
+
(function() {
|
|
417
|
+
var n = {}.hasOwnProperty;
|
|
418
|
+
function e() {
|
|
419
|
+
for (var i = "", s = 0; s < arguments.length; s++) {
|
|
420
|
+
var o = arguments[s];
|
|
421
|
+
o && (i = a(i, r.call(this, o)));
|
|
422
|
+
}
|
|
423
|
+
return i;
|
|
424
|
+
}
|
|
425
|
+
function r(i) {
|
|
426
|
+
if (typeof i == "string" || typeof i == "number")
|
|
427
|
+
return this && this[i] || i;
|
|
428
|
+
if (typeof i != "object")
|
|
429
|
+
return "";
|
|
430
|
+
if (Array.isArray(i))
|
|
431
|
+
return e.apply(this, i);
|
|
432
|
+
if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
|
|
433
|
+
return i.toString();
|
|
434
|
+
var s = "";
|
|
435
|
+
for (var o in i)
|
|
436
|
+
n.call(i, o) && i[o] && (s = a(s, this && this[o] || o));
|
|
437
|
+
return s;
|
|
438
|
+
}
|
|
439
|
+
function a(i, s) {
|
|
440
|
+
return s ? i ? i + " " + s : i + s : i;
|
|
441
|
+
}
|
|
442
|
+
t.exports ? (e.default = e, t.exports = e) : window.classNames = e;
|
|
443
|
+
})();
|
|
444
|
+
}($e)), $e.exports;
|
|
445
|
+
}
|
|
446
|
+
var wr = mr();
|
|
447
|
+
const yr = /* @__PURE__ */ hr(wr), _r = {
|
|
448
|
+
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
449
|
+
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
450
|
+
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
451
|
+
"purpur-icon--sm": "_purpur-icon--sm_8u1lq_12",
|
|
452
|
+
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
453
|
+
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
454
|
+
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
455
|
+
}, gr = yr.bind(_r), Ce = "purpur-icon", br = "md", xr = (t) => t.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), vr = ({ content: t = "", title: n } = {}) => {
|
|
456
|
+
const e = [
|
|
457
|
+
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
458
|
+
{ name: "fill", value: "currentColor" },
|
|
459
|
+
{ name: "viewBox", value: "0 0 24 24" },
|
|
460
|
+
n ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
461
|
+
], r = n ? `<title>${n}</title>` : "";
|
|
462
|
+
return `<svg ${xr(e)}>${r}${t}</svg>`;
|
|
463
|
+
}, Pr = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), he = ({ svg: t, allyTitle: n, className: e, size: r = br, ...a }) => {
|
|
464
|
+
const i = vr({
|
|
465
|
+
content: Pr(t.svg),
|
|
466
|
+
title: n
|
|
467
|
+
}), s = gr(e, Ce, `${Ce}--${r}`);
|
|
468
|
+
return /* @__PURE__ */ p("span", { className: s, dangerouslySetInnerHTML: { __html: i }, ...a });
|
|
469
|
+
};
|
|
470
|
+
he.displayName = "Icon";
|
|
471
|
+
const Or = {
|
|
472
|
+
name: "check-circle-filled",
|
|
473
|
+
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm4.712-12.491a.875.875 0 1 0-1.424-1.018l-4.4 6.16-2.27-2.27a.875.875 0 0 0-1.237 1.238l3 3a.875.875 0 0 0 1.331-.11l5-7Z" clip-rule="evenodd"/></svg>',
|
|
474
|
+
keywords: ["check-circle-filled"],
|
|
475
|
+
category: "status"
|
|
476
|
+
}, rt = (t) => /* @__PURE__ */ p(he, { ...t, svg: Or });
|
|
477
|
+
rt.displayName = "IconCheckCircleFilled";
|
|
478
|
+
const Mr = {
|
|
479
|
+
name: "close",
|
|
480
|
+
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',
|
|
481
|
+
keywords: ["close"],
|
|
482
|
+
category: "utility"
|
|
483
|
+
}, nt = (t) => /* @__PURE__ */ p(he, { ...t, svg: Mr });
|
|
484
|
+
nt.displayName = "IconClose";
|
|
485
|
+
function Le(t, n) {
|
|
486
|
+
if (typeof t == "function")
|
|
487
|
+
return t(n);
|
|
488
|
+
t != null && (t.current = n);
|
|
489
|
+
}
|
|
490
|
+
function kr(...t) {
|
|
491
|
+
return (n) => {
|
|
492
|
+
let e = !1;
|
|
493
|
+
const r = t.map((a) => {
|
|
494
|
+
const i = Le(a, n);
|
|
495
|
+
return !e && typeof i == "function" && (e = !0), i;
|
|
496
|
+
});
|
|
497
|
+
if (e)
|
|
498
|
+
return () => {
|
|
499
|
+
for (let a = 0; a < r.length; a++) {
|
|
500
|
+
const i = r[a];
|
|
501
|
+
typeof i == "function" ? i() : Le(t[a], null);
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
var at = N.forwardRef((t, n) => {
|
|
507
|
+
const { children: e, ...r } = t, a = N.Children.toArray(e), i = a.find(Tr);
|
|
508
|
+
if (i) {
|
|
509
|
+
const s = i.props.children, o = a.map((c) => c === i ? N.Children.count(s) > 1 ? N.Children.only(null) : N.isValidElement(s) ? s.props.children : null : c);
|
|
510
|
+
return /* @__PURE__ */ p(le, { ...r, ref: n, children: N.isValidElement(s) ? N.cloneElement(s, void 0, o) : null });
|
|
511
|
+
}
|
|
512
|
+
return /* @__PURE__ */ p(le, { ...r, ref: n, children: e });
|
|
513
|
+
});
|
|
514
|
+
at.displayName = "Slot";
|
|
515
|
+
var le = N.forwardRef((t, n) => {
|
|
516
|
+
const { children: e, ...r } = t;
|
|
517
|
+
if (N.isValidElement(e)) {
|
|
518
|
+
const a = Nr(e), i = qr(r, e.props);
|
|
519
|
+
return e.type !== N.Fragment && (i.ref = n ? kr(n, a) : a), N.cloneElement(e, i);
|
|
520
|
+
}
|
|
521
|
+
return N.Children.count(e) > 1 ? N.Children.only(null) : null;
|
|
522
|
+
});
|
|
523
|
+
le.displayName = "SlotClone";
|
|
524
|
+
var Dr = ({ children: t }) => /* @__PURE__ */ p(Ot, { children: t });
|
|
525
|
+
function Tr(t) {
|
|
526
|
+
return N.isValidElement(t) && t.type === Dr;
|
|
527
|
+
}
|
|
528
|
+
function qr(t, n) {
|
|
529
|
+
const e = { ...n };
|
|
530
|
+
for (const r in n) {
|
|
531
|
+
const a = t[r], i = n[r];
|
|
532
|
+
/^on[A-Z]/.test(r) ? a && i ? e[r] = (...s) => {
|
|
533
|
+
i(...s), a(...s);
|
|
534
|
+
} : a && (e[r] = a) : r === "style" ? e[r] = { ...a, ...i } : r === "className" && (e[r] = [a, i].filter(Boolean).join(" "));
|
|
535
|
+
}
|
|
536
|
+
return { ...t, ...e };
|
|
537
|
+
}
|
|
538
|
+
function Nr(t) {
|
|
539
|
+
var n, e;
|
|
540
|
+
let r = (n = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : n.get, a = r && "isReactWarning" in r && r.isReactWarning;
|
|
541
|
+
return a ? t.ref : (r = (e = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : e.get, a = r && "isReactWarning" in r && r.isReactWarning, a ? t.props.ref : t.props.ref || t.ref);
|
|
542
|
+
}
|
|
543
|
+
var Yr = [
|
|
544
|
+
"a",
|
|
545
|
+
"button",
|
|
546
|
+
"div",
|
|
547
|
+
"form",
|
|
548
|
+
"h2",
|
|
549
|
+
"h3",
|
|
550
|
+
"img",
|
|
551
|
+
"input",
|
|
552
|
+
"label",
|
|
553
|
+
"li",
|
|
554
|
+
"nav",
|
|
555
|
+
"ol",
|
|
556
|
+
"p",
|
|
557
|
+
"span",
|
|
558
|
+
"svg",
|
|
559
|
+
"ul"
|
|
560
|
+
], Er = Yr.reduce((t, n) => {
|
|
561
|
+
const e = N.forwardRef((r, a) => {
|
|
562
|
+
const { asChild: i, ...s } = r, o = i ? at : n;
|
|
563
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ p(o, { ...s, ref: a });
|
|
564
|
+
});
|
|
565
|
+
return e.displayName = `Primitive.${n}`, { ...t, [n]: e };
|
|
566
|
+
}, {}), Wr = "Label", it = N.forwardRef((t, n) => /* @__PURE__ */ p(
|
|
567
|
+
Er.label,
|
|
568
|
+
{
|
|
569
|
+
...t,
|
|
570
|
+
ref: n,
|
|
571
|
+
onMouseDown: (e) => {
|
|
572
|
+
var r;
|
|
573
|
+
e.target.closest("button, input, select, textarea") || ((r = t.onMouseDown) == null || r.call(t, e), !e.defaultPrevented && e.detail > 1 && e.preventDefault());
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
));
|
|
577
|
+
it.displayName = Wr;
|
|
578
|
+
var $r = it;
|
|
579
|
+
function Hr(t) {
|
|
580
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
581
|
+
}
|
|
582
|
+
var Fe = { exports: {} };
|
|
583
|
+
/*!
|
|
584
|
+
Copyright (c) 2018 Jed Watson.
|
|
585
|
+
Licensed under the MIT License (MIT), see
|
|
586
|
+
http://jedwatson.github.io/classnames
|
|
587
|
+
*/
|
|
588
|
+
var Ie;
|
|
589
|
+
function Cr() {
|
|
590
|
+
return Ie || (Ie = 1, function(t) {
|
|
591
|
+
(function() {
|
|
592
|
+
var n = {}.hasOwnProperty;
|
|
593
|
+
function e() {
|
|
594
|
+
for (var i = "", s = 0; s < arguments.length; s++) {
|
|
595
|
+
var o = arguments[s];
|
|
596
|
+
o && (i = a(i, r.call(this, o)));
|
|
597
|
+
}
|
|
598
|
+
return i;
|
|
599
|
+
}
|
|
600
|
+
function r(i) {
|
|
601
|
+
if (typeof i == "string" || typeof i == "number")
|
|
602
|
+
return this && this[i] || i;
|
|
603
|
+
if (typeof i != "object")
|
|
604
|
+
return "";
|
|
605
|
+
if (Array.isArray(i))
|
|
606
|
+
return e.apply(this, i);
|
|
607
|
+
if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
|
|
608
|
+
return i.toString();
|
|
609
|
+
var s = "";
|
|
610
|
+
for (var o in i)
|
|
611
|
+
n.call(i, o) && i[o] && (s = a(s, this && this[o] || o));
|
|
612
|
+
return s;
|
|
613
|
+
}
|
|
614
|
+
function a(i, s) {
|
|
615
|
+
return s ? i ? i + " " + s : i + s : i;
|
|
616
|
+
}
|
|
617
|
+
t.exports ? (e.default = e, t.exports = e) : window.classNames = e;
|
|
618
|
+
})();
|
|
619
|
+
}(Fe)), Fe.exports;
|
|
620
|
+
}
|
|
621
|
+
var Lr = Cr();
|
|
622
|
+
const Fr = /* @__PURE__ */ Hr(Lr), Ir = {
|
|
623
|
+
"purpur-label": "_purpur-label_1jndl_1",
|
|
624
|
+
"purpur-label--negative": "_purpur-label--negative_1jndl_8",
|
|
625
|
+
"purpur-label--disabled": "_purpur-label--disabled_1jndl_11"
|
|
626
|
+
}, jr = Fr.bind(Ir), ae = "purpur-label", Rr = ({
|
|
627
|
+
children: t,
|
|
628
|
+
className: n,
|
|
629
|
+
disabled: e,
|
|
630
|
+
negative: r = !1,
|
|
631
|
+
...a
|
|
632
|
+
}) => {
|
|
633
|
+
const i = jr(n, ae, {
|
|
634
|
+
[`${ae}--disabled`]: e,
|
|
635
|
+
[`${ae}--negative`]: r
|
|
636
|
+
});
|
|
637
|
+
return /* @__PURE__ */ p($r, { className: i, ...a, children: t });
|
|
638
|
+
};
|
|
639
|
+
function Ar(t) {
|
|
640
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
641
|
+
}
|
|
642
|
+
var je = { exports: {} };
|
|
643
|
+
/*!
|
|
644
|
+
Copyright (c) 2018 Jed Watson.
|
|
645
|
+
Licensed under the MIT License (MIT), see
|
|
646
|
+
http://jedwatson.github.io/classnames
|
|
647
|
+
*/
|
|
648
|
+
var Re;
|
|
649
|
+
function Qr() {
|
|
650
|
+
return Re || (Re = 1, function(t) {
|
|
651
|
+
(function() {
|
|
652
|
+
var n = {}.hasOwnProperty;
|
|
653
|
+
function e() {
|
|
654
|
+
for (var i = "", s = 0; s < arguments.length; s++) {
|
|
655
|
+
var o = arguments[s];
|
|
656
|
+
o && (i = a(i, r.call(this, o)));
|
|
657
|
+
}
|
|
658
|
+
return i;
|
|
659
|
+
}
|
|
660
|
+
function r(i) {
|
|
661
|
+
if (typeof i == "string" || typeof i == "number")
|
|
662
|
+
return this && this[i] || i;
|
|
663
|
+
if (typeof i != "object")
|
|
664
|
+
return "";
|
|
665
|
+
if (Array.isArray(i))
|
|
666
|
+
return e.apply(this, i);
|
|
667
|
+
if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
|
|
668
|
+
return i.toString();
|
|
669
|
+
var s = "";
|
|
670
|
+
for (var o in i)
|
|
671
|
+
n.call(i, o) && i[o] && (s = a(s, this && this[o] || o));
|
|
672
|
+
return s;
|
|
673
|
+
}
|
|
674
|
+
function a(i, s) {
|
|
675
|
+
return s ? i ? i + " " + s : i + s : i;
|
|
676
|
+
}
|
|
677
|
+
t.exports ? (e.default = e, t.exports = e) : window.classNames = e;
|
|
678
|
+
})();
|
|
679
|
+
}(je)), je.exports;
|
|
680
|
+
}
|
|
681
|
+
var Br = Qr();
|
|
682
|
+
const Sr = /* @__PURE__ */ Ar(Br), Xr = "_rotate_12t9p_1", Gr = "_dash_12t9p_1", Vr = {
|
|
683
|
+
"purpur-spinner": "_purpur-spinner_12t9p_2",
|
|
684
|
+
rotate: Xr,
|
|
685
|
+
"purpur-spinner--xxs": "_purpur-spinner--xxs_12t9p_6",
|
|
686
|
+
"purpur-spinner--xs": "_purpur-spinner--xs_12t9p_10",
|
|
687
|
+
"purpur-spinner--sm": "_purpur-spinner--sm_12t9p_14",
|
|
688
|
+
"purpur-spinner--md": "_purpur-spinner--md_12t9p_18",
|
|
689
|
+
"purpur-spinner--lg": "_purpur-spinner--lg_12t9p_22",
|
|
690
|
+
"purpur-spinner__circle": "_purpur-spinner__circle_12t9p_26",
|
|
691
|
+
dash: Gr,
|
|
692
|
+
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_12t9p_41",
|
|
693
|
+
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_12t9p_44"
|
|
694
|
+
}, Ae = Sr.bind(Vr), Z = "purpur-spinner", zr = {
|
|
695
|
+
SM: "sm"
|
|
696
|
+
}, Zr = ({
|
|
697
|
+
disabled: t = !1,
|
|
698
|
+
negative: n = !1,
|
|
699
|
+
size: e = zr.SM,
|
|
700
|
+
...r
|
|
701
|
+
}) => /* @__PURE__ */ p("div", { className: Ae(Z, `${Z}--${e}`), ...r, children: /* @__PURE__ */ p("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ p(
|
|
702
|
+
"circle",
|
|
703
|
+
{
|
|
704
|
+
className: Ae(`${Z}__circle`, {
|
|
705
|
+
[`${Z}__circle--disabled`]: t,
|
|
706
|
+
[`${Z}__circle--negative`]: n
|
|
707
|
+
}),
|
|
708
|
+
cx: "25",
|
|
709
|
+
cy: "25",
|
|
710
|
+
r: "20"
|
|
711
|
+
}
|
|
712
|
+
) }) });
|
|
713
|
+
function Jr(t) {
|
|
714
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
715
|
+
}
|
|
716
|
+
var Qe = { exports: {} };
|
|
717
|
+
/*!
|
|
718
|
+
Copyright (c) 2018 Jed Watson.
|
|
719
|
+
Licensed under the MIT License (MIT), see
|
|
720
|
+
http://jedwatson.github.io/classnames
|
|
721
|
+
*/
|
|
722
|
+
var Be;
|
|
723
|
+
function Kr() {
|
|
724
|
+
return Be || (Be = 1, function(t) {
|
|
725
|
+
(function() {
|
|
726
|
+
var n = {}.hasOwnProperty;
|
|
727
|
+
function e() {
|
|
728
|
+
for (var i = "", s = 0; s < arguments.length; s++) {
|
|
729
|
+
var o = arguments[s];
|
|
730
|
+
o && (i = a(i, r.call(this, o)));
|
|
731
|
+
}
|
|
732
|
+
return i;
|
|
733
|
+
}
|
|
734
|
+
function r(i) {
|
|
735
|
+
if (typeof i == "string" || typeof i == "number")
|
|
736
|
+
return this && this[i] || i;
|
|
737
|
+
if (typeof i != "object")
|
|
738
|
+
return "";
|
|
739
|
+
if (Array.isArray(i))
|
|
740
|
+
return e.apply(this, i);
|
|
741
|
+
if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
|
|
742
|
+
return i.toString();
|
|
743
|
+
var s = "";
|
|
744
|
+
for (var o in i)
|
|
745
|
+
n.call(i, o) && i[o] && (s = a(s, this && this[o] || o));
|
|
746
|
+
return s;
|
|
747
|
+
}
|
|
748
|
+
function a(i, s) {
|
|
749
|
+
return s ? i ? i + " " + s : i + s : i;
|
|
750
|
+
}
|
|
751
|
+
t.exports ? (e.default = e, t.exports = e) : window.classNames = e;
|
|
752
|
+
})();
|
|
753
|
+
}(Qe)), Qe.exports;
|
|
754
|
+
}
|
|
755
|
+
var Ur = Kr();
|
|
756
|
+
const en = /* @__PURE__ */ Jr(Ur), tn = {
|
|
757
|
+
"purpur-text-field": "_purpur-text-field_3gl1k_1",
|
|
758
|
+
"purpur-text-field__label": "_purpur-text-field__label_3gl1k_7",
|
|
759
|
+
"purpur-text-field__label-text": "_purpur-text-field__label-text_3gl1k_12",
|
|
760
|
+
"purpur-text-field__field-row": "_purpur-text-field__field-row_3gl1k_15",
|
|
761
|
+
"purpur-text-field__frame": "_purpur-text-field__frame_3gl1k_19",
|
|
762
|
+
"purpur-text-field__input-container": "_purpur-text-field__input-container_3gl1k_26",
|
|
763
|
+
"purpur-text-field__input-container--disabled": "_purpur-text-field__input-container--disabled_3gl1k_37",
|
|
764
|
+
"purpur-text-field__input-container--readonly": "_purpur-text-field__input-container--readonly_3gl1k_40",
|
|
765
|
+
"purpur-text-field__input-container--has-clear-button": "_purpur-text-field__input-container--has-clear-button_3gl1k_43",
|
|
766
|
+
"purpur-text-field__input-container--end-adornment": "_purpur-text-field__input-container--end-adornment_3gl1k_46",
|
|
767
|
+
"purpur-text-field__input": "_purpur-text-field__input_3gl1k_26",
|
|
768
|
+
"purpur-text-field__input-container--start-adornment": "_purpur-text-field__input-container--start-adornment_3gl1k_52",
|
|
769
|
+
"purpur-text-field__input--valid": "_purpur-text-field__input--valid_3gl1k_94",
|
|
770
|
+
"purpur-text-field__input--error": "_purpur-text-field__input--error_3gl1k_94",
|
|
771
|
+
"purpur-text-field__adornment-container": "_purpur-text-field__adornment-container_3gl1k_106",
|
|
772
|
+
"purpur-text-field__valid-icon": "_purpur-text-field__valid-icon_3gl1k_111"
|
|
773
|
+
}, rn = (t) => Ue(t), F = en.bind(tn), q = "purpur-text-field", st = pe(
|
|
774
|
+
({
|
|
775
|
+
["data-testid"]: t,
|
|
776
|
+
className: n,
|
|
777
|
+
clearButtonAriaLabel: e,
|
|
778
|
+
beforeField: r,
|
|
779
|
+
afterField: a,
|
|
780
|
+
endAdornment: i,
|
|
781
|
+
errorText: s,
|
|
782
|
+
helperText: o,
|
|
783
|
+
hideRequiredAsterisk: c = !1,
|
|
784
|
+
label: h,
|
|
785
|
+
loading: y = !1,
|
|
786
|
+
onClear: b,
|
|
787
|
+
startAdornment: k,
|
|
788
|
+
valid: T = !1,
|
|
789
|
+
...l
|
|
790
|
+
}, d) => {
|
|
791
|
+
var _;
|
|
792
|
+
const Y = Mt(), L = l.id ?? Y, W = ($) => t ? `${t}-${$}` : void 0, f = T && !s, g = o ? `${L}-helper-text` : void 0, E = [k].filter(($) => !!$), V = (typeof l.value == "number" ? l.value !== void 0 : (_ = l.value) == null ? void 0 : _.length) && !l.disabled && !l.readOnly && !y && b && e, B = rn(null), U = ($) => {
|
|
793
|
+
B.current = $, typeof d == "function" ? d($) : d && (d.current = $);
|
|
794
|
+
}, ee = () => {
|
|
795
|
+
var $;
|
|
796
|
+
b == null || b(), ($ = B.current) == null || $.focus();
|
|
797
|
+
}, ne = [
|
|
798
|
+
y && /* @__PURE__ */ p(
|
|
799
|
+
Zr,
|
|
800
|
+
{
|
|
801
|
+
disabled: l.disabled,
|
|
802
|
+
size: "xs",
|
|
803
|
+
"data-testid": W("spinner")
|
|
804
|
+
},
|
|
805
|
+
"spinner"
|
|
806
|
+
),
|
|
807
|
+
V && /* @__PURE__ */ p(
|
|
808
|
+
et,
|
|
809
|
+
{
|
|
810
|
+
variant: "tertiary-purple",
|
|
811
|
+
onClick: ee,
|
|
812
|
+
iconOnly: !0,
|
|
813
|
+
"aria-label": e ?? "",
|
|
814
|
+
"data-testid": W("clear-button"),
|
|
815
|
+
tabIndex: -1,
|
|
816
|
+
children: /* @__PURE__ */ p(nt, { size: "xs" })
|
|
817
|
+
},
|
|
818
|
+
"clear-button"
|
|
819
|
+
),
|
|
820
|
+
f && /* @__PURE__ */ p(
|
|
821
|
+
rt,
|
|
822
|
+
{
|
|
823
|
+
"data-testid": W("valid-icon"),
|
|
824
|
+
className: F(`${q}__valid-icon`)
|
|
825
|
+
},
|
|
826
|
+
"valid-icon"
|
|
827
|
+
)
|
|
828
|
+
].filter(($) => !!$), xt = F(`${q}__input-container`, {
|
|
829
|
+
[`${q}__input-container--start-adornment`]: E.length,
|
|
830
|
+
[`${q}__input-container--end-adornment`]: ne.length || i,
|
|
831
|
+
[`${q}__input-container--disabled`]: l.disabled,
|
|
832
|
+
[`${q}__input-container--has-clear-button`]: V,
|
|
833
|
+
[`${q}__input-container--readonly`]: l.readOnly && !l.disabled
|
|
834
|
+
});
|
|
835
|
+
return /* @__PURE__ */ j("div", { className: F(n, q), children: [
|
|
836
|
+
h && /* @__PURE__ */ j(
|
|
837
|
+
Rr,
|
|
838
|
+
{
|
|
839
|
+
htmlFor: L,
|
|
840
|
+
className: F(`${q}__label`),
|
|
841
|
+
"data-testid": W("label"),
|
|
842
|
+
disabled: l.disabled,
|
|
843
|
+
children: [
|
|
844
|
+
l.required && !c && /* @__PURE__ */ p("span", { "aria-hidden": !0, children: "*" }),
|
|
845
|
+
h
|
|
846
|
+
]
|
|
847
|
+
}
|
|
848
|
+
),
|
|
849
|
+
/* @__PURE__ */ j("div", { className: F(`${q}__field-row`), children: [
|
|
850
|
+
!!r && r,
|
|
851
|
+
/* @__PURE__ */ j("div", { className: xt, children: [
|
|
852
|
+
!!E.length && /* @__PURE__ */ p(
|
|
853
|
+
"div",
|
|
854
|
+
{
|
|
855
|
+
"data-testid": W("start-adornments"),
|
|
856
|
+
className: F(`${q}__adornment-container`),
|
|
857
|
+
children: E
|
|
858
|
+
}
|
|
859
|
+
),
|
|
860
|
+
/* @__PURE__ */ p(
|
|
861
|
+
"input",
|
|
862
|
+
{
|
|
863
|
+
...l,
|
|
864
|
+
id: L,
|
|
865
|
+
ref: U,
|
|
866
|
+
"data-testid": W("input"),
|
|
867
|
+
"aria-describedby": l["aria-describedby"] || g,
|
|
868
|
+
"aria-invalid": l["aria-invalid"] || !!s,
|
|
869
|
+
className: F([
|
|
870
|
+
`${q}__input`,
|
|
871
|
+
{
|
|
872
|
+
[`${q}__input--valid`]: f,
|
|
873
|
+
[`${q}__input--error`]: !!s
|
|
874
|
+
}
|
|
875
|
+
])
|
|
876
|
+
}
|
|
877
|
+
),
|
|
878
|
+
/* @__PURE__ */ p("div", { className: F(`${q}__frame`) }),
|
|
879
|
+
(!!ne.length || i) && /* @__PURE__ */ j(
|
|
880
|
+
"div",
|
|
881
|
+
{
|
|
882
|
+
"data-testid": W("end-adornments"),
|
|
883
|
+
className: F(`${q}__adornment-container`),
|
|
884
|
+
children: [
|
|
885
|
+
ne,
|
|
886
|
+
i
|
|
887
|
+
]
|
|
888
|
+
}
|
|
889
|
+
)
|
|
890
|
+
] }),
|
|
891
|
+
!!a && a
|
|
892
|
+
] }),
|
|
893
|
+
g && /* @__PURE__ */ p(pr, { "data-testid": W("helper-text"), id: g, children: o }),
|
|
894
|
+
s && /* @__PURE__ */ p(sr, { "data-testid": W("error-text"), children: s })
|
|
895
|
+
] });
|
|
896
|
+
}
|
|
897
|
+
);
|
|
898
|
+
st.displayName = "TextField";
|
|
899
|
+
function nn(t) {
|
|
900
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
901
|
+
}
|
|
902
|
+
var ie = { exports: {} };
|
|
903
|
+
/*!
|
|
904
|
+
Copyright (c) 2018 Jed Watson.
|
|
905
|
+
Licensed under the MIT License (MIT), see
|
|
906
|
+
http://jedwatson.github.io/classnames
|
|
907
|
+
*/
|
|
908
|
+
var Se;
|
|
909
|
+
function an() {
|
|
910
|
+
return Se || (Se = 1, function(t) {
|
|
911
|
+
(function() {
|
|
912
|
+
var n = {}.hasOwnProperty;
|
|
913
|
+
function e() {
|
|
914
|
+
for (var i = "", s = 0; s < arguments.length; s++) {
|
|
915
|
+
var o = arguments[s];
|
|
916
|
+
o && (i = a(i, r.call(this, o)));
|
|
917
|
+
}
|
|
918
|
+
return i;
|
|
919
|
+
}
|
|
920
|
+
function r(i) {
|
|
921
|
+
if (typeof i == "string" || typeof i == "number")
|
|
922
|
+
return this && this[i] || i;
|
|
923
|
+
if (typeof i != "object")
|
|
924
|
+
return "";
|
|
925
|
+
if (Array.isArray(i))
|
|
926
|
+
return e.apply(this, i);
|
|
927
|
+
if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
|
|
928
|
+
return i.toString();
|
|
929
|
+
var s = "";
|
|
930
|
+
for (var o in i)
|
|
931
|
+
n.call(i, o) && i[o] && (s = a(s, this && this[o] || o));
|
|
932
|
+
return s;
|
|
933
|
+
}
|
|
934
|
+
function a(i, s) {
|
|
935
|
+
return s ? i ? i + " " + s : i + s : i;
|
|
936
|
+
}
|
|
937
|
+
t.exports ? (e.default = e, t.exports = e) : window.classNames = e;
|
|
938
|
+
})();
|
|
939
|
+
}(ie)), ie.exports;
|
|
940
|
+
}
|
|
941
|
+
var sn = an();
|
|
942
|
+
const on = /* @__PURE__ */ nn(sn), ot = 6048e5, un = 864e5, cn = 6e4, ln = 36e5, dn = 1e3, Xe = Symbol.for("constructDateFrom");
|
|
943
|
+
function D(t, n) {
|
|
944
|
+
return typeof t == "function" ? t(n) : t && typeof t == "object" && Xe in t ? t[Xe](n) : t instanceof Date ? new t.constructor(n) : new Date(n);
|
|
945
|
+
}
|
|
946
|
+
function M(t, n) {
|
|
947
|
+
return D(n || t, t);
|
|
948
|
+
}
|
|
949
|
+
function ut(t, n, e) {
|
|
950
|
+
const r = M(t, e == null ? void 0 : e.in);
|
|
951
|
+
return isNaN(n) ? D((e == null ? void 0 : e.in) || t, NaN) : (n && r.setDate(r.getDate() + n), r);
|
|
952
|
+
}
|
|
953
|
+
let fn = {};
|
|
954
|
+
function G() {
|
|
955
|
+
return fn;
|
|
956
|
+
}
|
|
957
|
+
function R(t, n) {
|
|
958
|
+
var o, c, h, y;
|
|
959
|
+
const e = G(), r = (n == null ? void 0 : n.weekStartsOn) ?? ((c = (o = n == null ? void 0 : n.locale) == null ? void 0 : o.options) == null ? void 0 : c.weekStartsOn) ?? e.weekStartsOn ?? ((y = (h = e.locale) == null ? void 0 : h.options) == null ? void 0 : y.weekStartsOn) ?? 0, a = M(t, n == null ? void 0 : n.in), i = a.getDay(), s = (i < r ? 7 : 0) + i - r;
|
|
960
|
+
return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
|
|
961
|
+
}
|
|
962
|
+
function X(t, n) {
|
|
963
|
+
return R(t, { ...n, weekStartsOn: 1 });
|
|
964
|
+
}
|
|
965
|
+
function ct(t, n) {
|
|
966
|
+
const e = M(t, n == null ? void 0 : n.in), r = e.getFullYear(), a = D(e, 0);
|
|
967
|
+
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
968
|
+
const i = X(a), s = D(e, 0);
|
|
969
|
+
s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0);
|
|
970
|
+
const o = X(s);
|
|
971
|
+
return e.getTime() >= i.getTime() ? r + 1 : e.getTime() >= o.getTime() ? r : r - 1;
|
|
972
|
+
}
|
|
973
|
+
function te(t) {
|
|
974
|
+
const n = M(t), e = new Date(
|
|
975
|
+
Date.UTC(
|
|
976
|
+
n.getFullYear(),
|
|
977
|
+
n.getMonth(),
|
|
978
|
+
n.getDate(),
|
|
979
|
+
n.getHours(),
|
|
980
|
+
n.getMinutes(),
|
|
981
|
+
n.getSeconds(),
|
|
982
|
+
n.getMilliseconds()
|
|
983
|
+
)
|
|
984
|
+
);
|
|
985
|
+
return e.setUTCFullYear(n.getFullYear()), +t - +e;
|
|
986
|
+
}
|
|
987
|
+
function pn(t, ...n) {
|
|
988
|
+
const e = D.bind(
|
|
989
|
+
null,
|
|
990
|
+
n.find((r) => typeof r == "object")
|
|
991
|
+
);
|
|
992
|
+
return n.map(e);
|
|
993
|
+
}
|
|
994
|
+
function Ge(t, n) {
|
|
995
|
+
const e = M(t, n == null ? void 0 : n.in);
|
|
996
|
+
return e.setHours(0, 0, 0, 0), e;
|
|
997
|
+
}
|
|
998
|
+
function hn(t, n, e) {
|
|
999
|
+
const [r, a] = pn(
|
|
1000
|
+
e == null ? void 0 : e.in,
|
|
1001
|
+
t,
|
|
1002
|
+
n
|
|
1003
|
+
), i = Ge(r), s = Ge(a), o = +i - te(i), c = +s - te(s);
|
|
1004
|
+
return Math.round((o - c) / un);
|
|
1005
|
+
}
|
|
1006
|
+
function mn(t, n) {
|
|
1007
|
+
const e = ct(t, n), r = D(t, 0);
|
|
1008
|
+
return r.setFullYear(e, 0, 4), r.setHours(0, 0, 0, 0), X(r);
|
|
1009
|
+
}
|
|
1010
|
+
function wn(t) {
|
|
1011
|
+
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
1012
|
+
}
|
|
1013
|
+
function lt(t) {
|
|
1014
|
+
return !(!wn(t) && typeof t != "number" || isNaN(+M(t)));
|
|
1015
|
+
}
|
|
1016
|
+
function yn(t, n) {
|
|
1017
|
+
const e = M(t, n == null ? void 0 : n.in);
|
|
1018
|
+
return e.setFullYear(e.getFullYear(), 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1019
|
+
}
|
|
1020
|
+
const _n = {
|
|
1021
|
+
lessThanXSeconds: {
|
|
1022
|
+
one: "less than a second",
|
|
1023
|
+
other: "less than {{count}} seconds"
|
|
1024
|
+
},
|
|
1025
|
+
xSeconds: {
|
|
1026
|
+
one: "1 second",
|
|
1027
|
+
other: "{{count}} seconds"
|
|
1028
|
+
},
|
|
1029
|
+
halfAMinute: "half a minute",
|
|
1030
|
+
lessThanXMinutes: {
|
|
1031
|
+
one: "less than a minute",
|
|
1032
|
+
other: "less than {{count}} minutes"
|
|
1033
|
+
},
|
|
1034
|
+
xMinutes: {
|
|
1035
|
+
one: "1 minute",
|
|
1036
|
+
other: "{{count}} minutes"
|
|
1037
|
+
},
|
|
1038
|
+
aboutXHours: {
|
|
1039
|
+
one: "about 1 hour",
|
|
1040
|
+
other: "about {{count}} hours"
|
|
1041
|
+
},
|
|
1042
|
+
xHours: {
|
|
1043
|
+
one: "1 hour",
|
|
1044
|
+
other: "{{count}} hours"
|
|
1045
|
+
},
|
|
1046
|
+
xDays: {
|
|
1047
|
+
one: "1 day",
|
|
1048
|
+
other: "{{count}} days"
|
|
1049
|
+
},
|
|
1050
|
+
aboutXWeeks: {
|
|
1051
|
+
one: "about 1 week",
|
|
1052
|
+
other: "about {{count}} weeks"
|
|
1053
|
+
},
|
|
1054
|
+
xWeeks: {
|
|
1055
|
+
one: "1 week",
|
|
1056
|
+
other: "{{count}} weeks"
|
|
1057
|
+
},
|
|
1058
|
+
aboutXMonths: {
|
|
1059
|
+
one: "about 1 month",
|
|
1060
|
+
other: "about {{count}} months"
|
|
1061
|
+
},
|
|
1062
|
+
xMonths: {
|
|
1063
|
+
one: "1 month",
|
|
1064
|
+
other: "{{count}} months"
|
|
1065
|
+
},
|
|
1066
|
+
aboutXYears: {
|
|
1067
|
+
one: "about 1 year",
|
|
1068
|
+
other: "about {{count}} years"
|
|
1069
|
+
},
|
|
1070
|
+
xYears: {
|
|
1071
|
+
one: "1 year",
|
|
1072
|
+
other: "{{count}} years"
|
|
1073
|
+
},
|
|
1074
|
+
overXYears: {
|
|
1075
|
+
one: "over 1 year",
|
|
1076
|
+
other: "over {{count}} years"
|
|
1077
|
+
},
|
|
1078
|
+
almostXYears: {
|
|
1079
|
+
one: "almost 1 year",
|
|
1080
|
+
other: "almost {{count}} years"
|
|
1081
|
+
}
|
|
1082
|
+
}, gn = (t, n, e) => {
|
|
1083
|
+
let r;
|
|
1084
|
+
const a = _n[t];
|
|
1085
|
+
return typeof a == "string" ? r = a : n === 1 ? r = a.one : r = a.other.replace("{{count}}", n.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
1086
|
+
};
|
|
1087
|
+
function se(t) {
|
|
1088
|
+
return (n = {}) => {
|
|
1089
|
+
const e = n.width ? String(n.width) : t.defaultWidth;
|
|
1090
|
+
return t.formats[e] || t.formats[t.defaultWidth];
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
const bn = {
|
|
1094
|
+
full: "EEEE, MMMM do, y",
|
|
1095
|
+
long: "MMMM do, y",
|
|
1096
|
+
medium: "MMM d, y",
|
|
1097
|
+
short: "MM/dd/yyyy"
|
|
1098
|
+
}, xn = {
|
|
1099
|
+
full: "h:mm:ss a zzzz",
|
|
1100
|
+
long: "h:mm:ss a z",
|
|
1101
|
+
medium: "h:mm:ss a",
|
|
1102
|
+
short: "h:mm a"
|
|
1103
|
+
}, vn = {
|
|
1104
|
+
full: "{{date}} 'at' {{time}}",
|
|
1105
|
+
long: "{{date}} 'at' {{time}}",
|
|
1106
|
+
medium: "{{date}}, {{time}}",
|
|
1107
|
+
short: "{{date}}, {{time}}"
|
|
1108
|
+
}, Pn = {
|
|
1109
|
+
date: se({
|
|
1110
|
+
formats: bn,
|
|
1111
|
+
defaultWidth: "full"
|
|
1112
|
+
}),
|
|
1113
|
+
time: se({
|
|
1114
|
+
formats: xn,
|
|
1115
|
+
defaultWidth: "full"
|
|
1116
|
+
}),
|
|
1117
|
+
dateTime: se({
|
|
1118
|
+
formats: vn,
|
|
1119
|
+
defaultWidth: "full"
|
|
1120
|
+
})
|
|
1121
|
+
}, On = {
|
|
1122
|
+
lastWeek: "'last' eeee 'at' p",
|
|
1123
|
+
yesterday: "'yesterday at' p",
|
|
1124
|
+
today: "'today at' p",
|
|
1125
|
+
tomorrow: "'tomorrow at' p",
|
|
1126
|
+
nextWeek: "eeee 'at' p",
|
|
1127
|
+
other: "P"
|
|
1128
|
+
}, Mn = (t, n, e, r) => On[t];
|
|
1129
|
+
function J(t) {
|
|
1130
|
+
return (n, e) => {
|
|
1131
|
+
const r = e != null && e.context ? String(e.context) : "standalone";
|
|
1132
|
+
let a;
|
|
1133
|
+
if (r === "formatting" && t.formattingValues) {
|
|
1134
|
+
const s = t.defaultFormattingWidth || t.defaultWidth, o = e != null && e.width ? String(e.width) : s;
|
|
1135
|
+
a = t.formattingValues[o] || t.formattingValues[s];
|
|
1136
|
+
} else {
|
|
1137
|
+
const s = t.defaultWidth, o = e != null && e.width ? String(e.width) : t.defaultWidth;
|
|
1138
|
+
a = t.values[o] || t.values[s];
|
|
1139
|
+
}
|
|
1140
|
+
const i = t.argumentCallback ? t.argumentCallback(n) : n;
|
|
1141
|
+
return a[i];
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
const kn = {
|
|
1145
|
+
narrow: ["B", "A"],
|
|
1146
|
+
abbreviated: ["BC", "AD"],
|
|
1147
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
1148
|
+
}, Dn = {
|
|
1149
|
+
narrow: ["1", "2", "3", "4"],
|
|
1150
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
1151
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
1152
|
+
}, Tn = {
|
|
1153
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
1154
|
+
abbreviated: [
|
|
1155
|
+
"Jan",
|
|
1156
|
+
"Feb",
|
|
1157
|
+
"Mar",
|
|
1158
|
+
"Apr",
|
|
1159
|
+
"May",
|
|
1160
|
+
"Jun",
|
|
1161
|
+
"Jul",
|
|
1162
|
+
"Aug",
|
|
1163
|
+
"Sep",
|
|
1164
|
+
"Oct",
|
|
1165
|
+
"Nov",
|
|
1166
|
+
"Dec"
|
|
1167
|
+
],
|
|
1168
|
+
wide: [
|
|
1169
|
+
"January",
|
|
1170
|
+
"February",
|
|
1171
|
+
"March",
|
|
1172
|
+
"April",
|
|
1173
|
+
"May",
|
|
1174
|
+
"June",
|
|
1175
|
+
"July",
|
|
1176
|
+
"August",
|
|
1177
|
+
"September",
|
|
1178
|
+
"October",
|
|
1179
|
+
"November",
|
|
1180
|
+
"December"
|
|
1181
|
+
]
|
|
1182
|
+
}, qn = {
|
|
1183
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
1184
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1185
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1186
|
+
wide: [
|
|
1187
|
+
"Sunday",
|
|
1188
|
+
"Monday",
|
|
1189
|
+
"Tuesday",
|
|
1190
|
+
"Wednesday",
|
|
1191
|
+
"Thursday",
|
|
1192
|
+
"Friday",
|
|
1193
|
+
"Saturday"
|
|
1194
|
+
]
|
|
1195
|
+
}, Nn = {
|
|
1196
|
+
narrow: {
|
|
1197
|
+
am: "a",
|
|
1198
|
+
pm: "p",
|
|
1199
|
+
midnight: "mi",
|
|
1200
|
+
noon: "n",
|
|
1201
|
+
morning: "morning",
|
|
1202
|
+
afternoon: "afternoon",
|
|
1203
|
+
evening: "evening",
|
|
1204
|
+
night: "night"
|
|
1205
|
+
},
|
|
1206
|
+
abbreviated: {
|
|
1207
|
+
am: "AM",
|
|
1208
|
+
pm: "PM",
|
|
1209
|
+
midnight: "midnight",
|
|
1210
|
+
noon: "noon",
|
|
1211
|
+
morning: "morning",
|
|
1212
|
+
afternoon: "afternoon",
|
|
1213
|
+
evening: "evening",
|
|
1214
|
+
night: "night"
|
|
1215
|
+
},
|
|
1216
|
+
wide: {
|
|
1217
|
+
am: "a.m.",
|
|
1218
|
+
pm: "p.m.",
|
|
1219
|
+
midnight: "midnight",
|
|
1220
|
+
noon: "noon",
|
|
1221
|
+
morning: "morning",
|
|
1222
|
+
afternoon: "afternoon",
|
|
1223
|
+
evening: "evening",
|
|
1224
|
+
night: "night"
|
|
1225
|
+
}
|
|
1226
|
+
}, Yn = {
|
|
1227
|
+
narrow: {
|
|
1228
|
+
am: "a",
|
|
1229
|
+
pm: "p",
|
|
1230
|
+
midnight: "mi",
|
|
1231
|
+
noon: "n",
|
|
1232
|
+
morning: "in the morning",
|
|
1233
|
+
afternoon: "in the afternoon",
|
|
1234
|
+
evening: "in the evening",
|
|
1235
|
+
night: "at night"
|
|
1236
|
+
},
|
|
1237
|
+
abbreviated: {
|
|
1238
|
+
am: "AM",
|
|
1239
|
+
pm: "PM",
|
|
1240
|
+
midnight: "midnight",
|
|
1241
|
+
noon: "noon",
|
|
1242
|
+
morning: "in the morning",
|
|
1243
|
+
afternoon: "in the afternoon",
|
|
1244
|
+
evening: "in the evening",
|
|
1245
|
+
night: "at night"
|
|
1246
|
+
},
|
|
1247
|
+
wide: {
|
|
1248
|
+
am: "a.m.",
|
|
1249
|
+
pm: "p.m.",
|
|
1250
|
+
midnight: "midnight",
|
|
1251
|
+
noon: "noon",
|
|
1252
|
+
morning: "in the morning",
|
|
1253
|
+
afternoon: "in the afternoon",
|
|
1254
|
+
evening: "in the evening",
|
|
1255
|
+
night: "at night"
|
|
1256
|
+
}
|
|
1257
|
+
}, En = (t, n) => {
|
|
1258
|
+
const e = Number(t), r = e % 100;
|
|
1259
|
+
if (r > 20 || r < 10)
|
|
1260
|
+
switch (r % 10) {
|
|
1261
|
+
case 1:
|
|
1262
|
+
return e + "st";
|
|
1263
|
+
case 2:
|
|
1264
|
+
return e + "nd";
|
|
1265
|
+
case 3:
|
|
1266
|
+
return e + "rd";
|
|
1267
|
+
}
|
|
1268
|
+
return e + "th";
|
|
1269
|
+
}, Wn = {
|
|
1270
|
+
ordinalNumber: En,
|
|
1271
|
+
era: J({
|
|
1272
|
+
values: kn,
|
|
1273
|
+
defaultWidth: "wide"
|
|
1274
|
+
}),
|
|
1275
|
+
quarter: J({
|
|
1276
|
+
values: Dn,
|
|
1277
|
+
defaultWidth: "wide",
|
|
1278
|
+
argumentCallback: (t) => t - 1
|
|
1279
|
+
}),
|
|
1280
|
+
month: J({
|
|
1281
|
+
values: Tn,
|
|
1282
|
+
defaultWidth: "wide"
|
|
1283
|
+
}),
|
|
1284
|
+
day: J({
|
|
1285
|
+
values: qn,
|
|
1286
|
+
defaultWidth: "wide"
|
|
1287
|
+
}),
|
|
1288
|
+
dayPeriod: J({
|
|
1289
|
+
values: Nn,
|
|
1290
|
+
defaultWidth: "wide",
|
|
1291
|
+
formattingValues: Yn,
|
|
1292
|
+
defaultFormattingWidth: "wide"
|
|
1293
|
+
})
|
|
1294
|
+
};
|
|
1295
|
+
function K(t) {
|
|
1296
|
+
return (n, e = {}) => {
|
|
1297
|
+
const r = e.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], i = n.match(a);
|
|
1298
|
+
if (!i)
|
|
1299
|
+
return null;
|
|
1300
|
+
const s = i[0], o = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(o) ? Hn(o, (b) => b.test(s)) : (
|
|
1301
|
+
// [TODO] -- I challenge you to fix the type
|
|
1302
|
+
$n(o, (b) => b.test(s))
|
|
1303
|
+
);
|
|
1304
|
+
let h;
|
|
1305
|
+
h = t.valueCallback ? t.valueCallback(c) : c, h = e.valueCallback ? (
|
|
1306
|
+
// [TODO] -- I challenge you to fix the type
|
|
1307
|
+
e.valueCallback(h)
|
|
1308
|
+
) : h;
|
|
1309
|
+
const y = n.slice(s.length);
|
|
1310
|
+
return { value: h, rest: y };
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1313
|
+
function $n(t, n) {
|
|
1314
|
+
for (const e in t)
|
|
1315
|
+
if (Object.prototype.hasOwnProperty.call(t, e) && n(t[e]))
|
|
1316
|
+
return e;
|
|
1317
|
+
}
|
|
1318
|
+
function Hn(t, n) {
|
|
1319
|
+
for (let e = 0; e < t.length; e++)
|
|
1320
|
+
if (n(t[e]))
|
|
1321
|
+
return e;
|
|
1322
|
+
}
|
|
1323
|
+
function Cn(t) {
|
|
1324
|
+
return (n, e = {}) => {
|
|
1325
|
+
const r = n.match(t.matchPattern);
|
|
1326
|
+
if (!r) return null;
|
|
1327
|
+
const a = r[0], i = n.match(t.parsePattern);
|
|
1328
|
+
if (!i) return null;
|
|
1329
|
+
let s = t.valueCallback ? t.valueCallback(i[0]) : i[0];
|
|
1330
|
+
s = e.valueCallback ? e.valueCallback(s) : s;
|
|
1331
|
+
const o = n.slice(a.length);
|
|
1332
|
+
return { value: s, rest: o };
|
|
1333
|
+
};
|
|
1334
|
+
}
|
|
1335
|
+
const Ln = /^(\d+)(th|st|nd|rd)?/i, Fn = /\d+/i, In = {
|
|
1336
|
+
narrow: /^(b|a)/i,
|
|
1337
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
1338
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
1339
|
+
}, jn = {
|
|
1340
|
+
any: [/^b/i, /^(a|c)/i]
|
|
1341
|
+
}, Rn = {
|
|
1342
|
+
narrow: /^[1234]/i,
|
|
1343
|
+
abbreviated: /^q[1234]/i,
|
|
1344
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
1345
|
+
}, An = {
|
|
1346
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1347
|
+
}, Qn = {
|
|
1348
|
+
narrow: /^[jfmasond]/i,
|
|
1349
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
1350
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
1351
|
+
}, Bn = {
|
|
1352
|
+
narrow: [
|
|
1353
|
+
/^j/i,
|
|
1354
|
+
/^f/i,
|
|
1355
|
+
/^m/i,
|
|
1356
|
+
/^a/i,
|
|
1357
|
+
/^m/i,
|
|
1358
|
+
/^j/i,
|
|
1359
|
+
/^j/i,
|
|
1360
|
+
/^a/i,
|
|
1361
|
+
/^s/i,
|
|
1362
|
+
/^o/i,
|
|
1363
|
+
/^n/i,
|
|
1364
|
+
/^d/i
|
|
1365
|
+
],
|
|
1366
|
+
any: [
|
|
1367
|
+
/^ja/i,
|
|
1368
|
+
/^f/i,
|
|
1369
|
+
/^mar/i,
|
|
1370
|
+
/^ap/i,
|
|
1371
|
+
/^may/i,
|
|
1372
|
+
/^jun/i,
|
|
1373
|
+
/^jul/i,
|
|
1374
|
+
/^au/i,
|
|
1375
|
+
/^s/i,
|
|
1376
|
+
/^o/i,
|
|
1377
|
+
/^n/i,
|
|
1378
|
+
/^d/i
|
|
1379
|
+
]
|
|
1380
|
+
}, Sn = {
|
|
1381
|
+
narrow: /^[smtwf]/i,
|
|
1382
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
1383
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
1384
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
1385
|
+
}, Xn = {
|
|
1386
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
1387
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
1388
|
+
}, Gn = {
|
|
1389
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
1390
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
1391
|
+
}, Vn = {
|
|
1392
|
+
any: {
|
|
1393
|
+
am: /^a/i,
|
|
1394
|
+
pm: /^p/i,
|
|
1395
|
+
midnight: /^mi/i,
|
|
1396
|
+
noon: /^no/i,
|
|
1397
|
+
morning: /morning/i,
|
|
1398
|
+
afternoon: /afternoon/i,
|
|
1399
|
+
evening: /evening/i,
|
|
1400
|
+
night: /night/i
|
|
1401
|
+
}
|
|
1402
|
+
}, zn = {
|
|
1403
|
+
ordinalNumber: Cn({
|
|
1404
|
+
matchPattern: Ln,
|
|
1405
|
+
parsePattern: Fn,
|
|
1406
|
+
valueCallback: (t) => parseInt(t, 10)
|
|
1407
|
+
}),
|
|
1408
|
+
era: K({
|
|
1409
|
+
matchPatterns: In,
|
|
1410
|
+
defaultMatchWidth: "wide",
|
|
1411
|
+
parsePatterns: jn,
|
|
1412
|
+
defaultParseWidth: "any"
|
|
1413
|
+
}),
|
|
1414
|
+
quarter: K({
|
|
1415
|
+
matchPatterns: Rn,
|
|
1416
|
+
defaultMatchWidth: "wide",
|
|
1417
|
+
parsePatterns: An,
|
|
1418
|
+
defaultParseWidth: "any",
|
|
1419
|
+
valueCallback: (t) => t + 1
|
|
1420
|
+
}),
|
|
1421
|
+
month: K({
|
|
1422
|
+
matchPatterns: Qn,
|
|
1423
|
+
defaultMatchWidth: "wide",
|
|
1424
|
+
parsePatterns: Bn,
|
|
1425
|
+
defaultParseWidth: "any"
|
|
1426
|
+
}),
|
|
1427
|
+
day: K({
|
|
1428
|
+
matchPatterns: Sn,
|
|
1429
|
+
defaultMatchWidth: "wide",
|
|
1430
|
+
parsePatterns: Xn,
|
|
1431
|
+
defaultParseWidth: "any"
|
|
1432
|
+
}),
|
|
1433
|
+
dayPeriod: K({
|
|
1434
|
+
matchPatterns: Gn,
|
|
1435
|
+
defaultMatchWidth: "any",
|
|
1436
|
+
parsePatterns: Vn,
|
|
1437
|
+
defaultParseWidth: "any"
|
|
1438
|
+
})
|
|
1439
|
+
}, dt = {
|
|
1440
|
+
code: "en-US",
|
|
1441
|
+
formatDistance: gn,
|
|
1442
|
+
formatLong: Pn,
|
|
1443
|
+
formatRelative: Mn,
|
|
1444
|
+
localize: Wn,
|
|
1445
|
+
match: zn,
|
|
1446
|
+
options: {
|
|
1447
|
+
weekStartsOn: 0,
|
|
1448
|
+
firstWeekContainsDate: 1
|
|
1449
|
+
}
|
|
1450
|
+
};
|
|
1451
|
+
function Zn(t, n) {
|
|
1452
|
+
const e = M(t, n == null ? void 0 : n.in);
|
|
1453
|
+
return hn(e, yn(e)) + 1;
|
|
1454
|
+
}
|
|
1455
|
+
function ft(t, n) {
|
|
1456
|
+
const e = M(t, n == null ? void 0 : n.in), r = +X(e) - +mn(e);
|
|
1457
|
+
return Math.round(r / ot) + 1;
|
|
1458
|
+
}
|
|
1459
|
+
function me(t, n) {
|
|
1460
|
+
var y, b, k, T;
|
|
1461
|
+
const e = M(t, n == null ? void 0 : n.in), r = e.getFullYear(), a = G(), i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((b = (y = n == null ? void 0 : n.locale) == null ? void 0 : y.options) == null ? void 0 : b.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((T = (k = a.locale) == null ? void 0 : k.options) == null ? void 0 : T.firstWeekContainsDate) ?? 1, s = D((n == null ? void 0 : n.in) || t, 0);
|
|
1462
|
+
s.setFullYear(r + 1, 0, i), s.setHours(0, 0, 0, 0);
|
|
1463
|
+
const o = R(s, n), c = D((n == null ? void 0 : n.in) || t, 0);
|
|
1464
|
+
c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
|
|
1465
|
+
const h = R(c, n);
|
|
1466
|
+
return +e >= +o ? r + 1 : +e >= +h ? r : r - 1;
|
|
1467
|
+
}
|
|
1468
|
+
function Jn(t, n) {
|
|
1469
|
+
var o, c, h, y;
|
|
1470
|
+
const e = G(), r = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((c = (o = n == null ? void 0 : n.locale) == null ? void 0 : o.options) == null ? void 0 : c.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((y = (h = e.locale) == null ? void 0 : h.options) == null ? void 0 : y.firstWeekContainsDate) ?? 1, a = me(t, n), i = D((n == null ? void 0 : n.in) || t, 0);
|
|
1471
|
+
return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), R(i, n);
|
|
1472
|
+
}
|
|
1473
|
+
function pt(t, n) {
|
|
1474
|
+
const e = M(t, n == null ? void 0 : n.in), r = +R(e, n) - +Jn(e, n);
|
|
1475
|
+
return Math.round(r / ot) + 1;
|
|
1476
|
+
}
|
|
1477
|
+
function w(t, n) {
|
|
1478
|
+
const e = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(n, "0");
|
|
1479
|
+
return e + r;
|
|
1480
|
+
}
|
|
1481
|
+
const I = {
|
|
1482
|
+
// Year
|
|
1483
|
+
y(t, n) {
|
|
1484
|
+
const e = t.getFullYear(), r = e > 0 ? e : 1 - e;
|
|
1485
|
+
return w(n === "yy" ? r % 100 : r, n.length);
|
|
1486
|
+
},
|
|
1487
|
+
// Month
|
|
1488
|
+
M(t, n) {
|
|
1489
|
+
const e = t.getMonth();
|
|
1490
|
+
return n === "M" ? String(e + 1) : w(e + 1, 2);
|
|
1491
|
+
},
|
|
1492
|
+
// Day of the month
|
|
1493
|
+
d(t, n) {
|
|
1494
|
+
return w(t.getDate(), n.length);
|
|
1495
|
+
},
|
|
1496
|
+
// AM or PM
|
|
1497
|
+
a(t, n) {
|
|
1498
|
+
const e = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1499
|
+
switch (n) {
|
|
1500
|
+
case "a":
|
|
1501
|
+
case "aa":
|
|
1502
|
+
return e.toUpperCase();
|
|
1503
|
+
case "aaa":
|
|
1504
|
+
return e;
|
|
1505
|
+
case "aaaaa":
|
|
1506
|
+
return e[0];
|
|
1507
|
+
case "aaaa":
|
|
1508
|
+
default:
|
|
1509
|
+
return e === "am" ? "a.m." : "p.m.";
|
|
1510
|
+
}
|
|
1511
|
+
},
|
|
1512
|
+
// Hour [1-12]
|
|
1513
|
+
h(t, n) {
|
|
1514
|
+
return w(t.getHours() % 12 || 12, n.length);
|
|
1515
|
+
},
|
|
1516
|
+
// Hour [0-23]
|
|
1517
|
+
H(t, n) {
|
|
1518
|
+
return w(t.getHours(), n.length);
|
|
1519
|
+
},
|
|
1520
|
+
// Minute
|
|
1521
|
+
m(t, n) {
|
|
1522
|
+
return w(t.getMinutes(), n.length);
|
|
1523
|
+
},
|
|
1524
|
+
// Second
|
|
1525
|
+
s(t, n) {
|
|
1526
|
+
return w(t.getSeconds(), n.length);
|
|
1527
|
+
},
|
|
1528
|
+
// Fraction of second
|
|
1529
|
+
S(t, n) {
|
|
1530
|
+
const e = n.length, r = t.getMilliseconds(), a = Math.trunc(
|
|
1531
|
+
r * Math.pow(10, e - 3)
|
|
1532
|
+
);
|
|
1533
|
+
return w(a, n.length);
|
|
1534
|
+
}
|
|
1535
|
+
}, S = {
|
|
1536
|
+
midnight: "midnight",
|
|
1537
|
+
noon: "noon",
|
|
1538
|
+
morning: "morning",
|
|
1539
|
+
afternoon: "afternoon",
|
|
1540
|
+
evening: "evening",
|
|
1541
|
+
night: "night"
|
|
1542
|
+
}, Ve = {
|
|
1543
|
+
// Era
|
|
1544
|
+
G: function(t, n, e) {
|
|
1545
|
+
const r = t.getFullYear() > 0 ? 1 : 0;
|
|
1546
|
+
switch (n) {
|
|
1547
|
+
// AD, BC
|
|
1548
|
+
case "G":
|
|
1549
|
+
case "GG":
|
|
1550
|
+
case "GGG":
|
|
1551
|
+
return e.era(r, { width: "abbreviated" });
|
|
1552
|
+
// A, B
|
|
1553
|
+
case "GGGGG":
|
|
1554
|
+
return e.era(r, { width: "narrow" });
|
|
1555
|
+
// Anno Domini, Before Christ
|
|
1556
|
+
case "GGGG":
|
|
1557
|
+
default:
|
|
1558
|
+
return e.era(r, { width: "wide" });
|
|
1559
|
+
}
|
|
1560
|
+
},
|
|
1561
|
+
// Year
|
|
1562
|
+
y: function(t, n, e) {
|
|
1563
|
+
if (n === "yo") {
|
|
1564
|
+
const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
1565
|
+
return e.ordinalNumber(a, { unit: "year" });
|
|
1566
|
+
}
|
|
1567
|
+
return I.y(t, n);
|
|
1568
|
+
},
|
|
1569
|
+
// Local week-numbering year
|
|
1570
|
+
Y: function(t, n, e, r) {
|
|
1571
|
+
const a = me(t, r), i = a > 0 ? a : 1 - a;
|
|
1572
|
+
if (n === "YY") {
|
|
1573
|
+
const s = i % 100;
|
|
1574
|
+
return w(s, 2);
|
|
1575
|
+
}
|
|
1576
|
+
return n === "Yo" ? e.ordinalNumber(i, { unit: "year" }) : w(i, n.length);
|
|
1577
|
+
},
|
|
1578
|
+
// ISO week-numbering year
|
|
1579
|
+
R: function(t, n) {
|
|
1580
|
+
const e = ct(t);
|
|
1581
|
+
return w(e, n.length);
|
|
1582
|
+
},
|
|
1583
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
1584
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
1585
|
+
// | Year | `y` | `u` |
|
|
1586
|
+
// |------|-----|-----|
|
|
1587
|
+
// | AC 1 | 1 | 1 |
|
|
1588
|
+
// | BC 1 | 1 | 0 |
|
|
1589
|
+
// | BC 2 | 2 | -1 |
|
|
1590
|
+
// Also `yy` always returns the last two digits of a year,
|
|
1591
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
1592
|
+
u: function(t, n) {
|
|
1593
|
+
const e = t.getFullYear();
|
|
1594
|
+
return w(e, n.length);
|
|
1595
|
+
},
|
|
1596
|
+
// Quarter
|
|
1597
|
+
Q: function(t, n, e) {
|
|
1598
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
1599
|
+
switch (n) {
|
|
1600
|
+
// 1, 2, 3, 4
|
|
1601
|
+
case "Q":
|
|
1602
|
+
return String(r);
|
|
1603
|
+
// 01, 02, 03, 04
|
|
1604
|
+
case "QQ":
|
|
1605
|
+
return w(r, 2);
|
|
1606
|
+
// 1st, 2nd, 3rd, 4th
|
|
1607
|
+
case "Qo":
|
|
1608
|
+
return e.ordinalNumber(r, { unit: "quarter" });
|
|
1609
|
+
// Q1, Q2, Q3, Q4
|
|
1610
|
+
case "QQQ":
|
|
1611
|
+
return e.quarter(r, {
|
|
1612
|
+
width: "abbreviated",
|
|
1613
|
+
context: "formatting"
|
|
1614
|
+
});
|
|
1615
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1616
|
+
case "QQQQQ":
|
|
1617
|
+
return e.quarter(r, {
|
|
1618
|
+
width: "narrow",
|
|
1619
|
+
context: "formatting"
|
|
1620
|
+
});
|
|
1621
|
+
// 1st quarter, 2nd quarter, ...
|
|
1622
|
+
case "QQQQ":
|
|
1623
|
+
default:
|
|
1624
|
+
return e.quarter(r, {
|
|
1625
|
+
width: "wide",
|
|
1626
|
+
context: "formatting"
|
|
1627
|
+
});
|
|
1628
|
+
}
|
|
1629
|
+
},
|
|
1630
|
+
// Stand-alone quarter
|
|
1631
|
+
q: function(t, n, e) {
|
|
1632
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
1633
|
+
switch (n) {
|
|
1634
|
+
// 1, 2, 3, 4
|
|
1635
|
+
case "q":
|
|
1636
|
+
return String(r);
|
|
1637
|
+
// 01, 02, 03, 04
|
|
1638
|
+
case "qq":
|
|
1639
|
+
return w(r, 2);
|
|
1640
|
+
// 1st, 2nd, 3rd, 4th
|
|
1641
|
+
case "qo":
|
|
1642
|
+
return e.ordinalNumber(r, { unit: "quarter" });
|
|
1643
|
+
// Q1, Q2, Q3, Q4
|
|
1644
|
+
case "qqq":
|
|
1645
|
+
return e.quarter(r, {
|
|
1646
|
+
width: "abbreviated",
|
|
1647
|
+
context: "standalone"
|
|
1648
|
+
});
|
|
1649
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1650
|
+
case "qqqqq":
|
|
1651
|
+
return e.quarter(r, {
|
|
1652
|
+
width: "narrow",
|
|
1653
|
+
context: "standalone"
|
|
1654
|
+
});
|
|
1655
|
+
// 1st quarter, 2nd quarter, ...
|
|
1656
|
+
case "qqqq":
|
|
1657
|
+
default:
|
|
1658
|
+
return e.quarter(r, {
|
|
1659
|
+
width: "wide",
|
|
1660
|
+
context: "standalone"
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
},
|
|
1664
|
+
// Month
|
|
1665
|
+
M: function(t, n, e) {
|
|
1666
|
+
const r = t.getMonth();
|
|
1667
|
+
switch (n) {
|
|
1668
|
+
case "M":
|
|
1669
|
+
case "MM":
|
|
1670
|
+
return I.M(t, n);
|
|
1671
|
+
// 1st, 2nd, ..., 12th
|
|
1672
|
+
case "Mo":
|
|
1673
|
+
return e.ordinalNumber(r + 1, { unit: "month" });
|
|
1674
|
+
// Jan, Feb, ..., Dec
|
|
1675
|
+
case "MMM":
|
|
1676
|
+
return e.month(r, {
|
|
1677
|
+
width: "abbreviated",
|
|
1678
|
+
context: "formatting"
|
|
1679
|
+
});
|
|
1680
|
+
// J, F, ..., D
|
|
1681
|
+
case "MMMMM":
|
|
1682
|
+
return e.month(r, {
|
|
1683
|
+
width: "narrow",
|
|
1684
|
+
context: "formatting"
|
|
1685
|
+
});
|
|
1686
|
+
// January, February, ..., December
|
|
1687
|
+
case "MMMM":
|
|
1688
|
+
default:
|
|
1689
|
+
return e.month(r, { width: "wide", context: "formatting" });
|
|
1690
|
+
}
|
|
1691
|
+
},
|
|
1692
|
+
// Stand-alone month
|
|
1693
|
+
L: function(t, n, e) {
|
|
1694
|
+
const r = t.getMonth();
|
|
1695
|
+
switch (n) {
|
|
1696
|
+
// 1, 2, ..., 12
|
|
1697
|
+
case "L":
|
|
1698
|
+
return String(r + 1);
|
|
1699
|
+
// 01, 02, ..., 12
|
|
1700
|
+
case "LL":
|
|
1701
|
+
return w(r + 1, 2);
|
|
1702
|
+
// 1st, 2nd, ..., 12th
|
|
1703
|
+
case "Lo":
|
|
1704
|
+
return e.ordinalNumber(r + 1, { unit: "month" });
|
|
1705
|
+
// Jan, Feb, ..., Dec
|
|
1706
|
+
case "LLL":
|
|
1707
|
+
return e.month(r, {
|
|
1708
|
+
width: "abbreviated",
|
|
1709
|
+
context: "standalone"
|
|
1710
|
+
});
|
|
1711
|
+
// J, F, ..., D
|
|
1712
|
+
case "LLLLL":
|
|
1713
|
+
return e.month(r, {
|
|
1714
|
+
width: "narrow",
|
|
1715
|
+
context: "standalone"
|
|
1716
|
+
});
|
|
1717
|
+
// January, February, ..., December
|
|
1718
|
+
case "LLLL":
|
|
1719
|
+
default:
|
|
1720
|
+
return e.month(r, { width: "wide", context: "standalone" });
|
|
1721
|
+
}
|
|
1722
|
+
},
|
|
1723
|
+
// Local week of year
|
|
1724
|
+
w: function(t, n, e, r) {
|
|
1725
|
+
const a = pt(t, r);
|
|
1726
|
+
return n === "wo" ? e.ordinalNumber(a, { unit: "week" }) : w(a, n.length);
|
|
1727
|
+
},
|
|
1728
|
+
// ISO week of year
|
|
1729
|
+
I: function(t, n, e) {
|
|
1730
|
+
const r = ft(t);
|
|
1731
|
+
return n === "Io" ? e.ordinalNumber(r, { unit: "week" }) : w(r, n.length);
|
|
1732
|
+
},
|
|
1733
|
+
// Day of the month
|
|
1734
|
+
d: function(t, n, e) {
|
|
1735
|
+
return n === "do" ? e.ordinalNumber(t.getDate(), { unit: "date" }) : I.d(t, n);
|
|
1736
|
+
},
|
|
1737
|
+
// Day of year
|
|
1738
|
+
D: function(t, n, e) {
|
|
1739
|
+
const r = Zn(t);
|
|
1740
|
+
return n === "Do" ? e.ordinalNumber(r, { unit: "dayOfYear" }) : w(r, n.length);
|
|
1741
|
+
},
|
|
1742
|
+
// Day of week
|
|
1743
|
+
E: function(t, n, e) {
|
|
1744
|
+
const r = t.getDay();
|
|
1745
|
+
switch (n) {
|
|
1746
|
+
// Tue
|
|
1747
|
+
case "E":
|
|
1748
|
+
case "EE":
|
|
1749
|
+
case "EEE":
|
|
1750
|
+
return e.day(r, {
|
|
1751
|
+
width: "abbreviated",
|
|
1752
|
+
context: "formatting"
|
|
1753
|
+
});
|
|
1754
|
+
// T
|
|
1755
|
+
case "EEEEE":
|
|
1756
|
+
return e.day(r, {
|
|
1757
|
+
width: "narrow",
|
|
1758
|
+
context: "formatting"
|
|
1759
|
+
});
|
|
1760
|
+
// Tu
|
|
1761
|
+
case "EEEEEE":
|
|
1762
|
+
return e.day(r, {
|
|
1763
|
+
width: "short",
|
|
1764
|
+
context: "formatting"
|
|
1765
|
+
});
|
|
1766
|
+
// Tuesday
|
|
1767
|
+
case "EEEE":
|
|
1768
|
+
default:
|
|
1769
|
+
return e.day(r, {
|
|
1770
|
+
width: "wide",
|
|
1771
|
+
context: "formatting"
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
},
|
|
1775
|
+
// Local day of week
|
|
1776
|
+
e: function(t, n, e, r) {
|
|
1777
|
+
const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
1778
|
+
switch (n) {
|
|
1779
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1780
|
+
case "e":
|
|
1781
|
+
return String(i);
|
|
1782
|
+
// Padded numerical value
|
|
1783
|
+
case "ee":
|
|
1784
|
+
return w(i, 2);
|
|
1785
|
+
// 1st, 2nd, ..., 7th
|
|
1786
|
+
case "eo":
|
|
1787
|
+
return e.ordinalNumber(i, { unit: "day" });
|
|
1788
|
+
case "eee":
|
|
1789
|
+
return e.day(a, {
|
|
1790
|
+
width: "abbreviated",
|
|
1791
|
+
context: "formatting"
|
|
1792
|
+
});
|
|
1793
|
+
// T
|
|
1794
|
+
case "eeeee":
|
|
1795
|
+
return e.day(a, {
|
|
1796
|
+
width: "narrow",
|
|
1797
|
+
context: "formatting"
|
|
1798
|
+
});
|
|
1799
|
+
// Tu
|
|
1800
|
+
case "eeeeee":
|
|
1801
|
+
return e.day(a, {
|
|
1802
|
+
width: "short",
|
|
1803
|
+
context: "formatting"
|
|
1804
|
+
});
|
|
1805
|
+
// Tuesday
|
|
1806
|
+
case "eeee":
|
|
1807
|
+
default:
|
|
1808
|
+
return e.day(a, {
|
|
1809
|
+
width: "wide",
|
|
1810
|
+
context: "formatting"
|
|
1811
|
+
});
|
|
1812
|
+
}
|
|
1813
|
+
},
|
|
1814
|
+
// Stand-alone local day of week
|
|
1815
|
+
c: function(t, n, e, r) {
|
|
1816
|
+
const a = t.getDay(), i = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
1817
|
+
switch (n) {
|
|
1818
|
+
// Numerical value (same as in `e`)
|
|
1819
|
+
case "c":
|
|
1820
|
+
return String(i);
|
|
1821
|
+
// Padded numerical value
|
|
1822
|
+
case "cc":
|
|
1823
|
+
return w(i, n.length);
|
|
1824
|
+
// 1st, 2nd, ..., 7th
|
|
1825
|
+
case "co":
|
|
1826
|
+
return e.ordinalNumber(i, { unit: "day" });
|
|
1827
|
+
case "ccc":
|
|
1828
|
+
return e.day(a, {
|
|
1829
|
+
width: "abbreviated",
|
|
1830
|
+
context: "standalone"
|
|
1831
|
+
});
|
|
1832
|
+
// T
|
|
1833
|
+
case "ccccc":
|
|
1834
|
+
return e.day(a, {
|
|
1835
|
+
width: "narrow",
|
|
1836
|
+
context: "standalone"
|
|
1837
|
+
});
|
|
1838
|
+
// Tu
|
|
1839
|
+
case "cccccc":
|
|
1840
|
+
return e.day(a, {
|
|
1841
|
+
width: "short",
|
|
1842
|
+
context: "standalone"
|
|
1843
|
+
});
|
|
1844
|
+
// Tuesday
|
|
1845
|
+
case "cccc":
|
|
1846
|
+
default:
|
|
1847
|
+
return e.day(a, {
|
|
1848
|
+
width: "wide",
|
|
1849
|
+
context: "standalone"
|
|
1850
|
+
});
|
|
1851
|
+
}
|
|
1852
|
+
},
|
|
1853
|
+
// ISO day of week
|
|
1854
|
+
i: function(t, n, e) {
|
|
1855
|
+
const r = t.getDay(), a = r === 0 ? 7 : r;
|
|
1856
|
+
switch (n) {
|
|
1857
|
+
// 2
|
|
1858
|
+
case "i":
|
|
1859
|
+
return String(a);
|
|
1860
|
+
// 02
|
|
1861
|
+
case "ii":
|
|
1862
|
+
return w(a, n.length);
|
|
1863
|
+
// 2nd
|
|
1864
|
+
case "io":
|
|
1865
|
+
return e.ordinalNumber(a, { unit: "day" });
|
|
1866
|
+
// Tue
|
|
1867
|
+
case "iii":
|
|
1868
|
+
return e.day(r, {
|
|
1869
|
+
width: "abbreviated",
|
|
1870
|
+
context: "formatting"
|
|
1871
|
+
});
|
|
1872
|
+
// T
|
|
1873
|
+
case "iiiii":
|
|
1874
|
+
return e.day(r, {
|
|
1875
|
+
width: "narrow",
|
|
1876
|
+
context: "formatting"
|
|
1877
|
+
});
|
|
1878
|
+
// Tu
|
|
1879
|
+
case "iiiiii":
|
|
1880
|
+
return e.day(r, {
|
|
1881
|
+
width: "short",
|
|
1882
|
+
context: "formatting"
|
|
1883
|
+
});
|
|
1884
|
+
// Tuesday
|
|
1885
|
+
case "iiii":
|
|
1886
|
+
default:
|
|
1887
|
+
return e.day(r, {
|
|
1888
|
+
width: "wide",
|
|
1889
|
+
context: "formatting"
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1892
|
+
},
|
|
1893
|
+
// AM or PM
|
|
1894
|
+
a: function(t, n, e) {
|
|
1895
|
+
const a = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1896
|
+
switch (n) {
|
|
1897
|
+
case "a":
|
|
1898
|
+
case "aa":
|
|
1899
|
+
return e.dayPeriod(a, {
|
|
1900
|
+
width: "abbreviated",
|
|
1901
|
+
context: "formatting"
|
|
1902
|
+
});
|
|
1903
|
+
case "aaa":
|
|
1904
|
+
return e.dayPeriod(a, {
|
|
1905
|
+
width: "abbreviated",
|
|
1906
|
+
context: "formatting"
|
|
1907
|
+
}).toLowerCase();
|
|
1908
|
+
case "aaaaa":
|
|
1909
|
+
return e.dayPeriod(a, {
|
|
1910
|
+
width: "narrow",
|
|
1911
|
+
context: "formatting"
|
|
1912
|
+
});
|
|
1913
|
+
case "aaaa":
|
|
1914
|
+
default:
|
|
1915
|
+
return e.dayPeriod(a, {
|
|
1916
|
+
width: "wide",
|
|
1917
|
+
context: "formatting"
|
|
1918
|
+
});
|
|
1919
|
+
}
|
|
1920
|
+
},
|
|
1921
|
+
// AM, PM, midnight, noon
|
|
1922
|
+
b: function(t, n, e) {
|
|
1923
|
+
const r = t.getHours();
|
|
1924
|
+
let a;
|
|
1925
|
+
switch (r === 12 ? a = S.noon : r === 0 ? a = S.midnight : a = r / 12 >= 1 ? "pm" : "am", n) {
|
|
1926
|
+
case "b":
|
|
1927
|
+
case "bb":
|
|
1928
|
+
return e.dayPeriod(a, {
|
|
1929
|
+
width: "abbreviated",
|
|
1930
|
+
context: "formatting"
|
|
1931
|
+
});
|
|
1932
|
+
case "bbb":
|
|
1933
|
+
return e.dayPeriod(a, {
|
|
1934
|
+
width: "abbreviated",
|
|
1935
|
+
context: "formatting"
|
|
1936
|
+
}).toLowerCase();
|
|
1937
|
+
case "bbbbb":
|
|
1938
|
+
return e.dayPeriod(a, {
|
|
1939
|
+
width: "narrow",
|
|
1940
|
+
context: "formatting"
|
|
1941
|
+
});
|
|
1942
|
+
case "bbbb":
|
|
1943
|
+
default:
|
|
1944
|
+
return e.dayPeriod(a, {
|
|
1945
|
+
width: "wide",
|
|
1946
|
+
context: "formatting"
|
|
1947
|
+
});
|
|
1948
|
+
}
|
|
1949
|
+
},
|
|
1950
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
1951
|
+
B: function(t, n, e) {
|
|
1952
|
+
const r = t.getHours();
|
|
1953
|
+
let a;
|
|
1954
|
+
switch (r >= 17 ? a = S.evening : r >= 12 ? a = S.afternoon : r >= 4 ? a = S.morning : a = S.night, n) {
|
|
1955
|
+
case "B":
|
|
1956
|
+
case "BB":
|
|
1957
|
+
case "BBB":
|
|
1958
|
+
return e.dayPeriod(a, {
|
|
1959
|
+
width: "abbreviated",
|
|
1960
|
+
context: "formatting"
|
|
1961
|
+
});
|
|
1962
|
+
case "BBBBB":
|
|
1963
|
+
return e.dayPeriod(a, {
|
|
1964
|
+
width: "narrow",
|
|
1965
|
+
context: "formatting"
|
|
1966
|
+
});
|
|
1967
|
+
case "BBBB":
|
|
1968
|
+
default:
|
|
1969
|
+
return e.dayPeriod(a, {
|
|
1970
|
+
width: "wide",
|
|
1971
|
+
context: "formatting"
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
},
|
|
1975
|
+
// Hour [1-12]
|
|
1976
|
+
h: function(t, n, e) {
|
|
1977
|
+
if (n === "ho") {
|
|
1978
|
+
let r = t.getHours() % 12;
|
|
1979
|
+
return r === 0 && (r = 12), e.ordinalNumber(r, { unit: "hour" });
|
|
1980
|
+
}
|
|
1981
|
+
return I.h(t, n);
|
|
1982
|
+
},
|
|
1983
|
+
// Hour [0-23]
|
|
1984
|
+
H: function(t, n, e) {
|
|
1985
|
+
return n === "Ho" ? e.ordinalNumber(t.getHours(), { unit: "hour" }) : I.H(t, n);
|
|
1986
|
+
},
|
|
1987
|
+
// Hour [0-11]
|
|
1988
|
+
K: function(t, n, e) {
|
|
1989
|
+
const r = t.getHours() % 12;
|
|
1990
|
+
return n === "Ko" ? e.ordinalNumber(r, { unit: "hour" }) : w(r, n.length);
|
|
1991
|
+
},
|
|
1992
|
+
// Hour [1-24]
|
|
1993
|
+
k: function(t, n, e) {
|
|
1994
|
+
let r = t.getHours();
|
|
1995
|
+
return r === 0 && (r = 24), n === "ko" ? e.ordinalNumber(r, { unit: "hour" }) : w(r, n.length);
|
|
1996
|
+
},
|
|
1997
|
+
// Minute
|
|
1998
|
+
m: function(t, n, e) {
|
|
1999
|
+
return n === "mo" ? e.ordinalNumber(t.getMinutes(), { unit: "minute" }) : I.m(t, n);
|
|
2000
|
+
},
|
|
2001
|
+
// Second
|
|
2002
|
+
s: function(t, n, e) {
|
|
2003
|
+
return n === "so" ? e.ordinalNumber(t.getSeconds(), { unit: "second" }) : I.s(t, n);
|
|
2004
|
+
},
|
|
2005
|
+
// Fraction of second
|
|
2006
|
+
S: function(t, n) {
|
|
2007
|
+
return I.S(t, n);
|
|
2008
|
+
},
|
|
2009
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
2010
|
+
X: function(t, n, e) {
|
|
2011
|
+
const r = t.getTimezoneOffset();
|
|
2012
|
+
if (r === 0)
|
|
2013
|
+
return "Z";
|
|
2014
|
+
switch (n) {
|
|
2015
|
+
// Hours and optional minutes
|
|
2016
|
+
case "X":
|
|
2017
|
+
return Ze(r);
|
|
2018
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
2019
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2020
|
+
// so this token always has the same output as `XX`
|
|
2021
|
+
case "XXXX":
|
|
2022
|
+
case "XX":
|
|
2023
|
+
return Q(r);
|
|
2024
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
2025
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2026
|
+
// so this token always has the same output as `XXX`
|
|
2027
|
+
case "XXXXX":
|
|
2028
|
+
case "XXX":
|
|
2029
|
+
// Hours and minutes with `:` delimiter
|
|
2030
|
+
default:
|
|
2031
|
+
return Q(r, ":");
|
|
2032
|
+
}
|
|
2033
|
+
},
|
|
2034
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
2035
|
+
x: function(t, n, e) {
|
|
2036
|
+
const r = t.getTimezoneOffset();
|
|
2037
|
+
switch (n) {
|
|
2038
|
+
// Hours and optional minutes
|
|
2039
|
+
case "x":
|
|
2040
|
+
return Ze(r);
|
|
2041
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
2042
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2043
|
+
// so this token always has the same output as `xx`
|
|
2044
|
+
case "xxxx":
|
|
2045
|
+
case "xx":
|
|
2046
|
+
return Q(r);
|
|
2047
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
2048
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2049
|
+
// so this token always has the same output as `xxx`
|
|
2050
|
+
case "xxxxx":
|
|
2051
|
+
case "xxx":
|
|
2052
|
+
// Hours and minutes with `:` delimiter
|
|
2053
|
+
default:
|
|
2054
|
+
return Q(r, ":");
|
|
2055
|
+
}
|
|
2056
|
+
},
|
|
2057
|
+
// Timezone (GMT)
|
|
2058
|
+
O: function(t, n, e) {
|
|
2059
|
+
const r = t.getTimezoneOffset();
|
|
2060
|
+
switch (n) {
|
|
2061
|
+
// Short
|
|
2062
|
+
case "O":
|
|
2063
|
+
case "OO":
|
|
2064
|
+
case "OOO":
|
|
2065
|
+
return "GMT" + ze(r, ":");
|
|
2066
|
+
// Long
|
|
2067
|
+
case "OOOO":
|
|
2068
|
+
default:
|
|
2069
|
+
return "GMT" + Q(r, ":");
|
|
2070
|
+
}
|
|
2071
|
+
},
|
|
2072
|
+
// Timezone (specific non-location)
|
|
2073
|
+
z: function(t, n, e) {
|
|
2074
|
+
const r = t.getTimezoneOffset();
|
|
2075
|
+
switch (n) {
|
|
2076
|
+
// Short
|
|
2077
|
+
case "z":
|
|
2078
|
+
case "zz":
|
|
2079
|
+
case "zzz":
|
|
2080
|
+
return "GMT" + ze(r, ":");
|
|
2081
|
+
// Long
|
|
2082
|
+
case "zzzz":
|
|
2083
|
+
default:
|
|
2084
|
+
return "GMT" + Q(r, ":");
|
|
2085
|
+
}
|
|
2086
|
+
},
|
|
2087
|
+
// Seconds timestamp
|
|
2088
|
+
t: function(t, n, e) {
|
|
2089
|
+
const r = Math.trunc(+t / 1e3);
|
|
2090
|
+
return w(r, n.length);
|
|
2091
|
+
},
|
|
2092
|
+
// Milliseconds timestamp
|
|
2093
|
+
T: function(t, n, e) {
|
|
2094
|
+
return w(+t, n.length);
|
|
2095
|
+
}
|
|
2096
|
+
};
|
|
2097
|
+
function ze(t, n = "") {
|
|
2098
|
+
const e = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), i = r % 60;
|
|
2099
|
+
return i === 0 ? e + String(a) : e + String(a) + n + w(i, 2);
|
|
2100
|
+
}
|
|
2101
|
+
function Ze(t, n) {
|
|
2102
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + w(Math.abs(t) / 60, 2) : Q(t, n);
|
|
2103
|
+
}
|
|
2104
|
+
function Q(t, n = "") {
|
|
2105
|
+
const e = t > 0 ? "-" : "+", r = Math.abs(t), a = w(Math.trunc(r / 60), 2), i = w(r % 60, 2);
|
|
2106
|
+
return e + a + n + i;
|
|
2107
|
+
}
|
|
2108
|
+
const Je = (t, n) => {
|
|
2109
|
+
switch (t) {
|
|
2110
|
+
case "P":
|
|
2111
|
+
return n.date({ width: "short" });
|
|
2112
|
+
case "PP":
|
|
2113
|
+
return n.date({ width: "medium" });
|
|
2114
|
+
case "PPP":
|
|
2115
|
+
return n.date({ width: "long" });
|
|
2116
|
+
case "PPPP":
|
|
2117
|
+
default:
|
|
2118
|
+
return n.date({ width: "full" });
|
|
2119
|
+
}
|
|
2120
|
+
}, ht = (t, n) => {
|
|
2121
|
+
switch (t) {
|
|
2122
|
+
case "p":
|
|
2123
|
+
return n.time({ width: "short" });
|
|
2124
|
+
case "pp":
|
|
2125
|
+
return n.time({ width: "medium" });
|
|
2126
|
+
case "ppp":
|
|
2127
|
+
return n.time({ width: "long" });
|
|
2128
|
+
case "pppp":
|
|
2129
|
+
default:
|
|
2130
|
+
return n.time({ width: "full" });
|
|
2131
|
+
}
|
|
2132
|
+
}, Kn = (t, n) => {
|
|
2133
|
+
const e = t.match(/(P+)(p+)?/) || [], r = e[1], a = e[2];
|
|
2134
|
+
if (!a)
|
|
2135
|
+
return Je(t, n);
|
|
2136
|
+
let i;
|
|
2137
|
+
switch (r) {
|
|
2138
|
+
case "P":
|
|
2139
|
+
i = n.dateTime({ width: "short" });
|
|
2140
|
+
break;
|
|
2141
|
+
case "PP":
|
|
2142
|
+
i = n.dateTime({ width: "medium" });
|
|
2143
|
+
break;
|
|
2144
|
+
case "PPP":
|
|
2145
|
+
i = n.dateTime({ width: "long" });
|
|
2146
|
+
break;
|
|
2147
|
+
case "PPPP":
|
|
2148
|
+
default:
|
|
2149
|
+
i = n.dateTime({ width: "full" });
|
|
2150
|
+
break;
|
|
2151
|
+
}
|
|
2152
|
+
return i.replace("{{date}}", Je(r, n)).replace("{{time}}", ht(a, n));
|
|
2153
|
+
}, de = {
|
|
2154
|
+
p: ht,
|
|
2155
|
+
P: Kn
|
|
2156
|
+
}, Un = /^D+$/, ea = /^Y+$/, ta = ["D", "DD", "YY", "YYYY"];
|
|
2157
|
+
function mt(t) {
|
|
2158
|
+
return Un.test(t);
|
|
2159
|
+
}
|
|
2160
|
+
function wt(t) {
|
|
2161
|
+
return ea.test(t);
|
|
2162
|
+
}
|
|
2163
|
+
function fe(t, n, e) {
|
|
2164
|
+
const r = ra(t, n, e);
|
|
2165
|
+
if (console.warn(r), ta.includes(t)) throw new RangeError(r);
|
|
2166
|
+
}
|
|
2167
|
+
function ra(t, n, e) {
|
|
2168
|
+
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
2169
|
+
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${r} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
2170
|
+
}
|
|
2171
|
+
const na = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, aa = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, ia = /^'([^]*?)'?$/, sa = /''/g, oa = /[a-zA-Z]/;
|
|
2172
|
+
function ua(t, n, e) {
|
|
2173
|
+
var y, b, k, T;
|
|
2174
|
+
const r = G(), a = r.locale ?? dt, i = r.firstWeekContainsDate ?? ((b = (y = r.locale) == null ? void 0 : y.options) == null ? void 0 : b.firstWeekContainsDate) ?? 1, s = r.weekStartsOn ?? ((T = (k = r.locale) == null ? void 0 : k.options) == null ? void 0 : T.weekStartsOn) ?? 0, o = M(t, e == null ? void 0 : e.in);
|
|
2175
|
+
if (!lt(o))
|
|
2176
|
+
throw new RangeError("Invalid time value");
|
|
2177
|
+
let c = n.match(aa).map((l) => {
|
|
2178
|
+
const d = l[0];
|
|
2179
|
+
if (d === "p" || d === "P") {
|
|
2180
|
+
const _ = de[d];
|
|
2181
|
+
return _(l, a.formatLong);
|
|
2182
|
+
}
|
|
2183
|
+
return l;
|
|
2184
|
+
}).join("").match(na).map((l) => {
|
|
2185
|
+
if (l === "''")
|
|
2186
|
+
return { isToken: !1, value: "'" };
|
|
2187
|
+
const d = l[0];
|
|
2188
|
+
if (d === "'")
|
|
2189
|
+
return { isToken: !1, value: ca(l) };
|
|
2190
|
+
if (Ve[d])
|
|
2191
|
+
return { isToken: !0, value: l };
|
|
2192
|
+
if (d.match(oa))
|
|
2193
|
+
throw new RangeError(
|
|
2194
|
+
"Format string contains an unescaped latin alphabet character `" + d + "`"
|
|
2195
|
+
);
|
|
2196
|
+
return { isToken: !1, value: l };
|
|
2197
|
+
});
|
|
2198
|
+
a.localize.preprocessor && (c = a.localize.preprocessor(o, c));
|
|
2199
|
+
const h = {
|
|
2200
|
+
firstWeekContainsDate: i,
|
|
2201
|
+
weekStartsOn: s,
|
|
2202
|
+
locale: a
|
|
2203
|
+
};
|
|
2204
|
+
return c.map((l) => {
|
|
2205
|
+
if (!l.isToken) return l.value;
|
|
2206
|
+
const d = l.value;
|
|
2207
|
+
(wt(d) || mt(d)) && fe(d, n, String(t));
|
|
2208
|
+
const _ = Ve[d[0]];
|
|
2209
|
+
return _(o, d, a.localize, h);
|
|
2210
|
+
}).join("");
|
|
2211
|
+
}
|
|
2212
|
+
function ca(t) {
|
|
2213
|
+
const n = t.match(ia);
|
|
2214
|
+
return n ? n[1].replace(sa, "'") : t;
|
|
2215
|
+
}
|
|
2216
|
+
function la() {
|
|
2217
|
+
return Object.assign({}, G());
|
|
2218
|
+
}
|
|
2219
|
+
function da(t, n) {
|
|
2220
|
+
const e = M(t, n == null ? void 0 : n.in).getDay();
|
|
2221
|
+
return e === 0 ? 7 : e;
|
|
2222
|
+
}
|
|
2223
|
+
function fa(t, n) {
|
|
2224
|
+
const e = pa(n) ? new n(0) : D(n, 0);
|
|
2225
|
+
return e.setFullYear(t.getFullYear(), t.getMonth(), t.getDate()), e.setHours(
|
|
2226
|
+
t.getHours(),
|
|
2227
|
+
t.getMinutes(),
|
|
2228
|
+
t.getSeconds(),
|
|
2229
|
+
t.getMilliseconds()
|
|
2230
|
+
), e;
|
|
2231
|
+
}
|
|
2232
|
+
function pa(t) {
|
|
2233
|
+
var n;
|
|
2234
|
+
return typeof t == "function" && ((n = t.prototype) == null ? void 0 : n.constructor) === t;
|
|
2235
|
+
}
|
|
2236
|
+
const ha = 10;
|
|
2237
|
+
class yt {
|
|
2238
|
+
constructor() {
|
|
2239
|
+
u(this, "subPriority", 0);
|
|
2240
|
+
}
|
|
2241
|
+
validate(n, e) {
|
|
2242
|
+
return !0;
|
|
2243
|
+
}
|
|
2244
|
+
}
|
|
2245
|
+
class ma extends yt {
|
|
2246
|
+
constructor(n, e, r, a, i) {
|
|
2247
|
+
super(), this.value = n, this.validateValue = e, this.setValue = r, this.priority = a, i && (this.subPriority = i);
|
|
2248
|
+
}
|
|
2249
|
+
validate(n, e) {
|
|
2250
|
+
return this.validateValue(n, this.value, e);
|
|
2251
|
+
}
|
|
2252
|
+
set(n, e, r) {
|
|
2253
|
+
return this.setValue(n, e, this.value, r);
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2256
|
+
class wa extends yt {
|
|
2257
|
+
constructor(e, r) {
|
|
2258
|
+
super();
|
|
2259
|
+
u(this, "priority", ha);
|
|
2260
|
+
u(this, "subPriority", -1);
|
|
2261
|
+
this.context = e || ((a) => D(r, a));
|
|
2262
|
+
}
|
|
2263
|
+
set(e, r) {
|
|
2264
|
+
return r.timestampIsSet ? e : D(e, fa(e, this.context));
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
class m {
|
|
2268
|
+
run(n, e, r, a) {
|
|
2269
|
+
const i = this.parse(n, e, r, a);
|
|
2270
|
+
return i ? {
|
|
2271
|
+
setter: new ma(
|
|
2272
|
+
i.value,
|
|
2273
|
+
this.validate,
|
|
2274
|
+
this.set,
|
|
2275
|
+
this.priority,
|
|
2276
|
+
this.subPriority
|
|
2277
|
+
),
|
|
2278
|
+
rest: i.rest
|
|
2279
|
+
} : null;
|
|
2280
|
+
}
|
|
2281
|
+
validate(n, e, r) {
|
|
2282
|
+
return !0;
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
class ya extends m {
|
|
2286
|
+
constructor() {
|
|
2287
|
+
super(...arguments);
|
|
2288
|
+
u(this, "priority", 140);
|
|
2289
|
+
u(this, "incompatibleTokens", ["R", "u", "t", "T"]);
|
|
2290
|
+
}
|
|
2291
|
+
parse(e, r, a) {
|
|
2292
|
+
switch (r) {
|
|
2293
|
+
// AD, BC
|
|
2294
|
+
case "G":
|
|
2295
|
+
case "GG":
|
|
2296
|
+
case "GGG":
|
|
2297
|
+
return a.era(e, { width: "abbreviated" }) || a.era(e, { width: "narrow" });
|
|
2298
|
+
// A, B
|
|
2299
|
+
case "GGGGG":
|
|
2300
|
+
return a.era(e, { width: "narrow" });
|
|
2301
|
+
// Anno Domini, Before Christ
|
|
2302
|
+
case "GGGG":
|
|
2303
|
+
default:
|
|
2304
|
+
return a.era(e, { width: "wide" }) || a.era(e, { width: "abbreviated" }) || a.era(e, { width: "narrow" });
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
set(e, r, a) {
|
|
2308
|
+
return r.era = a, e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
2309
|
+
}
|
|
2310
|
+
}
|
|
2311
|
+
const P = {
|
|
2312
|
+
month: /^(1[0-2]|0?\d)/,
|
|
2313
|
+
// 0 to 12
|
|
2314
|
+
date: /^(3[0-1]|[0-2]?\d)/,
|
|
2315
|
+
// 0 to 31
|
|
2316
|
+
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
2317
|
+
// 0 to 366
|
|
2318
|
+
week: /^(5[0-3]|[0-4]?\d)/,
|
|
2319
|
+
// 0 to 53
|
|
2320
|
+
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
2321
|
+
// 0 to 23
|
|
2322
|
+
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
2323
|
+
// 0 to 24
|
|
2324
|
+
hour11h: /^(1[0-1]|0?\d)/,
|
|
2325
|
+
// 0 to 11
|
|
2326
|
+
hour12h: /^(1[0-2]|0?\d)/,
|
|
2327
|
+
// 0 to 12
|
|
2328
|
+
minute: /^[0-5]?\d/,
|
|
2329
|
+
// 0 to 59
|
|
2330
|
+
second: /^[0-5]?\d/,
|
|
2331
|
+
// 0 to 59
|
|
2332
|
+
singleDigit: /^\d/,
|
|
2333
|
+
// 0 to 9
|
|
2334
|
+
twoDigits: /^\d{1,2}/,
|
|
2335
|
+
// 0 to 99
|
|
2336
|
+
threeDigits: /^\d{1,3}/,
|
|
2337
|
+
// 0 to 999
|
|
2338
|
+
fourDigits: /^\d{1,4}/,
|
|
2339
|
+
// 0 to 9999
|
|
2340
|
+
anyDigitsSigned: /^-?\d+/,
|
|
2341
|
+
singleDigitSigned: /^-?\d/,
|
|
2342
|
+
// 0 to 9, -0 to -9
|
|
2343
|
+
twoDigitsSigned: /^-?\d{1,2}/,
|
|
2344
|
+
// 0 to 99, -0 to -99
|
|
2345
|
+
threeDigitsSigned: /^-?\d{1,3}/,
|
|
2346
|
+
// 0 to 999, -0 to -999
|
|
2347
|
+
fourDigitsSigned: /^-?\d{1,4}/
|
|
2348
|
+
// 0 to 9999, -0 to -9999
|
|
2349
|
+
}, H = {
|
|
2350
|
+
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
2351
|
+
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
2352
|
+
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
2353
|
+
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
2354
|
+
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
2355
|
+
};
|
|
2356
|
+
function O(t, n) {
|
|
2357
|
+
return t && {
|
|
2358
|
+
value: n(t.value),
|
|
2359
|
+
rest: t.rest
|
|
2360
|
+
};
|
|
2361
|
+
}
|
|
2362
|
+
function x(t, n) {
|
|
2363
|
+
const e = n.match(t);
|
|
2364
|
+
return e ? {
|
|
2365
|
+
value: parseInt(e[0], 10),
|
|
2366
|
+
rest: n.slice(e[0].length)
|
|
2367
|
+
} : null;
|
|
2368
|
+
}
|
|
2369
|
+
function C(t, n) {
|
|
2370
|
+
const e = n.match(t);
|
|
2371
|
+
if (!e)
|
|
2372
|
+
return null;
|
|
2373
|
+
if (e[0] === "Z")
|
|
2374
|
+
return {
|
|
2375
|
+
value: 0,
|
|
2376
|
+
rest: n.slice(1)
|
|
2377
|
+
};
|
|
2378
|
+
const r = e[1] === "+" ? 1 : -1, a = e[2] ? parseInt(e[2], 10) : 0, i = e[3] ? parseInt(e[3], 10) : 0, s = e[5] ? parseInt(e[5], 10) : 0;
|
|
2379
|
+
return {
|
|
2380
|
+
value: r * (a * ln + i * cn + s * dn),
|
|
2381
|
+
rest: n.slice(e[0].length)
|
|
2382
|
+
};
|
|
2383
|
+
}
|
|
2384
|
+
function _t(t) {
|
|
2385
|
+
return x(P.anyDigitsSigned, t);
|
|
2386
|
+
}
|
|
2387
|
+
function v(t, n) {
|
|
2388
|
+
switch (t) {
|
|
2389
|
+
case 1:
|
|
2390
|
+
return x(P.singleDigit, n);
|
|
2391
|
+
case 2:
|
|
2392
|
+
return x(P.twoDigits, n);
|
|
2393
|
+
case 3:
|
|
2394
|
+
return x(P.threeDigits, n);
|
|
2395
|
+
case 4:
|
|
2396
|
+
return x(P.fourDigits, n);
|
|
2397
|
+
default:
|
|
2398
|
+
return x(new RegExp("^\\d{1," + t + "}"), n);
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
function re(t, n) {
|
|
2402
|
+
switch (t) {
|
|
2403
|
+
case 1:
|
|
2404
|
+
return x(P.singleDigitSigned, n);
|
|
2405
|
+
case 2:
|
|
2406
|
+
return x(P.twoDigitsSigned, n);
|
|
2407
|
+
case 3:
|
|
2408
|
+
return x(P.threeDigitsSigned, n);
|
|
2409
|
+
case 4:
|
|
2410
|
+
return x(P.fourDigitsSigned, n);
|
|
2411
|
+
default:
|
|
2412
|
+
return x(new RegExp("^-?\\d{1," + t + "}"), n);
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
function we(t) {
|
|
2416
|
+
switch (t) {
|
|
2417
|
+
case "morning":
|
|
2418
|
+
return 4;
|
|
2419
|
+
case "evening":
|
|
2420
|
+
return 17;
|
|
2421
|
+
case "pm":
|
|
2422
|
+
case "noon":
|
|
2423
|
+
case "afternoon":
|
|
2424
|
+
return 12;
|
|
2425
|
+
case "am":
|
|
2426
|
+
case "midnight":
|
|
2427
|
+
case "night":
|
|
2428
|
+
default:
|
|
2429
|
+
return 0;
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
function gt(t, n) {
|
|
2433
|
+
const e = n > 0, r = e ? n : 1 - n;
|
|
2434
|
+
let a;
|
|
2435
|
+
if (r <= 50)
|
|
2436
|
+
a = t || 100;
|
|
2437
|
+
else {
|
|
2438
|
+
const i = r + 50, s = Math.trunc(i / 100) * 100, o = t >= i % 100;
|
|
2439
|
+
a = t + s - (o ? 100 : 0);
|
|
2440
|
+
}
|
|
2441
|
+
return e ? a : 1 - a;
|
|
2442
|
+
}
|
|
2443
|
+
function bt(t) {
|
|
2444
|
+
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
2445
|
+
}
|
|
2446
|
+
class _a extends m {
|
|
2447
|
+
constructor() {
|
|
2448
|
+
super(...arguments);
|
|
2449
|
+
u(this, "priority", 130);
|
|
2450
|
+
u(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
|
|
2451
|
+
}
|
|
2452
|
+
parse(e, r, a) {
|
|
2453
|
+
const i = (s) => ({
|
|
2454
|
+
year: s,
|
|
2455
|
+
isTwoDigitYear: r === "yy"
|
|
2456
|
+
});
|
|
2457
|
+
switch (r) {
|
|
2458
|
+
case "y":
|
|
2459
|
+
return O(v(4, e), i);
|
|
2460
|
+
case "yo":
|
|
2461
|
+
return O(
|
|
2462
|
+
a.ordinalNumber(e, {
|
|
2463
|
+
unit: "year"
|
|
2464
|
+
}),
|
|
2465
|
+
i
|
|
2466
|
+
);
|
|
2467
|
+
default:
|
|
2468
|
+
return O(v(r.length, e), i);
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
validate(e, r) {
|
|
2472
|
+
return r.isTwoDigitYear || r.year > 0;
|
|
2473
|
+
}
|
|
2474
|
+
set(e, r, a) {
|
|
2475
|
+
const i = e.getFullYear();
|
|
2476
|
+
if (a.isTwoDigitYear) {
|
|
2477
|
+
const o = gt(
|
|
2478
|
+
a.year,
|
|
2479
|
+
i
|
|
2480
|
+
);
|
|
2481
|
+
return e.setFullYear(o, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
2482
|
+
}
|
|
2483
|
+
const s = !("era" in r) || r.era === 1 ? a.year : 1 - a.year;
|
|
2484
|
+
return e.setFullYear(s, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
2485
|
+
}
|
|
2486
|
+
}
|
|
2487
|
+
class ga extends m {
|
|
2488
|
+
constructor() {
|
|
2489
|
+
super(...arguments);
|
|
2490
|
+
u(this, "priority", 130);
|
|
2491
|
+
u(this, "incompatibleTokens", [
|
|
2492
|
+
"y",
|
|
2493
|
+
"R",
|
|
2494
|
+
"u",
|
|
2495
|
+
"Q",
|
|
2496
|
+
"q",
|
|
2497
|
+
"M",
|
|
2498
|
+
"L",
|
|
2499
|
+
"I",
|
|
2500
|
+
"d",
|
|
2501
|
+
"D",
|
|
2502
|
+
"i",
|
|
2503
|
+
"t",
|
|
2504
|
+
"T"
|
|
2505
|
+
]);
|
|
2506
|
+
}
|
|
2507
|
+
parse(e, r, a) {
|
|
2508
|
+
const i = (s) => ({
|
|
2509
|
+
year: s,
|
|
2510
|
+
isTwoDigitYear: r === "YY"
|
|
2511
|
+
});
|
|
2512
|
+
switch (r) {
|
|
2513
|
+
case "Y":
|
|
2514
|
+
return O(v(4, e), i);
|
|
2515
|
+
case "Yo":
|
|
2516
|
+
return O(
|
|
2517
|
+
a.ordinalNumber(e, {
|
|
2518
|
+
unit: "year"
|
|
2519
|
+
}),
|
|
2520
|
+
i
|
|
2521
|
+
);
|
|
2522
|
+
default:
|
|
2523
|
+
return O(v(r.length, e), i);
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
validate(e, r) {
|
|
2527
|
+
return r.isTwoDigitYear || r.year > 0;
|
|
2528
|
+
}
|
|
2529
|
+
set(e, r, a, i) {
|
|
2530
|
+
const s = me(e, i);
|
|
2531
|
+
if (a.isTwoDigitYear) {
|
|
2532
|
+
const c = gt(
|
|
2533
|
+
a.year,
|
|
2534
|
+
s
|
|
2535
|
+
);
|
|
2536
|
+
return e.setFullYear(
|
|
2537
|
+
c,
|
|
2538
|
+
0,
|
|
2539
|
+
i.firstWeekContainsDate
|
|
2540
|
+
), e.setHours(0, 0, 0, 0), R(e, i);
|
|
2541
|
+
}
|
|
2542
|
+
const o = !("era" in r) || r.era === 1 ? a.year : 1 - a.year;
|
|
2543
|
+
return e.setFullYear(o, 0, i.firstWeekContainsDate), e.setHours(0, 0, 0, 0), R(e, i);
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
class ba extends m {
|
|
2547
|
+
constructor() {
|
|
2548
|
+
super(...arguments);
|
|
2549
|
+
u(this, "priority", 130);
|
|
2550
|
+
u(this, "incompatibleTokens", [
|
|
2551
|
+
"G",
|
|
2552
|
+
"y",
|
|
2553
|
+
"Y",
|
|
2554
|
+
"u",
|
|
2555
|
+
"Q",
|
|
2556
|
+
"q",
|
|
2557
|
+
"M",
|
|
2558
|
+
"L",
|
|
2559
|
+
"w",
|
|
2560
|
+
"d",
|
|
2561
|
+
"D",
|
|
2562
|
+
"e",
|
|
2563
|
+
"c",
|
|
2564
|
+
"t",
|
|
2565
|
+
"T"
|
|
2566
|
+
]);
|
|
2567
|
+
}
|
|
2568
|
+
parse(e, r) {
|
|
2569
|
+
return re(r === "R" ? 4 : r.length, e);
|
|
2570
|
+
}
|
|
2571
|
+
set(e, r, a) {
|
|
2572
|
+
const i = D(e, 0);
|
|
2573
|
+
return i.setFullYear(a, 0, 4), i.setHours(0, 0, 0, 0), X(i);
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
class xa extends m {
|
|
2577
|
+
constructor() {
|
|
2578
|
+
super(...arguments);
|
|
2579
|
+
u(this, "priority", 130);
|
|
2580
|
+
u(this, "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);
|
|
2581
|
+
}
|
|
2582
|
+
parse(e, r) {
|
|
2583
|
+
return re(r === "u" ? 4 : r.length, e);
|
|
2584
|
+
}
|
|
2585
|
+
set(e, r, a) {
|
|
2586
|
+
return e.setFullYear(a, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
class va extends m {
|
|
2590
|
+
constructor() {
|
|
2591
|
+
super(...arguments);
|
|
2592
|
+
u(this, "priority", 120);
|
|
2593
|
+
u(this, "incompatibleTokens", [
|
|
2594
|
+
"Y",
|
|
2595
|
+
"R",
|
|
2596
|
+
"q",
|
|
2597
|
+
"M",
|
|
2598
|
+
"L",
|
|
2599
|
+
"w",
|
|
2600
|
+
"I",
|
|
2601
|
+
"d",
|
|
2602
|
+
"D",
|
|
2603
|
+
"i",
|
|
2604
|
+
"e",
|
|
2605
|
+
"c",
|
|
2606
|
+
"t",
|
|
2607
|
+
"T"
|
|
2608
|
+
]);
|
|
2609
|
+
}
|
|
2610
|
+
parse(e, r, a) {
|
|
2611
|
+
switch (r) {
|
|
2612
|
+
// 1, 2, 3, 4
|
|
2613
|
+
case "Q":
|
|
2614
|
+
case "QQ":
|
|
2615
|
+
return v(r.length, e);
|
|
2616
|
+
// 1st, 2nd, 3rd, 4th
|
|
2617
|
+
case "Qo":
|
|
2618
|
+
return a.ordinalNumber(e, { unit: "quarter" });
|
|
2619
|
+
// Q1, Q2, Q3, Q4
|
|
2620
|
+
case "QQQ":
|
|
2621
|
+
return a.quarter(e, {
|
|
2622
|
+
width: "abbreviated",
|
|
2623
|
+
context: "formatting"
|
|
2624
|
+
}) || a.quarter(e, {
|
|
2625
|
+
width: "narrow",
|
|
2626
|
+
context: "formatting"
|
|
2627
|
+
});
|
|
2628
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
2629
|
+
case "QQQQQ":
|
|
2630
|
+
return a.quarter(e, {
|
|
2631
|
+
width: "narrow",
|
|
2632
|
+
context: "formatting"
|
|
2633
|
+
});
|
|
2634
|
+
// 1st quarter, 2nd quarter, ...
|
|
2635
|
+
case "QQQQ":
|
|
2636
|
+
default:
|
|
2637
|
+
return a.quarter(e, {
|
|
2638
|
+
width: "wide",
|
|
2639
|
+
context: "formatting"
|
|
2640
|
+
}) || a.quarter(e, {
|
|
2641
|
+
width: "abbreviated",
|
|
2642
|
+
context: "formatting"
|
|
2643
|
+
}) || a.quarter(e, {
|
|
2644
|
+
width: "narrow",
|
|
2645
|
+
context: "formatting"
|
|
2646
|
+
});
|
|
2647
|
+
}
|
|
2648
|
+
}
|
|
2649
|
+
validate(e, r) {
|
|
2650
|
+
return r >= 1 && r <= 4;
|
|
2651
|
+
}
|
|
2652
|
+
set(e, r, a) {
|
|
2653
|
+
return e.setMonth((a - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
class Pa extends m {
|
|
2657
|
+
constructor() {
|
|
2658
|
+
super(...arguments);
|
|
2659
|
+
u(this, "priority", 120);
|
|
2660
|
+
u(this, "incompatibleTokens", [
|
|
2661
|
+
"Y",
|
|
2662
|
+
"R",
|
|
2663
|
+
"Q",
|
|
2664
|
+
"M",
|
|
2665
|
+
"L",
|
|
2666
|
+
"w",
|
|
2667
|
+
"I",
|
|
2668
|
+
"d",
|
|
2669
|
+
"D",
|
|
2670
|
+
"i",
|
|
2671
|
+
"e",
|
|
2672
|
+
"c",
|
|
2673
|
+
"t",
|
|
2674
|
+
"T"
|
|
2675
|
+
]);
|
|
2676
|
+
}
|
|
2677
|
+
parse(e, r, a) {
|
|
2678
|
+
switch (r) {
|
|
2679
|
+
// 1, 2, 3, 4
|
|
2680
|
+
case "q":
|
|
2681
|
+
case "qq":
|
|
2682
|
+
return v(r.length, e);
|
|
2683
|
+
// 1st, 2nd, 3rd, 4th
|
|
2684
|
+
case "qo":
|
|
2685
|
+
return a.ordinalNumber(e, { unit: "quarter" });
|
|
2686
|
+
// Q1, Q2, Q3, Q4
|
|
2687
|
+
case "qqq":
|
|
2688
|
+
return a.quarter(e, {
|
|
2689
|
+
width: "abbreviated",
|
|
2690
|
+
context: "standalone"
|
|
2691
|
+
}) || a.quarter(e, {
|
|
2692
|
+
width: "narrow",
|
|
2693
|
+
context: "standalone"
|
|
2694
|
+
});
|
|
2695
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
2696
|
+
case "qqqqq":
|
|
2697
|
+
return a.quarter(e, {
|
|
2698
|
+
width: "narrow",
|
|
2699
|
+
context: "standalone"
|
|
2700
|
+
});
|
|
2701
|
+
// 1st quarter, 2nd quarter, ...
|
|
2702
|
+
case "qqqq":
|
|
2703
|
+
default:
|
|
2704
|
+
return a.quarter(e, {
|
|
2705
|
+
width: "wide",
|
|
2706
|
+
context: "standalone"
|
|
2707
|
+
}) || a.quarter(e, {
|
|
2708
|
+
width: "abbreviated",
|
|
2709
|
+
context: "standalone"
|
|
2710
|
+
}) || a.quarter(e, {
|
|
2711
|
+
width: "narrow",
|
|
2712
|
+
context: "standalone"
|
|
2713
|
+
});
|
|
2714
|
+
}
|
|
2715
|
+
}
|
|
2716
|
+
validate(e, r) {
|
|
2717
|
+
return r >= 1 && r <= 4;
|
|
2718
|
+
}
|
|
2719
|
+
set(e, r, a) {
|
|
2720
|
+
return e.setMonth((a - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
class Oa extends m {
|
|
2724
|
+
constructor() {
|
|
2725
|
+
super(...arguments);
|
|
2726
|
+
u(this, "incompatibleTokens", [
|
|
2727
|
+
"Y",
|
|
2728
|
+
"R",
|
|
2729
|
+
"q",
|
|
2730
|
+
"Q",
|
|
2731
|
+
"L",
|
|
2732
|
+
"w",
|
|
2733
|
+
"I",
|
|
2734
|
+
"D",
|
|
2735
|
+
"i",
|
|
2736
|
+
"e",
|
|
2737
|
+
"c",
|
|
2738
|
+
"t",
|
|
2739
|
+
"T"
|
|
2740
|
+
]);
|
|
2741
|
+
u(this, "priority", 110);
|
|
2742
|
+
}
|
|
2743
|
+
parse(e, r, a) {
|
|
2744
|
+
const i = (s) => s - 1;
|
|
2745
|
+
switch (r) {
|
|
2746
|
+
// 1, 2, ..., 12
|
|
2747
|
+
case "M":
|
|
2748
|
+
return O(
|
|
2749
|
+
x(P.month, e),
|
|
2750
|
+
i
|
|
2751
|
+
);
|
|
2752
|
+
// 01, 02, ..., 12
|
|
2753
|
+
case "MM":
|
|
2754
|
+
return O(v(2, e), i);
|
|
2755
|
+
// 1st, 2nd, ..., 12th
|
|
2756
|
+
case "Mo":
|
|
2757
|
+
return O(
|
|
2758
|
+
a.ordinalNumber(e, {
|
|
2759
|
+
unit: "month"
|
|
2760
|
+
}),
|
|
2761
|
+
i
|
|
2762
|
+
);
|
|
2763
|
+
// Jan, Feb, ..., Dec
|
|
2764
|
+
case "MMM":
|
|
2765
|
+
return a.month(e, {
|
|
2766
|
+
width: "abbreviated",
|
|
2767
|
+
context: "formatting"
|
|
2768
|
+
}) || a.month(e, { width: "narrow", context: "formatting" });
|
|
2769
|
+
// J, F, ..., D
|
|
2770
|
+
case "MMMMM":
|
|
2771
|
+
return a.month(e, {
|
|
2772
|
+
width: "narrow",
|
|
2773
|
+
context: "formatting"
|
|
2774
|
+
});
|
|
2775
|
+
// January, February, ..., December
|
|
2776
|
+
case "MMMM":
|
|
2777
|
+
default:
|
|
2778
|
+
return a.month(e, { width: "wide", context: "formatting" }) || a.month(e, {
|
|
2779
|
+
width: "abbreviated",
|
|
2780
|
+
context: "formatting"
|
|
2781
|
+
}) || a.month(e, { width: "narrow", context: "formatting" });
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
validate(e, r) {
|
|
2785
|
+
return r >= 0 && r <= 11;
|
|
2786
|
+
}
|
|
2787
|
+
set(e, r, a) {
|
|
2788
|
+
return e.setMonth(a, 1), e.setHours(0, 0, 0, 0), e;
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
class Ma extends m {
|
|
2792
|
+
constructor() {
|
|
2793
|
+
super(...arguments);
|
|
2794
|
+
u(this, "priority", 110);
|
|
2795
|
+
u(this, "incompatibleTokens", [
|
|
2796
|
+
"Y",
|
|
2797
|
+
"R",
|
|
2798
|
+
"q",
|
|
2799
|
+
"Q",
|
|
2800
|
+
"M",
|
|
2801
|
+
"w",
|
|
2802
|
+
"I",
|
|
2803
|
+
"D",
|
|
2804
|
+
"i",
|
|
2805
|
+
"e",
|
|
2806
|
+
"c",
|
|
2807
|
+
"t",
|
|
2808
|
+
"T"
|
|
2809
|
+
]);
|
|
2810
|
+
}
|
|
2811
|
+
parse(e, r, a) {
|
|
2812
|
+
const i = (s) => s - 1;
|
|
2813
|
+
switch (r) {
|
|
2814
|
+
// 1, 2, ..., 12
|
|
2815
|
+
case "L":
|
|
2816
|
+
return O(
|
|
2817
|
+
x(P.month, e),
|
|
2818
|
+
i
|
|
2819
|
+
);
|
|
2820
|
+
// 01, 02, ..., 12
|
|
2821
|
+
case "LL":
|
|
2822
|
+
return O(v(2, e), i);
|
|
2823
|
+
// 1st, 2nd, ..., 12th
|
|
2824
|
+
case "Lo":
|
|
2825
|
+
return O(
|
|
2826
|
+
a.ordinalNumber(e, {
|
|
2827
|
+
unit: "month"
|
|
2828
|
+
}),
|
|
2829
|
+
i
|
|
2830
|
+
);
|
|
2831
|
+
// Jan, Feb, ..., Dec
|
|
2832
|
+
case "LLL":
|
|
2833
|
+
return a.month(e, {
|
|
2834
|
+
width: "abbreviated",
|
|
2835
|
+
context: "standalone"
|
|
2836
|
+
}) || a.month(e, { width: "narrow", context: "standalone" });
|
|
2837
|
+
// J, F, ..., D
|
|
2838
|
+
case "LLLLL":
|
|
2839
|
+
return a.month(e, {
|
|
2840
|
+
width: "narrow",
|
|
2841
|
+
context: "standalone"
|
|
2842
|
+
});
|
|
2843
|
+
// January, February, ..., December
|
|
2844
|
+
case "LLLL":
|
|
2845
|
+
default:
|
|
2846
|
+
return a.month(e, { width: "wide", context: "standalone" }) || a.month(e, {
|
|
2847
|
+
width: "abbreviated",
|
|
2848
|
+
context: "standalone"
|
|
2849
|
+
}) || a.month(e, { width: "narrow", context: "standalone" });
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
validate(e, r) {
|
|
2853
|
+
return r >= 0 && r <= 11;
|
|
2854
|
+
}
|
|
2855
|
+
set(e, r, a) {
|
|
2856
|
+
return e.setMonth(a, 1), e.setHours(0, 0, 0, 0), e;
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2859
|
+
function ka(t, n, e) {
|
|
2860
|
+
const r = M(t, e == null ? void 0 : e.in), a = pt(r, e) - n;
|
|
2861
|
+
return r.setDate(r.getDate() - a * 7), M(r, e == null ? void 0 : e.in);
|
|
2862
|
+
}
|
|
2863
|
+
class Da extends m {
|
|
2864
|
+
constructor() {
|
|
2865
|
+
super(...arguments);
|
|
2866
|
+
u(this, "priority", 100);
|
|
2867
|
+
u(this, "incompatibleTokens", [
|
|
2868
|
+
"y",
|
|
2869
|
+
"R",
|
|
2870
|
+
"u",
|
|
2871
|
+
"q",
|
|
2872
|
+
"Q",
|
|
2873
|
+
"M",
|
|
2874
|
+
"L",
|
|
2875
|
+
"I",
|
|
2876
|
+
"d",
|
|
2877
|
+
"D",
|
|
2878
|
+
"i",
|
|
2879
|
+
"t",
|
|
2880
|
+
"T"
|
|
2881
|
+
]);
|
|
2882
|
+
}
|
|
2883
|
+
parse(e, r, a) {
|
|
2884
|
+
switch (r) {
|
|
2885
|
+
case "w":
|
|
2886
|
+
return x(P.week, e);
|
|
2887
|
+
case "wo":
|
|
2888
|
+
return a.ordinalNumber(e, { unit: "week" });
|
|
2889
|
+
default:
|
|
2890
|
+
return v(r.length, e);
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
validate(e, r) {
|
|
2894
|
+
return r >= 1 && r <= 53;
|
|
2895
|
+
}
|
|
2896
|
+
set(e, r, a, i) {
|
|
2897
|
+
return R(ka(e, a, i), i);
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
function Ta(t, n, e) {
|
|
2901
|
+
const r = M(t, e == null ? void 0 : e.in), a = ft(r, e) - n;
|
|
2902
|
+
return r.setDate(r.getDate() - a * 7), r;
|
|
2903
|
+
}
|
|
2904
|
+
class qa extends m {
|
|
2905
|
+
constructor() {
|
|
2906
|
+
super(...arguments);
|
|
2907
|
+
u(this, "priority", 100);
|
|
2908
|
+
u(this, "incompatibleTokens", [
|
|
2909
|
+
"y",
|
|
2910
|
+
"Y",
|
|
2911
|
+
"u",
|
|
2912
|
+
"q",
|
|
2913
|
+
"Q",
|
|
2914
|
+
"M",
|
|
2915
|
+
"L",
|
|
2916
|
+
"w",
|
|
2917
|
+
"d",
|
|
2918
|
+
"D",
|
|
2919
|
+
"e",
|
|
2920
|
+
"c",
|
|
2921
|
+
"t",
|
|
2922
|
+
"T"
|
|
2923
|
+
]);
|
|
2924
|
+
}
|
|
2925
|
+
parse(e, r, a) {
|
|
2926
|
+
switch (r) {
|
|
2927
|
+
case "I":
|
|
2928
|
+
return x(P.week, e);
|
|
2929
|
+
case "Io":
|
|
2930
|
+
return a.ordinalNumber(e, { unit: "week" });
|
|
2931
|
+
default:
|
|
2932
|
+
return v(r.length, e);
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
validate(e, r) {
|
|
2936
|
+
return r >= 1 && r <= 53;
|
|
2937
|
+
}
|
|
2938
|
+
set(e, r, a) {
|
|
2939
|
+
return X(Ta(e, a));
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
const Na = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Ya = [
|
|
2943
|
+
31,
|
|
2944
|
+
29,
|
|
2945
|
+
31,
|
|
2946
|
+
30,
|
|
2947
|
+
31,
|
|
2948
|
+
30,
|
|
2949
|
+
31,
|
|
2950
|
+
31,
|
|
2951
|
+
30,
|
|
2952
|
+
31,
|
|
2953
|
+
30,
|
|
2954
|
+
31
|
|
2955
|
+
];
|
|
2956
|
+
class Ea extends m {
|
|
2957
|
+
constructor() {
|
|
2958
|
+
super(...arguments);
|
|
2959
|
+
u(this, "priority", 90);
|
|
2960
|
+
u(this, "subPriority", 1);
|
|
2961
|
+
u(this, "incompatibleTokens", [
|
|
2962
|
+
"Y",
|
|
2963
|
+
"R",
|
|
2964
|
+
"q",
|
|
2965
|
+
"Q",
|
|
2966
|
+
"w",
|
|
2967
|
+
"I",
|
|
2968
|
+
"D",
|
|
2969
|
+
"i",
|
|
2970
|
+
"e",
|
|
2971
|
+
"c",
|
|
2972
|
+
"t",
|
|
2973
|
+
"T"
|
|
2974
|
+
]);
|
|
2975
|
+
}
|
|
2976
|
+
parse(e, r, a) {
|
|
2977
|
+
switch (r) {
|
|
2978
|
+
case "d":
|
|
2979
|
+
return x(P.date, e);
|
|
2980
|
+
case "do":
|
|
2981
|
+
return a.ordinalNumber(e, { unit: "date" });
|
|
2982
|
+
default:
|
|
2983
|
+
return v(r.length, e);
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
validate(e, r) {
|
|
2987
|
+
const a = e.getFullYear(), i = bt(a), s = e.getMonth();
|
|
2988
|
+
return i ? r >= 1 && r <= Ya[s] : r >= 1 && r <= Na[s];
|
|
2989
|
+
}
|
|
2990
|
+
set(e, r, a) {
|
|
2991
|
+
return e.setDate(a), e.setHours(0, 0, 0, 0), e;
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
class Wa extends m {
|
|
2995
|
+
constructor() {
|
|
2996
|
+
super(...arguments);
|
|
2997
|
+
u(this, "priority", 90);
|
|
2998
|
+
u(this, "subpriority", 1);
|
|
2999
|
+
u(this, "incompatibleTokens", [
|
|
3000
|
+
"Y",
|
|
3001
|
+
"R",
|
|
3002
|
+
"q",
|
|
3003
|
+
"Q",
|
|
3004
|
+
"M",
|
|
3005
|
+
"L",
|
|
3006
|
+
"w",
|
|
3007
|
+
"I",
|
|
3008
|
+
"d",
|
|
3009
|
+
"E",
|
|
3010
|
+
"i",
|
|
3011
|
+
"e",
|
|
3012
|
+
"c",
|
|
3013
|
+
"t",
|
|
3014
|
+
"T"
|
|
3015
|
+
]);
|
|
3016
|
+
}
|
|
3017
|
+
parse(e, r, a) {
|
|
3018
|
+
switch (r) {
|
|
3019
|
+
case "D":
|
|
3020
|
+
case "DD":
|
|
3021
|
+
return x(P.dayOfYear, e);
|
|
3022
|
+
case "Do":
|
|
3023
|
+
return a.ordinalNumber(e, { unit: "date" });
|
|
3024
|
+
default:
|
|
3025
|
+
return v(r.length, e);
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
validate(e, r) {
|
|
3029
|
+
const a = e.getFullYear();
|
|
3030
|
+
return bt(a) ? r >= 1 && r <= 366 : r >= 1 && r <= 365;
|
|
3031
|
+
}
|
|
3032
|
+
set(e, r, a) {
|
|
3033
|
+
return e.setMonth(0, a), e.setHours(0, 0, 0, 0), e;
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
function ye(t, n, e) {
|
|
3037
|
+
var b, k, T, l;
|
|
3038
|
+
const r = G(), a = (e == null ? void 0 : e.weekStartsOn) ?? ((k = (b = e == null ? void 0 : e.locale) == null ? void 0 : b.options) == null ? void 0 : k.weekStartsOn) ?? r.weekStartsOn ?? ((l = (T = r.locale) == null ? void 0 : T.options) == null ? void 0 : l.weekStartsOn) ?? 0, i = M(t, e == null ? void 0 : e.in), s = i.getDay(), c = (n % 7 + 7) % 7, h = 7 - a, y = n < 0 || n > 6 ? n - (s + h) % 7 : (c + h) % 7 - (s + h) % 7;
|
|
3039
|
+
return ut(i, y, e);
|
|
3040
|
+
}
|
|
3041
|
+
class $a extends m {
|
|
3042
|
+
constructor() {
|
|
3043
|
+
super(...arguments);
|
|
3044
|
+
u(this, "priority", 90);
|
|
3045
|
+
u(this, "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]);
|
|
3046
|
+
}
|
|
3047
|
+
parse(e, r, a) {
|
|
3048
|
+
switch (r) {
|
|
3049
|
+
// Tue
|
|
3050
|
+
case "E":
|
|
3051
|
+
case "EE":
|
|
3052
|
+
case "EEE":
|
|
3053
|
+
return a.day(e, {
|
|
3054
|
+
width: "abbreviated",
|
|
3055
|
+
context: "formatting"
|
|
3056
|
+
}) || a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
|
|
3057
|
+
// T
|
|
3058
|
+
case "EEEEE":
|
|
3059
|
+
return a.day(e, {
|
|
3060
|
+
width: "narrow",
|
|
3061
|
+
context: "formatting"
|
|
3062
|
+
});
|
|
3063
|
+
// Tu
|
|
3064
|
+
case "EEEEEE":
|
|
3065
|
+
return a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
|
|
3066
|
+
// Tuesday
|
|
3067
|
+
case "EEEE":
|
|
3068
|
+
default:
|
|
3069
|
+
return a.day(e, { width: "wide", context: "formatting" }) || a.day(e, {
|
|
3070
|
+
width: "abbreviated",
|
|
3071
|
+
context: "formatting"
|
|
3072
|
+
}) || a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
|
|
3073
|
+
}
|
|
3074
|
+
}
|
|
3075
|
+
validate(e, r) {
|
|
3076
|
+
return r >= 0 && r <= 6;
|
|
3077
|
+
}
|
|
3078
|
+
set(e, r, a, i) {
|
|
3079
|
+
return e = ye(e, a, i), e.setHours(0, 0, 0, 0), e;
|
|
3080
|
+
}
|
|
3081
|
+
}
|
|
3082
|
+
class Ha extends m {
|
|
3083
|
+
constructor() {
|
|
3084
|
+
super(...arguments);
|
|
3085
|
+
u(this, "priority", 90);
|
|
3086
|
+
u(this, "incompatibleTokens", [
|
|
3087
|
+
"y",
|
|
3088
|
+
"R",
|
|
3089
|
+
"u",
|
|
3090
|
+
"q",
|
|
3091
|
+
"Q",
|
|
3092
|
+
"M",
|
|
3093
|
+
"L",
|
|
3094
|
+
"I",
|
|
3095
|
+
"d",
|
|
3096
|
+
"D",
|
|
3097
|
+
"E",
|
|
3098
|
+
"i",
|
|
3099
|
+
"c",
|
|
3100
|
+
"t",
|
|
3101
|
+
"T"
|
|
3102
|
+
]);
|
|
3103
|
+
}
|
|
3104
|
+
parse(e, r, a, i) {
|
|
3105
|
+
const s = (o) => {
|
|
3106
|
+
const c = Math.floor((o - 1) / 7) * 7;
|
|
3107
|
+
return (o + i.weekStartsOn + 6) % 7 + c;
|
|
3108
|
+
};
|
|
3109
|
+
switch (r) {
|
|
3110
|
+
// 3
|
|
3111
|
+
case "e":
|
|
3112
|
+
case "ee":
|
|
3113
|
+
return O(v(r.length, e), s);
|
|
3114
|
+
// 3rd
|
|
3115
|
+
case "eo":
|
|
3116
|
+
return O(
|
|
3117
|
+
a.ordinalNumber(e, {
|
|
3118
|
+
unit: "day"
|
|
3119
|
+
}),
|
|
3120
|
+
s
|
|
3121
|
+
);
|
|
3122
|
+
// Tue
|
|
3123
|
+
case "eee":
|
|
3124
|
+
return a.day(e, {
|
|
3125
|
+
width: "abbreviated",
|
|
3126
|
+
context: "formatting"
|
|
3127
|
+
}) || a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
|
|
3128
|
+
// T
|
|
3129
|
+
case "eeeee":
|
|
3130
|
+
return a.day(e, {
|
|
3131
|
+
width: "narrow",
|
|
3132
|
+
context: "formatting"
|
|
3133
|
+
});
|
|
3134
|
+
// Tu
|
|
3135
|
+
case "eeeeee":
|
|
3136
|
+
return a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
|
|
3137
|
+
// Tuesday
|
|
3138
|
+
case "eeee":
|
|
3139
|
+
default:
|
|
3140
|
+
return a.day(e, { width: "wide", context: "formatting" }) || a.day(e, {
|
|
3141
|
+
width: "abbreviated",
|
|
3142
|
+
context: "formatting"
|
|
3143
|
+
}) || a.day(e, { width: "short", context: "formatting" }) || a.day(e, { width: "narrow", context: "formatting" });
|
|
3144
|
+
}
|
|
3145
|
+
}
|
|
3146
|
+
validate(e, r) {
|
|
3147
|
+
return r >= 0 && r <= 6;
|
|
3148
|
+
}
|
|
3149
|
+
set(e, r, a, i) {
|
|
3150
|
+
return e = ye(e, a, i), e.setHours(0, 0, 0, 0), e;
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
class Ca extends m {
|
|
3154
|
+
constructor() {
|
|
3155
|
+
super(...arguments);
|
|
3156
|
+
u(this, "priority", 90);
|
|
3157
|
+
u(this, "incompatibleTokens", [
|
|
3158
|
+
"y",
|
|
3159
|
+
"R",
|
|
3160
|
+
"u",
|
|
3161
|
+
"q",
|
|
3162
|
+
"Q",
|
|
3163
|
+
"M",
|
|
3164
|
+
"L",
|
|
3165
|
+
"I",
|
|
3166
|
+
"d",
|
|
3167
|
+
"D",
|
|
3168
|
+
"E",
|
|
3169
|
+
"i",
|
|
3170
|
+
"e",
|
|
3171
|
+
"t",
|
|
3172
|
+
"T"
|
|
3173
|
+
]);
|
|
3174
|
+
}
|
|
3175
|
+
parse(e, r, a, i) {
|
|
3176
|
+
const s = (o) => {
|
|
3177
|
+
const c = Math.floor((o - 1) / 7) * 7;
|
|
3178
|
+
return (o + i.weekStartsOn + 6) % 7 + c;
|
|
3179
|
+
};
|
|
3180
|
+
switch (r) {
|
|
3181
|
+
// 3
|
|
3182
|
+
case "c":
|
|
3183
|
+
case "cc":
|
|
3184
|
+
return O(v(r.length, e), s);
|
|
3185
|
+
// 3rd
|
|
3186
|
+
case "co":
|
|
3187
|
+
return O(
|
|
3188
|
+
a.ordinalNumber(e, {
|
|
3189
|
+
unit: "day"
|
|
3190
|
+
}),
|
|
3191
|
+
s
|
|
3192
|
+
);
|
|
3193
|
+
// Tue
|
|
3194
|
+
case "ccc":
|
|
3195
|
+
return a.day(e, {
|
|
3196
|
+
width: "abbreviated",
|
|
3197
|
+
context: "standalone"
|
|
3198
|
+
}) || a.day(e, { width: "short", context: "standalone" }) || a.day(e, { width: "narrow", context: "standalone" });
|
|
3199
|
+
// T
|
|
3200
|
+
case "ccccc":
|
|
3201
|
+
return a.day(e, {
|
|
3202
|
+
width: "narrow",
|
|
3203
|
+
context: "standalone"
|
|
3204
|
+
});
|
|
3205
|
+
// Tu
|
|
3206
|
+
case "cccccc":
|
|
3207
|
+
return a.day(e, { width: "short", context: "standalone" }) || a.day(e, { width: "narrow", context: "standalone" });
|
|
3208
|
+
// Tuesday
|
|
3209
|
+
case "cccc":
|
|
3210
|
+
default:
|
|
3211
|
+
return a.day(e, { width: "wide", context: "standalone" }) || a.day(e, {
|
|
3212
|
+
width: "abbreviated",
|
|
3213
|
+
context: "standalone"
|
|
3214
|
+
}) || a.day(e, { width: "short", context: "standalone" }) || a.day(e, { width: "narrow", context: "standalone" });
|
|
3215
|
+
}
|
|
3216
|
+
}
|
|
3217
|
+
validate(e, r) {
|
|
3218
|
+
return r >= 0 && r <= 6;
|
|
3219
|
+
}
|
|
3220
|
+
set(e, r, a, i) {
|
|
3221
|
+
return e = ye(e, a, i), e.setHours(0, 0, 0, 0), e;
|
|
3222
|
+
}
|
|
3223
|
+
}
|
|
3224
|
+
function La(t, n, e) {
|
|
3225
|
+
const r = M(t, e == null ? void 0 : e.in), a = da(r, e), i = n - a;
|
|
3226
|
+
return ut(r, i, e);
|
|
3227
|
+
}
|
|
3228
|
+
class Fa extends m {
|
|
3229
|
+
constructor() {
|
|
3230
|
+
super(...arguments);
|
|
3231
|
+
u(this, "priority", 90);
|
|
3232
|
+
u(this, "incompatibleTokens", [
|
|
3233
|
+
"y",
|
|
3234
|
+
"Y",
|
|
3235
|
+
"u",
|
|
3236
|
+
"q",
|
|
3237
|
+
"Q",
|
|
3238
|
+
"M",
|
|
3239
|
+
"L",
|
|
3240
|
+
"w",
|
|
3241
|
+
"d",
|
|
3242
|
+
"D",
|
|
3243
|
+
"E",
|
|
3244
|
+
"e",
|
|
3245
|
+
"c",
|
|
3246
|
+
"t",
|
|
3247
|
+
"T"
|
|
3248
|
+
]);
|
|
3249
|
+
}
|
|
3250
|
+
parse(e, r, a) {
|
|
3251
|
+
const i = (s) => s === 0 ? 7 : s;
|
|
3252
|
+
switch (r) {
|
|
3253
|
+
// 2
|
|
3254
|
+
case "i":
|
|
3255
|
+
case "ii":
|
|
3256
|
+
return v(r.length, e);
|
|
3257
|
+
// 2nd
|
|
3258
|
+
case "io":
|
|
3259
|
+
return a.ordinalNumber(e, { unit: "day" });
|
|
3260
|
+
// Tue
|
|
3261
|
+
case "iii":
|
|
3262
|
+
return O(
|
|
3263
|
+
a.day(e, {
|
|
3264
|
+
width: "abbreviated",
|
|
3265
|
+
context: "formatting"
|
|
3266
|
+
}) || a.day(e, {
|
|
3267
|
+
width: "short",
|
|
3268
|
+
context: "formatting"
|
|
3269
|
+
}) || a.day(e, {
|
|
3270
|
+
width: "narrow",
|
|
3271
|
+
context: "formatting"
|
|
3272
|
+
}),
|
|
3273
|
+
i
|
|
3274
|
+
);
|
|
3275
|
+
// T
|
|
3276
|
+
case "iiiii":
|
|
3277
|
+
return O(
|
|
3278
|
+
a.day(e, {
|
|
3279
|
+
width: "narrow",
|
|
3280
|
+
context: "formatting"
|
|
3281
|
+
}),
|
|
3282
|
+
i
|
|
3283
|
+
);
|
|
3284
|
+
// Tu
|
|
3285
|
+
case "iiiiii":
|
|
3286
|
+
return O(
|
|
3287
|
+
a.day(e, {
|
|
3288
|
+
width: "short",
|
|
3289
|
+
context: "formatting"
|
|
3290
|
+
}) || a.day(e, {
|
|
3291
|
+
width: "narrow",
|
|
3292
|
+
context: "formatting"
|
|
3293
|
+
}),
|
|
3294
|
+
i
|
|
3295
|
+
);
|
|
3296
|
+
// Tuesday
|
|
3297
|
+
case "iiii":
|
|
3298
|
+
default:
|
|
3299
|
+
return O(
|
|
3300
|
+
a.day(e, {
|
|
3301
|
+
width: "wide",
|
|
3302
|
+
context: "formatting"
|
|
3303
|
+
}) || a.day(e, {
|
|
3304
|
+
width: "abbreviated",
|
|
3305
|
+
context: "formatting"
|
|
3306
|
+
}) || a.day(e, {
|
|
3307
|
+
width: "short",
|
|
3308
|
+
context: "formatting"
|
|
3309
|
+
}) || a.day(e, {
|
|
3310
|
+
width: "narrow",
|
|
3311
|
+
context: "formatting"
|
|
3312
|
+
}),
|
|
3313
|
+
i
|
|
3314
|
+
);
|
|
3315
|
+
}
|
|
3316
|
+
}
|
|
3317
|
+
validate(e, r) {
|
|
3318
|
+
return r >= 1 && r <= 7;
|
|
3319
|
+
}
|
|
3320
|
+
set(e, r, a) {
|
|
3321
|
+
return e = La(e, a), e.setHours(0, 0, 0, 0), e;
|
|
3322
|
+
}
|
|
3323
|
+
}
|
|
3324
|
+
class Ia extends m {
|
|
3325
|
+
constructor() {
|
|
3326
|
+
super(...arguments);
|
|
3327
|
+
u(this, "priority", 80);
|
|
3328
|
+
u(this, "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]);
|
|
3329
|
+
}
|
|
3330
|
+
parse(e, r, a) {
|
|
3331
|
+
switch (r) {
|
|
3332
|
+
case "a":
|
|
3333
|
+
case "aa":
|
|
3334
|
+
case "aaa":
|
|
3335
|
+
return a.dayPeriod(e, {
|
|
3336
|
+
width: "abbreviated",
|
|
3337
|
+
context: "formatting"
|
|
3338
|
+
}) || a.dayPeriod(e, {
|
|
3339
|
+
width: "narrow",
|
|
3340
|
+
context: "formatting"
|
|
3341
|
+
});
|
|
3342
|
+
case "aaaaa":
|
|
3343
|
+
return a.dayPeriod(e, {
|
|
3344
|
+
width: "narrow",
|
|
3345
|
+
context: "formatting"
|
|
3346
|
+
});
|
|
3347
|
+
case "aaaa":
|
|
3348
|
+
default:
|
|
3349
|
+
return a.dayPeriod(e, {
|
|
3350
|
+
width: "wide",
|
|
3351
|
+
context: "formatting"
|
|
3352
|
+
}) || a.dayPeriod(e, {
|
|
3353
|
+
width: "abbreviated",
|
|
3354
|
+
context: "formatting"
|
|
3355
|
+
}) || a.dayPeriod(e, {
|
|
3356
|
+
width: "narrow",
|
|
3357
|
+
context: "formatting"
|
|
3358
|
+
});
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
set(e, r, a) {
|
|
3362
|
+
return e.setHours(we(a), 0, 0, 0), e;
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
class ja extends m {
|
|
3366
|
+
constructor() {
|
|
3367
|
+
super(...arguments);
|
|
3368
|
+
u(this, "priority", 80);
|
|
3369
|
+
u(this, "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]);
|
|
3370
|
+
}
|
|
3371
|
+
parse(e, r, a) {
|
|
3372
|
+
switch (r) {
|
|
3373
|
+
case "b":
|
|
3374
|
+
case "bb":
|
|
3375
|
+
case "bbb":
|
|
3376
|
+
return a.dayPeriod(e, {
|
|
3377
|
+
width: "abbreviated",
|
|
3378
|
+
context: "formatting"
|
|
3379
|
+
}) || a.dayPeriod(e, {
|
|
3380
|
+
width: "narrow",
|
|
3381
|
+
context: "formatting"
|
|
3382
|
+
});
|
|
3383
|
+
case "bbbbb":
|
|
3384
|
+
return a.dayPeriod(e, {
|
|
3385
|
+
width: "narrow",
|
|
3386
|
+
context: "formatting"
|
|
3387
|
+
});
|
|
3388
|
+
case "bbbb":
|
|
3389
|
+
default:
|
|
3390
|
+
return a.dayPeriod(e, {
|
|
3391
|
+
width: "wide",
|
|
3392
|
+
context: "formatting"
|
|
3393
|
+
}) || a.dayPeriod(e, {
|
|
3394
|
+
width: "abbreviated",
|
|
3395
|
+
context: "formatting"
|
|
3396
|
+
}) || a.dayPeriod(e, {
|
|
3397
|
+
width: "narrow",
|
|
3398
|
+
context: "formatting"
|
|
3399
|
+
});
|
|
3400
|
+
}
|
|
3401
|
+
}
|
|
3402
|
+
set(e, r, a) {
|
|
3403
|
+
return e.setHours(we(a), 0, 0, 0), e;
|
|
3404
|
+
}
|
|
3405
|
+
}
|
|
3406
|
+
class Ra extends m {
|
|
3407
|
+
constructor() {
|
|
3408
|
+
super(...arguments);
|
|
3409
|
+
u(this, "priority", 80);
|
|
3410
|
+
u(this, "incompatibleTokens", ["a", "b", "t", "T"]);
|
|
3411
|
+
}
|
|
3412
|
+
parse(e, r, a) {
|
|
3413
|
+
switch (r) {
|
|
3414
|
+
case "B":
|
|
3415
|
+
case "BB":
|
|
3416
|
+
case "BBB":
|
|
3417
|
+
return a.dayPeriod(e, {
|
|
3418
|
+
width: "abbreviated",
|
|
3419
|
+
context: "formatting"
|
|
3420
|
+
}) || a.dayPeriod(e, {
|
|
3421
|
+
width: "narrow",
|
|
3422
|
+
context: "formatting"
|
|
3423
|
+
});
|
|
3424
|
+
case "BBBBB":
|
|
3425
|
+
return a.dayPeriod(e, {
|
|
3426
|
+
width: "narrow",
|
|
3427
|
+
context: "formatting"
|
|
3428
|
+
});
|
|
3429
|
+
case "BBBB":
|
|
3430
|
+
default:
|
|
3431
|
+
return a.dayPeriod(e, {
|
|
3432
|
+
width: "wide",
|
|
3433
|
+
context: "formatting"
|
|
3434
|
+
}) || a.dayPeriod(e, {
|
|
3435
|
+
width: "abbreviated",
|
|
3436
|
+
context: "formatting"
|
|
3437
|
+
}) || a.dayPeriod(e, {
|
|
3438
|
+
width: "narrow",
|
|
3439
|
+
context: "formatting"
|
|
3440
|
+
});
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
set(e, r, a) {
|
|
3444
|
+
return e.setHours(we(a), 0, 0, 0), e;
|
|
3445
|
+
}
|
|
3446
|
+
}
|
|
3447
|
+
class Aa extends m {
|
|
3448
|
+
constructor() {
|
|
3449
|
+
super(...arguments);
|
|
3450
|
+
u(this, "priority", 70);
|
|
3451
|
+
u(this, "incompatibleTokens", ["H", "K", "k", "t", "T"]);
|
|
3452
|
+
}
|
|
3453
|
+
parse(e, r, a) {
|
|
3454
|
+
switch (r) {
|
|
3455
|
+
case "h":
|
|
3456
|
+
return x(P.hour12h, e);
|
|
3457
|
+
case "ho":
|
|
3458
|
+
return a.ordinalNumber(e, { unit: "hour" });
|
|
3459
|
+
default:
|
|
3460
|
+
return v(r.length, e);
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
validate(e, r) {
|
|
3464
|
+
return r >= 1 && r <= 12;
|
|
3465
|
+
}
|
|
3466
|
+
set(e, r, a) {
|
|
3467
|
+
const i = e.getHours() >= 12;
|
|
3468
|
+
return i && a < 12 ? e.setHours(a + 12, 0, 0, 0) : !i && a === 12 ? e.setHours(0, 0, 0, 0) : e.setHours(a, 0, 0, 0), e;
|
|
3469
|
+
}
|
|
3470
|
+
}
|
|
3471
|
+
class Qa extends m {
|
|
3472
|
+
constructor() {
|
|
3473
|
+
super(...arguments);
|
|
3474
|
+
u(this, "priority", 70);
|
|
3475
|
+
u(this, "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]);
|
|
3476
|
+
}
|
|
3477
|
+
parse(e, r, a) {
|
|
3478
|
+
switch (r) {
|
|
3479
|
+
case "H":
|
|
3480
|
+
return x(P.hour23h, e);
|
|
3481
|
+
case "Ho":
|
|
3482
|
+
return a.ordinalNumber(e, { unit: "hour" });
|
|
3483
|
+
default:
|
|
3484
|
+
return v(r.length, e);
|
|
3485
|
+
}
|
|
3486
|
+
}
|
|
3487
|
+
validate(e, r) {
|
|
3488
|
+
return r >= 0 && r <= 23;
|
|
3489
|
+
}
|
|
3490
|
+
set(e, r, a) {
|
|
3491
|
+
return e.setHours(a, 0, 0, 0), e;
|
|
3492
|
+
}
|
|
3493
|
+
}
|
|
3494
|
+
class Ba extends m {
|
|
3495
|
+
constructor() {
|
|
3496
|
+
super(...arguments);
|
|
3497
|
+
u(this, "priority", 70);
|
|
3498
|
+
u(this, "incompatibleTokens", ["h", "H", "k", "t", "T"]);
|
|
3499
|
+
}
|
|
3500
|
+
parse(e, r, a) {
|
|
3501
|
+
switch (r) {
|
|
3502
|
+
case "K":
|
|
3503
|
+
return x(P.hour11h, e);
|
|
3504
|
+
case "Ko":
|
|
3505
|
+
return a.ordinalNumber(e, { unit: "hour" });
|
|
3506
|
+
default:
|
|
3507
|
+
return v(r.length, e);
|
|
3508
|
+
}
|
|
3509
|
+
}
|
|
3510
|
+
validate(e, r) {
|
|
3511
|
+
return r >= 0 && r <= 11;
|
|
3512
|
+
}
|
|
3513
|
+
set(e, r, a) {
|
|
3514
|
+
return e.getHours() >= 12 && a < 12 ? e.setHours(a + 12, 0, 0, 0) : e.setHours(a, 0, 0, 0), e;
|
|
3515
|
+
}
|
|
3516
|
+
}
|
|
3517
|
+
class Sa extends m {
|
|
3518
|
+
constructor() {
|
|
3519
|
+
super(...arguments);
|
|
3520
|
+
u(this, "priority", 70);
|
|
3521
|
+
u(this, "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]);
|
|
3522
|
+
}
|
|
3523
|
+
parse(e, r, a) {
|
|
3524
|
+
switch (r) {
|
|
3525
|
+
case "k":
|
|
3526
|
+
return x(P.hour24h, e);
|
|
3527
|
+
case "ko":
|
|
3528
|
+
return a.ordinalNumber(e, { unit: "hour" });
|
|
3529
|
+
default:
|
|
3530
|
+
return v(r.length, e);
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
validate(e, r) {
|
|
3534
|
+
return r >= 1 && r <= 24;
|
|
3535
|
+
}
|
|
3536
|
+
set(e, r, a) {
|
|
3537
|
+
const i = a <= 24 ? a % 24 : a;
|
|
3538
|
+
return e.setHours(i, 0, 0, 0), e;
|
|
3539
|
+
}
|
|
3540
|
+
}
|
|
3541
|
+
class Xa extends m {
|
|
3542
|
+
constructor() {
|
|
3543
|
+
super(...arguments);
|
|
3544
|
+
u(this, "priority", 60);
|
|
3545
|
+
u(this, "incompatibleTokens", ["t", "T"]);
|
|
3546
|
+
}
|
|
3547
|
+
parse(e, r, a) {
|
|
3548
|
+
switch (r) {
|
|
3549
|
+
case "m":
|
|
3550
|
+
return x(P.minute, e);
|
|
3551
|
+
case "mo":
|
|
3552
|
+
return a.ordinalNumber(e, { unit: "minute" });
|
|
3553
|
+
default:
|
|
3554
|
+
return v(r.length, e);
|
|
3555
|
+
}
|
|
3556
|
+
}
|
|
3557
|
+
validate(e, r) {
|
|
3558
|
+
return r >= 0 && r <= 59;
|
|
3559
|
+
}
|
|
3560
|
+
set(e, r, a) {
|
|
3561
|
+
return e.setMinutes(a, 0, 0), e;
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
class Ga extends m {
|
|
3565
|
+
constructor() {
|
|
3566
|
+
super(...arguments);
|
|
3567
|
+
u(this, "priority", 50);
|
|
3568
|
+
u(this, "incompatibleTokens", ["t", "T"]);
|
|
3569
|
+
}
|
|
3570
|
+
parse(e, r, a) {
|
|
3571
|
+
switch (r) {
|
|
3572
|
+
case "s":
|
|
3573
|
+
return x(P.second, e);
|
|
3574
|
+
case "so":
|
|
3575
|
+
return a.ordinalNumber(e, { unit: "second" });
|
|
3576
|
+
default:
|
|
3577
|
+
return v(r.length, e);
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
validate(e, r) {
|
|
3581
|
+
return r >= 0 && r <= 59;
|
|
3582
|
+
}
|
|
3583
|
+
set(e, r, a) {
|
|
3584
|
+
return e.setSeconds(a, 0), e;
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3587
|
+
class Va extends m {
|
|
3588
|
+
constructor() {
|
|
3589
|
+
super(...arguments);
|
|
3590
|
+
u(this, "priority", 30);
|
|
3591
|
+
u(this, "incompatibleTokens", ["t", "T"]);
|
|
3592
|
+
}
|
|
3593
|
+
parse(e, r) {
|
|
3594
|
+
const a = (i) => Math.trunc(i * Math.pow(10, -r.length + 3));
|
|
3595
|
+
return O(v(r.length, e), a);
|
|
3596
|
+
}
|
|
3597
|
+
set(e, r, a) {
|
|
3598
|
+
return e.setMilliseconds(a), e;
|
|
3599
|
+
}
|
|
3600
|
+
}
|
|
3601
|
+
class za extends m {
|
|
3602
|
+
constructor() {
|
|
3603
|
+
super(...arguments);
|
|
3604
|
+
u(this, "priority", 10);
|
|
3605
|
+
u(this, "incompatibleTokens", ["t", "T", "x"]);
|
|
3606
|
+
}
|
|
3607
|
+
parse(e, r) {
|
|
3608
|
+
switch (r) {
|
|
3609
|
+
case "X":
|
|
3610
|
+
return C(
|
|
3611
|
+
H.basicOptionalMinutes,
|
|
3612
|
+
e
|
|
3613
|
+
);
|
|
3614
|
+
case "XX":
|
|
3615
|
+
return C(H.basic, e);
|
|
3616
|
+
case "XXXX":
|
|
3617
|
+
return C(
|
|
3618
|
+
H.basicOptionalSeconds,
|
|
3619
|
+
e
|
|
3620
|
+
);
|
|
3621
|
+
case "XXXXX":
|
|
3622
|
+
return C(
|
|
3623
|
+
H.extendedOptionalSeconds,
|
|
3624
|
+
e
|
|
3625
|
+
);
|
|
3626
|
+
case "XXX":
|
|
3627
|
+
default:
|
|
3628
|
+
return C(H.extended, e);
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
set(e, r, a) {
|
|
3632
|
+
return r.timestampIsSet ? e : D(
|
|
3633
|
+
e,
|
|
3634
|
+
e.getTime() - te(e) - a
|
|
3635
|
+
);
|
|
3636
|
+
}
|
|
3637
|
+
}
|
|
3638
|
+
class Za extends m {
|
|
3639
|
+
constructor() {
|
|
3640
|
+
super(...arguments);
|
|
3641
|
+
u(this, "priority", 10);
|
|
3642
|
+
u(this, "incompatibleTokens", ["t", "T", "X"]);
|
|
3643
|
+
}
|
|
3644
|
+
parse(e, r) {
|
|
3645
|
+
switch (r) {
|
|
3646
|
+
case "x":
|
|
3647
|
+
return C(
|
|
3648
|
+
H.basicOptionalMinutes,
|
|
3649
|
+
e
|
|
3650
|
+
);
|
|
3651
|
+
case "xx":
|
|
3652
|
+
return C(H.basic, e);
|
|
3653
|
+
case "xxxx":
|
|
3654
|
+
return C(
|
|
3655
|
+
H.basicOptionalSeconds,
|
|
3656
|
+
e
|
|
3657
|
+
);
|
|
3658
|
+
case "xxxxx":
|
|
3659
|
+
return C(
|
|
3660
|
+
H.extendedOptionalSeconds,
|
|
3661
|
+
e
|
|
3662
|
+
);
|
|
3663
|
+
case "xxx":
|
|
3664
|
+
default:
|
|
3665
|
+
return C(H.extended, e);
|
|
3666
|
+
}
|
|
3667
|
+
}
|
|
3668
|
+
set(e, r, a) {
|
|
3669
|
+
return r.timestampIsSet ? e : D(
|
|
3670
|
+
e,
|
|
3671
|
+
e.getTime() - te(e) - a
|
|
3672
|
+
);
|
|
3673
|
+
}
|
|
3674
|
+
}
|
|
3675
|
+
class Ja extends m {
|
|
3676
|
+
constructor() {
|
|
3677
|
+
super(...arguments);
|
|
3678
|
+
u(this, "priority", 40);
|
|
3679
|
+
u(this, "incompatibleTokens", "*");
|
|
3680
|
+
}
|
|
3681
|
+
parse(e) {
|
|
3682
|
+
return _t(e);
|
|
3683
|
+
}
|
|
3684
|
+
set(e, r, a) {
|
|
3685
|
+
return [D(e, a * 1e3), { timestampIsSet: !0 }];
|
|
3686
|
+
}
|
|
3687
|
+
}
|
|
3688
|
+
class Ka extends m {
|
|
3689
|
+
constructor() {
|
|
3690
|
+
super(...arguments);
|
|
3691
|
+
u(this, "priority", 20);
|
|
3692
|
+
u(this, "incompatibleTokens", "*");
|
|
3693
|
+
}
|
|
3694
|
+
parse(e) {
|
|
3695
|
+
return _t(e);
|
|
3696
|
+
}
|
|
3697
|
+
set(e, r, a) {
|
|
3698
|
+
return [D(e, a), { timestampIsSet: !0 }];
|
|
3699
|
+
}
|
|
3700
|
+
}
|
|
3701
|
+
const Ua = {
|
|
3702
|
+
G: new ya(),
|
|
3703
|
+
y: new _a(),
|
|
3704
|
+
Y: new ga(),
|
|
3705
|
+
R: new ba(),
|
|
3706
|
+
u: new xa(),
|
|
3707
|
+
Q: new va(),
|
|
3708
|
+
q: new Pa(),
|
|
3709
|
+
M: new Oa(),
|
|
3710
|
+
L: new Ma(),
|
|
3711
|
+
w: new Da(),
|
|
3712
|
+
I: new qa(),
|
|
3713
|
+
d: new Ea(),
|
|
3714
|
+
D: new Wa(),
|
|
3715
|
+
E: new $a(),
|
|
3716
|
+
e: new Ha(),
|
|
3717
|
+
c: new Ca(),
|
|
3718
|
+
i: new Fa(),
|
|
3719
|
+
a: new Ia(),
|
|
3720
|
+
b: new ja(),
|
|
3721
|
+
B: new Ra(),
|
|
3722
|
+
h: new Aa(),
|
|
3723
|
+
H: new Qa(),
|
|
3724
|
+
K: new Ba(),
|
|
3725
|
+
k: new Sa(),
|
|
3726
|
+
m: new Xa(),
|
|
3727
|
+
s: new Ga(),
|
|
3728
|
+
S: new Va(),
|
|
3729
|
+
X: new za(),
|
|
3730
|
+
x: new Za(),
|
|
3731
|
+
t: new Ja(),
|
|
3732
|
+
T: new Ka()
|
|
3733
|
+
}, ei = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ti = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, ri = /^'([^]*?)'?$/, ni = /''/g, ai = /\S/, ii = /[a-zA-Z]/;
|
|
3734
|
+
function si(t, n, e, r) {
|
|
3735
|
+
var _, Y, L, W;
|
|
3736
|
+
const a = () => D(e, NaN), i = la(), s = i.locale ?? dt, o = i.firstWeekContainsDate ?? ((Y = (_ = i.locale) == null ? void 0 : _.options) == null ? void 0 : Y.firstWeekContainsDate) ?? 1, c = i.weekStartsOn ?? ((W = (L = i.locale) == null ? void 0 : L.options) == null ? void 0 : W.weekStartsOn) ?? 0, h = {
|
|
3737
|
+
firstWeekContainsDate: o,
|
|
3738
|
+
weekStartsOn: c,
|
|
3739
|
+
locale: s
|
|
3740
|
+
}, y = [new wa(r == null ? void 0 : r.in, e)], b = n.match(ti).map((f) => {
|
|
3741
|
+
const g = f[0];
|
|
3742
|
+
if (g in de) {
|
|
3743
|
+
const E = de[g];
|
|
3744
|
+
return E(f, s.formatLong);
|
|
3745
|
+
}
|
|
3746
|
+
return f;
|
|
3747
|
+
}).join("").match(ei), k = [];
|
|
3748
|
+
for (let f of b) {
|
|
3749
|
+
wt(f) && fe(f, n, t), mt(f) && fe(f, n, t);
|
|
3750
|
+
const g = f[0], E = Ua[g];
|
|
3751
|
+
if (E) {
|
|
3752
|
+
const { incompatibleTokens: V } = E;
|
|
3753
|
+
if (Array.isArray(V)) {
|
|
3754
|
+
const U = k.find(
|
|
3755
|
+
(ee) => V.includes(ee.token) || ee.token === g
|
|
3756
|
+
);
|
|
3757
|
+
if (U)
|
|
3758
|
+
throw new RangeError(
|
|
3759
|
+
`The format string mustn't contain \`${U.fullToken}\` and \`${f}\` at the same time`
|
|
3760
|
+
);
|
|
3761
|
+
} else if (E.incompatibleTokens === "*" && k.length > 0)
|
|
3762
|
+
throw new RangeError(
|
|
3763
|
+
`The format string mustn't contain \`${f}\` and any other token at the same time`
|
|
3764
|
+
);
|
|
3765
|
+
k.push({ token: g, fullToken: f });
|
|
3766
|
+
const B = E.run(
|
|
3767
|
+
t,
|
|
3768
|
+
f,
|
|
3769
|
+
s.match,
|
|
3770
|
+
h
|
|
3771
|
+
);
|
|
3772
|
+
if (!B)
|
|
3773
|
+
return a();
|
|
3774
|
+
y.push(B.setter), t = B.rest;
|
|
3775
|
+
} else {
|
|
3776
|
+
if (g.match(ii))
|
|
3777
|
+
throw new RangeError(
|
|
3778
|
+
"Format string contains an unescaped latin alphabet character `" + g + "`"
|
|
3779
|
+
);
|
|
3780
|
+
if (f === "''" ? f = "'" : g === "'" && (f = oi(f)), t.indexOf(f) === 0)
|
|
3781
|
+
t = t.slice(f.length);
|
|
3782
|
+
else
|
|
3783
|
+
return a();
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
if (t.length > 0 && ai.test(t))
|
|
3787
|
+
return a();
|
|
3788
|
+
const T = y.map((f) => f.priority).sort((f, g) => g - f).filter((f, g, E) => E.indexOf(f) === g).map(
|
|
3789
|
+
(f) => y.filter((g) => g.priority === f).sort((g, E) => E.subPriority - g.subPriority)
|
|
3790
|
+
).map((f) => f[0]);
|
|
3791
|
+
let l = M(e, r == null ? void 0 : r.in);
|
|
3792
|
+
if (isNaN(+l)) return a();
|
|
3793
|
+
const d = {};
|
|
3794
|
+
for (const f of T) {
|
|
3795
|
+
if (!f.validate(l, h))
|
|
3796
|
+
return a();
|
|
3797
|
+
const g = f.set(l, d, h);
|
|
3798
|
+
Array.isArray(g) ? (l = g[0], Object.assign(d, g[1])) : l = g;
|
|
3799
|
+
}
|
|
3800
|
+
return l;
|
|
3801
|
+
}
|
|
3802
|
+
function oi(t) {
|
|
3803
|
+
return t.match(ri)[1].replace(ni, "'");
|
|
3804
|
+
}
|
|
3805
|
+
const ui = {
|
|
3806
|
+
"purpur-date-field__container": "_purpur-date-field__container_ci2f4_1",
|
|
3807
|
+
"purpur-date-field__overlay": "_purpur-date-field__overlay_ci2f4_5",
|
|
3808
|
+
"purpur-date-field__start-adornment": "_purpur-date-field__start-adornment_ci2f4_16"
|
|
3809
|
+
}, ci = (t) => si(t, "yyyy-MM-dd", /* @__PURE__ */ new Date()), Ke = (t) => t ? ua(t, "yyyy-MM-dd") : "", li = (...t) => {
|
|
3810
|
+
const n = t.filter(Boolean);
|
|
3811
|
+
return n.length <= 1 ? n[0] || null : (e) => {
|
|
3812
|
+
for (const r of n)
|
|
3813
|
+
typeof r == "function" ? r(e) : r && (r.current = e);
|
|
3814
|
+
};
|
|
3815
|
+
}, oe = on.bind(ui), ue = "purpur-date-field", ce = "YYYY-MM-DD", di = pe(
|
|
3816
|
+
({ value: t, label: n, onChange: e, startAdornment: r, ...a }, i) => {
|
|
3817
|
+
const [s, o] = _e(Ke(t));
|
|
3818
|
+
kt(() => {
|
|
3819
|
+
o(t ? Ke(t) : "");
|
|
3820
|
+
}, [t]);
|
|
3821
|
+
const c = Ue(null), h = li(i, c), [y, b] = _e({});
|
|
3822
|
+
Dt(() => {
|
|
3823
|
+
if (c.current) {
|
|
3824
|
+
const d = window.document.querySelector(
|
|
3825
|
+
`label[for="${c.current.id}"]`
|
|
3826
|
+
), _ = d ? d.offsetHeight + 4 : 0, Y = window.getComputedStyle(c.current);
|
|
3827
|
+
b({
|
|
3828
|
+
position: "absolute",
|
|
3829
|
+
top: c.current.offsetTop + _,
|
|
3830
|
+
left: c.current.offsetLeft,
|
|
3831
|
+
padding: Y.padding,
|
|
3832
|
+
width: c.current.offsetWidth,
|
|
3833
|
+
height: c.current.offsetHeight
|
|
3834
|
+
});
|
|
3835
|
+
}
|
|
3836
|
+
}, [s, n, c]);
|
|
3837
|
+
const k = (d) => {
|
|
3838
|
+
if (d.length === 0 && (e == null || e(void 0)), d.length !== ce.length)
|
|
3839
|
+
return;
|
|
3840
|
+
const _ = ci(d);
|
|
3841
|
+
lt(_) && (e == null || e(_));
|
|
3842
|
+
}, T = (d) => {
|
|
3843
|
+
const _ = d.target.value.replace(/\D/g, "");
|
|
3844
|
+
let Y = "";
|
|
3845
|
+
_.length > 0 && (Y += _.slice(0, 4)), _.length > 4 && (Y += "-" + _.slice(4, 6)), _.length > 6 && (Y += "-" + _.slice(6, 8)), o(Y), k(d.target.value);
|
|
3846
|
+
}, l = () => ce.split("").map((_, Y) => {
|
|
3847
|
+
const L = s[Y];
|
|
3848
|
+
return /* @__PURE__ */ p(
|
|
3849
|
+
"span",
|
|
3850
|
+
{
|
|
3851
|
+
style: {
|
|
3852
|
+
color: L ? "transparent" : "var(--purpur-color-text-weak)"
|
|
3853
|
+
},
|
|
3854
|
+
children: L || _
|
|
3855
|
+
},
|
|
3856
|
+
Y
|
|
3857
|
+
);
|
|
3858
|
+
});
|
|
3859
|
+
return /* @__PURE__ */ j("div", { className: oe(`${ue}__container`), children: [
|
|
3860
|
+
/* @__PURE__ */ p(
|
|
3861
|
+
st,
|
|
3862
|
+
{
|
|
3863
|
+
...a,
|
|
3864
|
+
startAdornment: r ? /* @__PURE__ */ p("span", { className: oe(`${ue}__start-adornment`), children: r }) : void 0,
|
|
3865
|
+
ref: h,
|
|
3866
|
+
value: s,
|
|
3867
|
+
onChange: T,
|
|
3868
|
+
type: "text",
|
|
3869
|
+
maxLength: ce.length,
|
|
3870
|
+
inputMode: "numeric",
|
|
3871
|
+
label: n
|
|
3872
|
+
}
|
|
3873
|
+
),
|
|
3874
|
+
/* @__PURE__ */ p("div", { role: "presentation", style: y, className: oe(`${ue}__overlay`), children: l() })
|
|
3875
|
+
] });
|
|
3876
|
+
}
|
|
3877
|
+
);
|
|
3878
|
+
di.displayName = "DateField";
|
|
3879
|
+
export {
|
|
3880
|
+
di as DateField
|
|
3881
|
+
};
|
|
3882
|
+
//# sourceMappingURL=date-field.es.js.map
|