@prefecthq/prefab-ui 0.16.0 → 0.16.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/package.json +3 -3
- package/dist/_renderer/charts-Dr57vKmb.mjs +0 -21311
- package/dist/_renderer/compound-calendar-Cn18AoRs.mjs +0 -3406
- package/dist/_renderer/content-e43PvxaF.mjs +0 -14178
- package/dist/_renderer/embed-DRE2wKZJ.mjs +0 -37734
- package/dist/_renderer/embed.mjs +0 -1
- package/dist/_renderer/icons-CImNZgDa.mjs +0 -27129
- package/dist/_renderer/svg-BL0kMZ_p.mjs +0 -571
- package/dist/playground.html +0 -20205
- package/dist/renderer.js +0 -1
- /package/dist/app/{renderer.html → index.html} +0 -0
|
@@ -1,3406 +0,0 @@
|
|
|
1
|
-
import { j as A, c as Y, b as lt, B as En, P as Fn, d as In, e as Bn } from "./embed-DRE2wKZJ.mjs";
|
|
2
|
-
import { R as m, a as x, f as jn, e as Hn, h as St, j as An } from "./icons-CImNZgDa.mjs";
|
|
3
|
-
const pt = 6048e5, qn = 864e5, Ct = 6e4, xt = 36e5, ht = Symbol.for("constructDateFrom");
|
|
4
|
-
function j(e, t) {
|
|
5
|
-
return typeof e == "function" ? e(t) : e && typeof e == "object" && ht in e ? e[ht](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
6
|
-
}
|
|
7
|
-
function P(e, t) {
|
|
8
|
-
return j(t || e, e);
|
|
9
|
-
}
|
|
10
|
-
function Yt(e, t, n) {
|
|
11
|
-
const r = P(e, n == null ? void 0 : n.in);
|
|
12
|
-
return isNaN(t) ? j(e, NaN) : (t && r.setDate(r.getDate() + t), r);
|
|
13
|
-
}
|
|
14
|
-
function Tt(e, t, n) {
|
|
15
|
-
const r = P(e, n == null ? void 0 : n.in);
|
|
16
|
-
if (isNaN(t)) return j(e, NaN);
|
|
17
|
-
if (!t)
|
|
18
|
-
return r;
|
|
19
|
-
const a = r.getDate(), o = j(e, r.getTime());
|
|
20
|
-
o.setMonth(r.getMonth() + t + 1, 0);
|
|
21
|
-
const s = o.getDate();
|
|
22
|
-
return a >= s ? o : (r.setFullYear(
|
|
23
|
-
o.getFullYear(),
|
|
24
|
-
o.getMonth(),
|
|
25
|
-
a
|
|
26
|
-
), r);
|
|
27
|
-
}
|
|
28
|
-
let zn = {};
|
|
29
|
-
function Ne() {
|
|
30
|
-
return zn;
|
|
31
|
-
}
|
|
32
|
-
function me(e, t) {
|
|
33
|
-
var c, i, u, d;
|
|
34
|
-
const n = Ne(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((i = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : i.weekStartsOn) ?? n.weekStartsOn ?? ((d = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : d.weekStartsOn) ?? 0, a = P(e, t == null ? void 0 : t.in), o = a.getDay(), s = (o < r ? 7 : 0) + o - r;
|
|
35
|
-
return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
|
|
36
|
-
}
|
|
37
|
-
function ve(e, t) {
|
|
38
|
-
return me(e, { ...t, weekStartsOn: 1 });
|
|
39
|
-
}
|
|
40
|
-
function _t(e, t) {
|
|
41
|
-
const n = P(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = j(n, 0);
|
|
42
|
-
a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
|
|
43
|
-
const o = ve(a), s = j(n, 0);
|
|
44
|
-
s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0);
|
|
45
|
-
const c = ve(s);
|
|
46
|
-
return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= c.getTime() ? r : r - 1;
|
|
47
|
-
}
|
|
48
|
-
function mt(e) {
|
|
49
|
-
const t = P(e), n = new Date(
|
|
50
|
-
Date.UTC(
|
|
51
|
-
t.getFullYear(),
|
|
52
|
-
t.getMonth(),
|
|
53
|
-
t.getDate(),
|
|
54
|
-
t.getHours(),
|
|
55
|
-
t.getMinutes(),
|
|
56
|
-
t.getSeconds(),
|
|
57
|
-
t.getMilliseconds()
|
|
58
|
-
)
|
|
59
|
-
);
|
|
60
|
-
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
61
|
-
}
|
|
62
|
-
function ye(e, ...t) {
|
|
63
|
-
const n = j.bind(
|
|
64
|
-
null,
|
|
65
|
-
t.find((r) => typeof r == "object")
|
|
66
|
-
);
|
|
67
|
-
return t.map(n);
|
|
68
|
-
}
|
|
69
|
-
function We(e, t) {
|
|
70
|
-
const n = P(e, t == null ? void 0 : t.in);
|
|
71
|
-
return n.setHours(0, 0, 0, 0), n;
|
|
72
|
-
}
|
|
73
|
-
function Ze(e, t, n) {
|
|
74
|
-
const [r, a] = ye(
|
|
75
|
-
n == null ? void 0 : n.in,
|
|
76
|
-
e,
|
|
77
|
-
t
|
|
78
|
-
), o = We(r), s = We(a), c = +o - mt(o), i = +s - mt(s);
|
|
79
|
-
return Math.round((c - i) / qn);
|
|
80
|
-
}
|
|
81
|
-
function $n(e, t) {
|
|
82
|
-
const n = _t(e, t), r = j(e, 0);
|
|
83
|
-
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), ve(r);
|
|
84
|
-
}
|
|
85
|
-
function Rn(e, t, n) {
|
|
86
|
-
return Yt(e, t * 7, n);
|
|
87
|
-
}
|
|
88
|
-
function Gn(e, t, n) {
|
|
89
|
-
return Tt(e, t * 12, n);
|
|
90
|
-
}
|
|
91
|
-
function Un(e, t) {
|
|
92
|
-
let n, r = t == null ? void 0 : t.in;
|
|
93
|
-
return e.forEach((a) => {
|
|
94
|
-
!r && typeof a == "object" && (r = j.bind(null, a));
|
|
95
|
-
const o = P(a, r);
|
|
96
|
-
(!n || n < o || isNaN(+o)) && (n = o);
|
|
97
|
-
}), j(r, n || NaN);
|
|
98
|
-
}
|
|
99
|
-
function Qn(e, t) {
|
|
100
|
-
let n, r = t == null ? void 0 : t.in;
|
|
101
|
-
return e.forEach((a) => {
|
|
102
|
-
!r && typeof a == "object" && (r = j.bind(null, a));
|
|
103
|
-
const o = P(a, r);
|
|
104
|
-
(!n || n > o || isNaN(+o)) && (n = o);
|
|
105
|
-
}), j(r, n || NaN);
|
|
106
|
-
}
|
|
107
|
-
function Xn(e, t, n) {
|
|
108
|
-
const [r, a] = ye(
|
|
109
|
-
n == null ? void 0 : n.in,
|
|
110
|
-
e,
|
|
111
|
-
t
|
|
112
|
-
);
|
|
113
|
-
return +We(r) == +We(a);
|
|
114
|
-
}
|
|
115
|
-
function Pt(e) {
|
|
116
|
-
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
117
|
-
}
|
|
118
|
-
function Vn(e) {
|
|
119
|
-
return !(!Pt(e) && typeof e != "number" || isNaN(+P(e)));
|
|
120
|
-
}
|
|
121
|
-
function Et(e, t, n) {
|
|
122
|
-
const [r, a] = ye(
|
|
123
|
-
n == null ? void 0 : n.in,
|
|
124
|
-
e,
|
|
125
|
-
t
|
|
126
|
-
), o = r.getFullYear() - a.getFullYear(), s = r.getMonth() - a.getMonth();
|
|
127
|
-
return o * 12 + s;
|
|
128
|
-
}
|
|
129
|
-
function Jn(e, t) {
|
|
130
|
-
const n = P(e, t == null ? void 0 : t.in), r = n.getMonth();
|
|
131
|
-
return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
132
|
-
}
|
|
133
|
-
function Ft(e, t) {
|
|
134
|
-
const [n, r] = ye(e, t.start, t.end);
|
|
135
|
-
return { start: n, end: r };
|
|
136
|
-
}
|
|
137
|
-
function Zn(e, t) {
|
|
138
|
-
const { start: n, end: r } = Ft(t == null ? void 0 : t.in, e);
|
|
139
|
-
let a = +n > +r;
|
|
140
|
-
const o = a ? +n : +r, s = a ? r : n;
|
|
141
|
-
s.setHours(0, 0, 0, 0), s.setDate(1);
|
|
142
|
-
let c = 1;
|
|
143
|
-
const i = [];
|
|
144
|
-
for (; +s <= o; )
|
|
145
|
-
i.push(j(n, s)), s.setMonth(s.getMonth() + c);
|
|
146
|
-
return a ? i.reverse() : i;
|
|
147
|
-
}
|
|
148
|
-
function Kn(e, t) {
|
|
149
|
-
const n = P(e, t == null ? void 0 : t.in);
|
|
150
|
-
return n.setDate(1), n.setHours(0, 0, 0, 0), n;
|
|
151
|
-
}
|
|
152
|
-
function Ln(e, t) {
|
|
153
|
-
const n = P(e, t == null ? void 0 : t.in), r = n.getFullYear();
|
|
154
|
-
return n.setFullYear(r + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
|
|
155
|
-
}
|
|
156
|
-
function It(e, t) {
|
|
157
|
-
const n = P(e, t == null ? void 0 : t.in);
|
|
158
|
-
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
159
|
-
}
|
|
160
|
-
function er(e, t) {
|
|
161
|
-
const { start: n, end: r } = Ft(t == null ? void 0 : t.in, e);
|
|
162
|
-
let a = +n > +r;
|
|
163
|
-
const o = a ? +n : +r, s = a ? r : n;
|
|
164
|
-
s.setHours(0, 0, 0, 0), s.setMonth(0, 1);
|
|
165
|
-
let c = 1;
|
|
166
|
-
const i = [];
|
|
167
|
-
for (; +s <= o; )
|
|
168
|
-
i.push(j(n, s)), s.setFullYear(s.getFullYear() + c);
|
|
169
|
-
return a ? i.reverse() : i;
|
|
170
|
-
}
|
|
171
|
-
function Bt(e, t) {
|
|
172
|
-
var c, i, u, d;
|
|
173
|
-
const n = Ne(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((i = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : i.weekStartsOn) ?? n.weekStartsOn ?? ((d = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : d.weekStartsOn) ?? 0, a = P(e, t == null ? void 0 : t.in), o = a.getDay(), s = (o < r ? -7 : 0) + 6 - (o - r);
|
|
174
|
-
return a.setDate(a.getDate() + s), a.setHours(23, 59, 59, 999), a;
|
|
175
|
-
}
|
|
176
|
-
function tr(e, t) {
|
|
177
|
-
return Bt(e, { ...t, weekStartsOn: 1 });
|
|
178
|
-
}
|
|
179
|
-
const nr = {
|
|
180
|
-
lessThanXSeconds: {
|
|
181
|
-
one: "less than a second",
|
|
182
|
-
other: "less than {{count}} seconds"
|
|
183
|
-
},
|
|
184
|
-
xSeconds: {
|
|
185
|
-
one: "1 second",
|
|
186
|
-
other: "{{count}} seconds"
|
|
187
|
-
},
|
|
188
|
-
halfAMinute: "half a minute",
|
|
189
|
-
lessThanXMinutes: {
|
|
190
|
-
one: "less than a minute",
|
|
191
|
-
other: "less than {{count}} minutes"
|
|
192
|
-
},
|
|
193
|
-
xMinutes: {
|
|
194
|
-
one: "1 minute",
|
|
195
|
-
other: "{{count}} minutes"
|
|
196
|
-
},
|
|
197
|
-
aboutXHours: {
|
|
198
|
-
one: "about 1 hour",
|
|
199
|
-
other: "about {{count}} hours"
|
|
200
|
-
},
|
|
201
|
-
xHours: {
|
|
202
|
-
one: "1 hour",
|
|
203
|
-
other: "{{count}} hours"
|
|
204
|
-
},
|
|
205
|
-
xDays: {
|
|
206
|
-
one: "1 day",
|
|
207
|
-
other: "{{count}} days"
|
|
208
|
-
},
|
|
209
|
-
aboutXWeeks: {
|
|
210
|
-
one: "about 1 week",
|
|
211
|
-
other: "about {{count}} weeks"
|
|
212
|
-
},
|
|
213
|
-
xWeeks: {
|
|
214
|
-
one: "1 week",
|
|
215
|
-
other: "{{count}} weeks"
|
|
216
|
-
},
|
|
217
|
-
aboutXMonths: {
|
|
218
|
-
one: "about 1 month",
|
|
219
|
-
other: "about {{count}} months"
|
|
220
|
-
},
|
|
221
|
-
xMonths: {
|
|
222
|
-
one: "1 month",
|
|
223
|
-
other: "{{count}} months"
|
|
224
|
-
},
|
|
225
|
-
aboutXYears: {
|
|
226
|
-
one: "about 1 year",
|
|
227
|
-
other: "about {{count}} years"
|
|
228
|
-
},
|
|
229
|
-
xYears: {
|
|
230
|
-
one: "1 year",
|
|
231
|
-
other: "{{count}} years"
|
|
232
|
-
},
|
|
233
|
-
overXYears: {
|
|
234
|
-
one: "over 1 year",
|
|
235
|
-
other: "over {{count}} years"
|
|
236
|
-
},
|
|
237
|
-
almostXYears: {
|
|
238
|
-
one: "almost 1 year",
|
|
239
|
-
other: "almost {{count}} years"
|
|
240
|
-
}
|
|
241
|
-
}, rr = (e, t, n) => {
|
|
242
|
-
let r;
|
|
243
|
-
const a = nr[e];
|
|
244
|
-
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;
|
|
245
|
-
};
|
|
246
|
-
function $e(e) {
|
|
247
|
-
return (t = {}) => {
|
|
248
|
-
const n = t.width ? String(t.width) : e.defaultWidth;
|
|
249
|
-
return e.formats[n] || e.formats[e.defaultWidth];
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
const ar = {
|
|
253
|
-
full: "EEEE, MMMM do, y",
|
|
254
|
-
long: "MMMM do, y",
|
|
255
|
-
medium: "MMM d, y",
|
|
256
|
-
short: "MM/dd/yyyy"
|
|
257
|
-
}, or = {
|
|
258
|
-
full: "h:mm:ss a zzzz",
|
|
259
|
-
long: "h:mm:ss a z",
|
|
260
|
-
medium: "h:mm:ss a",
|
|
261
|
-
short: "h:mm a"
|
|
262
|
-
}, sr = {
|
|
263
|
-
full: "{{date}} 'at' {{time}}",
|
|
264
|
-
long: "{{date}} 'at' {{time}}",
|
|
265
|
-
medium: "{{date}}, {{time}}",
|
|
266
|
-
short: "{{date}}, {{time}}"
|
|
267
|
-
}, ir = {
|
|
268
|
-
date: $e({
|
|
269
|
-
formats: ar,
|
|
270
|
-
defaultWidth: "full"
|
|
271
|
-
}),
|
|
272
|
-
time: $e({
|
|
273
|
-
formats: or,
|
|
274
|
-
defaultWidth: "full"
|
|
275
|
-
}),
|
|
276
|
-
dateTime: $e({
|
|
277
|
-
formats: sr,
|
|
278
|
-
defaultWidth: "full"
|
|
279
|
-
})
|
|
280
|
-
}, cr = {
|
|
281
|
-
lastWeek: "'last' eeee 'at' p",
|
|
282
|
-
yesterday: "'yesterday at' p",
|
|
283
|
-
today: "'today at' p",
|
|
284
|
-
tomorrow: "'tomorrow at' p",
|
|
285
|
-
nextWeek: "eeee 'at' p",
|
|
286
|
-
other: "P"
|
|
287
|
-
}, ur = (e, t, n, r) => cr[e];
|
|
288
|
-
function be(e) {
|
|
289
|
-
return (t, n) => {
|
|
290
|
-
const r = n != null && n.context ? String(n.context) : "standalone";
|
|
291
|
-
let a;
|
|
292
|
-
if (r === "formatting" && e.formattingValues) {
|
|
293
|
-
const s = e.defaultFormattingWidth || e.defaultWidth, c = n != null && n.width ? String(n.width) : s;
|
|
294
|
-
a = e.formattingValues[c] || e.formattingValues[s];
|
|
295
|
-
} else {
|
|
296
|
-
const s = e.defaultWidth, c = n != null && n.width ? String(n.width) : e.defaultWidth;
|
|
297
|
-
a = e.values[c] || e.values[s];
|
|
298
|
-
}
|
|
299
|
-
const o = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
300
|
-
return a[o];
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
const dr = {
|
|
304
|
-
narrow: ["B", "A"],
|
|
305
|
-
abbreviated: ["BC", "AD"],
|
|
306
|
-
wide: ["Before Christ", "Anno Domini"]
|
|
307
|
-
}, fr = {
|
|
308
|
-
narrow: ["1", "2", "3", "4"],
|
|
309
|
-
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
310
|
-
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
311
|
-
}, lr = {
|
|
312
|
-
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
313
|
-
abbreviated: [
|
|
314
|
-
"Jan",
|
|
315
|
-
"Feb",
|
|
316
|
-
"Mar",
|
|
317
|
-
"Apr",
|
|
318
|
-
"May",
|
|
319
|
-
"Jun",
|
|
320
|
-
"Jul",
|
|
321
|
-
"Aug",
|
|
322
|
-
"Sep",
|
|
323
|
-
"Oct",
|
|
324
|
-
"Nov",
|
|
325
|
-
"Dec"
|
|
326
|
-
],
|
|
327
|
-
wide: [
|
|
328
|
-
"January",
|
|
329
|
-
"February",
|
|
330
|
-
"March",
|
|
331
|
-
"April",
|
|
332
|
-
"May",
|
|
333
|
-
"June",
|
|
334
|
-
"July",
|
|
335
|
-
"August",
|
|
336
|
-
"September",
|
|
337
|
-
"October",
|
|
338
|
-
"November",
|
|
339
|
-
"December"
|
|
340
|
-
]
|
|
341
|
-
}, hr = {
|
|
342
|
-
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
343
|
-
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
344
|
-
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
345
|
-
wide: [
|
|
346
|
-
"Sunday",
|
|
347
|
-
"Monday",
|
|
348
|
-
"Tuesday",
|
|
349
|
-
"Wednesday",
|
|
350
|
-
"Thursday",
|
|
351
|
-
"Friday",
|
|
352
|
-
"Saturday"
|
|
353
|
-
]
|
|
354
|
-
}, mr = {
|
|
355
|
-
narrow: {
|
|
356
|
-
am: "a",
|
|
357
|
-
pm: "p",
|
|
358
|
-
midnight: "mi",
|
|
359
|
-
noon: "n",
|
|
360
|
-
morning: "morning",
|
|
361
|
-
afternoon: "afternoon",
|
|
362
|
-
evening: "evening",
|
|
363
|
-
night: "night"
|
|
364
|
-
},
|
|
365
|
-
abbreviated: {
|
|
366
|
-
am: "AM",
|
|
367
|
-
pm: "PM",
|
|
368
|
-
midnight: "midnight",
|
|
369
|
-
noon: "noon",
|
|
370
|
-
morning: "morning",
|
|
371
|
-
afternoon: "afternoon",
|
|
372
|
-
evening: "evening",
|
|
373
|
-
night: "night"
|
|
374
|
-
},
|
|
375
|
-
wide: {
|
|
376
|
-
am: "a.m.",
|
|
377
|
-
pm: "p.m.",
|
|
378
|
-
midnight: "midnight",
|
|
379
|
-
noon: "noon",
|
|
380
|
-
morning: "morning",
|
|
381
|
-
afternoon: "afternoon",
|
|
382
|
-
evening: "evening",
|
|
383
|
-
night: "night"
|
|
384
|
-
}
|
|
385
|
-
}, yr = {
|
|
386
|
-
narrow: {
|
|
387
|
-
am: "a",
|
|
388
|
-
pm: "p",
|
|
389
|
-
midnight: "mi",
|
|
390
|
-
noon: "n",
|
|
391
|
-
morning: "in the morning",
|
|
392
|
-
afternoon: "in the afternoon",
|
|
393
|
-
evening: "in the evening",
|
|
394
|
-
night: "at night"
|
|
395
|
-
},
|
|
396
|
-
abbreviated: {
|
|
397
|
-
am: "AM",
|
|
398
|
-
pm: "PM",
|
|
399
|
-
midnight: "midnight",
|
|
400
|
-
noon: "noon",
|
|
401
|
-
morning: "in the morning",
|
|
402
|
-
afternoon: "in the afternoon",
|
|
403
|
-
evening: "in the evening",
|
|
404
|
-
night: "at night"
|
|
405
|
-
},
|
|
406
|
-
wide: {
|
|
407
|
-
am: "a.m.",
|
|
408
|
-
pm: "p.m.",
|
|
409
|
-
midnight: "midnight",
|
|
410
|
-
noon: "noon",
|
|
411
|
-
morning: "in the morning",
|
|
412
|
-
afternoon: "in the afternoon",
|
|
413
|
-
evening: "in the evening",
|
|
414
|
-
night: "at night"
|
|
415
|
-
}
|
|
416
|
-
}, gr = (e, t) => {
|
|
417
|
-
const n = Number(e), r = n % 100;
|
|
418
|
-
if (r > 20 || r < 10)
|
|
419
|
-
switch (r % 10) {
|
|
420
|
-
case 1:
|
|
421
|
-
return n + "st";
|
|
422
|
-
case 2:
|
|
423
|
-
return n + "nd";
|
|
424
|
-
case 3:
|
|
425
|
-
return n + "rd";
|
|
426
|
-
}
|
|
427
|
-
return n + "th";
|
|
428
|
-
}, wr = {
|
|
429
|
-
ordinalNumber: gr,
|
|
430
|
-
era: be({
|
|
431
|
-
values: dr,
|
|
432
|
-
defaultWidth: "wide"
|
|
433
|
-
}),
|
|
434
|
-
quarter: be({
|
|
435
|
-
values: fr,
|
|
436
|
-
defaultWidth: "wide",
|
|
437
|
-
argumentCallback: (e) => e - 1
|
|
438
|
-
}),
|
|
439
|
-
month: be({
|
|
440
|
-
values: lr,
|
|
441
|
-
defaultWidth: "wide"
|
|
442
|
-
}),
|
|
443
|
-
day: be({
|
|
444
|
-
values: hr,
|
|
445
|
-
defaultWidth: "wide"
|
|
446
|
-
}),
|
|
447
|
-
dayPeriod: be({
|
|
448
|
-
values: mr,
|
|
449
|
-
defaultWidth: "wide",
|
|
450
|
-
formattingValues: yr,
|
|
451
|
-
defaultFormattingWidth: "wide"
|
|
452
|
-
})
|
|
453
|
-
};
|
|
454
|
-
function Me(e) {
|
|
455
|
-
return (t, n = {}) => {
|
|
456
|
-
const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], o = t.match(a);
|
|
457
|
-
if (!o)
|
|
458
|
-
return null;
|
|
459
|
-
const s = o[0], c = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], i = Array.isArray(c) ? Mr(c, (f) => f.test(s)) : (
|
|
460
|
-
// [TODO] -- I challenge you to fix the type
|
|
461
|
-
br(c, (f) => f.test(s))
|
|
462
|
-
);
|
|
463
|
-
let u;
|
|
464
|
-
u = e.valueCallback ? e.valueCallback(i) : i, u = n.valueCallback ? (
|
|
465
|
-
// [TODO] -- I challenge you to fix the type
|
|
466
|
-
n.valueCallback(u)
|
|
467
|
-
) : u;
|
|
468
|
-
const d = t.slice(s.length);
|
|
469
|
-
return { value: u, rest: d };
|
|
470
|
-
};
|
|
471
|
-
}
|
|
472
|
-
function br(e, t) {
|
|
473
|
-
for (const n in e)
|
|
474
|
-
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
475
|
-
return n;
|
|
476
|
-
}
|
|
477
|
-
function Mr(e, t) {
|
|
478
|
-
for (let n = 0; n < e.length; n++)
|
|
479
|
-
if (t(e[n]))
|
|
480
|
-
return n;
|
|
481
|
-
}
|
|
482
|
-
function Dr(e) {
|
|
483
|
-
return (t, n = {}) => {
|
|
484
|
-
const r = t.match(e.matchPattern);
|
|
485
|
-
if (!r) return null;
|
|
486
|
-
const a = r[0], o = t.match(e.parsePattern);
|
|
487
|
-
if (!o) return null;
|
|
488
|
-
let s = e.valueCallback ? e.valueCallback(o[0]) : o[0];
|
|
489
|
-
s = n.valueCallback ? n.valueCallback(s) : s;
|
|
490
|
-
const c = t.slice(a.length);
|
|
491
|
-
return { value: s, rest: c };
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
const kr = /^(\d+)(th|st|nd|rd)?/i, Or = /\d+/i, vr = {
|
|
495
|
-
narrow: /^(b|a)/i,
|
|
496
|
-
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
497
|
-
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
498
|
-
}, Wr = {
|
|
499
|
-
any: [/^b/i, /^(a|c)/i]
|
|
500
|
-
}, Nr = {
|
|
501
|
-
narrow: /^[1234]/i,
|
|
502
|
-
abbreviated: /^q[1234]/i,
|
|
503
|
-
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
504
|
-
}, Sr = {
|
|
505
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
506
|
-
}, pr = {
|
|
507
|
-
narrow: /^[jfmasond]/i,
|
|
508
|
-
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
509
|
-
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
510
|
-
}, Cr = {
|
|
511
|
-
narrow: [
|
|
512
|
-
/^j/i,
|
|
513
|
-
/^f/i,
|
|
514
|
-
/^m/i,
|
|
515
|
-
/^a/i,
|
|
516
|
-
/^m/i,
|
|
517
|
-
/^j/i,
|
|
518
|
-
/^j/i,
|
|
519
|
-
/^a/i,
|
|
520
|
-
/^s/i,
|
|
521
|
-
/^o/i,
|
|
522
|
-
/^n/i,
|
|
523
|
-
/^d/i
|
|
524
|
-
],
|
|
525
|
-
any: [
|
|
526
|
-
/^ja/i,
|
|
527
|
-
/^f/i,
|
|
528
|
-
/^mar/i,
|
|
529
|
-
/^ap/i,
|
|
530
|
-
/^may/i,
|
|
531
|
-
/^jun/i,
|
|
532
|
-
/^jul/i,
|
|
533
|
-
/^au/i,
|
|
534
|
-
/^s/i,
|
|
535
|
-
/^o/i,
|
|
536
|
-
/^n/i,
|
|
537
|
-
/^d/i
|
|
538
|
-
]
|
|
539
|
-
}, xr = {
|
|
540
|
-
narrow: /^[smtwf]/i,
|
|
541
|
-
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
542
|
-
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
543
|
-
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
544
|
-
}, Yr = {
|
|
545
|
-
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
546
|
-
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
547
|
-
}, Tr = {
|
|
548
|
-
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
549
|
-
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
550
|
-
}, _r = {
|
|
551
|
-
any: {
|
|
552
|
-
am: /^a/i,
|
|
553
|
-
pm: /^p/i,
|
|
554
|
-
midnight: /^mi/i,
|
|
555
|
-
noon: /^no/i,
|
|
556
|
-
morning: /morning/i,
|
|
557
|
-
afternoon: /afternoon/i,
|
|
558
|
-
evening: /evening/i,
|
|
559
|
-
night: /night/i
|
|
560
|
-
}
|
|
561
|
-
}, Pr = {
|
|
562
|
-
ordinalNumber: Dr({
|
|
563
|
-
matchPattern: kr,
|
|
564
|
-
parsePattern: Or,
|
|
565
|
-
valueCallback: (e) => parseInt(e, 10)
|
|
566
|
-
}),
|
|
567
|
-
era: Me({
|
|
568
|
-
matchPatterns: vr,
|
|
569
|
-
defaultMatchWidth: "wide",
|
|
570
|
-
parsePatterns: Wr,
|
|
571
|
-
defaultParseWidth: "any"
|
|
572
|
-
}),
|
|
573
|
-
quarter: Me({
|
|
574
|
-
matchPatterns: Nr,
|
|
575
|
-
defaultMatchWidth: "wide",
|
|
576
|
-
parsePatterns: Sr,
|
|
577
|
-
defaultParseWidth: "any",
|
|
578
|
-
valueCallback: (e) => e + 1
|
|
579
|
-
}),
|
|
580
|
-
month: Me({
|
|
581
|
-
matchPatterns: pr,
|
|
582
|
-
defaultMatchWidth: "wide",
|
|
583
|
-
parsePatterns: Cr,
|
|
584
|
-
defaultParseWidth: "any"
|
|
585
|
-
}),
|
|
586
|
-
day: Me({
|
|
587
|
-
matchPatterns: xr,
|
|
588
|
-
defaultMatchWidth: "wide",
|
|
589
|
-
parsePatterns: Yr,
|
|
590
|
-
defaultParseWidth: "any"
|
|
591
|
-
}),
|
|
592
|
-
dayPeriod: Me({
|
|
593
|
-
matchPatterns: Tr,
|
|
594
|
-
defaultMatchWidth: "any",
|
|
595
|
-
parsePatterns: _r,
|
|
596
|
-
defaultParseWidth: "any"
|
|
597
|
-
})
|
|
598
|
-
}, le = {
|
|
599
|
-
code: "en-US",
|
|
600
|
-
formatDistance: rr,
|
|
601
|
-
formatLong: ir,
|
|
602
|
-
formatRelative: ur,
|
|
603
|
-
localize: wr,
|
|
604
|
-
match: Pr,
|
|
605
|
-
options: {
|
|
606
|
-
weekStartsOn: 0,
|
|
607
|
-
firstWeekContainsDate: 1
|
|
608
|
-
}
|
|
609
|
-
};
|
|
610
|
-
function Er(e, t) {
|
|
611
|
-
const n = P(e, t == null ? void 0 : t.in);
|
|
612
|
-
return Ze(n, It(n)) + 1;
|
|
613
|
-
}
|
|
614
|
-
function Ke(e, t) {
|
|
615
|
-
const n = P(e, t == null ? void 0 : t.in), r = +ve(n) - +$n(n);
|
|
616
|
-
return Math.round(r / pt) + 1;
|
|
617
|
-
}
|
|
618
|
-
function jt(e, t) {
|
|
619
|
-
var d, f, h, g;
|
|
620
|
-
const n = P(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = Ne(), o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((f = (d = t == null ? void 0 : t.locale) == null ? void 0 : d.options) == null ? void 0 : f.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((g = (h = a.locale) == null ? void 0 : h.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, s = j((t == null ? void 0 : t.in) || e, 0);
|
|
621
|
-
s.setFullYear(r + 1, 0, o), s.setHours(0, 0, 0, 0);
|
|
622
|
-
const c = me(s, t), i = j((t == null ? void 0 : t.in) || e, 0);
|
|
623
|
-
i.setFullYear(r, 0, o), i.setHours(0, 0, 0, 0);
|
|
624
|
-
const u = me(i, t);
|
|
625
|
-
return +n >= +c ? r + 1 : +n >= +u ? r : r - 1;
|
|
626
|
-
}
|
|
627
|
-
function Fr(e, t) {
|
|
628
|
-
var c, i, u, d;
|
|
629
|
-
const n = Ne(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((i = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : i.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((d = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : d.firstWeekContainsDate) ?? 1, a = jt(e, t), o = j((t == null ? void 0 : t.in) || e, 0);
|
|
630
|
-
return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0), me(o, t);
|
|
631
|
-
}
|
|
632
|
-
function Le(e, t) {
|
|
633
|
-
const n = P(e, t == null ? void 0 : t.in), r = +me(n, t) - +Fr(n, t);
|
|
634
|
-
return Math.round(r / pt) + 1;
|
|
635
|
-
}
|
|
636
|
-
function E(e, t) {
|
|
637
|
-
const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
|
|
638
|
-
return n + r;
|
|
639
|
-
}
|
|
640
|
-
const se = {
|
|
641
|
-
// Year
|
|
642
|
-
y(e, t) {
|
|
643
|
-
const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
644
|
-
return E(t === "yy" ? r % 100 : r, t.length);
|
|
645
|
-
},
|
|
646
|
-
// Month
|
|
647
|
-
M(e, t) {
|
|
648
|
-
const n = e.getMonth();
|
|
649
|
-
return t === "M" ? String(n + 1) : E(n + 1, 2);
|
|
650
|
-
},
|
|
651
|
-
// Day of the month
|
|
652
|
-
d(e, t) {
|
|
653
|
-
return E(e.getDate(), t.length);
|
|
654
|
-
},
|
|
655
|
-
// AM or PM
|
|
656
|
-
a(e, t) {
|
|
657
|
-
const n = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
658
|
-
switch (t) {
|
|
659
|
-
case "a":
|
|
660
|
-
case "aa":
|
|
661
|
-
return n.toUpperCase();
|
|
662
|
-
case "aaa":
|
|
663
|
-
return n;
|
|
664
|
-
case "aaaaa":
|
|
665
|
-
return n[0];
|
|
666
|
-
case "aaaa":
|
|
667
|
-
default:
|
|
668
|
-
return n === "am" ? "a.m." : "p.m.";
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
// Hour [1-12]
|
|
672
|
-
h(e, t) {
|
|
673
|
-
return E(e.getHours() % 12 || 12, t.length);
|
|
674
|
-
},
|
|
675
|
-
// Hour [0-23]
|
|
676
|
-
H(e, t) {
|
|
677
|
-
return E(e.getHours(), t.length);
|
|
678
|
-
},
|
|
679
|
-
// Minute
|
|
680
|
-
m(e, t) {
|
|
681
|
-
return E(e.getMinutes(), t.length);
|
|
682
|
-
},
|
|
683
|
-
// Second
|
|
684
|
-
s(e, t) {
|
|
685
|
-
return E(e.getSeconds(), t.length);
|
|
686
|
-
},
|
|
687
|
-
// Fraction of second
|
|
688
|
-
S(e, t) {
|
|
689
|
-
const n = t.length, r = e.getMilliseconds(), a = Math.trunc(
|
|
690
|
-
r * Math.pow(10, n - 3)
|
|
691
|
-
);
|
|
692
|
-
return E(a, t.length);
|
|
693
|
-
}
|
|
694
|
-
}, de = {
|
|
695
|
-
midnight: "midnight",
|
|
696
|
-
noon: "noon",
|
|
697
|
-
morning: "morning",
|
|
698
|
-
afternoon: "afternoon",
|
|
699
|
-
evening: "evening",
|
|
700
|
-
night: "night"
|
|
701
|
-
}, yt = {
|
|
702
|
-
// Era
|
|
703
|
-
G: function(e, t, n) {
|
|
704
|
-
const r = e.getFullYear() > 0 ? 1 : 0;
|
|
705
|
-
switch (t) {
|
|
706
|
-
// AD, BC
|
|
707
|
-
case "G":
|
|
708
|
-
case "GG":
|
|
709
|
-
case "GGG":
|
|
710
|
-
return n.era(r, { width: "abbreviated" });
|
|
711
|
-
// A, B
|
|
712
|
-
case "GGGGG":
|
|
713
|
-
return n.era(r, { width: "narrow" });
|
|
714
|
-
// Anno Domini, Before Christ
|
|
715
|
-
case "GGGG":
|
|
716
|
-
default:
|
|
717
|
-
return n.era(r, { width: "wide" });
|
|
718
|
-
}
|
|
719
|
-
},
|
|
720
|
-
// Year
|
|
721
|
-
y: function(e, t, n) {
|
|
722
|
-
if (t === "yo") {
|
|
723
|
-
const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
724
|
-
return n.ordinalNumber(a, { unit: "year" });
|
|
725
|
-
}
|
|
726
|
-
return se.y(e, t);
|
|
727
|
-
},
|
|
728
|
-
// Local week-numbering year
|
|
729
|
-
Y: function(e, t, n, r) {
|
|
730
|
-
const a = jt(e, r), o = a > 0 ? a : 1 - a;
|
|
731
|
-
if (t === "YY") {
|
|
732
|
-
const s = o % 100;
|
|
733
|
-
return E(s, 2);
|
|
734
|
-
}
|
|
735
|
-
return t === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : E(o, t.length);
|
|
736
|
-
},
|
|
737
|
-
// ISO week-numbering year
|
|
738
|
-
R: function(e, t) {
|
|
739
|
-
const n = _t(e);
|
|
740
|
-
return E(n, t.length);
|
|
741
|
-
},
|
|
742
|
-
// Extended year. This is a single number designating the year of this calendar system.
|
|
743
|
-
// The main difference between `y` and `u` localizers are B.C. years:
|
|
744
|
-
// | Year | `y` | `u` |
|
|
745
|
-
// |------|-----|-----|
|
|
746
|
-
// | AC 1 | 1 | 1 |
|
|
747
|
-
// | BC 1 | 1 | 0 |
|
|
748
|
-
// | BC 2 | 2 | -1 |
|
|
749
|
-
// Also `yy` always returns the last two digits of a year,
|
|
750
|
-
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
751
|
-
u: function(e, t) {
|
|
752
|
-
const n = e.getFullYear();
|
|
753
|
-
return E(n, t.length);
|
|
754
|
-
},
|
|
755
|
-
// Quarter
|
|
756
|
-
Q: function(e, t, n) {
|
|
757
|
-
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
758
|
-
switch (t) {
|
|
759
|
-
// 1, 2, 3, 4
|
|
760
|
-
case "Q":
|
|
761
|
-
return String(r);
|
|
762
|
-
// 01, 02, 03, 04
|
|
763
|
-
case "QQ":
|
|
764
|
-
return E(r, 2);
|
|
765
|
-
// 1st, 2nd, 3rd, 4th
|
|
766
|
-
case "Qo":
|
|
767
|
-
return n.ordinalNumber(r, { unit: "quarter" });
|
|
768
|
-
// Q1, Q2, Q3, Q4
|
|
769
|
-
case "QQQ":
|
|
770
|
-
return n.quarter(r, {
|
|
771
|
-
width: "abbreviated",
|
|
772
|
-
context: "formatting"
|
|
773
|
-
});
|
|
774
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
775
|
-
case "QQQQQ":
|
|
776
|
-
return n.quarter(r, {
|
|
777
|
-
width: "narrow",
|
|
778
|
-
context: "formatting"
|
|
779
|
-
});
|
|
780
|
-
// 1st quarter, 2nd quarter, ...
|
|
781
|
-
case "QQQQ":
|
|
782
|
-
default:
|
|
783
|
-
return n.quarter(r, {
|
|
784
|
-
width: "wide",
|
|
785
|
-
context: "formatting"
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
},
|
|
789
|
-
// Stand-alone quarter
|
|
790
|
-
q: function(e, t, n) {
|
|
791
|
-
const r = Math.ceil((e.getMonth() + 1) / 3);
|
|
792
|
-
switch (t) {
|
|
793
|
-
// 1, 2, 3, 4
|
|
794
|
-
case "q":
|
|
795
|
-
return String(r);
|
|
796
|
-
// 01, 02, 03, 04
|
|
797
|
-
case "qq":
|
|
798
|
-
return E(r, 2);
|
|
799
|
-
// 1st, 2nd, 3rd, 4th
|
|
800
|
-
case "qo":
|
|
801
|
-
return n.ordinalNumber(r, { unit: "quarter" });
|
|
802
|
-
// Q1, Q2, Q3, Q4
|
|
803
|
-
case "qqq":
|
|
804
|
-
return n.quarter(r, {
|
|
805
|
-
width: "abbreviated",
|
|
806
|
-
context: "standalone"
|
|
807
|
-
});
|
|
808
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
809
|
-
case "qqqqq":
|
|
810
|
-
return n.quarter(r, {
|
|
811
|
-
width: "narrow",
|
|
812
|
-
context: "standalone"
|
|
813
|
-
});
|
|
814
|
-
// 1st quarter, 2nd quarter, ...
|
|
815
|
-
case "qqqq":
|
|
816
|
-
default:
|
|
817
|
-
return n.quarter(r, {
|
|
818
|
-
width: "wide",
|
|
819
|
-
context: "standalone"
|
|
820
|
-
});
|
|
821
|
-
}
|
|
822
|
-
},
|
|
823
|
-
// Month
|
|
824
|
-
M: function(e, t, n) {
|
|
825
|
-
const r = e.getMonth();
|
|
826
|
-
switch (t) {
|
|
827
|
-
case "M":
|
|
828
|
-
case "MM":
|
|
829
|
-
return se.M(e, t);
|
|
830
|
-
// 1st, 2nd, ..., 12th
|
|
831
|
-
case "Mo":
|
|
832
|
-
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
833
|
-
// Jan, Feb, ..., Dec
|
|
834
|
-
case "MMM":
|
|
835
|
-
return n.month(r, {
|
|
836
|
-
width: "abbreviated",
|
|
837
|
-
context: "formatting"
|
|
838
|
-
});
|
|
839
|
-
// J, F, ..., D
|
|
840
|
-
case "MMMMM":
|
|
841
|
-
return n.month(r, {
|
|
842
|
-
width: "narrow",
|
|
843
|
-
context: "formatting"
|
|
844
|
-
});
|
|
845
|
-
// January, February, ..., December
|
|
846
|
-
case "MMMM":
|
|
847
|
-
default:
|
|
848
|
-
return n.month(r, { width: "wide", context: "formatting" });
|
|
849
|
-
}
|
|
850
|
-
},
|
|
851
|
-
// Stand-alone month
|
|
852
|
-
L: function(e, t, n) {
|
|
853
|
-
const r = e.getMonth();
|
|
854
|
-
switch (t) {
|
|
855
|
-
// 1, 2, ..., 12
|
|
856
|
-
case "L":
|
|
857
|
-
return String(r + 1);
|
|
858
|
-
// 01, 02, ..., 12
|
|
859
|
-
case "LL":
|
|
860
|
-
return E(r + 1, 2);
|
|
861
|
-
// 1st, 2nd, ..., 12th
|
|
862
|
-
case "Lo":
|
|
863
|
-
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
864
|
-
// Jan, Feb, ..., Dec
|
|
865
|
-
case "LLL":
|
|
866
|
-
return n.month(r, {
|
|
867
|
-
width: "abbreviated",
|
|
868
|
-
context: "standalone"
|
|
869
|
-
});
|
|
870
|
-
// J, F, ..., D
|
|
871
|
-
case "LLLLL":
|
|
872
|
-
return n.month(r, {
|
|
873
|
-
width: "narrow",
|
|
874
|
-
context: "standalone"
|
|
875
|
-
});
|
|
876
|
-
// January, February, ..., December
|
|
877
|
-
case "LLLL":
|
|
878
|
-
default:
|
|
879
|
-
return n.month(r, { width: "wide", context: "standalone" });
|
|
880
|
-
}
|
|
881
|
-
},
|
|
882
|
-
// Local week of year
|
|
883
|
-
w: function(e, t, n, r) {
|
|
884
|
-
const a = Le(e, r);
|
|
885
|
-
return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : E(a, t.length);
|
|
886
|
-
},
|
|
887
|
-
// ISO week of year
|
|
888
|
-
I: function(e, t, n) {
|
|
889
|
-
const r = Ke(e);
|
|
890
|
-
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : E(r, t.length);
|
|
891
|
-
},
|
|
892
|
-
// Day of the month
|
|
893
|
-
d: function(e, t, n) {
|
|
894
|
-
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : se.d(e, t);
|
|
895
|
-
},
|
|
896
|
-
// Day of year
|
|
897
|
-
D: function(e, t, n) {
|
|
898
|
-
const r = Er(e);
|
|
899
|
-
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : E(r, t.length);
|
|
900
|
-
},
|
|
901
|
-
// Day of week
|
|
902
|
-
E: function(e, t, n) {
|
|
903
|
-
const r = e.getDay();
|
|
904
|
-
switch (t) {
|
|
905
|
-
// Tue
|
|
906
|
-
case "E":
|
|
907
|
-
case "EE":
|
|
908
|
-
case "EEE":
|
|
909
|
-
return n.day(r, {
|
|
910
|
-
width: "abbreviated",
|
|
911
|
-
context: "formatting"
|
|
912
|
-
});
|
|
913
|
-
// T
|
|
914
|
-
case "EEEEE":
|
|
915
|
-
return n.day(r, {
|
|
916
|
-
width: "narrow",
|
|
917
|
-
context: "formatting"
|
|
918
|
-
});
|
|
919
|
-
// Tu
|
|
920
|
-
case "EEEEEE":
|
|
921
|
-
return n.day(r, {
|
|
922
|
-
width: "short",
|
|
923
|
-
context: "formatting"
|
|
924
|
-
});
|
|
925
|
-
// Tuesday
|
|
926
|
-
case "EEEE":
|
|
927
|
-
default:
|
|
928
|
-
return n.day(r, {
|
|
929
|
-
width: "wide",
|
|
930
|
-
context: "formatting"
|
|
931
|
-
});
|
|
932
|
-
}
|
|
933
|
-
},
|
|
934
|
-
// Local day of week
|
|
935
|
-
e: function(e, t, n, r) {
|
|
936
|
-
const a = e.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
937
|
-
switch (t) {
|
|
938
|
-
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
939
|
-
case "e":
|
|
940
|
-
return String(o);
|
|
941
|
-
// Padded numerical value
|
|
942
|
-
case "ee":
|
|
943
|
-
return E(o, 2);
|
|
944
|
-
// 1st, 2nd, ..., 7th
|
|
945
|
-
case "eo":
|
|
946
|
-
return n.ordinalNumber(o, { unit: "day" });
|
|
947
|
-
case "eee":
|
|
948
|
-
return n.day(a, {
|
|
949
|
-
width: "abbreviated",
|
|
950
|
-
context: "formatting"
|
|
951
|
-
});
|
|
952
|
-
// T
|
|
953
|
-
case "eeeee":
|
|
954
|
-
return n.day(a, {
|
|
955
|
-
width: "narrow",
|
|
956
|
-
context: "formatting"
|
|
957
|
-
});
|
|
958
|
-
// Tu
|
|
959
|
-
case "eeeeee":
|
|
960
|
-
return n.day(a, {
|
|
961
|
-
width: "short",
|
|
962
|
-
context: "formatting"
|
|
963
|
-
});
|
|
964
|
-
// Tuesday
|
|
965
|
-
case "eeee":
|
|
966
|
-
default:
|
|
967
|
-
return n.day(a, {
|
|
968
|
-
width: "wide",
|
|
969
|
-
context: "formatting"
|
|
970
|
-
});
|
|
971
|
-
}
|
|
972
|
-
},
|
|
973
|
-
// Stand-alone local day of week
|
|
974
|
-
c: function(e, t, n, r) {
|
|
975
|
-
const a = e.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
976
|
-
switch (t) {
|
|
977
|
-
// Numerical value (same as in `e`)
|
|
978
|
-
case "c":
|
|
979
|
-
return String(o);
|
|
980
|
-
// Padded numerical value
|
|
981
|
-
case "cc":
|
|
982
|
-
return E(o, t.length);
|
|
983
|
-
// 1st, 2nd, ..., 7th
|
|
984
|
-
case "co":
|
|
985
|
-
return n.ordinalNumber(o, { unit: "day" });
|
|
986
|
-
case "ccc":
|
|
987
|
-
return n.day(a, {
|
|
988
|
-
width: "abbreviated",
|
|
989
|
-
context: "standalone"
|
|
990
|
-
});
|
|
991
|
-
// T
|
|
992
|
-
case "ccccc":
|
|
993
|
-
return n.day(a, {
|
|
994
|
-
width: "narrow",
|
|
995
|
-
context: "standalone"
|
|
996
|
-
});
|
|
997
|
-
// Tu
|
|
998
|
-
case "cccccc":
|
|
999
|
-
return n.day(a, {
|
|
1000
|
-
width: "short",
|
|
1001
|
-
context: "standalone"
|
|
1002
|
-
});
|
|
1003
|
-
// Tuesday
|
|
1004
|
-
case "cccc":
|
|
1005
|
-
default:
|
|
1006
|
-
return n.day(a, {
|
|
1007
|
-
width: "wide",
|
|
1008
|
-
context: "standalone"
|
|
1009
|
-
});
|
|
1010
|
-
}
|
|
1011
|
-
},
|
|
1012
|
-
// ISO day of week
|
|
1013
|
-
i: function(e, t, n) {
|
|
1014
|
-
const r = e.getDay(), a = r === 0 ? 7 : r;
|
|
1015
|
-
switch (t) {
|
|
1016
|
-
// 2
|
|
1017
|
-
case "i":
|
|
1018
|
-
return String(a);
|
|
1019
|
-
// 02
|
|
1020
|
-
case "ii":
|
|
1021
|
-
return E(a, t.length);
|
|
1022
|
-
// 2nd
|
|
1023
|
-
case "io":
|
|
1024
|
-
return n.ordinalNumber(a, { unit: "day" });
|
|
1025
|
-
// Tue
|
|
1026
|
-
case "iii":
|
|
1027
|
-
return n.day(r, {
|
|
1028
|
-
width: "abbreviated",
|
|
1029
|
-
context: "formatting"
|
|
1030
|
-
});
|
|
1031
|
-
// T
|
|
1032
|
-
case "iiiii":
|
|
1033
|
-
return n.day(r, {
|
|
1034
|
-
width: "narrow",
|
|
1035
|
-
context: "formatting"
|
|
1036
|
-
});
|
|
1037
|
-
// Tu
|
|
1038
|
-
case "iiiiii":
|
|
1039
|
-
return n.day(r, {
|
|
1040
|
-
width: "short",
|
|
1041
|
-
context: "formatting"
|
|
1042
|
-
});
|
|
1043
|
-
// Tuesday
|
|
1044
|
-
case "iiii":
|
|
1045
|
-
default:
|
|
1046
|
-
return n.day(r, {
|
|
1047
|
-
width: "wide",
|
|
1048
|
-
context: "formatting"
|
|
1049
|
-
});
|
|
1050
|
-
}
|
|
1051
|
-
},
|
|
1052
|
-
// AM or PM
|
|
1053
|
-
a: function(e, t, n) {
|
|
1054
|
-
const a = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1055
|
-
switch (t) {
|
|
1056
|
-
case "a":
|
|
1057
|
-
case "aa":
|
|
1058
|
-
return n.dayPeriod(a, {
|
|
1059
|
-
width: "abbreviated",
|
|
1060
|
-
context: "formatting"
|
|
1061
|
-
});
|
|
1062
|
-
case "aaa":
|
|
1063
|
-
return n.dayPeriod(a, {
|
|
1064
|
-
width: "abbreviated",
|
|
1065
|
-
context: "formatting"
|
|
1066
|
-
}).toLowerCase();
|
|
1067
|
-
case "aaaaa":
|
|
1068
|
-
return n.dayPeriod(a, {
|
|
1069
|
-
width: "narrow",
|
|
1070
|
-
context: "formatting"
|
|
1071
|
-
});
|
|
1072
|
-
case "aaaa":
|
|
1073
|
-
default:
|
|
1074
|
-
return n.dayPeriod(a, {
|
|
1075
|
-
width: "wide",
|
|
1076
|
-
context: "formatting"
|
|
1077
|
-
});
|
|
1078
|
-
}
|
|
1079
|
-
},
|
|
1080
|
-
// AM, PM, midnight, noon
|
|
1081
|
-
b: function(e, t, n) {
|
|
1082
|
-
const r = e.getHours();
|
|
1083
|
-
let a;
|
|
1084
|
-
switch (r === 12 ? a = de.noon : r === 0 ? a = de.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
|
|
1085
|
-
case "b":
|
|
1086
|
-
case "bb":
|
|
1087
|
-
return n.dayPeriod(a, {
|
|
1088
|
-
width: "abbreviated",
|
|
1089
|
-
context: "formatting"
|
|
1090
|
-
});
|
|
1091
|
-
case "bbb":
|
|
1092
|
-
return n.dayPeriod(a, {
|
|
1093
|
-
width: "abbreviated",
|
|
1094
|
-
context: "formatting"
|
|
1095
|
-
}).toLowerCase();
|
|
1096
|
-
case "bbbbb":
|
|
1097
|
-
return n.dayPeriod(a, {
|
|
1098
|
-
width: "narrow",
|
|
1099
|
-
context: "formatting"
|
|
1100
|
-
});
|
|
1101
|
-
case "bbbb":
|
|
1102
|
-
default:
|
|
1103
|
-
return n.dayPeriod(a, {
|
|
1104
|
-
width: "wide",
|
|
1105
|
-
context: "formatting"
|
|
1106
|
-
});
|
|
1107
|
-
}
|
|
1108
|
-
},
|
|
1109
|
-
// in the morning, in the afternoon, in the evening, at night
|
|
1110
|
-
B: function(e, t, n) {
|
|
1111
|
-
const r = e.getHours();
|
|
1112
|
-
let a;
|
|
1113
|
-
switch (r >= 17 ? a = de.evening : r >= 12 ? a = de.afternoon : r >= 4 ? a = de.morning : a = de.night, t) {
|
|
1114
|
-
case "B":
|
|
1115
|
-
case "BB":
|
|
1116
|
-
case "BBB":
|
|
1117
|
-
return n.dayPeriod(a, {
|
|
1118
|
-
width: "abbreviated",
|
|
1119
|
-
context: "formatting"
|
|
1120
|
-
});
|
|
1121
|
-
case "BBBBB":
|
|
1122
|
-
return n.dayPeriod(a, {
|
|
1123
|
-
width: "narrow",
|
|
1124
|
-
context: "formatting"
|
|
1125
|
-
});
|
|
1126
|
-
case "BBBB":
|
|
1127
|
-
default:
|
|
1128
|
-
return n.dayPeriod(a, {
|
|
1129
|
-
width: "wide",
|
|
1130
|
-
context: "formatting"
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
},
|
|
1134
|
-
// Hour [1-12]
|
|
1135
|
-
h: function(e, t, n) {
|
|
1136
|
-
if (t === "ho") {
|
|
1137
|
-
let r = e.getHours() % 12;
|
|
1138
|
-
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1139
|
-
}
|
|
1140
|
-
return se.h(e, t);
|
|
1141
|
-
},
|
|
1142
|
-
// Hour [0-23]
|
|
1143
|
-
H: function(e, t, n) {
|
|
1144
|
-
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : se.H(e, t);
|
|
1145
|
-
},
|
|
1146
|
-
// Hour [0-11]
|
|
1147
|
-
K: function(e, t, n) {
|
|
1148
|
-
const r = e.getHours() % 12;
|
|
1149
|
-
return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : E(r, t.length);
|
|
1150
|
-
},
|
|
1151
|
-
// Hour [1-24]
|
|
1152
|
-
k: function(e, t, n) {
|
|
1153
|
-
let r = e.getHours();
|
|
1154
|
-
return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : E(r, t.length);
|
|
1155
|
-
},
|
|
1156
|
-
// Minute
|
|
1157
|
-
m: function(e, t, n) {
|
|
1158
|
-
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : se.m(e, t);
|
|
1159
|
-
},
|
|
1160
|
-
// Second
|
|
1161
|
-
s: function(e, t, n) {
|
|
1162
|
-
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : se.s(e, t);
|
|
1163
|
-
},
|
|
1164
|
-
// Fraction of second
|
|
1165
|
-
S: function(e, t) {
|
|
1166
|
-
return se.S(e, t);
|
|
1167
|
-
},
|
|
1168
|
-
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1169
|
-
X: function(e, t, n) {
|
|
1170
|
-
const r = e.getTimezoneOffset();
|
|
1171
|
-
if (r === 0)
|
|
1172
|
-
return "Z";
|
|
1173
|
-
switch (t) {
|
|
1174
|
-
// Hours and optional minutes
|
|
1175
|
-
case "X":
|
|
1176
|
-
return wt(r);
|
|
1177
|
-
// Hours, minutes and optional seconds without `:` delimiter
|
|
1178
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1179
|
-
// so this token always has the same output as `XX`
|
|
1180
|
-
case "XXXX":
|
|
1181
|
-
case "XX":
|
|
1182
|
-
return ie(r);
|
|
1183
|
-
// Hours, minutes and optional seconds with `:` delimiter
|
|
1184
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1185
|
-
// so this token always has the same output as `XXX`
|
|
1186
|
-
case "XXXXX":
|
|
1187
|
-
case "XXX":
|
|
1188
|
-
// Hours and minutes with `:` delimiter
|
|
1189
|
-
default:
|
|
1190
|
-
return ie(r, ":");
|
|
1191
|
-
}
|
|
1192
|
-
},
|
|
1193
|
-
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1194
|
-
x: function(e, t, n) {
|
|
1195
|
-
const r = e.getTimezoneOffset();
|
|
1196
|
-
switch (t) {
|
|
1197
|
-
// Hours and optional minutes
|
|
1198
|
-
case "x":
|
|
1199
|
-
return wt(r);
|
|
1200
|
-
// Hours, minutes and optional seconds without `:` delimiter
|
|
1201
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1202
|
-
// so this token always has the same output as `xx`
|
|
1203
|
-
case "xxxx":
|
|
1204
|
-
case "xx":
|
|
1205
|
-
return ie(r);
|
|
1206
|
-
// Hours, minutes and optional seconds with `:` delimiter
|
|
1207
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1208
|
-
// so this token always has the same output as `xxx`
|
|
1209
|
-
case "xxxxx":
|
|
1210
|
-
case "xxx":
|
|
1211
|
-
// Hours and minutes with `:` delimiter
|
|
1212
|
-
default:
|
|
1213
|
-
return ie(r, ":");
|
|
1214
|
-
}
|
|
1215
|
-
},
|
|
1216
|
-
// Timezone (GMT)
|
|
1217
|
-
O: function(e, t, n) {
|
|
1218
|
-
const r = e.getTimezoneOffset();
|
|
1219
|
-
switch (t) {
|
|
1220
|
-
// Short
|
|
1221
|
-
case "O":
|
|
1222
|
-
case "OO":
|
|
1223
|
-
case "OOO":
|
|
1224
|
-
return "GMT" + gt(r, ":");
|
|
1225
|
-
// Long
|
|
1226
|
-
case "OOOO":
|
|
1227
|
-
default:
|
|
1228
|
-
return "GMT" + ie(r, ":");
|
|
1229
|
-
}
|
|
1230
|
-
},
|
|
1231
|
-
// Timezone (specific non-location)
|
|
1232
|
-
z: function(e, t, n) {
|
|
1233
|
-
const r = e.getTimezoneOffset();
|
|
1234
|
-
switch (t) {
|
|
1235
|
-
// Short
|
|
1236
|
-
case "z":
|
|
1237
|
-
case "zz":
|
|
1238
|
-
case "zzz":
|
|
1239
|
-
return "GMT" + gt(r, ":");
|
|
1240
|
-
// Long
|
|
1241
|
-
case "zzzz":
|
|
1242
|
-
default:
|
|
1243
|
-
return "GMT" + ie(r, ":");
|
|
1244
|
-
}
|
|
1245
|
-
},
|
|
1246
|
-
// Seconds timestamp
|
|
1247
|
-
t: function(e, t, n) {
|
|
1248
|
-
const r = Math.trunc(+e / 1e3);
|
|
1249
|
-
return E(r, t.length);
|
|
1250
|
-
},
|
|
1251
|
-
// Milliseconds timestamp
|
|
1252
|
-
T: function(e, t, n) {
|
|
1253
|
-
return E(+e, t.length);
|
|
1254
|
-
}
|
|
1255
|
-
};
|
|
1256
|
-
function gt(e, t = "") {
|
|
1257
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), o = r % 60;
|
|
1258
|
-
return o === 0 ? n + String(a) : n + String(a) + t + E(o, 2);
|
|
1259
|
-
}
|
|
1260
|
-
function wt(e, t) {
|
|
1261
|
-
return e % 60 === 0 ? (e > 0 ? "-" : "+") + E(Math.abs(e) / 60, 2) : ie(e, t);
|
|
1262
|
-
}
|
|
1263
|
-
function ie(e, t = "") {
|
|
1264
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = E(Math.trunc(r / 60), 2), o = E(r % 60, 2);
|
|
1265
|
-
return n + a + t + o;
|
|
1266
|
-
}
|
|
1267
|
-
const bt = (e, t) => {
|
|
1268
|
-
switch (e) {
|
|
1269
|
-
case "P":
|
|
1270
|
-
return t.date({ width: "short" });
|
|
1271
|
-
case "PP":
|
|
1272
|
-
return t.date({ width: "medium" });
|
|
1273
|
-
case "PPP":
|
|
1274
|
-
return t.date({ width: "long" });
|
|
1275
|
-
case "PPPP":
|
|
1276
|
-
default:
|
|
1277
|
-
return t.date({ width: "full" });
|
|
1278
|
-
}
|
|
1279
|
-
}, Ht = (e, t) => {
|
|
1280
|
-
switch (e) {
|
|
1281
|
-
case "p":
|
|
1282
|
-
return t.time({ width: "short" });
|
|
1283
|
-
case "pp":
|
|
1284
|
-
return t.time({ width: "medium" });
|
|
1285
|
-
case "ppp":
|
|
1286
|
-
return t.time({ width: "long" });
|
|
1287
|
-
case "pppp":
|
|
1288
|
-
default:
|
|
1289
|
-
return t.time({ width: "full" });
|
|
1290
|
-
}
|
|
1291
|
-
}, Ir = (e, t) => {
|
|
1292
|
-
const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1293
|
-
if (!a)
|
|
1294
|
-
return bt(e, t);
|
|
1295
|
-
let o;
|
|
1296
|
-
switch (r) {
|
|
1297
|
-
case "P":
|
|
1298
|
-
o = t.dateTime({ width: "short" });
|
|
1299
|
-
break;
|
|
1300
|
-
case "PP":
|
|
1301
|
-
o = t.dateTime({ width: "medium" });
|
|
1302
|
-
break;
|
|
1303
|
-
case "PPP":
|
|
1304
|
-
o = t.dateTime({ width: "long" });
|
|
1305
|
-
break;
|
|
1306
|
-
case "PPPP":
|
|
1307
|
-
default:
|
|
1308
|
-
o = t.dateTime({ width: "full" });
|
|
1309
|
-
break;
|
|
1310
|
-
}
|
|
1311
|
-
return o.replace("{{date}}", bt(r, t)).replace("{{time}}", Ht(a, t));
|
|
1312
|
-
}, Br = {
|
|
1313
|
-
p: Ht,
|
|
1314
|
-
P: Ir
|
|
1315
|
-
}, jr = /^D+$/, Hr = /^Y+$/, Ar = ["D", "DD", "YY", "YYYY"];
|
|
1316
|
-
function qr(e) {
|
|
1317
|
-
return jr.test(e);
|
|
1318
|
-
}
|
|
1319
|
-
function zr(e) {
|
|
1320
|
-
return Hr.test(e);
|
|
1321
|
-
}
|
|
1322
|
-
function $r(e, t, n) {
|
|
1323
|
-
const r = Rr(e, t, n);
|
|
1324
|
-
if (console.warn(r), Ar.includes(e)) throw new RangeError(r);
|
|
1325
|
-
}
|
|
1326
|
-
function Rr(e, t, n) {
|
|
1327
|
-
const r = e[0] === "Y" ? "years" : "days of the month";
|
|
1328
|
-
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`;
|
|
1329
|
-
}
|
|
1330
|
-
const Gr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ur = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Qr = /^'([^]*?)'?$/, Xr = /''/g, Vr = /[a-zA-Z]/;
|
|
1331
|
-
function he(e, t, n) {
|
|
1332
|
-
var d, f, h, g, v, N, k, M;
|
|
1333
|
-
const r = Ne(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? le, o = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((f = (d = n == null ? void 0 : n.locale) == null ? void 0 : d.options) == null ? void 0 : f.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((g = (h = r.locale) == null ? void 0 : h.options) == null ? void 0 : g.firstWeekContainsDate) ?? 1, s = (n == null ? void 0 : n.weekStartsOn) ?? ((N = (v = n == null ? void 0 : n.locale) == null ? void 0 : v.options) == null ? void 0 : N.weekStartsOn) ?? r.weekStartsOn ?? ((M = (k = r.locale) == null ? void 0 : k.options) == null ? void 0 : M.weekStartsOn) ?? 0, c = P(e, n == null ? void 0 : n.in);
|
|
1334
|
-
if (!Vn(c))
|
|
1335
|
-
throw new RangeError("Invalid time value");
|
|
1336
|
-
let i = t.match(Ur).map((O) => {
|
|
1337
|
-
const y = O[0];
|
|
1338
|
-
if (y === "p" || y === "P") {
|
|
1339
|
-
const p = Br[y];
|
|
1340
|
-
return p(O, a.formatLong);
|
|
1341
|
-
}
|
|
1342
|
-
return O;
|
|
1343
|
-
}).join("").match(Gr).map((O) => {
|
|
1344
|
-
if (O === "''")
|
|
1345
|
-
return { isToken: !1, value: "'" };
|
|
1346
|
-
const y = O[0];
|
|
1347
|
-
if (y === "'")
|
|
1348
|
-
return { isToken: !1, value: Jr(O) };
|
|
1349
|
-
if (yt[y])
|
|
1350
|
-
return { isToken: !0, value: O };
|
|
1351
|
-
if (y.match(Vr))
|
|
1352
|
-
throw new RangeError(
|
|
1353
|
-
"Format string contains an unescaped latin alphabet character `" + y + "`"
|
|
1354
|
-
);
|
|
1355
|
-
return { isToken: !1, value: O };
|
|
1356
|
-
});
|
|
1357
|
-
a.localize.preprocessor && (i = a.localize.preprocessor(c, i));
|
|
1358
|
-
const u = {
|
|
1359
|
-
firstWeekContainsDate: o,
|
|
1360
|
-
weekStartsOn: s,
|
|
1361
|
-
locale: a
|
|
1362
|
-
};
|
|
1363
|
-
return i.map((O) => {
|
|
1364
|
-
if (!O.isToken) return O.value;
|
|
1365
|
-
const y = O.value;
|
|
1366
|
-
(!(n != null && n.useAdditionalWeekYearTokens) && zr(y) || !(n != null && n.useAdditionalDayOfYearTokens) && qr(y)) && $r(y, t, String(e));
|
|
1367
|
-
const p = yt[y[0]];
|
|
1368
|
-
return p(c, y, a.localize, u);
|
|
1369
|
-
}).join("");
|
|
1370
|
-
}
|
|
1371
|
-
function Jr(e) {
|
|
1372
|
-
const t = e.match(Qr);
|
|
1373
|
-
return t ? t[1].replace(Xr, "'") : e;
|
|
1374
|
-
}
|
|
1375
|
-
function Zr(e, t) {
|
|
1376
|
-
const n = P(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = n.getMonth(), o = j(n, 0);
|
|
1377
|
-
return o.setFullYear(r, a + 1, 0), o.setHours(0, 0, 0, 0), o.getDate();
|
|
1378
|
-
}
|
|
1379
|
-
function Kr(e, t) {
|
|
1380
|
-
return P(e, t == null ? void 0 : t.in).getMonth();
|
|
1381
|
-
}
|
|
1382
|
-
function Lr(e, t) {
|
|
1383
|
-
return P(e, t == null ? void 0 : t.in).getFullYear();
|
|
1384
|
-
}
|
|
1385
|
-
function ea(e, t) {
|
|
1386
|
-
return +P(e) > +P(t);
|
|
1387
|
-
}
|
|
1388
|
-
function ta(e, t) {
|
|
1389
|
-
return +P(e) < +P(t);
|
|
1390
|
-
}
|
|
1391
|
-
function na(e, t, n) {
|
|
1392
|
-
const [r, a] = ye(
|
|
1393
|
-
n == null ? void 0 : n.in,
|
|
1394
|
-
e,
|
|
1395
|
-
t
|
|
1396
|
-
);
|
|
1397
|
-
return r.getFullYear() === a.getFullYear() && r.getMonth() === a.getMonth();
|
|
1398
|
-
}
|
|
1399
|
-
function ra(e, t, n) {
|
|
1400
|
-
const [r, a] = ye(
|
|
1401
|
-
n == null ? void 0 : n.in,
|
|
1402
|
-
e,
|
|
1403
|
-
t
|
|
1404
|
-
);
|
|
1405
|
-
return r.getFullYear() === a.getFullYear();
|
|
1406
|
-
}
|
|
1407
|
-
function ke(e, t) {
|
|
1408
|
-
const n = () => j(t == null ? void 0 : t.in, NaN), a = ia(e);
|
|
1409
|
-
let o;
|
|
1410
|
-
if (a.date) {
|
|
1411
|
-
const u = ca(a.date, 2);
|
|
1412
|
-
o = ua(u.restDateString, u.year);
|
|
1413
|
-
}
|
|
1414
|
-
if (!o || isNaN(+o)) return n();
|
|
1415
|
-
const s = +o;
|
|
1416
|
-
let c = 0, i;
|
|
1417
|
-
if (a.time && (c = da(a.time), isNaN(c)))
|
|
1418
|
-
return n();
|
|
1419
|
-
if (a.timezone) {
|
|
1420
|
-
if (i = fa(a.timezone), isNaN(i)) return n();
|
|
1421
|
-
} else {
|
|
1422
|
-
const u = new Date(s + c), d = P(0, t == null ? void 0 : t.in);
|
|
1423
|
-
return d.setFullYear(
|
|
1424
|
-
u.getUTCFullYear(),
|
|
1425
|
-
u.getUTCMonth(),
|
|
1426
|
-
u.getUTCDate()
|
|
1427
|
-
), d.setHours(
|
|
1428
|
-
u.getUTCHours(),
|
|
1429
|
-
u.getUTCMinutes(),
|
|
1430
|
-
u.getUTCSeconds(),
|
|
1431
|
-
u.getUTCMilliseconds()
|
|
1432
|
-
), d;
|
|
1433
|
-
}
|
|
1434
|
-
return P(s + c + i, t == null ? void 0 : t.in);
|
|
1435
|
-
}
|
|
1436
|
-
const _e = {
|
|
1437
|
-
dateTimeDelimiter: /[T ]/,
|
|
1438
|
-
timeZoneDelimiter: /[Z ]/i,
|
|
1439
|
-
timezone: /([Z+-].*)$/
|
|
1440
|
-
}, aa = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, oa = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, sa = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
1441
|
-
function ia(e) {
|
|
1442
|
-
const t = {}, n = e.split(_e.dateTimeDelimiter);
|
|
1443
|
-
let r;
|
|
1444
|
-
if (n.length > 2)
|
|
1445
|
-
return t;
|
|
1446
|
-
if (/:/.test(n[0]) ? r = n[0] : (t.date = n[0], r = n[1], _e.timeZoneDelimiter.test(t.date) && (t.date = e.split(_e.timeZoneDelimiter)[0], r = e.substr(
|
|
1447
|
-
t.date.length,
|
|
1448
|
-
e.length
|
|
1449
|
-
))), r) {
|
|
1450
|
-
const a = _e.timezone.exec(r);
|
|
1451
|
-
a ? (t.time = r.replace(a[1], ""), t.timezone = a[1]) : t.time = r;
|
|
1452
|
-
}
|
|
1453
|
-
return t;
|
|
1454
|
-
}
|
|
1455
|
-
function ca(e, t) {
|
|
1456
|
-
const n = new RegExp(
|
|
1457
|
-
"^(?:(\\d{4}|[+-]\\d{" + (4 + t) + "})|(\\d{2}|[+-]\\d{" + (2 + t) + "})$)"
|
|
1458
|
-
), r = e.match(n);
|
|
1459
|
-
if (!r) return { year: NaN, restDateString: "" };
|
|
1460
|
-
const a = r[1] ? parseInt(r[1]) : null, o = r[2] ? parseInt(r[2]) : null;
|
|
1461
|
-
return {
|
|
1462
|
-
year: o === null ? a : o * 100,
|
|
1463
|
-
restDateString: e.slice((r[1] || r[2]).length)
|
|
1464
|
-
};
|
|
1465
|
-
}
|
|
1466
|
-
function ua(e, t) {
|
|
1467
|
-
if (t === null) return /* @__PURE__ */ new Date(NaN);
|
|
1468
|
-
const n = e.match(aa);
|
|
1469
|
-
if (!n) return /* @__PURE__ */ new Date(NaN);
|
|
1470
|
-
const r = !!n[4], a = De(n[1]), o = De(n[2]) - 1, s = De(n[3]), c = De(n[4]), i = De(n[5]) - 1;
|
|
1471
|
-
if (r)
|
|
1472
|
-
return ga(t, c, i) ? la(t, c, i) : /* @__PURE__ */ new Date(NaN);
|
|
1473
|
-
{
|
|
1474
|
-
const u = /* @__PURE__ */ new Date(0);
|
|
1475
|
-
return !ma(t, o, s) || !ya(t, a) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(t, o, Math.max(a, s)), u);
|
|
1476
|
-
}
|
|
1477
|
-
}
|
|
1478
|
-
function De(e) {
|
|
1479
|
-
return e ? parseInt(e) : 1;
|
|
1480
|
-
}
|
|
1481
|
-
function da(e) {
|
|
1482
|
-
const t = e.match(oa);
|
|
1483
|
-
if (!t) return NaN;
|
|
1484
|
-
const n = Re(t[1]), r = Re(t[2]), a = Re(t[3]);
|
|
1485
|
-
return wa(n, r, a) ? n * xt + r * Ct + a * 1e3 : NaN;
|
|
1486
|
-
}
|
|
1487
|
-
function Re(e) {
|
|
1488
|
-
return e && parseFloat(e.replace(",", ".")) || 0;
|
|
1489
|
-
}
|
|
1490
|
-
function fa(e) {
|
|
1491
|
-
if (e === "Z") return 0;
|
|
1492
|
-
const t = e.match(sa);
|
|
1493
|
-
if (!t) return 0;
|
|
1494
|
-
const n = t[1] === "+" ? -1 : 1, r = parseInt(t[2]), a = t[3] && parseInt(t[3]) || 0;
|
|
1495
|
-
return ba(r, a) ? n * (r * xt + a * Ct) : NaN;
|
|
1496
|
-
}
|
|
1497
|
-
function la(e, t, n) {
|
|
1498
|
-
const r = /* @__PURE__ */ new Date(0);
|
|
1499
|
-
r.setUTCFullYear(e, 0, 4);
|
|
1500
|
-
const a = r.getUTCDay() || 7, o = (t - 1) * 7 + n + 1 - a;
|
|
1501
|
-
return r.setUTCDate(r.getUTCDate() + o), r;
|
|
1502
|
-
}
|
|
1503
|
-
const ha = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
1504
|
-
function At(e) {
|
|
1505
|
-
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
1506
|
-
}
|
|
1507
|
-
function ma(e, t, n) {
|
|
1508
|
-
return t >= 0 && t <= 11 && n >= 1 && n <= (ha[t] || (At(e) ? 29 : 28));
|
|
1509
|
-
}
|
|
1510
|
-
function ya(e, t) {
|
|
1511
|
-
return t >= 1 && t <= (At(e) ? 366 : 365);
|
|
1512
|
-
}
|
|
1513
|
-
function ga(e, t, n) {
|
|
1514
|
-
return t >= 1 && t <= 53 && n >= 0 && n <= 6;
|
|
1515
|
-
}
|
|
1516
|
-
function wa(e, t, n) {
|
|
1517
|
-
return e === 24 ? t === 0 && n === 0 : n >= 0 && n < 60 && t >= 0 && t < 60 && e >= 0 && e < 25;
|
|
1518
|
-
}
|
|
1519
|
-
function ba(e, t) {
|
|
1520
|
-
return t >= 0 && t <= 59;
|
|
1521
|
-
}
|
|
1522
|
-
function Ma(e, t, n) {
|
|
1523
|
-
const r = P(e, n == null ? void 0 : n.in), a = r.getFullYear(), o = r.getDate(), s = j(e, 0);
|
|
1524
|
-
s.setFullYear(a, t, 15), s.setHours(0, 0, 0, 0);
|
|
1525
|
-
const c = Zr(s);
|
|
1526
|
-
return r.setMonth(t, Math.min(o, c)), r;
|
|
1527
|
-
}
|
|
1528
|
-
function Da(e, t, n) {
|
|
1529
|
-
const r = P(e, n == null ? void 0 : n.in);
|
|
1530
|
-
return isNaN(+r) ? j(e, NaN) : (r.setFullYear(t), r);
|
|
1531
|
-
}
|
|
1532
|
-
function ka(e, t, n = "long") {
|
|
1533
|
-
return new Intl.DateTimeFormat("en-US", {
|
|
1534
|
-
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
1535
|
-
hour: "numeric",
|
|
1536
|
-
timeZone: e,
|
|
1537
|
-
timeZoneName: n
|
|
1538
|
-
}).format(t).split(/\s/g).slice(2).join(" ");
|
|
1539
|
-
}
|
|
1540
|
-
const Ge = {}, Oe = {};
|
|
1541
|
-
function ce(e, t) {
|
|
1542
|
-
try {
|
|
1543
|
-
const r = (Ge[e] || (Ge[e] = new Intl.DateTimeFormat("en-US", {
|
|
1544
|
-
timeZone: e,
|
|
1545
|
-
timeZoneName: "longOffset"
|
|
1546
|
-
}).format))(t).split("GMT")[1];
|
|
1547
|
-
return r in Oe ? Oe[r] : Mt(r, r.split(":"));
|
|
1548
|
-
} catch {
|
|
1549
|
-
if (e in Oe) return Oe[e];
|
|
1550
|
-
const n = e == null ? void 0 : e.match(Oa);
|
|
1551
|
-
return n ? Mt(e, n.slice(1)) : NaN;
|
|
1552
|
-
}
|
|
1553
|
-
}
|
|
1554
|
-
const Oa = /([+-]\d\d):?(\d\d)?/;
|
|
1555
|
-
function Mt(e, t) {
|
|
1556
|
-
const n = +(t[0] || 0), r = +(t[1] || 0), a = +(t[2] || 0) / 60;
|
|
1557
|
-
return Oe[e] = n * 60 + r > 0 ? n * 60 + r + a : n * 60 - r - a;
|
|
1558
|
-
}
|
|
1559
|
-
class L extends Date {
|
|
1560
|
-
//#region static
|
|
1561
|
-
constructor(...t) {
|
|
1562
|
-
super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(ce(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), qt(this), Je(this)) : this.setTime(Date.now());
|
|
1563
|
-
}
|
|
1564
|
-
static tz(t, ...n) {
|
|
1565
|
-
return n.length ? new L(...n, t) : new L(Date.now(), t);
|
|
1566
|
-
}
|
|
1567
|
-
//#endregion
|
|
1568
|
-
//#region time zone
|
|
1569
|
-
withTimeZone(t) {
|
|
1570
|
-
return new L(+this, t);
|
|
1571
|
-
}
|
|
1572
|
-
getTimezoneOffset() {
|
|
1573
|
-
const t = -ce(this.timeZone, this);
|
|
1574
|
-
return t > 0 ? Math.floor(t) : Math.ceil(t);
|
|
1575
|
-
}
|
|
1576
|
-
//#endregion
|
|
1577
|
-
//#region time
|
|
1578
|
-
setTime(t) {
|
|
1579
|
-
return Date.prototype.setTime.apply(this, arguments), Je(this), +this;
|
|
1580
|
-
}
|
|
1581
|
-
//#endregion
|
|
1582
|
-
//#region date-fns integration
|
|
1583
|
-
[Symbol.for("constructDateFrom")](t) {
|
|
1584
|
-
return new L(+new Date(t), this.timeZone);
|
|
1585
|
-
}
|
|
1586
|
-
//#endregion
|
|
1587
|
-
}
|
|
1588
|
-
const Dt = /^(get|set)(?!UTC)/;
|
|
1589
|
-
Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
|
|
1590
|
-
if (!Dt.test(e)) return;
|
|
1591
|
-
const t = e.replace(Dt, "$1UTC");
|
|
1592
|
-
L.prototype[t] && (e.startsWith("get") ? L.prototype[e] = function() {
|
|
1593
|
-
return this.internal[t]();
|
|
1594
|
-
} : (L.prototype[e] = function() {
|
|
1595
|
-
return Date.prototype[t].apply(this.internal, arguments), va(this), +this;
|
|
1596
|
-
}, L.prototype[t] = function() {
|
|
1597
|
-
return Date.prototype[t].apply(this, arguments), Je(this), +this;
|
|
1598
|
-
}));
|
|
1599
|
-
});
|
|
1600
|
-
function Je(e) {
|
|
1601
|
-
e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-ce(e.timeZone, e) * 60));
|
|
1602
|
-
}
|
|
1603
|
-
function va(e) {
|
|
1604
|
-
Date.prototype.setFullYear.call(e, e.internal.getUTCFullYear(), e.internal.getUTCMonth(), e.internal.getUTCDate()), Date.prototype.setHours.call(e, e.internal.getUTCHours(), e.internal.getUTCMinutes(), e.internal.getUTCSeconds(), e.internal.getUTCMilliseconds()), qt(e);
|
|
1605
|
-
}
|
|
1606
|
-
function qt(e) {
|
|
1607
|
-
const t = ce(e.timeZone, e), n = t > 0 ? Math.floor(t) : Math.ceil(t), r = /* @__PURE__ */ new Date(+e);
|
|
1608
|
-
r.setUTCHours(r.getUTCHours() - 1);
|
|
1609
|
-
const a = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), o = -(/* @__PURE__ */ new Date(+r)).getTimezoneOffset(), s = a - o, c = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
|
|
1610
|
-
s && c && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + s);
|
|
1611
|
-
const i = a - n;
|
|
1612
|
-
i && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + i);
|
|
1613
|
-
const u = /* @__PURE__ */ new Date(+e);
|
|
1614
|
-
u.setUTCSeconds(0);
|
|
1615
|
-
const d = a > 0 ? u.getSeconds() : (u.getSeconds() - 60) % 60, f = Math.round(-(ce(e.timeZone, e) * 60)) % 60;
|
|
1616
|
-
(f || d) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + f), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + f + d));
|
|
1617
|
-
const h = ce(e.timeZone, e), g = h > 0 ? Math.floor(h) : Math.ceil(h), N = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - g, k = g !== n, M = N - i;
|
|
1618
|
-
if (k && M) {
|
|
1619
|
-
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + M);
|
|
1620
|
-
const O = ce(e.timeZone, e), y = O > 0 ? Math.floor(O) : Math.ceil(O), p = g - y;
|
|
1621
|
-
p && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + p), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + p));
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1624
|
-
class q extends L {
|
|
1625
|
-
//#region static
|
|
1626
|
-
static tz(t, ...n) {
|
|
1627
|
-
return n.length ? new q(...n, t) : new q(Date.now(), t);
|
|
1628
|
-
}
|
|
1629
|
-
//#endregion
|
|
1630
|
-
//#region representation
|
|
1631
|
-
toISOString() {
|
|
1632
|
-
const [t, n, r] = this.tzComponents(), a = `${t}${n}:${r}`;
|
|
1633
|
-
return this.internal.toISOString().slice(0, -1) + a;
|
|
1634
|
-
}
|
|
1635
|
-
toString() {
|
|
1636
|
-
return `${this.toDateString()} ${this.toTimeString()}`;
|
|
1637
|
-
}
|
|
1638
|
-
toDateString() {
|
|
1639
|
-
const [t, n, r, a] = this.internal.toUTCString().split(" ");
|
|
1640
|
-
return `${t == null ? void 0 : t.slice(0, -1)} ${r} ${n} ${a}`;
|
|
1641
|
-
}
|
|
1642
|
-
toTimeString() {
|
|
1643
|
-
const t = this.internal.toUTCString().split(" ")[4], [n, r, a] = this.tzComponents();
|
|
1644
|
-
return `${t} GMT${n}${r}${a} (${ka(this.timeZone, this)})`;
|
|
1645
|
-
}
|
|
1646
|
-
toLocaleString(t, n) {
|
|
1647
|
-
return Date.prototype.toLocaleString.call(this, t, {
|
|
1648
|
-
...n,
|
|
1649
|
-
timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
|
|
1650
|
-
});
|
|
1651
|
-
}
|
|
1652
|
-
toLocaleDateString(t, n) {
|
|
1653
|
-
return Date.prototype.toLocaleDateString.call(this, t, {
|
|
1654
|
-
...n,
|
|
1655
|
-
timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
|
|
1656
|
-
});
|
|
1657
|
-
}
|
|
1658
|
-
toLocaleTimeString(t, n) {
|
|
1659
|
-
return Date.prototype.toLocaleTimeString.call(this, t, {
|
|
1660
|
-
...n,
|
|
1661
|
-
timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
|
|
1662
|
-
});
|
|
1663
|
-
}
|
|
1664
|
-
//#endregion
|
|
1665
|
-
//#region private
|
|
1666
|
-
tzComponents() {
|
|
1667
|
-
const t = this.getTimezoneOffset(), n = t > 0 ? "-" : "+", r = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), a = String(Math.abs(t) % 60).padStart(2, "0");
|
|
1668
|
-
return [n, r, a];
|
|
1669
|
-
}
|
|
1670
|
-
//#endregion
|
|
1671
|
-
withTimeZone(t) {
|
|
1672
|
-
return new q(+this, t);
|
|
1673
|
-
}
|
|
1674
|
-
//#region date-fns integration
|
|
1675
|
-
[Symbol.for("constructDateFrom")](t) {
|
|
1676
|
-
return new q(+new Date(t), this.timeZone);
|
|
1677
|
-
}
|
|
1678
|
-
//#endregion
|
|
1679
|
-
}
|
|
1680
|
-
const kt = 5, Wa = 4;
|
|
1681
|
-
function Na(e, t) {
|
|
1682
|
-
const n = t.startOfMonth(e), r = n.getDay() > 0 ? n.getDay() : 7, a = t.addDays(e, -r + 1), o = t.addDays(a, kt * 7 - 1);
|
|
1683
|
-
return t.getMonth(e) === t.getMonth(o) ? kt : Wa;
|
|
1684
|
-
}
|
|
1685
|
-
function zt(e, t) {
|
|
1686
|
-
const n = t.startOfMonth(e), r = n.getDay();
|
|
1687
|
-
return r === 1 ? n : r === 0 ? t.addDays(n, -6) : t.addDays(n, -1 * (r - 1));
|
|
1688
|
-
}
|
|
1689
|
-
function Sa(e, t) {
|
|
1690
|
-
const n = zt(e, t), r = Na(e, t);
|
|
1691
|
-
return t.addDays(n, r * 7 - 1);
|
|
1692
|
-
}
|
|
1693
|
-
const $t = {
|
|
1694
|
-
...le,
|
|
1695
|
-
labels: {
|
|
1696
|
-
labelDayButton: (e, t, n, r) => {
|
|
1697
|
-
let a;
|
|
1698
|
-
r && typeof r.format == "function" ? a = r.format.bind(r) : a = (s, c) => he(s, c, { locale: le, ...n });
|
|
1699
|
-
let o = a(e, "PPPP");
|
|
1700
|
-
return t.today && (o = `Today, ${o}`), t.selected && (o = `${o}, selected`), o;
|
|
1701
|
-
},
|
|
1702
|
-
labelMonthDropdown: "Choose the Month",
|
|
1703
|
-
labelNext: "Go to the Next Month",
|
|
1704
|
-
labelPrevious: "Go to the Previous Month",
|
|
1705
|
-
labelWeekNumber: (e) => `Week ${e}`,
|
|
1706
|
-
labelYearDropdown: "Choose the Year",
|
|
1707
|
-
labelGrid: (e, t, n) => {
|
|
1708
|
-
let r;
|
|
1709
|
-
return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (a, o) => he(a, o, { locale: le, ...t }), r(e, "LLLL yyyy");
|
|
1710
|
-
},
|
|
1711
|
-
labelGridcell: (e, t, n, r) => {
|
|
1712
|
-
let a;
|
|
1713
|
-
r && typeof r.format == "function" ? a = r.format.bind(r) : a = (s, c) => he(s, c, { locale: le, ...n });
|
|
1714
|
-
let o = a(e, "PPPP");
|
|
1715
|
-
return t != null && t.today && (o = `Today, ${o}`), o;
|
|
1716
|
-
},
|
|
1717
|
-
labelNav: "Navigation bar",
|
|
1718
|
-
labelWeekNumberHeader: "Week Number",
|
|
1719
|
-
labelWeekday: (e, t, n) => {
|
|
1720
|
-
let r;
|
|
1721
|
-
return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (a, o) => he(a, o, { locale: le, ...t }), r(e, "cccc");
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
|
-
};
|
|
1725
|
-
class R {
|
|
1726
|
-
/**
|
|
1727
|
-
* Creates an instance of `DateLib`.
|
|
1728
|
-
*
|
|
1729
|
-
* @param options Configuration options for the date library.
|
|
1730
|
-
* @param overrides Custom overrides for the date library functions.
|
|
1731
|
-
*/
|
|
1732
|
-
constructor(t, n) {
|
|
1733
|
-
this.Date = Date, this.today = () => {
|
|
1734
|
-
var r;
|
|
1735
|
-
return (r = this.overrides) != null && r.today ? this.overrides.today() : this.options.timeZone ? q.tz(this.options.timeZone) : new this.Date();
|
|
1736
|
-
}, this.newDate = (r, a, o) => {
|
|
1737
|
-
var s;
|
|
1738
|
-
return (s = this.overrides) != null && s.newDate ? this.overrides.newDate(r, a, o) : this.options.timeZone ? new q(r, a, o, this.options.timeZone) : new Date(r, a, o);
|
|
1739
|
-
}, this.addDays = (r, a) => {
|
|
1740
|
-
var o;
|
|
1741
|
-
return (o = this.overrides) != null && o.addDays ? this.overrides.addDays(r, a) : Yt(r, a);
|
|
1742
|
-
}, this.addMonths = (r, a) => {
|
|
1743
|
-
var o;
|
|
1744
|
-
return (o = this.overrides) != null && o.addMonths ? this.overrides.addMonths(r, a) : Tt(r, a);
|
|
1745
|
-
}, this.addWeeks = (r, a) => {
|
|
1746
|
-
var o;
|
|
1747
|
-
return (o = this.overrides) != null && o.addWeeks ? this.overrides.addWeeks(r, a) : Rn(r, a);
|
|
1748
|
-
}, this.addYears = (r, a) => {
|
|
1749
|
-
var o;
|
|
1750
|
-
return (o = this.overrides) != null && o.addYears ? this.overrides.addYears(r, a) : Gn(r, a);
|
|
1751
|
-
}, this.differenceInCalendarDays = (r, a) => {
|
|
1752
|
-
var o;
|
|
1753
|
-
return (o = this.overrides) != null && o.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, a) : Ze(r, a);
|
|
1754
|
-
}, this.differenceInCalendarMonths = (r, a) => {
|
|
1755
|
-
var o;
|
|
1756
|
-
return (o = this.overrides) != null && o.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, a) : Et(r, a);
|
|
1757
|
-
}, this.eachMonthOfInterval = (r) => {
|
|
1758
|
-
var a;
|
|
1759
|
-
return (a = this.overrides) != null && a.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : Zn(r);
|
|
1760
|
-
}, this.eachYearOfInterval = (r) => {
|
|
1761
|
-
var c;
|
|
1762
|
-
const a = (c = this.overrides) != null && c.eachYearOfInterval ? this.overrides.eachYearOfInterval(r) : er(r), o = new Set(a.map((i) => this.getYear(i)));
|
|
1763
|
-
if (o.size === a.length)
|
|
1764
|
-
return a;
|
|
1765
|
-
const s = [];
|
|
1766
|
-
return o.forEach((i) => {
|
|
1767
|
-
s.push(new Date(i, 0, 1));
|
|
1768
|
-
}), s;
|
|
1769
|
-
}, this.endOfBroadcastWeek = (r) => {
|
|
1770
|
-
var a;
|
|
1771
|
-
return (a = this.overrides) != null && a.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : Sa(r, this);
|
|
1772
|
-
}, this.endOfISOWeek = (r) => {
|
|
1773
|
-
var a;
|
|
1774
|
-
return (a = this.overrides) != null && a.endOfISOWeek ? this.overrides.endOfISOWeek(r) : tr(r);
|
|
1775
|
-
}, this.endOfMonth = (r) => {
|
|
1776
|
-
var a;
|
|
1777
|
-
return (a = this.overrides) != null && a.endOfMonth ? this.overrides.endOfMonth(r) : Jn(r);
|
|
1778
|
-
}, this.endOfWeek = (r, a) => {
|
|
1779
|
-
var o;
|
|
1780
|
-
return (o = this.overrides) != null && o.endOfWeek ? this.overrides.endOfWeek(r, a) : Bt(r, this.options);
|
|
1781
|
-
}, this.endOfYear = (r) => {
|
|
1782
|
-
var a;
|
|
1783
|
-
return (a = this.overrides) != null && a.endOfYear ? this.overrides.endOfYear(r) : Ln(r);
|
|
1784
|
-
}, this.format = (r, a, o) => {
|
|
1785
|
-
var c;
|
|
1786
|
-
const s = (c = this.overrides) != null && c.format ? this.overrides.format(r, a, this.options) : he(r, a, this.options);
|
|
1787
|
-
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(s) : s;
|
|
1788
|
-
}, this.getISOWeek = (r) => {
|
|
1789
|
-
var a;
|
|
1790
|
-
return (a = this.overrides) != null && a.getISOWeek ? this.overrides.getISOWeek(r) : Ke(r);
|
|
1791
|
-
}, this.getMonth = (r, a) => {
|
|
1792
|
-
var o;
|
|
1793
|
-
return (o = this.overrides) != null && o.getMonth ? this.overrides.getMonth(r, this.options) : Kr(r, this.options);
|
|
1794
|
-
}, this.getYear = (r, a) => {
|
|
1795
|
-
var o;
|
|
1796
|
-
return (o = this.overrides) != null && o.getYear ? this.overrides.getYear(r, this.options) : Lr(r, this.options);
|
|
1797
|
-
}, this.getWeek = (r, a) => {
|
|
1798
|
-
var o;
|
|
1799
|
-
return (o = this.overrides) != null && o.getWeek ? this.overrides.getWeek(r, this.options) : Le(r, this.options);
|
|
1800
|
-
}, this.isAfter = (r, a) => {
|
|
1801
|
-
var o;
|
|
1802
|
-
return (o = this.overrides) != null && o.isAfter ? this.overrides.isAfter(r, a) : ea(r, a);
|
|
1803
|
-
}, this.isBefore = (r, a) => {
|
|
1804
|
-
var o;
|
|
1805
|
-
return (o = this.overrides) != null && o.isBefore ? this.overrides.isBefore(r, a) : ta(r, a);
|
|
1806
|
-
}, this.isDate = (r) => {
|
|
1807
|
-
var a;
|
|
1808
|
-
return (a = this.overrides) != null && a.isDate ? this.overrides.isDate(r) : Pt(r);
|
|
1809
|
-
}, this.isSameDay = (r, a) => {
|
|
1810
|
-
var o;
|
|
1811
|
-
return (o = this.overrides) != null && o.isSameDay ? this.overrides.isSameDay(r, a) : Xn(r, a);
|
|
1812
|
-
}, this.isSameMonth = (r, a) => {
|
|
1813
|
-
var o;
|
|
1814
|
-
return (o = this.overrides) != null && o.isSameMonth ? this.overrides.isSameMonth(r, a) : na(r, a);
|
|
1815
|
-
}, this.isSameYear = (r, a) => {
|
|
1816
|
-
var o;
|
|
1817
|
-
return (o = this.overrides) != null && o.isSameYear ? this.overrides.isSameYear(r, a) : ra(r, a);
|
|
1818
|
-
}, this.max = (r) => {
|
|
1819
|
-
var a;
|
|
1820
|
-
return (a = this.overrides) != null && a.max ? this.overrides.max(r) : Un(r);
|
|
1821
|
-
}, this.min = (r) => {
|
|
1822
|
-
var a;
|
|
1823
|
-
return (a = this.overrides) != null && a.min ? this.overrides.min(r) : Qn(r);
|
|
1824
|
-
}, this.setMonth = (r, a) => {
|
|
1825
|
-
var o;
|
|
1826
|
-
return (o = this.overrides) != null && o.setMonth ? this.overrides.setMonth(r, a) : Ma(r, a);
|
|
1827
|
-
}, this.setYear = (r, a) => {
|
|
1828
|
-
var o;
|
|
1829
|
-
return (o = this.overrides) != null && o.setYear ? this.overrides.setYear(r, a) : Da(r, a);
|
|
1830
|
-
}, this.startOfBroadcastWeek = (r, a) => {
|
|
1831
|
-
var o;
|
|
1832
|
-
return (o = this.overrides) != null && o.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : zt(r, this);
|
|
1833
|
-
}, this.startOfDay = (r) => {
|
|
1834
|
-
var a;
|
|
1835
|
-
return (a = this.overrides) != null && a.startOfDay ? this.overrides.startOfDay(r) : We(r);
|
|
1836
|
-
}, this.startOfISOWeek = (r) => {
|
|
1837
|
-
var a;
|
|
1838
|
-
return (a = this.overrides) != null && a.startOfISOWeek ? this.overrides.startOfISOWeek(r) : ve(r);
|
|
1839
|
-
}, this.startOfMonth = (r) => {
|
|
1840
|
-
var a;
|
|
1841
|
-
return (a = this.overrides) != null && a.startOfMonth ? this.overrides.startOfMonth(r) : Kn(r);
|
|
1842
|
-
}, this.startOfWeek = (r, a) => {
|
|
1843
|
-
var o;
|
|
1844
|
-
return (o = this.overrides) != null && o.startOfWeek ? this.overrides.startOfWeek(r, this.options) : me(r, this.options);
|
|
1845
|
-
}, this.startOfYear = (r) => {
|
|
1846
|
-
var a;
|
|
1847
|
-
return (a = this.overrides) != null && a.startOfYear ? this.overrides.startOfYear(r) : It(r);
|
|
1848
|
-
}, this.options = { locale: $t, ...t }, this.overrides = n;
|
|
1849
|
-
}
|
|
1850
|
-
/**
|
|
1851
|
-
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
1852
|
-
* digits.
|
|
1853
|
-
*
|
|
1854
|
-
* @since 9.5.0
|
|
1855
|
-
* @returns A record mapping Arabic digits to the target numerals.
|
|
1856
|
-
*/
|
|
1857
|
-
getDigitMap() {
|
|
1858
|
-
const { numerals: t = "latn" } = this.options, n = new Intl.NumberFormat("en-US", {
|
|
1859
|
-
numberingSystem: t
|
|
1860
|
-
}), r = {};
|
|
1861
|
-
for (let a = 0; a < 10; a++)
|
|
1862
|
-
r[a.toString()] = n.format(a);
|
|
1863
|
-
return r;
|
|
1864
|
-
}
|
|
1865
|
-
/**
|
|
1866
|
-
* Replaces Arabic digits in a string with the target numbering system digits.
|
|
1867
|
-
*
|
|
1868
|
-
* @since 9.5.0
|
|
1869
|
-
* @param input The string containing Arabic digits.
|
|
1870
|
-
* @returns The string with digits replaced.
|
|
1871
|
-
*/
|
|
1872
|
-
replaceDigits(t) {
|
|
1873
|
-
const n = this.getDigitMap();
|
|
1874
|
-
return t.replace(/\d/g, (r) => n[r] || r);
|
|
1875
|
-
}
|
|
1876
|
-
/**
|
|
1877
|
-
* Formats a number using the configured numbering system.
|
|
1878
|
-
*
|
|
1879
|
-
* @since 9.5.0
|
|
1880
|
-
* @param value The number to format.
|
|
1881
|
-
* @returns The formatted number as a string.
|
|
1882
|
-
*/
|
|
1883
|
-
formatNumber(t) {
|
|
1884
|
-
return this.replaceDigits(t.toString());
|
|
1885
|
-
}
|
|
1886
|
-
/**
|
|
1887
|
-
* Returns the preferred ordering for month and year labels for the current
|
|
1888
|
-
* locale.
|
|
1889
|
-
*/
|
|
1890
|
-
getMonthYearOrder() {
|
|
1891
|
-
var n;
|
|
1892
|
-
const t = (n = this.options.locale) == null ? void 0 : n.code;
|
|
1893
|
-
return t && R.yearFirstLocales.has(t) ? "year-first" : "month-first";
|
|
1894
|
-
}
|
|
1895
|
-
/**
|
|
1896
|
-
* Formats the month/year pair respecting locale conventions.
|
|
1897
|
-
*
|
|
1898
|
-
* @since 9.11.0
|
|
1899
|
-
*/
|
|
1900
|
-
formatMonthYear(t) {
|
|
1901
|
-
const { locale: n, timeZone: r, numerals: a } = this.options, o = n == null ? void 0 : n.code;
|
|
1902
|
-
if (o && R.yearFirstLocales.has(o))
|
|
1903
|
-
try {
|
|
1904
|
-
return new Intl.DateTimeFormat(o, {
|
|
1905
|
-
month: "long",
|
|
1906
|
-
year: "numeric",
|
|
1907
|
-
timeZone: r,
|
|
1908
|
-
numberingSystem: a
|
|
1909
|
-
}).format(t);
|
|
1910
|
-
} catch {
|
|
1911
|
-
}
|
|
1912
|
-
const s = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
1913
|
-
return this.format(t, s);
|
|
1914
|
-
}
|
|
1915
|
-
}
|
|
1916
|
-
R.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
1917
|
-
"eu",
|
|
1918
|
-
"hu",
|
|
1919
|
-
"ja",
|
|
1920
|
-
"ja-Hira",
|
|
1921
|
-
"ja-JP",
|
|
1922
|
-
"ko",
|
|
1923
|
-
"ko-KR",
|
|
1924
|
-
"lt",
|
|
1925
|
-
"lt-LT",
|
|
1926
|
-
"lv",
|
|
1927
|
-
"lv-LV",
|
|
1928
|
-
"mn",
|
|
1929
|
-
"mn-MN",
|
|
1930
|
-
"zh",
|
|
1931
|
-
"zh-CN",
|
|
1932
|
-
"zh-HK",
|
|
1933
|
-
"zh-TW"
|
|
1934
|
-
]);
|
|
1935
|
-
const ee = new R();
|
|
1936
|
-
class Rt {
|
|
1937
|
-
constructor(t, n, r = ee) {
|
|
1938
|
-
this.date = t, this.displayMonth = n, this.outside = !!(n && !r.isSameMonth(t, n)), this.dateLib = r, this.isoDate = r.format(t, "yyyy-MM-dd"), this.displayMonthId = r.format(n, "yyyy-MM"), this.dateMonthId = r.format(t, "yyyy-MM");
|
|
1939
|
-
}
|
|
1940
|
-
/**
|
|
1941
|
-
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
1942
|
-
* date and the displayed month.
|
|
1943
|
-
*
|
|
1944
|
-
* @param day The `CalendarDay` to compare with.
|
|
1945
|
-
* @returns `true` if the days are equal, otherwise `false`.
|
|
1946
|
-
*/
|
|
1947
|
-
isEqualTo(t) {
|
|
1948
|
-
return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
class pa {
|
|
1952
|
-
constructor(t, n) {
|
|
1953
|
-
this.date = t, this.weeks = n;
|
|
1954
|
-
}
|
|
1955
|
-
}
|
|
1956
|
-
class Ca {
|
|
1957
|
-
constructor(t, n) {
|
|
1958
|
-
this.days = n, this.weekNumber = t;
|
|
1959
|
-
}
|
|
1960
|
-
}
|
|
1961
|
-
function xa(e) {
|
|
1962
|
-
return m.createElement("button", { ...e });
|
|
1963
|
-
}
|
|
1964
|
-
function Ya(e) {
|
|
1965
|
-
return m.createElement("span", { ...e });
|
|
1966
|
-
}
|
|
1967
|
-
function Ta(e) {
|
|
1968
|
-
const { size: t = 24, orientation: n = "left", className: r } = e;
|
|
1969
|
-
return (
|
|
1970
|
-
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
|
|
1971
|
-
m.createElement(
|
|
1972
|
-
"svg",
|
|
1973
|
-
{ className: r, width: t, height: t, viewBox: "0 0 24 24" },
|
|
1974
|
-
n === "up" && m.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
|
|
1975
|
-
n === "down" && m.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
|
|
1976
|
-
n === "left" && m.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
1977
|
-
n === "right" && m.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
|
|
1978
|
-
)
|
|
1979
|
-
);
|
|
1980
|
-
}
|
|
1981
|
-
function _a(e) {
|
|
1982
|
-
const { day: t, modifiers: n, ...r } = e;
|
|
1983
|
-
return m.createElement("td", { ...r });
|
|
1984
|
-
}
|
|
1985
|
-
function Pa(e) {
|
|
1986
|
-
const { day: t, modifiers: n, ...r } = e, a = m.useRef(null);
|
|
1987
|
-
return m.useEffect(() => {
|
|
1988
|
-
var o;
|
|
1989
|
-
n.focused && ((o = a.current) == null || o.focus());
|
|
1990
|
-
}, [n.focused]), m.createElement("button", { ref: a, ...r });
|
|
1991
|
-
}
|
|
1992
|
-
var w;
|
|
1993
|
-
(function(e) {
|
|
1994
|
-
e.Root = "root", e.Chevron = "chevron", e.Day = "day", e.DayButton = "day_button", e.CaptionLabel = "caption_label", e.Dropdowns = "dropdowns", e.Dropdown = "dropdown", e.DropdownRoot = "dropdown_root", e.Footer = "footer", e.MonthGrid = "month_grid", e.MonthCaption = "month_caption", e.MonthsDropdown = "months_dropdown", e.Month = "month", e.Months = "months", e.Nav = "nav", e.NextMonthButton = "button_next", e.PreviousMonthButton = "button_previous", e.Week = "week", e.Weeks = "weeks", e.Weekday = "weekday", e.Weekdays = "weekdays", e.WeekNumber = "week_number", e.WeekNumberHeader = "week_number_header", e.YearsDropdown = "years_dropdown";
|
|
1995
|
-
})(w || (w = {}));
|
|
1996
|
-
var I;
|
|
1997
|
-
(function(e) {
|
|
1998
|
-
e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
|
|
1999
|
-
})(I || (I = {}));
|
|
2000
|
-
var Z;
|
|
2001
|
-
(function(e) {
|
|
2002
|
-
e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
|
|
2003
|
-
})(Z || (Z = {}));
|
|
2004
|
-
var $;
|
|
2005
|
-
(function(e) {
|
|
2006
|
-
e.weeks_before_enter = "weeks_before_enter", e.weeks_before_exit = "weeks_before_exit", e.weeks_after_enter = "weeks_after_enter", e.weeks_after_exit = "weeks_after_exit", e.caption_after_enter = "caption_after_enter", e.caption_after_exit = "caption_after_exit", e.caption_before_enter = "caption_before_enter", e.caption_before_exit = "caption_before_exit";
|
|
2007
|
-
})($ || ($ = {}));
|
|
2008
|
-
function Ea(e) {
|
|
2009
|
-
const { options: t, className: n, components: r, classNames: a, ...o } = e, s = [a[w.Dropdown], n].join(" "), c = t == null ? void 0 : t.find(({ value: i }) => i === o.value);
|
|
2010
|
-
return m.createElement(
|
|
2011
|
-
"span",
|
|
2012
|
-
{ "data-disabled": o.disabled, className: a[w.DropdownRoot] },
|
|
2013
|
-
m.createElement(r.Select, { className: s, ...o }, t == null ? void 0 : t.map(({ value: i, label: u, disabled: d }) => m.createElement(r.Option, { key: i, value: i, disabled: d }, u))),
|
|
2014
|
-
m.createElement(
|
|
2015
|
-
"span",
|
|
2016
|
-
{ className: a[w.CaptionLabel], "aria-hidden": !0 },
|
|
2017
|
-
c == null ? void 0 : c.label,
|
|
2018
|
-
m.createElement(r.Chevron, { orientation: "down", size: 18, className: a[w.Chevron] })
|
|
2019
|
-
)
|
|
2020
|
-
);
|
|
2021
|
-
}
|
|
2022
|
-
function Fa(e) {
|
|
2023
|
-
return m.createElement("div", { ...e });
|
|
2024
|
-
}
|
|
2025
|
-
function Ia(e) {
|
|
2026
|
-
return m.createElement("div", { ...e });
|
|
2027
|
-
}
|
|
2028
|
-
function Ba(e) {
|
|
2029
|
-
const { calendarMonth: t, displayIndex: n, ...r } = e;
|
|
2030
|
-
return m.createElement("div", { ...r }, e.children);
|
|
2031
|
-
}
|
|
2032
|
-
function ja(e) {
|
|
2033
|
-
const { calendarMonth: t, displayIndex: n, ...r } = e;
|
|
2034
|
-
return m.createElement("div", { ...r });
|
|
2035
|
-
}
|
|
2036
|
-
function Ha(e) {
|
|
2037
|
-
return m.createElement("table", { ...e });
|
|
2038
|
-
}
|
|
2039
|
-
function Aa(e) {
|
|
2040
|
-
return m.createElement("div", { ...e });
|
|
2041
|
-
}
|
|
2042
|
-
const Gt = x.createContext(void 0);
|
|
2043
|
-
function Se() {
|
|
2044
|
-
const e = x.useContext(Gt);
|
|
2045
|
-
if (e === void 0)
|
|
2046
|
-
throw new Error("useDayPicker() must be used within a custom component.");
|
|
2047
|
-
return e;
|
|
2048
|
-
}
|
|
2049
|
-
function qa(e) {
|
|
2050
|
-
const { components: t } = Se();
|
|
2051
|
-
return m.createElement(t.Dropdown, { ...e });
|
|
2052
|
-
}
|
|
2053
|
-
function za(e) {
|
|
2054
|
-
const { onPreviousClick: t, onNextClick: n, previousMonth: r, nextMonth: a, ...o } = e, { components: s, classNames: c, labels: { labelPrevious: i, labelNext: u } } = Se(), d = x.useCallback((h) => {
|
|
2055
|
-
a && (n == null || n(h));
|
|
2056
|
-
}, [a, n]), f = x.useCallback((h) => {
|
|
2057
|
-
r && (t == null || t(h));
|
|
2058
|
-
}, [r, t]);
|
|
2059
|
-
return m.createElement(
|
|
2060
|
-
"nav",
|
|
2061
|
-
{ ...o },
|
|
2062
|
-
m.createElement(
|
|
2063
|
-
s.PreviousMonthButton,
|
|
2064
|
-
{ type: "button", className: c[w.PreviousMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled": r ? void 0 : !0, "aria-label": i(r), onClick: f },
|
|
2065
|
-
m.createElement(s.Chevron, { disabled: r ? void 0 : !0, className: c[w.Chevron], orientation: "left" })
|
|
2066
|
-
),
|
|
2067
|
-
m.createElement(
|
|
2068
|
-
s.NextMonthButton,
|
|
2069
|
-
{ type: "button", className: c[w.NextMonthButton], tabIndex: a ? void 0 : -1, "aria-disabled": a ? void 0 : !0, "aria-label": u(a), onClick: d },
|
|
2070
|
-
m.createElement(s.Chevron, { disabled: a ? void 0 : !0, orientation: "right", className: c[w.Chevron] })
|
|
2071
|
-
)
|
|
2072
|
-
);
|
|
2073
|
-
}
|
|
2074
|
-
function $a(e) {
|
|
2075
|
-
const { components: t } = Se();
|
|
2076
|
-
return m.createElement(t.Button, { ...e });
|
|
2077
|
-
}
|
|
2078
|
-
function Ra(e) {
|
|
2079
|
-
return m.createElement("option", { ...e });
|
|
2080
|
-
}
|
|
2081
|
-
function Ga(e) {
|
|
2082
|
-
const { components: t } = Se();
|
|
2083
|
-
return m.createElement(t.Button, { ...e });
|
|
2084
|
-
}
|
|
2085
|
-
function Ua(e) {
|
|
2086
|
-
const { rootRef: t, ...n } = e;
|
|
2087
|
-
return m.createElement("div", { ...n, ref: t });
|
|
2088
|
-
}
|
|
2089
|
-
function Qa(e) {
|
|
2090
|
-
return m.createElement("select", { ...e });
|
|
2091
|
-
}
|
|
2092
|
-
function Xa(e) {
|
|
2093
|
-
const { week: t, ...n } = e;
|
|
2094
|
-
return m.createElement("tr", { ...n });
|
|
2095
|
-
}
|
|
2096
|
-
function Va(e) {
|
|
2097
|
-
return m.createElement("th", { ...e });
|
|
2098
|
-
}
|
|
2099
|
-
function Ja(e) {
|
|
2100
|
-
return m.createElement(
|
|
2101
|
-
"thead",
|
|
2102
|
-
{ "aria-hidden": !0 },
|
|
2103
|
-
m.createElement("tr", { ...e })
|
|
2104
|
-
);
|
|
2105
|
-
}
|
|
2106
|
-
function Za(e) {
|
|
2107
|
-
const { week: t, ...n } = e;
|
|
2108
|
-
return m.createElement("th", { ...n });
|
|
2109
|
-
}
|
|
2110
|
-
function Ka(e) {
|
|
2111
|
-
return m.createElement("th", { ...e });
|
|
2112
|
-
}
|
|
2113
|
-
function La(e) {
|
|
2114
|
-
return m.createElement("tbody", { ...e });
|
|
2115
|
-
}
|
|
2116
|
-
function eo(e) {
|
|
2117
|
-
const { components: t } = Se();
|
|
2118
|
-
return m.createElement(t.Dropdown, { ...e });
|
|
2119
|
-
}
|
|
2120
|
-
const to = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2121
|
-
__proto__: null,
|
|
2122
|
-
Button: xa,
|
|
2123
|
-
CaptionLabel: Ya,
|
|
2124
|
-
Chevron: Ta,
|
|
2125
|
-
Day: _a,
|
|
2126
|
-
DayButton: Pa,
|
|
2127
|
-
Dropdown: Ea,
|
|
2128
|
-
DropdownNav: Fa,
|
|
2129
|
-
Footer: Ia,
|
|
2130
|
-
Month: Ba,
|
|
2131
|
-
MonthCaption: ja,
|
|
2132
|
-
MonthGrid: Ha,
|
|
2133
|
-
Months: Aa,
|
|
2134
|
-
MonthsDropdown: qa,
|
|
2135
|
-
Nav: za,
|
|
2136
|
-
NextMonthButton: $a,
|
|
2137
|
-
Option: Ra,
|
|
2138
|
-
PreviousMonthButton: Ga,
|
|
2139
|
-
Root: Ua,
|
|
2140
|
-
Select: Qa,
|
|
2141
|
-
Week: Xa,
|
|
2142
|
-
WeekNumber: Za,
|
|
2143
|
-
WeekNumberHeader: Ka,
|
|
2144
|
-
Weekday: Va,
|
|
2145
|
-
Weekdays: Ja,
|
|
2146
|
-
Weeks: La,
|
|
2147
|
-
YearsDropdown: eo
|
|
2148
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2149
|
-
function re(e, t, n = !1, r = ee) {
|
|
2150
|
-
let { from: a, to: o } = e;
|
|
2151
|
-
const { differenceInCalendarDays: s, isSameDay: c } = r;
|
|
2152
|
-
return a && o ? (s(o, a) < 0 && ([a, o] = [o, a]), s(t, a) >= (n ? 1 : 0) && s(o, t) >= (n ? 1 : 0)) : !n && o ? c(o, t) : !n && a ? c(a, t) : !1;
|
|
2153
|
-
}
|
|
2154
|
-
function et(e) {
|
|
2155
|
-
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
2156
|
-
}
|
|
2157
|
-
function Ee(e) {
|
|
2158
|
-
return !!(e && typeof e == "object" && "from" in e);
|
|
2159
|
-
}
|
|
2160
|
-
function tt(e) {
|
|
2161
|
-
return !!(e && typeof e == "object" && "after" in e);
|
|
2162
|
-
}
|
|
2163
|
-
function nt(e) {
|
|
2164
|
-
return !!(e && typeof e == "object" && "before" in e);
|
|
2165
|
-
}
|
|
2166
|
-
function Ut(e) {
|
|
2167
|
-
return !!(e && typeof e == "object" && "dayOfWeek" in e);
|
|
2168
|
-
}
|
|
2169
|
-
function Qt(e, t) {
|
|
2170
|
-
return Array.isArray(e) && e.every(t.isDate);
|
|
2171
|
-
}
|
|
2172
|
-
function ae(e, t, n = ee) {
|
|
2173
|
-
const r = Array.isArray(t) ? t : [t], { isSameDay: a, differenceInCalendarDays: o, isAfter: s } = n;
|
|
2174
|
-
return r.some((c) => {
|
|
2175
|
-
if (typeof c == "boolean")
|
|
2176
|
-
return c;
|
|
2177
|
-
if (n.isDate(c))
|
|
2178
|
-
return a(e, c);
|
|
2179
|
-
if (Qt(c, n))
|
|
2180
|
-
return c.some((i) => a(e, i));
|
|
2181
|
-
if (Ee(c))
|
|
2182
|
-
return re(c, e, !1, n);
|
|
2183
|
-
if (Ut(c))
|
|
2184
|
-
return Array.isArray(c.dayOfWeek) ? c.dayOfWeek.includes(e.getDay()) : c.dayOfWeek === e.getDay();
|
|
2185
|
-
if (et(c)) {
|
|
2186
|
-
const i = o(c.before, e), u = o(c.after, e), d = i > 0, f = u < 0;
|
|
2187
|
-
return s(c.before, c.after) ? f && d : d || f;
|
|
2188
|
-
}
|
|
2189
|
-
return tt(c) ? o(e, c.after) > 0 : nt(c) ? o(c.before, e) > 0 : typeof c == "function" ? c(e) : !1;
|
|
2190
|
-
});
|
|
2191
|
-
}
|
|
2192
|
-
function no(e, t, n, r, a) {
|
|
2193
|
-
const { disabled: o, hidden: s, modifiers: c, showOutsideDays: i, broadcastCalendar: u, today: d = a.today() } = t, { isSameDay: f, isSameMonth: h, startOfMonth: g, isBefore: v, endOfMonth: N, isAfter: k } = a, M = n && g(n), O = r && N(r), y = {
|
|
2194
|
-
[I.focused]: [],
|
|
2195
|
-
[I.outside]: [],
|
|
2196
|
-
[I.disabled]: [],
|
|
2197
|
-
[I.hidden]: [],
|
|
2198
|
-
[I.today]: []
|
|
2199
|
-
}, p = {};
|
|
2200
|
-
for (const D of e) {
|
|
2201
|
-
const { date: l, displayMonth: S } = D, F = !!(S && !h(l, S)), H = !!(M && v(l, M)), B = !!(O && k(l, O)), G = !!(o && ae(l, o, a)), oe = !!(s && ae(l, s, a)) || H || B || // Broadcast calendar will show outside days as default
|
|
2202
|
-
!u && !i && F || u && i === !1 && F, te = f(l, d);
|
|
2203
|
-
F && y.outside.push(D), G && y.disabled.push(D), oe && y.hidden.push(D), te && y.today.push(D), c && Object.keys(c).forEach((U) => {
|
|
2204
|
-
const ue = c == null ? void 0 : c[U];
|
|
2205
|
-
ue && ae(l, ue, a) && (p[U] ? p[U].push(D) : p[U] = [D]);
|
|
2206
|
-
});
|
|
2207
|
-
}
|
|
2208
|
-
return (D) => {
|
|
2209
|
-
const l = {
|
|
2210
|
-
[I.focused]: !1,
|
|
2211
|
-
[I.disabled]: !1,
|
|
2212
|
-
[I.hidden]: !1,
|
|
2213
|
-
[I.outside]: !1,
|
|
2214
|
-
[I.today]: !1
|
|
2215
|
-
}, S = {};
|
|
2216
|
-
for (const F in y) {
|
|
2217
|
-
const H = y[F];
|
|
2218
|
-
l[F] = H.some((B) => B === D);
|
|
2219
|
-
}
|
|
2220
|
-
for (const F in p)
|
|
2221
|
-
S[F] = p[F].some((H) => H === D);
|
|
2222
|
-
return {
|
|
2223
|
-
...l,
|
|
2224
|
-
// custom modifiers should override all the previous ones
|
|
2225
|
-
...S
|
|
2226
|
-
};
|
|
2227
|
-
};
|
|
2228
|
-
}
|
|
2229
|
-
function ro(e, t, n = {}) {
|
|
2230
|
-
return Object.entries(e).filter(([, a]) => a === !0).reduce((a, [o]) => (n[o] ? a.push(n[o]) : t[I[o]] ? a.push(t[I[o]]) : t[Z[o]] && a.push(t[Z[o]]), a), [t[w.Day]]);
|
|
2231
|
-
}
|
|
2232
|
-
function ao(e) {
|
|
2233
|
-
return {
|
|
2234
|
-
...to,
|
|
2235
|
-
...e
|
|
2236
|
-
};
|
|
2237
|
-
}
|
|
2238
|
-
function oo(e) {
|
|
2239
|
-
const t = {
|
|
2240
|
-
"data-mode": e.mode ?? void 0,
|
|
2241
|
-
"data-required": "required" in e ? e.required : void 0,
|
|
2242
|
-
"data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
|
|
2243
|
-
"data-week-numbers": e.showWeekNumber || void 0,
|
|
2244
|
-
"data-broadcast-calendar": e.broadcastCalendar || void 0,
|
|
2245
|
-
"data-nav-layout": e.navLayout || void 0
|
|
2246
|
-
};
|
|
2247
|
-
return Object.entries(e).forEach(([n, r]) => {
|
|
2248
|
-
n.startsWith("data-") && (t[n] = r);
|
|
2249
|
-
}), t;
|
|
2250
|
-
}
|
|
2251
|
-
function rt() {
|
|
2252
|
-
const e = {};
|
|
2253
|
-
for (const t in w)
|
|
2254
|
-
e[w[t]] = `rdp-${w[t]}`;
|
|
2255
|
-
for (const t in I)
|
|
2256
|
-
e[I[t]] = `rdp-${I[t]}`;
|
|
2257
|
-
for (const t in Z)
|
|
2258
|
-
e[Z[t]] = `rdp-${Z[t]}`;
|
|
2259
|
-
for (const t in $)
|
|
2260
|
-
e[$[t]] = `rdp-${$[t]}`;
|
|
2261
|
-
return e;
|
|
2262
|
-
}
|
|
2263
|
-
function Xt(e, t, n) {
|
|
2264
|
-
return (n ?? new R(t)).formatMonthYear(e);
|
|
2265
|
-
}
|
|
2266
|
-
const so = Xt;
|
|
2267
|
-
function io(e, t, n) {
|
|
2268
|
-
return (n ?? new R(t)).format(e, "d");
|
|
2269
|
-
}
|
|
2270
|
-
function co(e, t = ee) {
|
|
2271
|
-
return t.format(e, "LLLL");
|
|
2272
|
-
}
|
|
2273
|
-
function uo(e, t, n) {
|
|
2274
|
-
return (n ?? new R(t)).format(e, "cccccc");
|
|
2275
|
-
}
|
|
2276
|
-
function fo(e, t = ee) {
|
|
2277
|
-
return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
|
|
2278
|
-
}
|
|
2279
|
-
function lo() {
|
|
2280
|
-
return "";
|
|
2281
|
-
}
|
|
2282
|
-
function Vt(e, t = ee) {
|
|
2283
|
-
return t.format(e, "yyyy");
|
|
2284
|
-
}
|
|
2285
|
-
const ho = Vt, mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2286
|
-
__proto__: null,
|
|
2287
|
-
formatCaption: Xt,
|
|
2288
|
-
formatDay: io,
|
|
2289
|
-
formatMonthCaption: so,
|
|
2290
|
-
formatMonthDropdown: co,
|
|
2291
|
-
formatWeekNumber: fo,
|
|
2292
|
-
formatWeekNumberHeader: lo,
|
|
2293
|
-
formatWeekdayName: uo,
|
|
2294
|
-
formatYearCaption: ho,
|
|
2295
|
-
formatYearDropdown: Vt
|
|
2296
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2297
|
-
function yo(e) {
|
|
2298
|
-
return e != null && e.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e != null && e.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
|
|
2299
|
-
...mo,
|
|
2300
|
-
...e
|
|
2301
|
-
};
|
|
2302
|
-
}
|
|
2303
|
-
function at(e, t, n, r) {
|
|
2304
|
-
let a = (r ?? new R(n)).format(e, "PPPP");
|
|
2305
|
-
return t.today && (a = `Today, ${a}`), t.selected && (a = `${a}, selected`), a;
|
|
2306
|
-
}
|
|
2307
|
-
const go = at;
|
|
2308
|
-
function ot(e, t, n) {
|
|
2309
|
-
return (n ?? new R(t)).formatMonthYear(e);
|
|
2310
|
-
}
|
|
2311
|
-
const wo = ot;
|
|
2312
|
-
function Jt(e, t, n, r) {
|
|
2313
|
-
let a = (r ?? new R(n)).format(e, "PPPP");
|
|
2314
|
-
return t != null && t.today && (a = `Today, ${a}`), a;
|
|
2315
|
-
}
|
|
2316
|
-
function Zt(e) {
|
|
2317
|
-
return "Choose the Month";
|
|
2318
|
-
}
|
|
2319
|
-
function Kt() {
|
|
2320
|
-
return "";
|
|
2321
|
-
}
|
|
2322
|
-
const bo = "Go to the Next Month";
|
|
2323
|
-
function Lt(e, t) {
|
|
2324
|
-
return bo;
|
|
2325
|
-
}
|
|
2326
|
-
function en(e) {
|
|
2327
|
-
return "Go to the Previous Month";
|
|
2328
|
-
}
|
|
2329
|
-
function tn(e, t, n) {
|
|
2330
|
-
return (n ?? new R(t)).format(e, "cccc");
|
|
2331
|
-
}
|
|
2332
|
-
function nn(e, t) {
|
|
2333
|
-
return `Week ${e}`;
|
|
2334
|
-
}
|
|
2335
|
-
function rn(e) {
|
|
2336
|
-
return "Week Number";
|
|
2337
|
-
}
|
|
2338
|
-
function an(e) {
|
|
2339
|
-
return "Choose the Year";
|
|
2340
|
-
}
|
|
2341
|
-
const Mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2342
|
-
__proto__: null,
|
|
2343
|
-
labelCaption: wo,
|
|
2344
|
-
labelDay: go,
|
|
2345
|
-
labelDayButton: at,
|
|
2346
|
-
labelGrid: ot,
|
|
2347
|
-
labelGridcell: Jt,
|
|
2348
|
-
labelMonthDropdown: Zt,
|
|
2349
|
-
labelNav: Kt,
|
|
2350
|
-
labelNext: Lt,
|
|
2351
|
-
labelPrevious: en,
|
|
2352
|
-
labelWeekNumber: nn,
|
|
2353
|
-
labelWeekNumberHeader: rn,
|
|
2354
|
-
labelWeekday: tn,
|
|
2355
|
-
labelYearDropdown: an
|
|
2356
|
-
}, Symbol.toStringTag, { value: "Module" })), J = (e, t, n) => t || (n ? typeof n == "function" ? n : (...r) => n : e);
|
|
2357
|
-
function Do(e, t) {
|
|
2358
|
-
var r;
|
|
2359
|
-
const n = ((r = t.locale) == null ? void 0 : r.labels) ?? {};
|
|
2360
|
-
return {
|
|
2361
|
-
...Mo,
|
|
2362
|
-
...e ?? {},
|
|
2363
|
-
labelDayButton: J(at, e == null ? void 0 : e.labelDayButton, n.labelDayButton),
|
|
2364
|
-
labelMonthDropdown: J(Zt, e == null ? void 0 : e.labelMonthDropdown, n.labelMonthDropdown),
|
|
2365
|
-
labelNext: J(Lt, e == null ? void 0 : e.labelNext, n.labelNext),
|
|
2366
|
-
labelPrevious: J(en, e == null ? void 0 : e.labelPrevious, n.labelPrevious),
|
|
2367
|
-
labelWeekNumber: J(nn, e == null ? void 0 : e.labelWeekNumber, n.labelWeekNumber),
|
|
2368
|
-
labelYearDropdown: J(an, e == null ? void 0 : e.labelYearDropdown, n.labelYearDropdown),
|
|
2369
|
-
labelGrid: J(ot, e == null ? void 0 : e.labelGrid, n.labelGrid),
|
|
2370
|
-
labelGridcell: J(Jt, e == null ? void 0 : e.labelGridcell, n.labelGridcell),
|
|
2371
|
-
labelNav: J(Kt, e == null ? void 0 : e.labelNav, n.labelNav),
|
|
2372
|
-
labelWeekNumberHeader: J(rn, e == null ? void 0 : e.labelWeekNumberHeader, n.labelWeekNumberHeader),
|
|
2373
|
-
labelWeekday: J(tn, e == null ? void 0 : e.labelWeekday, n.labelWeekday)
|
|
2374
|
-
};
|
|
2375
|
-
}
|
|
2376
|
-
function ko(e, t, n, r, a) {
|
|
2377
|
-
const { startOfMonth: o, startOfYear: s, endOfYear: c, eachMonthOfInterval: i, getMonth: u } = a;
|
|
2378
|
-
return i({
|
|
2379
|
-
start: s(e),
|
|
2380
|
-
end: c(e)
|
|
2381
|
-
}).map((h) => {
|
|
2382
|
-
const g = r.formatMonthDropdown(h, a), v = u(h), N = t && h < o(t) || n && h > o(n) || !1;
|
|
2383
|
-
return { value: v, label: g, disabled: N };
|
|
2384
|
-
});
|
|
2385
|
-
}
|
|
2386
|
-
function Oo(e, t = {}, n = {}) {
|
|
2387
|
-
let r = { ...t == null ? void 0 : t[w.Day] };
|
|
2388
|
-
return Object.entries(e).filter(([, a]) => a === !0).forEach(([a]) => {
|
|
2389
|
-
r = {
|
|
2390
|
-
...r,
|
|
2391
|
-
...n == null ? void 0 : n[a]
|
|
2392
|
-
};
|
|
2393
|
-
}), r;
|
|
2394
|
-
}
|
|
2395
|
-
function vo(e, t, n, r) {
|
|
2396
|
-
const a = r ?? e.today(), o = n ? e.startOfBroadcastWeek(a, e) : t ? e.startOfISOWeek(a) : e.startOfWeek(a), s = [];
|
|
2397
|
-
for (let c = 0; c < 7; c++) {
|
|
2398
|
-
const i = e.addDays(o, c);
|
|
2399
|
-
s.push(i);
|
|
2400
|
-
}
|
|
2401
|
-
return s;
|
|
2402
|
-
}
|
|
2403
|
-
function Wo(e, t, n, r, a = !1) {
|
|
2404
|
-
if (!e || !t)
|
|
2405
|
-
return;
|
|
2406
|
-
const { startOfYear: o, endOfYear: s, eachYearOfInterval: c, getYear: i } = r, u = o(e), d = s(t), f = c({ start: u, end: d });
|
|
2407
|
-
return a && f.reverse(), f.map((h) => {
|
|
2408
|
-
const g = n.formatYearDropdown(h, r);
|
|
2409
|
-
return {
|
|
2410
|
-
value: i(h),
|
|
2411
|
-
label: g,
|
|
2412
|
-
disabled: !1
|
|
2413
|
-
};
|
|
2414
|
-
});
|
|
2415
|
-
}
|
|
2416
|
-
function No(e, t = {}) {
|
|
2417
|
-
var c;
|
|
2418
|
-
const { weekStartsOn: n, locale: r } = t, a = n ?? ((c = r == null ? void 0 : r.options) == null ? void 0 : c.weekStartsOn) ?? 0, o = (i) => {
|
|
2419
|
-
const u = typeof i == "number" || typeof i == "string" ? new Date(i) : i;
|
|
2420
|
-
return new q(u.getFullYear(), u.getMonth(), u.getDate(), 12, 0, 0, e);
|
|
2421
|
-
}, s = (i) => {
|
|
2422
|
-
const u = o(i);
|
|
2423
|
-
return new Date(u.getFullYear(), u.getMonth(), u.getDate(), 0, 0, 0, 0);
|
|
2424
|
-
};
|
|
2425
|
-
return {
|
|
2426
|
-
today: () => o(q.tz(e)),
|
|
2427
|
-
newDate: (i, u, d) => new q(i, u, d, 12, 0, 0, e),
|
|
2428
|
-
startOfDay: (i) => o(i),
|
|
2429
|
-
startOfWeek: (i, u) => {
|
|
2430
|
-
const d = o(i), f = (u == null ? void 0 : u.weekStartsOn) ?? a, h = (d.getDay() - f + 7) % 7;
|
|
2431
|
-
return d.setDate(d.getDate() - h), d;
|
|
2432
|
-
},
|
|
2433
|
-
startOfISOWeek: (i) => {
|
|
2434
|
-
const u = o(i), d = (u.getDay() - 1 + 7) % 7;
|
|
2435
|
-
return u.setDate(u.getDate() - d), u;
|
|
2436
|
-
},
|
|
2437
|
-
startOfMonth: (i) => {
|
|
2438
|
-
const u = o(i);
|
|
2439
|
-
return u.setDate(1), u;
|
|
2440
|
-
},
|
|
2441
|
-
startOfYear: (i) => {
|
|
2442
|
-
const u = o(i);
|
|
2443
|
-
return u.setMonth(0, 1), u;
|
|
2444
|
-
},
|
|
2445
|
-
endOfWeek: (i, u) => {
|
|
2446
|
-
const d = o(i), g = ((((u == null ? void 0 : u.weekStartsOn) ?? a) + 6) % 7 - d.getDay() + 7) % 7;
|
|
2447
|
-
return d.setDate(d.getDate() + g), d;
|
|
2448
|
-
},
|
|
2449
|
-
endOfISOWeek: (i) => {
|
|
2450
|
-
const u = o(i), d = (7 - u.getDay()) % 7;
|
|
2451
|
-
return u.setDate(u.getDate() + d), u;
|
|
2452
|
-
},
|
|
2453
|
-
endOfMonth: (i) => {
|
|
2454
|
-
const u = o(i);
|
|
2455
|
-
return u.setMonth(u.getMonth() + 1, 0), u;
|
|
2456
|
-
},
|
|
2457
|
-
endOfYear: (i) => {
|
|
2458
|
-
const u = o(i);
|
|
2459
|
-
return u.setMonth(11, 31), u;
|
|
2460
|
-
},
|
|
2461
|
-
eachMonthOfInterval: (i) => {
|
|
2462
|
-
const u = o(i.start), d = o(i.end), f = [], h = new q(u.getFullYear(), u.getMonth(), 1, 12, 0, 0, e), g = d.getFullYear() * 12 + d.getMonth();
|
|
2463
|
-
for (; h.getFullYear() * 12 + h.getMonth() <= g; )
|
|
2464
|
-
f.push(new q(h, e)), h.setMonth(h.getMonth() + 1, 1);
|
|
2465
|
-
return f;
|
|
2466
|
-
},
|
|
2467
|
-
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
2468
|
-
// mutate the same TZDate, and return it.
|
|
2469
|
-
addDays: (i, u) => {
|
|
2470
|
-
const d = o(i);
|
|
2471
|
-
return d.setDate(d.getDate() + u), d;
|
|
2472
|
-
},
|
|
2473
|
-
addWeeks: (i, u) => {
|
|
2474
|
-
const d = o(i);
|
|
2475
|
-
return d.setDate(d.getDate() + u * 7), d;
|
|
2476
|
-
},
|
|
2477
|
-
addMonths: (i, u) => {
|
|
2478
|
-
const d = o(i);
|
|
2479
|
-
return d.setMonth(d.getMonth() + u), d;
|
|
2480
|
-
},
|
|
2481
|
-
addYears: (i, u) => {
|
|
2482
|
-
const d = o(i);
|
|
2483
|
-
return d.setFullYear(d.getFullYear() + u), d;
|
|
2484
|
-
},
|
|
2485
|
-
eachYearOfInterval: (i) => {
|
|
2486
|
-
const u = o(i.start), d = o(i.end), f = [], h = new q(u.getFullYear(), 0, 1, 12, 0, 0, e);
|
|
2487
|
-
for (; h.getFullYear() <= d.getFullYear(); )
|
|
2488
|
-
f.push(new q(h, e)), h.setFullYear(h.getFullYear() + 1, 0, 1);
|
|
2489
|
-
return f;
|
|
2490
|
-
},
|
|
2491
|
-
getWeek: (i, u) => {
|
|
2492
|
-
var f;
|
|
2493
|
-
const d = s(i);
|
|
2494
|
-
return Le(d, {
|
|
2495
|
-
weekStartsOn: (u == null ? void 0 : u.weekStartsOn) ?? a,
|
|
2496
|
-
firstWeekContainsDate: (u == null ? void 0 : u.firstWeekContainsDate) ?? ((f = r == null ? void 0 : r.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1
|
|
2497
|
-
});
|
|
2498
|
-
},
|
|
2499
|
-
getISOWeek: (i) => {
|
|
2500
|
-
const u = s(i);
|
|
2501
|
-
return Ke(u);
|
|
2502
|
-
},
|
|
2503
|
-
differenceInCalendarDays: (i, u) => {
|
|
2504
|
-
const d = s(i), f = s(u);
|
|
2505
|
-
return Ze(d, f);
|
|
2506
|
-
},
|
|
2507
|
-
differenceInCalendarMonths: (i, u) => {
|
|
2508
|
-
const d = s(i), f = s(u);
|
|
2509
|
-
return Et(d, f);
|
|
2510
|
-
}
|
|
2511
|
-
};
|
|
2512
|
-
}
|
|
2513
|
-
const pe = (e) => e instanceof HTMLElement ? e : null, Ue = (e) => [
|
|
2514
|
-
...e.querySelectorAll("[data-animated-month]") ?? []
|
|
2515
|
-
], So = (e) => pe(e.querySelector("[data-animated-month]")), Qe = (e) => pe(e.querySelector("[data-animated-caption]")), Xe = (e) => pe(e.querySelector("[data-animated-weeks]")), po = (e) => pe(e.querySelector("[data-animated-nav]")), Co = (e) => pe(e.querySelector("[data-animated-weekdays]"));
|
|
2516
|
-
function xo(e, t, { classNames: n, months: r, focused: a, dateLib: o }) {
|
|
2517
|
-
const s = x.useRef(null), c = x.useRef(r), i = x.useRef(!1);
|
|
2518
|
-
x.useLayoutEffect(() => {
|
|
2519
|
-
const u = c.current;
|
|
2520
|
-
if (c.current = r, !t || !e.current || // safety check because the ref can be set to anything by consumers
|
|
2521
|
-
!(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
2522
|
-
r.length === 0 || u.length === 0 || r.length !== u.length)
|
|
2523
|
-
return;
|
|
2524
|
-
const d = o.isSameMonth(r[0].date, u[0].date), f = o.isAfter(r[0].date, u[0].date), h = f ? n[$.caption_after_enter] : n[$.caption_before_enter], g = f ? n[$.weeks_after_enter] : n[$.weeks_before_enter], v = s.current, N = e.current.cloneNode(!0);
|
|
2525
|
-
if (N instanceof HTMLElement ? (Ue(N).forEach((y) => {
|
|
2526
|
-
if (!(y instanceof HTMLElement))
|
|
2527
|
-
return;
|
|
2528
|
-
const p = So(y);
|
|
2529
|
-
p && y.contains(p) && y.removeChild(p);
|
|
2530
|
-
const D = Qe(y);
|
|
2531
|
-
D && D.classList.remove(h);
|
|
2532
|
-
const l = Xe(y);
|
|
2533
|
-
l && l.classList.remove(g);
|
|
2534
|
-
}), s.current = N) : s.current = null, i.current || d || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
|
|
2535
|
-
a)
|
|
2536
|
-
return;
|
|
2537
|
-
const k = v instanceof HTMLElement ? Ue(v) : [], M = Ue(e.current);
|
|
2538
|
-
if (M != null && M.every((O) => O instanceof HTMLElement) && k && k.every((O) => O instanceof HTMLElement)) {
|
|
2539
|
-
i.current = !0, e.current.style.isolation = "isolate";
|
|
2540
|
-
const O = po(e.current);
|
|
2541
|
-
O && (O.style.zIndex = "1"), M.forEach((y, p) => {
|
|
2542
|
-
const D = k[p];
|
|
2543
|
-
if (!D)
|
|
2544
|
-
return;
|
|
2545
|
-
y.style.position = "relative", y.style.overflow = "hidden";
|
|
2546
|
-
const l = Qe(y);
|
|
2547
|
-
l && l.classList.add(h);
|
|
2548
|
-
const S = Xe(y);
|
|
2549
|
-
S && S.classList.add(g);
|
|
2550
|
-
const F = () => {
|
|
2551
|
-
i.current = !1, e.current && (e.current.style.isolation = ""), O && (O.style.zIndex = ""), l && l.classList.remove(h), S && S.classList.remove(g), y.style.position = "", y.style.overflow = "", y.contains(D) && y.removeChild(D);
|
|
2552
|
-
};
|
|
2553
|
-
D.style.pointerEvents = "none", D.style.position = "absolute", D.style.overflow = "hidden", D.setAttribute("aria-hidden", "true");
|
|
2554
|
-
const H = Co(D);
|
|
2555
|
-
H && (H.style.opacity = "0");
|
|
2556
|
-
const B = Qe(D);
|
|
2557
|
-
B && (B.classList.add(f ? n[$.caption_before_exit] : n[$.caption_after_exit]), B.addEventListener("animationend", F));
|
|
2558
|
-
const G = Xe(D);
|
|
2559
|
-
G && G.classList.add(f ? n[$.weeks_before_exit] : n[$.weeks_after_exit]), y.insertBefore(D, y.firstChild);
|
|
2560
|
-
});
|
|
2561
|
-
}
|
|
2562
|
-
});
|
|
2563
|
-
}
|
|
2564
|
-
function Yo(e, t, n, r) {
|
|
2565
|
-
const a = e[0], o = e[e.length - 1], { ISOWeek: s, fixedWeeks: c, broadcastCalendar: i } = n ?? {}, { addDays: u, differenceInCalendarDays: d, differenceInCalendarMonths: f, endOfBroadcastWeek: h, endOfISOWeek: g, endOfMonth: v, endOfWeek: N, isAfter: k, startOfBroadcastWeek: M, startOfISOWeek: O, startOfWeek: y } = r, p = i ? M(a, r) : s ? O(a) : y(a), D = i ? h(o) : s ? g(v(o)) : N(v(o)), l = t && (i ? h(t) : s ? g(t) : N(t)), S = l && k(D, l) ? l : D, F = d(S, p), H = f(o, a) + 1, B = [];
|
|
2566
|
-
for (let te = 0; te <= F; te++) {
|
|
2567
|
-
const U = u(p, te);
|
|
2568
|
-
B.push(U);
|
|
2569
|
-
}
|
|
2570
|
-
const oe = (i ? 35 : 42) * H;
|
|
2571
|
-
if (c && B.length < oe) {
|
|
2572
|
-
const te = oe - B.length;
|
|
2573
|
-
for (let U = 0; U < te; U++) {
|
|
2574
|
-
const ue = u(B[B.length - 1], 1);
|
|
2575
|
-
B.push(ue);
|
|
2576
|
-
}
|
|
2577
|
-
}
|
|
2578
|
-
return B;
|
|
2579
|
-
}
|
|
2580
|
-
function To(e) {
|
|
2581
|
-
const t = [];
|
|
2582
|
-
return e.reduce((n, r) => {
|
|
2583
|
-
const a = r.weeks.reduce((o, s) => o.concat(s.days.slice()), t.slice());
|
|
2584
|
-
return n.concat(a.slice());
|
|
2585
|
-
}, t.slice());
|
|
2586
|
-
}
|
|
2587
|
-
function _o(e, t, n, r) {
|
|
2588
|
-
const { numberOfMonths: a = 1 } = n, o = [];
|
|
2589
|
-
for (let s = 0; s < a; s++) {
|
|
2590
|
-
const c = r.addMonths(e, s);
|
|
2591
|
-
if (t && c > t)
|
|
2592
|
-
break;
|
|
2593
|
-
o.push(c);
|
|
2594
|
-
}
|
|
2595
|
-
return o;
|
|
2596
|
-
}
|
|
2597
|
-
function Ot(e, t, n, r) {
|
|
2598
|
-
const { month: a, defaultMonth: o, today: s = r.today(), numberOfMonths: c = 1 } = e;
|
|
2599
|
-
let i = a || o || s;
|
|
2600
|
-
const { differenceInCalendarMonths: u, addMonths: d, startOfMonth: f } = r;
|
|
2601
|
-
if (n && u(n, i) < c - 1) {
|
|
2602
|
-
const h = -1 * (c - 1);
|
|
2603
|
-
i = d(n, h);
|
|
2604
|
-
}
|
|
2605
|
-
return t && u(i, t) < 0 && (i = t), f(i);
|
|
2606
|
-
}
|
|
2607
|
-
function Po(e, t, n, r) {
|
|
2608
|
-
const { addDays: a, endOfBroadcastWeek: o, endOfISOWeek: s, endOfMonth: c, endOfWeek: i, getISOWeek: u, getWeek: d, startOfBroadcastWeek: f, startOfISOWeek: h, startOfWeek: g } = r, v = e.reduce((N, k) => {
|
|
2609
|
-
const M = n.broadcastCalendar ? f(k, r) : n.ISOWeek ? h(k) : g(k), O = n.broadcastCalendar ? o(k) : n.ISOWeek ? s(c(k)) : i(c(k)), y = t.filter((S) => S >= M && S <= O), p = n.broadcastCalendar ? 35 : 42;
|
|
2610
|
-
if (n.fixedWeeks && y.length < p) {
|
|
2611
|
-
const S = t.filter((F) => {
|
|
2612
|
-
const H = p - y.length;
|
|
2613
|
-
return F > O && F <= a(O, H);
|
|
2614
|
-
});
|
|
2615
|
-
y.push(...S);
|
|
2616
|
-
}
|
|
2617
|
-
const D = y.reduce((S, F) => {
|
|
2618
|
-
const H = n.ISOWeek ? u(F) : d(F), B = S.find((oe) => oe.weekNumber === H), G = new Rt(F, k, r);
|
|
2619
|
-
return B ? B.days.push(G) : S.push(new Ca(H, [G])), S;
|
|
2620
|
-
}, []), l = new pa(k, D);
|
|
2621
|
-
return N.push(l), N;
|
|
2622
|
-
}, []);
|
|
2623
|
-
return n.reverseMonths ? v.reverse() : v;
|
|
2624
|
-
}
|
|
2625
|
-
function Eo(e, t) {
|
|
2626
|
-
let { startMonth: n, endMonth: r } = e;
|
|
2627
|
-
const { startOfYear: a, startOfDay: o, startOfMonth: s, endOfMonth: c, addYears: i, endOfYear: u, newDate: d, today: f } = t, { fromYear: h, toYear: g, fromMonth: v, toMonth: N } = e;
|
|
2628
|
-
!n && v && (n = v), !n && h && (n = t.newDate(h, 0, 1)), !r && N && (r = N), !r && g && (r = d(g, 11, 31));
|
|
2629
|
-
const k = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
|
|
2630
|
-
return n ? n = s(n) : h ? n = d(h, 0, 1) : !n && k && (n = a(i(e.today ?? f(), -100))), r ? r = c(r) : g ? r = d(g, 11, 31) : !r && k && (r = u(e.today ?? f())), [
|
|
2631
|
-
n && o(n),
|
|
2632
|
-
r && o(r)
|
|
2633
|
-
];
|
|
2634
|
-
}
|
|
2635
|
-
function Fo(e, t, n, r) {
|
|
2636
|
-
if (n.disableNavigation)
|
|
2637
|
-
return;
|
|
2638
|
-
const { pagedNavigation: a, numberOfMonths: o = 1 } = n, { startOfMonth: s, addMonths: c, differenceInCalendarMonths: i } = r, u = a ? o : 1, d = s(e);
|
|
2639
|
-
if (!t)
|
|
2640
|
-
return c(d, u);
|
|
2641
|
-
if (!(i(t, e) < o))
|
|
2642
|
-
return c(d, u);
|
|
2643
|
-
}
|
|
2644
|
-
function Io(e, t, n, r) {
|
|
2645
|
-
if (n.disableNavigation)
|
|
2646
|
-
return;
|
|
2647
|
-
const { pagedNavigation: a, numberOfMonths: o } = n, { startOfMonth: s, addMonths: c, differenceInCalendarMonths: i } = r, u = a ? o ?? 1 : 1, d = s(e);
|
|
2648
|
-
if (!t)
|
|
2649
|
-
return c(d, -u);
|
|
2650
|
-
if (!(i(d, t) <= 0))
|
|
2651
|
-
return c(d, -u);
|
|
2652
|
-
}
|
|
2653
|
-
function Bo(e) {
|
|
2654
|
-
const t = [];
|
|
2655
|
-
return e.reduce((n, r) => n.concat(r.weeks.slice()), t.slice());
|
|
2656
|
-
}
|
|
2657
|
-
function Fe(e, t) {
|
|
2658
|
-
const [n, r] = x.useState(e);
|
|
2659
|
-
return [t === void 0 ? n : t, r];
|
|
2660
|
-
}
|
|
2661
|
-
function jo(e, t) {
|
|
2662
|
-
var p;
|
|
2663
|
-
const [n, r] = Eo(e, t), { startOfMonth: a, endOfMonth: o } = t, s = Ot(e, n, r, t), [c, i] = Fe(
|
|
2664
|
-
s,
|
|
2665
|
-
// initialMonth is always computed from props.month if provided
|
|
2666
|
-
e.month ? s : void 0
|
|
2667
|
-
);
|
|
2668
|
-
x.useEffect(() => {
|
|
2669
|
-
const D = Ot(e, n, r, t);
|
|
2670
|
-
i(D);
|
|
2671
|
-
}, [e.timeZone]);
|
|
2672
|
-
const { months: u, weeks: d, days: f, previousMonth: h, nextMonth: g } = x.useMemo(() => {
|
|
2673
|
-
const D = _o(c, r, { numberOfMonths: e.numberOfMonths }, t), l = Yo(D, e.endMonth ? o(e.endMonth) : void 0, {
|
|
2674
|
-
ISOWeek: e.ISOWeek,
|
|
2675
|
-
fixedWeeks: e.fixedWeeks,
|
|
2676
|
-
broadcastCalendar: e.broadcastCalendar
|
|
2677
|
-
}, t), S = Po(D, l, {
|
|
2678
|
-
broadcastCalendar: e.broadcastCalendar,
|
|
2679
|
-
fixedWeeks: e.fixedWeeks,
|
|
2680
|
-
ISOWeek: e.ISOWeek,
|
|
2681
|
-
reverseMonths: e.reverseMonths
|
|
2682
|
-
}, t), F = Bo(S), H = To(S), B = Io(c, n, e, t), G = Fo(c, r, e, t);
|
|
2683
|
-
return {
|
|
2684
|
-
months: S,
|
|
2685
|
-
weeks: F,
|
|
2686
|
-
days: H,
|
|
2687
|
-
previousMonth: B,
|
|
2688
|
-
nextMonth: G
|
|
2689
|
-
};
|
|
2690
|
-
}, [
|
|
2691
|
-
t,
|
|
2692
|
-
c.getTime(),
|
|
2693
|
-
r == null ? void 0 : r.getTime(),
|
|
2694
|
-
n == null ? void 0 : n.getTime(),
|
|
2695
|
-
e.disableNavigation,
|
|
2696
|
-
e.broadcastCalendar,
|
|
2697
|
-
(p = e.endMonth) == null ? void 0 : p.getTime(),
|
|
2698
|
-
e.fixedWeeks,
|
|
2699
|
-
e.ISOWeek,
|
|
2700
|
-
e.numberOfMonths,
|
|
2701
|
-
e.pagedNavigation,
|
|
2702
|
-
e.reverseMonths
|
|
2703
|
-
]), { disableNavigation: v, onMonthChange: N } = e, k = (D) => d.some((l) => l.days.some((S) => S.isEqualTo(D))), M = (D) => {
|
|
2704
|
-
if (v)
|
|
2705
|
-
return;
|
|
2706
|
-
let l = a(D);
|
|
2707
|
-
n && l < a(n) && (l = a(n)), r && l > a(r) && (l = a(r)), i(l), N == null || N(l);
|
|
2708
|
-
};
|
|
2709
|
-
return {
|
|
2710
|
-
months: u,
|
|
2711
|
-
weeks: d,
|
|
2712
|
-
days: f,
|
|
2713
|
-
navStart: n,
|
|
2714
|
-
navEnd: r,
|
|
2715
|
-
previousMonth: h,
|
|
2716
|
-
nextMonth: g,
|
|
2717
|
-
goToMonth: M,
|
|
2718
|
-
goToDay: (D) => {
|
|
2719
|
-
k(D) || M(D.date);
|
|
2720
|
-
}
|
|
2721
|
-
};
|
|
2722
|
-
}
|
|
2723
|
-
var K;
|
|
2724
|
-
(function(e) {
|
|
2725
|
-
e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
|
|
2726
|
-
})(K || (K = {}));
|
|
2727
|
-
function vt(e) {
|
|
2728
|
-
return !e[I.disabled] && !e[I.hidden] && !e[I.outside];
|
|
2729
|
-
}
|
|
2730
|
-
function Ho(e, t, n, r) {
|
|
2731
|
-
let a, o = -1;
|
|
2732
|
-
for (const s of e) {
|
|
2733
|
-
const c = t(s);
|
|
2734
|
-
vt(c) && (c[I.focused] && o < K.FocusedModifier ? (a = s, o = K.FocusedModifier) : r != null && r.isEqualTo(s) && o < K.LastFocused ? (a = s, o = K.LastFocused) : n(s.date) && o < K.Selected ? (a = s, o = K.Selected) : c[I.today] && o < K.Today && (a = s, o = K.Today));
|
|
2735
|
-
}
|
|
2736
|
-
return a || (a = e.find((s) => vt(t(s)))), a;
|
|
2737
|
-
}
|
|
2738
|
-
function Ao(e, t, n, r, a, o, s) {
|
|
2739
|
-
const { ISOWeek: c, broadcastCalendar: i } = o, { addDays: u, addMonths: d, addWeeks: f, addYears: h, endOfBroadcastWeek: g, endOfISOWeek: v, endOfWeek: N, max: k, min: M, startOfBroadcastWeek: O, startOfISOWeek: y, startOfWeek: p } = s;
|
|
2740
|
-
let l = {
|
|
2741
|
-
day: u,
|
|
2742
|
-
week: f,
|
|
2743
|
-
month: d,
|
|
2744
|
-
year: h,
|
|
2745
|
-
startOfWeek: (S) => i ? O(S, s) : c ? y(S) : p(S),
|
|
2746
|
-
endOfWeek: (S) => i ? g(S) : c ? v(S) : N(S)
|
|
2747
|
-
}[e](n, t === "after" ? 1 : -1);
|
|
2748
|
-
return t === "before" && r ? l = k([r, l]) : t === "after" && a && (l = M([a, l])), l;
|
|
2749
|
-
}
|
|
2750
|
-
function on(e, t, n, r, a, o, s, c = 0) {
|
|
2751
|
-
if (c > 365)
|
|
2752
|
-
return;
|
|
2753
|
-
const i = Ao(e, t, n.date, r, a, o, s), u = !!(o.disabled && ae(i, o.disabled, s)), d = !!(o.hidden && ae(i, o.hidden, s)), f = i, h = new Rt(i, f, s);
|
|
2754
|
-
return !u && !d ? h : on(e, t, h, r, a, o, s, c + 1);
|
|
2755
|
-
}
|
|
2756
|
-
function qo(e, t, n, r, a) {
|
|
2757
|
-
const { autoFocus: o } = e, [s, c] = x.useState(), i = Ho(t.days, n, r || (() => !1), s), [u, d] = x.useState(o ? i : void 0);
|
|
2758
|
-
return {
|
|
2759
|
-
isFocusTarget: (N) => !!(i != null && i.isEqualTo(N)),
|
|
2760
|
-
setFocused: d,
|
|
2761
|
-
focused: u,
|
|
2762
|
-
blur: () => {
|
|
2763
|
-
c(u), d(void 0);
|
|
2764
|
-
},
|
|
2765
|
-
moveFocus: (N, k) => {
|
|
2766
|
-
if (!u)
|
|
2767
|
-
return;
|
|
2768
|
-
const M = on(N, k, u, t.navStart, t.navEnd, e, a);
|
|
2769
|
-
M && (e.disableNavigation && !t.days.some((y) => y.isEqualTo(M)) || (t.goToDay(M), d(M)));
|
|
2770
|
-
}
|
|
2771
|
-
};
|
|
2772
|
-
}
|
|
2773
|
-
function zo(e, t) {
|
|
2774
|
-
const { selected: n, required: r, onSelect: a } = e, [o, s] = Fe(n, a ? n : void 0), c = a ? n : o, { isSameDay: i } = t, u = (g) => (c == null ? void 0 : c.some((v) => i(v, g))) ?? !1, { min: d, max: f } = e;
|
|
2775
|
-
return {
|
|
2776
|
-
selected: c,
|
|
2777
|
-
select: (g, v, N) => {
|
|
2778
|
-
let k = [...c ?? []];
|
|
2779
|
-
if (u(g)) {
|
|
2780
|
-
if ((c == null ? void 0 : c.length) === d || r && (c == null ? void 0 : c.length) === 1)
|
|
2781
|
-
return;
|
|
2782
|
-
k = c == null ? void 0 : c.filter((M) => !i(M, g));
|
|
2783
|
-
} else
|
|
2784
|
-
(c == null ? void 0 : c.length) === f ? k = [g] : k = [...k, g];
|
|
2785
|
-
return a || s(k), a == null || a(k, g, v, N), k;
|
|
2786
|
-
},
|
|
2787
|
-
isSelected: u
|
|
2788
|
-
};
|
|
2789
|
-
}
|
|
2790
|
-
function $o(e, t, n = 0, r = 0, a = !1, o = ee) {
|
|
2791
|
-
const { from: s, to: c } = t || {}, { isSameDay: i, isAfter: u, isBefore: d } = o;
|
|
2792
|
-
let f;
|
|
2793
|
-
if (!s && !c)
|
|
2794
|
-
f = { from: e, to: n > 0 ? void 0 : e };
|
|
2795
|
-
else if (s && !c)
|
|
2796
|
-
i(s, e) ? n === 0 ? f = { from: s, to: e } : a ? f = { from: s, to: void 0 } : f = void 0 : d(e, s) ? f = { from: e, to: s } : f = { from: s, to: e };
|
|
2797
|
-
else if (s && c)
|
|
2798
|
-
if (i(s, e) && i(c, e))
|
|
2799
|
-
a ? f = { from: s, to: c } : f = void 0;
|
|
2800
|
-
else if (i(s, e))
|
|
2801
|
-
f = { from: s, to: n > 0 ? void 0 : e };
|
|
2802
|
-
else if (i(c, e))
|
|
2803
|
-
f = { from: e, to: n > 0 ? void 0 : e };
|
|
2804
|
-
else if (d(e, s))
|
|
2805
|
-
f = { from: e, to: c };
|
|
2806
|
-
else if (u(e, s))
|
|
2807
|
-
f = { from: s, to: e };
|
|
2808
|
-
else if (u(e, c))
|
|
2809
|
-
f = { from: s, to: e };
|
|
2810
|
-
else
|
|
2811
|
-
throw new Error("Invalid range");
|
|
2812
|
-
if (f != null && f.from && (f != null && f.to)) {
|
|
2813
|
-
const h = o.differenceInCalendarDays(f.to, f.from);
|
|
2814
|
-
r > 0 && h > r ? f = { from: e, to: void 0 } : n > 1 && h < n && (f = { from: e, to: void 0 });
|
|
2815
|
-
}
|
|
2816
|
-
return f;
|
|
2817
|
-
}
|
|
2818
|
-
function Ro(e, t, n = ee) {
|
|
2819
|
-
const r = Array.isArray(t) ? t : [t];
|
|
2820
|
-
let a = e.from;
|
|
2821
|
-
const o = n.differenceInCalendarDays(e.to, e.from), s = Math.min(o, 6);
|
|
2822
|
-
for (let c = 0; c <= s; c++) {
|
|
2823
|
-
if (r.includes(a.getDay()))
|
|
2824
|
-
return !0;
|
|
2825
|
-
a = n.addDays(a, 1);
|
|
2826
|
-
}
|
|
2827
|
-
return !1;
|
|
2828
|
-
}
|
|
2829
|
-
function Wt(e, t, n = ee) {
|
|
2830
|
-
return re(e, t.from, !1, n) || re(e, t.to, !1, n) || re(t, e.from, !1, n) || re(t, e.to, !1, n);
|
|
2831
|
-
}
|
|
2832
|
-
function Go(e, t, n = ee) {
|
|
2833
|
-
const r = Array.isArray(t) ? t : [t];
|
|
2834
|
-
if (r.filter((c) => typeof c != "function").some((c) => typeof c == "boolean" ? c : n.isDate(c) ? re(e, c, !1, n) : Qt(c, n) ? c.some((i) => re(e, i, !1, n)) : Ee(c) ? c.from && c.to ? Wt(e, { from: c.from, to: c.to }, n) : !1 : Ut(c) ? Ro(e, c.dayOfWeek, n) : et(c) ? n.isAfter(c.before, c.after) ? Wt(e, {
|
|
2835
|
-
from: n.addDays(c.after, 1),
|
|
2836
|
-
to: n.addDays(c.before, -1)
|
|
2837
|
-
}, n) : ae(e.from, c, n) || ae(e.to, c, n) : tt(c) || nt(c) ? ae(e.from, c, n) || ae(e.to, c, n) : !1))
|
|
2838
|
-
return !0;
|
|
2839
|
-
const s = r.filter((c) => typeof c == "function");
|
|
2840
|
-
if (s.length) {
|
|
2841
|
-
let c = e.from;
|
|
2842
|
-
const i = n.differenceInCalendarDays(e.to, e.from);
|
|
2843
|
-
for (let u = 0; u <= i; u++) {
|
|
2844
|
-
if (s.some((d) => d(c)))
|
|
2845
|
-
return !0;
|
|
2846
|
-
c = n.addDays(c, 1);
|
|
2847
|
-
}
|
|
2848
|
-
}
|
|
2849
|
-
return !1;
|
|
2850
|
-
}
|
|
2851
|
-
function Uo(e, t) {
|
|
2852
|
-
const { disabled: n, excludeDisabled: r, selected: a, required: o, onSelect: s } = e, [c, i] = Fe(a, s ? a : void 0), u = s ? a : c;
|
|
2853
|
-
return {
|
|
2854
|
-
selected: u,
|
|
2855
|
-
select: (h, g, v) => {
|
|
2856
|
-
const { min: N, max: k } = e, M = h ? $o(h, u, N, k, o, t) : void 0;
|
|
2857
|
-
return r && n && (M != null && M.from) && M.to && Go({ from: M.from, to: M.to }, n, t) && (M.from = h, M.to = void 0), s || i(M), s == null || s(M, h, g, v), M;
|
|
2858
|
-
},
|
|
2859
|
-
isSelected: (h) => u && re(u, h, !1, t)
|
|
2860
|
-
};
|
|
2861
|
-
}
|
|
2862
|
-
function Qo(e, t) {
|
|
2863
|
-
const { selected: n, required: r, onSelect: a } = e, [o, s] = Fe(n, a ? n : void 0), c = a ? n : o, { isSameDay: i } = t;
|
|
2864
|
-
return {
|
|
2865
|
-
selected: c,
|
|
2866
|
-
select: (f, h, g) => {
|
|
2867
|
-
let v = f;
|
|
2868
|
-
return !r && c && c && i(f, c) && (v = void 0), a || s(v), a == null || a(v, f, h, g), v;
|
|
2869
|
-
},
|
|
2870
|
-
isSelected: (f) => c ? i(c, f) : !1
|
|
2871
|
-
};
|
|
2872
|
-
}
|
|
2873
|
-
function Xo(e, t) {
|
|
2874
|
-
const n = Qo(e, t), r = zo(e, t), a = Uo(e, t);
|
|
2875
|
-
switch (e.mode) {
|
|
2876
|
-
case "single":
|
|
2877
|
-
return n;
|
|
2878
|
-
case "multiple":
|
|
2879
|
-
return r;
|
|
2880
|
-
case "range":
|
|
2881
|
-
return a;
|
|
2882
|
-
default:
|
|
2883
|
-
return;
|
|
2884
|
-
}
|
|
2885
|
-
}
|
|
2886
|
-
function Q(e, t) {
|
|
2887
|
-
return e instanceof q && e.timeZone === t ? e : new q(e, t);
|
|
2888
|
-
}
|
|
2889
|
-
function fe(e, t, n) {
|
|
2890
|
-
return Q(e, t);
|
|
2891
|
-
}
|
|
2892
|
-
function Nt(e, t, n) {
|
|
2893
|
-
return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? fe(e, t) : Array.isArray(e) ? e.map((r) => r instanceof Date ? fe(r, t) : r) : Ee(e) ? {
|
|
2894
|
-
...e,
|
|
2895
|
-
from: e.from ? Q(e.from, t) : e.from,
|
|
2896
|
-
to: e.to ? Q(e.to, t) : e.to
|
|
2897
|
-
} : et(e) ? {
|
|
2898
|
-
before: fe(e.before, t),
|
|
2899
|
-
after: fe(e.after, t)
|
|
2900
|
-
} : tt(e) ? {
|
|
2901
|
-
after: fe(e.after, t)
|
|
2902
|
-
} : nt(e) ? {
|
|
2903
|
-
before: fe(e.before, t)
|
|
2904
|
-
} : e;
|
|
2905
|
-
}
|
|
2906
|
-
function Ve(e, t, n) {
|
|
2907
|
-
return e && (Array.isArray(e) ? e.map((r) => Nt(r, t)) : Nt(e, t));
|
|
2908
|
-
}
|
|
2909
|
-
function Vo(e) {
|
|
2910
|
-
var ft;
|
|
2911
|
-
let t = e;
|
|
2912
|
-
const n = t.timeZone;
|
|
2913
|
-
if (n && (t = {
|
|
2914
|
-
...e,
|
|
2915
|
-
timeZone: n
|
|
2916
|
-
}, t.today && (t.today = Q(t.today, n)), t.month && (t.month = Q(t.month, n)), t.defaultMonth && (t.defaultMonth = Q(t.defaultMonth, n)), t.startMonth && (t.startMonth = Q(t.startMonth, n)), t.endMonth && (t.endMonth = Q(t.endMonth, n)), t.mode === "single" && t.selected ? t.selected = Q(t.selected, n) : t.mode === "multiple" && t.selected ? t.selected = (ft = t.selected) == null ? void 0 : ft.map((W) => Q(W, n)) : t.mode === "range" && t.selected && (t.selected = {
|
|
2917
|
-
from: t.selected.from ? Q(t.selected.from, n) : t.selected.from,
|
|
2918
|
-
to: t.selected.to ? Q(t.selected.to, n) : t.selected.to
|
|
2919
|
-
}), t.disabled !== void 0 && (t.disabled = Ve(t.disabled, n)), t.hidden !== void 0 && (t.hidden = Ve(t.hidden, n)), t.modifiers)) {
|
|
2920
|
-
const W = {};
|
|
2921
|
-
Object.keys(t.modifiers).forEach((_) => {
|
|
2922
|
-
var b;
|
|
2923
|
-
W[_] = Ve((b = t.modifiers) == null ? void 0 : b[_], n);
|
|
2924
|
-
}), t.modifiers = W;
|
|
2925
|
-
}
|
|
2926
|
-
const { components: r, formatters: a, labels: o, dateLib: s, locale: c, classNames: i } = x.useMemo(() => {
|
|
2927
|
-
const W = { ...$t, ...t.locale }, _ = t.broadcastCalendar ? 1 : t.weekStartsOn, b = t.noonSafe && t.timeZone ? No(t.timeZone, {
|
|
2928
|
-
weekStartsOn: _,
|
|
2929
|
-
locale: W
|
|
2930
|
-
}) : void 0, T = t.dateLib && b ? { ...b, ...t.dateLib } : t.dateLib ?? b, z = new R({
|
|
2931
|
-
locale: W,
|
|
2932
|
-
weekStartsOn: _,
|
|
2933
|
-
firstWeekContainsDate: t.firstWeekContainsDate,
|
|
2934
|
-
useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
|
|
2935
|
-
useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
|
|
2936
|
-
timeZone: t.timeZone,
|
|
2937
|
-
numerals: t.numerals
|
|
2938
|
-
}, T);
|
|
2939
|
-
return {
|
|
2940
|
-
dateLib: z,
|
|
2941
|
-
components: ao(t.components),
|
|
2942
|
-
formatters: yo(t.formatters),
|
|
2943
|
-
labels: Do(t.labels, z.options),
|
|
2944
|
-
locale: W,
|
|
2945
|
-
classNames: { ...rt(), ...t.classNames }
|
|
2946
|
-
};
|
|
2947
|
-
}, [
|
|
2948
|
-
t.locale,
|
|
2949
|
-
t.broadcastCalendar,
|
|
2950
|
-
t.weekStartsOn,
|
|
2951
|
-
t.firstWeekContainsDate,
|
|
2952
|
-
t.useAdditionalWeekYearTokens,
|
|
2953
|
-
t.useAdditionalDayOfYearTokens,
|
|
2954
|
-
t.timeZone,
|
|
2955
|
-
t.numerals,
|
|
2956
|
-
t.dateLib,
|
|
2957
|
-
t.noonSafe,
|
|
2958
|
-
t.components,
|
|
2959
|
-
t.formatters,
|
|
2960
|
-
t.labels,
|
|
2961
|
-
t.classNames
|
|
2962
|
-
]);
|
|
2963
|
-
t.today || (t = { ...t, today: s.today() });
|
|
2964
|
-
const { captionLayout: u, mode: d, navLayout: f, numberOfMonths: h = 1, onDayBlur: g, onDayClick: v, onDayFocus: N, onDayKeyDown: k, onDayMouseEnter: M, onDayMouseLeave: O, onNextClick: y, onPrevClick: p, showWeekNumber: D, styles: l } = t, { formatCaption: S, formatDay: F, formatMonthDropdown: H, formatWeekNumber: B, formatWeekNumberHeader: G, formatWeekdayName: oe, formatYearDropdown: te } = a, U = jo(t, s), { days: ue, months: Ce, navStart: Ie, navEnd: Be, previousMonth: X, nextMonth: V, goToMonth: ne } = U, je = no(ue, t, Ie, Be, s), { isSelected: ge, select: we, selected: xe } = Xo(t, s) ?? {}, { blur: st, focused: Ye, isFocusTarget: sn, moveFocus: it, setFocused: Te } = qo(t, U, je, ge ?? (() => !1), s), { labelDayButton: cn, labelGridcell: un, labelGrid: dn, labelMonthDropdown: fn, labelNav: ct, labelPrevious: ln, labelNext: hn, labelWeekday: mn, labelWeekNumber: yn, labelWeekNumberHeader: gn, labelYearDropdown: wn } = o, bn = x.useMemo(() => vo(s, t.ISOWeek, t.broadcastCalendar, t.today), [s, t.ISOWeek, t.broadcastCalendar, t.today]), ut = d !== void 0 || v !== void 0, He = x.useCallback(() => {
|
|
2965
|
-
X && (ne(X), p == null || p(X));
|
|
2966
|
-
}, [X, ne, p]), Ae = x.useCallback(() => {
|
|
2967
|
-
V && (ne(V), y == null || y(V));
|
|
2968
|
-
}, [ne, V, y]), Mn = x.useCallback((W, _) => (b) => {
|
|
2969
|
-
b.preventDefault(), b.stopPropagation(), Te(W), !_.disabled && (we == null || we(W.date, _, b), v == null || v(W.date, _, b));
|
|
2970
|
-
}, [we, v, Te]), Dn = x.useCallback((W, _) => (b) => {
|
|
2971
|
-
Te(W), N == null || N(W.date, _, b);
|
|
2972
|
-
}, [N, Te]), kn = x.useCallback((W, _) => (b) => {
|
|
2973
|
-
st(), g == null || g(W.date, _, b);
|
|
2974
|
-
}, [st, g]), On = x.useCallback((W, _) => (b) => {
|
|
2975
|
-
const T = {
|
|
2976
|
-
ArrowLeft: [
|
|
2977
|
-
b.shiftKey ? "month" : "day",
|
|
2978
|
-
t.dir === "rtl" ? "after" : "before"
|
|
2979
|
-
],
|
|
2980
|
-
ArrowRight: [
|
|
2981
|
-
b.shiftKey ? "month" : "day",
|
|
2982
|
-
t.dir === "rtl" ? "before" : "after"
|
|
2983
|
-
],
|
|
2984
|
-
ArrowDown: [b.shiftKey ? "year" : "week", "after"],
|
|
2985
|
-
ArrowUp: [b.shiftKey ? "year" : "week", "before"],
|
|
2986
|
-
PageUp: [b.shiftKey ? "year" : "month", "before"],
|
|
2987
|
-
PageDown: [b.shiftKey ? "year" : "month", "after"],
|
|
2988
|
-
Home: ["startOfWeek", "before"],
|
|
2989
|
-
End: ["endOfWeek", "after"]
|
|
2990
|
-
};
|
|
2991
|
-
if (T[b.key]) {
|
|
2992
|
-
b.preventDefault(), b.stopPropagation();
|
|
2993
|
-
const [z, C] = T[b.key];
|
|
2994
|
-
it(z, C);
|
|
2995
|
-
}
|
|
2996
|
-
k == null || k(W.date, _, b);
|
|
2997
|
-
}, [it, k, t.dir]), vn = x.useCallback((W, _) => (b) => {
|
|
2998
|
-
M == null || M(W.date, _, b);
|
|
2999
|
-
}, [M]), Wn = x.useCallback((W, _) => (b) => {
|
|
3000
|
-
O == null || O(W.date, _, b);
|
|
3001
|
-
}, [O]), Nn = x.useCallback((W) => (_) => {
|
|
3002
|
-
const b = Number(_.target.value), T = s.setMonth(s.startOfMonth(W), b);
|
|
3003
|
-
ne(T);
|
|
3004
|
-
}, [s, ne]), Sn = x.useCallback((W) => (_) => {
|
|
3005
|
-
const b = Number(_.target.value), T = s.setYear(s.startOfMonth(W), b);
|
|
3006
|
-
ne(T);
|
|
3007
|
-
}, [s, ne]), { className: pn, style: Cn } = x.useMemo(() => ({
|
|
3008
|
-
className: [i[w.Root], t.className].filter(Boolean).join(" "),
|
|
3009
|
-
style: { ...l == null ? void 0 : l[w.Root], ...t.style }
|
|
3010
|
-
}), [i, t.className, t.style, l]), xn = oo(t), dt = x.useRef(null);
|
|
3011
|
-
xo(dt, !!t.animate, {
|
|
3012
|
-
classNames: i,
|
|
3013
|
-
months: Ce,
|
|
3014
|
-
focused: Ye,
|
|
3015
|
-
dateLib: s
|
|
3016
|
-
});
|
|
3017
|
-
const Yn = {
|
|
3018
|
-
dayPickerProps: t,
|
|
3019
|
-
selected: xe,
|
|
3020
|
-
select: we,
|
|
3021
|
-
isSelected: ge,
|
|
3022
|
-
months: Ce,
|
|
3023
|
-
nextMonth: V,
|
|
3024
|
-
previousMonth: X,
|
|
3025
|
-
goToMonth: ne,
|
|
3026
|
-
getModifiers: je,
|
|
3027
|
-
components: r,
|
|
3028
|
-
classNames: i,
|
|
3029
|
-
styles: l,
|
|
3030
|
-
labels: o,
|
|
3031
|
-
formatters: a
|
|
3032
|
-
};
|
|
3033
|
-
return m.createElement(
|
|
3034
|
-
Gt.Provider,
|
|
3035
|
-
{ value: Yn },
|
|
3036
|
-
m.createElement(
|
|
3037
|
-
r.Root,
|
|
3038
|
-
{ rootRef: t.animate ? dt : void 0, className: pn, style: Cn, dir: t.dir, id: t.id, lang: t.lang, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...xn },
|
|
3039
|
-
m.createElement(
|
|
3040
|
-
r.Months,
|
|
3041
|
-
{ className: i[w.Months], style: l == null ? void 0 : l[w.Months] },
|
|
3042
|
-
!t.hideNavigation && !f && m.createElement(r.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: i[w.Nav], style: l == null ? void 0 : l[w.Nav], "aria-label": ct(), onPreviousClick: He, onNextClick: Ae, previousMonth: X, nextMonth: V }),
|
|
3043
|
-
Ce.map((W, _) => m.createElement(
|
|
3044
|
-
r.Month,
|
|
3045
|
-
{
|
|
3046
|
-
"data-animated-month": t.animate ? "true" : void 0,
|
|
3047
|
-
className: i[w.Month],
|
|
3048
|
-
style: l == null ? void 0 : l[w.Month],
|
|
3049
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
|
|
3050
|
-
key: _,
|
|
3051
|
-
displayIndex: _,
|
|
3052
|
-
calendarMonth: W
|
|
3053
|
-
},
|
|
3054
|
-
f === "around" && !t.hideNavigation && _ === 0 && m.createElement(
|
|
3055
|
-
r.PreviousMonthButton,
|
|
3056
|
-
{ type: "button", className: i[w.PreviousMonthButton], tabIndex: X ? void 0 : -1, "aria-disabled": X ? void 0 : !0, "aria-label": ln(X), onClick: He, "data-animated-button": t.animate ? "true" : void 0 },
|
|
3057
|
-
m.createElement(r.Chevron, { disabled: X ? void 0 : !0, className: i[w.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
|
|
3058
|
-
),
|
|
3059
|
-
m.createElement(r.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: i[w.MonthCaption], style: l == null ? void 0 : l[w.MonthCaption], calendarMonth: W, displayIndex: _ }, u != null && u.startsWith("dropdown") ? m.createElement(
|
|
3060
|
-
r.DropdownNav,
|
|
3061
|
-
{ className: i[w.Dropdowns], style: l == null ? void 0 : l[w.Dropdowns] },
|
|
3062
|
-
(() => {
|
|
3063
|
-
const b = u === "dropdown" || u === "dropdown-months" ? m.createElement(r.MonthsDropdown, { key: "month", className: i[w.MonthsDropdown], "aria-label": fn(), classNames: i, components: r, disabled: !!t.disableNavigation, onChange: Nn(W.date), options: ko(W.date, Ie, Be, a, s), style: l == null ? void 0 : l[w.Dropdown], value: s.getMonth(W.date) }) : m.createElement("span", { key: "month" }, H(W.date, s)), T = u === "dropdown" || u === "dropdown-years" ? m.createElement(r.YearsDropdown, { key: "year", className: i[w.YearsDropdown], "aria-label": wn(s.options), classNames: i, components: r, disabled: !!t.disableNavigation, onChange: Sn(W.date), options: Wo(Ie, Be, a, s, !!t.reverseYears), style: l == null ? void 0 : l[w.Dropdown], value: s.getYear(W.date) }) : m.createElement("span", { key: "year" }, te(W.date, s));
|
|
3064
|
-
return s.getMonthYearOrder() === "year-first" ? [T, b] : [b, T];
|
|
3065
|
-
})(),
|
|
3066
|
-
m.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
3067
|
-
border: 0,
|
|
3068
|
-
clip: "rect(0 0 0 0)",
|
|
3069
|
-
height: "1px",
|
|
3070
|
-
margin: "-1px",
|
|
3071
|
-
overflow: "hidden",
|
|
3072
|
-
padding: 0,
|
|
3073
|
-
position: "absolute",
|
|
3074
|
-
width: "1px",
|
|
3075
|
-
whiteSpace: "nowrap",
|
|
3076
|
-
wordWrap: "normal"
|
|
3077
|
-
} }, S(W.date, s.options, s))
|
|
3078
|
-
) : m.createElement(r.CaptionLabel, { className: i[w.CaptionLabel], role: "status", "aria-live": "polite" }, S(W.date, s.options, s))),
|
|
3079
|
-
f === "around" && !t.hideNavigation && _ === h - 1 && m.createElement(
|
|
3080
|
-
r.NextMonthButton,
|
|
3081
|
-
{ type: "button", className: i[w.NextMonthButton], tabIndex: V ? void 0 : -1, "aria-disabled": V ? void 0 : !0, "aria-label": hn(V), onClick: Ae, "data-animated-button": t.animate ? "true" : void 0 },
|
|
3082
|
-
m.createElement(r.Chevron, { disabled: V ? void 0 : !0, className: i[w.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
|
|
3083
|
-
),
|
|
3084
|
-
_ === h - 1 && f === "after" && !t.hideNavigation && m.createElement(r.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: i[w.Nav], style: l == null ? void 0 : l[w.Nav], "aria-label": ct(), onPreviousClick: He, onNextClick: Ae, previousMonth: X, nextMonth: V }),
|
|
3085
|
-
m.createElement(
|
|
3086
|
-
r.MonthGrid,
|
|
3087
|
-
{ role: "grid", "aria-multiselectable": d === "multiple" || d === "range", "aria-label": dn(W.date, s.options, s) || void 0, className: i[w.MonthGrid], style: l == null ? void 0 : l[w.MonthGrid] },
|
|
3088
|
-
!t.hideWeekdays && m.createElement(
|
|
3089
|
-
r.Weekdays,
|
|
3090
|
-
{ "data-animated-weekdays": t.animate ? "true" : void 0, className: i[w.Weekdays], style: l == null ? void 0 : l[w.Weekdays] },
|
|
3091
|
-
D && m.createElement(r.WeekNumberHeader, { "aria-label": gn(s.options), className: i[w.WeekNumberHeader], style: l == null ? void 0 : l[w.WeekNumberHeader], scope: "col" }, G()),
|
|
3092
|
-
bn.map((b) => m.createElement(r.Weekday, { "aria-label": mn(b, s.options, s), className: i[w.Weekday], key: String(b), style: l == null ? void 0 : l[w.Weekday], scope: "col" }, oe(b, s.options, s)))
|
|
3093
|
-
),
|
|
3094
|
-
m.createElement(r.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: i[w.Weeks], style: l == null ? void 0 : l[w.Weeks] }, W.weeks.map((b) => m.createElement(
|
|
3095
|
-
r.Week,
|
|
3096
|
-
{ className: i[w.Week], key: b.weekNumber, style: l == null ? void 0 : l[w.Week], week: b },
|
|
3097
|
-
D && m.createElement(r.WeekNumber, { week: b, style: l == null ? void 0 : l[w.WeekNumber], "aria-label": yn(b.weekNumber, {
|
|
3098
|
-
locale: c
|
|
3099
|
-
}), className: i[w.WeekNumber], scope: "row", role: "rowheader" }, B(b.weekNumber, s)),
|
|
3100
|
-
b.days.map((T) => {
|
|
3101
|
-
const { date: z } = T, C = je(T);
|
|
3102
|
-
if (C[I.focused] = !C.hidden && !!(Ye != null && Ye.isEqualTo(T)), C[Z.selected] = (ge == null ? void 0 : ge(z)) || C.selected, Ee(xe)) {
|
|
3103
|
-
const { from: qe, to: ze } = xe;
|
|
3104
|
-
C[Z.range_start] = !!(qe && ze && s.isSameDay(z, qe)), C[Z.range_end] = !!(qe && ze && s.isSameDay(z, ze)), C[Z.range_middle] = re(xe, z, !0, s);
|
|
3105
|
-
}
|
|
3106
|
-
const Tn = Oo(C, l, t.modifiersStyles), _n = ro(C, i, t.modifiersClassNames), Pn = !ut && !C.hidden ? un(z, C, s.options, s) : void 0;
|
|
3107
|
-
return m.createElement(r.Day, { key: `${T.isoDate}_${T.displayMonthId}`, day: T, modifiers: C, className: _n.join(" "), style: Tn, role: "gridcell", "aria-selected": C.selected || void 0, "aria-label": Pn, "data-day": T.isoDate, "data-month": T.outside ? T.dateMonthId : void 0, "data-selected": C.selected || void 0, "data-disabled": C.disabled || void 0, "data-hidden": C.hidden || void 0, "data-outside": T.outside || void 0, "data-focused": C.focused || void 0, "data-today": C.today || void 0 }, !C.hidden && ut ? m.createElement(r.DayButton, { className: i[w.DayButton], style: l == null ? void 0 : l[w.DayButton], type: "button", day: T, modifiers: C, disabled: !C.focused && C.disabled || void 0, "aria-disabled": C.focused && C.disabled || void 0, tabIndex: sn(T) ? 0 : -1, "aria-label": cn(z, C, s.options, s), onClick: Mn(T, C), onBlur: kn(T, C), onFocus: Dn(T, C), onKeyDown: On(T, C), onMouseEnter: vn(T, C), onMouseLeave: Wn(T, C) }, F(z, s.options, s)) : !C.hidden && F(T.date, s.options, s));
|
|
3108
|
-
})
|
|
3109
|
-
)))
|
|
3110
|
-
)
|
|
3111
|
-
))
|
|
3112
|
-
),
|
|
3113
|
-
t.footer && m.createElement(r.Footer, { className: i[w.Footer], style: l == null ? void 0 : l[w.Footer], role: "status", "aria-live": "polite" }, t.footer)
|
|
3114
|
-
)
|
|
3115
|
-
);
|
|
3116
|
-
}
|
|
3117
|
-
function Pe({
|
|
3118
|
-
className: e,
|
|
3119
|
-
classNames: t,
|
|
3120
|
-
showOutsideDays: n = !0,
|
|
3121
|
-
captionLayout: r = "label",
|
|
3122
|
-
buttonVariant: a = "ghost",
|
|
3123
|
-
formatters: o,
|
|
3124
|
-
components: s,
|
|
3125
|
-
...c
|
|
3126
|
-
}) {
|
|
3127
|
-
const i = rt();
|
|
3128
|
-
return /* @__PURE__ */ A.jsx(
|
|
3129
|
-
Vo,
|
|
3130
|
-
{
|
|
3131
|
-
showOutsideDays: n,
|
|
3132
|
-
className: Y(
|
|
3133
|
-
"pf-calendar bg-background group/calendar [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
3134
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
3135
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
3136
|
-
e
|
|
3137
|
-
),
|
|
3138
|
-
captionLayout: r,
|
|
3139
|
-
formatters: {
|
|
3140
|
-
formatMonthDropdown: (u) => u.toLocaleString("default", { month: "short" }),
|
|
3141
|
-
...o
|
|
3142
|
-
},
|
|
3143
|
-
classNames: {
|
|
3144
|
-
root: Y("w-fit", i.root),
|
|
3145
|
-
months: Y(
|
|
3146
|
-
"relative flex flex-col gap-4 md:flex-row",
|
|
3147
|
-
i.months
|
|
3148
|
-
),
|
|
3149
|
-
month: Y("flex w-full flex-col gap-4", i.month),
|
|
3150
|
-
nav: Y(
|
|
3151
|
-
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
3152
|
-
i.nav
|
|
3153
|
-
),
|
|
3154
|
-
button_previous: Y(
|
|
3155
|
-
lt({ variant: a }),
|
|
3156
|
-
"h-[var(--cell-size)] w-[var(--cell-size)] select-none p-0 aria-disabled:opacity-50",
|
|
3157
|
-
i.button_previous
|
|
3158
|
-
),
|
|
3159
|
-
button_next: Y(
|
|
3160
|
-
lt({ variant: a }),
|
|
3161
|
-
"h-[var(--cell-size)] w-[var(--cell-size)] select-none p-0 aria-disabled:opacity-50",
|
|
3162
|
-
i.button_next
|
|
3163
|
-
),
|
|
3164
|
-
month_caption: Y(
|
|
3165
|
-
"flex h-[var(--cell-size)] w-full items-center justify-center px-[var(--cell-size)]",
|
|
3166
|
-
i.month_caption
|
|
3167
|
-
),
|
|
3168
|
-
dropdowns: Y(
|
|
3169
|
-
"flex h-[var(--cell-size)] w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
3170
|
-
i.dropdowns
|
|
3171
|
-
),
|
|
3172
|
-
dropdown_root: Y(
|
|
3173
|
-
"pf-calendar-dropdown-root shadow-xs relative rounded-md",
|
|
3174
|
-
i.dropdown_root
|
|
3175
|
-
),
|
|
3176
|
-
dropdown: Y(
|
|
3177
|
-
"bg-popover absolute inset-0 opacity-0",
|
|
3178
|
-
i.dropdown
|
|
3179
|
-
),
|
|
3180
|
-
caption_label: Y(
|
|
3181
|
-
"pf-calendar-caption-label select-none font-medium",
|
|
3182
|
-
r === "label" ? "text-sm" : "[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md text-sm [&>svg]:size-3.5",
|
|
3183
|
-
i.caption_label
|
|
3184
|
-
),
|
|
3185
|
-
table: "w-full border-collapse",
|
|
3186
|
-
weekdays: Y("flex", i.weekdays),
|
|
3187
|
-
weekday: Y(
|
|
3188
|
-
"text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",
|
|
3189
|
-
i.weekday
|
|
3190
|
-
),
|
|
3191
|
-
week: Y("mt-2 flex w-full", i.week),
|
|
3192
|
-
week_number_header: Y(
|
|
3193
|
-
"w-[var(--cell-size)] select-none",
|
|
3194
|
-
i.week_number_header
|
|
3195
|
-
),
|
|
3196
|
-
week_number: Y(
|
|
3197
|
-
"text-muted-foreground select-none text-[0.8rem]",
|
|
3198
|
-
i.week_number
|
|
3199
|
-
),
|
|
3200
|
-
day: Y(
|
|
3201
|
-
"group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",
|
|
3202
|
-
i.day
|
|
3203
|
-
),
|
|
3204
|
-
range_start: Y(
|
|
3205
|
-
"bg-accent rounded-l-md",
|
|
3206
|
-
i.range_start
|
|
3207
|
-
),
|
|
3208
|
-
range_middle: Y("rounded-none", i.range_middle),
|
|
3209
|
-
range_end: Y("bg-accent rounded-r-md", i.range_end),
|
|
3210
|
-
today: Y(
|
|
3211
|
-
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
3212
|
-
i.today
|
|
3213
|
-
),
|
|
3214
|
-
outside: Y(
|
|
3215
|
-
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
3216
|
-
i.outside
|
|
3217
|
-
),
|
|
3218
|
-
disabled: Y(
|
|
3219
|
-
"text-muted-foreground opacity-50",
|
|
3220
|
-
i.disabled
|
|
3221
|
-
),
|
|
3222
|
-
hidden: Y("invisible", i.hidden),
|
|
3223
|
-
...t
|
|
3224
|
-
},
|
|
3225
|
-
components: {
|
|
3226
|
-
Root: ({ className: u, rootRef: d, ...f }) => /* @__PURE__ */ A.jsx(
|
|
3227
|
-
"div",
|
|
3228
|
-
{
|
|
3229
|
-
"data-slot": "calendar",
|
|
3230
|
-
ref: d,
|
|
3231
|
-
className: Y(u),
|
|
3232
|
-
...f
|
|
3233
|
-
}
|
|
3234
|
-
),
|
|
3235
|
-
Chevron: ({ className: u, orientation: d, ...f }) => d === "left" ? /* @__PURE__ */ A.jsx(jn, { className: Y("size-4", u), ...f }) : d === "right" ? /* @__PURE__ */ A.jsx(
|
|
3236
|
-
Hn,
|
|
3237
|
-
{
|
|
3238
|
-
className: Y("size-4", u),
|
|
3239
|
-
...f
|
|
3240
|
-
}
|
|
3241
|
-
) : /* @__PURE__ */ A.jsx(St, { className: Y("size-4", u), ...f }),
|
|
3242
|
-
DayButton: Jo,
|
|
3243
|
-
WeekNumber: ({ children: u, ...d }) => /* @__PURE__ */ A.jsx("td", { ...d, children: /* @__PURE__ */ A.jsx("div", { className: "flex size-[var(--cell-size)] items-center justify-center text-center", children: u }) }),
|
|
3244
|
-
...s
|
|
3245
|
-
},
|
|
3246
|
-
...c
|
|
3247
|
-
}
|
|
3248
|
-
);
|
|
3249
|
-
}
|
|
3250
|
-
function Jo({
|
|
3251
|
-
className: e,
|
|
3252
|
-
day: t,
|
|
3253
|
-
modifiers: n,
|
|
3254
|
-
...r
|
|
3255
|
-
}) {
|
|
3256
|
-
const a = rt(), o = x.useRef(null);
|
|
3257
|
-
return x.useEffect(() => {
|
|
3258
|
-
var s;
|
|
3259
|
-
n.focused && ((s = o.current) == null || s.focus());
|
|
3260
|
-
}, [n.focused]), /* @__PURE__ */ A.jsx(
|
|
3261
|
-
En,
|
|
3262
|
-
{
|
|
3263
|
-
ref: o,
|
|
3264
|
-
variant: "ghost",
|
|
3265
|
-
size: "icon",
|
|
3266
|
-
"data-day": t.date.toLocaleDateString(),
|
|
3267
|
-
"data-selected-single": n.selected && !n.range_start && !n.range_end && !n.range_middle,
|
|
3268
|
-
"data-range-start": n.range_start,
|
|
3269
|
-
"data-range-end": n.range_end,
|
|
3270
|
-
"data-range-middle": n.range_middle,
|
|
3271
|
-
className: Y(
|
|
3272
|
-
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[var(--cell-size)] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",
|
|
3273
|
-
a.day,
|
|
3274
|
-
e
|
|
3275
|
-
),
|
|
3276
|
-
...r
|
|
3277
|
-
}
|
|
3278
|
-
);
|
|
3279
|
-
}
|
|
3280
|
-
function Lo({
|
|
3281
|
-
mode: e = "single",
|
|
3282
|
-
value: t,
|
|
3283
|
-
onSelect: n,
|
|
3284
|
-
className: r
|
|
3285
|
-
}) {
|
|
3286
|
-
const a = x.useMemo(() => {
|
|
3287
|
-
if (t) {
|
|
3288
|
-
if (e === "range")
|
|
3289
|
-
try {
|
|
3290
|
-
const u = JSON.parse(t);
|
|
3291
|
-
return {
|
|
3292
|
-
from: u.from ? ke(u.from) : void 0,
|
|
3293
|
-
to: u.to ? ke(u.to) : void 0
|
|
3294
|
-
};
|
|
3295
|
-
} catch {
|
|
3296
|
-
return;
|
|
3297
|
-
}
|
|
3298
|
-
if (e === "multiple")
|
|
3299
|
-
try {
|
|
3300
|
-
return JSON.parse(t).map((d) => ke(d));
|
|
3301
|
-
} catch {
|
|
3302
|
-
return;
|
|
3303
|
-
}
|
|
3304
|
-
return ke(t);
|
|
3305
|
-
}
|
|
3306
|
-
}, [t, e]), o = x.useMemo(() => {
|
|
3307
|
-
if (a)
|
|
3308
|
-
return e === "range" ? a.from : e === "multiple" ? a[0] : a;
|
|
3309
|
-
}, [a, e]), [s, c] = x.useState(() => {
|
|
3310
|
-
if (e !== "range" || !a) return !1;
|
|
3311
|
-
const u = a;
|
|
3312
|
-
return !!u.from && !!u.to;
|
|
3313
|
-
}), i = Y("rounded-lg border", r);
|
|
3314
|
-
return e === "range" ? /* @__PURE__ */ A.jsx(
|
|
3315
|
-
Pe,
|
|
3316
|
-
{
|
|
3317
|
-
mode: "range",
|
|
3318
|
-
numberOfMonths: 2,
|
|
3319
|
-
defaultMonth: o,
|
|
3320
|
-
selected: a,
|
|
3321
|
-
onSelect: (u, d) => {
|
|
3322
|
-
var f, h;
|
|
3323
|
-
if (n) {
|
|
3324
|
-
if (s) {
|
|
3325
|
-
n(JSON.stringify({ from: d.toISOString() })), c(!1);
|
|
3326
|
-
return;
|
|
3327
|
-
}
|
|
3328
|
-
u && (n(
|
|
3329
|
-
JSON.stringify({
|
|
3330
|
-
from: (f = u.from) == null ? void 0 : f.toISOString(),
|
|
3331
|
-
to: (h = u.to) == null ? void 0 : h.toISOString()
|
|
3332
|
-
})
|
|
3333
|
-
), c(!!u.from && !!u.to));
|
|
3334
|
-
}
|
|
3335
|
-
},
|
|
3336
|
-
className: i
|
|
3337
|
-
}
|
|
3338
|
-
) : e === "multiple" ? /* @__PURE__ */ A.jsx(
|
|
3339
|
-
Pe,
|
|
3340
|
-
{
|
|
3341
|
-
mode: "multiple",
|
|
3342
|
-
defaultMonth: o,
|
|
3343
|
-
selected: a,
|
|
3344
|
-
onSelect: (u) => {
|
|
3345
|
-
n && u && n(JSON.stringify(u.map((d) => d.toISOString())));
|
|
3346
|
-
},
|
|
3347
|
-
className: i
|
|
3348
|
-
}
|
|
3349
|
-
) : /* @__PURE__ */ A.jsx(
|
|
3350
|
-
Pe,
|
|
3351
|
-
{
|
|
3352
|
-
mode: "single",
|
|
3353
|
-
defaultMonth: o,
|
|
3354
|
-
selected: a,
|
|
3355
|
-
onSelect: (u) => {
|
|
3356
|
-
u && n && n(u.toISOString());
|
|
3357
|
-
},
|
|
3358
|
-
className: i
|
|
3359
|
-
}
|
|
3360
|
-
);
|
|
3361
|
-
}
|
|
3362
|
-
function es({
|
|
3363
|
-
placeholder: e = "Pick a date",
|
|
3364
|
-
value: t,
|
|
3365
|
-
onSelect: n,
|
|
3366
|
-
className: r
|
|
3367
|
-
}) {
|
|
3368
|
-
const [a, o] = x.useState(!1), s = x.useMemo(() => {
|
|
3369
|
-
if (t)
|
|
3370
|
-
return ke(t);
|
|
3371
|
-
}, [t]), c = (i) => {
|
|
3372
|
-
const u = i;
|
|
3373
|
-
u && n && n(u.toISOString()), o(!1);
|
|
3374
|
-
};
|
|
3375
|
-
return /* @__PURE__ */ A.jsxs(Fn, { open: a, onOpenChange: o, children: [
|
|
3376
|
-
/* @__PURE__ */ A.jsxs(
|
|
3377
|
-
In,
|
|
3378
|
-
{
|
|
3379
|
-
className: Y(
|
|
3380
|
-
"pf-button pf-button-variant-outline pf-button-size-default w-full justify-between text-left font-normal",
|
|
3381
|
-
!s && "text-muted-foreground",
|
|
3382
|
-
r
|
|
3383
|
-
),
|
|
3384
|
-
children: [
|
|
3385
|
-
/* @__PURE__ */ A.jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
3386
|
-
/* @__PURE__ */ A.jsx(An, { className: "size-4" }),
|
|
3387
|
-
s ? he(s, "PPP") : e
|
|
3388
|
-
] }),
|
|
3389
|
-
/* @__PURE__ */ A.jsx(St, { className: "size-4 opacity-50" })
|
|
3390
|
-
]
|
|
3391
|
-
}
|
|
3392
|
-
),
|
|
3393
|
-
/* @__PURE__ */ A.jsx(Bn, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ A.jsx(
|
|
3394
|
-
Pe,
|
|
3395
|
-
{
|
|
3396
|
-
mode: "single",
|
|
3397
|
-
selected: s,
|
|
3398
|
-
onSelect: c
|
|
3399
|
-
}
|
|
3400
|
-
) })
|
|
3401
|
-
] });
|
|
3402
|
-
}
|
|
3403
|
-
export {
|
|
3404
|
-
Lo as PrefabCalendar,
|
|
3405
|
-
es as PrefabDatePicker
|
|
3406
|
-
};
|