@kong-ui-public/core 1.8.1-pr.1587.c2e14872.0 → 1.9.0
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/core.es.js +888 -958
- package/dist/core.umd.js +1 -1
- package/package.json +2 -2
package/dist/core.es.js
CHANGED
|
@@ -1,210 +1,612 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { inject as
|
|
3
|
-
function
|
|
1
|
+
import L from "axios";
|
|
2
|
+
import { inject as J, ref as x, readonly as F, computed as $, nextTick as _, watchEffect as K } from "vue";
|
|
3
|
+
function ut() {
|
|
4
4
|
return {
|
|
5
|
-
getAxiosInstance: (
|
|
5
|
+
getAxiosInstance: (n = {}) => {
|
|
6
6
|
try {
|
|
7
|
-
const r =
|
|
8
|
-
return typeof r == "function" ? r(
|
|
7
|
+
const r = J("get-axios-instance", void 0);
|
|
8
|
+
return typeof r == "function" ? r(n) : L.create({
|
|
9
9
|
withCredentials: !0,
|
|
10
10
|
timeout: 3e4,
|
|
11
|
-
...
|
|
11
|
+
...n
|
|
12
12
|
});
|
|
13
13
|
} catch (r) {
|
|
14
|
-
return console.warn("getAxiosInstance:", r.message || r),
|
|
14
|
+
return console.warn("getAxiosInstance:", r.message || r), L.create({
|
|
15
15
|
withCredentials: !0,
|
|
16
16
|
timeout: 3e4,
|
|
17
|
-
...
|
|
17
|
+
...n
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
getTraceIdFromError: (
|
|
21
|
+
getTraceIdFromError: (n) => {
|
|
22
22
|
var r;
|
|
23
|
-
return ((r =
|
|
23
|
+
return ((r = n == null ? void 0 : n.response) == null ? void 0 : r.headers["x-datadog-trace-id"]) || "";
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
return
|
|
30
|
-
return typeof e;
|
|
31
|
-
} : function(e) {
|
|
32
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
33
|
-
}, Y(a);
|
|
27
|
+
function b(e) {
|
|
28
|
+
const t = Object.prototype.toString.call(e);
|
|
29
|
+
return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || t === "[object Number]" || typeof e == "string" || t === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
|
|
34
30
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
return NaN;
|
|
38
|
-
var e = Number(a);
|
|
39
|
-
return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e);
|
|
31
|
+
function O(e, t) {
|
|
32
|
+
return e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
40
33
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
const X = 6048e5, z = 864e5;
|
|
35
|
+
let Z = {};
|
|
36
|
+
function W() {
|
|
37
|
+
return Z;
|
|
44
38
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return a
|
|
39
|
+
function M(e, t) {
|
|
40
|
+
var u, i, d, f;
|
|
41
|
+
const n = W(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((i = (u = t == null ? void 0 : t.locale) == null ? void 0 : u.options) == null ? void 0 : i.weekStartsOn) ?? n.weekStartsOn ?? ((f = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : f.weekStartsOn) ?? 0, a = b(e), o = a.getDay(), c = (o < r ? 7 : 0) + o - r;
|
|
42
|
+
return a.setDate(a.getDate() - c), a.setHours(0, 0, 0, 0), a;
|
|
49
43
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
var t = y(a).getTime(), r = S(e);
|
|
53
|
-
return new Date(t + r);
|
|
44
|
+
function E(e) {
|
|
45
|
+
return M(e, { weekStartsOn: 1 });
|
|
54
46
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
function Q(e) {
|
|
48
|
+
const t = b(e), n = t.getFullYear(), r = O(e, 0);
|
|
49
|
+
r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
|
|
50
|
+
const a = E(r), o = O(e, 0);
|
|
51
|
+
o.setFullYear(n, 0, 4), o.setHours(0, 0, 0, 0);
|
|
52
|
+
const c = E(o);
|
|
53
|
+
return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >= c.getTime() ? n : n - 1;
|
|
58
54
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
return
|
|
55
|
+
function R(e) {
|
|
56
|
+
const t = b(e);
|
|
57
|
+
return t.setHours(0, 0, 0, 0), t;
|
|
62
58
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
59
|
+
function I(e) {
|
|
60
|
+
const t = b(e), n = new Date(
|
|
61
|
+
Date.UTC(
|
|
62
|
+
t.getFullYear(),
|
|
63
|
+
t.getMonth(),
|
|
64
|
+
t.getDate(),
|
|
65
|
+
t.getHours(),
|
|
66
|
+
t.getMinutes(),
|
|
67
|
+
t.getSeconds(),
|
|
68
|
+
t.getMilliseconds()
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
72
|
+
}
|
|
73
|
+
function ee(e, t) {
|
|
74
|
+
const n = R(e), r = R(t), a = +n - I(n), o = +r - I(r);
|
|
75
|
+
return Math.round((a - o) / z);
|
|
76
|
+
}
|
|
77
|
+
function te(e) {
|
|
78
|
+
const t = Q(e), n = O(e, 0);
|
|
79
|
+
return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), E(n);
|
|
65
80
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
81
|
+
function ne(e) {
|
|
82
|
+
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
83
|
+
}
|
|
84
|
+
function re(e) {
|
|
85
|
+
if (!ne(e) && typeof e != "number")
|
|
68
86
|
return !1;
|
|
69
|
-
|
|
70
|
-
return !isNaN(Number(
|
|
87
|
+
const t = b(e);
|
|
88
|
+
return !isNaN(Number(t));
|
|
71
89
|
}
|
|
72
|
-
function
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return se(a, -t);
|
|
90
|
+
function ae(e) {
|
|
91
|
+
const t = b(e), n = O(e, 0);
|
|
92
|
+
return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
76
93
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
94
|
+
const oe = {
|
|
95
|
+
lessThanXSeconds: {
|
|
96
|
+
one: "less than a second",
|
|
97
|
+
other: "less than {{count}} seconds"
|
|
98
|
+
},
|
|
99
|
+
xSeconds: {
|
|
100
|
+
one: "1 second",
|
|
101
|
+
other: "{{count}} seconds"
|
|
102
|
+
},
|
|
103
|
+
halfAMinute: "half a minute",
|
|
104
|
+
lessThanXMinutes: {
|
|
105
|
+
one: "less than a minute",
|
|
106
|
+
other: "less than {{count}} minutes"
|
|
107
|
+
},
|
|
108
|
+
xMinutes: {
|
|
109
|
+
one: "1 minute",
|
|
110
|
+
other: "{{count}} minutes"
|
|
111
|
+
},
|
|
112
|
+
aboutXHours: {
|
|
113
|
+
one: "about 1 hour",
|
|
114
|
+
other: "about {{count}} hours"
|
|
115
|
+
},
|
|
116
|
+
xHours: {
|
|
117
|
+
one: "1 hour",
|
|
118
|
+
other: "{{count}} hours"
|
|
119
|
+
},
|
|
120
|
+
xDays: {
|
|
121
|
+
one: "1 day",
|
|
122
|
+
other: "{{count}} days"
|
|
123
|
+
},
|
|
124
|
+
aboutXWeeks: {
|
|
125
|
+
one: "about 1 week",
|
|
126
|
+
other: "about {{count}} weeks"
|
|
127
|
+
},
|
|
128
|
+
xWeeks: {
|
|
129
|
+
one: "1 week",
|
|
130
|
+
other: "{{count}} weeks"
|
|
131
|
+
},
|
|
132
|
+
aboutXMonths: {
|
|
133
|
+
one: "about 1 month",
|
|
134
|
+
other: "about {{count}} months"
|
|
135
|
+
},
|
|
136
|
+
xMonths: {
|
|
137
|
+
one: "1 month",
|
|
138
|
+
other: "{{count}} months"
|
|
139
|
+
},
|
|
140
|
+
aboutXYears: {
|
|
141
|
+
one: "about 1 year",
|
|
142
|
+
other: "about {{count}} years"
|
|
143
|
+
},
|
|
144
|
+
xYears: {
|
|
145
|
+
one: "1 year",
|
|
146
|
+
other: "{{count}} years"
|
|
147
|
+
},
|
|
148
|
+
overXYears: {
|
|
149
|
+
one: "over 1 year",
|
|
150
|
+
other: "over {{count}} years"
|
|
151
|
+
},
|
|
152
|
+
almostXYears: {
|
|
153
|
+
one: "almost 1 year",
|
|
154
|
+
other: "almost {{count}} years"
|
|
155
|
+
}
|
|
156
|
+
}, ie = (e, t, n) => {
|
|
157
|
+
let r;
|
|
158
|
+
const a = oe[e];
|
|
159
|
+
return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
160
|
+
};
|
|
161
|
+
function C(e) {
|
|
162
|
+
return (t = {}) => {
|
|
163
|
+
const n = t.width ? String(t.width) : e.defaultWidth;
|
|
164
|
+
return e.formats[n] || e.formats[e.defaultWidth];
|
|
165
|
+
};
|
|
84
166
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
167
|
+
const ce = {
|
|
168
|
+
full: "EEEE, MMMM do, y",
|
|
169
|
+
long: "MMMM do, y",
|
|
170
|
+
medium: "MMM d, y",
|
|
171
|
+
short: "MM/dd/yyyy"
|
|
172
|
+
}, ue = {
|
|
173
|
+
full: "h:mm:ss a zzzz",
|
|
174
|
+
long: "h:mm:ss a z",
|
|
175
|
+
medium: "h:mm:ss a",
|
|
176
|
+
short: "h:mm a"
|
|
177
|
+
}, se = {
|
|
178
|
+
full: "{{date}} 'at' {{time}}",
|
|
179
|
+
long: "{{date}} 'at' {{time}}",
|
|
180
|
+
medium: "{{date}}, {{time}}",
|
|
181
|
+
short: "{{date}}, {{time}}"
|
|
182
|
+
}, de = {
|
|
183
|
+
date: C({
|
|
184
|
+
formats: ce,
|
|
185
|
+
defaultWidth: "full"
|
|
186
|
+
}),
|
|
187
|
+
time: C({
|
|
188
|
+
formats: ue,
|
|
189
|
+
defaultWidth: "full"
|
|
190
|
+
}),
|
|
191
|
+
dateTime: C({
|
|
192
|
+
formats: se,
|
|
193
|
+
defaultWidth: "full"
|
|
194
|
+
})
|
|
195
|
+
}, fe = {
|
|
196
|
+
lastWeek: "'last' eeee 'at' p",
|
|
197
|
+
yesterday: "'yesterday at' p",
|
|
198
|
+
today: "'today at' p",
|
|
199
|
+
tomorrow: "'tomorrow at' p",
|
|
200
|
+
nextWeek: "eeee 'at' p",
|
|
201
|
+
other: "P"
|
|
202
|
+
}, le = (e, t, n, r) => fe[e];
|
|
203
|
+
function T(e) {
|
|
204
|
+
return (t, n) => {
|
|
205
|
+
const r = n != null && n.context ? String(n.context) : "standalone";
|
|
206
|
+
let a;
|
|
207
|
+
if (r === "formatting" && e.formattingValues) {
|
|
208
|
+
const c = e.defaultFormattingWidth || e.defaultWidth, u = n != null && n.width ? String(n.width) : c;
|
|
209
|
+
a = e.formattingValues[u] || e.formattingValues[c];
|
|
210
|
+
} else {
|
|
211
|
+
const c = e.defaultWidth, u = n != null && n.width ? String(n.width) : e.defaultWidth;
|
|
212
|
+
a = e.values[u] || e.values[c];
|
|
213
|
+
}
|
|
214
|
+
const o = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
215
|
+
return a[o];
|
|
216
|
+
};
|
|
89
217
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
218
|
+
const he = {
|
|
219
|
+
narrow: ["B", "A"],
|
|
220
|
+
abbreviated: ["BC", "AD"],
|
|
221
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
222
|
+
}, me = {
|
|
223
|
+
narrow: ["1", "2", "3", "4"],
|
|
224
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
225
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
226
|
+
}, ge = {
|
|
227
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
228
|
+
abbreviated: [
|
|
229
|
+
"Jan",
|
|
230
|
+
"Feb",
|
|
231
|
+
"Mar",
|
|
232
|
+
"Apr",
|
|
233
|
+
"May",
|
|
234
|
+
"Jun",
|
|
235
|
+
"Jul",
|
|
236
|
+
"Aug",
|
|
237
|
+
"Sep",
|
|
238
|
+
"Oct",
|
|
239
|
+
"Nov",
|
|
240
|
+
"Dec"
|
|
241
|
+
],
|
|
242
|
+
wide: [
|
|
243
|
+
"January",
|
|
244
|
+
"February",
|
|
245
|
+
"March",
|
|
246
|
+
"April",
|
|
247
|
+
"May",
|
|
248
|
+
"June",
|
|
249
|
+
"July",
|
|
250
|
+
"August",
|
|
251
|
+
"September",
|
|
252
|
+
"October",
|
|
253
|
+
"November",
|
|
254
|
+
"December"
|
|
255
|
+
]
|
|
256
|
+
}, we = {
|
|
257
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
258
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
259
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
260
|
+
wide: [
|
|
261
|
+
"Sunday",
|
|
262
|
+
"Monday",
|
|
263
|
+
"Tuesday",
|
|
264
|
+
"Wednesday",
|
|
265
|
+
"Thursday",
|
|
266
|
+
"Friday",
|
|
267
|
+
"Saturday"
|
|
268
|
+
]
|
|
269
|
+
}, be = {
|
|
270
|
+
narrow: {
|
|
271
|
+
am: "a",
|
|
272
|
+
pm: "p",
|
|
273
|
+
midnight: "mi",
|
|
274
|
+
noon: "n",
|
|
275
|
+
morning: "morning",
|
|
276
|
+
afternoon: "afternoon",
|
|
277
|
+
evening: "evening",
|
|
278
|
+
night: "night"
|
|
279
|
+
},
|
|
280
|
+
abbreviated: {
|
|
281
|
+
am: "AM",
|
|
282
|
+
pm: "PM",
|
|
283
|
+
midnight: "midnight",
|
|
284
|
+
noon: "noon",
|
|
285
|
+
morning: "morning",
|
|
286
|
+
afternoon: "afternoon",
|
|
287
|
+
evening: "evening",
|
|
288
|
+
night: "night"
|
|
289
|
+
},
|
|
290
|
+
wide: {
|
|
291
|
+
am: "a.m.",
|
|
292
|
+
pm: "p.m.",
|
|
293
|
+
midnight: "midnight",
|
|
294
|
+
noon: "noon",
|
|
295
|
+
morning: "morning",
|
|
296
|
+
afternoon: "afternoon",
|
|
297
|
+
evening: "evening",
|
|
298
|
+
night: "night"
|
|
299
|
+
}
|
|
300
|
+
}, ye = {
|
|
301
|
+
narrow: {
|
|
302
|
+
am: "a",
|
|
303
|
+
pm: "p",
|
|
304
|
+
midnight: "mi",
|
|
305
|
+
noon: "n",
|
|
306
|
+
morning: "in the morning",
|
|
307
|
+
afternoon: "in the afternoon",
|
|
308
|
+
evening: "in the evening",
|
|
309
|
+
night: "at night"
|
|
310
|
+
},
|
|
311
|
+
abbreviated: {
|
|
312
|
+
am: "AM",
|
|
313
|
+
pm: "PM",
|
|
314
|
+
midnight: "midnight",
|
|
315
|
+
noon: "noon",
|
|
316
|
+
morning: "in the morning",
|
|
317
|
+
afternoon: "in the afternoon",
|
|
318
|
+
evening: "in the evening",
|
|
319
|
+
night: "at night"
|
|
320
|
+
},
|
|
321
|
+
wide: {
|
|
322
|
+
am: "a.m.",
|
|
323
|
+
pm: "p.m.",
|
|
324
|
+
midnight: "midnight",
|
|
325
|
+
noon: "noon",
|
|
326
|
+
morning: "in the morning",
|
|
327
|
+
afternoon: "in the afternoon",
|
|
328
|
+
evening: "in the evening",
|
|
329
|
+
night: "at night"
|
|
330
|
+
}
|
|
331
|
+
}, Pe = (e, t) => {
|
|
332
|
+
const n = Number(e), r = n % 100;
|
|
333
|
+
if (r > 20 || r < 10)
|
|
334
|
+
switch (r % 10) {
|
|
335
|
+
case 1:
|
|
336
|
+
return n + "st";
|
|
337
|
+
case 2:
|
|
338
|
+
return n + "nd";
|
|
339
|
+
case 3:
|
|
340
|
+
return n + "rd";
|
|
341
|
+
}
|
|
342
|
+
return n + "th";
|
|
343
|
+
}, ve = {
|
|
344
|
+
ordinalNumber: Pe,
|
|
345
|
+
era: T({
|
|
346
|
+
values: he,
|
|
347
|
+
defaultWidth: "wide"
|
|
348
|
+
}),
|
|
349
|
+
quarter: T({
|
|
350
|
+
values: me,
|
|
351
|
+
defaultWidth: "wide",
|
|
352
|
+
argumentCallback: (e) => e - 1
|
|
353
|
+
}),
|
|
354
|
+
month: T({
|
|
355
|
+
values: ge,
|
|
356
|
+
defaultWidth: "wide"
|
|
357
|
+
}),
|
|
358
|
+
day: T({
|
|
359
|
+
values: we,
|
|
360
|
+
defaultWidth: "wide"
|
|
361
|
+
}),
|
|
362
|
+
dayPeriod: T({
|
|
363
|
+
values: be,
|
|
364
|
+
defaultWidth: "wide",
|
|
365
|
+
formattingValues: ye,
|
|
366
|
+
defaultFormattingWidth: "wide"
|
|
367
|
+
})
|
|
368
|
+
};
|
|
369
|
+
function k(e) {
|
|
370
|
+
return (t, n = {}) => {
|
|
371
|
+
const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], o = t.match(a);
|
|
372
|
+
if (!o)
|
|
373
|
+
return null;
|
|
374
|
+
const c = o[0], u = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], i = Array.isArray(u) ? Oe(u, (g) => g.test(c)) : (
|
|
375
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
376
|
+
Se(u, (g) => g.test(c))
|
|
377
|
+
);
|
|
378
|
+
let d;
|
|
379
|
+
d = e.valueCallback ? e.valueCallback(i) : i, d = n.valueCallback ? (
|
|
380
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
381
|
+
n.valueCallback(d)
|
|
382
|
+
) : d;
|
|
383
|
+
const f = t.slice(c.length);
|
|
384
|
+
return { value: d, rest: f };
|
|
385
|
+
};
|
|
98
386
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
var r = N(t);
|
|
104
|
-
return r;
|
|
387
|
+
function Se(e, t) {
|
|
388
|
+
for (const n in e)
|
|
389
|
+
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
390
|
+
return n;
|
|
105
391
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return Math.round(t / ye) + 1;
|
|
392
|
+
function Oe(e, t) {
|
|
393
|
+
for (let n = 0; n < e.length; n++)
|
|
394
|
+
if (t(e[n]))
|
|
395
|
+
return n;
|
|
111
396
|
}
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
397
|
+
function De(e) {
|
|
398
|
+
return (t, n = {}) => {
|
|
399
|
+
const r = t.match(e.matchPattern);
|
|
400
|
+
if (!r) return null;
|
|
401
|
+
const a = r[0], o = t.match(e.parsePattern);
|
|
402
|
+
if (!o) return null;
|
|
403
|
+
let c = e.valueCallback ? e.valueCallback(o[0]) : o[0];
|
|
404
|
+
c = n.valueCallback ? n.valueCallback(c) : c;
|
|
405
|
+
const u = t.slice(a.length);
|
|
406
|
+
return { value: c, rest: u };
|
|
407
|
+
};
|
|
120
408
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
409
|
+
const Te = /^(\d+)(th|st|nd|rd)?/i, ke = /\d+/i, Me = {
|
|
410
|
+
narrow: /^(b|a)/i,
|
|
411
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
412
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
413
|
+
}, xe = {
|
|
414
|
+
any: [/^b/i, /^(a|c)/i]
|
|
415
|
+
}, Ee = {
|
|
416
|
+
narrow: /^[1234]/i,
|
|
417
|
+
abbreviated: /^q[1234]/i,
|
|
418
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
419
|
+
}, We = {
|
|
420
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
421
|
+
}, Ae = {
|
|
422
|
+
narrow: /^[jfmasond]/i,
|
|
423
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
424
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
425
|
+
}, Ce = {
|
|
426
|
+
narrow: [
|
|
427
|
+
/^j/i,
|
|
428
|
+
/^f/i,
|
|
429
|
+
/^m/i,
|
|
430
|
+
/^a/i,
|
|
431
|
+
/^m/i,
|
|
432
|
+
/^j/i,
|
|
433
|
+
/^j/i,
|
|
434
|
+
/^a/i,
|
|
435
|
+
/^s/i,
|
|
436
|
+
/^o/i,
|
|
437
|
+
/^n/i,
|
|
438
|
+
/^d/i
|
|
439
|
+
],
|
|
440
|
+
any: [
|
|
441
|
+
/^ja/i,
|
|
442
|
+
/^f/i,
|
|
443
|
+
/^mar/i,
|
|
444
|
+
/^ap/i,
|
|
445
|
+
/^may/i,
|
|
446
|
+
/^jun/i,
|
|
447
|
+
/^jul/i,
|
|
448
|
+
/^au/i,
|
|
449
|
+
/^s/i,
|
|
450
|
+
/^o/i,
|
|
451
|
+
/^n/i,
|
|
452
|
+
/^d/i
|
|
453
|
+
]
|
|
454
|
+
}, Ye = {
|
|
455
|
+
narrow: /^[smtwf]/i,
|
|
456
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
457
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
458
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
459
|
+
}, pe = {
|
|
460
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
461
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
462
|
+
}, Ne = {
|
|
463
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
464
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
465
|
+
}, Le = {
|
|
466
|
+
any: {
|
|
467
|
+
am: /^a/i,
|
|
468
|
+
pm: /^p/i,
|
|
469
|
+
midnight: /^mi/i,
|
|
470
|
+
noon: /^no/i,
|
|
471
|
+
morning: /morning/i,
|
|
472
|
+
afternoon: /afternoon/i,
|
|
473
|
+
evening: /evening/i,
|
|
474
|
+
night: /night/i
|
|
475
|
+
}
|
|
476
|
+
}, Fe = {
|
|
477
|
+
ordinalNumber: De({
|
|
478
|
+
matchPattern: Te,
|
|
479
|
+
parsePattern: ke,
|
|
480
|
+
valueCallback: (e) => parseInt(e, 10)
|
|
481
|
+
}),
|
|
482
|
+
era: k({
|
|
483
|
+
matchPatterns: Me,
|
|
484
|
+
defaultMatchWidth: "wide",
|
|
485
|
+
parsePatterns: xe,
|
|
486
|
+
defaultParseWidth: "any"
|
|
487
|
+
}),
|
|
488
|
+
quarter: k({
|
|
489
|
+
matchPatterns: Ee,
|
|
490
|
+
defaultMatchWidth: "wide",
|
|
491
|
+
parsePatterns: We,
|
|
492
|
+
defaultParseWidth: "any",
|
|
493
|
+
valueCallback: (e) => e + 1
|
|
494
|
+
}),
|
|
495
|
+
month: k({
|
|
496
|
+
matchPatterns: Ae,
|
|
497
|
+
defaultMatchWidth: "wide",
|
|
498
|
+
parsePatterns: Ce,
|
|
499
|
+
defaultParseWidth: "any"
|
|
500
|
+
}),
|
|
501
|
+
day: k({
|
|
502
|
+
matchPatterns: Ye,
|
|
503
|
+
defaultMatchWidth: "wide",
|
|
504
|
+
parsePatterns: pe,
|
|
505
|
+
defaultParseWidth: "any"
|
|
506
|
+
}),
|
|
507
|
+
dayPeriod: k({
|
|
508
|
+
matchPatterns: Ne,
|
|
509
|
+
defaultMatchWidth: "any",
|
|
510
|
+
parsePatterns: Le,
|
|
511
|
+
defaultParseWidth: "any"
|
|
512
|
+
})
|
|
513
|
+
}, _e = {
|
|
514
|
+
code: "en-US",
|
|
515
|
+
formatDistance: ie,
|
|
516
|
+
formatLong: de,
|
|
517
|
+
formatRelative: le,
|
|
518
|
+
localize: ve,
|
|
519
|
+
match: Fe,
|
|
520
|
+
options: {
|
|
521
|
+
weekStartsOn: 0,
|
|
522
|
+
firstWeekContainsDate: 1
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
function Re(e) {
|
|
526
|
+
const t = b(e);
|
|
527
|
+
return ee(t, ae(t)) + 1;
|
|
528
|
+
}
|
|
529
|
+
function Ie(e) {
|
|
530
|
+
const t = b(e), n = +E(t) - +te(t);
|
|
531
|
+
return Math.round(n / X) + 1;
|
|
133
532
|
}
|
|
134
|
-
function
|
|
135
|
-
var
|
|
136
|
-
g(1,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
533
|
+
function B(e, t) {
|
|
534
|
+
var f, g, l, w;
|
|
535
|
+
const n = b(e), r = n.getFullYear(), a = W(), o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((g = (f = t == null ? void 0 : t.locale) == null ? void 0 : f.options) == null ? void 0 : g.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((w = (l = a.locale) == null ? void 0 : l.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, c = O(e, 0);
|
|
536
|
+
c.setFullYear(r + 1, 0, o), c.setHours(0, 0, 0, 0);
|
|
537
|
+
const u = M(c, t), i = O(e, 0);
|
|
538
|
+
i.setFullYear(r, 0, o), i.setHours(0, 0, 0, 0);
|
|
539
|
+
const d = M(i, t);
|
|
540
|
+
return n.getTime() >= u.getTime() ? r + 1 : n.getTime() >= d.getTime() ? r : r - 1;
|
|
141
541
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return Math.round(r / Ce) + 1;
|
|
542
|
+
function He(e, t) {
|
|
543
|
+
var u, i, d, f;
|
|
544
|
+
const n = W(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((i = (u = t == null ? void 0 : t.locale) == null ? void 0 : u.options) == null ? void 0 : i.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((f = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, a = B(e, t), o = O(e, 0);
|
|
545
|
+
return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0), M(o, t);
|
|
147
546
|
}
|
|
148
|
-
function
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return t + r;
|
|
547
|
+
function qe(e, t) {
|
|
548
|
+
const n = b(e), r = +M(n, t) - +He(n, t);
|
|
549
|
+
return Math.round(r / X) + 1;
|
|
152
550
|
}
|
|
153
|
-
|
|
551
|
+
function s(e, t) {
|
|
552
|
+
const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
|
|
553
|
+
return n + r;
|
|
554
|
+
}
|
|
555
|
+
const P = {
|
|
154
556
|
// Year
|
|
155
|
-
y
|
|
156
|
-
|
|
157
|
-
return s(t === "yy" ?
|
|
557
|
+
y(e, t) {
|
|
558
|
+
const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
559
|
+
return s(t === "yy" ? r % 100 : r, t.length);
|
|
158
560
|
},
|
|
159
561
|
// Month
|
|
160
|
-
M
|
|
161
|
-
|
|
162
|
-
return t === "M" ? String(
|
|
562
|
+
M(e, t) {
|
|
563
|
+
const n = e.getMonth();
|
|
564
|
+
return t === "M" ? String(n + 1) : s(n + 1, 2);
|
|
163
565
|
},
|
|
164
566
|
// Day of the month
|
|
165
|
-
d
|
|
166
|
-
return s(e.
|
|
567
|
+
d(e, t) {
|
|
568
|
+
return s(e.getDate(), t.length);
|
|
167
569
|
},
|
|
168
570
|
// AM or PM
|
|
169
|
-
a
|
|
170
|
-
|
|
571
|
+
a(e, t) {
|
|
572
|
+
const n = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
171
573
|
switch (t) {
|
|
172
574
|
case "a":
|
|
173
575
|
case "aa":
|
|
174
|
-
return
|
|
576
|
+
return n.toUpperCase();
|
|
175
577
|
case "aaa":
|
|
176
|
-
return
|
|
578
|
+
return n;
|
|
177
579
|
case "aaaaa":
|
|
178
|
-
return
|
|
580
|
+
return n[0];
|
|
179
581
|
case "aaaa":
|
|
180
582
|
default:
|
|
181
|
-
return
|
|
583
|
+
return n === "am" ? "a.m." : "p.m.";
|
|
182
584
|
}
|
|
183
585
|
},
|
|
184
586
|
// Hour [1-12]
|
|
185
|
-
h
|
|
186
|
-
return s(e.
|
|
587
|
+
h(e, t) {
|
|
588
|
+
return s(e.getHours() % 12 || 12, t.length);
|
|
187
589
|
},
|
|
188
590
|
// Hour [0-23]
|
|
189
|
-
H
|
|
190
|
-
return s(e.
|
|
591
|
+
H(e, t) {
|
|
592
|
+
return s(e.getHours(), t.length);
|
|
191
593
|
},
|
|
192
594
|
// Minute
|
|
193
|
-
m
|
|
194
|
-
return s(e.
|
|
595
|
+
m(e, t) {
|
|
596
|
+
return s(e.getMinutes(), t.length);
|
|
195
597
|
},
|
|
196
598
|
// Second
|
|
197
|
-
s
|
|
198
|
-
return s(e.
|
|
599
|
+
s(e, t) {
|
|
600
|
+
return s(e.getSeconds(), t.length);
|
|
199
601
|
},
|
|
200
602
|
// Fraction of second
|
|
201
|
-
S
|
|
202
|
-
|
|
203
|
-
|
|
603
|
+
S(e, t) {
|
|
604
|
+
const n = t.length, r = e.getMilliseconds(), a = Math.trunc(
|
|
605
|
+
r * Math.pow(10, n - 3)
|
|
606
|
+
);
|
|
607
|
+
return s(a, t.length);
|
|
204
608
|
}
|
|
205
|
-
}
|
|
206
|
-
const p = Se;
|
|
207
|
-
var P = {
|
|
609
|
+
}, D = {
|
|
208
610
|
am: "am",
|
|
209
611
|
pm: "pm",
|
|
210
612
|
midnight: "midnight",
|
|
@@ -213,53 +615,43 @@ var P = {
|
|
|
213
615
|
afternoon: "afternoon",
|
|
214
616
|
evening: "evening",
|
|
215
617
|
night: "night"
|
|
216
|
-
},
|
|
618
|
+
}, H = {
|
|
217
619
|
// Era
|
|
218
|
-
G: function(e, t,
|
|
219
|
-
|
|
620
|
+
G: function(e, t, n) {
|
|
621
|
+
const r = e.getFullYear() > 0 ? 1 : 0;
|
|
220
622
|
switch (t) {
|
|
221
623
|
case "G":
|
|
222
624
|
case "GG":
|
|
223
625
|
case "GGG":
|
|
224
|
-
return
|
|
225
|
-
width: "abbreviated"
|
|
226
|
-
});
|
|
626
|
+
return n.era(r, { width: "abbreviated" });
|
|
227
627
|
case "GGGGG":
|
|
228
|
-
return
|
|
229
|
-
width: "narrow"
|
|
230
|
-
});
|
|
628
|
+
return n.era(r, { width: "narrow" });
|
|
231
629
|
case "GGGG":
|
|
232
630
|
default:
|
|
233
|
-
return
|
|
234
|
-
width: "wide"
|
|
235
|
-
});
|
|
631
|
+
return n.era(r, { width: "wide" });
|
|
236
632
|
}
|
|
237
633
|
},
|
|
238
634
|
// Year
|
|
239
|
-
y: function(e, t,
|
|
635
|
+
y: function(e, t, n) {
|
|
240
636
|
if (t === "yo") {
|
|
241
|
-
|
|
242
|
-
return
|
|
243
|
-
unit: "year"
|
|
244
|
-
});
|
|
637
|
+
const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
638
|
+
return n.ordinalNumber(a, { unit: "year" });
|
|
245
639
|
}
|
|
246
|
-
return
|
|
640
|
+
return P.y(e, t);
|
|
247
641
|
},
|
|
248
642
|
// Local week-numbering year
|
|
249
|
-
Y: function(e, t,
|
|
250
|
-
|
|
643
|
+
Y: function(e, t, n, r) {
|
|
644
|
+
const a = B(e, r), o = a > 0 ? a : 1 - a;
|
|
251
645
|
if (t === "YY") {
|
|
252
|
-
|
|
646
|
+
const c = o % 100;
|
|
253
647
|
return s(c, 2);
|
|
254
648
|
}
|
|
255
|
-
return t === "Yo" ?
|
|
256
|
-
unit: "year"
|
|
257
|
-
}) : s(o, t.length);
|
|
649
|
+
return t === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : s(o, t.length);
|
|
258
650
|
},
|
|
259
651
|
// ISO week-numbering year
|
|
260
652
|
R: function(e, t) {
|
|
261
|
-
|
|
262
|
-
return s(
|
|
653
|
+
const n = Q(e);
|
|
654
|
+
return s(n, t.length);
|
|
263
655
|
},
|
|
264
656
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
265
657
|
// The main difference between `y` and `u` localizers are B.C. years:
|
|
@@ -271,1034 +663,572 @@ var P = {
|
|
|
271
663
|
// Also `yy` always returns the last two digits of a year,
|
|
272
664
|
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
273
665
|
u: function(e, t) {
|
|
274
|
-
|
|
275
|
-
return s(
|
|
666
|
+
const n = e.getFullYear();
|
|
667
|
+
return s(n, t.length);
|
|
276
668
|
},
|
|
277
669
|
// Quarter
|
|
278
|
-
Q: function(e, t,
|
|
279
|
-
|
|
670
|
+
Q: function(e, t, n) {
|
|
671
|
+
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
280
672
|
switch (t) {
|
|
281
673
|
case "Q":
|
|
282
|
-
return String(
|
|
674
|
+
return String(r);
|
|
283
675
|
case "QQ":
|
|
284
|
-
return s(
|
|
676
|
+
return s(r, 2);
|
|
285
677
|
case "Qo":
|
|
286
|
-
return
|
|
287
|
-
unit: "quarter"
|
|
288
|
-
});
|
|
678
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
289
679
|
case "QQQ":
|
|
290
|
-
return
|
|
680
|
+
return n.quarter(r, {
|
|
291
681
|
width: "abbreviated",
|
|
292
682
|
context: "formatting"
|
|
293
683
|
});
|
|
294
684
|
case "QQQQQ":
|
|
295
|
-
return
|
|
685
|
+
return n.quarter(r, {
|
|
296
686
|
width: "narrow",
|
|
297
687
|
context: "formatting"
|
|
298
688
|
});
|
|
299
689
|
case "QQQQ":
|
|
300
690
|
default:
|
|
301
|
-
return
|
|
691
|
+
return n.quarter(r, {
|
|
302
692
|
width: "wide",
|
|
303
693
|
context: "formatting"
|
|
304
694
|
});
|
|
305
695
|
}
|
|
306
696
|
},
|
|
307
697
|
// Stand-alone quarter
|
|
308
|
-
q: function(e, t,
|
|
309
|
-
|
|
698
|
+
q: function(e, t, n) {
|
|
699
|
+
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
310
700
|
switch (t) {
|
|
311
701
|
case "q":
|
|
312
|
-
return String(
|
|
702
|
+
return String(r);
|
|
313
703
|
case "qq":
|
|
314
|
-
return s(
|
|
704
|
+
return s(r, 2);
|
|
315
705
|
case "qo":
|
|
316
|
-
return
|
|
317
|
-
unit: "quarter"
|
|
318
|
-
});
|
|
706
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
319
707
|
case "qqq":
|
|
320
|
-
return
|
|
708
|
+
return n.quarter(r, {
|
|
321
709
|
width: "abbreviated",
|
|
322
710
|
context: "standalone"
|
|
323
711
|
});
|
|
324
712
|
case "qqqqq":
|
|
325
|
-
return
|
|
713
|
+
return n.quarter(r, {
|
|
326
714
|
width: "narrow",
|
|
327
715
|
context: "standalone"
|
|
328
716
|
});
|
|
329
717
|
case "qqqq":
|
|
330
718
|
default:
|
|
331
|
-
return
|
|
719
|
+
return n.quarter(r, {
|
|
332
720
|
width: "wide",
|
|
333
721
|
context: "standalone"
|
|
334
722
|
});
|
|
335
723
|
}
|
|
336
724
|
},
|
|
337
725
|
// Month
|
|
338
|
-
M: function(e, t,
|
|
339
|
-
|
|
726
|
+
M: function(e, t, n) {
|
|
727
|
+
const r = e.getMonth();
|
|
340
728
|
switch (t) {
|
|
341
729
|
case "M":
|
|
342
730
|
case "MM":
|
|
343
|
-
return
|
|
731
|
+
return P.M(e, t);
|
|
344
732
|
case "Mo":
|
|
345
|
-
return
|
|
346
|
-
unit: "month"
|
|
347
|
-
});
|
|
733
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
348
734
|
case "MMM":
|
|
349
|
-
return
|
|
735
|
+
return n.month(r, {
|
|
350
736
|
width: "abbreviated",
|
|
351
737
|
context: "formatting"
|
|
352
738
|
});
|
|
353
739
|
case "MMMMM":
|
|
354
|
-
return
|
|
740
|
+
return n.month(r, {
|
|
355
741
|
width: "narrow",
|
|
356
742
|
context: "formatting"
|
|
357
743
|
});
|
|
358
744
|
case "MMMM":
|
|
359
745
|
default:
|
|
360
|
-
return
|
|
361
|
-
width: "wide",
|
|
362
|
-
context: "formatting"
|
|
363
|
-
});
|
|
746
|
+
return n.month(r, { width: "wide", context: "formatting" });
|
|
364
747
|
}
|
|
365
748
|
},
|
|
366
749
|
// Stand-alone month
|
|
367
|
-
L: function(e, t,
|
|
368
|
-
|
|
750
|
+
L: function(e, t, n) {
|
|
751
|
+
const r = e.getMonth();
|
|
369
752
|
switch (t) {
|
|
370
753
|
case "L":
|
|
371
|
-
return String(
|
|
754
|
+
return String(r + 1);
|
|
372
755
|
case "LL":
|
|
373
|
-
return s(
|
|
756
|
+
return s(r + 1, 2);
|
|
374
757
|
case "Lo":
|
|
375
|
-
return
|
|
376
|
-
unit: "month"
|
|
377
|
-
});
|
|
758
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
378
759
|
case "LLL":
|
|
379
|
-
return
|
|
760
|
+
return n.month(r, {
|
|
380
761
|
width: "abbreviated",
|
|
381
762
|
context: "standalone"
|
|
382
763
|
});
|
|
383
764
|
case "LLLLL":
|
|
384
|
-
return
|
|
765
|
+
return n.month(r, {
|
|
385
766
|
width: "narrow",
|
|
386
767
|
context: "standalone"
|
|
387
768
|
});
|
|
388
769
|
case "LLLL":
|
|
389
770
|
default:
|
|
390
|
-
return
|
|
391
|
-
width: "wide",
|
|
392
|
-
context: "standalone"
|
|
393
|
-
});
|
|
771
|
+
return n.month(r, { width: "wide", context: "standalone" });
|
|
394
772
|
}
|
|
395
773
|
},
|
|
396
774
|
// Local week of year
|
|
397
|
-
w: function(e, t,
|
|
398
|
-
|
|
399
|
-
return t === "wo" ?
|
|
400
|
-
unit: "week"
|
|
401
|
-
}) : s(i, t.length);
|
|
775
|
+
w: function(e, t, n, r) {
|
|
776
|
+
const a = qe(e, r);
|
|
777
|
+
return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : s(a, t.length);
|
|
402
778
|
},
|
|
403
779
|
// ISO week of year
|
|
404
|
-
I: function(e, t,
|
|
405
|
-
|
|
406
|
-
return t === "Io" ?
|
|
407
|
-
unit: "week"
|
|
408
|
-
}) : s(n, t.length);
|
|
780
|
+
I: function(e, t, n) {
|
|
781
|
+
const r = Ie(e);
|
|
782
|
+
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : s(r, t.length);
|
|
409
783
|
},
|
|
410
784
|
// Day of the month
|
|
411
|
-
d: function(e, t,
|
|
412
|
-
return t === "do" ?
|
|
413
|
-
unit: "date"
|
|
414
|
-
}) : p.d(e, t);
|
|
785
|
+
d: function(e, t, n) {
|
|
786
|
+
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : P.d(e, t);
|
|
415
787
|
},
|
|
416
788
|
// Day of year
|
|
417
|
-
D: function(e, t,
|
|
418
|
-
|
|
419
|
-
return t === "Do" ?
|
|
420
|
-
unit: "dayOfYear"
|
|
421
|
-
}) : s(n, t.length);
|
|
789
|
+
D: function(e, t, n) {
|
|
790
|
+
const r = Re(e);
|
|
791
|
+
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : s(r, t.length);
|
|
422
792
|
},
|
|
423
793
|
// Day of week
|
|
424
|
-
E: function(e, t,
|
|
425
|
-
|
|
794
|
+
E: function(e, t, n) {
|
|
795
|
+
const r = e.getDay();
|
|
426
796
|
switch (t) {
|
|
427
797
|
case "E":
|
|
428
798
|
case "EE":
|
|
429
799
|
case "EEE":
|
|
430
|
-
return
|
|
800
|
+
return n.day(r, {
|
|
431
801
|
width: "abbreviated",
|
|
432
802
|
context: "formatting"
|
|
433
803
|
});
|
|
434
804
|
case "EEEEE":
|
|
435
|
-
return
|
|
805
|
+
return n.day(r, {
|
|
436
806
|
width: "narrow",
|
|
437
807
|
context: "formatting"
|
|
438
808
|
});
|
|
439
809
|
case "EEEEEE":
|
|
440
|
-
return
|
|
810
|
+
return n.day(r, {
|
|
441
811
|
width: "short",
|
|
442
812
|
context: "formatting"
|
|
443
813
|
});
|
|
444
814
|
case "EEEE":
|
|
445
815
|
default:
|
|
446
|
-
return
|
|
816
|
+
return n.day(r, {
|
|
447
817
|
width: "wide",
|
|
448
818
|
context: "formatting"
|
|
449
819
|
});
|
|
450
820
|
}
|
|
451
821
|
},
|
|
452
822
|
// Local day of week
|
|
453
|
-
e: function(e, t,
|
|
454
|
-
|
|
823
|
+
e: function(e, t, n, r) {
|
|
824
|
+
const a = e.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
455
825
|
switch (t) {
|
|
456
826
|
case "e":
|
|
457
827
|
return String(o);
|
|
458
828
|
case "ee":
|
|
459
829
|
return s(o, 2);
|
|
460
830
|
case "eo":
|
|
461
|
-
return
|
|
462
|
-
unit: "day"
|
|
463
|
-
});
|
|
831
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
464
832
|
case "eee":
|
|
465
|
-
return
|
|
833
|
+
return n.day(a, {
|
|
466
834
|
width: "abbreviated",
|
|
467
835
|
context: "formatting"
|
|
468
836
|
});
|
|
469
837
|
case "eeeee":
|
|
470
|
-
return
|
|
838
|
+
return n.day(a, {
|
|
471
839
|
width: "narrow",
|
|
472
840
|
context: "formatting"
|
|
473
841
|
});
|
|
474
842
|
case "eeeeee":
|
|
475
|
-
return
|
|
843
|
+
return n.day(a, {
|
|
476
844
|
width: "short",
|
|
477
845
|
context: "formatting"
|
|
478
846
|
});
|
|
479
847
|
case "eeee":
|
|
480
848
|
default:
|
|
481
|
-
return
|
|
849
|
+
return n.day(a, {
|
|
482
850
|
width: "wide",
|
|
483
851
|
context: "formatting"
|
|
484
852
|
});
|
|
485
853
|
}
|
|
486
854
|
},
|
|
487
855
|
// Stand-alone local day of week
|
|
488
|
-
c: function(e, t,
|
|
489
|
-
|
|
856
|
+
c: function(e, t, n, r) {
|
|
857
|
+
const a = e.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
490
858
|
switch (t) {
|
|
491
859
|
case "c":
|
|
492
860
|
return String(o);
|
|
493
861
|
case "cc":
|
|
494
862
|
return s(o, t.length);
|
|
495
863
|
case "co":
|
|
496
|
-
return
|
|
497
|
-
unit: "day"
|
|
498
|
-
});
|
|
864
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
499
865
|
case "ccc":
|
|
500
|
-
return
|
|
866
|
+
return n.day(a, {
|
|
501
867
|
width: "abbreviated",
|
|
502
868
|
context: "standalone"
|
|
503
869
|
});
|
|
504
870
|
case "ccccc":
|
|
505
|
-
return
|
|
871
|
+
return n.day(a, {
|
|
506
872
|
width: "narrow",
|
|
507
873
|
context: "standalone"
|
|
508
874
|
});
|
|
509
875
|
case "cccccc":
|
|
510
|
-
return
|
|
876
|
+
return n.day(a, {
|
|
511
877
|
width: "short",
|
|
512
878
|
context: "standalone"
|
|
513
879
|
});
|
|
514
880
|
case "cccc":
|
|
515
881
|
default:
|
|
516
|
-
return
|
|
882
|
+
return n.day(a, {
|
|
517
883
|
width: "wide",
|
|
518
884
|
context: "standalone"
|
|
519
885
|
});
|
|
520
886
|
}
|
|
521
887
|
},
|
|
522
888
|
// ISO day of week
|
|
523
|
-
i: function(e, t,
|
|
524
|
-
|
|
889
|
+
i: function(e, t, n) {
|
|
890
|
+
const r = e.getDay(), a = r === 0 ? 7 : r;
|
|
525
891
|
switch (t) {
|
|
526
892
|
case "i":
|
|
527
|
-
return String(
|
|
893
|
+
return String(a);
|
|
528
894
|
case "ii":
|
|
529
|
-
return s(
|
|
895
|
+
return s(a, t.length);
|
|
530
896
|
case "io":
|
|
531
|
-
return
|
|
532
|
-
unit: "day"
|
|
533
|
-
});
|
|
897
|
+
return n.ordinalNumber(a, { unit: "day" });
|
|
534
898
|
case "iii":
|
|
535
|
-
return
|
|
899
|
+
return n.day(r, {
|
|
536
900
|
width: "abbreviated",
|
|
537
901
|
context: "formatting"
|
|
538
902
|
});
|
|
539
903
|
case "iiiii":
|
|
540
|
-
return
|
|
904
|
+
return n.day(r, {
|
|
541
905
|
width: "narrow",
|
|
542
906
|
context: "formatting"
|
|
543
907
|
});
|
|
544
908
|
case "iiiiii":
|
|
545
|
-
return
|
|
909
|
+
return n.day(r, {
|
|
546
910
|
width: "short",
|
|
547
911
|
context: "formatting"
|
|
548
912
|
});
|
|
549
913
|
case "iiii":
|
|
550
914
|
default:
|
|
551
|
-
return
|
|
915
|
+
return n.day(r, {
|
|
552
916
|
width: "wide",
|
|
553
917
|
context: "formatting"
|
|
554
918
|
});
|
|
555
919
|
}
|
|
556
920
|
},
|
|
557
921
|
// AM or PM
|
|
558
|
-
a: function(e, t,
|
|
559
|
-
|
|
922
|
+
a: function(e, t, n) {
|
|
923
|
+
const a = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
560
924
|
switch (t) {
|
|
561
925
|
case "a":
|
|
562
926
|
case "aa":
|
|
563
|
-
return
|
|
927
|
+
return n.dayPeriod(a, {
|
|
564
928
|
width: "abbreviated",
|
|
565
929
|
context: "formatting"
|
|
566
930
|
});
|
|
567
931
|
case "aaa":
|
|
568
|
-
return
|
|
932
|
+
return n.dayPeriod(a, {
|
|
569
933
|
width: "abbreviated",
|
|
570
934
|
context: "formatting"
|
|
571
935
|
}).toLowerCase();
|
|
572
936
|
case "aaaaa":
|
|
573
|
-
return
|
|
937
|
+
return n.dayPeriod(a, {
|
|
574
938
|
width: "narrow",
|
|
575
939
|
context: "formatting"
|
|
576
940
|
});
|
|
577
941
|
case "aaaa":
|
|
578
942
|
default:
|
|
579
|
-
return
|
|
943
|
+
return n.dayPeriod(a, {
|
|
580
944
|
width: "wide",
|
|
581
945
|
context: "formatting"
|
|
582
946
|
});
|
|
583
947
|
}
|
|
584
948
|
},
|
|
585
949
|
// AM, PM, midnight, noon
|
|
586
|
-
b: function(e, t,
|
|
587
|
-
|
|
588
|
-
|
|
950
|
+
b: function(e, t, n) {
|
|
951
|
+
const r = e.getHours();
|
|
952
|
+
let a;
|
|
953
|
+
switch (r === 12 ? a = D.noon : r === 0 ? a = D.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
|
|
589
954
|
case "b":
|
|
590
955
|
case "bb":
|
|
591
|
-
return
|
|
956
|
+
return n.dayPeriod(a, {
|
|
592
957
|
width: "abbreviated",
|
|
593
958
|
context: "formatting"
|
|
594
959
|
});
|
|
595
960
|
case "bbb":
|
|
596
|
-
return
|
|
961
|
+
return n.dayPeriod(a, {
|
|
597
962
|
width: "abbreviated",
|
|
598
963
|
context: "formatting"
|
|
599
964
|
}).toLowerCase();
|
|
600
965
|
case "bbbbb":
|
|
601
|
-
return
|
|
966
|
+
return n.dayPeriod(a, {
|
|
602
967
|
width: "narrow",
|
|
603
968
|
context: "formatting"
|
|
604
969
|
});
|
|
605
970
|
case "bbbb":
|
|
606
971
|
default:
|
|
607
|
-
return
|
|
972
|
+
return n.dayPeriod(a, {
|
|
608
973
|
width: "wide",
|
|
609
974
|
context: "formatting"
|
|
610
975
|
});
|
|
611
976
|
}
|
|
612
977
|
},
|
|
613
978
|
// in the morning, in the afternoon, in the evening, at night
|
|
614
|
-
B: function(e, t,
|
|
615
|
-
|
|
616
|
-
|
|
979
|
+
B: function(e, t, n) {
|
|
980
|
+
const r = e.getHours();
|
|
981
|
+
let a;
|
|
982
|
+
switch (r >= 17 ? a = D.evening : r >= 12 ? a = D.afternoon : r >= 4 ? a = D.morning : a = D.night, t) {
|
|
617
983
|
case "B":
|
|
618
984
|
case "BB":
|
|
619
985
|
case "BBB":
|
|
620
|
-
return
|
|
986
|
+
return n.dayPeriod(a, {
|
|
621
987
|
width: "abbreviated",
|
|
622
988
|
context: "formatting"
|
|
623
989
|
});
|
|
624
990
|
case "BBBBB":
|
|
625
|
-
return
|
|
991
|
+
return n.dayPeriod(a, {
|
|
626
992
|
width: "narrow",
|
|
627
993
|
context: "formatting"
|
|
628
994
|
});
|
|
629
995
|
case "BBBB":
|
|
630
996
|
default:
|
|
631
|
-
return
|
|
997
|
+
return n.dayPeriod(a, {
|
|
632
998
|
width: "wide",
|
|
633
999
|
context: "formatting"
|
|
634
1000
|
});
|
|
635
1001
|
}
|
|
636
1002
|
},
|
|
637
1003
|
// Hour [1-12]
|
|
638
|
-
h: function(e, t,
|
|
1004
|
+
h: function(e, t, n) {
|
|
639
1005
|
if (t === "ho") {
|
|
640
|
-
|
|
641
|
-
return
|
|
642
|
-
unit: "hour"
|
|
643
|
-
});
|
|
1006
|
+
let r = e.getHours() % 12;
|
|
1007
|
+
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
644
1008
|
}
|
|
645
|
-
return
|
|
1009
|
+
return P.h(e, t);
|
|
646
1010
|
},
|
|
647
1011
|
// Hour [0-23]
|
|
648
|
-
H: function(e, t,
|
|
649
|
-
return t === "Ho" ?
|
|
650
|
-
unit: "hour"
|
|
651
|
-
}) : p.H(e, t);
|
|
1012
|
+
H: function(e, t, n) {
|
|
1013
|
+
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : P.H(e, t);
|
|
652
1014
|
},
|
|
653
1015
|
// Hour [0-11]
|
|
654
|
-
K: function(e, t,
|
|
655
|
-
|
|
656
|
-
return t === "Ko" ?
|
|
657
|
-
unit: "hour"
|
|
658
|
-
}) : s(n, t.length);
|
|
1016
|
+
K: function(e, t, n) {
|
|
1017
|
+
const r = e.getHours() % 12;
|
|
1018
|
+
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : s(r, t.length);
|
|
659
1019
|
},
|
|
660
1020
|
// Hour [1-24]
|
|
661
|
-
k: function(e, t,
|
|
662
|
-
|
|
663
|
-
return
|
|
664
|
-
unit: "hour"
|
|
665
|
-
}) : s(n, t.length);
|
|
1021
|
+
k: function(e, t, n) {
|
|
1022
|
+
let r = e.getHours();
|
|
1023
|
+
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : s(r, t.length);
|
|
666
1024
|
},
|
|
667
1025
|
// Minute
|
|
668
|
-
m: function(e, t,
|
|
669
|
-
return t === "mo" ?
|
|
670
|
-
unit: "minute"
|
|
671
|
-
}) : p.m(e, t);
|
|
1026
|
+
m: function(e, t, n) {
|
|
1027
|
+
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : P.m(e, t);
|
|
672
1028
|
},
|
|
673
1029
|
// Second
|
|
674
|
-
s: function(e, t,
|
|
675
|
-
return t === "so" ?
|
|
676
|
-
unit: "second"
|
|
677
|
-
}) : p.s(e, t);
|
|
1030
|
+
s: function(e, t, n) {
|
|
1031
|
+
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : P.s(e, t);
|
|
678
1032
|
},
|
|
679
1033
|
// Fraction of second
|
|
680
1034
|
S: function(e, t) {
|
|
681
|
-
return
|
|
1035
|
+
return P.S(e, t);
|
|
682
1036
|
},
|
|
683
1037
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
684
|
-
X: function(e, t,
|
|
685
|
-
|
|
686
|
-
if (
|
|
1038
|
+
X: function(e, t, n) {
|
|
1039
|
+
const r = e.getTimezoneOffset();
|
|
1040
|
+
if (r === 0)
|
|
687
1041
|
return "Z";
|
|
688
1042
|
switch (t) {
|
|
689
1043
|
case "X":
|
|
690
|
-
return
|
|
1044
|
+
return G(r);
|
|
691
1045
|
case "XXXX":
|
|
692
1046
|
case "XX":
|
|
693
|
-
return
|
|
1047
|
+
return S(r);
|
|
694
1048
|
case "XXXXX":
|
|
695
1049
|
case "XXX":
|
|
696
1050
|
default:
|
|
697
|
-
return
|
|
1051
|
+
return S(r, ":");
|
|
698
1052
|
}
|
|
699
1053
|
},
|
|
700
1054
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
701
|
-
x: function(e, t,
|
|
702
|
-
|
|
1055
|
+
x: function(e, t, n) {
|
|
1056
|
+
const r = e.getTimezoneOffset();
|
|
703
1057
|
switch (t) {
|
|
704
1058
|
case "x":
|
|
705
|
-
return
|
|
1059
|
+
return G(r);
|
|
706
1060
|
case "xxxx":
|
|
707
1061
|
case "xx":
|
|
708
|
-
return
|
|
1062
|
+
return S(r);
|
|
709
1063
|
case "xxxxx":
|
|
710
1064
|
case "xxx":
|
|
711
1065
|
default:
|
|
712
|
-
return
|
|
1066
|
+
return S(r, ":");
|
|
713
1067
|
}
|
|
714
1068
|
},
|
|
715
1069
|
// Timezone (GMT)
|
|
716
|
-
O: function(e, t,
|
|
717
|
-
|
|
1070
|
+
O: function(e, t, n) {
|
|
1071
|
+
const r = e.getTimezoneOffset();
|
|
718
1072
|
switch (t) {
|
|
719
1073
|
case "O":
|
|
720
1074
|
case "OO":
|
|
721
1075
|
case "OOO":
|
|
722
|
-
return "GMT" +
|
|
1076
|
+
return "GMT" + q(r, ":");
|
|
723
1077
|
case "OOOO":
|
|
724
1078
|
default:
|
|
725
|
-
return "GMT" +
|
|
1079
|
+
return "GMT" + S(r, ":");
|
|
726
1080
|
}
|
|
727
1081
|
},
|
|
728
1082
|
// Timezone (specific non-location)
|
|
729
|
-
z: function(e, t,
|
|
730
|
-
|
|
1083
|
+
z: function(e, t, n) {
|
|
1084
|
+
const r = e.getTimezoneOffset();
|
|
731
1085
|
switch (t) {
|
|
732
1086
|
case "z":
|
|
733
1087
|
case "zz":
|
|
734
1088
|
case "zzz":
|
|
735
|
-
return "GMT" +
|
|
1089
|
+
return "GMT" + q(r, ":");
|
|
736
1090
|
case "zzzz":
|
|
737
1091
|
default:
|
|
738
|
-
return "GMT" +
|
|
1092
|
+
return "GMT" + S(r, ":");
|
|
739
1093
|
}
|
|
740
1094
|
},
|
|
741
1095
|
// Seconds timestamp
|
|
742
|
-
t: function(e, t,
|
|
743
|
-
|
|
744
|
-
return s(
|
|
1096
|
+
t: function(e, t, n) {
|
|
1097
|
+
const r = Math.trunc(e.getTime() / 1e3);
|
|
1098
|
+
return s(r, t.length);
|
|
745
1099
|
},
|
|
746
1100
|
// Milliseconds timestamp
|
|
747
|
-
T: function(e, t,
|
|
748
|
-
|
|
749
|
-
return s(
|
|
1101
|
+
T: function(e, t, n) {
|
|
1102
|
+
const r = e.getTime();
|
|
1103
|
+
return s(r, t.length);
|
|
750
1104
|
}
|
|
751
1105
|
};
|
|
752
|
-
function
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
return t + String(n);
|
|
756
|
-
var o = e || "";
|
|
757
|
-
return t + String(n) + o + s(i, 2);
|
|
1106
|
+
function q(e, t = "") {
|
|
1107
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), o = r % 60;
|
|
1108
|
+
return o === 0 ? n + String(a) : n + String(a) + t + s(o, 2);
|
|
758
1109
|
}
|
|
759
|
-
function
|
|
760
|
-
|
|
761
|
-
var t = a > 0 ? "-" : "+";
|
|
762
|
-
return t + s(Math.abs(a) / 60, 2);
|
|
763
|
-
}
|
|
764
|
-
return D(a, e);
|
|
1110
|
+
function G(e, t) {
|
|
1111
|
+
return e % 60 === 0 ? (e > 0 ? "-" : "+") + s(Math.abs(e) / 60, 2) : S(e, t);
|
|
765
1112
|
}
|
|
766
|
-
function
|
|
767
|
-
|
|
768
|
-
return
|
|
1113
|
+
function S(e, t = "") {
|
|
1114
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = s(Math.trunc(r / 60), 2), o = s(r % 60, 2);
|
|
1115
|
+
return n + a + t + o;
|
|
769
1116
|
}
|
|
770
|
-
|
|
1117
|
+
const j = (e, t) => {
|
|
771
1118
|
switch (e) {
|
|
772
1119
|
case "P":
|
|
773
|
-
return t.date({
|
|
774
|
-
width: "short"
|
|
775
|
-
});
|
|
1120
|
+
return t.date({ width: "short" });
|
|
776
1121
|
case "PP":
|
|
777
|
-
return t.date({
|
|
778
|
-
width: "medium"
|
|
779
|
-
});
|
|
1122
|
+
return t.date({ width: "medium" });
|
|
780
1123
|
case "PPP":
|
|
781
|
-
return t.date({
|
|
782
|
-
width: "long"
|
|
783
|
-
});
|
|
1124
|
+
return t.date({ width: "long" });
|
|
784
1125
|
case "PPPP":
|
|
785
1126
|
default:
|
|
786
|
-
return t.date({
|
|
787
|
-
width: "full"
|
|
788
|
-
});
|
|
1127
|
+
return t.date({ width: "full" });
|
|
789
1128
|
}
|
|
790
|
-
},
|
|
1129
|
+
}, V = (e, t) => {
|
|
791
1130
|
switch (e) {
|
|
792
1131
|
case "p":
|
|
793
|
-
return t.time({
|
|
794
|
-
width: "short"
|
|
795
|
-
});
|
|
1132
|
+
return t.time({ width: "short" });
|
|
796
1133
|
case "pp":
|
|
797
|
-
return t.time({
|
|
798
|
-
width: "medium"
|
|
799
|
-
});
|
|
1134
|
+
return t.time({ width: "medium" });
|
|
800
1135
|
case "ppp":
|
|
801
|
-
return t.time({
|
|
802
|
-
width: "long"
|
|
803
|
-
});
|
|
1136
|
+
return t.time({ width: "long" });
|
|
804
1137
|
case "pppp":
|
|
805
1138
|
default:
|
|
806
|
-
return t.time({
|
|
807
|
-
width: "full"
|
|
808
|
-
});
|
|
1139
|
+
return t.time({ width: "full" });
|
|
809
1140
|
}
|
|
810
|
-
},
|
|
811
|
-
|
|
812
|
-
if (!
|
|
813
|
-
return
|
|
814
|
-
|
|
815
|
-
switch (
|
|
1141
|
+
}, Ge = (e, t) => {
|
|
1142
|
+
const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1143
|
+
if (!a)
|
|
1144
|
+
return j(e, t);
|
|
1145
|
+
let o;
|
|
1146
|
+
switch (r) {
|
|
816
1147
|
case "P":
|
|
817
|
-
o = t.dateTime({
|
|
818
|
-
width: "short"
|
|
819
|
-
});
|
|
1148
|
+
o = t.dateTime({ width: "short" });
|
|
820
1149
|
break;
|
|
821
1150
|
case "PP":
|
|
822
|
-
o = t.dateTime({
|
|
823
|
-
width: "medium"
|
|
824
|
-
});
|
|
1151
|
+
o = t.dateTime({ width: "medium" });
|
|
825
1152
|
break;
|
|
826
1153
|
case "PPP":
|
|
827
|
-
o = t.dateTime({
|
|
828
|
-
width: "long"
|
|
829
|
-
});
|
|
1154
|
+
o = t.dateTime({ width: "long" });
|
|
830
1155
|
break;
|
|
831
1156
|
case "PPPP":
|
|
832
1157
|
default:
|
|
833
|
-
o = t.dateTime({
|
|
834
|
-
width: "full"
|
|
835
|
-
});
|
|
1158
|
+
o = t.dateTime({ width: "full" });
|
|
836
1159
|
break;
|
|
837
1160
|
}
|
|
838
|
-
return o.replace("{{date}}",
|
|
839
|
-
}, Me = {
|
|
840
|
-
p: ee,
|
|
841
|
-
P: Oe
|
|
842
|
-
}, Ee = ["D", "DD"], ke = ["YY", "YYYY"];
|
|
843
|
-
function xe(a) {
|
|
844
|
-
return Ee.indexOf(a) !== -1;
|
|
845
|
-
}
|
|
846
|
-
function _e(a) {
|
|
847
|
-
return ke.indexOf(a) !== -1;
|
|
848
|
-
}
|
|
849
|
-
function K(a, e, t) {
|
|
850
|
-
if (a === "YYYY")
|
|
851
|
-
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e, "`) for formatting years to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
|
|
852
|
-
if (a === "YY")
|
|
853
|
-
throw new RangeError("Use `yy` instead of `YY` (in `".concat(e, "`) for formatting years to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
|
|
854
|
-
if (a === "D")
|
|
855
|
-
throw new RangeError("Use `d` instead of `D` (in `".concat(e, "`) for formatting days of the month to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
|
|
856
|
-
if (a === "DD")
|
|
857
|
-
throw new RangeError("Use `dd` instead of `DD` (in `".concat(e, "`) for formatting days of the month to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
|
|
858
|
-
}
|
|
859
|
-
var Ue = {
|
|
860
|
-
lessThanXSeconds: {
|
|
861
|
-
one: "less than a second",
|
|
862
|
-
other: "less than {{count}} seconds"
|
|
863
|
-
},
|
|
864
|
-
xSeconds: {
|
|
865
|
-
one: "1 second",
|
|
866
|
-
other: "{{count}} seconds"
|
|
867
|
-
},
|
|
868
|
-
halfAMinute: "half a minute",
|
|
869
|
-
lessThanXMinutes: {
|
|
870
|
-
one: "less than a minute",
|
|
871
|
-
other: "less than {{count}} minutes"
|
|
872
|
-
},
|
|
873
|
-
xMinutes: {
|
|
874
|
-
one: "1 minute",
|
|
875
|
-
other: "{{count}} minutes"
|
|
876
|
-
},
|
|
877
|
-
aboutXHours: {
|
|
878
|
-
one: "about 1 hour",
|
|
879
|
-
other: "about {{count}} hours"
|
|
880
|
-
},
|
|
881
|
-
xHours: {
|
|
882
|
-
one: "1 hour",
|
|
883
|
-
other: "{{count}} hours"
|
|
884
|
-
},
|
|
885
|
-
xDays: {
|
|
886
|
-
one: "1 day",
|
|
887
|
-
other: "{{count}} days"
|
|
888
|
-
},
|
|
889
|
-
aboutXWeeks: {
|
|
890
|
-
one: "about 1 week",
|
|
891
|
-
other: "about {{count}} weeks"
|
|
892
|
-
},
|
|
893
|
-
xWeeks: {
|
|
894
|
-
one: "1 week",
|
|
895
|
-
other: "{{count}} weeks"
|
|
896
|
-
},
|
|
897
|
-
aboutXMonths: {
|
|
898
|
-
one: "about 1 month",
|
|
899
|
-
other: "about {{count}} months"
|
|
900
|
-
},
|
|
901
|
-
xMonths: {
|
|
902
|
-
one: "1 month",
|
|
903
|
-
other: "{{count}} months"
|
|
904
|
-
},
|
|
905
|
-
aboutXYears: {
|
|
906
|
-
one: "about 1 year",
|
|
907
|
-
other: "about {{count}} years"
|
|
908
|
-
},
|
|
909
|
-
xYears: {
|
|
910
|
-
one: "1 year",
|
|
911
|
-
other: "{{count}} years"
|
|
912
|
-
},
|
|
913
|
-
overXYears: {
|
|
914
|
-
one: "over 1 year",
|
|
915
|
-
other: "over {{count}} years"
|
|
916
|
-
},
|
|
917
|
-
almostXYears: {
|
|
918
|
-
one: "almost 1 year",
|
|
919
|
-
other: "almost {{count}} years"
|
|
920
|
-
}
|
|
921
|
-
}, We = function(e, t, r) {
|
|
922
|
-
var n, i = Ue[e];
|
|
923
|
-
return typeof i == "string" ? n = i : t === 1 ? n = i.one : n = i.other.replace("{{count}}", t.toString()), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + n : n + " ago" : n;
|
|
924
|
-
};
|
|
925
|
-
const Ye = We;
|
|
926
|
-
function q(a) {
|
|
927
|
-
return function() {
|
|
928
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.width ? String(e.width) : a.defaultWidth, r = a.formats[t] || a.formats[a.defaultWidth];
|
|
929
|
-
return r;
|
|
930
|
-
};
|
|
931
|
-
}
|
|
932
|
-
var Ne = {
|
|
933
|
-
full: "EEEE, MMMM do, y",
|
|
934
|
-
long: "MMMM do, y",
|
|
935
|
-
medium: "MMM d, y",
|
|
936
|
-
short: "MM/dd/yyyy"
|
|
937
|
-
}, Ae = {
|
|
938
|
-
full: "h:mm:ss a zzzz",
|
|
939
|
-
long: "h:mm:ss a z",
|
|
940
|
-
medium: "h:mm:ss a",
|
|
941
|
-
short: "h:mm a"
|
|
942
|
-
}, Le = {
|
|
943
|
-
full: "{{date}} 'at' {{time}}",
|
|
944
|
-
long: "{{date}} 'at' {{time}}",
|
|
945
|
-
medium: "{{date}}, {{time}}",
|
|
946
|
-
short: "{{date}}, {{time}}"
|
|
947
|
-
}, Re = {
|
|
948
|
-
date: q({
|
|
949
|
-
formats: Ne,
|
|
950
|
-
defaultWidth: "full"
|
|
951
|
-
}),
|
|
952
|
-
time: q({
|
|
953
|
-
formats: Ae,
|
|
954
|
-
defaultWidth: "full"
|
|
955
|
-
}),
|
|
956
|
-
dateTime: q({
|
|
957
|
-
formats: Le,
|
|
958
|
-
defaultWidth: "full"
|
|
959
|
-
})
|
|
960
|
-
};
|
|
961
|
-
const Ie = Re;
|
|
962
|
-
var Fe = {
|
|
963
|
-
lastWeek: "'last' eeee 'at' p",
|
|
964
|
-
yesterday: "'yesterday at' p",
|
|
965
|
-
today: "'today at' p",
|
|
966
|
-
tomorrow: "'tomorrow at' p",
|
|
967
|
-
nextWeek: "eeee 'at' p",
|
|
968
|
-
other: "P"
|
|
969
|
-
}, $e = function(e, t, r, n) {
|
|
970
|
-
return Fe[e];
|
|
971
|
-
};
|
|
972
|
-
const He = $e;
|
|
973
|
-
function k(a) {
|
|
974
|
-
return function(e, t) {
|
|
975
|
-
var r = t != null && t.context ? String(t.context) : "standalone", n;
|
|
976
|
-
if (r === "formatting" && a.formattingValues) {
|
|
977
|
-
var i = a.defaultFormattingWidth || a.defaultWidth, o = t != null && t.width ? String(t.width) : i;
|
|
978
|
-
n = a.formattingValues[o] || a.formattingValues[i];
|
|
979
|
-
} else {
|
|
980
|
-
var c = a.defaultWidth, u = t != null && t.width ? String(t.width) : a.defaultWidth;
|
|
981
|
-
n = a.values[u] || a.values[c];
|
|
982
|
-
}
|
|
983
|
-
var d = a.argumentCallback ? a.argumentCallback(e) : e;
|
|
984
|
-
return n[d];
|
|
985
|
-
};
|
|
986
|
-
}
|
|
987
|
-
var qe = {
|
|
988
|
-
narrow: ["B", "A"],
|
|
989
|
-
abbreviated: ["BC", "AD"],
|
|
990
|
-
wide: ["Before Christ", "Anno Domini"]
|
|
991
|
-
}, Ge = {
|
|
992
|
-
narrow: ["1", "2", "3", "4"],
|
|
993
|
-
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
994
|
-
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
995
|
-
}, Xe = {
|
|
996
|
-
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
997
|
-
abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
|
998
|
-
wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
|
|
999
|
-
}, Qe = {
|
|
1000
|
-
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
1001
|
-
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1002
|
-
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1003
|
-
wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
|
|
1161
|
+
return o.replace("{{date}}", j(r, t)).replace("{{time}}", V(a, t));
|
|
1004
1162
|
}, je = {
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
morning: "morning",
|
|
1011
|
-
afternoon: "afternoon",
|
|
1012
|
-
evening: "evening",
|
|
1013
|
-
night: "night"
|
|
1014
|
-
},
|
|
1015
|
-
abbreviated: {
|
|
1016
|
-
am: "AM",
|
|
1017
|
-
pm: "PM",
|
|
1018
|
-
midnight: "midnight",
|
|
1019
|
-
noon: "noon",
|
|
1020
|
-
morning: "morning",
|
|
1021
|
-
afternoon: "afternoon",
|
|
1022
|
-
evening: "evening",
|
|
1023
|
-
night: "night"
|
|
1024
|
-
},
|
|
1025
|
-
wide: {
|
|
1026
|
-
am: "a.m.",
|
|
1027
|
-
pm: "p.m.",
|
|
1028
|
-
midnight: "midnight",
|
|
1029
|
-
noon: "noon",
|
|
1030
|
-
morning: "morning",
|
|
1031
|
-
afternoon: "afternoon",
|
|
1032
|
-
evening: "evening",
|
|
1033
|
-
night: "night"
|
|
1034
|
-
}
|
|
1035
|
-
}, Be = {
|
|
1036
|
-
narrow: {
|
|
1037
|
-
am: "a",
|
|
1038
|
-
pm: "p",
|
|
1039
|
-
midnight: "mi",
|
|
1040
|
-
noon: "n",
|
|
1041
|
-
morning: "in the morning",
|
|
1042
|
-
afternoon: "in the afternoon",
|
|
1043
|
-
evening: "in the evening",
|
|
1044
|
-
night: "at night"
|
|
1045
|
-
},
|
|
1046
|
-
abbreviated: {
|
|
1047
|
-
am: "AM",
|
|
1048
|
-
pm: "PM",
|
|
1049
|
-
midnight: "midnight",
|
|
1050
|
-
noon: "noon",
|
|
1051
|
-
morning: "in the morning",
|
|
1052
|
-
afternoon: "in the afternoon",
|
|
1053
|
-
evening: "in the evening",
|
|
1054
|
-
night: "at night"
|
|
1055
|
-
},
|
|
1056
|
-
wide: {
|
|
1057
|
-
am: "a.m.",
|
|
1058
|
-
pm: "p.m.",
|
|
1059
|
-
midnight: "midnight",
|
|
1060
|
-
noon: "noon",
|
|
1061
|
-
morning: "in the morning",
|
|
1062
|
-
afternoon: "in the afternoon",
|
|
1063
|
-
evening: "in the evening",
|
|
1064
|
-
night: "at night"
|
|
1065
|
-
}
|
|
1066
|
-
}, Ve = function(e, t) {
|
|
1067
|
-
var r = Number(e), n = r % 100;
|
|
1068
|
-
if (n > 20 || n < 10)
|
|
1069
|
-
switch (n % 10) {
|
|
1070
|
-
case 1:
|
|
1071
|
-
return r + "st";
|
|
1072
|
-
case 2:
|
|
1073
|
-
return r + "nd";
|
|
1074
|
-
case 3:
|
|
1075
|
-
return r + "rd";
|
|
1076
|
-
}
|
|
1077
|
-
return r + "th";
|
|
1078
|
-
}, Je = {
|
|
1079
|
-
ordinalNumber: Ve,
|
|
1080
|
-
era: k({
|
|
1081
|
-
values: qe,
|
|
1082
|
-
defaultWidth: "wide"
|
|
1083
|
-
}),
|
|
1084
|
-
quarter: k({
|
|
1085
|
-
values: Ge,
|
|
1086
|
-
defaultWidth: "wide",
|
|
1087
|
-
argumentCallback: function(e) {
|
|
1088
|
-
return e - 1;
|
|
1089
|
-
}
|
|
1090
|
-
}),
|
|
1091
|
-
month: k({
|
|
1092
|
-
values: Xe,
|
|
1093
|
-
defaultWidth: "wide"
|
|
1094
|
-
}),
|
|
1095
|
-
day: k({
|
|
1096
|
-
values: Qe,
|
|
1097
|
-
defaultWidth: "wide"
|
|
1098
|
-
}),
|
|
1099
|
-
dayPeriod: k({
|
|
1100
|
-
values: je,
|
|
1101
|
-
defaultWidth: "wide",
|
|
1102
|
-
formattingValues: Be,
|
|
1103
|
-
defaultFormattingWidth: "wide"
|
|
1104
|
-
})
|
|
1105
|
-
};
|
|
1106
|
-
const Ke = Je;
|
|
1107
|
-
function x(a) {
|
|
1108
|
-
return function(e) {
|
|
1109
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = t.width, n = r && a.matchPatterns[r] || a.matchPatterns[a.defaultMatchWidth], i = e.match(n);
|
|
1110
|
-
if (!i)
|
|
1111
|
-
return null;
|
|
1112
|
-
var o = i[0], c = r && a.parsePatterns[r] || a.parsePatterns[a.defaultParseWidth], u = Array.isArray(c) ? Ze(c, function(m) {
|
|
1113
|
-
return m.test(o);
|
|
1114
|
-
}) : ze(c, function(m) {
|
|
1115
|
-
return m.test(o);
|
|
1116
|
-
}), d;
|
|
1117
|
-
d = a.valueCallback ? a.valueCallback(u) : u, d = t.valueCallback ? t.valueCallback(d) : d;
|
|
1118
|
-
var f = e.slice(o.length);
|
|
1119
|
-
return {
|
|
1120
|
-
value: d,
|
|
1121
|
-
rest: f
|
|
1122
|
-
};
|
|
1123
|
-
};
|
|
1163
|
+
p: V,
|
|
1164
|
+
P: Ge
|
|
1165
|
+
}, Xe = /^D+$/, Qe = /^Y+$/, Be = ["D", "DD", "YY", "YYYY"];
|
|
1166
|
+
function Ve(e) {
|
|
1167
|
+
return Xe.test(e);
|
|
1124
1168
|
}
|
|
1125
|
-
function
|
|
1126
|
-
|
|
1127
|
-
if (a.hasOwnProperty(t) && e(a[t]))
|
|
1128
|
-
return t;
|
|
1169
|
+
function Ue(e) {
|
|
1170
|
+
return Qe.test(e);
|
|
1129
1171
|
}
|
|
1130
|
-
function
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
return t;
|
|
1172
|
+
function Je(e, t, n) {
|
|
1173
|
+
const r = $e(e, t, n);
|
|
1174
|
+
if (console.warn(r), Be.includes(e)) throw new RangeError(r);
|
|
1134
1175
|
}
|
|
1135
|
-
function
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
if (!r) return null;
|
|
1139
|
-
var n = r[0], i = e.match(a.parsePattern);
|
|
1140
|
-
if (!i) return null;
|
|
1141
|
-
var o = a.valueCallback ? a.valueCallback(i[0]) : i[0];
|
|
1142
|
-
o = t.valueCallback ? t.valueCallback(o) : o;
|
|
1143
|
-
var c = e.slice(n.length);
|
|
1144
|
-
return {
|
|
1145
|
-
value: o,
|
|
1146
|
-
rest: c
|
|
1147
|
-
};
|
|
1148
|
-
};
|
|
1176
|
+
function $e(e, t, n) {
|
|
1177
|
+
const r = e[0] === "Y" ? "years" : "days of the month";
|
|
1178
|
+
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1149
1179
|
}
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
any: [/^b/i, /^(a|c)/i]
|
|
1156
|
-
}, it = {
|
|
1157
|
-
narrow: /^[1234]/i,
|
|
1158
|
-
abbreviated: /^q[1234]/i,
|
|
1159
|
-
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
1160
|
-
}, ot = {
|
|
1161
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1162
|
-
}, ut = {
|
|
1163
|
-
narrow: /^[jfmasond]/i,
|
|
1164
|
-
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
1165
|
-
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
1166
|
-
}, dt = {
|
|
1167
|
-
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
|
|
1168
|
-
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
|
|
1169
|
-
}, ct = {
|
|
1170
|
-
narrow: /^[smtwf]/i,
|
|
1171
|
-
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
1172
|
-
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
1173
|
-
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
1174
|
-
}, st = {
|
|
1175
|
-
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
1176
|
-
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
1177
|
-
}, lt = {
|
|
1178
|
-
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
1179
|
-
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
1180
|
-
}, ft = {
|
|
1181
|
-
any: {
|
|
1182
|
-
am: /^a/i,
|
|
1183
|
-
pm: /^p/i,
|
|
1184
|
-
midnight: /^mi/i,
|
|
1185
|
-
noon: /^no/i,
|
|
1186
|
-
morning: /morning/i,
|
|
1187
|
-
afternoon: /afternoon/i,
|
|
1188
|
-
evening: /evening/i,
|
|
1189
|
-
night: /night/i
|
|
1190
|
-
}
|
|
1191
|
-
}, mt = {
|
|
1192
|
-
ordinalNumber: et({
|
|
1193
|
-
matchPattern: tt,
|
|
1194
|
-
parsePattern: at,
|
|
1195
|
-
valueCallback: function(e) {
|
|
1196
|
-
return parseInt(e, 10);
|
|
1197
|
-
}
|
|
1198
|
-
}),
|
|
1199
|
-
era: x({
|
|
1200
|
-
matchPatterns: rt,
|
|
1201
|
-
defaultMatchWidth: "wide",
|
|
1202
|
-
parsePatterns: nt,
|
|
1203
|
-
defaultParseWidth: "any"
|
|
1204
|
-
}),
|
|
1205
|
-
quarter: x({
|
|
1206
|
-
matchPatterns: it,
|
|
1207
|
-
defaultMatchWidth: "wide",
|
|
1208
|
-
parsePatterns: ot,
|
|
1209
|
-
defaultParseWidth: "any",
|
|
1210
|
-
valueCallback: function(e) {
|
|
1211
|
-
return e + 1;
|
|
1212
|
-
}
|
|
1213
|
-
}),
|
|
1214
|
-
month: x({
|
|
1215
|
-
matchPatterns: ut,
|
|
1216
|
-
defaultMatchWidth: "wide",
|
|
1217
|
-
parsePatterns: dt,
|
|
1218
|
-
defaultParseWidth: "any"
|
|
1219
|
-
}),
|
|
1220
|
-
day: x({
|
|
1221
|
-
matchPatterns: ct,
|
|
1222
|
-
defaultMatchWidth: "wide",
|
|
1223
|
-
parsePatterns: st,
|
|
1224
|
-
defaultParseWidth: "any"
|
|
1225
|
-
}),
|
|
1226
|
-
dayPeriod: x({
|
|
1227
|
-
matchPatterns: lt,
|
|
1228
|
-
defaultMatchWidth: "any",
|
|
1229
|
-
parsePatterns: ft,
|
|
1230
|
-
defaultParseWidth: "any"
|
|
1231
|
-
})
|
|
1232
|
-
};
|
|
1233
|
-
const ht = mt;
|
|
1234
|
-
var vt = {
|
|
1235
|
-
code: "en-US",
|
|
1236
|
-
formatDistance: Ye,
|
|
1237
|
-
formatLong: Ie,
|
|
1238
|
-
formatRelative: He,
|
|
1239
|
-
localize: Ke,
|
|
1240
|
-
match: ht,
|
|
1241
|
-
options: {
|
|
1242
|
-
weekStartsOn: 0,
|
|
1243
|
-
firstWeekContainsDate: 1
|
|
1244
|
-
}
|
|
1245
|
-
};
|
|
1246
|
-
const gt = vt;
|
|
1247
|
-
var wt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, bt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, yt = /^'([^]*?)'?$/, Tt = /''/g, pt = /[a-zA-Z]/;
|
|
1248
|
-
function Ct(a, e, t) {
|
|
1249
|
-
var r, n, i, o, c, u, d, f, m, l, h, v, b, C, O, R, I, F;
|
|
1250
|
-
g(2, arguments);
|
|
1251
|
-
var ae = String(e), M = L(), E = (r = (n = t == null ? void 0 : t.locale) !== null && n !== void 0 ? n : M.locale) !== null && r !== void 0 ? r : gt, $ = S((i = (o = (c = (u = t == null ? void 0 : t.firstWeekContainsDate) !== null && u !== void 0 ? u : t == null || (d = t.locale) === null || d === void 0 || (f = d.options) === null || f === void 0 ? void 0 : f.firstWeekContainsDate) !== null && c !== void 0 ? c : M.firstWeekContainsDate) !== null && o !== void 0 ? o : (m = M.locale) === null || m === void 0 || (l = m.options) === null || l === void 0 ? void 0 : l.firstWeekContainsDate) !== null && i !== void 0 ? i : 1);
|
|
1252
|
-
if (!($ >= 1 && $ <= 7))
|
|
1253
|
-
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
|
|
1254
|
-
var H = S((h = (v = (b = (C = t == null ? void 0 : t.weekStartsOn) !== null && C !== void 0 ? C : t == null || (O = t.locale) === null || O === void 0 || (R = O.options) === null || R === void 0 ? void 0 : R.weekStartsOn) !== null && b !== void 0 ? b : M.weekStartsOn) !== null && v !== void 0 ? v : (I = M.locale) === null || I === void 0 || (F = I.options) === null || F === void 0 ? void 0 : F.weekStartsOn) !== null && h !== void 0 ? h : 0);
|
|
1255
|
-
if (!(H >= 0 && H <= 6))
|
|
1256
|
-
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
|
|
1257
|
-
if (!E.localize)
|
|
1258
|
-
throw new RangeError("locale must contain localize property");
|
|
1259
|
-
if (!E.formatLong)
|
|
1260
|
-
throw new RangeError("locale must contain formatLong property");
|
|
1261
|
-
var _ = y(a);
|
|
1262
|
-
if (!he(_))
|
|
1180
|
+
const Ke = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ze = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ze = /^'([^]*?)'?$/, et = /''/g, tt = /[a-zA-Z]/;
|
|
1181
|
+
function nt(e, t, n) {
|
|
1182
|
+
var f, g, l, w, v, y, p, N;
|
|
1183
|
+
const r = W(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? _e, o = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((g = (f = n == null ? void 0 : n.locale) == null ? void 0 : f.options) == null ? void 0 : g.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((w = (l = r.locale) == null ? void 0 : l.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, c = (n == null ? void 0 : n.weekStartsOn) ?? ((y = (v = n == null ? void 0 : n.locale) == null ? void 0 : v.options) == null ? void 0 : y.weekStartsOn) ?? r.weekStartsOn ?? ((N = (p = r.locale) == null ? void 0 : p.options) == null ? void 0 : N.weekStartsOn) ?? 0, u = b(e);
|
|
1184
|
+
if (!re(u))
|
|
1263
1185
|
throw new RangeError("Invalid time value");
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
}, oe = ae.match(bt).map(function(w) {
|
|
1270
|
-
var T = w[0];
|
|
1271
|
-
if (T === "p" || T === "P") {
|
|
1272
|
-
var U = Me[T];
|
|
1273
|
-
return U(w, E.formatLong);
|
|
1186
|
+
let i = t.match(ze).map((m) => {
|
|
1187
|
+
const h = m[0];
|
|
1188
|
+
if (h === "p" || h === "P") {
|
|
1189
|
+
const A = je[h];
|
|
1190
|
+
return A(m, a.formatLong);
|
|
1274
1191
|
}
|
|
1275
|
-
return
|
|
1276
|
-
}).join("").match(
|
|
1277
|
-
if (
|
|
1278
|
-
return "'";
|
|
1279
|
-
|
|
1280
|
-
if (
|
|
1281
|
-
return
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1192
|
+
return m;
|
|
1193
|
+
}).join("").match(Ke).map((m) => {
|
|
1194
|
+
if (m === "''")
|
|
1195
|
+
return { isToken: !1, value: "'" };
|
|
1196
|
+
const h = m[0];
|
|
1197
|
+
if (h === "'")
|
|
1198
|
+
return { isToken: !1, value: rt(m) };
|
|
1199
|
+
if (H[h])
|
|
1200
|
+
return { isToken: !0, value: m };
|
|
1201
|
+
if (h.match(tt))
|
|
1202
|
+
throw new RangeError(
|
|
1203
|
+
"Format string contains an unescaped latin alphabet character `" + h + "`"
|
|
1204
|
+
);
|
|
1205
|
+
return { isToken: !1, value: m };
|
|
1206
|
+
});
|
|
1207
|
+
a.localize.preprocessor && (i = a.localize.preprocessor(u, i));
|
|
1208
|
+
const d = {
|
|
1209
|
+
firstWeekContainsDate: o,
|
|
1210
|
+
weekStartsOn: c,
|
|
1211
|
+
locale: a
|
|
1212
|
+
};
|
|
1213
|
+
return i.map((m) => {
|
|
1214
|
+
if (!m.isToken) return m.value;
|
|
1215
|
+
const h = m.value;
|
|
1216
|
+
(!(n != null && n.useAdditionalWeekYearTokens) && Ue(h) || !(n != null && n.useAdditionalDayOfYearTokens) && Ve(h)) && Je(h, t, String(e));
|
|
1217
|
+
const A = H[h[0]];
|
|
1218
|
+
return A(u, h, a.localize, d);
|
|
1288
1219
|
}).join("");
|
|
1289
|
-
return oe;
|
|
1290
1220
|
}
|
|
1291
|
-
function
|
|
1292
|
-
|
|
1293
|
-
return
|
|
1221
|
+
function rt(e) {
|
|
1222
|
+
const t = e.match(Ze);
|
|
1223
|
+
return t ? t[1].replace(et, "'") : e;
|
|
1294
1224
|
}
|
|
1295
|
-
function
|
|
1225
|
+
function st() {
|
|
1296
1226
|
return {
|
|
1297
|
-
formatDateBy: (
|
|
1298
|
-
if (isNaN(
|
|
1227
|
+
formatDateBy: (n, r = {}) => {
|
|
1228
|
+
if (isNaN(n))
|
|
1299
1229
|
return null;
|
|
1300
1230
|
try {
|
|
1301
|
-
return new Date(
|
|
1231
|
+
return new Date(n * 1e3).toLocaleDateString("en-US", {
|
|
1302
1232
|
year: "numeric",
|
|
1303
1233
|
month: "long",
|
|
1304
1234
|
day: "numeric",
|
|
@@ -1313,57 +1243,57 @@ function kt() {
|
|
|
1313
1243
|
return null;
|
|
1314
1244
|
}
|
|
1315
1245
|
},
|
|
1316
|
-
formatUnixToDate: (
|
|
1317
|
-
if (!
|
|
1246
|
+
formatUnixToDate: (n, r) => {
|
|
1247
|
+
if (!n)
|
|
1318
1248
|
return "";
|
|
1319
|
-
const
|
|
1249
|
+
const a = r ? "yyyy-MM-dd HH:mm:ss" : "yyyy-MM-dd HH:mm:ss XX";
|
|
1320
1250
|
try {
|
|
1321
|
-
const
|
|
1322
|
-
return
|
|
1251
|
+
const o = new Date(n * 1e3);
|
|
1252
|
+
return nt(o, a);
|
|
1323
1253
|
} catch {
|
|
1324
1254
|
return "";
|
|
1325
1255
|
}
|
|
1326
1256
|
}
|
|
1327
1257
|
};
|
|
1328
1258
|
}
|
|
1329
|
-
function
|
|
1259
|
+
function dt() {
|
|
1330
1260
|
return {
|
|
1331
|
-
debounce: (
|
|
1261
|
+
debounce: (t, n) => {
|
|
1332
1262
|
let r;
|
|
1333
|
-
return (...
|
|
1263
|
+
return (...a) => {
|
|
1334
1264
|
clearTimeout(r), r = window == null ? void 0 : window.setTimeout(() => {
|
|
1335
|
-
|
|
1336
|
-
},
|
|
1265
|
+
t(...a);
|
|
1266
|
+
}, n);
|
|
1337
1267
|
};
|
|
1338
1268
|
}
|
|
1339
1269
|
};
|
|
1340
1270
|
}
|
|
1341
|
-
function
|
|
1342
|
-
const r =
|
|
1343
|
-
const { libName:
|
|
1271
|
+
function ft({ script: e, styles: t, onReady: n }) {
|
|
1272
|
+
const r = x(!0), a = x(!0), o = async () => {
|
|
1273
|
+
const { libName: i, url: d, type: f } = e;
|
|
1344
1274
|
if ((f !== void 0 && ["umd", "es"].includes(f) ? f : "umd") === "es") {
|
|
1345
1275
|
await import(
|
|
1346
1276
|
/* @vite-ignore */
|
|
1347
1277
|
d
|
|
1348
|
-
), typeof
|
|
1278
|
+
), typeof n == "function" && await n();
|
|
1349
1279
|
return;
|
|
1350
1280
|
}
|
|
1351
|
-
const l =
|
|
1352
|
-
return window[l] || (window[l] = await new Promise((
|
|
1353
|
-
const
|
|
1354
|
-
|
|
1355
|
-
typeof
|
|
1356
|
-
}),
|
|
1281
|
+
const l = i.startsWith("kong-ui-") ? i : `kong-ui-${i}`;
|
|
1282
|
+
return window[l] || (window[l] = await new Promise((w, v) => {
|
|
1283
|
+
const y = document.createElement("script");
|
|
1284
|
+
y.async = !0, y.addEventListener("load", async () => {
|
|
1285
|
+
typeof n == "function" && await n(), r.value = !1, w(window[l]);
|
|
1286
|
+
}), y.addEventListener("error", () => {
|
|
1357
1287
|
v(new Error(`Could not load '${l}' from ${d}`));
|
|
1358
|
-
}),
|
|
1288
|
+
}), y.src = d, document.head.appendChild(y);
|
|
1359
1289
|
})), window[l];
|
|
1360
|
-
},
|
|
1290
|
+
}, c = async (i, d) => {
|
|
1361
1291
|
var f;
|
|
1362
|
-
for (const
|
|
1292
|
+
for (const g of i) {
|
|
1363
1293
|
const l = document.createElement("link");
|
|
1364
|
-
l.type = "text/css", l.rel = "stylesheet", l.href =
|
|
1365
|
-
const
|
|
1366
|
-
if (
|
|
1294
|
+
l.type = "text/css", l.rel = "stylesheet", l.href = g;
|
|
1295
|
+
const w = d ? document.querySelector(d) : null, v = d ? (f = w == null ? void 0 : w.shadowRoot) == null ? void 0 : f.children[0] : null;
|
|
1296
|
+
if (w && v)
|
|
1367
1297
|
try {
|
|
1368
1298
|
v.appendChild(l);
|
|
1369
1299
|
} catch {
|
|
@@ -1376,137 +1306,137 @@ function _t({ script: a, styles: e, onReady: t }) {
|
|
|
1376
1306
|
return {
|
|
1377
1307
|
importPackage: async () => {
|
|
1378
1308
|
var d, f;
|
|
1379
|
-
if (!
|
|
1380
|
-
const
|
|
1381
|
-
if ((!
|
|
1382
|
-
return await
|
|
1383
|
-
await
|
|
1309
|
+
if (!e || !e.url || typeof window > "u" || typeof document > "u") return;
|
|
1310
|
+
const i = $(() => !!(t && (t != null && t.urls) && (t != null && t.urls.length) && t.shadowRoot));
|
|
1311
|
+
if ((!t || !(t != null && t.urls) || !((d = t == null ? void 0 : t.urls) != null && d.length)) && (a.value = !1), t != null && t.urls && ((f = t == null ? void 0 : t.urls) != null && f.length) && !i.value && (await c(t.urls), a.value = !1), (!e.type || e.type === "umd") && !i.value)
|
|
1312
|
+
return await o();
|
|
1313
|
+
await o(), await _(), r.value = !1, t != null && t.urls && i.value && (await c(t.urls, t == null ? void 0 : t.shadowRoot), await _(), a.value = !1);
|
|
1384
1314
|
},
|
|
1385
|
-
loadingPackage:
|
|
1386
|
-
loadingStyles:
|
|
1315
|
+
loadingPackage: F(r),
|
|
1316
|
+
loadingStyles: F(a)
|
|
1387
1317
|
};
|
|
1388
1318
|
}
|
|
1389
|
-
var
|
|
1390
|
-
const
|
|
1391
|
-
var
|
|
1392
|
-
return
|
|
1393
|
-
((
|
|
1319
|
+
var U = /* @__PURE__ */ ((e) => (e.VALIDATING = "VALIDATING", e.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", e.PENDING = "PENDING", e.SUCCESS = "SUCCESS", e.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", e.ERROR = "ERROR", e.STALE_IF_ERROR = "STALE_IF_ERROR", e))(U || {});
|
|
1320
|
+
const at = (e) => {
|
|
1321
|
+
var t, n, r, a, o;
|
|
1322
|
+
return e ? !!// TODO: revisit: currently only the first check ever matters?
|
|
1323
|
+
((t = Object.keys(e)) != null && t.length || (n = e.data) != null && n.length || (a = (r = e.data) == null ? void 0 : r.data) != null && a.length || !((o = e.data) != null && o.data) && typeof e.data == "object" && Object.keys(e == null ? void 0 : e.data).length) : !1;
|
|
1394
1324
|
};
|
|
1395
|
-
function
|
|
1396
|
-
const
|
|
1325
|
+
function lt(e = x({}), t, n, r = at) {
|
|
1326
|
+
const a = x(
|
|
1397
1327
|
"PENDING"
|
|
1398
1328
|
/* PENDING */
|
|
1399
1329
|
);
|
|
1400
|
-
return
|
|
1401
|
-
const
|
|
1402
|
-
if (
|
|
1403
|
-
|
|
1330
|
+
return K(() => {
|
|
1331
|
+
const o = r(e.value);
|
|
1332
|
+
if (e.value && o && n.value) {
|
|
1333
|
+
a.value = "VALIDATING_HAS_DATA";
|
|
1404
1334
|
return;
|
|
1405
1335
|
}
|
|
1406
|
-
if (
|
|
1407
|
-
|
|
1336
|
+
if (e.value && n.value) {
|
|
1337
|
+
a.value = "VALIDATING";
|
|
1408
1338
|
return;
|
|
1409
1339
|
}
|
|
1410
|
-
if (
|
|
1411
|
-
|
|
1340
|
+
if (e.value && t.value) {
|
|
1341
|
+
a.value = "STALE_IF_ERROR";
|
|
1412
1342
|
return;
|
|
1413
1343
|
}
|
|
1414
|
-
if (
|
|
1415
|
-
|
|
1344
|
+
if (e.value === void 0 && !t.value) {
|
|
1345
|
+
a.value = "PENDING";
|
|
1416
1346
|
return;
|
|
1417
1347
|
}
|
|
1418
|
-
if (
|
|
1419
|
-
|
|
1348
|
+
if (e.value && !t.value && o) {
|
|
1349
|
+
a.value = "SUCCESS_HAS_DATA";
|
|
1420
1350
|
return;
|
|
1421
1351
|
}
|
|
1422
|
-
if (
|
|
1423
|
-
|
|
1352
|
+
if (e.value && !t.value) {
|
|
1353
|
+
a.value = "SUCCESS";
|
|
1424
1354
|
return;
|
|
1425
1355
|
}
|
|
1426
|
-
|
|
1356
|
+
e.value === void 0 && t && (a.value = "ERROR");
|
|
1427
1357
|
}), {
|
|
1428
|
-
state:
|
|
1429
|
-
swrvState:
|
|
1358
|
+
state: a,
|
|
1359
|
+
swrvState: U
|
|
1430
1360
|
};
|
|
1431
1361
|
}
|
|
1432
|
-
const
|
|
1362
|
+
const Y = "khcp-user-table-preferences", ot = {
|
|
1433
1363
|
pageSize: 30,
|
|
1434
1364
|
sortColumnKey: void 0,
|
|
1435
1365
|
sortColumnOrder: void 0,
|
|
1436
1366
|
columnWidths: {},
|
|
1437
1367
|
columnVisibility: {}
|
|
1438
1368
|
};
|
|
1439
|
-
function
|
|
1440
|
-
const
|
|
1441
|
-
if (typeof
|
|
1369
|
+
function ht() {
|
|
1370
|
+
const e = (o) => {
|
|
1371
|
+
if (typeof o == "string")
|
|
1442
1372
|
try {
|
|
1443
|
-
return JSON.parse(
|
|
1444
|
-
} catch (
|
|
1445
|
-
console.error("useTablePreferences(tryParseJson)",
|
|
1373
|
+
return JSON.parse(o);
|
|
1374
|
+
} catch (c) {
|
|
1375
|
+
console.error("useTablePreferences(tryParseJson)", c);
|
|
1446
1376
|
return;
|
|
1447
1377
|
}
|
|
1448
|
-
},
|
|
1449
|
-
const
|
|
1450
|
-
return !
|
|
1378
|
+
}, t = () => {
|
|
1379
|
+
const o = e(localStorage.getItem(Y));
|
|
1380
|
+
return !o || !Object.keys(o).length ? /* @__PURE__ */ new Map() : new Map(Object.entries(o));
|
|
1451
1381
|
};
|
|
1452
1382
|
return {
|
|
1453
|
-
setTablePreferences: (
|
|
1383
|
+
setTablePreferences: (o, c) => {
|
|
1454
1384
|
try {
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1457
|
-
} catch (
|
|
1458
|
-
console.error("useTablePreferences(setTablePreferences)",
|
|
1385
|
+
const u = t();
|
|
1386
|
+
u.set(o, c), localStorage.setItem(Y, JSON.stringify(Object.fromEntries(u.entries())));
|
|
1387
|
+
} catch (u) {
|
|
1388
|
+
console.error("useTablePreferences(setTablePreferences)", u);
|
|
1459
1389
|
}
|
|
1460
1390
|
},
|
|
1461
|
-
getTablePreferences: (
|
|
1462
|
-
const
|
|
1463
|
-
return (
|
|
1391
|
+
getTablePreferences: (o) => {
|
|
1392
|
+
const c = t();
|
|
1393
|
+
return (c == null ? void 0 : c.get(o)) || void 0 || ot;
|
|
1464
1394
|
},
|
|
1465
1395
|
deleteAllTablePreferences: () => {
|
|
1466
|
-
localStorage.removeItem(
|
|
1396
|
+
localStorage.removeItem(Y);
|
|
1467
1397
|
}
|
|
1468
1398
|
};
|
|
1469
1399
|
}
|
|
1470
|
-
function
|
|
1471
|
-
const
|
|
1472
|
-
var
|
|
1473
|
-
return ((
|
|
1400
|
+
function mt() {
|
|
1401
|
+
const e = () => {
|
|
1402
|
+
var i;
|
|
1403
|
+
return ((i = window == null ? void 0 : window.location) == null ? void 0 : i.search) || "";
|
|
1474
1404
|
};
|
|
1475
1405
|
return {
|
|
1476
|
-
getLocationSearch:
|
|
1406
|
+
getLocationSearch: e,
|
|
1477
1407
|
getLocationHostname: () => {
|
|
1478
|
-
var
|
|
1479
|
-
return ((
|
|
1408
|
+
var i;
|
|
1409
|
+
return ((i = window == null ? void 0 : window.location) == null ? void 0 : i.hostname) || "";
|
|
1480
1410
|
},
|
|
1481
1411
|
getLocationHref: () => {
|
|
1482
|
-
var
|
|
1483
|
-
return ((
|
|
1412
|
+
var i;
|
|
1413
|
+
return ((i = window == null ? void 0 : window.location) == null ? void 0 : i.href) || "";
|
|
1484
1414
|
},
|
|
1485
1415
|
getLocationPathname: () => {
|
|
1486
|
-
var
|
|
1487
|
-
return ((
|
|
1416
|
+
var i;
|
|
1417
|
+
return ((i = window == null ? void 0 : window.location) == null ? void 0 : i.pathname) || "";
|
|
1488
1418
|
},
|
|
1489
1419
|
getLocationOrigin: () => {
|
|
1490
|
-
var
|
|
1491
|
-
return ((
|
|
1420
|
+
var i;
|
|
1421
|
+
return ((i = window == null ? void 0 : window.location) == null ? void 0 : i.origin) || "";
|
|
1492
1422
|
},
|
|
1493
|
-
getUrlSearchParams: () => new URLSearchParams(
|
|
1494
|
-
setLocationAssign: (
|
|
1495
|
-
window.location.assign(
|
|
1423
|
+
getUrlSearchParams: () => new URLSearchParams(e()),
|
|
1424
|
+
setLocationAssign: (i) => {
|
|
1425
|
+
window.location.assign(i);
|
|
1496
1426
|
},
|
|
1497
|
-
setLocationReplace: (
|
|
1498
|
-
window.location.replace(
|
|
1427
|
+
setLocationReplace: (i) => {
|
|
1428
|
+
window.location.replace(i);
|
|
1499
1429
|
}
|
|
1500
1430
|
};
|
|
1501
1431
|
}
|
|
1502
1432
|
export {
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1433
|
+
ot as DEFAULT_USER_TABLE_PREFERENCES,
|
|
1434
|
+
Y as USER_TABLE_PREFERENCES_LOCAL_STORAGE_KEY,
|
|
1435
|
+
ut as useAxios,
|
|
1436
|
+
st as useDate,
|
|
1437
|
+
dt as useDebounce,
|
|
1438
|
+
ft as usePackage,
|
|
1439
|
+
lt as useSwrvState,
|
|
1440
|
+
ht as useTablePreferences,
|
|
1441
|
+
mt as useWindow
|
|
1512
1442
|
};
|