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