ics-ui-kit 1.0.0-alpha.0 → 1.0.0-alpha.2
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/CalendarPreviousMonthButton-CHMp8bkd.js +2964 -0
- package/dist/CalendarPreviousMonthButton-CHMp8bkd.js.map +1 -0
- package/dist/{CheckboxField-Ca48ZYoX.js → CheckboxField-xDqHgXHh.js} +2 -2
- package/dist/{CheckboxField-Ca48ZYoX.js.map → CheckboxField-xDqHgXHh.js.map} +1 -1
- package/dist/{Command-CsW4aK7M.js → Command-WsAKNQrY.js} +2 -2
- package/dist/{Command-CsW4aK7M.js.map → Command-WsAKNQrY.js.map} +1 -1
- package/dist/{Dialog-BT_775Iz.js → Dialog-i_Y-phdM.js} +42 -43
- package/dist/Dialog-i_Y-phdM.js.map +1 -0
- package/dist/{Field-BRPdaQ8D.js → Field-BcwUtgGr.js} +2 -2
- package/dist/{Field-BRPdaQ8D.js.map → Field-BcwUtgGr.js.map} +1 -1
- package/dist/{FieldLabel-ic0eq9Un.js → FieldLabel-DYu1AcGH.js} +2 -2
- package/dist/{FieldLabel-ic0eq9Un.js.map → FieldLabel-DYu1AcGH.js.map} +1 -1
- package/dist/{FormFooterTemplate-BIwnBQhL.js → FormFooterTemplate-CHlas_Pp.js} +2 -2
- package/dist/{FormFooterTemplate-BIwnBQhL.js.map → FormFooterTemplate-CHlas_Pp.js.map} +1 -1
- package/dist/FormStack-DfoaOry7.js +1205 -0
- package/dist/FormStack-DfoaOry7.js.map +1 -0
- package/dist/{IconTooltip-CgbefRXG.js → IconTooltip-R6_6_f40.js} +2 -2
- package/dist/{IconTooltip-CgbefRXG.js.map → IconTooltip-R6_6_f40.js.map} +1 -1
- package/dist/{Popover-Dz2eNsXh.js → Popover-XrJa7lyb.js} +49 -50
- package/dist/Popover-XrJa7lyb.js.map +1 -0
- package/dist/{Select-Bfbtj5zt.js → Select-DO02vXt3.js} +185 -186
- package/dist/{Select-Bfbtj5zt.js.map → Select-DO02vXt3.js.map} +1 -1
- package/dist/{Sheet-aLBPtE1k.js → Sheet-C2UoHLL0.js} +35 -36
- package/dist/Sheet-C2UoHLL0.js.map +1 -0
- package/dist/{TextOverflowTooltip-BaNPKqnO.js → TextOverflowTooltip-XPDdO9Dz.js} +2 -2
- package/dist/{TextOverflowTooltip-BaNPKqnO.js.map → TextOverflowTooltip-XPDdO9Dz.js.map} +1 -1
- package/dist/{Tooltip-DOgKy50D.js → Tooltip-D2XvRS0c.js} +63 -64
- package/dist/Tooltip-D2XvRS0c.js.map +1 -0
- package/dist/blocks/auth/otp-form.js +3240 -204
- package/dist/blocks/auth/otp-form.js.map +1 -1
- package/dist/components/alert-dialog/AlertDialog.d.ts +2 -4
- package/dist/components/alert-dialog.js +70 -71
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/calendar/components/calendar-dropdown/CalendarDropdown.d.ts +24 -0
- package/dist/components/calendar/styles.d.ts +61 -0
- package/dist/components/calendar-scroll/CalendarScroll.d.ts +21 -0
- package/dist/components/calendar-scroll/CalendarScroll.stories.d.ts +16 -0
- package/dist/components/calendar-scroll/index.d.ts +3 -0
- package/dist/components/calendar-scroll.d.ts +2 -0
- package/dist/components/calendar-scroll.js +181 -0
- package/dist/components/calendar-scroll.js.map +1 -0
- package/dist/components/calendar.js +51 -147
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/dialog/Dialog.d.ts +2 -4
- package/dist/components/dialog.js +3 -3
- package/dist/components/drawer/components/drawer-content/DrawerContent.d.ts +1 -2
- package/dist/components/drawer.js +96 -97
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown/Dropdown.d.ts +2 -4
- package/dist/components/dropdown.js +251 -252
- package/dist/components/dropdown.js.map +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/file-upload.js +1 -1
- package/dist/components/form/Form.d.ts +14 -0
- package/dist/components/form/components/form-field/FormField.d.ts +4 -0
- package/dist/components/form.js +3 -3
- package/dist/components/icon-tooltip.js +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/overflow-tooltip.js +1 -1
- package/dist/components/popover/Popover.d.ts +1 -2
- package/dist/components/popover.js +1 -1
- package/dist/components/resizable/Resizable.d.ts +1 -1
- package/dist/components/scheduler.js +1 -1
- package/dist/components/search-select/multi-select/MultiSelect.d.ts +1 -1
- package/dist/components/search-select.js +3 -3
- package/dist/components/search-select.js.map +1 -1
- package/dist/components/select/Select.d.ts +1 -2
- package/dist/components/select.js +1 -1
- package/dist/components/sheet/Sheet.d.ts +1 -2
- package/dist/components/sheet.js +1 -1
- package/dist/components/sidebar.js +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tag-input.js +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +2 -4
- package/dist/components/tooltip.js +1 -1
- package/dist/tailwind.css +406 -361
- package/package.json +22 -18
- package/dist/DayPicker-4hE1QEvO.js +0 -2452
- package/dist/DayPicker-4hE1QEvO.js.map +0 -1
- package/dist/Dialog-BT_775Iz.js.map +0 -1
- package/dist/FormStack-CxiZhx1n.js +0 -127
- package/dist/FormStack-CxiZhx1n.js.map +0 -1
- package/dist/Popover-Dz2eNsXh.js.map +0 -1
- package/dist/Sheet-aLBPtE1k.js.map +0 -1
- package/dist/Tooltip-DOgKy50D.js.map +0 -1
- package/dist/buildMatchPatternFn-d7GTeGl_.js +0 -68
- package/dist/buildMatchPatternFn-d7GTeGl_.js.map +0 -1
- package/dist/components/portal-container/PortalContainer.d.ts +0 -10
- package/dist/components/portal-container/index.d.ts +0 -2
- package/dist/components/portal-container/portalContainerEvents.d.ts +0 -12
- package/dist/components/portal-container/usePortalContainer.d.ts +0 -11
- package/dist/components/portal-container.d.ts +0 -2
- package/dist/components/portal-container.js +0 -14
- package/dist/components/portal-container.js.map +0 -1
- package/dist/index.esm-CXA6i4d7.js +0 -1282
- package/dist/index.esm-CXA6i4d7.js.map +0 -1
- package/dist/normalizeDates-9A3c9WYM.js +0 -32
- package/dist/normalizeDates-9A3c9WYM.js.map +0 -1
- package/dist/styles.css +0 -9064
- package/dist/styles.d.ts +0 -1
- package/dist/usePortalContainer-B1xla842.js +0 -33
- package/dist/usePortalContainer-B1xla842.js.map +0 -1
- package/dist/vendors/date-fns/index.d.ts +0 -12
- package/dist/vendors/date-fns/locale/en-US/index.d.ts +0 -5
- package/dist/vendors/date-fns/locale/en-US.d.ts +0 -2
- package/dist/vendors/date-fns/locale/en-US.js +0 -372
- package/dist/vendors/date-fns/locale/en-US.js.map +0 -1
- package/dist/vendors/date-fns/locale/ru/index.d.ts +0 -5
- package/dist/vendors/date-fns/locale/ru.d.ts +0 -2
- package/dist/vendors/date-fns/locale/ru.js +0 -569
- package/dist/vendors/date-fns/locale/ru.js.map +0 -1
- package/dist/vendors/date-fns.d.ts +0 -2
- package/dist/vendors/date-fns.js +0 -2
- package/dist/vendors/date-fns.js.map +0 -1
- package/dist/vendors/react-day-picker/index.d.ts +0 -13
- package/dist/vendors/react-day-picker.d.ts +0 -2
- package/dist/vendors/react-day-picker.js +0 -87
- package/dist/vendors/react-day-picker.js.map +0 -1
- package/dist/vendors/react-hook-form/index.d.ts +0 -14
- package/dist/vendors/react-hook-form.d.ts +0 -2
- package/dist/vendors/react-hook-form.js +0 -19
- package/dist/vendors/react-hook-form.js.map +0 -1
- package/dist/vendors/tanstack/react-table/index.d.ts +0 -13
- package/dist/vendors/tanstack/react-table.d.ts +0 -2
- package/dist/vendors/tanstack/react-table.js +0 -2090
- package/dist/vendors/tanstack/react-table.js.map +0 -1
- package/dist/vendors/zod/index.d.ts +0 -13
- package/dist/vendors/zod.d.ts +0 -2
- package/dist/vendors/zod.js +0 -3080
- package/dist/vendors/zod.js.map +0 -1
- package/dist/zod-BMNoK3aM.js +0 -75
- package/dist/zod-BMNoK3aM.js.map +0 -1
|
@@ -1,2452 +0,0 @@
|
|
|
1
|
-
import d, { createContext as bn, useContext as wn, useCallback as j, useRef as pe, useLayoutEffect as kn, useState as Ge, useEffect as pn, useMemo as Oe } from "react";
|
|
2
|
-
import { enUS as fe } from "./vendors/date-fns/locale/en-US.js";
|
|
3
|
-
import { t as x, c as I, s as le, n as de, m as On, g as ve, a as yt } from "./normalizeDates-9A3c9WYM.js";
|
|
4
|
-
function vn(e, t, r = "long") {
|
|
5
|
-
return new Intl.DateTimeFormat("en-US", {
|
|
6
|
-
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
7
|
-
hour: "numeric",
|
|
8
|
-
timeZone: e,
|
|
9
|
-
timeZoneName: r
|
|
10
|
-
}).format(t).split(/\s/g).slice(2).join(" ");
|
|
11
|
-
}
|
|
12
|
-
const Be = {}, he = {};
|
|
13
|
-
function ae(e, t) {
|
|
14
|
-
try {
|
|
15
|
-
const n = (Be[e] || (Be[e] = new Intl.DateTimeFormat("en-US", {
|
|
16
|
-
timeZone: e,
|
|
17
|
-
timeZoneName: "longOffset"
|
|
18
|
-
}).format))(t).split("GMT")[1];
|
|
19
|
-
return n in he ? he[n] : rt(n, n.split(":"));
|
|
20
|
-
} catch {
|
|
21
|
-
if (e in he) return he[e];
|
|
22
|
-
const r = e?.match(Wn);
|
|
23
|
-
return r ? rt(e, r.slice(1)) : NaN;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const Wn = /([+-]\d\d):?(\d\d)?/;
|
|
27
|
-
function rt(e, t) {
|
|
28
|
-
const r = +(t[0] || 0), n = +(t[1] || 0), o = +(t[2] || 0) / 60;
|
|
29
|
-
return he[e] = r * 60 + n > 0 ? r * 60 + n + o : r * 60 - n - o;
|
|
30
|
-
}
|
|
31
|
-
class J extends Date {
|
|
32
|
-
//#region static
|
|
33
|
-
constructor(...t) {
|
|
34
|
-
super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(ae(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)), gt(this), $e(this)) : this.setTime(Date.now());
|
|
35
|
-
}
|
|
36
|
-
static tz(t, ...r) {
|
|
37
|
-
return r.length ? new J(...r, t) : new J(Date.now(), t);
|
|
38
|
-
}
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region time zone
|
|
41
|
-
withTimeZone(t) {
|
|
42
|
-
return new J(+this, t);
|
|
43
|
-
}
|
|
44
|
-
getTimezoneOffset() {
|
|
45
|
-
const t = -ae(this.timeZone, this);
|
|
46
|
-
return t > 0 ? Math.floor(t) : Math.ceil(t);
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region time
|
|
50
|
-
setTime(t) {
|
|
51
|
-
return Date.prototype.setTime.apply(this, arguments), $e(this), +this;
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region date-fns integration
|
|
55
|
-
[Symbol.for("constructDateFrom")](t) {
|
|
56
|
-
return new J(+new Date(t), this.timeZone);
|
|
57
|
-
}
|
|
58
|
-
//#endregion
|
|
59
|
-
}
|
|
60
|
-
const ot = /^(get|set)(?!UTC)/;
|
|
61
|
-
Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
|
|
62
|
-
if (!ot.test(e)) return;
|
|
63
|
-
const t = e.replace(ot, "$1UTC");
|
|
64
|
-
J.prototype[t] && (e.startsWith("get") ? J.prototype[e] = function() {
|
|
65
|
-
return this.internal[t]();
|
|
66
|
-
} : (J.prototype[e] = function() {
|
|
67
|
-
return Date.prototype[t].apply(this.internal, arguments), Sn(this), +this;
|
|
68
|
-
}, J.prototype[t] = function() {
|
|
69
|
-
return Date.prototype[t].apply(this, arguments), $e(this), +this;
|
|
70
|
-
}));
|
|
71
|
-
});
|
|
72
|
-
function $e(e) {
|
|
73
|
-
e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-ae(e.timeZone, e) * 60));
|
|
74
|
-
}
|
|
75
|
-
function Sn(e) {
|
|
76
|
-
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()), gt(e);
|
|
77
|
-
}
|
|
78
|
-
function gt(e) {
|
|
79
|
-
const t = ae(e.timeZone, e), r = t > 0 ? Math.floor(t) : Math.ceil(t), n = /* @__PURE__ */ new Date(+e);
|
|
80
|
-
n.setUTCHours(n.getUTCHours() - 1);
|
|
81
|
-
const o = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), a = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), i = o - a, s = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
|
|
82
|
-
i && s && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + i);
|
|
83
|
-
const c = o - r;
|
|
84
|
-
c && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + c);
|
|
85
|
-
const u = /* @__PURE__ */ new Date(+e);
|
|
86
|
-
u.setUTCSeconds(0);
|
|
87
|
-
const l = o > 0 ? u.getSeconds() : (u.getSeconds() - 60) % 60, f = Math.round(-(ae(e.timeZone, e) * 60)) % 60;
|
|
88
|
-
(f || l) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + f), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + f + l));
|
|
89
|
-
const h = ae(e.timeZone, e), g = h > 0 ? Math.floor(h) : Math.ceil(h), N = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - g, O = g !== r, T = N - c;
|
|
90
|
-
if (O && T) {
|
|
91
|
-
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + T);
|
|
92
|
-
const w = ae(e.timeZone, e), M = w > 0 ? Math.floor(w) : Math.ceil(w), k = g - M;
|
|
93
|
-
k && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + k), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + k));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
class H extends J {
|
|
97
|
-
//#region static
|
|
98
|
-
static tz(t, ...r) {
|
|
99
|
-
return r.length ? new H(...r, t) : new H(Date.now(), t);
|
|
100
|
-
}
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region representation
|
|
103
|
-
toISOString() {
|
|
104
|
-
const [t, r, n] = this.tzComponents(), o = `${t}${r}:${n}`;
|
|
105
|
-
return this.internal.toISOString().slice(0, -1) + o;
|
|
106
|
-
}
|
|
107
|
-
toString() {
|
|
108
|
-
return `${this.toDateString()} ${this.toTimeString()}`;
|
|
109
|
-
}
|
|
110
|
-
toDateString() {
|
|
111
|
-
const [t, r, n, o] = this.internal.toUTCString().split(" ");
|
|
112
|
-
return `${t?.slice(0, -1)} ${n} ${r} ${o}`;
|
|
113
|
-
}
|
|
114
|
-
toTimeString() {
|
|
115
|
-
const t = this.internal.toUTCString().split(" ")[4], [r, n, o] = this.tzComponents();
|
|
116
|
-
return `${t} GMT${r}${n}${o} (${vn(this.timeZone, this)})`;
|
|
117
|
-
}
|
|
118
|
-
toLocaleString(t, r) {
|
|
119
|
-
return Date.prototype.toLocaleString.call(this, t, {
|
|
120
|
-
...r,
|
|
121
|
-
timeZone: r?.timeZone || this.timeZone
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
toLocaleDateString(t, r) {
|
|
125
|
-
return Date.prototype.toLocaleDateString.call(this, t, {
|
|
126
|
-
...r,
|
|
127
|
-
timeZone: r?.timeZone || this.timeZone
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
toLocaleTimeString(t, r) {
|
|
131
|
-
return Date.prototype.toLocaleTimeString.call(this, t, {
|
|
132
|
-
...r,
|
|
133
|
-
timeZone: r?.timeZone || this.timeZone
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
//#endregion
|
|
137
|
-
//#region private
|
|
138
|
-
tzComponents() {
|
|
139
|
-
const t = this.getTimezoneOffset(), r = t > 0 ? "-" : "+", n = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), o = String(Math.abs(t) % 60).padStart(2, "0");
|
|
140
|
-
return [r, n, o];
|
|
141
|
-
}
|
|
142
|
-
//#endregion
|
|
143
|
-
withTimeZone(t) {
|
|
144
|
-
return new H(+this, t);
|
|
145
|
-
}
|
|
146
|
-
//#region date-fns integration
|
|
147
|
-
[Symbol.for("constructDateFrom")](t) {
|
|
148
|
-
return new H(+new Date(t), this.timeZone);
|
|
149
|
-
}
|
|
150
|
-
//#endregion
|
|
151
|
-
}
|
|
152
|
-
function Dt(e, t, r) {
|
|
153
|
-
const n = x(e, r?.in);
|
|
154
|
-
return isNaN(t) ? I(e, NaN) : (t && n.setDate(n.getDate() + t), n);
|
|
155
|
-
}
|
|
156
|
-
function Mt(e, t, r) {
|
|
157
|
-
const n = x(e, r?.in);
|
|
158
|
-
if (isNaN(t)) return I(e, NaN);
|
|
159
|
-
if (!t)
|
|
160
|
-
return n;
|
|
161
|
-
const o = n.getDate(), a = I(e, n.getTime());
|
|
162
|
-
a.setMonth(n.getMonth() + t + 1, 0);
|
|
163
|
-
const i = a.getDate();
|
|
164
|
-
return o >= i ? a : (n.setFullYear(
|
|
165
|
-
a.getFullYear(),
|
|
166
|
-
a.getMonth(),
|
|
167
|
-
o
|
|
168
|
-
), n);
|
|
169
|
-
}
|
|
170
|
-
function ye(e, t) {
|
|
171
|
-
return le(e, { ...t, weekStartsOn: 1 });
|
|
172
|
-
}
|
|
173
|
-
function bt(e, t) {
|
|
174
|
-
const r = x(e, t?.in), n = r.getFullYear(), o = I(r, 0);
|
|
175
|
-
o.setFullYear(n + 1, 0, 4), o.setHours(0, 0, 0, 0);
|
|
176
|
-
const a = ye(o), i = I(r, 0);
|
|
177
|
-
i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
|
|
178
|
-
const s = ye(i);
|
|
179
|
-
return r.getTime() >= a.getTime() ? n + 1 : r.getTime() >= s.getTime() ? n : n - 1;
|
|
180
|
-
}
|
|
181
|
-
function st(e) {
|
|
182
|
-
const t = x(e), r = new Date(
|
|
183
|
-
Date.UTC(
|
|
184
|
-
t.getFullYear(),
|
|
185
|
-
t.getMonth(),
|
|
186
|
-
t.getDate(),
|
|
187
|
-
t.getHours(),
|
|
188
|
-
t.getMinutes(),
|
|
189
|
-
t.getSeconds(),
|
|
190
|
-
t.getMilliseconds()
|
|
191
|
-
)
|
|
192
|
-
);
|
|
193
|
-
return r.setUTCFullYear(t.getFullYear()), +e - +r;
|
|
194
|
-
}
|
|
195
|
-
function ge(e, t) {
|
|
196
|
-
const r = x(e, t?.in);
|
|
197
|
-
return r.setHours(0, 0, 0, 0), r;
|
|
198
|
-
}
|
|
199
|
-
function je(e, t, r) {
|
|
200
|
-
const [n, o] = de(
|
|
201
|
-
r?.in,
|
|
202
|
-
e,
|
|
203
|
-
t
|
|
204
|
-
), a = ge(n), i = ge(o), s = +a - st(a), c = +i - st(i);
|
|
205
|
-
return Math.round((s - c) / On);
|
|
206
|
-
}
|
|
207
|
-
function Nn(e, t) {
|
|
208
|
-
const r = bt(e, t), n = I(e, 0);
|
|
209
|
-
return n.setFullYear(r, 0, 4), n.setHours(0, 0, 0, 0), ye(n);
|
|
210
|
-
}
|
|
211
|
-
function Cn(e, t, r) {
|
|
212
|
-
return Dt(e, t * 7, r);
|
|
213
|
-
}
|
|
214
|
-
function Yn(e, t, r) {
|
|
215
|
-
return Mt(e, t * 12, r);
|
|
216
|
-
}
|
|
217
|
-
function Tn(e, t) {
|
|
218
|
-
let r, n = t?.in;
|
|
219
|
-
return e.forEach((o) => {
|
|
220
|
-
!n && typeof o == "object" && (n = I.bind(null, o));
|
|
221
|
-
const a = x(o, n);
|
|
222
|
-
(!r || r < a || isNaN(+a)) && (r = a);
|
|
223
|
-
}), I(n, r || NaN);
|
|
224
|
-
}
|
|
225
|
-
function En(e, t) {
|
|
226
|
-
let r, n = t?.in;
|
|
227
|
-
return e.forEach((o) => {
|
|
228
|
-
!n && typeof o == "object" && (n = I.bind(null, o));
|
|
229
|
-
const a = x(o, n);
|
|
230
|
-
(!r || r > a || isNaN(+a)) && (r = a);
|
|
231
|
-
}), I(n, r || NaN);
|
|
232
|
-
}
|
|
233
|
-
function xn(e, t, r) {
|
|
234
|
-
const [n, o] = de(
|
|
235
|
-
r?.in,
|
|
236
|
-
e,
|
|
237
|
-
t
|
|
238
|
-
);
|
|
239
|
-
return +ge(n) == +ge(o);
|
|
240
|
-
}
|
|
241
|
-
function wt(e) {
|
|
242
|
-
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
243
|
-
}
|
|
244
|
-
function _n(e) {
|
|
245
|
-
return !(!wt(e) && typeof e != "number" || isNaN(+x(e)));
|
|
246
|
-
}
|
|
247
|
-
function kt(e, t, r) {
|
|
248
|
-
const [n, o] = de(
|
|
249
|
-
r?.in,
|
|
250
|
-
e,
|
|
251
|
-
t
|
|
252
|
-
), a = n.getFullYear() - o.getFullYear(), i = n.getMonth() - o.getMonth();
|
|
253
|
-
return a * 12 + i;
|
|
254
|
-
}
|
|
255
|
-
function Fn(e, t) {
|
|
256
|
-
const r = x(e, t?.in), n = r.getMonth();
|
|
257
|
-
return r.setFullYear(r.getFullYear(), n + 1, 0), r.setHours(23, 59, 59, 999), r;
|
|
258
|
-
}
|
|
259
|
-
function pt(e, t) {
|
|
260
|
-
const [r, n] = de(e, t.start, t.end);
|
|
261
|
-
return { start: r, end: n };
|
|
262
|
-
}
|
|
263
|
-
function Pn(e, t) {
|
|
264
|
-
const { start: r, end: n } = pt(t?.in, e);
|
|
265
|
-
let o = +r > +n;
|
|
266
|
-
const a = o ? +r : +n, i = o ? n : r;
|
|
267
|
-
i.setHours(0, 0, 0, 0), i.setDate(1);
|
|
268
|
-
let s = 1;
|
|
269
|
-
const c = [];
|
|
270
|
-
for (; +i <= a; )
|
|
271
|
-
c.push(I(r, i)), i.setMonth(i.getMonth() + s);
|
|
272
|
-
return o ? c.reverse() : c;
|
|
273
|
-
}
|
|
274
|
-
function Bn(e, t) {
|
|
275
|
-
const r = x(e, t?.in);
|
|
276
|
-
return r.setDate(1), r.setHours(0, 0, 0, 0), r;
|
|
277
|
-
}
|
|
278
|
-
function In(e, t) {
|
|
279
|
-
const r = x(e, t?.in), n = r.getFullYear();
|
|
280
|
-
return r.setFullYear(n + 1, 0, 0), r.setHours(23, 59, 59, 999), r;
|
|
281
|
-
}
|
|
282
|
-
function Ot(e, t) {
|
|
283
|
-
const r = x(e, t?.in);
|
|
284
|
-
return r.setFullYear(r.getFullYear(), 0, 1), r.setHours(0, 0, 0, 0), r;
|
|
285
|
-
}
|
|
286
|
-
function Hn(e, t) {
|
|
287
|
-
const { start: r, end: n } = pt(t?.in, e);
|
|
288
|
-
let o = +r > +n;
|
|
289
|
-
const a = o ? +r : +n, i = o ? n : r;
|
|
290
|
-
i.setHours(0, 0, 0, 0), i.setMonth(0, 1);
|
|
291
|
-
let s = 1;
|
|
292
|
-
const c = [];
|
|
293
|
-
for (; +i <= a; )
|
|
294
|
-
c.push(I(r, i)), i.setFullYear(i.getFullYear() + s);
|
|
295
|
-
return o ? c.reverse() : c;
|
|
296
|
-
}
|
|
297
|
-
function vt(e, t) {
|
|
298
|
-
const r = ve(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, o = x(e, t?.in), a = o.getDay(), i = (a < n ? -7 : 0) + 6 - (a - n);
|
|
299
|
-
return o.setDate(o.getDate() + i), o.setHours(23, 59, 59, 999), o;
|
|
300
|
-
}
|
|
301
|
-
function qn(e, t) {
|
|
302
|
-
return vt(e, { ...t, weekStartsOn: 1 });
|
|
303
|
-
}
|
|
304
|
-
function An(e, t) {
|
|
305
|
-
const r = x(e, t?.in);
|
|
306
|
-
return je(r, Ot(r)) + 1;
|
|
307
|
-
}
|
|
308
|
-
function Re(e, t) {
|
|
309
|
-
const r = x(e, t?.in), n = +ye(r) - +Nn(r);
|
|
310
|
-
return Math.round(n / yt) + 1;
|
|
311
|
-
}
|
|
312
|
-
function Wt(e, t) {
|
|
313
|
-
const r = x(e, t?.in), n = r.getFullYear(), o = ve(), a = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, i = I(t?.in || e, 0);
|
|
314
|
-
i.setFullYear(n + 1, 0, a), i.setHours(0, 0, 0, 0);
|
|
315
|
-
const s = le(i, t), c = I(t?.in || e, 0);
|
|
316
|
-
c.setFullYear(n, 0, a), c.setHours(0, 0, 0, 0);
|
|
317
|
-
const u = le(c, t);
|
|
318
|
-
return +r >= +s ? n + 1 : +r >= +u ? n : n - 1;
|
|
319
|
-
}
|
|
320
|
-
function Gn(e, t) {
|
|
321
|
-
const r = ve(), n = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = Wt(e, t), a = I(t?.in || e, 0);
|
|
322
|
-
return a.setFullYear(o, 0, n), a.setHours(0, 0, 0, 0), le(a, t);
|
|
323
|
-
}
|
|
324
|
-
function ze(e, t) {
|
|
325
|
-
const r = x(e, t?.in), n = +le(r, t) - +Gn(r, t);
|
|
326
|
-
return Math.round(n / yt) + 1;
|
|
327
|
-
}
|
|
328
|
-
function E(e, t) {
|
|
329
|
-
const r = e < 0 ? "-" : "", n = Math.abs(e).toString().padStart(t, "0");
|
|
330
|
-
return r + n;
|
|
331
|
-
}
|
|
332
|
-
const oe = {
|
|
333
|
-
// Year
|
|
334
|
-
y(e, t) {
|
|
335
|
-
const r = e.getFullYear(), n = r > 0 ? r : 1 - r;
|
|
336
|
-
return E(t === "yy" ? n % 100 : n, t.length);
|
|
337
|
-
},
|
|
338
|
-
// Month
|
|
339
|
-
M(e, t) {
|
|
340
|
-
const r = e.getMonth();
|
|
341
|
-
return t === "M" ? String(r + 1) : E(r + 1, 2);
|
|
342
|
-
},
|
|
343
|
-
// Day of the month
|
|
344
|
-
d(e, t) {
|
|
345
|
-
return E(e.getDate(), t.length);
|
|
346
|
-
},
|
|
347
|
-
// AM or PM
|
|
348
|
-
a(e, t) {
|
|
349
|
-
const r = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
350
|
-
switch (t) {
|
|
351
|
-
case "a":
|
|
352
|
-
case "aa":
|
|
353
|
-
return r.toUpperCase();
|
|
354
|
-
case "aaa":
|
|
355
|
-
return r;
|
|
356
|
-
case "aaaaa":
|
|
357
|
-
return r[0];
|
|
358
|
-
case "aaaa":
|
|
359
|
-
default:
|
|
360
|
-
return r === "am" ? "a.m." : "p.m.";
|
|
361
|
-
}
|
|
362
|
-
},
|
|
363
|
-
// Hour [1-12]
|
|
364
|
-
h(e, t) {
|
|
365
|
-
return E(e.getHours() % 12 || 12, t.length);
|
|
366
|
-
},
|
|
367
|
-
// Hour [0-23]
|
|
368
|
-
H(e, t) {
|
|
369
|
-
return E(e.getHours(), t.length);
|
|
370
|
-
},
|
|
371
|
-
// Minute
|
|
372
|
-
m(e, t) {
|
|
373
|
-
return E(e.getMinutes(), t.length);
|
|
374
|
-
},
|
|
375
|
-
// Second
|
|
376
|
-
s(e, t) {
|
|
377
|
-
return E(e.getSeconds(), t.length);
|
|
378
|
-
},
|
|
379
|
-
// Fraction of second
|
|
380
|
-
S(e, t) {
|
|
381
|
-
const r = t.length, n = e.getMilliseconds(), o = Math.trunc(
|
|
382
|
-
n * Math.pow(10, r - 3)
|
|
383
|
-
);
|
|
384
|
-
return E(o, t.length);
|
|
385
|
-
}
|
|
386
|
-
}, ce = {
|
|
387
|
-
midnight: "midnight",
|
|
388
|
-
noon: "noon",
|
|
389
|
-
morning: "morning",
|
|
390
|
-
afternoon: "afternoon",
|
|
391
|
-
evening: "evening",
|
|
392
|
-
night: "night"
|
|
393
|
-
}, at = {
|
|
394
|
-
// Era
|
|
395
|
-
G: function(e, t, r) {
|
|
396
|
-
const n = e.getFullYear() > 0 ? 1 : 0;
|
|
397
|
-
switch (t) {
|
|
398
|
-
case "G":
|
|
399
|
-
case "GG":
|
|
400
|
-
case "GGG":
|
|
401
|
-
return r.era(n, { width: "abbreviated" });
|
|
402
|
-
case "GGGGG":
|
|
403
|
-
return r.era(n, { width: "narrow" });
|
|
404
|
-
case "GGGG":
|
|
405
|
-
default:
|
|
406
|
-
return r.era(n, { width: "wide" });
|
|
407
|
-
}
|
|
408
|
-
},
|
|
409
|
-
// Year
|
|
410
|
-
y: function(e, t, r) {
|
|
411
|
-
if (t === "yo") {
|
|
412
|
-
const n = e.getFullYear(), o = n > 0 ? n : 1 - n;
|
|
413
|
-
return r.ordinalNumber(o, { unit: "year" });
|
|
414
|
-
}
|
|
415
|
-
return oe.y(e, t);
|
|
416
|
-
},
|
|
417
|
-
// Local week-numbering year
|
|
418
|
-
Y: function(e, t, r, n) {
|
|
419
|
-
const o = Wt(e, n), a = o > 0 ? o : 1 - o;
|
|
420
|
-
if (t === "YY") {
|
|
421
|
-
const i = a % 100;
|
|
422
|
-
return E(i, 2);
|
|
423
|
-
}
|
|
424
|
-
return t === "Yo" ? r.ordinalNumber(a, { unit: "year" }) : E(a, t.length);
|
|
425
|
-
},
|
|
426
|
-
// ISO week-numbering year
|
|
427
|
-
R: function(e, t) {
|
|
428
|
-
const r = bt(e);
|
|
429
|
-
return E(r, t.length);
|
|
430
|
-
},
|
|
431
|
-
// Extended year. This is a single number designating the year of this calendar system.
|
|
432
|
-
// The main difference between `y` and `u` localizers are B.C. years:
|
|
433
|
-
// | Year | `y` | `u` |
|
|
434
|
-
// |------|-----|-----|
|
|
435
|
-
// | AC 1 | 1 | 1 |
|
|
436
|
-
// | BC 1 | 1 | 0 |
|
|
437
|
-
// | BC 2 | 2 | -1 |
|
|
438
|
-
// Also `yy` always returns the last two digits of a year,
|
|
439
|
-
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
440
|
-
u: function(e, t) {
|
|
441
|
-
const r = e.getFullYear();
|
|
442
|
-
return E(r, t.length);
|
|
443
|
-
},
|
|
444
|
-
// Quarter
|
|
445
|
-
Q: function(e, t, r) {
|
|
446
|
-
const n = Math.ceil((e.getMonth() + 1) / 3);
|
|
447
|
-
switch (t) {
|
|
448
|
-
case "Q":
|
|
449
|
-
return String(n);
|
|
450
|
-
case "QQ":
|
|
451
|
-
return E(n, 2);
|
|
452
|
-
case "Qo":
|
|
453
|
-
return r.ordinalNumber(n, { unit: "quarter" });
|
|
454
|
-
case "QQQ":
|
|
455
|
-
return r.quarter(n, {
|
|
456
|
-
width: "abbreviated",
|
|
457
|
-
context: "formatting"
|
|
458
|
-
});
|
|
459
|
-
case "QQQQQ":
|
|
460
|
-
return r.quarter(n, {
|
|
461
|
-
width: "narrow",
|
|
462
|
-
context: "formatting"
|
|
463
|
-
});
|
|
464
|
-
case "QQQQ":
|
|
465
|
-
default:
|
|
466
|
-
return r.quarter(n, {
|
|
467
|
-
width: "wide",
|
|
468
|
-
context: "formatting"
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
},
|
|
472
|
-
// Stand-alone quarter
|
|
473
|
-
q: function(e, t, r) {
|
|
474
|
-
const n = Math.ceil((e.getMonth() + 1) / 3);
|
|
475
|
-
switch (t) {
|
|
476
|
-
case "q":
|
|
477
|
-
return String(n);
|
|
478
|
-
case "qq":
|
|
479
|
-
return E(n, 2);
|
|
480
|
-
case "qo":
|
|
481
|
-
return r.ordinalNumber(n, { unit: "quarter" });
|
|
482
|
-
case "qqq":
|
|
483
|
-
return r.quarter(n, {
|
|
484
|
-
width: "abbreviated",
|
|
485
|
-
context: "standalone"
|
|
486
|
-
});
|
|
487
|
-
case "qqqqq":
|
|
488
|
-
return r.quarter(n, {
|
|
489
|
-
width: "narrow",
|
|
490
|
-
context: "standalone"
|
|
491
|
-
});
|
|
492
|
-
case "qqqq":
|
|
493
|
-
default:
|
|
494
|
-
return r.quarter(n, {
|
|
495
|
-
width: "wide",
|
|
496
|
-
context: "standalone"
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
},
|
|
500
|
-
// Month
|
|
501
|
-
M: function(e, t, r) {
|
|
502
|
-
const n = e.getMonth();
|
|
503
|
-
switch (t) {
|
|
504
|
-
case "M":
|
|
505
|
-
case "MM":
|
|
506
|
-
return oe.M(e, t);
|
|
507
|
-
case "Mo":
|
|
508
|
-
return r.ordinalNumber(n + 1, { unit: "month" });
|
|
509
|
-
case "MMM":
|
|
510
|
-
return r.month(n, {
|
|
511
|
-
width: "abbreviated",
|
|
512
|
-
context: "formatting"
|
|
513
|
-
});
|
|
514
|
-
case "MMMMM":
|
|
515
|
-
return r.month(n, {
|
|
516
|
-
width: "narrow",
|
|
517
|
-
context: "formatting"
|
|
518
|
-
});
|
|
519
|
-
case "MMMM":
|
|
520
|
-
default:
|
|
521
|
-
return r.month(n, { width: "wide", context: "formatting" });
|
|
522
|
-
}
|
|
523
|
-
},
|
|
524
|
-
// Stand-alone month
|
|
525
|
-
L: function(e, t, r) {
|
|
526
|
-
const n = e.getMonth();
|
|
527
|
-
switch (t) {
|
|
528
|
-
case "L":
|
|
529
|
-
return String(n + 1);
|
|
530
|
-
case "LL":
|
|
531
|
-
return E(n + 1, 2);
|
|
532
|
-
case "Lo":
|
|
533
|
-
return r.ordinalNumber(n + 1, { unit: "month" });
|
|
534
|
-
case "LLL":
|
|
535
|
-
return r.month(n, {
|
|
536
|
-
width: "abbreviated",
|
|
537
|
-
context: "standalone"
|
|
538
|
-
});
|
|
539
|
-
case "LLLLL":
|
|
540
|
-
return r.month(n, {
|
|
541
|
-
width: "narrow",
|
|
542
|
-
context: "standalone"
|
|
543
|
-
});
|
|
544
|
-
case "LLLL":
|
|
545
|
-
default:
|
|
546
|
-
return r.month(n, { width: "wide", context: "standalone" });
|
|
547
|
-
}
|
|
548
|
-
},
|
|
549
|
-
// Local week of year
|
|
550
|
-
w: function(e, t, r, n) {
|
|
551
|
-
const o = ze(e, n);
|
|
552
|
-
return t === "wo" ? r.ordinalNumber(o, { unit: "week" }) : E(o, t.length);
|
|
553
|
-
},
|
|
554
|
-
// ISO week of year
|
|
555
|
-
I: function(e, t, r) {
|
|
556
|
-
const n = Re(e);
|
|
557
|
-
return t === "Io" ? r.ordinalNumber(n, { unit: "week" }) : E(n, t.length);
|
|
558
|
-
},
|
|
559
|
-
// Day of the month
|
|
560
|
-
d: function(e, t, r) {
|
|
561
|
-
return t === "do" ? r.ordinalNumber(e.getDate(), { unit: "date" }) : oe.d(e, t);
|
|
562
|
-
},
|
|
563
|
-
// Day of year
|
|
564
|
-
D: function(e, t, r) {
|
|
565
|
-
const n = An(e);
|
|
566
|
-
return t === "Do" ? r.ordinalNumber(n, { unit: "dayOfYear" }) : E(n, t.length);
|
|
567
|
-
},
|
|
568
|
-
// Day of week
|
|
569
|
-
E: function(e, t, r) {
|
|
570
|
-
const n = e.getDay();
|
|
571
|
-
switch (t) {
|
|
572
|
-
case "E":
|
|
573
|
-
case "EE":
|
|
574
|
-
case "EEE":
|
|
575
|
-
return r.day(n, {
|
|
576
|
-
width: "abbreviated",
|
|
577
|
-
context: "formatting"
|
|
578
|
-
});
|
|
579
|
-
case "EEEEE":
|
|
580
|
-
return r.day(n, {
|
|
581
|
-
width: "narrow",
|
|
582
|
-
context: "formatting"
|
|
583
|
-
});
|
|
584
|
-
case "EEEEEE":
|
|
585
|
-
return r.day(n, {
|
|
586
|
-
width: "short",
|
|
587
|
-
context: "formatting"
|
|
588
|
-
});
|
|
589
|
-
case "EEEE":
|
|
590
|
-
default:
|
|
591
|
-
return r.day(n, {
|
|
592
|
-
width: "wide",
|
|
593
|
-
context: "formatting"
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
},
|
|
597
|
-
// Local day of week
|
|
598
|
-
e: function(e, t, r, n) {
|
|
599
|
-
const o = e.getDay(), a = (o - n.weekStartsOn + 8) % 7 || 7;
|
|
600
|
-
switch (t) {
|
|
601
|
-
case "e":
|
|
602
|
-
return String(a);
|
|
603
|
-
case "ee":
|
|
604
|
-
return E(a, 2);
|
|
605
|
-
case "eo":
|
|
606
|
-
return r.ordinalNumber(a, { unit: "day" });
|
|
607
|
-
case "eee":
|
|
608
|
-
return r.day(o, {
|
|
609
|
-
width: "abbreviated",
|
|
610
|
-
context: "formatting"
|
|
611
|
-
});
|
|
612
|
-
case "eeeee":
|
|
613
|
-
return r.day(o, {
|
|
614
|
-
width: "narrow",
|
|
615
|
-
context: "formatting"
|
|
616
|
-
});
|
|
617
|
-
case "eeeeee":
|
|
618
|
-
return r.day(o, {
|
|
619
|
-
width: "short",
|
|
620
|
-
context: "formatting"
|
|
621
|
-
});
|
|
622
|
-
case "eeee":
|
|
623
|
-
default:
|
|
624
|
-
return r.day(o, {
|
|
625
|
-
width: "wide",
|
|
626
|
-
context: "formatting"
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
},
|
|
630
|
-
// Stand-alone local day of week
|
|
631
|
-
c: function(e, t, r, n) {
|
|
632
|
-
const o = e.getDay(), a = (o - n.weekStartsOn + 8) % 7 || 7;
|
|
633
|
-
switch (t) {
|
|
634
|
-
case "c":
|
|
635
|
-
return String(a);
|
|
636
|
-
case "cc":
|
|
637
|
-
return E(a, t.length);
|
|
638
|
-
case "co":
|
|
639
|
-
return r.ordinalNumber(a, { unit: "day" });
|
|
640
|
-
case "ccc":
|
|
641
|
-
return r.day(o, {
|
|
642
|
-
width: "abbreviated",
|
|
643
|
-
context: "standalone"
|
|
644
|
-
});
|
|
645
|
-
case "ccccc":
|
|
646
|
-
return r.day(o, {
|
|
647
|
-
width: "narrow",
|
|
648
|
-
context: "standalone"
|
|
649
|
-
});
|
|
650
|
-
case "cccccc":
|
|
651
|
-
return r.day(o, {
|
|
652
|
-
width: "short",
|
|
653
|
-
context: "standalone"
|
|
654
|
-
});
|
|
655
|
-
case "cccc":
|
|
656
|
-
default:
|
|
657
|
-
return r.day(o, {
|
|
658
|
-
width: "wide",
|
|
659
|
-
context: "standalone"
|
|
660
|
-
});
|
|
661
|
-
}
|
|
662
|
-
},
|
|
663
|
-
// ISO day of week
|
|
664
|
-
i: function(e, t, r) {
|
|
665
|
-
const n = e.getDay(), o = n === 0 ? 7 : n;
|
|
666
|
-
switch (t) {
|
|
667
|
-
case "i":
|
|
668
|
-
return String(o);
|
|
669
|
-
case "ii":
|
|
670
|
-
return E(o, t.length);
|
|
671
|
-
case "io":
|
|
672
|
-
return r.ordinalNumber(o, { unit: "day" });
|
|
673
|
-
case "iii":
|
|
674
|
-
return r.day(n, {
|
|
675
|
-
width: "abbreviated",
|
|
676
|
-
context: "formatting"
|
|
677
|
-
});
|
|
678
|
-
case "iiiii":
|
|
679
|
-
return r.day(n, {
|
|
680
|
-
width: "narrow",
|
|
681
|
-
context: "formatting"
|
|
682
|
-
});
|
|
683
|
-
case "iiiiii":
|
|
684
|
-
return r.day(n, {
|
|
685
|
-
width: "short",
|
|
686
|
-
context: "formatting"
|
|
687
|
-
});
|
|
688
|
-
case "iiii":
|
|
689
|
-
default:
|
|
690
|
-
return r.day(n, {
|
|
691
|
-
width: "wide",
|
|
692
|
-
context: "formatting"
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
},
|
|
696
|
-
// AM or PM
|
|
697
|
-
a: function(e, t, r) {
|
|
698
|
-
const o = e.getHours() / 12 >= 1 ? "pm" : "am";
|
|
699
|
-
switch (t) {
|
|
700
|
-
case "a":
|
|
701
|
-
case "aa":
|
|
702
|
-
return r.dayPeriod(o, {
|
|
703
|
-
width: "abbreviated",
|
|
704
|
-
context: "formatting"
|
|
705
|
-
});
|
|
706
|
-
case "aaa":
|
|
707
|
-
return r.dayPeriod(o, {
|
|
708
|
-
width: "abbreviated",
|
|
709
|
-
context: "formatting"
|
|
710
|
-
}).toLowerCase();
|
|
711
|
-
case "aaaaa":
|
|
712
|
-
return r.dayPeriod(o, {
|
|
713
|
-
width: "narrow",
|
|
714
|
-
context: "formatting"
|
|
715
|
-
});
|
|
716
|
-
case "aaaa":
|
|
717
|
-
default:
|
|
718
|
-
return r.dayPeriod(o, {
|
|
719
|
-
width: "wide",
|
|
720
|
-
context: "formatting"
|
|
721
|
-
});
|
|
722
|
-
}
|
|
723
|
-
},
|
|
724
|
-
// AM, PM, midnight, noon
|
|
725
|
-
b: function(e, t, r) {
|
|
726
|
-
const n = e.getHours();
|
|
727
|
-
let o;
|
|
728
|
-
switch (n === 12 ? o = ce.noon : n === 0 ? o = ce.midnight : o = n / 12 >= 1 ? "pm" : "am", t) {
|
|
729
|
-
case "b":
|
|
730
|
-
case "bb":
|
|
731
|
-
return r.dayPeriod(o, {
|
|
732
|
-
width: "abbreviated",
|
|
733
|
-
context: "formatting"
|
|
734
|
-
});
|
|
735
|
-
case "bbb":
|
|
736
|
-
return r.dayPeriod(o, {
|
|
737
|
-
width: "abbreviated",
|
|
738
|
-
context: "formatting"
|
|
739
|
-
}).toLowerCase();
|
|
740
|
-
case "bbbbb":
|
|
741
|
-
return r.dayPeriod(o, {
|
|
742
|
-
width: "narrow",
|
|
743
|
-
context: "formatting"
|
|
744
|
-
});
|
|
745
|
-
case "bbbb":
|
|
746
|
-
default:
|
|
747
|
-
return r.dayPeriod(o, {
|
|
748
|
-
width: "wide",
|
|
749
|
-
context: "formatting"
|
|
750
|
-
});
|
|
751
|
-
}
|
|
752
|
-
},
|
|
753
|
-
// in the morning, in the afternoon, in the evening, at night
|
|
754
|
-
B: function(e, t, r) {
|
|
755
|
-
const n = e.getHours();
|
|
756
|
-
let o;
|
|
757
|
-
switch (n >= 17 ? o = ce.evening : n >= 12 ? o = ce.afternoon : n >= 4 ? o = ce.morning : o = ce.night, t) {
|
|
758
|
-
case "B":
|
|
759
|
-
case "BB":
|
|
760
|
-
case "BBB":
|
|
761
|
-
return r.dayPeriod(o, {
|
|
762
|
-
width: "abbreviated",
|
|
763
|
-
context: "formatting"
|
|
764
|
-
});
|
|
765
|
-
case "BBBBB":
|
|
766
|
-
return r.dayPeriod(o, {
|
|
767
|
-
width: "narrow",
|
|
768
|
-
context: "formatting"
|
|
769
|
-
});
|
|
770
|
-
case "BBBB":
|
|
771
|
-
default:
|
|
772
|
-
return r.dayPeriod(o, {
|
|
773
|
-
width: "wide",
|
|
774
|
-
context: "formatting"
|
|
775
|
-
});
|
|
776
|
-
}
|
|
777
|
-
},
|
|
778
|
-
// Hour [1-12]
|
|
779
|
-
h: function(e, t, r) {
|
|
780
|
-
if (t === "ho") {
|
|
781
|
-
let n = e.getHours() % 12;
|
|
782
|
-
return n === 0 && (n = 12), r.ordinalNumber(n, { unit: "hour" });
|
|
783
|
-
}
|
|
784
|
-
return oe.h(e, t);
|
|
785
|
-
},
|
|
786
|
-
// Hour [0-23]
|
|
787
|
-
H: function(e, t, r) {
|
|
788
|
-
return t === "Ho" ? r.ordinalNumber(e.getHours(), { unit: "hour" }) : oe.H(e, t);
|
|
789
|
-
},
|
|
790
|
-
// Hour [0-11]
|
|
791
|
-
K: function(e, t, r) {
|
|
792
|
-
const n = e.getHours() % 12;
|
|
793
|
-
return t === "Ko" ? r.ordinalNumber(n, { unit: "hour" }) : E(n, t.length);
|
|
794
|
-
},
|
|
795
|
-
// Hour [1-24]
|
|
796
|
-
k: function(e, t, r) {
|
|
797
|
-
let n = e.getHours();
|
|
798
|
-
return n === 0 && (n = 24), t === "ko" ? r.ordinalNumber(n, { unit: "hour" }) : E(n, t.length);
|
|
799
|
-
},
|
|
800
|
-
// Minute
|
|
801
|
-
m: function(e, t, r) {
|
|
802
|
-
return t === "mo" ? r.ordinalNumber(e.getMinutes(), { unit: "minute" }) : oe.m(e, t);
|
|
803
|
-
},
|
|
804
|
-
// Second
|
|
805
|
-
s: function(e, t, r) {
|
|
806
|
-
return t === "so" ? r.ordinalNumber(e.getSeconds(), { unit: "second" }) : oe.s(e, t);
|
|
807
|
-
},
|
|
808
|
-
// Fraction of second
|
|
809
|
-
S: function(e, t) {
|
|
810
|
-
return oe.S(e, t);
|
|
811
|
-
},
|
|
812
|
-
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
813
|
-
X: function(e, t, r) {
|
|
814
|
-
const n = e.getTimezoneOffset();
|
|
815
|
-
if (n === 0)
|
|
816
|
-
return "Z";
|
|
817
|
-
switch (t) {
|
|
818
|
-
case "X":
|
|
819
|
-
return ct(n);
|
|
820
|
-
case "XXXX":
|
|
821
|
-
case "XX":
|
|
822
|
-
return se(n);
|
|
823
|
-
case "XXXXX":
|
|
824
|
-
case "XXX":
|
|
825
|
-
default:
|
|
826
|
-
return se(n, ":");
|
|
827
|
-
}
|
|
828
|
-
},
|
|
829
|
-
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
830
|
-
x: function(e, t, r) {
|
|
831
|
-
const n = e.getTimezoneOffset();
|
|
832
|
-
switch (t) {
|
|
833
|
-
case "x":
|
|
834
|
-
return ct(n);
|
|
835
|
-
case "xxxx":
|
|
836
|
-
case "xx":
|
|
837
|
-
return se(n);
|
|
838
|
-
case "xxxxx":
|
|
839
|
-
case "xxx":
|
|
840
|
-
default:
|
|
841
|
-
return se(n, ":");
|
|
842
|
-
}
|
|
843
|
-
},
|
|
844
|
-
// Timezone (GMT)
|
|
845
|
-
O: function(e, t, r) {
|
|
846
|
-
const n = e.getTimezoneOffset();
|
|
847
|
-
switch (t) {
|
|
848
|
-
case "O":
|
|
849
|
-
case "OO":
|
|
850
|
-
case "OOO":
|
|
851
|
-
return "GMT" + it(n, ":");
|
|
852
|
-
case "OOOO":
|
|
853
|
-
default:
|
|
854
|
-
return "GMT" + se(n, ":");
|
|
855
|
-
}
|
|
856
|
-
},
|
|
857
|
-
// Timezone (specific non-location)
|
|
858
|
-
z: function(e, t, r) {
|
|
859
|
-
const n = e.getTimezoneOffset();
|
|
860
|
-
switch (t) {
|
|
861
|
-
case "z":
|
|
862
|
-
case "zz":
|
|
863
|
-
case "zzz":
|
|
864
|
-
return "GMT" + it(n, ":");
|
|
865
|
-
case "zzzz":
|
|
866
|
-
default:
|
|
867
|
-
return "GMT" + se(n, ":");
|
|
868
|
-
}
|
|
869
|
-
},
|
|
870
|
-
// Seconds timestamp
|
|
871
|
-
t: function(e, t, r) {
|
|
872
|
-
const n = Math.trunc(+e / 1e3);
|
|
873
|
-
return E(n, t.length);
|
|
874
|
-
},
|
|
875
|
-
// Milliseconds timestamp
|
|
876
|
-
T: function(e, t, r) {
|
|
877
|
-
return E(+e, t.length);
|
|
878
|
-
}
|
|
879
|
-
};
|
|
880
|
-
function it(e, t = "") {
|
|
881
|
-
const r = e > 0 ? "-" : "+", n = Math.abs(e), o = Math.trunc(n / 60), a = n % 60;
|
|
882
|
-
return a === 0 ? r + String(o) : r + String(o) + t + E(a, 2);
|
|
883
|
-
}
|
|
884
|
-
function ct(e, t) {
|
|
885
|
-
return e % 60 === 0 ? (e > 0 ? "-" : "+") + E(Math.abs(e) / 60, 2) : se(e, t);
|
|
886
|
-
}
|
|
887
|
-
function se(e, t = "") {
|
|
888
|
-
const r = e > 0 ? "-" : "+", n = Math.abs(e), o = E(Math.trunc(n / 60), 2), a = E(n % 60, 2);
|
|
889
|
-
return r + o + t + a;
|
|
890
|
-
}
|
|
891
|
-
const ut = (e, t) => {
|
|
892
|
-
switch (e) {
|
|
893
|
-
case "P":
|
|
894
|
-
return t.date({ width: "short" });
|
|
895
|
-
case "PP":
|
|
896
|
-
return t.date({ width: "medium" });
|
|
897
|
-
case "PPP":
|
|
898
|
-
return t.date({ width: "long" });
|
|
899
|
-
case "PPPP":
|
|
900
|
-
default:
|
|
901
|
-
return t.date({ width: "full" });
|
|
902
|
-
}
|
|
903
|
-
}, St = (e, t) => {
|
|
904
|
-
switch (e) {
|
|
905
|
-
case "p":
|
|
906
|
-
return t.time({ width: "short" });
|
|
907
|
-
case "pp":
|
|
908
|
-
return t.time({ width: "medium" });
|
|
909
|
-
case "ppp":
|
|
910
|
-
return t.time({ width: "long" });
|
|
911
|
-
case "pppp":
|
|
912
|
-
default:
|
|
913
|
-
return t.time({ width: "full" });
|
|
914
|
-
}
|
|
915
|
-
}, $n = (e, t) => {
|
|
916
|
-
const r = e.match(/(P+)(p+)?/) || [], n = r[1], o = r[2];
|
|
917
|
-
if (!o)
|
|
918
|
-
return ut(e, t);
|
|
919
|
-
let a;
|
|
920
|
-
switch (n) {
|
|
921
|
-
case "P":
|
|
922
|
-
a = t.dateTime({ width: "short" });
|
|
923
|
-
break;
|
|
924
|
-
case "PP":
|
|
925
|
-
a = t.dateTime({ width: "medium" });
|
|
926
|
-
break;
|
|
927
|
-
case "PPP":
|
|
928
|
-
a = t.dateTime({ width: "long" });
|
|
929
|
-
break;
|
|
930
|
-
case "PPPP":
|
|
931
|
-
default:
|
|
932
|
-
a = t.dateTime({ width: "full" });
|
|
933
|
-
break;
|
|
934
|
-
}
|
|
935
|
-
return a.replace("{{date}}", ut(n, t)).replace("{{time}}", St(o, t));
|
|
936
|
-
}, jn = {
|
|
937
|
-
p: St,
|
|
938
|
-
P: $n
|
|
939
|
-
}, Rn = /^D+$/, zn = /^Y+$/, Un = ["D", "DD", "YY", "YYYY"];
|
|
940
|
-
function Qn(e) {
|
|
941
|
-
return Rn.test(e);
|
|
942
|
-
}
|
|
943
|
-
function Kn(e) {
|
|
944
|
-
return zn.test(e);
|
|
945
|
-
}
|
|
946
|
-
function Zn(e, t, r) {
|
|
947
|
-
const n = Xn(e, t, r);
|
|
948
|
-
if (console.warn(n), Un.includes(e)) throw new RangeError(n);
|
|
949
|
-
}
|
|
950
|
-
function Xn(e, t, r) {
|
|
951
|
-
const n = e[0] === "Y" ? "years" : "days of the month";
|
|
952
|
-
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
953
|
-
}
|
|
954
|
-
const Vn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Jn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ln = /^'([^]*?)'?$/, er = /''/g, tr = /[a-zA-Z]/;
|
|
955
|
-
function me(e, t, r) {
|
|
956
|
-
const n = ve(), o = r?.locale ?? n.locale ?? fe, a = r?.firstWeekContainsDate ?? r?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, i = r?.weekStartsOn ?? r?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = x(e, r?.in);
|
|
957
|
-
if (!_n(s))
|
|
958
|
-
throw new RangeError("Invalid time value");
|
|
959
|
-
let c = t.match(Jn).map((l) => {
|
|
960
|
-
const f = l[0];
|
|
961
|
-
if (f === "p" || f === "P") {
|
|
962
|
-
const h = jn[f];
|
|
963
|
-
return h(l, o.formatLong);
|
|
964
|
-
}
|
|
965
|
-
return l;
|
|
966
|
-
}).join("").match(Vn).map((l) => {
|
|
967
|
-
if (l === "''")
|
|
968
|
-
return { isToken: !1, value: "'" };
|
|
969
|
-
const f = l[0];
|
|
970
|
-
if (f === "'")
|
|
971
|
-
return { isToken: !1, value: nr(l) };
|
|
972
|
-
if (at[f])
|
|
973
|
-
return { isToken: !0, value: l };
|
|
974
|
-
if (f.match(tr))
|
|
975
|
-
throw new RangeError(
|
|
976
|
-
"Format string contains an unescaped latin alphabet character `" + f + "`"
|
|
977
|
-
);
|
|
978
|
-
return { isToken: !1, value: l };
|
|
979
|
-
});
|
|
980
|
-
o.localize.preprocessor && (c = o.localize.preprocessor(s, c));
|
|
981
|
-
const u = {
|
|
982
|
-
firstWeekContainsDate: a,
|
|
983
|
-
weekStartsOn: i,
|
|
984
|
-
locale: o
|
|
985
|
-
};
|
|
986
|
-
return c.map((l) => {
|
|
987
|
-
if (!l.isToken) return l.value;
|
|
988
|
-
const f = l.value;
|
|
989
|
-
(!r?.useAdditionalWeekYearTokens && Kn(f) || !r?.useAdditionalDayOfYearTokens && Qn(f)) && Zn(f, t, String(e));
|
|
990
|
-
const h = at[f[0]];
|
|
991
|
-
return h(s, f, o.localize, u);
|
|
992
|
-
}).join("");
|
|
993
|
-
}
|
|
994
|
-
function nr(e) {
|
|
995
|
-
const t = e.match(Ln);
|
|
996
|
-
return t ? t[1].replace(er, "'") : e;
|
|
997
|
-
}
|
|
998
|
-
function rr(e, t) {
|
|
999
|
-
const r = x(e, t?.in), n = r.getFullYear(), o = r.getMonth(), a = I(r, 0);
|
|
1000
|
-
return a.setFullYear(n, o + 1, 0), a.setHours(0, 0, 0, 0), a.getDate();
|
|
1001
|
-
}
|
|
1002
|
-
function or(e, t) {
|
|
1003
|
-
return x(e, t?.in).getMonth();
|
|
1004
|
-
}
|
|
1005
|
-
function sr(e, t) {
|
|
1006
|
-
return x(e, t?.in).getFullYear();
|
|
1007
|
-
}
|
|
1008
|
-
function ar(e, t) {
|
|
1009
|
-
return +x(e) > +x(t);
|
|
1010
|
-
}
|
|
1011
|
-
function ir(e, t) {
|
|
1012
|
-
return +x(e) < +x(t);
|
|
1013
|
-
}
|
|
1014
|
-
function cr(e, t, r) {
|
|
1015
|
-
const [n, o] = de(
|
|
1016
|
-
r?.in,
|
|
1017
|
-
e,
|
|
1018
|
-
t
|
|
1019
|
-
);
|
|
1020
|
-
return n.getFullYear() === o.getFullYear() && n.getMonth() === o.getMonth();
|
|
1021
|
-
}
|
|
1022
|
-
function ur(e, t, r) {
|
|
1023
|
-
const [n, o] = de(
|
|
1024
|
-
r?.in,
|
|
1025
|
-
e,
|
|
1026
|
-
t
|
|
1027
|
-
);
|
|
1028
|
-
return n.getFullYear() === o.getFullYear();
|
|
1029
|
-
}
|
|
1030
|
-
function fr(e, t, r) {
|
|
1031
|
-
const n = x(e, r?.in), o = n.getFullYear(), a = n.getDate(), i = I(e, 0);
|
|
1032
|
-
i.setFullYear(o, t, 15), i.setHours(0, 0, 0, 0);
|
|
1033
|
-
const s = rr(i);
|
|
1034
|
-
return n.setMonth(t, Math.min(a, s)), n;
|
|
1035
|
-
}
|
|
1036
|
-
function lr(e, t, r) {
|
|
1037
|
-
const n = x(e, r?.in);
|
|
1038
|
-
return isNaN(+n) ? I(e, NaN) : (n.setFullYear(t), n);
|
|
1039
|
-
}
|
|
1040
|
-
const ft = 5, dr = 4;
|
|
1041
|
-
function hr(e, t) {
|
|
1042
|
-
const r = t.startOfMonth(e), n = r.getDay() > 0 ? r.getDay() : 7, o = t.addDays(e, -n + 1), a = t.addDays(o, ft * 7 - 1);
|
|
1043
|
-
return t.getMonth(e) === t.getMonth(a) ? ft : dr;
|
|
1044
|
-
}
|
|
1045
|
-
function Nt(e, t) {
|
|
1046
|
-
const r = t.startOfMonth(e), n = r.getDay();
|
|
1047
|
-
return n === 1 ? r : n === 0 ? t.addDays(r, -1 * 6) : t.addDays(r, -1 * (n - 1));
|
|
1048
|
-
}
|
|
1049
|
-
function mr(e, t) {
|
|
1050
|
-
const r = Nt(e, t), n = hr(e, t);
|
|
1051
|
-
return t.addDays(r, n * 7 - 1);
|
|
1052
|
-
}
|
|
1053
|
-
const Ct = {
|
|
1054
|
-
...fe,
|
|
1055
|
-
labels: {
|
|
1056
|
-
labelDayButton: (e, t, r, n) => {
|
|
1057
|
-
let o;
|
|
1058
|
-
n && typeof n.format == "function" ? o = n.format.bind(n) : o = (i, s) => me(i, s, { locale: fe, ...r });
|
|
1059
|
-
let a = o(e, "PPPP");
|
|
1060
|
-
return t.today && (a = `Today, ${a}`), t.selected && (a = `${a}, selected`), a;
|
|
1061
|
-
},
|
|
1062
|
-
labelMonthDropdown: "Choose the Month",
|
|
1063
|
-
labelNext: "Go to the Next Month",
|
|
1064
|
-
labelPrevious: "Go to the Previous Month",
|
|
1065
|
-
labelWeekNumber: (e) => `Week ${e}`,
|
|
1066
|
-
labelYearDropdown: "Choose the Year",
|
|
1067
|
-
labelGrid: (e, t, r) => {
|
|
1068
|
-
let n;
|
|
1069
|
-
return r && typeof r.format == "function" ? n = r.format.bind(r) : n = (o, a) => me(o, a, { locale: fe, ...t }), n(e, "LLLL yyyy");
|
|
1070
|
-
},
|
|
1071
|
-
labelGridcell: (e, t, r, n) => {
|
|
1072
|
-
let o;
|
|
1073
|
-
n && typeof n.format == "function" ? o = n.format.bind(n) : o = (i, s) => me(i, s, { locale: fe, ...r });
|
|
1074
|
-
let a = o(e, "PPPP");
|
|
1075
|
-
return t?.today && (a = `Today, ${a}`), a;
|
|
1076
|
-
},
|
|
1077
|
-
labelNav: "Navigation bar",
|
|
1078
|
-
labelWeekNumberHeader: "Week Number",
|
|
1079
|
-
labelWeekday: (e, t, r) => {
|
|
1080
|
-
let n;
|
|
1081
|
-
return r && typeof r.format == "function" ? n = r.format.bind(r) : n = (o, a) => me(o, a, { locale: fe, ...t }), n(e, "cccc");
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
};
|
|
1085
|
-
class G {
|
|
1086
|
-
/**
|
|
1087
|
-
* Creates an instance of `DateLib`.
|
|
1088
|
-
*
|
|
1089
|
-
* @param options Configuration options for the date library.
|
|
1090
|
-
* @param overrides Custom overrides for the date library functions.
|
|
1091
|
-
*/
|
|
1092
|
-
constructor(t, r) {
|
|
1093
|
-
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? H.tz(this.options.timeZone) : new this.Date(), this.newDate = (n, o, a) => this.overrides?.newDate ? this.overrides.newDate(n, o, a) : this.options.timeZone ? new H(n, o, a, this.options.timeZone) : new Date(n, o, a), this.addDays = (n, o) => this.overrides?.addDays ? this.overrides.addDays(n, o) : Dt(n, o), this.addMonths = (n, o) => this.overrides?.addMonths ? this.overrides.addMonths(n, o) : Mt(n, o), this.addWeeks = (n, o) => this.overrides?.addWeeks ? this.overrides.addWeeks(n, o) : Cn(n, o), this.addYears = (n, o) => this.overrides?.addYears ? this.overrides.addYears(n, o) : Yn(n, o), this.differenceInCalendarDays = (n, o) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(n, o) : je(n, o), this.differenceInCalendarMonths = (n, o) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(n, o) : kt(n, o), this.eachMonthOfInterval = (n) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(n) : Pn(n), this.eachYearOfInterval = (n) => {
|
|
1094
|
-
const o = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(n) : Hn(n), a = new Set(o.map((s) => this.getYear(s)));
|
|
1095
|
-
if (a.size === o.length)
|
|
1096
|
-
return o;
|
|
1097
|
-
const i = [];
|
|
1098
|
-
return a.forEach((s) => {
|
|
1099
|
-
i.push(new Date(s, 0, 1));
|
|
1100
|
-
}), i;
|
|
1101
|
-
}, this.endOfBroadcastWeek = (n) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(n) : mr(n, this), this.endOfISOWeek = (n) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(n) : qn(n), this.endOfMonth = (n) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(n) : Fn(n), this.endOfWeek = (n, o) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(n, o) : vt(n, this.options), this.endOfYear = (n) => this.overrides?.endOfYear ? this.overrides.endOfYear(n) : In(n), this.format = (n, o, a) => {
|
|
1102
|
-
const i = this.overrides?.format ? this.overrides.format(n, o, this.options) : me(n, o, this.options);
|
|
1103
|
-
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(i) : i;
|
|
1104
|
-
}, this.getISOWeek = (n) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(n) : Re(n), this.getMonth = (n, o) => this.overrides?.getMonth ? this.overrides.getMonth(n, this.options) : or(n, this.options), this.getYear = (n, o) => this.overrides?.getYear ? this.overrides.getYear(n, this.options) : sr(n, this.options), this.getWeek = (n, o) => this.overrides?.getWeek ? this.overrides.getWeek(n, this.options) : ze(n, this.options), this.isAfter = (n, o) => this.overrides?.isAfter ? this.overrides.isAfter(n, o) : ar(n, o), this.isBefore = (n, o) => this.overrides?.isBefore ? this.overrides.isBefore(n, o) : ir(n, o), this.isDate = (n) => this.overrides?.isDate ? this.overrides.isDate(n) : wt(n), this.isSameDay = (n, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(n, o) : xn(n, o), this.isSameMonth = (n, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(n, o) : cr(n, o), this.isSameYear = (n, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(n, o) : ur(n, o), this.max = (n) => this.overrides?.max ? this.overrides.max(n) : Tn(n), this.min = (n) => this.overrides?.min ? this.overrides.min(n) : En(n), this.setMonth = (n, o) => this.overrides?.setMonth ? this.overrides.setMonth(n, o) : fr(n, o), this.setYear = (n, o) => this.overrides?.setYear ? this.overrides.setYear(n, o) : lr(n, o), this.startOfBroadcastWeek = (n, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(n, this) : Nt(n, this), this.startOfDay = (n) => this.overrides?.startOfDay ? this.overrides.startOfDay(n) : ge(n), this.startOfISOWeek = (n) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(n) : ye(n), this.startOfMonth = (n) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(n) : Bn(n), this.startOfWeek = (n, o) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(n, this.options) : le(n, this.options), this.startOfYear = (n) => this.overrides?.startOfYear ? this.overrides.startOfYear(n) : Ot(n), this.options = { locale: Ct, ...t }, this.overrides = r;
|
|
1105
|
-
}
|
|
1106
|
-
/**
|
|
1107
|
-
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
1108
|
-
* digits.
|
|
1109
|
-
*
|
|
1110
|
-
* @since 9.5.0
|
|
1111
|
-
* @returns A record mapping Arabic digits to the target numerals.
|
|
1112
|
-
*/
|
|
1113
|
-
getDigitMap() {
|
|
1114
|
-
const { numerals: t = "latn" } = this.options, r = new Intl.NumberFormat("en-US", {
|
|
1115
|
-
numberingSystem: t
|
|
1116
|
-
}), n = {};
|
|
1117
|
-
for (let o = 0; o < 10; o++)
|
|
1118
|
-
n[o.toString()] = r.format(o);
|
|
1119
|
-
return n;
|
|
1120
|
-
}
|
|
1121
|
-
/**
|
|
1122
|
-
* Replaces Arabic digits in a string with the target numbering system digits.
|
|
1123
|
-
*
|
|
1124
|
-
* @since 9.5.0
|
|
1125
|
-
* @param input The string containing Arabic digits.
|
|
1126
|
-
* @returns The string with digits replaced.
|
|
1127
|
-
*/
|
|
1128
|
-
replaceDigits(t) {
|
|
1129
|
-
const r = this.getDigitMap();
|
|
1130
|
-
return t.replace(/\d/g, (n) => r[n] || n);
|
|
1131
|
-
}
|
|
1132
|
-
/**
|
|
1133
|
-
* Formats a number using the configured numbering system.
|
|
1134
|
-
*
|
|
1135
|
-
* @since 9.5.0
|
|
1136
|
-
* @param value The number to format.
|
|
1137
|
-
* @returns The formatted number as a string.
|
|
1138
|
-
*/
|
|
1139
|
-
formatNumber(t) {
|
|
1140
|
-
return this.replaceDigits(t.toString());
|
|
1141
|
-
}
|
|
1142
|
-
/**
|
|
1143
|
-
* Returns the preferred ordering for month and year labels for the current
|
|
1144
|
-
* locale.
|
|
1145
|
-
*/
|
|
1146
|
-
getMonthYearOrder() {
|
|
1147
|
-
const t = this.options.locale?.code;
|
|
1148
|
-
return t && G.yearFirstLocales.has(t) ? "year-first" : "month-first";
|
|
1149
|
-
}
|
|
1150
|
-
/**
|
|
1151
|
-
* Formats the month/year pair respecting locale conventions.
|
|
1152
|
-
*
|
|
1153
|
-
* @since 9.11.0
|
|
1154
|
-
*/
|
|
1155
|
-
formatMonthYear(t) {
|
|
1156
|
-
const { locale: r, timeZone: n, numerals: o } = this.options, a = r?.code;
|
|
1157
|
-
if (a && G.yearFirstLocales.has(a))
|
|
1158
|
-
try {
|
|
1159
|
-
return new Intl.DateTimeFormat(a, {
|
|
1160
|
-
month: "long",
|
|
1161
|
-
year: "numeric",
|
|
1162
|
-
timeZone: n,
|
|
1163
|
-
numberingSystem: o
|
|
1164
|
-
}).format(t);
|
|
1165
|
-
} catch {
|
|
1166
|
-
}
|
|
1167
|
-
const i = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
1168
|
-
return this.format(t, i);
|
|
1169
|
-
}
|
|
1170
|
-
}
|
|
1171
|
-
G.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
1172
|
-
"eu",
|
|
1173
|
-
"hu",
|
|
1174
|
-
"ja",
|
|
1175
|
-
"ja-Hira",
|
|
1176
|
-
"ja-JP",
|
|
1177
|
-
"ko",
|
|
1178
|
-
"ko-KR",
|
|
1179
|
-
"lt",
|
|
1180
|
-
"lt-LT",
|
|
1181
|
-
"lv",
|
|
1182
|
-
"lv-LV",
|
|
1183
|
-
"mn",
|
|
1184
|
-
"mn-MN",
|
|
1185
|
-
"zh",
|
|
1186
|
-
"zh-CN",
|
|
1187
|
-
"zh-HK",
|
|
1188
|
-
"zh-TW"
|
|
1189
|
-
]);
|
|
1190
|
-
const z = new G(), Go = z;
|
|
1191
|
-
class Yt {
|
|
1192
|
-
constructor(t, r, n = z) {
|
|
1193
|
-
this.date = t, this.displayMonth = r, this.outside = !!(r && !n.isSameMonth(t, r)), this.dateLib = n, this.isoDate = n.format(t, "yyyy-MM-dd"), this.displayMonthId = n.format(r, "yyyy-MM"), this.dateMonthId = n.format(t, "yyyy-MM");
|
|
1194
|
-
}
|
|
1195
|
-
/**
|
|
1196
|
-
* Checks if this day is equal to another `CalendarDay`, considering both the
|
|
1197
|
-
* date and the displayed month.
|
|
1198
|
-
*
|
|
1199
|
-
* @param day The `CalendarDay` to compare with.
|
|
1200
|
-
* @returns `true` if the days are equal, otherwise `false`.
|
|
1201
|
-
*/
|
|
1202
|
-
isEqualTo(t) {
|
|
1203
|
-
return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
|
|
1204
|
-
}
|
|
1205
|
-
}
|
|
1206
|
-
class yr {
|
|
1207
|
-
constructor(t, r) {
|
|
1208
|
-
this.date = t, this.weeks = r;
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
class gr {
|
|
1212
|
-
constructor(t, r) {
|
|
1213
|
-
this.days = r, this.weekNumber = t;
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
function Dr(e) {
|
|
1217
|
-
return d.createElement("button", { ...e });
|
|
1218
|
-
}
|
|
1219
|
-
function Mr(e) {
|
|
1220
|
-
return d.createElement("span", { ...e });
|
|
1221
|
-
}
|
|
1222
|
-
function br(e) {
|
|
1223
|
-
const { size: t = 24, orientation: r = "left", className: n } = e;
|
|
1224
|
-
return (
|
|
1225
|
-
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
|
|
1226
|
-
d.createElement(
|
|
1227
|
-
"svg",
|
|
1228
|
-
{ className: n, width: t, height: t, viewBox: "0 0 24 24" },
|
|
1229
|
-
r === "up" && d.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
|
|
1230
|
-
r === "down" && d.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
|
|
1231
|
-
r === "left" && d.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
1232
|
-
r === "right" && d.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
|
|
1233
|
-
)
|
|
1234
|
-
);
|
|
1235
|
-
}
|
|
1236
|
-
function wr(e) {
|
|
1237
|
-
const { day: t, modifiers: r, ...n } = e;
|
|
1238
|
-
return d.createElement("td", { ...n });
|
|
1239
|
-
}
|
|
1240
|
-
function kr(e) {
|
|
1241
|
-
const { day: t, modifiers: r, ...n } = e, o = d.useRef(null);
|
|
1242
|
-
return d.useEffect(() => {
|
|
1243
|
-
r.focused && o.current?.focus();
|
|
1244
|
-
}, [r.focused]), d.createElement("button", { ref: o, ...n });
|
|
1245
|
-
}
|
|
1246
|
-
var y;
|
|
1247
|
-
(function(e) {
|
|
1248
|
-
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";
|
|
1249
|
-
})(y || (y = {}));
|
|
1250
|
-
var F;
|
|
1251
|
-
(function(e) {
|
|
1252
|
-
e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
|
|
1253
|
-
})(F || (F = {}));
|
|
1254
|
-
var Z;
|
|
1255
|
-
(function(e) {
|
|
1256
|
-
e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
|
|
1257
|
-
})(Z || (Z = {}));
|
|
1258
|
-
var A;
|
|
1259
|
-
(function(e) {
|
|
1260
|
-
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";
|
|
1261
|
-
})(A || (A = {}));
|
|
1262
|
-
function pr(e) {
|
|
1263
|
-
const { options: t, className: r, components: n, classNames: o, ...a } = e, i = [o[y.Dropdown], r].join(" "), s = t?.find(({ value: c }) => c === a.value);
|
|
1264
|
-
return d.createElement(
|
|
1265
|
-
"span",
|
|
1266
|
-
{ "data-disabled": a.disabled, className: o[y.DropdownRoot] },
|
|
1267
|
-
d.createElement(n.Select, { className: i, ...a }, t?.map(({ value: c, label: u, disabled: l }) => d.createElement(n.Option, { key: c, value: c, disabled: l }, u))),
|
|
1268
|
-
d.createElement(
|
|
1269
|
-
"span",
|
|
1270
|
-
{ className: o[y.CaptionLabel], "aria-hidden": !0 },
|
|
1271
|
-
s?.label,
|
|
1272
|
-
d.createElement(n.Chevron, { orientation: "down", size: 18, className: o[y.Chevron] })
|
|
1273
|
-
)
|
|
1274
|
-
);
|
|
1275
|
-
}
|
|
1276
|
-
function Or(e) {
|
|
1277
|
-
return d.createElement("div", { ...e });
|
|
1278
|
-
}
|
|
1279
|
-
function vr(e) {
|
|
1280
|
-
return d.createElement("div", { ...e });
|
|
1281
|
-
}
|
|
1282
|
-
function Wr(e) {
|
|
1283
|
-
const { calendarMonth: t, displayIndex: r, ...n } = e;
|
|
1284
|
-
return d.createElement("div", { ...n }, e.children);
|
|
1285
|
-
}
|
|
1286
|
-
function Sr(e) {
|
|
1287
|
-
const { calendarMonth: t, displayIndex: r, ...n } = e;
|
|
1288
|
-
return d.createElement("div", { ...n });
|
|
1289
|
-
}
|
|
1290
|
-
function Nr(e) {
|
|
1291
|
-
return d.createElement("table", { ...e });
|
|
1292
|
-
}
|
|
1293
|
-
function Cr(e) {
|
|
1294
|
-
return d.createElement("div", { ...e });
|
|
1295
|
-
}
|
|
1296
|
-
const Tt = bn(void 0);
|
|
1297
|
-
function De() {
|
|
1298
|
-
const e = wn(Tt);
|
|
1299
|
-
if (e === void 0)
|
|
1300
|
-
throw new Error("useDayPicker() must be used within a custom component.");
|
|
1301
|
-
return e;
|
|
1302
|
-
}
|
|
1303
|
-
function Yr(e) {
|
|
1304
|
-
const { components: t } = De();
|
|
1305
|
-
return d.createElement(t.Dropdown, { ...e });
|
|
1306
|
-
}
|
|
1307
|
-
function Tr(e) {
|
|
1308
|
-
const { onPreviousClick: t, onNextClick: r, previousMonth: n, nextMonth: o, ...a } = e, { components: i, classNames: s, labels: { labelPrevious: c, labelNext: u } } = De(), l = j((h) => {
|
|
1309
|
-
o && r?.(h);
|
|
1310
|
-
}, [o, r]), f = j((h) => {
|
|
1311
|
-
n && t?.(h);
|
|
1312
|
-
}, [n, t]);
|
|
1313
|
-
return d.createElement(
|
|
1314
|
-
"nav",
|
|
1315
|
-
{ ...a },
|
|
1316
|
-
d.createElement(
|
|
1317
|
-
i.PreviousMonthButton,
|
|
1318
|
-
{ type: "button", className: s[y.PreviousMonthButton], tabIndex: n ? void 0 : -1, "aria-disabled": n ? void 0 : !0, "aria-label": c(n), onClick: f },
|
|
1319
|
-
d.createElement(i.Chevron, { disabled: n ? void 0 : !0, className: s[y.Chevron], orientation: "left" })
|
|
1320
|
-
),
|
|
1321
|
-
d.createElement(
|
|
1322
|
-
i.NextMonthButton,
|
|
1323
|
-
{ type: "button", className: s[y.NextMonthButton], tabIndex: o ? void 0 : -1, "aria-disabled": o ? void 0 : !0, "aria-label": u(o), onClick: l },
|
|
1324
|
-
d.createElement(i.Chevron, { disabled: o ? void 0 : !0, orientation: "right", className: s[y.Chevron] })
|
|
1325
|
-
)
|
|
1326
|
-
);
|
|
1327
|
-
}
|
|
1328
|
-
function Er(e) {
|
|
1329
|
-
const { components: t } = De();
|
|
1330
|
-
return d.createElement(t.Button, { ...e });
|
|
1331
|
-
}
|
|
1332
|
-
function xr(e) {
|
|
1333
|
-
return d.createElement("option", { ...e });
|
|
1334
|
-
}
|
|
1335
|
-
function _r(e) {
|
|
1336
|
-
const { components: t } = De();
|
|
1337
|
-
return d.createElement(t.Button, { ...e });
|
|
1338
|
-
}
|
|
1339
|
-
function Fr(e) {
|
|
1340
|
-
const { rootRef: t, ...r } = e;
|
|
1341
|
-
return d.createElement("div", { ...r, ref: t });
|
|
1342
|
-
}
|
|
1343
|
-
function Pr(e) {
|
|
1344
|
-
return d.createElement("select", { ...e });
|
|
1345
|
-
}
|
|
1346
|
-
function Br(e) {
|
|
1347
|
-
const { week: t, ...r } = e;
|
|
1348
|
-
return d.createElement("tr", { ...r });
|
|
1349
|
-
}
|
|
1350
|
-
function Ir(e) {
|
|
1351
|
-
return d.createElement("th", { ...e });
|
|
1352
|
-
}
|
|
1353
|
-
function Hr(e) {
|
|
1354
|
-
return d.createElement(
|
|
1355
|
-
"thead",
|
|
1356
|
-
{ "aria-hidden": !0 },
|
|
1357
|
-
d.createElement("tr", { ...e })
|
|
1358
|
-
);
|
|
1359
|
-
}
|
|
1360
|
-
function qr(e) {
|
|
1361
|
-
const { week: t, ...r } = e;
|
|
1362
|
-
return d.createElement("th", { ...r });
|
|
1363
|
-
}
|
|
1364
|
-
function Ar(e) {
|
|
1365
|
-
return d.createElement("th", { ...e });
|
|
1366
|
-
}
|
|
1367
|
-
function Gr(e) {
|
|
1368
|
-
return d.createElement("tbody", { ...e });
|
|
1369
|
-
}
|
|
1370
|
-
function $r(e) {
|
|
1371
|
-
const { components: t } = De();
|
|
1372
|
-
return d.createElement(t.Dropdown, { ...e });
|
|
1373
|
-
}
|
|
1374
|
-
const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1375
|
-
__proto__: null,
|
|
1376
|
-
Button: Dr,
|
|
1377
|
-
CaptionLabel: Mr,
|
|
1378
|
-
Chevron: br,
|
|
1379
|
-
Day: wr,
|
|
1380
|
-
DayButton: kr,
|
|
1381
|
-
Dropdown: pr,
|
|
1382
|
-
DropdownNav: Or,
|
|
1383
|
-
Footer: vr,
|
|
1384
|
-
Month: Wr,
|
|
1385
|
-
MonthCaption: Sr,
|
|
1386
|
-
MonthGrid: Nr,
|
|
1387
|
-
Months: Cr,
|
|
1388
|
-
MonthsDropdown: Yr,
|
|
1389
|
-
Nav: Tr,
|
|
1390
|
-
NextMonthButton: Er,
|
|
1391
|
-
Option: xr,
|
|
1392
|
-
PreviousMonthButton: _r,
|
|
1393
|
-
Root: Fr,
|
|
1394
|
-
Select: Pr,
|
|
1395
|
-
Week: Br,
|
|
1396
|
-
WeekNumber: qr,
|
|
1397
|
-
WeekNumberHeader: Ar,
|
|
1398
|
-
Weekday: Ir,
|
|
1399
|
-
Weekdays: Hr,
|
|
1400
|
-
Weeks: Gr,
|
|
1401
|
-
YearsDropdown: $r
|
|
1402
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1403
|
-
function L(e, t, r = !1, n = z) {
|
|
1404
|
-
let { from: o, to: a } = e;
|
|
1405
|
-
const { differenceInCalendarDays: i, isSameDay: s } = n;
|
|
1406
|
-
return o && a ? (i(a, o) < 0 && ([o, a] = [a, o]), i(t, o) >= (r ? 1 : 0) && i(a, t) >= (r ? 1 : 0)) : !r && a ? s(a, t) : !r && o ? s(o, t) : !1;
|
|
1407
|
-
}
|
|
1408
|
-
const $o = (e, t) => L(e, t, !1, z);
|
|
1409
|
-
function Ue(e) {
|
|
1410
|
-
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
1411
|
-
}
|
|
1412
|
-
function We(e) {
|
|
1413
|
-
return !!(e && typeof e == "object" && "from" in e);
|
|
1414
|
-
}
|
|
1415
|
-
function Qe(e) {
|
|
1416
|
-
return !!(e && typeof e == "object" && "after" in e);
|
|
1417
|
-
}
|
|
1418
|
-
function Ke(e) {
|
|
1419
|
-
return !!(e && typeof e == "object" && "before" in e);
|
|
1420
|
-
}
|
|
1421
|
-
function Et(e) {
|
|
1422
|
-
return !!(e && typeof e == "object" && "dayOfWeek" in e);
|
|
1423
|
-
}
|
|
1424
|
-
function xt(e, t) {
|
|
1425
|
-
return Array.isArray(e) && e.every(t.isDate);
|
|
1426
|
-
}
|
|
1427
|
-
function ee(e, t, r = z) {
|
|
1428
|
-
const n = Array.isArray(t) ? t : [t], { isSameDay: o, differenceInCalendarDays: a, isAfter: i } = r;
|
|
1429
|
-
return n.some((s) => {
|
|
1430
|
-
if (typeof s == "boolean")
|
|
1431
|
-
return s;
|
|
1432
|
-
if (r.isDate(s))
|
|
1433
|
-
return o(e, s);
|
|
1434
|
-
if (xt(s, r))
|
|
1435
|
-
return s.some((c) => o(e, c));
|
|
1436
|
-
if (We(s))
|
|
1437
|
-
return L(s, e, !1, r);
|
|
1438
|
-
if (Et(s))
|
|
1439
|
-
return Array.isArray(s.dayOfWeek) ? s.dayOfWeek.includes(e.getDay()) : s.dayOfWeek === e.getDay();
|
|
1440
|
-
if (Ue(s)) {
|
|
1441
|
-
const c = a(s.before, e), u = a(s.after, e), l = c > 0, f = u < 0;
|
|
1442
|
-
return i(s.before, s.after) ? f && l : l || f;
|
|
1443
|
-
}
|
|
1444
|
-
return Qe(s) ? a(e, s.after) > 0 : Ke(s) ? a(s.before, e) > 0 : typeof s == "function" ? s(e) : !1;
|
|
1445
|
-
});
|
|
1446
|
-
}
|
|
1447
|
-
const jo = ee;
|
|
1448
|
-
function Rr(e, t, r, n, o) {
|
|
1449
|
-
const { disabled: a, hidden: i, modifiers: s, showOutsideDays: c, broadcastCalendar: u, today: l = o.today() } = t, { isSameDay: f, isSameMonth: h, startOfMonth: g, isBefore: v, endOfMonth: N, isAfter: O } = o, T = r && g(r), w = n && N(n), M = {
|
|
1450
|
-
[F.focused]: [],
|
|
1451
|
-
[F.outside]: [],
|
|
1452
|
-
[F.disabled]: [],
|
|
1453
|
-
[F.hidden]: [],
|
|
1454
|
-
[F.today]: []
|
|
1455
|
-
}, k = {};
|
|
1456
|
-
for (const D of e) {
|
|
1457
|
-
const { date: m, displayMonth: W } = D, _ = !!(W && !h(m, W)), B = !!(T && v(m, T)), P = !!(w && O(m, w)), X = !!(a && ee(m, a, o)), re = !!(i && ee(m, i, o)) || B || P || // Broadcast calendar will show outside days as default
|
|
1458
|
-
!u && !c && _ || u && c === !1 && _, te = f(m, l);
|
|
1459
|
-
_ && M.outside.push(D), X && M.disabled.push(D), re && M.hidden.push(D), te && M.today.push(D), s && Object.keys(s).forEach(($) => {
|
|
1460
|
-
const ie = s?.[$];
|
|
1461
|
-
ie && ee(m, ie, o) && (k[$] ? k[$].push(D) : k[$] = [D]);
|
|
1462
|
-
});
|
|
1463
|
-
}
|
|
1464
|
-
return (D) => {
|
|
1465
|
-
const m = {
|
|
1466
|
-
[F.focused]: !1,
|
|
1467
|
-
[F.disabled]: !1,
|
|
1468
|
-
[F.hidden]: !1,
|
|
1469
|
-
[F.outside]: !1,
|
|
1470
|
-
[F.today]: !1
|
|
1471
|
-
}, W = {};
|
|
1472
|
-
for (const _ in M) {
|
|
1473
|
-
const B = M[_];
|
|
1474
|
-
m[_] = B.some((P) => P === D);
|
|
1475
|
-
}
|
|
1476
|
-
for (const _ in k)
|
|
1477
|
-
W[_] = k[_].some((B) => B === D);
|
|
1478
|
-
return {
|
|
1479
|
-
...m,
|
|
1480
|
-
// custom modifiers should override all the previous ones
|
|
1481
|
-
...W
|
|
1482
|
-
};
|
|
1483
|
-
};
|
|
1484
|
-
}
|
|
1485
|
-
function zr(e, t, r = {}) {
|
|
1486
|
-
return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [a]) => (r[a] ? o.push(r[a]) : t[F[a]] ? o.push(t[F[a]]) : t[Z[a]] && o.push(t[Z[a]]), o), [t[y.Day]]);
|
|
1487
|
-
}
|
|
1488
|
-
function Ur(e) {
|
|
1489
|
-
return {
|
|
1490
|
-
...jr,
|
|
1491
|
-
...e
|
|
1492
|
-
};
|
|
1493
|
-
}
|
|
1494
|
-
function Qr(e) {
|
|
1495
|
-
const t = {
|
|
1496
|
-
"data-mode": e.mode ?? void 0,
|
|
1497
|
-
"data-required": "required" in e ? e.required : void 0,
|
|
1498
|
-
"data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
|
|
1499
|
-
"data-week-numbers": e.showWeekNumber || void 0,
|
|
1500
|
-
"data-broadcast-calendar": e.broadcastCalendar || void 0,
|
|
1501
|
-
"data-nav-layout": e.navLayout || void 0
|
|
1502
|
-
};
|
|
1503
|
-
return Object.entries(e).forEach(([r, n]) => {
|
|
1504
|
-
r.startsWith("data-") && (t[r] = n);
|
|
1505
|
-
}), t;
|
|
1506
|
-
}
|
|
1507
|
-
function Kr() {
|
|
1508
|
-
const e = {};
|
|
1509
|
-
for (const t in y)
|
|
1510
|
-
e[y[t]] = `rdp-${y[t]}`;
|
|
1511
|
-
for (const t in F)
|
|
1512
|
-
e[F[t]] = `rdp-${F[t]}`;
|
|
1513
|
-
for (const t in Z)
|
|
1514
|
-
e[Z[t]] = `rdp-${Z[t]}`;
|
|
1515
|
-
for (const t in A)
|
|
1516
|
-
e[A[t]] = `rdp-${A[t]}`;
|
|
1517
|
-
return e;
|
|
1518
|
-
}
|
|
1519
|
-
function _t(e, t, r) {
|
|
1520
|
-
return (r ?? new G(t)).formatMonthYear(e);
|
|
1521
|
-
}
|
|
1522
|
-
const Zr = _t;
|
|
1523
|
-
function Xr(e, t, r) {
|
|
1524
|
-
return (r ?? new G(t)).format(e, "d");
|
|
1525
|
-
}
|
|
1526
|
-
function Vr(e, t = z) {
|
|
1527
|
-
return t.format(e, "LLLL");
|
|
1528
|
-
}
|
|
1529
|
-
function Jr(e, t, r) {
|
|
1530
|
-
return (r ?? new G(t)).format(e, "cccccc");
|
|
1531
|
-
}
|
|
1532
|
-
function Lr(e, t = z) {
|
|
1533
|
-
return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
|
|
1534
|
-
}
|
|
1535
|
-
function eo() {
|
|
1536
|
-
return "";
|
|
1537
|
-
}
|
|
1538
|
-
function Ft(e, t = z) {
|
|
1539
|
-
return t.format(e, "yyyy");
|
|
1540
|
-
}
|
|
1541
|
-
const to = Ft, no = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1542
|
-
__proto__: null,
|
|
1543
|
-
formatCaption: _t,
|
|
1544
|
-
formatDay: Xr,
|
|
1545
|
-
formatMonthCaption: Zr,
|
|
1546
|
-
formatMonthDropdown: Vr,
|
|
1547
|
-
formatWeekNumber: Lr,
|
|
1548
|
-
formatWeekNumberHeader: eo,
|
|
1549
|
-
formatWeekdayName: Jr,
|
|
1550
|
-
formatYearCaption: to,
|
|
1551
|
-
formatYearDropdown: Ft
|
|
1552
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1553
|
-
function ro(e) {
|
|
1554
|
-
return e?.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e?.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
|
|
1555
|
-
...no,
|
|
1556
|
-
...e
|
|
1557
|
-
};
|
|
1558
|
-
}
|
|
1559
|
-
function Ze(e, t, r, n) {
|
|
1560
|
-
let o = (n ?? new G(r)).format(e, "PPPP");
|
|
1561
|
-
return t.today && (o = `Today, ${o}`), t.selected && (o = `${o}, selected`), o;
|
|
1562
|
-
}
|
|
1563
|
-
const oo = Ze;
|
|
1564
|
-
function Xe(e, t, r) {
|
|
1565
|
-
return (r ?? new G(t)).formatMonthYear(e);
|
|
1566
|
-
}
|
|
1567
|
-
const so = Xe;
|
|
1568
|
-
function Pt(e, t, r, n) {
|
|
1569
|
-
let o = (n ?? new G(r)).format(e, "PPPP");
|
|
1570
|
-
return t?.today && (o = `Today, ${o}`), o;
|
|
1571
|
-
}
|
|
1572
|
-
function Bt(e) {
|
|
1573
|
-
return "Choose the Month";
|
|
1574
|
-
}
|
|
1575
|
-
function It() {
|
|
1576
|
-
return "";
|
|
1577
|
-
}
|
|
1578
|
-
const ao = "Go to the Next Month";
|
|
1579
|
-
function Ht(e, t) {
|
|
1580
|
-
return ao;
|
|
1581
|
-
}
|
|
1582
|
-
function qt(e) {
|
|
1583
|
-
return "Go to the Previous Month";
|
|
1584
|
-
}
|
|
1585
|
-
function At(e, t, r) {
|
|
1586
|
-
return (r ?? new G(t)).format(e, "cccc");
|
|
1587
|
-
}
|
|
1588
|
-
function Gt(e, t) {
|
|
1589
|
-
return `Week ${e}`;
|
|
1590
|
-
}
|
|
1591
|
-
function $t(e) {
|
|
1592
|
-
return "Week Number";
|
|
1593
|
-
}
|
|
1594
|
-
function jt(e) {
|
|
1595
|
-
return "Choose the Year";
|
|
1596
|
-
}
|
|
1597
|
-
const io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1598
|
-
__proto__: null,
|
|
1599
|
-
labelCaption: so,
|
|
1600
|
-
labelDay: oo,
|
|
1601
|
-
labelDayButton: Ze,
|
|
1602
|
-
labelGrid: Xe,
|
|
1603
|
-
labelGridcell: Pt,
|
|
1604
|
-
labelMonthDropdown: Bt,
|
|
1605
|
-
labelNav: It,
|
|
1606
|
-
labelNext: Ht,
|
|
1607
|
-
labelPrevious: qt,
|
|
1608
|
-
labelWeekNumber: Gt,
|
|
1609
|
-
labelWeekNumberHeader: $t,
|
|
1610
|
-
labelWeekday: At,
|
|
1611
|
-
labelYearDropdown: jt
|
|
1612
|
-
}, Symbol.toStringTag, { value: "Module" })), K = (e, t, r) => t || (r ? typeof r == "function" ? r : (...n) => r : e);
|
|
1613
|
-
function co(e, t) {
|
|
1614
|
-
const r = t.locale?.labels ?? {};
|
|
1615
|
-
return {
|
|
1616
|
-
...io,
|
|
1617
|
-
...e ?? {},
|
|
1618
|
-
labelDayButton: K(Ze, e?.labelDayButton, r.labelDayButton),
|
|
1619
|
-
labelMonthDropdown: K(Bt, e?.labelMonthDropdown, r.labelMonthDropdown),
|
|
1620
|
-
labelNext: K(Ht, e?.labelNext, r.labelNext),
|
|
1621
|
-
labelPrevious: K(qt, e?.labelPrevious, r.labelPrevious),
|
|
1622
|
-
labelWeekNumber: K(Gt, e?.labelWeekNumber, r.labelWeekNumber),
|
|
1623
|
-
labelYearDropdown: K(jt, e?.labelYearDropdown, r.labelYearDropdown),
|
|
1624
|
-
labelGrid: K(Xe, e?.labelGrid, r.labelGrid),
|
|
1625
|
-
labelGridcell: K(Pt, e?.labelGridcell, r.labelGridcell),
|
|
1626
|
-
labelNav: K(It, e?.labelNav, r.labelNav),
|
|
1627
|
-
labelWeekNumberHeader: K($t, e?.labelWeekNumberHeader, r.labelWeekNumberHeader),
|
|
1628
|
-
labelWeekday: K(At, e?.labelWeekday, r.labelWeekday)
|
|
1629
|
-
};
|
|
1630
|
-
}
|
|
1631
|
-
function uo(e, t, r, n, o) {
|
|
1632
|
-
const { startOfMonth: a, startOfYear: i, endOfYear: s, eachMonthOfInterval: c, getMonth: u } = o;
|
|
1633
|
-
return c({
|
|
1634
|
-
start: i(e),
|
|
1635
|
-
end: s(e)
|
|
1636
|
-
}).map((h) => {
|
|
1637
|
-
const g = n.formatMonthDropdown(h, o), v = u(h), N = t && h < a(t) || r && h > a(r) || !1;
|
|
1638
|
-
return { value: v, label: g, disabled: N };
|
|
1639
|
-
});
|
|
1640
|
-
}
|
|
1641
|
-
function fo(e, t = {}, r = {}) {
|
|
1642
|
-
let n = { ...t?.[y.Day] };
|
|
1643
|
-
return Object.entries(e).filter(([, o]) => o === !0).forEach(([o]) => {
|
|
1644
|
-
n = {
|
|
1645
|
-
...n,
|
|
1646
|
-
...r?.[o]
|
|
1647
|
-
};
|
|
1648
|
-
}), n;
|
|
1649
|
-
}
|
|
1650
|
-
function lo(e, t, r, n) {
|
|
1651
|
-
const o = n ?? e.today(), a = r ? e.startOfBroadcastWeek(o, e) : t ? e.startOfISOWeek(o) : e.startOfWeek(o), i = [];
|
|
1652
|
-
for (let s = 0; s < 7; s++) {
|
|
1653
|
-
const c = e.addDays(a, s);
|
|
1654
|
-
i.push(c);
|
|
1655
|
-
}
|
|
1656
|
-
return i;
|
|
1657
|
-
}
|
|
1658
|
-
function ho(e, t, r, n, o = !1) {
|
|
1659
|
-
if (!e || !t)
|
|
1660
|
-
return;
|
|
1661
|
-
const { startOfYear: a, endOfYear: i, eachYearOfInterval: s, getYear: c } = n, u = a(e), l = i(t), f = s({ start: u, end: l });
|
|
1662
|
-
return o && f.reverse(), f.map((h) => {
|
|
1663
|
-
const g = r.formatYearDropdown(h, n);
|
|
1664
|
-
return {
|
|
1665
|
-
value: c(h),
|
|
1666
|
-
label: g,
|
|
1667
|
-
disabled: !1
|
|
1668
|
-
};
|
|
1669
|
-
});
|
|
1670
|
-
}
|
|
1671
|
-
function mo(e, t = {}) {
|
|
1672
|
-
const { weekStartsOn: r, locale: n } = t, o = r ?? n?.options?.weekStartsOn ?? 0, a = (s) => {
|
|
1673
|
-
const c = typeof s == "number" || typeof s == "string" ? new Date(s) : s;
|
|
1674
|
-
return new H(c.getFullYear(), c.getMonth(), c.getDate(), 12, 0, 0, e);
|
|
1675
|
-
}, i = (s) => {
|
|
1676
|
-
const c = a(s);
|
|
1677
|
-
return new Date(c.getFullYear(), c.getMonth(), c.getDate(), 0, 0, 0, 0);
|
|
1678
|
-
};
|
|
1679
|
-
return {
|
|
1680
|
-
today: () => a(H.tz(e)),
|
|
1681
|
-
newDate: (s, c, u) => new H(s, c, u, 12, 0, 0, e),
|
|
1682
|
-
startOfDay: (s) => a(s),
|
|
1683
|
-
startOfWeek: (s, c) => {
|
|
1684
|
-
const u = a(s), l = c?.weekStartsOn ?? o, f = (u.getDay() - l + 7) % 7;
|
|
1685
|
-
return u.setDate(u.getDate() - f), u;
|
|
1686
|
-
},
|
|
1687
|
-
startOfISOWeek: (s) => {
|
|
1688
|
-
const c = a(s), u = (c.getDay() - 1 + 7) % 7;
|
|
1689
|
-
return c.setDate(c.getDate() - u), c;
|
|
1690
|
-
},
|
|
1691
|
-
startOfMonth: (s) => {
|
|
1692
|
-
const c = a(s);
|
|
1693
|
-
return c.setDate(1), c;
|
|
1694
|
-
},
|
|
1695
|
-
startOfYear: (s) => {
|
|
1696
|
-
const c = a(s);
|
|
1697
|
-
return c.setMonth(0, 1), c;
|
|
1698
|
-
},
|
|
1699
|
-
endOfWeek: (s, c) => {
|
|
1700
|
-
const u = a(s), h = (((c?.weekStartsOn ?? o) + 6) % 7 - u.getDay() + 7) % 7;
|
|
1701
|
-
return u.setDate(u.getDate() + h), u;
|
|
1702
|
-
},
|
|
1703
|
-
endOfISOWeek: (s) => {
|
|
1704
|
-
const c = a(s), u = (7 - c.getDay()) % 7;
|
|
1705
|
-
return c.setDate(c.getDate() + u), c;
|
|
1706
|
-
},
|
|
1707
|
-
endOfMonth: (s) => {
|
|
1708
|
-
const c = a(s);
|
|
1709
|
-
return c.setMonth(c.getMonth() + 1, 0), c;
|
|
1710
|
-
},
|
|
1711
|
-
endOfYear: (s) => {
|
|
1712
|
-
const c = a(s);
|
|
1713
|
-
return c.setMonth(11, 31), c;
|
|
1714
|
-
},
|
|
1715
|
-
eachMonthOfInterval: (s) => {
|
|
1716
|
-
const c = a(s.start), u = a(s.end), l = [], f = new H(c.getFullYear(), c.getMonth(), 1, 12, 0, 0, e), h = u.getFullYear() * 12 + u.getMonth();
|
|
1717
|
-
for (; f.getFullYear() * 12 + f.getMonth() <= h; )
|
|
1718
|
-
l.push(new H(f, e)), f.setMonth(f.getMonth() + 1, 1);
|
|
1719
|
-
return l;
|
|
1720
|
-
},
|
|
1721
|
-
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
1722
|
-
// mutate the same TZDate, and return it.
|
|
1723
|
-
addDays: (s, c) => {
|
|
1724
|
-
const u = a(s);
|
|
1725
|
-
return u.setDate(u.getDate() + c), u;
|
|
1726
|
-
},
|
|
1727
|
-
addWeeks: (s, c) => {
|
|
1728
|
-
const u = a(s);
|
|
1729
|
-
return u.setDate(u.getDate() + c * 7), u;
|
|
1730
|
-
},
|
|
1731
|
-
addMonths: (s, c) => {
|
|
1732
|
-
const u = a(s);
|
|
1733
|
-
return u.setMonth(u.getMonth() + c), u;
|
|
1734
|
-
},
|
|
1735
|
-
addYears: (s, c) => {
|
|
1736
|
-
const u = a(s);
|
|
1737
|
-
return u.setFullYear(u.getFullYear() + c), u;
|
|
1738
|
-
},
|
|
1739
|
-
eachYearOfInterval: (s) => {
|
|
1740
|
-
const c = a(s.start), u = a(s.end), l = [], f = new H(c.getFullYear(), 0, 1, 12, 0, 0, e);
|
|
1741
|
-
for (; f.getFullYear() <= u.getFullYear(); )
|
|
1742
|
-
l.push(new H(f, e)), f.setFullYear(f.getFullYear() + 1, 0, 1);
|
|
1743
|
-
return l;
|
|
1744
|
-
},
|
|
1745
|
-
getWeek: (s, c) => {
|
|
1746
|
-
const u = i(s);
|
|
1747
|
-
return ze(u, {
|
|
1748
|
-
weekStartsOn: c?.weekStartsOn ?? o,
|
|
1749
|
-
firstWeekContainsDate: c?.firstWeekContainsDate ?? n?.options?.firstWeekContainsDate ?? 1
|
|
1750
|
-
});
|
|
1751
|
-
},
|
|
1752
|
-
getISOWeek: (s) => {
|
|
1753
|
-
const c = i(s);
|
|
1754
|
-
return Re(c);
|
|
1755
|
-
},
|
|
1756
|
-
differenceInCalendarDays: (s, c) => {
|
|
1757
|
-
const u = i(s), l = i(c);
|
|
1758
|
-
return je(u, l);
|
|
1759
|
-
},
|
|
1760
|
-
differenceInCalendarMonths: (s, c) => {
|
|
1761
|
-
const u = i(s), l = i(c);
|
|
1762
|
-
return kt(u, l);
|
|
1763
|
-
}
|
|
1764
|
-
};
|
|
1765
|
-
}
|
|
1766
|
-
const Me = (e) => e instanceof HTMLElement ? e : null, Ie = (e) => [
|
|
1767
|
-
...e.querySelectorAll("[data-animated-month]") ?? []
|
|
1768
|
-
], yo = (e) => Me(e.querySelector("[data-animated-month]")), He = (e) => Me(e.querySelector("[data-animated-caption]")), qe = (e) => Me(e.querySelector("[data-animated-weeks]")), go = (e) => Me(e.querySelector("[data-animated-nav]")), Do = (e) => Me(e.querySelector("[data-animated-weekdays]"));
|
|
1769
|
-
function Mo(e, t, { classNames: r, months: n, focused: o, dateLib: a }) {
|
|
1770
|
-
const i = pe(null), s = pe(n), c = pe(!1);
|
|
1771
|
-
kn(() => {
|
|
1772
|
-
const u = s.current;
|
|
1773
|
-
if (s.current = n, !t || !e.current || // safety check because the ref can be set to anything by consumers
|
|
1774
|
-
!(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
1775
|
-
n.length === 0 || u.length === 0 || n.length !== u.length)
|
|
1776
|
-
return;
|
|
1777
|
-
const l = a.isSameMonth(n[0].date, u[0].date), f = a.isAfter(n[0].date, u[0].date), h = f ? r[A.caption_after_enter] : r[A.caption_before_enter], g = f ? r[A.weeks_after_enter] : r[A.weeks_before_enter], v = i.current, N = e.current.cloneNode(!0);
|
|
1778
|
-
if (N instanceof HTMLElement ? (Ie(N).forEach((M) => {
|
|
1779
|
-
if (!(M instanceof HTMLElement))
|
|
1780
|
-
return;
|
|
1781
|
-
const k = yo(M);
|
|
1782
|
-
k && M.contains(k) && M.removeChild(k);
|
|
1783
|
-
const D = He(M);
|
|
1784
|
-
D && D.classList.remove(h);
|
|
1785
|
-
const m = qe(M);
|
|
1786
|
-
m && m.classList.remove(g);
|
|
1787
|
-
}), i.current = N) : i.current = null, c.current || l || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
|
|
1788
|
-
o)
|
|
1789
|
-
return;
|
|
1790
|
-
const O = v instanceof HTMLElement ? Ie(v) : [], T = Ie(e.current);
|
|
1791
|
-
if (T?.every((w) => w instanceof HTMLElement) && O && O.every((w) => w instanceof HTMLElement)) {
|
|
1792
|
-
c.current = !0, e.current.style.isolation = "isolate";
|
|
1793
|
-
const w = go(e.current);
|
|
1794
|
-
w && (w.style.zIndex = "1"), T.forEach((M, k) => {
|
|
1795
|
-
const D = O[k];
|
|
1796
|
-
if (!D)
|
|
1797
|
-
return;
|
|
1798
|
-
M.style.position = "relative", M.style.overflow = "hidden";
|
|
1799
|
-
const m = He(M);
|
|
1800
|
-
m && m.classList.add(h);
|
|
1801
|
-
const W = qe(M);
|
|
1802
|
-
W && W.classList.add(g);
|
|
1803
|
-
const _ = () => {
|
|
1804
|
-
c.current = !1, e.current && (e.current.style.isolation = ""), w && (w.style.zIndex = ""), m && m.classList.remove(h), W && W.classList.remove(g), M.style.position = "", M.style.overflow = "", M.contains(D) && M.removeChild(D);
|
|
1805
|
-
};
|
|
1806
|
-
D.style.pointerEvents = "none", D.style.position = "absolute", D.style.overflow = "hidden", D.setAttribute("aria-hidden", "true");
|
|
1807
|
-
const B = Do(D);
|
|
1808
|
-
B && (B.style.opacity = "0");
|
|
1809
|
-
const P = He(D);
|
|
1810
|
-
P && (P.classList.add(f ? r[A.caption_before_exit] : r[A.caption_after_exit]), P.addEventListener("animationend", _));
|
|
1811
|
-
const X = qe(D);
|
|
1812
|
-
X && X.classList.add(f ? r[A.weeks_before_exit] : r[A.weeks_after_exit]), M.insertBefore(D, M.firstChild);
|
|
1813
|
-
});
|
|
1814
|
-
}
|
|
1815
|
-
});
|
|
1816
|
-
}
|
|
1817
|
-
function bo(e, t, r, n) {
|
|
1818
|
-
const o = e[0], a = e[e.length - 1], { ISOWeek: i, fixedWeeks: s, broadcastCalendar: c } = r ?? {}, { addDays: u, differenceInCalendarDays: l, differenceInCalendarMonths: f, endOfBroadcastWeek: h, endOfISOWeek: g, endOfMonth: v, endOfWeek: N, isAfter: O, startOfBroadcastWeek: T, startOfISOWeek: w, startOfWeek: M } = n, k = c ? T(o, n) : i ? w(o) : M(o), D = c ? h(a) : i ? g(v(a)) : N(v(a)), m = t && (c ? h(t) : i ? g(t) : N(t)), W = m && O(D, m) ? m : D, _ = l(W, k), B = f(a, o) + 1, P = [];
|
|
1819
|
-
for (let te = 0; te <= _; te++) {
|
|
1820
|
-
const $ = u(k, te);
|
|
1821
|
-
P.push($);
|
|
1822
|
-
}
|
|
1823
|
-
const re = (c ? 35 : 42) * B;
|
|
1824
|
-
if (s && P.length < re) {
|
|
1825
|
-
const te = re - P.length;
|
|
1826
|
-
for (let $ = 0; $ < te; $++) {
|
|
1827
|
-
const ie = u(P[P.length - 1], 1);
|
|
1828
|
-
P.push(ie);
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
return P;
|
|
1832
|
-
}
|
|
1833
|
-
function wo(e) {
|
|
1834
|
-
const t = [];
|
|
1835
|
-
return e.reduce((r, n) => {
|
|
1836
|
-
const o = n.weeks.reduce((a, i) => a.concat(i.days.slice()), t.slice());
|
|
1837
|
-
return r.concat(o.slice());
|
|
1838
|
-
}, t.slice());
|
|
1839
|
-
}
|
|
1840
|
-
function ko(e, t, r, n) {
|
|
1841
|
-
const { numberOfMonths: o = 1 } = r, a = [];
|
|
1842
|
-
for (let i = 0; i < o; i++) {
|
|
1843
|
-
const s = n.addMonths(e, i);
|
|
1844
|
-
if (t && s > t)
|
|
1845
|
-
break;
|
|
1846
|
-
a.push(s);
|
|
1847
|
-
}
|
|
1848
|
-
return a;
|
|
1849
|
-
}
|
|
1850
|
-
function lt(e, t, r, n) {
|
|
1851
|
-
const { month: o, defaultMonth: a, today: i = n.today(), numberOfMonths: s = 1 } = e;
|
|
1852
|
-
let c = o || a || i;
|
|
1853
|
-
const { differenceInCalendarMonths: u, addMonths: l, startOfMonth: f } = n;
|
|
1854
|
-
if (r && u(r, c) < s - 1) {
|
|
1855
|
-
const h = -1 * (s - 1);
|
|
1856
|
-
c = l(r, h);
|
|
1857
|
-
}
|
|
1858
|
-
return t && u(c, t) < 0 && (c = t), f(c);
|
|
1859
|
-
}
|
|
1860
|
-
function po(e, t, r, n) {
|
|
1861
|
-
const { addDays: o, endOfBroadcastWeek: a, endOfISOWeek: i, endOfMonth: s, endOfWeek: c, getISOWeek: u, getWeek: l, startOfBroadcastWeek: f, startOfISOWeek: h, startOfWeek: g } = n, v = e.reduce((N, O) => {
|
|
1862
|
-
const T = r.broadcastCalendar ? f(O, n) : r.ISOWeek ? h(O) : g(O), w = r.broadcastCalendar ? a(O) : r.ISOWeek ? i(s(O)) : c(s(O)), M = t.filter((W) => W >= T && W <= w), k = r.broadcastCalendar ? 35 : 42;
|
|
1863
|
-
if (r.fixedWeeks && M.length < k) {
|
|
1864
|
-
const W = t.filter((_) => {
|
|
1865
|
-
const B = k - M.length;
|
|
1866
|
-
return _ > w && _ <= o(w, B);
|
|
1867
|
-
});
|
|
1868
|
-
M.push(...W);
|
|
1869
|
-
}
|
|
1870
|
-
const D = M.reduce((W, _) => {
|
|
1871
|
-
const B = r.ISOWeek ? u(_) : l(_), P = W.find((re) => re.weekNumber === B), X = new Yt(_, O, n);
|
|
1872
|
-
return P ? P.days.push(X) : W.push(new gr(B, [X])), W;
|
|
1873
|
-
}, []), m = new yr(O, D);
|
|
1874
|
-
return N.push(m), N;
|
|
1875
|
-
}, []);
|
|
1876
|
-
return r.reverseMonths ? v.reverse() : v;
|
|
1877
|
-
}
|
|
1878
|
-
function Oo(e, t) {
|
|
1879
|
-
let { startMonth: r, endMonth: n } = e;
|
|
1880
|
-
const { startOfYear: o, startOfDay: a, startOfMonth: i, endOfMonth: s, addYears: c, endOfYear: u, newDate: l, today: f } = t, { fromYear: h, toYear: g, fromMonth: v, toMonth: N } = e;
|
|
1881
|
-
!r && v && (r = v), !r && h && (r = t.newDate(h, 0, 1)), !n && N && (n = N), !n && g && (n = l(g, 11, 31));
|
|
1882
|
-
const O = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
|
|
1883
|
-
return r ? r = i(r) : h ? r = l(h, 0, 1) : !r && O && (r = o(c(e.today ?? f(), -100))), n ? n = s(n) : g ? n = l(g, 11, 31) : !n && O && (n = u(e.today ?? f())), [
|
|
1884
|
-
r && a(r),
|
|
1885
|
-
n && a(n)
|
|
1886
|
-
];
|
|
1887
|
-
}
|
|
1888
|
-
function vo(e, t, r, n) {
|
|
1889
|
-
if (r.disableNavigation)
|
|
1890
|
-
return;
|
|
1891
|
-
const { pagedNavigation: o, numberOfMonths: a = 1 } = r, { startOfMonth: i, addMonths: s, differenceInCalendarMonths: c } = n, u = o ? a : 1, l = i(e);
|
|
1892
|
-
if (!t)
|
|
1893
|
-
return s(l, u);
|
|
1894
|
-
if (!(c(t, e) < a))
|
|
1895
|
-
return s(l, u);
|
|
1896
|
-
}
|
|
1897
|
-
function Wo(e, t, r, n) {
|
|
1898
|
-
if (r.disableNavigation)
|
|
1899
|
-
return;
|
|
1900
|
-
const { pagedNavigation: o, numberOfMonths: a } = r, { startOfMonth: i, addMonths: s, differenceInCalendarMonths: c } = n, u = o ? a ?? 1 : 1, l = i(e);
|
|
1901
|
-
if (!t)
|
|
1902
|
-
return s(l, -u);
|
|
1903
|
-
if (!(c(l, t) <= 0))
|
|
1904
|
-
return s(l, -u);
|
|
1905
|
-
}
|
|
1906
|
-
function So(e) {
|
|
1907
|
-
const t = [];
|
|
1908
|
-
return e.reduce((r, n) => r.concat(n.weeks.slice()), t.slice());
|
|
1909
|
-
}
|
|
1910
|
-
function Se(e, t) {
|
|
1911
|
-
const [r, n] = Ge(e);
|
|
1912
|
-
return [t === void 0 ? r : t, n];
|
|
1913
|
-
}
|
|
1914
|
-
function No(e, t) {
|
|
1915
|
-
const [r, n] = Oo(e, t), { startOfMonth: o, endOfMonth: a } = t, i = lt(e, r, n, t), [s, c] = Se(
|
|
1916
|
-
i,
|
|
1917
|
-
// initialMonth is always computed from props.month if provided
|
|
1918
|
-
e.month ? i : void 0
|
|
1919
|
-
);
|
|
1920
|
-
pn(() => {
|
|
1921
|
-
const k = lt(e, r, n, t);
|
|
1922
|
-
c(k);
|
|
1923
|
-
}, [e.timeZone]);
|
|
1924
|
-
const { months: u, weeks: l, days: f, previousMonth: h, nextMonth: g } = Oe(() => {
|
|
1925
|
-
const k = ko(s, n, { numberOfMonths: e.numberOfMonths }, t), D = bo(k, e.endMonth ? a(e.endMonth) : void 0, {
|
|
1926
|
-
ISOWeek: e.ISOWeek,
|
|
1927
|
-
fixedWeeks: e.fixedWeeks,
|
|
1928
|
-
broadcastCalendar: e.broadcastCalendar
|
|
1929
|
-
}, t), m = po(k, D, {
|
|
1930
|
-
broadcastCalendar: e.broadcastCalendar,
|
|
1931
|
-
fixedWeeks: e.fixedWeeks,
|
|
1932
|
-
ISOWeek: e.ISOWeek,
|
|
1933
|
-
reverseMonths: e.reverseMonths
|
|
1934
|
-
}, t), W = So(m), _ = wo(m), B = Wo(s, r, e, t), P = vo(s, n, e, t);
|
|
1935
|
-
return {
|
|
1936
|
-
months: m,
|
|
1937
|
-
weeks: W,
|
|
1938
|
-
days: _,
|
|
1939
|
-
previousMonth: B,
|
|
1940
|
-
nextMonth: P
|
|
1941
|
-
};
|
|
1942
|
-
}, [
|
|
1943
|
-
t,
|
|
1944
|
-
s.getTime(),
|
|
1945
|
-
n?.getTime(),
|
|
1946
|
-
r?.getTime(),
|
|
1947
|
-
e.disableNavigation,
|
|
1948
|
-
e.broadcastCalendar,
|
|
1949
|
-
e.endMonth?.getTime(),
|
|
1950
|
-
e.fixedWeeks,
|
|
1951
|
-
e.ISOWeek,
|
|
1952
|
-
e.numberOfMonths,
|
|
1953
|
-
e.pagedNavigation,
|
|
1954
|
-
e.reverseMonths
|
|
1955
|
-
]), { disableNavigation: v, onMonthChange: N } = e, O = (k) => l.some((D) => D.days.some((m) => m.isEqualTo(k))), T = (k) => {
|
|
1956
|
-
if (v)
|
|
1957
|
-
return;
|
|
1958
|
-
let D = o(k);
|
|
1959
|
-
r && D < o(r) && (D = o(r)), n && D > o(n) && (D = o(n)), c(D), N?.(D);
|
|
1960
|
-
};
|
|
1961
|
-
return {
|
|
1962
|
-
months: u,
|
|
1963
|
-
weeks: l,
|
|
1964
|
-
days: f,
|
|
1965
|
-
navStart: r,
|
|
1966
|
-
navEnd: n,
|
|
1967
|
-
previousMonth: h,
|
|
1968
|
-
nextMonth: g,
|
|
1969
|
-
goToMonth: T,
|
|
1970
|
-
goToDay: (k) => {
|
|
1971
|
-
O(k) || T(k.date);
|
|
1972
|
-
}
|
|
1973
|
-
};
|
|
1974
|
-
}
|
|
1975
|
-
var V;
|
|
1976
|
-
(function(e) {
|
|
1977
|
-
e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
|
|
1978
|
-
})(V || (V = {}));
|
|
1979
|
-
function dt(e) {
|
|
1980
|
-
return !e[F.disabled] && !e[F.hidden] && !e[F.outside];
|
|
1981
|
-
}
|
|
1982
|
-
function Co(e, t, r, n) {
|
|
1983
|
-
let o, a = -1;
|
|
1984
|
-
for (const i of e) {
|
|
1985
|
-
const s = t(i);
|
|
1986
|
-
dt(s) && (s[F.focused] && a < V.FocusedModifier ? (o = i, a = V.FocusedModifier) : n?.isEqualTo(i) && a < V.LastFocused ? (o = i, a = V.LastFocused) : r(i.date) && a < V.Selected ? (o = i, a = V.Selected) : s[F.today] && a < V.Today && (o = i, a = V.Today));
|
|
1987
|
-
}
|
|
1988
|
-
return o || (o = e.find((i) => dt(t(i)))), o;
|
|
1989
|
-
}
|
|
1990
|
-
function Yo(e, t, r, n, o, a, i) {
|
|
1991
|
-
const { ISOWeek: s, broadcastCalendar: c } = a, { addDays: u, addMonths: l, addWeeks: f, addYears: h, endOfBroadcastWeek: g, endOfISOWeek: v, endOfWeek: N, max: O, min: T, startOfBroadcastWeek: w, startOfISOWeek: M, startOfWeek: k } = i;
|
|
1992
|
-
let m = {
|
|
1993
|
-
day: u,
|
|
1994
|
-
week: f,
|
|
1995
|
-
month: l,
|
|
1996
|
-
year: h,
|
|
1997
|
-
startOfWeek: (W) => c ? w(W, i) : s ? M(W) : k(W),
|
|
1998
|
-
endOfWeek: (W) => c ? g(W) : s ? v(W) : N(W)
|
|
1999
|
-
}[e](r, t === "after" ? 1 : -1);
|
|
2000
|
-
return t === "before" && n ? m = O([n, m]) : t === "after" && o && (m = T([o, m])), m;
|
|
2001
|
-
}
|
|
2002
|
-
function Rt(e, t, r, n, o, a, i, s = 0) {
|
|
2003
|
-
if (s > 365)
|
|
2004
|
-
return;
|
|
2005
|
-
const c = Yo(e, t, r.date, n, o, a, i), u = !!(a.disabled && ee(c, a.disabled, i)), l = !!(a.hidden && ee(c, a.hidden, i)), f = c, h = new Yt(c, f, i);
|
|
2006
|
-
return !u && !l ? h : Rt(e, t, h, n, o, a, i, s + 1);
|
|
2007
|
-
}
|
|
2008
|
-
function To(e, t, r, n, o) {
|
|
2009
|
-
const { autoFocus: a } = e, [i, s] = Ge(), c = Co(t.days, r, n || (() => !1), i), [u, l] = Ge(a ? c : void 0);
|
|
2010
|
-
return {
|
|
2011
|
-
isFocusTarget: (N) => !!c?.isEqualTo(N),
|
|
2012
|
-
setFocused: l,
|
|
2013
|
-
focused: u,
|
|
2014
|
-
blur: () => {
|
|
2015
|
-
s(u), l(void 0);
|
|
2016
|
-
},
|
|
2017
|
-
moveFocus: (N, O) => {
|
|
2018
|
-
if (!u)
|
|
2019
|
-
return;
|
|
2020
|
-
const T = Rt(N, O, u, t.navStart, t.navEnd, e, o);
|
|
2021
|
-
T && (e.disableNavigation && !t.days.some((M) => M.isEqualTo(T)) || (t.goToDay(T), l(T)));
|
|
2022
|
-
}
|
|
2023
|
-
};
|
|
2024
|
-
}
|
|
2025
|
-
function Eo(e, t) {
|
|
2026
|
-
const { selected: r, required: n, onSelect: o } = e, [a, i] = Se(r, o ? r : void 0), s = o ? r : a, { isSameDay: c } = t, u = (g) => s?.some((v) => c(v, g)) ?? !1, { min: l, max: f } = e;
|
|
2027
|
-
return {
|
|
2028
|
-
selected: s,
|
|
2029
|
-
select: (g, v, N) => {
|
|
2030
|
-
let O = [...s ?? []];
|
|
2031
|
-
if (u(g)) {
|
|
2032
|
-
if (s?.length === l || n && s?.length === 1)
|
|
2033
|
-
return;
|
|
2034
|
-
O = s?.filter((T) => !c(T, g));
|
|
2035
|
-
} else
|
|
2036
|
-
s?.length === f ? O = [g] : O = [...O, g];
|
|
2037
|
-
return o || i(O), o?.(O, g, v, N), O;
|
|
2038
|
-
},
|
|
2039
|
-
isSelected: u
|
|
2040
|
-
};
|
|
2041
|
-
}
|
|
2042
|
-
function xo(e, t, r = 0, n = 0, o = !1, a = z) {
|
|
2043
|
-
const { from: i, to: s } = t || {}, { isSameDay: c, isAfter: u, isBefore: l } = a;
|
|
2044
|
-
let f;
|
|
2045
|
-
if (!i && !s)
|
|
2046
|
-
f = { from: e, to: r > 0 ? void 0 : e };
|
|
2047
|
-
else if (i && !s)
|
|
2048
|
-
c(i, e) ? r === 0 ? f = { from: i, to: e } : o ? f = { from: i, to: void 0 } : f = void 0 : l(e, i) ? f = { from: e, to: i } : f = { from: i, to: e };
|
|
2049
|
-
else if (i && s)
|
|
2050
|
-
if (c(i, e) && c(s, e))
|
|
2051
|
-
o ? f = { from: i, to: s } : f = void 0;
|
|
2052
|
-
else if (c(i, e))
|
|
2053
|
-
f = { from: i, to: r > 0 ? void 0 : e };
|
|
2054
|
-
else if (c(s, e))
|
|
2055
|
-
f = { from: e, to: r > 0 ? void 0 : e };
|
|
2056
|
-
else if (l(e, i))
|
|
2057
|
-
f = { from: e, to: s };
|
|
2058
|
-
else if (u(e, i))
|
|
2059
|
-
f = { from: i, to: e };
|
|
2060
|
-
else if (u(e, s))
|
|
2061
|
-
f = { from: i, to: e };
|
|
2062
|
-
else
|
|
2063
|
-
throw new Error("Invalid range");
|
|
2064
|
-
if (f?.from && f?.to) {
|
|
2065
|
-
const h = a.differenceInCalendarDays(f.to, f.from);
|
|
2066
|
-
n > 0 && h > n ? f = { from: e, to: void 0 } : r > 1 && h < r && (f = { from: e, to: void 0 });
|
|
2067
|
-
}
|
|
2068
|
-
return f;
|
|
2069
|
-
}
|
|
2070
|
-
function _o(e, t, r = z) {
|
|
2071
|
-
const n = Array.isArray(t) ? t : [t];
|
|
2072
|
-
let o = e.from;
|
|
2073
|
-
const a = r.differenceInCalendarDays(e.to, e.from), i = Math.min(a, 6);
|
|
2074
|
-
for (let s = 0; s <= i; s++) {
|
|
2075
|
-
if (n.includes(o.getDay()))
|
|
2076
|
-
return !0;
|
|
2077
|
-
o = r.addDays(o, 1);
|
|
2078
|
-
}
|
|
2079
|
-
return !1;
|
|
2080
|
-
}
|
|
2081
|
-
function ht(e, t, r = z) {
|
|
2082
|
-
return L(e, t.from, !1, r) || L(e, t.to, !1, r) || L(t, e.from, !1, r) || L(t, e.to, !1, r);
|
|
2083
|
-
}
|
|
2084
|
-
function Fo(e, t, r = z) {
|
|
2085
|
-
const n = Array.isArray(t) ? t : [t];
|
|
2086
|
-
if (n.filter((s) => typeof s != "function").some((s) => typeof s == "boolean" ? s : r.isDate(s) ? L(e, s, !1, r) : xt(s, r) ? s.some((c) => L(e, c, !1, r)) : We(s) ? s.from && s.to ? ht(e, { from: s.from, to: s.to }, r) : !1 : Et(s) ? _o(e, s.dayOfWeek, r) : Ue(s) ? r.isAfter(s.before, s.after) ? ht(e, {
|
|
2087
|
-
from: r.addDays(s.after, 1),
|
|
2088
|
-
to: r.addDays(s.before, -1)
|
|
2089
|
-
}, r) : ee(e.from, s, r) || ee(e.to, s, r) : Qe(s) || Ke(s) ? ee(e.from, s, r) || ee(e.to, s, r) : !1))
|
|
2090
|
-
return !0;
|
|
2091
|
-
const i = n.filter((s) => typeof s == "function");
|
|
2092
|
-
if (i.length) {
|
|
2093
|
-
let s = e.from;
|
|
2094
|
-
const c = r.differenceInCalendarDays(e.to, e.from);
|
|
2095
|
-
for (let u = 0; u <= c; u++) {
|
|
2096
|
-
if (i.some((l) => l(s)))
|
|
2097
|
-
return !0;
|
|
2098
|
-
s = r.addDays(s, 1);
|
|
2099
|
-
}
|
|
2100
|
-
}
|
|
2101
|
-
return !1;
|
|
2102
|
-
}
|
|
2103
|
-
function Po(e, t) {
|
|
2104
|
-
const { disabled: r, excludeDisabled: n, resetOnSelect: o, selected: a, required: i, onSelect: s } = e, [c, u] = Se(a, s ? a : void 0), l = s ? a : c;
|
|
2105
|
-
return {
|
|
2106
|
-
selected: l,
|
|
2107
|
-
select: (g, v, N) => {
|
|
2108
|
-
const { min: O, max: T } = e;
|
|
2109
|
-
let w;
|
|
2110
|
-
if (g) {
|
|
2111
|
-
const M = l?.from, k = l?.to, D = !!M && !!k, m = !!M && !!k && t.isSameDay(M, k) && t.isSameDay(g, M);
|
|
2112
|
-
o && (D || !l?.from) ? !i && m ? w = void 0 : w = { from: g, to: void 0 } : w = xo(g, l, O, T, i, t);
|
|
2113
|
-
}
|
|
2114
|
-
return n && r && w?.from && w.to && Fo({ from: w.from, to: w.to }, r, t) && (w.from = g, w.to = void 0), s || u(w), s?.(w, g, v, N), w;
|
|
2115
|
-
},
|
|
2116
|
-
isSelected: (g) => l && L(l, g, !1, t)
|
|
2117
|
-
};
|
|
2118
|
-
}
|
|
2119
|
-
function Bo(e, t) {
|
|
2120
|
-
const { selected: r, required: n, onSelect: o } = e, [a, i] = Se(r, o ? r : void 0), s = o ? r : a, { isSameDay: c } = t;
|
|
2121
|
-
return {
|
|
2122
|
-
selected: s,
|
|
2123
|
-
select: (f, h, g) => {
|
|
2124
|
-
let v = f;
|
|
2125
|
-
return !n && s && s && c(f, s) && (v = void 0), o || i(v), o?.(v, f, h, g), v;
|
|
2126
|
-
},
|
|
2127
|
-
isSelected: (f) => s ? c(s, f) : !1
|
|
2128
|
-
};
|
|
2129
|
-
}
|
|
2130
|
-
function Io(e, t) {
|
|
2131
|
-
const r = Bo(e, t), n = Eo(e, t), o = Po(e, t);
|
|
2132
|
-
switch (e.mode) {
|
|
2133
|
-
case "single":
|
|
2134
|
-
return r;
|
|
2135
|
-
case "multiple":
|
|
2136
|
-
return n;
|
|
2137
|
-
case "range":
|
|
2138
|
-
return o;
|
|
2139
|
-
default:
|
|
2140
|
-
return;
|
|
2141
|
-
}
|
|
2142
|
-
}
|
|
2143
|
-
function R(e, t) {
|
|
2144
|
-
return e instanceof H && e.timeZone === t ? e : new H(e, t);
|
|
2145
|
-
}
|
|
2146
|
-
function ue(e, t, r) {
|
|
2147
|
-
return R(e, t);
|
|
2148
|
-
}
|
|
2149
|
-
function mt(e, t, r) {
|
|
2150
|
-
return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? ue(e, t) : Array.isArray(e) ? e.map((n) => n instanceof Date ? ue(n, t) : n) : We(e) ? {
|
|
2151
|
-
...e,
|
|
2152
|
-
from: e.from ? R(e.from, t) : e.from,
|
|
2153
|
-
to: e.to ? R(e.to, t) : e.to
|
|
2154
|
-
} : Ue(e) ? {
|
|
2155
|
-
before: ue(e.before, t),
|
|
2156
|
-
after: ue(e.after, t)
|
|
2157
|
-
} : Qe(e) ? {
|
|
2158
|
-
after: ue(e.after, t)
|
|
2159
|
-
} : Ke(e) ? {
|
|
2160
|
-
before: ue(e.before, t)
|
|
2161
|
-
} : e;
|
|
2162
|
-
}
|
|
2163
|
-
function Ae(e, t, r) {
|
|
2164
|
-
return e && (Array.isArray(e) ? e.map((n) => mt(n, t)) : mt(e, t));
|
|
2165
|
-
}
|
|
2166
|
-
function Ro(e) {
|
|
2167
|
-
let t = e;
|
|
2168
|
-
const r = t.timeZone;
|
|
2169
|
-
if (r && (t = {
|
|
2170
|
-
...e,
|
|
2171
|
-
timeZone: r
|
|
2172
|
-
}, t.today && (t.today = R(t.today, r)), t.month && (t.month = R(t.month, r)), t.defaultMonth && (t.defaultMonth = R(t.defaultMonth, r)), t.startMonth && (t.startMonth = R(t.startMonth, r)), t.endMonth && (t.endMonth = R(t.endMonth, r)), t.mode === "single" && t.selected ? t.selected = R(t.selected, r) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((p) => R(p, r)) : t.mode === "range" && t.selected && (t.selected = {
|
|
2173
|
-
from: t.selected.from ? R(t.selected.from, r) : t.selected.from,
|
|
2174
|
-
to: t.selected.to ? R(t.selected.to, r) : t.selected.to
|
|
2175
|
-
}), t.disabled !== void 0 && (t.disabled = Ae(t.disabled, r)), t.hidden !== void 0 && (t.hidden = Ae(t.hidden, r)), t.modifiers)) {
|
|
2176
|
-
const p = {};
|
|
2177
|
-
Object.keys(t.modifiers).forEach((Y) => {
|
|
2178
|
-
p[Y] = Ae(t.modifiers?.[Y], r);
|
|
2179
|
-
}), t.modifiers = p;
|
|
2180
|
-
}
|
|
2181
|
-
const { components: n, formatters: o, labels: a, dateLib: i, locale: s, classNames: c } = Oe(() => {
|
|
2182
|
-
const p = { ...Ct, ...t.locale }, Y = t.broadcastCalendar ? 1 : t.weekStartsOn, b = t.noonSafe && t.timeZone ? mo(t.timeZone, {
|
|
2183
|
-
weekStartsOn: Y,
|
|
2184
|
-
locale: p
|
|
2185
|
-
}) : void 0, C = t.dateLib && b ? { ...b, ...t.dateLib } : t.dateLib ?? b, q = new G({
|
|
2186
|
-
locale: p,
|
|
2187
|
-
weekStartsOn: Y,
|
|
2188
|
-
firstWeekContainsDate: t.firstWeekContainsDate,
|
|
2189
|
-
useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
|
|
2190
|
-
useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
|
|
2191
|
-
timeZone: t.timeZone,
|
|
2192
|
-
numerals: t.numerals
|
|
2193
|
-
}, C);
|
|
2194
|
-
return {
|
|
2195
|
-
dateLib: q,
|
|
2196
|
-
components: Ur(t.components),
|
|
2197
|
-
formatters: ro(t.formatters),
|
|
2198
|
-
labels: co(t.labels, q.options),
|
|
2199
|
-
locale: p,
|
|
2200
|
-
classNames: { ...Kr(), ...t.classNames }
|
|
2201
|
-
};
|
|
2202
|
-
}, [
|
|
2203
|
-
t.locale,
|
|
2204
|
-
t.broadcastCalendar,
|
|
2205
|
-
t.weekStartsOn,
|
|
2206
|
-
t.firstWeekContainsDate,
|
|
2207
|
-
t.useAdditionalWeekYearTokens,
|
|
2208
|
-
t.useAdditionalDayOfYearTokens,
|
|
2209
|
-
t.timeZone,
|
|
2210
|
-
t.numerals,
|
|
2211
|
-
t.dateLib,
|
|
2212
|
-
t.noonSafe,
|
|
2213
|
-
t.components,
|
|
2214
|
-
t.formatters,
|
|
2215
|
-
t.labels,
|
|
2216
|
-
t.classNames
|
|
2217
|
-
]);
|
|
2218
|
-
t.today || (t = { ...t, today: i.today() });
|
|
2219
|
-
const { captionLayout: u, mode: l, navLayout: f, numberOfMonths: h = 1, onDayBlur: g, onDayClick: v, onDayFocus: N, onDayKeyDown: O, onDayMouseEnter: T, onDayMouseLeave: w, onNextClick: M, onPrevClick: k, showWeekNumber: D, styles: m } = t, { formatCaption: W, formatDay: _, formatMonthDropdown: B, formatWeekNumber: P, formatWeekNumberHeader: X, formatWeekdayName: re, formatYearDropdown: te } = o, $ = No(t, i), { days: ie, months: be, navStart: Ne, navEnd: Ce, previousMonth: U, nextMonth: Q, goToMonth: ne } = $, Ye = Rr(ie, t, Ne, Ce, i), { isSelected: Te, select: Ee, selected: we } = Io(t, i) ?? {}, { blur: Ve, focused: Je, isFocusTarget: zt, moveFocus: Le, setFocused: ke } = To(t, $, Ye, Te ?? (() => !1), i), { labelDayButton: Ut, labelGridcell: Qt, labelGrid: Kt, labelMonthDropdown: Zt, labelNav: et, labelPrevious: Xt, labelNext: Vt, labelWeekday: Jt, labelWeekNumber: Lt, labelWeekNumberHeader: en, labelYearDropdown: tn } = a, nn = Oe(() => lo(i, t.ISOWeek, t.broadcastCalendar, t.today), [i, t.ISOWeek, t.broadcastCalendar, t.today]), tt = l !== void 0 || v !== void 0, xe = j(() => {
|
|
2220
|
-
U && (ne(U), k?.(U));
|
|
2221
|
-
}, [U, ne, k]), _e = j(() => {
|
|
2222
|
-
Q && (ne(Q), M?.(Q));
|
|
2223
|
-
}, [ne, Q, M]), rn = j((p, Y) => (b) => {
|
|
2224
|
-
b.preventDefault(), b.stopPropagation(), ke(p), !Y.disabled && (Ee?.(p.date, Y, b), v?.(p.date, Y, b));
|
|
2225
|
-
}, [Ee, v, ke]), on = j((p, Y) => (b) => {
|
|
2226
|
-
ke(p), N?.(p.date, Y, b);
|
|
2227
|
-
}, [N, ke]), sn = j((p, Y) => (b) => {
|
|
2228
|
-
Ve(), g?.(p.date, Y, b);
|
|
2229
|
-
}, [Ve, g]), an = j((p, Y) => (b) => {
|
|
2230
|
-
const C = {
|
|
2231
|
-
ArrowLeft: [
|
|
2232
|
-
b.shiftKey ? "month" : "day",
|
|
2233
|
-
t.dir === "rtl" ? "after" : "before"
|
|
2234
|
-
],
|
|
2235
|
-
ArrowRight: [
|
|
2236
|
-
b.shiftKey ? "month" : "day",
|
|
2237
|
-
t.dir === "rtl" ? "before" : "after"
|
|
2238
|
-
],
|
|
2239
|
-
ArrowDown: [b.shiftKey ? "year" : "week", "after"],
|
|
2240
|
-
ArrowUp: [b.shiftKey ? "year" : "week", "before"],
|
|
2241
|
-
PageUp: [b.shiftKey ? "year" : "month", "before"],
|
|
2242
|
-
PageDown: [b.shiftKey ? "year" : "month", "after"],
|
|
2243
|
-
Home: ["startOfWeek", "before"],
|
|
2244
|
-
End: ["endOfWeek", "after"]
|
|
2245
|
-
};
|
|
2246
|
-
if (C[b.key]) {
|
|
2247
|
-
b.preventDefault(), b.stopPropagation();
|
|
2248
|
-
const [q, S] = C[b.key];
|
|
2249
|
-
Le(q, S);
|
|
2250
|
-
}
|
|
2251
|
-
O?.(p.date, Y, b);
|
|
2252
|
-
}, [Le, O, t.dir]), cn = j((p, Y) => (b) => {
|
|
2253
|
-
T?.(p.date, Y, b);
|
|
2254
|
-
}, [T]), un = j((p, Y) => (b) => {
|
|
2255
|
-
w?.(p.date, Y, b);
|
|
2256
|
-
}, [w]), fn = j((p) => (Y) => {
|
|
2257
|
-
const b = Number(Y.target.value), C = i.setMonth(i.startOfMonth(p), b);
|
|
2258
|
-
ne(C);
|
|
2259
|
-
}, [i, ne]), ln = j((p) => (Y) => {
|
|
2260
|
-
const b = Number(Y.target.value), C = i.setYear(i.startOfMonth(p), b);
|
|
2261
|
-
ne(C);
|
|
2262
|
-
}, [i, ne]), { className: dn, style: hn } = Oe(() => ({
|
|
2263
|
-
className: [c[y.Root], t.className].filter(Boolean).join(" "),
|
|
2264
|
-
style: { ...m?.[y.Root], ...t.style }
|
|
2265
|
-
}), [c, t.className, t.style, m]), mn = Qr(t), nt = pe(null);
|
|
2266
|
-
Mo(nt, !!t.animate, {
|
|
2267
|
-
classNames: c,
|
|
2268
|
-
months: be,
|
|
2269
|
-
focused: Je,
|
|
2270
|
-
dateLib: i
|
|
2271
|
-
});
|
|
2272
|
-
const yn = {
|
|
2273
|
-
dayPickerProps: t,
|
|
2274
|
-
selected: we,
|
|
2275
|
-
select: Ee,
|
|
2276
|
-
isSelected: Te,
|
|
2277
|
-
months: be,
|
|
2278
|
-
nextMonth: Q,
|
|
2279
|
-
previousMonth: U,
|
|
2280
|
-
goToMonth: ne,
|
|
2281
|
-
getModifiers: Ye,
|
|
2282
|
-
components: n,
|
|
2283
|
-
classNames: c,
|
|
2284
|
-
styles: m,
|
|
2285
|
-
labels: a,
|
|
2286
|
-
formatters: o
|
|
2287
|
-
};
|
|
2288
|
-
return d.createElement(
|
|
2289
|
-
Tt.Provider,
|
|
2290
|
-
{ value: yn },
|
|
2291
|
-
d.createElement(
|
|
2292
|
-
n.Root,
|
|
2293
|
-
{ rootRef: t.animate ? nt : void 0, className: dn, style: hn, dir: t.dir, id: t.id, lang: t.lang ?? s.code, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...mn },
|
|
2294
|
-
d.createElement(
|
|
2295
|
-
n.Months,
|
|
2296
|
-
{ className: c[y.Months], style: m?.[y.Months] },
|
|
2297
|
-
!t.hideNavigation && !f && d.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[y.Nav], style: m?.[y.Nav], "aria-label": et(), onPreviousClick: xe, onNextClick: _e, previousMonth: U, nextMonth: Q }),
|
|
2298
|
-
be.map((p, Y) => d.createElement(
|
|
2299
|
-
n.Month,
|
|
2300
|
-
{
|
|
2301
|
-
"data-animated-month": t.animate ? "true" : void 0,
|
|
2302
|
-
className: c[y.Month],
|
|
2303
|
-
style: m?.[y.Month],
|
|
2304
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
|
|
2305
|
-
key: Y,
|
|
2306
|
-
displayIndex: Y,
|
|
2307
|
-
calendarMonth: p
|
|
2308
|
-
},
|
|
2309
|
-
f === "around" && !t.hideNavigation && Y === 0 && d.createElement(
|
|
2310
|
-
n.PreviousMonthButton,
|
|
2311
|
-
{ type: "button", className: c[y.PreviousMonthButton], tabIndex: U ? void 0 : -1, "aria-disabled": U ? void 0 : !0, "aria-label": Xt(U), onClick: xe, "data-animated-button": t.animate ? "true" : void 0 },
|
|
2312
|
-
d.createElement(n.Chevron, { disabled: U ? void 0 : !0, className: c[y.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
|
|
2313
|
-
),
|
|
2314
|
-
d.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: c[y.MonthCaption], style: m?.[y.MonthCaption], calendarMonth: p, displayIndex: Y }, u?.startsWith("dropdown") ? d.createElement(
|
|
2315
|
-
n.DropdownNav,
|
|
2316
|
-
{ className: c[y.Dropdowns], style: m?.[y.Dropdowns] },
|
|
2317
|
-
(() => {
|
|
2318
|
-
const b = u === "dropdown" || u === "dropdown-months" ? d.createElement(n.MonthsDropdown, { key: "month", className: c[y.MonthsDropdown], "aria-label": Zt(), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: fn(p.date), options: uo(p.date, Ne, Ce, o, i), style: m?.[y.Dropdown], value: i.getMonth(p.date) }) : d.createElement("span", { key: "month" }, B(p.date, i)), C = u === "dropdown" || u === "dropdown-years" ? d.createElement(n.YearsDropdown, { key: "year", className: c[y.YearsDropdown], "aria-label": tn(i.options), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: ln(p.date), options: ho(Ne, Ce, o, i, !!t.reverseYears), style: m?.[y.Dropdown], value: i.getYear(p.date) }) : d.createElement("span", { key: "year" }, te(p.date, i));
|
|
2319
|
-
return i.getMonthYearOrder() === "year-first" ? [C, b] : [b, C];
|
|
2320
|
-
})(),
|
|
2321
|
-
d.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
2322
|
-
border: 0,
|
|
2323
|
-
clip: "rect(0 0 0 0)",
|
|
2324
|
-
height: "1px",
|
|
2325
|
-
margin: "-1px",
|
|
2326
|
-
overflow: "hidden",
|
|
2327
|
-
padding: 0,
|
|
2328
|
-
position: "absolute",
|
|
2329
|
-
width: "1px",
|
|
2330
|
-
whiteSpace: "nowrap",
|
|
2331
|
-
wordWrap: "normal"
|
|
2332
|
-
} }, W(p.date, i.options, i))
|
|
2333
|
-
) : d.createElement(n.CaptionLabel, { className: c[y.CaptionLabel], role: "status", "aria-live": "polite" }, W(p.date, i.options, i))),
|
|
2334
|
-
f === "around" && !t.hideNavigation && Y === h - 1 && d.createElement(
|
|
2335
|
-
n.NextMonthButton,
|
|
2336
|
-
{ type: "button", className: c[y.NextMonthButton], tabIndex: Q ? void 0 : -1, "aria-disabled": Q ? void 0 : !0, "aria-label": Vt(Q), onClick: _e, "data-animated-button": t.animate ? "true" : void 0 },
|
|
2337
|
-
d.createElement(n.Chevron, { disabled: Q ? void 0 : !0, className: c[y.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
|
|
2338
|
-
),
|
|
2339
|
-
Y === h - 1 && f === "after" && !t.hideNavigation && d.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[y.Nav], style: m?.[y.Nav], "aria-label": et(), onPreviousClick: xe, onNextClick: _e, previousMonth: U, nextMonth: Q }),
|
|
2340
|
-
d.createElement(
|
|
2341
|
-
n.MonthGrid,
|
|
2342
|
-
{ role: "grid", "aria-multiselectable": l === "multiple" || l === "range", "aria-label": Kt(p.date, i.options, i) || void 0, className: c[y.MonthGrid], style: m?.[y.MonthGrid] },
|
|
2343
|
-
!t.hideWeekdays && d.createElement(
|
|
2344
|
-
n.Weekdays,
|
|
2345
|
-
{ "data-animated-weekdays": t.animate ? "true" : void 0, className: c[y.Weekdays], style: m?.[y.Weekdays] },
|
|
2346
|
-
D && d.createElement(n.WeekNumberHeader, { "aria-label": en(i.options), className: c[y.WeekNumberHeader], style: m?.[y.WeekNumberHeader], scope: "col" }, X()),
|
|
2347
|
-
nn.map((b) => d.createElement(n.Weekday, { "aria-label": Jt(b, i.options, i), className: c[y.Weekday], key: String(b), style: m?.[y.Weekday], scope: "col" }, re(b, i.options, i)))
|
|
2348
|
-
),
|
|
2349
|
-
d.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: c[y.Weeks], style: m?.[y.Weeks] }, p.weeks.map((b) => d.createElement(
|
|
2350
|
-
n.Week,
|
|
2351
|
-
{ className: c[y.Week], key: b.weekNumber, style: m?.[y.Week], week: b },
|
|
2352
|
-
D && d.createElement(n.WeekNumber, { week: b, style: m?.[y.WeekNumber], "aria-label": Lt(b.weekNumber, {
|
|
2353
|
-
locale: s
|
|
2354
|
-
}), className: c[y.WeekNumber], scope: "row", role: "rowheader" }, P(b.weekNumber, i)),
|
|
2355
|
-
b.days.map((C) => {
|
|
2356
|
-
const { date: q } = C, S = Ye(C);
|
|
2357
|
-
if (S[F.focused] = !S.hidden && !!Je?.isEqualTo(C), S[Z.selected] = Te?.(q) || S.selected, We(we)) {
|
|
2358
|
-
const { from: Fe, to: Pe } = we;
|
|
2359
|
-
S[Z.range_start] = !!(Fe && Pe && i.isSameDay(q, Fe)), S[Z.range_end] = !!(Fe && Pe && i.isSameDay(q, Pe)), S[Z.range_middle] = L(we, q, !0, i);
|
|
2360
|
-
}
|
|
2361
|
-
const gn = fo(S, m, t.modifiersStyles), Dn = zr(S, c, t.modifiersClassNames), Mn = !tt && !S.hidden ? Qt(q, S, i.options, i) : void 0;
|
|
2362
|
-
return d.createElement(n.Day, { key: `${C.isoDate}_${C.displayMonthId}`, day: C, modifiers: S, className: Dn.join(" "), style: gn, role: "gridcell", "aria-selected": S.selected || void 0, "aria-label": Mn, "data-day": C.isoDate, "data-month": C.outside ? C.dateMonthId : void 0, "data-selected": S.selected || void 0, "data-disabled": S.disabled || void 0, "data-hidden": S.hidden || void 0, "data-outside": C.outside || void 0, "data-focused": S.focused || void 0, "data-today": S.today || void 0 }, !S.hidden && tt ? d.createElement(n.DayButton, { className: c[y.DayButton], style: m?.[y.DayButton], type: "button", day: C, modifiers: S, disabled: !S.focused && S.disabled || void 0, "aria-disabled": S.focused && S.disabled || void 0, tabIndex: zt(C) ? 0 : -1, "aria-label": Ut(q, S, i.options, i), onClick: rn(C, S), onBlur: sn(C, S), onFocus: on(C, S), onKeyDown: an(C, S), onMouseEnter: cn(C, S), onMouseLeave: un(C, S) }, _(q, i.options, i)) : !S.hidden && _(C.date, i.options, i));
|
|
2363
|
-
})
|
|
2364
|
-
)))
|
|
2365
|
-
)
|
|
2366
|
-
))
|
|
2367
|
-
),
|
|
2368
|
-
t.footer && d.createElement(n.Footer, { className: c[y.Footer], style: m?.[y.Footer], role: "status", "aria-live": "polite" }, t.footer)
|
|
2369
|
-
)
|
|
2370
|
-
);
|
|
2371
|
-
}
|
|
2372
|
-
export {
|
|
2373
|
-
Ht as $,
|
|
2374
|
-
Vr as A,
|
|
2375
|
-
Dr as B,
|
|
2376
|
-
Yt as C,
|
|
2377
|
-
G as D,
|
|
2378
|
-
Jr as E,
|
|
2379
|
-
vr as F,
|
|
2380
|
-
Lr as G,
|
|
2381
|
-
eo as H,
|
|
2382
|
-
Ft as I,
|
|
2383
|
-
to as J,
|
|
2384
|
-
Kr as K,
|
|
2385
|
-
Ze as L,
|
|
2386
|
-
Sr as M,
|
|
2387
|
-
Tr as N,
|
|
2388
|
-
xr as O,
|
|
2389
|
-
_r as P,
|
|
2390
|
-
oo as Q,
|
|
2391
|
-
Fr as R,
|
|
2392
|
-
Pr as S,
|
|
2393
|
-
H as T,
|
|
2394
|
-
Xe as U,
|
|
2395
|
-
so as V,
|
|
2396
|
-
Br as W,
|
|
2397
|
-
Pt as X,
|
|
2398
|
-
$r as Y,
|
|
2399
|
-
Bt as Z,
|
|
2400
|
-
It as _,
|
|
2401
|
-
yr as a,
|
|
2402
|
-
qt as a0,
|
|
2403
|
-
At as a1,
|
|
2404
|
-
Gt as a2,
|
|
2405
|
-
$t as a3,
|
|
2406
|
-
jt as a4,
|
|
2407
|
-
y as a5,
|
|
2408
|
-
F as a6,
|
|
2409
|
-
Z as a7,
|
|
2410
|
-
A as a8,
|
|
2411
|
-
Tt as a9,
|
|
2412
|
-
xo as aa,
|
|
2413
|
-
ee as ab,
|
|
2414
|
-
jo as ac,
|
|
2415
|
-
_o as ad,
|
|
2416
|
-
Fo as ae,
|
|
2417
|
-
L as af,
|
|
2418
|
-
$o as ag,
|
|
2419
|
-
ht as ah,
|
|
2420
|
-
Ue as ai,
|
|
2421
|
-
We as aj,
|
|
2422
|
-
Qe as ak,
|
|
2423
|
-
Ke as al,
|
|
2424
|
-
Et as am,
|
|
2425
|
-
xt as an,
|
|
2426
|
-
gr as b,
|
|
2427
|
-
Go as c,
|
|
2428
|
-
z as d,
|
|
2429
|
-
Ct as e,
|
|
2430
|
-
Mr as f,
|
|
2431
|
-
br as g,
|
|
2432
|
-
wr as h,
|
|
2433
|
-
kr as i,
|
|
2434
|
-
pr as j,
|
|
2435
|
-
Or as k,
|
|
2436
|
-
Wr as l,
|
|
2437
|
-
Nr as m,
|
|
2438
|
-
Cr as n,
|
|
2439
|
-
Yr as o,
|
|
2440
|
-
Er as p,
|
|
2441
|
-
Ir as q,
|
|
2442
|
-
Hr as r,
|
|
2443
|
-
qr as s,
|
|
2444
|
-
Ar as t,
|
|
2445
|
-
De as u,
|
|
2446
|
-
Gr as v,
|
|
2447
|
-
Ro as w,
|
|
2448
|
-
_t as x,
|
|
2449
|
-
Zr as y,
|
|
2450
|
-
Xr as z
|
|
2451
|
-
};
|
|
2452
|
-
//# sourceMappingURL=DayPicker-4hE1QEvO.js.map
|