@forsyteco/product-ui 0.0.11 → 0.0.13
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/{active-element-history-BJ1HYFpN.mjs → active-element-history-B7wA4w4L.mjs} +3 -3
- package/dist/autocomplete/autocomplete.d.ts +87 -0
- package/dist/autocomplete/autocomplete.d.ts.map +1 -0
- package/dist/autocomplete/index.cjs +1 -0
- package/dist/autocomplete/index.d.ts +4 -0
- package/dist/autocomplete/index.d.ts.map +1 -0
- package/dist/autocomplete/index.mjs +4 -0
- package/dist/autocomplete/types.d.ts +7 -0
- package/dist/autocomplete/types.d.ts.map +1 -0
- package/dist/autocomplete-DqDP76nV.mjs +318 -0
- package/dist/autocomplete-DuGKfbQn.js +1 -0
- package/dist/avatar/index.mjs +1 -1
- package/dist/{avatar-CN9vtSKm.mjs → avatar-Br4ih6PQ.mjs} +2 -2
- package/dist/breadcrumb/index.cjs +1 -1
- package/dist/breadcrumb/index.mjs +1 -1
- package/dist/{breadcrumb-Bz_JVFcb.mjs → breadcrumb-C81R8CJz.mjs} +2 -2
- package/dist/{breadcrumb-y_RB72EG.js → breadcrumb-DJGlCCR1.js} +1 -1
- package/dist/{bugs-bn44RJ1Q.mjs → bugs-g7aYPtcD.mjs} +1 -1
- package/dist/calendar/calendar.d.ts.map +1 -1
- package/dist/calendar/index.cjs +1 -1
- package/dist/calendar/index.mjs +1 -1
- package/dist/{calendar-CAySGYDy.mjs → calendar-DQdo9vO-.mjs} +1058 -993
- package/dist/calendar-v2NOtsdr.js +1 -0
- package/dist/chevron-right-CIgI-iLu.js +1 -0
- package/dist/{chevron-right-DcjcIxI2.mjs → chevron-right-Ck5BtE5n.mjs} +11 -6
- package/dist/combobox/combobox.d.ts +72 -17
- package/dist/combobox/combobox.d.ts.map +1 -1
- package/dist/combobox/index.cjs +1 -1
- package/dist/combobox/index.d.ts +2 -1
- package/dist/combobox/index.d.ts.map +1 -1
- package/dist/combobox/index.mjs +1 -1
- package/dist/combobox/types.d.ts +7 -0
- package/dist/combobox/types.d.ts.map +1 -0
- package/dist/combobox-B1h2hn6a.js +4 -0
- package/dist/combobox-BHLjk9D9.mjs +293 -0
- package/dist/combobox-DxpuSWuM.js +1 -0
- package/dist/{combobox-Dyen_KC6.mjs → combobox-Umb1ZW9S.mjs} +358 -408
- package/dist/data-table/components/table-body.d.ts.map +1 -1
- package/dist/date-picker/date-picker.d.ts.map +1 -1
- package/dist/{description-CAH1nOgr.mjs → description-hiFZ303Y.mjs} +2 -2
- package/dist/dialog/index.mjs +1 -1
- package/dist/{dialog-nGcnK6o1.mjs → dialog-Cs7TMa7R.mjs} +53 -53
- package/dist/disclosure/index.cjs +1 -1
- package/dist/disclosure/index.mjs +1 -1
- package/dist/{disclosure-CA45jH3I.mjs → disclosure-DOWglOHy.mjs} +8 -12
- package/dist/{disclosure-CGxPdR-8.js → disclosure-qEQ_kll8.js} +1 -1
- package/dist/dropdown-menu/index.cjs +1 -1
- package/dist/dropdown-menu/index.mjs +1 -1
- package/dist/{dropdown-menu-Bj9ftuBZ.mjs → dropdown-menu--aGYYbJi.mjs} +22 -30
- package/dist/dropdown-menu-B9fTvSZe.js +1 -0
- package/dist/{element-movement-B3AVr940.mjs → element-movement-Bad2OqSj.mjs} +4 -4
- package/dist/floating-C1n3e5u7.js +1 -0
- package/dist/{floating-dEgEvBqv.mjs → floating-DQ2M2ViQ.mjs} +429 -425
- package/dist/{focus-management-DUVCz_zm.mjs → focus-management-BGuC9pKE.mjs} +2 -2
- package/dist/{form-fields-CXtJvVC5.mjs → form-fields-Bpp9kTvo.mjs} +2 -2
- package/dist/{frozen-Cpa22rmr.mjs → frozen-CXF36eio.mjs} +2 -2
- package/dist/{hidden-Blo8kfIB.mjs → hidden-H5tOTsXH.mjs} +1 -1
- package/dist/{index-CuNisU0H.mjs → index-Dh75VhI6.mjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +769 -776
- package/dist/{keyboard-Bi11Rnr0.mjs → keyboard-BzaAKRwG.mjs} +1 -1
- package/dist/{label-DAaE-vxI.mjs → label--pGndX3z.mjs} +3 -3
- package/dist/listbox/index.cjs +1 -1
- package/dist/listbox/index.mjs +1 -1
- package/dist/{listbox-DZ4v8TYt.mjs → listbox-3DAgC6_y.mjs} +17 -21
- package/dist/{listbox-BIwbzCji.js → listbox-cpJossI7.js} +1 -1
- package/dist/{open-closed-BkH8ZC7H.mjs → open-closed-Be5nD5U2.mjs} +4 -4
- package/dist/popover/index.cjs +1 -1
- package/dist/popover/index.mjs +1 -1
- package/dist/{popover-BAm_8SCx.mjs → popover-CZO6Afya.mjs} +22 -22
- package/dist/{popover-B5-dVDC1.js → popover-CysmX396.js} +1 -1
- package/dist/{portal-BaBdcS83.mjs → portal-D-TZOwvF.mjs} +6 -6
- package/dist/radio-group/index.cjs +1 -1
- package/dist/radio-group/index.mjs +1 -1
- package/dist/{radio-group-CTf6mrDs.mjs → radio-group-BIQWXrVI.mjs} +8 -8
- package/dist/{radio-group-d2V69c7t.js → radio-group-CbQAsBFv.js} +1 -1
- package/dist/sonner/index.cjs +1 -1
- package/dist/sonner/index.mjs +1 -1
- package/dist/{sonner-CuPfwlK5.js → sonner-BRjN2nJD.js} +1 -1
- package/dist/{sonner-Ce9PJbum.mjs → sonner-Cgc0p6ph.mjs} +3 -5
- package/dist/switch/index.cjs +1 -1
- package/dist/switch/index.mjs +1 -1
- package/dist/{switch-DqAuXwa2.js → switch-D0OrcI50.js} +1 -1
- package/dist/{switch-DKcD0IFH.mjs → switch-Eoi1pTsi.mjs} +13 -13
- package/dist/tabs/index.cjs +1 -1
- package/dist/tabs/index.mjs +1 -1
- package/dist/{tabs-DLqfQ301.mjs → tabs-Cufnu60W.mjs} +15 -15
- package/dist/{tabs-X4sPQQYs.js → tabs-TTkcVq-Q.js} +1 -1
- package/dist/transition/index.mjs +1 -1
- package/dist/{transition-B0MGuDho.mjs → transition-B4KhhkrB.mjs} +4 -4
- package/dist/{transition-D0HuUd2-.mjs → transition-Dfxdl8Si.mjs} +1 -1
- package/dist/{use-event-listener-BjXsgSkG.mjs → use-event-listener-BUA2xXRr.mjs} +1 -1
- package/dist/{use-inert-others-BCB16FKE.mjs → use-inert-others-CgSXXC-d.mjs} +3 -3
- package/dist/{use-is-mounted-COmayWN0.mjs → use-is-mounted-DJc35WXO.mjs} +1 -1
- package/dist/{use-resolve-button-type-637wy6MK.mjs → use-resolve-button-type-BhmWA6Dl.mjs} +2 -2
- package/dist/{use-sync-refs-B0fmGxD4.mjs → use-sync-refs-CDCE8QtA.mjs} +2 -2
- package/dist/{use-tab-direction-BTonGsg0.mjs → use-tab-direction-tJsn3ckX.mjs} +8 -8
- package/dist/{use-text-value-BMXU9EaO.mjs → use-text-value-BKEvykNe.mjs} +2 -2
- package/dist/{use-tree-walker-D25YXIMY.mjs → use-tree-walker-CHC6ccbq.mjs} +2 -2
- package/dist/useFocusRing-BM96K_1O.js +1 -0
- package/dist/useFocusRing-Df1NuOsX.mjs +497 -0
- package/package.json +32 -22
- package/dist/calendar-BIhWkTtG.js +0 -1
- package/dist/chevron-right-HwlOajQy.js +0 -1
- package/dist/combobox-Cm_xVD4l.js +0 -4
- package/dist/dropdown-menu-BPMdVlet.js +0 -1
- package/dist/floating-CTjRm9bt.js +0 -1
- package/dist/useFocusRing-Bocdsy5M.mjs +0 -446
- package/dist/useFocusRing-uXUSOfAR.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as q, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import h, { createContext as
|
|
1
|
+
import { jsx as q, jsxs as Tn } from "react/jsx-runtime";
|
|
2
|
+
import * as lt from "react";
|
|
3
|
+
import h, { createContext as _n, useContext as Pn, useCallback as R, useRef as Ne, useLayoutEffect as En, useState as Re, useEffect as Fn, useMemo as Ce } from "react";
|
|
4
4
|
import { c as C } from "./tailwind-DtaLkIY8.mjs";
|
|
5
|
-
import { b as
|
|
6
|
-
import { c as
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
function
|
|
5
|
+
import { b as dt, B as Qe } from "./button-DiBXU5vv.mjs";
|
|
6
|
+
import { c as Wt, C as St } from "./chevron-right-Ck5BtE5n.mjs";
|
|
7
|
+
const Bn = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], In = Wt("chevron-down", Bn);
|
|
8
|
+
const Hn = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Nt = Wt("chevron-left", Hn);
|
|
9
|
+
function zn(e, t, n = "long") {
|
|
10
10
|
return new Intl.DateTimeFormat("en-US", {
|
|
11
11
|
// Enforces engine to render the time. Without the option JavaScriptCore omits it.
|
|
12
12
|
hour: "numeric",
|
|
@@ -14,37 +14,37 @@ function In(e, t, n = "long") {
|
|
|
14
14
|
timeZoneName: n
|
|
15
15
|
}).format(t).split(/\s/g).slice(2).join(" ");
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const An = {}, pe = {};
|
|
18
18
|
function ce(e, t) {
|
|
19
19
|
try {
|
|
20
|
-
const r = (
|
|
20
|
+
const r = (An[e] ||= new Intl.DateTimeFormat("en-US", {
|
|
21
21
|
timeZone: e,
|
|
22
22
|
timeZoneName: "longOffset"
|
|
23
23
|
}).format)(t).split("GMT")[1];
|
|
24
|
-
return r in
|
|
24
|
+
return r in pe ? pe[r] : ft(r, r.split(":"));
|
|
25
25
|
} catch {
|
|
26
|
-
if (e in
|
|
27
|
-
const n = e?.match(
|
|
28
|
-
return n ?
|
|
26
|
+
if (e in pe) return pe[e];
|
|
27
|
+
const n = e?.match(qn);
|
|
28
|
+
return n ? ft(e, n.slice(1)) : NaN;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
function
|
|
31
|
+
const qn = /([+-]\d\d):?(\d\d)?/;
|
|
32
|
+
function ft(e, t) {
|
|
33
33
|
const n = +(t[0] || 0), r = +(t[1] || 0), o = +(t[2] || 0) / 60;
|
|
34
|
-
return
|
|
34
|
+
return pe[e] = n * 60 + r > 0 ? n * 60 + r + o : n * 60 - r - o;
|
|
35
35
|
}
|
|
36
|
-
class
|
|
36
|
+
class L extends Date {
|
|
37
37
|
//#region static
|
|
38
38
|
constructor(...t) {
|
|
39
|
-
super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(ce(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)),
|
|
39
|
+
super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(ce(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), Ct(this), Xe(this)) : this.setTime(Date.now());
|
|
40
40
|
}
|
|
41
41
|
static tz(t, ...n) {
|
|
42
|
-
return n.length ? new
|
|
42
|
+
return n.length ? new L(...n, t) : new L(Date.now(), t);
|
|
43
43
|
}
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region time zone
|
|
46
46
|
withTimeZone(t) {
|
|
47
|
-
return new
|
|
47
|
+
return new L(+this, t);
|
|
48
48
|
}
|
|
49
49
|
getTimezoneOffset() {
|
|
50
50
|
const t = -ce(this.timeZone, this);
|
|
@@ -53,55 +53,55 @@ class J extends Date {
|
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region time
|
|
55
55
|
setTime(t) {
|
|
56
|
-
return Date.prototype.setTime.apply(this, arguments),
|
|
56
|
+
return Date.prototype.setTime.apply(this, arguments), Xe(this), +this;
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region date-fns integration
|
|
60
|
-
[Symbol.for("constructDateFrom")](t) {
|
|
61
|
-
return new
|
|
60
|
+
[/* @__PURE__ */ Symbol.for("constructDateFrom")](t) {
|
|
61
|
+
return new L(+new Date(t), this.timeZone);
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const ht = /^(get|set)(?!UTC)/;
|
|
66
66
|
Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
|
|
67
|
-
if (!
|
|
68
|
-
const t = e.replace(
|
|
69
|
-
|
|
67
|
+
if (!ht.test(e)) return;
|
|
68
|
+
const t = e.replace(ht, "$1UTC");
|
|
69
|
+
L.prototype[t] && (e.startsWith("get") ? L.prototype[e] = function() {
|
|
70
70
|
return this.internal[t]();
|
|
71
|
-
} : (
|
|
72
|
-
return Date.prototype[t].apply(this.internal, arguments),
|
|
73
|
-
},
|
|
74
|
-
return Date.prototype[t].apply(this, arguments),
|
|
71
|
+
} : (L.prototype[e] = function() {
|
|
72
|
+
return Date.prototype[t].apply(this.internal, arguments), jn(this), +this;
|
|
73
|
+
}, L.prototype[t] = function() {
|
|
74
|
+
return Date.prototype[t].apply(this, arguments), Xe(this), +this;
|
|
75
75
|
}));
|
|
76
76
|
});
|
|
77
|
-
function
|
|
77
|
+
function Xe(e) {
|
|
78
78
|
e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-ce(e.timeZone, e) * 60));
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
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()),
|
|
80
|
+
function jn(e) {
|
|
81
|
+
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()), Ct(e);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Ct(e) {
|
|
84
84
|
const t = ce(e.timeZone, e), n = t > 0 ? Math.floor(t) : Math.ceil(t), r = /* @__PURE__ */ new Date(+e);
|
|
85
85
|
r.setUTCHours(r.getUTCHours() - 1);
|
|
86
|
-
const o = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(),
|
|
87
|
-
|
|
86
|
+
const o = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), i = -(/* @__PURE__ */ new Date(+r)).getTimezoneOffset(), a = o - i, s = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
|
|
87
|
+
a && s && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + a);
|
|
88
88
|
const c = o - n;
|
|
89
89
|
c && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + c);
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
(
|
|
94
|
-
const f = ce(e.timeZone, e), g = f > 0 ? Math.floor(f) : Math.ceil(f), W = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - g,
|
|
95
|
-
if (
|
|
96
|
-
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) +
|
|
97
|
-
const x = ce(e.timeZone, e),
|
|
90
|
+
const u = /* @__PURE__ */ new Date(+e);
|
|
91
|
+
u.setUTCSeconds(0);
|
|
92
|
+
const d = o > 0 ? u.getSeconds() : (u.getSeconds() - 60) % 60, l = Math.round(-(ce(e.timeZone, e) * 60)) % 60;
|
|
93
|
+
(l || d) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + l), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + l + d));
|
|
94
|
+
const f = ce(e.timeZone, e), g = f > 0 ? Math.floor(f) : Math.ceil(f), W = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - g, w = g !== n, D = W - c;
|
|
95
|
+
if (w && D) {
|
|
96
|
+
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + D);
|
|
97
|
+
const x = ce(e.timeZone, e), M = x > 0 ? Math.floor(x) : Math.ceil(x), O = g - M;
|
|
98
98
|
O && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + O), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + O));
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
class
|
|
101
|
+
class z extends L {
|
|
102
102
|
//#region static
|
|
103
103
|
static tz(t, ...n) {
|
|
104
|
-
return n.length ? new
|
|
104
|
+
return n.length ? new z(...n, t) : new z(Date.now(), t);
|
|
105
105
|
}
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region representation
|
|
@@ -118,7 +118,7 @@ class ne extends J {
|
|
|
118
118
|
}
|
|
119
119
|
toTimeString() {
|
|
120
120
|
const t = this.internal.toUTCString().split(" ")[4], [n, r, o] = this.tzComponents();
|
|
121
|
-
return `${t} GMT${n}${r}${o} (${
|
|
121
|
+
return `${t} GMT${n}${r}${o} (${zn(this.timeZone, this)})`;
|
|
122
122
|
}
|
|
123
123
|
toLocaleString(t, n) {
|
|
124
124
|
return Date.prototype.toLocaleString.call(this, t, {
|
|
@@ -146,59 +146,59 @@ class ne extends J {
|
|
|
146
146
|
}
|
|
147
147
|
//#endregion
|
|
148
148
|
withTimeZone(t) {
|
|
149
|
-
return new
|
|
149
|
+
return new z(+this, t);
|
|
150
150
|
}
|
|
151
151
|
//#region date-fns integration
|
|
152
|
-
[Symbol.for("constructDateFrom")](t) {
|
|
153
|
-
return new
|
|
152
|
+
[/* @__PURE__ */ Symbol.for("constructDateFrom")](t) {
|
|
153
|
+
return new z(+new Date(t), this.timeZone);
|
|
154
154
|
}
|
|
155
155
|
//#endregion
|
|
156
156
|
}
|
|
157
|
-
const
|
|
157
|
+
const xt = 6048e5, Gn = 864e5, mt = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
158
158
|
function I(e, t) {
|
|
159
|
-
return typeof e == "function" ? e(t) : e && typeof e == "object" &&
|
|
159
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && mt in e ? e[mt](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
160
160
|
}
|
|
161
161
|
function P(e, t) {
|
|
162
162
|
return I(t || e, e);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function Yt(e, t, n) {
|
|
165
165
|
const r = P(e, n?.in);
|
|
166
166
|
return isNaN(t) ? I(e, NaN) : (t && r.setDate(r.getDate() + t), r);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function Tt(e, t, n) {
|
|
169
169
|
const r = P(e, n?.in);
|
|
170
170
|
if (isNaN(t)) return I(e, NaN);
|
|
171
171
|
if (!t)
|
|
172
172
|
return r;
|
|
173
|
-
const o = r.getDate(),
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
return o >=
|
|
177
|
-
|
|
178
|
-
|
|
173
|
+
const o = r.getDate(), i = I(e, r.getTime());
|
|
174
|
+
i.setMonth(r.getMonth() + t + 1, 0);
|
|
175
|
+
const a = i.getDate();
|
|
176
|
+
return o >= a ? i : (r.setFullYear(
|
|
177
|
+
i.getFullYear(),
|
|
178
|
+
i.getMonth(),
|
|
179
179
|
o
|
|
180
180
|
), r);
|
|
181
181
|
}
|
|
182
|
-
let
|
|
183
|
-
function
|
|
184
|
-
return
|
|
182
|
+
let $n = {};
|
|
183
|
+
function De() {
|
|
184
|
+
return $n;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
const n =
|
|
188
|
-
return o.setDate(o.getDate() -
|
|
186
|
+
function he(e, t) {
|
|
187
|
+
const n = De(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, o = P(e, t?.in), i = o.getDay(), a = (i < r ? 7 : 0) + i - r;
|
|
188
|
+
return o.setDate(o.getDate() - a), o.setHours(0, 0, 0, 0), o;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
return
|
|
190
|
+
function Me(e, t) {
|
|
191
|
+
return he(e, { ...t, weekStartsOn: 1 });
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function _t(e, t) {
|
|
194
194
|
const n = P(e, t?.in), r = n.getFullYear(), o = I(n, 0);
|
|
195
195
|
o.setFullYear(r + 1, 0, 4), o.setHours(0, 0, 0, 0);
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
return n.getTime() >=
|
|
196
|
+
const i = Me(o), a = I(n, 0);
|
|
197
|
+
a.setFullYear(r, 0, 4), a.setHours(0, 0, 0, 0);
|
|
198
|
+
const s = Me(a);
|
|
199
|
+
return n.getTime() >= i.getTime() ? r + 1 : n.getTime() >= s.getTime() ? r : r - 1;
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function yt(e) {
|
|
202
202
|
const t = P(e), n = new Date(
|
|
203
203
|
Date.UTC(
|
|
204
204
|
t.getFullYear(),
|
|
@@ -212,123 +212,123 @@ function dt(e) {
|
|
|
212
212
|
);
|
|
213
213
|
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function me(e, ...t) {
|
|
216
216
|
const n = I.bind(
|
|
217
217
|
null,
|
|
218
218
|
t.find((r) => typeof r == "object")
|
|
219
219
|
);
|
|
220
220
|
return t.map(n);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function ke(e, t) {
|
|
223
223
|
const n = P(e, t?.in);
|
|
224
224
|
return n.setHours(0, 0, 0, 0), n;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
const [r, o] =
|
|
226
|
+
function Ue(e, t, n) {
|
|
227
|
+
const [r, o] = me(
|
|
228
228
|
n?.in,
|
|
229
229
|
e,
|
|
230
230
|
t
|
|
231
|
-
),
|
|
232
|
-
return Math.round((
|
|
231
|
+
), i = ke(r), a = ke(o), s = +i - yt(i), c = +a - yt(a);
|
|
232
|
+
return Math.round((s - c) / Gn);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
const n =
|
|
236
|
-
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0),
|
|
234
|
+
function Rn(e, t) {
|
|
235
|
+
const n = _t(e, t), r = I(e, 0);
|
|
236
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), Me(r);
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
return
|
|
238
|
+
function Qn(e, t, n) {
|
|
239
|
+
return Yt(e, t * 7, n);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
return
|
|
241
|
+
function Xn(e, t, n) {
|
|
242
|
+
return Tt(e, t * 12, n);
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Un(e, t) {
|
|
245
245
|
let n, r = t?.in;
|
|
246
246
|
return e.forEach((o) => {
|
|
247
247
|
!r && typeof o == "object" && (r = I.bind(null, o));
|
|
248
|
-
const
|
|
249
|
-
(!n || n <
|
|
248
|
+
const i = P(o, r);
|
|
249
|
+
(!n || n < i || isNaN(+i)) && (n = i);
|
|
250
250
|
}), I(r, n || NaN);
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function Vn(e, t) {
|
|
253
253
|
let n, r = t?.in;
|
|
254
254
|
return e.forEach((o) => {
|
|
255
255
|
!r && typeof o == "object" && (r = I.bind(null, o));
|
|
256
|
-
const
|
|
257
|
-
(!n || n >
|
|
256
|
+
const i = P(o, r);
|
|
257
|
+
(!n || n > i || isNaN(+i)) && (n = i);
|
|
258
258
|
}), I(r, n || NaN);
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
const [r, o] =
|
|
260
|
+
function Zn(e, t, n) {
|
|
261
|
+
const [r, o] = me(
|
|
262
262
|
n?.in,
|
|
263
263
|
e,
|
|
264
264
|
t
|
|
265
265
|
);
|
|
266
|
-
return +
|
|
266
|
+
return +ke(r) == +ke(o);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function Pt(e) {
|
|
269
269
|
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
270
270
|
}
|
|
271
|
-
function
|
|
272
|
-
return !(!
|
|
271
|
+
function Kn(e) {
|
|
272
|
+
return !(!Pt(e) && typeof e != "number" || isNaN(+P(e)));
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
const [r, o] =
|
|
274
|
+
function Et(e, t, n) {
|
|
275
|
+
const [r, o] = me(
|
|
276
276
|
n?.in,
|
|
277
277
|
e,
|
|
278
278
|
t
|
|
279
|
-
),
|
|
280
|
-
return
|
|
279
|
+
), i = r.getFullYear() - o.getFullYear(), a = r.getMonth() - o.getMonth();
|
|
280
|
+
return i * 12 + a;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Jn(e, t) {
|
|
283
283
|
const n = P(e, t?.in), r = n.getMonth();
|
|
284
284
|
return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
const [n, r] =
|
|
286
|
+
function Ft(e, t) {
|
|
287
|
+
const [n, r] = me(e, t.start, t.end);
|
|
288
288
|
return { start: n, end: r };
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
const { start: n, end: r } =
|
|
290
|
+
function Ln(e, t) {
|
|
291
|
+
const { start: n, end: r } = Ft(t?.in, e);
|
|
292
292
|
let o = +n > +r;
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
let
|
|
293
|
+
const i = o ? +n : +r, a = o ? r : n;
|
|
294
|
+
a.setHours(0, 0, 0, 0), a.setDate(1);
|
|
295
|
+
let s = 1;
|
|
296
296
|
const c = [];
|
|
297
|
-
for (; +
|
|
298
|
-
c.push(I(n,
|
|
297
|
+
for (; +a <= i; )
|
|
298
|
+
c.push(I(n, a)), a.setMonth(a.getMonth() + s);
|
|
299
299
|
return o ? c.reverse() : c;
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function er(e, t) {
|
|
302
302
|
const n = P(e, t?.in);
|
|
303
303
|
return n.setDate(1), n.setHours(0, 0, 0, 0), n;
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function tr(e, t) {
|
|
306
306
|
const n = P(e, t?.in), r = n.getFullYear();
|
|
307
307
|
return n.setFullYear(r + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function Bt(e, t) {
|
|
310
310
|
const n = P(e, t?.in);
|
|
311
311
|
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
const { start: n, end: r } =
|
|
313
|
+
function nr(e, t) {
|
|
314
|
+
const { start: n, end: r } = Ft(t?.in, e);
|
|
315
315
|
let o = +n > +r;
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
let
|
|
316
|
+
const i = o ? +n : +r, a = o ? r : n;
|
|
317
|
+
a.setHours(0, 0, 0, 0), a.setMonth(0, 1);
|
|
318
|
+
let s = 1;
|
|
319
319
|
const c = [];
|
|
320
|
-
for (; +
|
|
321
|
-
c.push(I(n,
|
|
320
|
+
for (; +a <= i; )
|
|
321
|
+
c.push(I(n, a)), a.setFullYear(a.getFullYear() + s);
|
|
322
322
|
return o ? c.reverse() : c;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
const n =
|
|
326
|
-
return o.setDate(o.getDate() +
|
|
324
|
+
function It(e, t) {
|
|
325
|
+
const n = De(), r = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, o = P(e, t?.in), i = o.getDay(), a = (i < r ? -7 : 0) + 6 - (i - r);
|
|
326
|
+
return o.setDate(o.getDate() + a), o.setHours(23, 59, 59, 999), o;
|
|
327
327
|
}
|
|
328
|
-
function
|
|
329
|
-
return
|
|
328
|
+
function rr(e, t) {
|
|
329
|
+
return It(e, { ...t, weekStartsOn: 1 });
|
|
330
330
|
}
|
|
331
|
-
const
|
|
331
|
+
const or = {
|
|
332
332
|
lessThanXSeconds: {
|
|
333
333
|
one: "less than a second",
|
|
334
334
|
other: "less than {{count}} seconds"
|
|
@@ -390,9 +390,9 @@ const rr = {
|
|
|
390
390
|
one: "almost 1 year",
|
|
391
391
|
other: "almost {{count}} years"
|
|
392
392
|
}
|
|
393
|
-
},
|
|
393
|
+
}, sr = (e, t, n) => {
|
|
394
394
|
let r;
|
|
395
|
-
const o =
|
|
395
|
+
const o = or[e];
|
|
396
396
|
return typeof o == "string" ? r = o : t === 1 ? r = o.one : r = o.other.replace("{{count}}", t.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
397
397
|
};
|
|
398
398
|
function Ae(e) {
|
|
@@ -401,66 +401,66 @@ function Ae(e) {
|
|
|
401
401
|
return e.formats[n] || e.formats[e.defaultWidth];
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
|
-
const
|
|
404
|
+
const ar = {
|
|
405
405
|
full: "EEEE, MMMM do, y",
|
|
406
406
|
long: "MMMM do, y",
|
|
407
407
|
medium: "MMM d, y",
|
|
408
408
|
short: "MM/dd/yyyy"
|
|
409
|
-
},
|
|
409
|
+
}, ir = {
|
|
410
410
|
full: "h:mm:ss a zzzz",
|
|
411
411
|
long: "h:mm:ss a z",
|
|
412
412
|
medium: "h:mm:ss a",
|
|
413
413
|
short: "h:mm a"
|
|
414
|
-
},
|
|
414
|
+
}, cr = {
|
|
415
415
|
full: "{{date}} 'at' {{time}}",
|
|
416
416
|
long: "{{date}} 'at' {{time}}",
|
|
417
417
|
medium: "{{date}}, {{time}}",
|
|
418
418
|
short: "{{date}}, {{time}}"
|
|
419
|
-
},
|
|
419
|
+
}, ur = {
|
|
420
420
|
date: Ae({
|
|
421
|
-
formats:
|
|
421
|
+
formats: ar,
|
|
422
422
|
defaultWidth: "full"
|
|
423
423
|
}),
|
|
424
424
|
time: Ae({
|
|
425
|
-
formats:
|
|
425
|
+
formats: ir,
|
|
426
426
|
defaultWidth: "full"
|
|
427
427
|
}),
|
|
428
428
|
dateTime: Ae({
|
|
429
|
-
formats:
|
|
429
|
+
formats: cr,
|
|
430
430
|
defaultWidth: "full"
|
|
431
431
|
})
|
|
432
|
-
},
|
|
432
|
+
}, lr = {
|
|
433
433
|
lastWeek: "'last' eeee 'at' p",
|
|
434
434
|
yesterday: "'yesterday at' p",
|
|
435
435
|
today: "'today at' p",
|
|
436
436
|
tomorrow: "'tomorrow at' p",
|
|
437
437
|
nextWeek: "eeee 'at' p",
|
|
438
438
|
other: "P"
|
|
439
|
-
},
|
|
440
|
-
function
|
|
439
|
+
}, dr = (e, t, n, r) => lr[e];
|
|
440
|
+
function ge(e) {
|
|
441
441
|
return (t, n) => {
|
|
442
442
|
const r = n?.context ? String(n.context) : "standalone";
|
|
443
443
|
let o;
|
|
444
444
|
if (r === "formatting" && e.formattingValues) {
|
|
445
|
-
const
|
|
446
|
-
o = e.formattingValues[
|
|
445
|
+
const a = e.defaultFormattingWidth || e.defaultWidth, s = n?.width ? String(n.width) : a;
|
|
446
|
+
o = e.formattingValues[s] || e.formattingValues[a];
|
|
447
447
|
} else {
|
|
448
|
-
const
|
|
449
|
-
o = e.values[
|
|
448
|
+
const a = e.defaultWidth, s = n?.width ? String(n.width) : e.defaultWidth;
|
|
449
|
+
o = e.values[s] || e.values[a];
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
return o[
|
|
451
|
+
const i = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
452
|
+
return o[i];
|
|
453
453
|
};
|
|
454
454
|
}
|
|
455
|
-
const
|
|
455
|
+
const fr = {
|
|
456
456
|
narrow: ["B", "A"],
|
|
457
457
|
abbreviated: ["BC", "AD"],
|
|
458
458
|
wide: ["Before Christ", "Anno Domini"]
|
|
459
|
-
},
|
|
459
|
+
}, hr = {
|
|
460
460
|
narrow: ["1", "2", "3", "4"],
|
|
461
461
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
462
462
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
463
|
-
},
|
|
463
|
+
}, mr = {
|
|
464
464
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
465
465
|
abbreviated: [
|
|
466
466
|
"Jan",
|
|
@@ -490,7 +490,7 @@ const dr = {
|
|
|
490
490
|
"November",
|
|
491
491
|
"December"
|
|
492
492
|
]
|
|
493
|
-
},
|
|
493
|
+
}, yr = {
|
|
494
494
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
495
495
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
496
496
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -503,7 +503,7 @@ const dr = {
|
|
|
503
503
|
"Friday",
|
|
504
504
|
"Saturday"
|
|
505
505
|
]
|
|
506
|
-
},
|
|
506
|
+
}, gr = {
|
|
507
507
|
narrow: {
|
|
508
508
|
am: "a",
|
|
509
509
|
pm: "p",
|
|
@@ -534,7 +534,7 @@ const dr = {
|
|
|
534
534
|
evening: "evening",
|
|
535
535
|
night: "night"
|
|
536
536
|
}
|
|
537
|
-
},
|
|
537
|
+
}, br = {
|
|
538
538
|
narrow: {
|
|
539
539
|
am: "a",
|
|
540
540
|
pm: "p",
|
|
@@ -565,7 +565,7 @@ const dr = {
|
|
|
565
565
|
evening: "in the evening",
|
|
566
566
|
night: "at night"
|
|
567
567
|
}
|
|
568
|
-
},
|
|
568
|
+
}, pr = (e, t) => {
|
|
569
569
|
const n = Number(e), r = n % 100;
|
|
570
570
|
if (r > 20 || r < 10)
|
|
571
571
|
switch (r % 10) {
|
|
@@ -577,89 +577,89 @@ const dr = {
|
|
|
577
577
|
return n + "rd";
|
|
578
578
|
}
|
|
579
579
|
return n + "th";
|
|
580
|
-
},
|
|
581
|
-
ordinalNumber:
|
|
582
|
-
era:
|
|
583
|
-
values:
|
|
580
|
+
}, wr = {
|
|
581
|
+
ordinalNumber: pr,
|
|
582
|
+
era: ge({
|
|
583
|
+
values: fr,
|
|
584
584
|
defaultWidth: "wide"
|
|
585
585
|
}),
|
|
586
|
-
quarter:
|
|
587
|
-
values:
|
|
586
|
+
quarter: ge({
|
|
587
|
+
values: hr,
|
|
588
588
|
defaultWidth: "wide",
|
|
589
589
|
argumentCallback: (e) => e - 1
|
|
590
590
|
}),
|
|
591
|
-
month:
|
|
592
|
-
values: hr,
|
|
593
|
-
defaultWidth: "wide"
|
|
594
|
-
}),
|
|
595
|
-
day: ye({
|
|
591
|
+
month: ge({
|
|
596
592
|
values: mr,
|
|
597
593
|
defaultWidth: "wide"
|
|
598
594
|
}),
|
|
599
|
-
|
|
595
|
+
day: ge({
|
|
600
596
|
values: yr,
|
|
597
|
+
defaultWidth: "wide"
|
|
598
|
+
}),
|
|
599
|
+
dayPeriod: ge({
|
|
600
|
+
values: gr,
|
|
601
601
|
defaultWidth: "wide",
|
|
602
|
-
formattingValues:
|
|
602
|
+
formattingValues: br,
|
|
603
603
|
defaultFormattingWidth: "wide"
|
|
604
604
|
})
|
|
605
605
|
};
|
|
606
|
-
function
|
|
606
|
+
function be(e) {
|
|
607
607
|
return (t, n = {}) => {
|
|
608
|
-
const r = n.width, o = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth],
|
|
609
|
-
if (!
|
|
608
|
+
const r = n.width, o = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], i = t.match(o);
|
|
609
|
+
if (!i)
|
|
610
610
|
return null;
|
|
611
|
-
const
|
|
611
|
+
const a = i[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? kr(s, (l) => l.test(a)) : (
|
|
612
612
|
// [TODO] -- I challenge you to fix the type
|
|
613
|
-
|
|
613
|
+
Mr(s, (l) => l.test(a))
|
|
614
614
|
);
|
|
615
|
-
let
|
|
616
|
-
|
|
615
|
+
let u;
|
|
616
|
+
u = e.valueCallback ? e.valueCallback(c) : c, u = n.valueCallback ? (
|
|
617
617
|
// [TODO] -- I challenge you to fix the type
|
|
618
|
-
n.valueCallback(
|
|
619
|
-
) :
|
|
620
|
-
const
|
|
621
|
-
return { value:
|
|
618
|
+
n.valueCallback(u)
|
|
619
|
+
) : u;
|
|
620
|
+
const d = t.slice(a.length);
|
|
621
|
+
return { value: u, rest: d };
|
|
622
622
|
};
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function Mr(e, t) {
|
|
625
625
|
for (const n in e)
|
|
626
626
|
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
627
627
|
return n;
|
|
628
628
|
}
|
|
629
|
-
function
|
|
629
|
+
function kr(e, t) {
|
|
630
630
|
for (let n = 0; n < e.length; n++)
|
|
631
631
|
if (t(e[n]))
|
|
632
632
|
return n;
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function Dr(e) {
|
|
635
635
|
return (t, n = {}) => {
|
|
636
636
|
const r = t.match(e.matchPattern);
|
|
637
637
|
if (!r) return null;
|
|
638
|
-
const o = r[0],
|
|
639
|
-
if (!
|
|
640
|
-
let
|
|
641
|
-
|
|
642
|
-
const
|
|
643
|
-
return { value:
|
|
638
|
+
const o = r[0], i = t.match(e.parsePattern);
|
|
639
|
+
if (!i) return null;
|
|
640
|
+
let a = e.valueCallback ? e.valueCallback(i[0]) : i[0];
|
|
641
|
+
a = n.valueCallback ? n.valueCallback(a) : a;
|
|
642
|
+
const s = t.slice(o.length);
|
|
643
|
+
return { value: a, rest: s };
|
|
644
644
|
};
|
|
645
645
|
}
|
|
646
|
-
const vr = /^(\d+)(th|st|nd|rd)?/i,
|
|
646
|
+
const vr = /^(\d+)(th|st|nd|rd)?/i, Or = /\d+/i, Wr = {
|
|
647
647
|
narrow: /^(b|a)/i,
|
|
648
648
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
649
649
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
650
|
-
},
|
|
650
|
+
}, Sr = {
|
|
651
651
|
any: [/^b/i, /^(a|c)/i]
|
|
652
652
|
}, Nr = {
|
|
653
653
|
narrow: /^[1234]/i,
|
|
654
654
|
abbreviated: /^q[1234]/i,
|
|
655
655
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
656
|
-
}, Sr = {
|
|
657
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
658
656
|
}, Cr = {
|
|
657
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
658
|
+
}, xr = {
|
|
659
659
|
narrow: /^[jfmasond]/i,
|
|
660
660
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
661
661
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
662
|
-
},
|
|
662
|
+
}, Yr = {
|
|
663
663
|
narrow: [
|
|
664
664
|
/^j/i,
|
|
665
665
|
/^f/i,
|
|
@@ -693,13 +693,13 @@ const vr = /^(\d+)(th|st|nd|rd)?/i, Dr = /\d+/i, Or = {
|
|
|
693
693
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
694
694
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
695
695
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
696
|
-
},
|
|
696
|
+
}, _r = {
|
|
697
697
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
698
698
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
699
|
-
},
|
|
699
|
+
}, Pr = {
|
|
700
700
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
701
701
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
702
|
-
},
|
|
702
|
+
}, Er = {
|
|
703
703
|
any: {
|
|
704
704
|
am: /^a/i,
|
|
705
705
|
pm: /^p/i,
|
|
@@ -710,78 +710,78 @@ const vr = /^(\d+)(th|st|nd|rd)?/i, Dr = /\d+/i, Or = {
|
|
|
710
710
|
evening: /evening/i,
|
|
711
711
|
night: /night/i
|
|
712
712
|
}
|
|
713
|
-
},
|
|
714
|
-
ordinalNumber:
|
|
713
|
+
}, Fr = {
|
|
714
|
+
ordinalNumber: Dr({
|
|
715
715
|
matchPattern: vr,
|
|
716
|
-
parsePattern:
|
|
716
|
+
parsePattern: Or,
|
|
717
717
|
valueCallback: (e) => parseInt(e, 10)
|
|
718
718
|
}),
|
|
719
|
-
era:
|
|
720
|
-
matchPatterns:
|
|
719
|
+
era: be({
|
|
720
|
+
matchPatterns: Wr,
|
|
721
721
|
defaultMatchWidth: "wide",
|
|
722
|
-
parsePatterns:
|
|
722
|
+
parsePatterns: Sr,
|
|
723
723
|
defaultParseWidth: "any"
|
|
724
724
|
}),
|
|
725
|
-
quarter:
|
|
725
|
+
quarter: be({
|
|
726
726
|
matchPatterns: Nr,
|
|
727
727
|
defaultMatchWidth: "wide",
|
|
728
|
-
parsePatterns:
|
|
728
|
+
parsePatterns: Cr,
|
|
729
729
|
defaultParseWidth: "any",
|
|
730
730
|
valueCallback: (e) => e + 1
|
|
731
731
|
}),
|
|
732
|
-
month:
|
|
733
|
-
matchPatterns:
|
|
732
|
+
month: be({
|
|
733
|
+
matchPatterns: xr,
|
|
734
734
|
defaultMatchWidth: "wide",
|
|
735
|
-
parsePatterns:
|
|
735
|
+
parsePatterns: Yr,
|
|
736
736
|
defaultParseWidth: "any"
|
|
737
737
|
}),
|
|
738
|
-
day:
|
|
738
|
+
day: be({
|
|
739
739
|
matchPatterns: Tr,
|
|
740
740
|
defaultMatchWidth: "wide",
|
|
741
|
-
parsePatterns:
|
|
741
|
+
parsePatterns: _r,
|
|
742
742
|
defaultParseWidth: "any"
|
|
743
743
|
}),
|
|
744
|
-
dayPeriod:
|
|
745
|
-
matchPatterns:
|
|
744
|
+
dayPeriod: be({
|
|
745
|
+
matchPatterns: Pr,
|
|
746
746
|
defaultMatchWidth: "any",
|
|
747
|
-
parsePatterns:
|
|
747
|
+
parsePatterns: Er,
|
|
748
748
|
defaultParseWidth: "any"
|
|
749
749
|
})
|
|
750
|
-
},
|
|
750
|
+
}, fe = {
|
|
751
751
|
code: "en-US",
|
|
752
|
-
formatDistance:
|
|
753
|
-
formatLong:
|
|
754
|
-
formatRelative:
|
|
755
|
-
localize:
|
|
756
|
-
match:
|
|
752
|
+
formatDistance: sr,
|
|
753
|
+
formatLong: ur,
|
|
754
|
+
formatRelative: dr,
|
|
755
|
+
localize: wr,
|
|
756
|
+
match: Fr,
|
|
757
757
|
options: {
|
|
758
758
|
weekStartsOn: 0,
|
|
759
759
|
firstWeekContainsDate: 1
|
|
760
760
|
}
|
|
761
761
|
};
|
|
762
|
-
function
|
|
762
|
+
function Br(e, t) {
|
|
763
763
|
const n = P(e, t?.in);
|
|
764
|
-
return
|
|
764
|
+
return Ue(n, Bt(n)) + 1;
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
const n = P(e, t?.in), r = +
|
|
768
|
-
return Math.round(r /
|
|
766
|
+
function Ve(e, t) {
|
|
767
|
+
const n = P(e, t?.in), r = +Me(n) - +Rn(n);
|
|
768
|
+
return Math.round(r / xt) + 1;
|
|
769
769
|
}
|
|
770
|
-
function
|
|
771
|
-
const n = P(e, t?.in), r = n.getFullYear(), o =
|
|
772
|
-
|
|
773
|
-
const
|
|
774
|
-
c.setFullYear(r, 0,
|
|
775
|
-
const
|
|
776
|
-
return +n >= +
|
|
770
|
+
function Ht(e, t) {
|
|
771
|
+
const n = P(e, t?.in), r = n.getFullYear(), o = De(), i = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, a = I(t?.in || e, 0);
|
|
772
|
+
a.setFullYear(r + 1, 0, i), a.setHours(0, 0, 0, 0);
|
|
773
|
+
const s = he(a, t), c = I(t?.in || e, 0);
|
|
774
|
+
c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
|
|
775
|
+
const u = he(c, t);
|
|
776
|
+
return +n >= +s ? r + 1 : +n >= +u ? r : r - 1;
|
|
777
777
|
}
|
|
778
|
-
function
|
|
779
|
-
const n =
|
|
780
|
-
return
|
|
778
|
+
function Ir(e, t) {
|
|
779
|
+
const n = De(), r = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, o = Ht(e, t), i = I(t?.in || e, 0);
|
|
780
|
+
return i.setFullYear(o, 0, r), i.setHours(0, 0, 0, 0), he(i, t);
|
|
781
781
|
}
|
|
782
|
-
function
|
|
783
|
-
const n = P(e, t?.in), r = +
|
|
784
|
-
return Math.round(r /
|
|
782
|
+
function Ze(e, t) {
|
|
783
|
+
const n = P(e, t?.in), r = +he(n, t) - +Ir(n, t);
|
|
784
|
+
return Math.round(r / xt) + 1;
|
|
785
785
|
}
|
|
786
786
|
function _(e, t) {
|
|
787
787
|
const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
|
|
@@ -813,7 +813,6 @@ const ae = {
|
|
|
813
813
|
return n;
|
|
814
814
|
case "aaaaa":
|
|
815
815
|
return n[0];
|
|
816
|
-
case "aaaa":
|
|
817
816
|
default:
|
|
818
817
|
return n === "am" ? "a.m." : "p.m.";
|
|
819
818
|
}
|
|
@@ -848,7 +847,7 @@ const ae = {
|
|
|
848
847
|
afternoon: "afternoon",
|
|
849
848
|
evening: "evening",
|
|
850
849
|
night: "night"
|
|
851
|
-
},
|
|
850
|
+
}, gt = {
|
|
852
851
|
// Era
|
|
853
852
|
G: function(e, t, n) {
|
|
854
853
|
const r = e.getFullYear() > 0 ? 1 : 0;
|
|
@@ -861,8 +860,6 @@ const ae = {
|
|
|
861
860
|
// A, B
|
|
862
861
|
case "GGGGG":
|
|
863
862
|
return n.era(r, { width: "narrow" });
|
|
864
|
-
// Anno Domini, Before Christ
|
|
865
|
-
case "GGGG":
|
|
866
863
|
default:
|
|
867
864
|
return n.era(r, { width: "wide" });
|
|
868
865
|
}
|
|
@@ -877,16 +874,16 @@ const ae = {
|
|
|
877
874
|
},
|
|
878
875
|
// Local week-numbering year
|
|
879
876
|
Y: function(e, t, n, r) {
|
|
880
|
-
const o =
|
|
877
|
+
const o = Ht(e, r), i = o > 0 ? o : 1 - o;
|
|
881
878
|
if (t === "YY") {
|
|
882
|
-
const
|
|
883
|
-
return _(
|
|
879
|
+
const a = i % 100;
|
|
880
|
+
return _(a, 2);
|
|
884
881
|
}
|
|
885
|
-
return t === "Yo" ? n.ordinalNumber(
|
|
882
|
+
return t === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : _(i, t.length);
|
|
886
883
|
},
|
|
887
884
|
// ISO week-numbering year
|
|
888
885
|
R: function(e, t) {
|
|
889
|
-
const n =
|
|
886
|
+
const n = _t(e);
|
|
890
887
|
return _(n, t.length);
|
|
891
888
|
},
|
|
892
889
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
@@ -927,8 +924,6 @@ const ae = {
|
|
|
927
924
|
width: "narrow",
|
|
928
925
|
context: "formatting"
|
|
929
926
|
});
|
|
930
|
-
// 1st quarter, 2nd quarter, ...
|
|
931
|
-
case "QQQQ":
|
|
932
927
|
default:
|
|
933
928
|
return n.quarter(r, {
|
|
934
929
|
width: "wide",
|
|
@@ -961,8 +956,6 @@ const ae = {
|
|
|
961
956
|
width: "narrow",
|
|
962
957
|
context: "standalone"
|
|
963
958
|
});
|
|
964
|
-
// 1st quarter, 2nd quarter, ...
|
|
965
|
-
case "qqqq":
|
|
966
959
|
default:
|
|
967
960
|
return n.quarter(r, {
|
|
968
961
|
width: "wide",
|
|
@@ -992,8 +985,6 @@ const ae = {
|
|
|
992
985
|
width: "narrow",
|
|
993
986
|
context: "formatting"
|
|
994
987
|
});
|
|
995
|
-
// January, February, ..., December
|
|
996
|
-
case "MMMM":
|
|
997
988
|
default:
|
|
998
989
|
return n.month(r, { width: "wide", context: "formatting" });
|
|
999
990
|
}
|
|
@@ -1023,20 +1014,18 @@ const ae = {
|
|
|
1023
1014
|
width: "narrow",
|
|
1024
1015
|
context: "standalone"
|
|
1025
1016
|
});
|
|
1026
|
-
// January, February, ..., December
|
|
1027
|
-
case "LLLL":
|
|
1028
1017
|
default:
|
|
1029
1018
|
return n.month(r, { width: "wide", context: "standalone" });
|
|
1030
1019
|
}
|
|
1031
1020
|
},
|
|
1032
1021
|
// Local week of year
|
|
1033
1022
|
w: function(e, t, n, r) {
|
|
1034
|
-
const o =
|
|
1023
|
+
const o = Ze(e, r);
|
|
1035
1024
|
return t === "wo" ? n.ordinalNumber(o, { unit: "week" }) : _(o, t.length);
|
|
1036
1025
|
},
|
|
1037
1026
|
// ISO week of year
|
|
1038
1027
|
I: function(e, t, n) {
|
|
1039
|
-
const r =
|
|
1028
|
+
const r = Ve(e);
|
|
1040
1029
|
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : _(r, t.length);
|
|
1041
1030
|
},
|
|
1042
1031
|
// Day of the month
|
|
@@ -1045,7 +1034,7 @@ const ae = {
|
|
|
1045
1034
|
},
|
|
1046
1035
|
// Day of year
|
|
1047
1036
|
D: function(e, t, n) {
|
|
1048
|
-
const r =
|
|
1037
|
+
const r = Br(e);
|
|
1049
1038
|
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : _(r, t.length);
|
|
1050
1039
|
},
|
|
1051
1040
|
// Day of week
|
|
@@ -1072,8 +1061,6 @@ const ae = {
|
|
|
1072
1061
|
width: "short",
|
|
1073
1062
|
context: "formatting"
|
|
1074
1063
|
});
|
|
1075
|
-
// Tuesday
|
|
1076
|
-
case "EEEE":
|
|
1077
1064
|
default:
|
|
1078
1065
|
return n.day(r, {
|
|
1079
1066
|
width: "wide",
|
|
@@ -1083,17 +1070,17 @@ const ae = {
|
|
|
1083
1070
|
},
|
|
1084
1071
|
// Local day of week
|
|
1085
1072
|
e: function(e, t, n, r) {
|
|
1086
|
-
const o = e.getDay(),
|
|
1073
|
+
const o = e.getDay(), i = (o - r.weekStartsOn + 8) % 7 || 7;
|
|
1087
1074
|
switch (t) {
|
|
1088
1075
|
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1089
1076
|
case "e":
|
|
1090
|
-
return String(
|
|
1077
|
+
return String(i);
|
|
1091
1078
|
// Padded numerical value
|
|
1092
1079
|
case "ee":
|
|
1093
|
-
return _(
|
|
1080
|
+
return _(i, 2);
|
|
1094
1081
|
// 1st, 2nd, ..., 7th
|
|
1095
1082
|
case "eo":
|
|
1096
|
-
return n.ordinalNumber(
|
|
1083
|
+
return n.ordinalNumber(i, { unit: "day" });
|
|
1097
1084
|
case "eee":
|
|
1098
1085
|
return n.day(o, {
|
|
1099
1086
|
width: "abbreviated",
|
|
@@ -1111,8 +1098,6 @@ const ae = {
|
|
|
1111
1098
|
width: "short",
|
|
1112
1099
|
context: "formatting"
|
|
1113
1100
|
});
|
|
1114
|
-
// Tuesday
|
|
1115
|
-
case "eeee":
|
|
1116
1101
|
default:
|
|
1117
1102
|
return n.day(o, {
|
|
1118
1103
|
width: "wide",
|
|
@@ -1122,17 +1107,17 @@ const ae = {
|
|
|
1122
1107
|
},
|
|
1123
1108
|
// Stand-alone local day of week
|
|
1124
1109
|
c: function(e, t, n, r) {
|
|
1125
|
-
const o = e.getDay(),
|
|
1110
|
+
const o = e.getDay(), i = (o - r.weekStartsOn + 8) % 7 || 7;
|
|
1126
1111
|
switch (t) {
|
|
1127
1112
|
// Numerical value (same as in `e`)
|
|
1128
1113
|
case "c":
|
|
1129
|
-
return String(
|
|
1114
|
+
return String(i);
|
|
1130
1115
|
// Padded numerical value
|
|
1131
1116
|
case "cc":
|
|
1132
|
-
return _(
|
|
1117
|
+
return _(i, t.length);
|
|
1133
1118
|
// 1st, 2nd, ..., 7th
|
|
1134
1119
|
case "co":
|
|
1135
|
-
return n.ordinalNumber(
|
|
1120
|
+
return n.ordinalNumber(i, { unit: "day" });
|
|
1136
1121
|
case "ccc":
|
|
1137
1122
|
return n.day(o, {
|
|
1138
1123
|
width: "abbreviated",
|
|
@@ -1150,8 +1135,6 @@ const ae = {
|
|
|
1150
1135
|
width: "short",
|
|
1151
1136
|
context: "standalone"
|
|
1152
1137
|
});
|
|
1153
|
-
// Tuesday
|
|
1154
|
-
case "cccc":
|
|
1155
1138
|
default:
|
|
1156
1139
|
return n.day(o, {
|
|
1157
1140
|
width: "wide",
|
|
@@ -1190,8 +1173,6 @@ const ae = {
|
|
|
1190
1173
|
width: "short",
|
|
1191
1174
|
context: "formatting"
|
|
1192
1175
|
});
|
|
1193
|
-
// Tuesday
|
|
1194
|
-
case "iiii":
|
|
1195
1176
|
default:
|
|
1196
1177
|
return n.day(r, {
|
|
1197
1178
|
width: "wide",
|
|
@@ -1219,7 +1200,6 @@ const ae = {
|
|
|
1219
1200
|
width: "narrow",
|
|
1220
1201
|
context: "formatting"
|
|
1221
1202
|
});
|
|
1222
|
-
case "aaaa":
|
|
1223
1203
|
default:
|
|
1224
1204
|
return n.dayPeriod(o, {
|
|
1225
1205
|
width: "wide",
|
|
@@ -1248,7 +1228,6 @@ const ae = {
|
|
|
1248
1228
|
width: "narrow",
|
|
1249
1229
|
context: "formatting"
|
|
1250
1230
|
});
|
|
1251
|
-
case "bbbb":
|
|
1252
1231
|
default:
|
|
1253
1232
|
return n.dayPeriod(o, {
|
|
1254
1233
|
width: "wide",
|
|
@@ -1273,7 +1252,6 @@ const ae = {
|
|
|
1273
1252
|
width: "narrow",
|
|
1274
1253
|
context: "formatting"
|
|
1275
1254
|
});
|
|
1276
|
-
case "BBBB":
|
|
1277
1255
|
default:
|
|
1278
1256
|
return n.dayPeriod(o, {
|
|
1279
1257
|
width: "wide",
|
|
@@ -1323,18 +1301,13 @@ const ae = {
|
|
|
1323
1301
|
switch (t) {
|
|
1324
1302
|
// Hours and optional minutes
|
|
1325
1303
|
case "X":
|
|
1326
|
-
return
|
|
1304
|
+
return pt(r);
|
|
1327
1305
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1328
1306
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1329
1307
|
// so this token always has the same output as `XX`
|
|
1330
1308
|
case "XXXX":
|
|
1331
1309
|
case "XX":
|
|
1332
1310
|
return ie(r);
|
|
1333
|
-
// Hours, minutes and optional seconds with `:` delimiter
|
|
1334
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1335
|
-
// so this token always has the same output as `XXX`
|
|
1336
|
-
case "XXXXX":
|
|
1337
|
-
case "XXX":
|
|
1338
1311
|
// Hours and minutes with `:` delimiter
|
|
1339
1312
|
default:
|
|
1340
1313
|
return ie(r, ":");
|
|
@@ -1346,18 +1319,13 @@ const ae = {
|
|
|
1346
1319
|
switch (t) {
|
|
1347
1320
|
// Hours and optional minutes
|
|
1348
1321
|
case "x":
|
|
1349
|
-
return
|
|
1322
|
+
return pt(r);
|
|
1350
1323
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1351
1324
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1352
1325
|
// so this token always has the same output as `xx`
|
|
1353
1326
|
case "xxxx":
|
|
1354
1327
|
case "xx":
|
|
1355
1328
|
return ie(r);
|
|
1356
|
-
// Hours, minutes and optional seconds with `:` delimiter
|
|
1357
|
-
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1358
|
-
// so this token always has the same output as `xxx`
|
|
1359
|
-
case "xxxxx":
|
|
1360
|
-
case "xxx":
|
|
1361
1329
|
// Hours and minutes with `:` delimiter
|
|
1362
1330
|
default:
|
|
1363
1331
|
return ie(r, ":");
|
|
@@ -1371,9 +1339,7 @@ const ae = {
|
|
|
1371
1339
|
case "O":
|
|
1372
1340
|
case "OO":
|
|
1373
1341
|
case "OOO":
|
|
1374
|
-
return "GMT" +
|
|
1375
|
-
// Long
|
|
1376
|
-
case "OOOO":
|
|
1342
|
+
return "GMT" + bt(r, ":");
|
|
1377
1343
|
default:
|
|
1378
1344
|
return "GMT" + ie(r, ":");
|
|
1379
1345
|
}
|
|
@@ -1386,9 +1352,7 @@ const ae = {
|
|
|
1386
1352
|
case "z":
|
|
1387
1353
|
case "zz":
|
|
1388
1354
|
case "zzz":
|
|
1389
|
-
return "GMT" +
|
|
1390
|
-
// Long
|
|
1391
|
-
case "zzzz":
|
|
1355
|
+
return "GMT" + bt(r, ":");
|
|
1392
1356
|
default:
|
|
1393
1357
|
return "GMT" + ie(r, ":");
|
|
1394
1358
|
}
|
|
@@ -1403,18 +1367,18 @@ const ae = {
|
|
|
1403
1367
|
return _(+e, t.length);
|
|
1404
1368
|
}
|
|
1405
1369
|
};
|
|
1406
|
-
function
|
|
1407
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), o = Math.trunc(r / 60),
|
|
1408
|
-
return
|
|
1370
|
+
function bt(e, t = "") {
|
|
1371
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), o = Math.trunc(r / 60), i = r % 60;
|
|
1372
|
+
return i === 0 ? n + String(o) : n + String(o) + t + _(i, 2);
|
|
1409
1373
|
}
|
|
1410
|
-
function
|
|
1374
|
+
function pt(e, t) {
|
|
1411
1375
|
return e % 60 === 0 ? (e > 0 ? "-" : "+") + _(Math.abs(e) / 60, 2) : ie(e, t);
|
|
1412
1376
|
}
|
|
1413
1377
|
function ie(e, t = "") {
|
|
1414
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), o = _(Math.trunc(r / 60), 2),
|
|
1415
|
-
return n + o + t +
|
|
1378
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), o = _(Math.trunc(r / 60), 2), i = _(r % 60, 2);
|
|
1379
|
+
return n + o + t + i;
|
|
1416
1380
|
}
|
|
1417
|
-
const
|
|
1381
|
+
const wt = (e, t) => {
|
|
1418
1382
|
switch (e) {
|
|
1419
1383
|
case "P":
|
|
1420
1384
|
return t.date({ width: "short" });
|
|
@@ -1422,11 +1386,10 @@ const yt = (e, t) => {
|
|
|
1422
1386
|
return t.date({ width: "medium" });
|
|
1423
1387
|
case "PPP":
|
|
1424
1388
|
return t.date({ width: "long" });
|
|
1425
|
-
case "PPPP":
|
|
1426
1389
|
default:
|
|
1427
1390
|
return t.date({ width: "full" });
|
|
1428
1391
|
}
|
|
1429
|
-
},
|
|
1392
|
+
}, zt = (e, t) => {
|
|
1430
1393
|
switch (e) {
|
|
1431
1394
|
case "p":
|
|
1432
1395
|
return t.time({ width: "short" });
|
|
@@ -1434,156 +1397,154 @@ const yt = (e, t) => {
|
|
|
1434
1397
|
return t.time({ width: "medium" });
|
|
1435
1398
|
case "ppp":
|
|
1436
1399
|
return t.time({ width: "long" });
|
|
1437
|
-
case "pppp":
|
|
1438
1400
|
default:
|
|
1439
1401
|
return t.time({ width: "full" });
|
|
1440
1402
|
}
|
|
1441
|
-
},
|
|
1403
|
+
}, Hr = (e, t) => {
|
|
1442
1404
|
const n = e.match(/(P+)(p+)?/) || [], r = n[1], o = n[2];
|
|
1443
1405
|
if (!o)
|
|
1444
|
-
return
|
|
1445
|
-
let
|
|
1406
|
+
return wt(e, t);
|
|
1407
|
+
let i;
|
|
1446
1408
|
switch (r) {
|
|
1447
1409
|
case "P":
|
|
1448
|
-
|
|
1410
|
+
i = t.dateTime({ width: "short" });
|
|
1449
1411
|
break;
|
|
1450
1412
|
case "PP":
|
|
1451
|
-
|
|
1413
|
+
i = t.dateTime({ width: "medium" });
|
|
1452
1414
|
break;
|
|
1453
1415
|
case "PPP":
|
|
1454
|
-
|
|
1416
|
+
i = t.dateTime({ width: "long" });
|
|
1455
1417
|
break;
|
|
1456
|
-
case "PPPP":
|
|
1457
1418
|
default:
|
|
1458
|
-
|
|
1419
|
+
i = t.dateTime({ width: "full" });
|
|
1459
1420
|
break;
|
|
1460
1421
|
}
|
|
1461
|
-
return
|
|
1462
|
-
},
|
|
1463
|
-
p:
|
|
1464
|
-
P:
|
|
1465
|
-
}, Ar = /^D+$/, qr = /^Y+$/,
|
|
1466
|
-
function
|
|
1422
|
+
return i.replace("{{date}}", wt(r, t)).replace("{{time}}", zt(o, t));
|
|
1423
|
+
}, zr = {
|
|
1424
|
+
p: zt,
|
|
1425
|
+
P: Hr
|
|
1426
|
+
}, Ar = /^D+$/, qr = /^Y+$/, jr = ["D", "DD", "YY", "YYYY"];
|
|
1427
|
+
function Gr(e) {
|
|
1467
1428
|
return Ar.test(e);
|
|
1468
1429
|
}
|
|
1469
|
-
function
|
|
1430
|
+
function $r(e) {
|
|
1470
1431
|
return qr.test(e);
|
|
1471
1432
|
}
|
|
1472
|
-
function $r(e, t, n) {
|
|
1473
|
-
const r = Rr(e, t, n);
|
|
1474
|
-
if (console.warn(r), zr.includes(e)) throw new RangeError(r);
|
|
1475
|
-
}
|
|
1476
1433
|
function Rr(e, t, n) {
|
|
1434
|
+
const r = Qr(e, t, n);
|
|
1435
|
+
if (console.warn(r), jr.includes(e)) throw new RangeError(r);
|
|
1436
|
+
}
|
|
1437
|
+
function Qr(e, t, n) {
|
|
1477
1438
|
const r = e[0] === "Y" ? "years" : "days of the month";
|
|
1478
1439
|
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1479
1440
|
}
|
|
1480
|
-
const
|
|
1481
|
-
function
|
|
1482
|
-
const r =
|
|
1483
|
-
if (!
|
|
1441
|
+
const Xr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ur = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Vr = /^'([^]*?)'?$/, Zr = /''/g, Kr = /[a-zA-Z]/;
|
|
1442
|
+
function we(e, t, n) {
|
|
1443
|
+
const r = De(), o = n?.locale ?? r.locale ?? fe, i = n?.firstWeekContainsDate ?? n?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, a = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, s = P(e, n?.in);
|
|
1444
|
+
if (!Kn(s))
|
|
1484
1445
|
throw new RangeError("Invalid time value");
|
|
1485
|
-
let c = t.match(
|
|
1486
|
-
const
|
|
1487
|
-
if (
|
|
1488
|
-
const f =
|
|
1489
|
-
return f(
|
|
1446
|
+
let c = t.match(Ur).map((d) => {
|
|
1447
|
+
const l = d[0];
|
|
1448
|
+
if (l === "p" || l === "P") {
|
|
1449
|
+
const f = zr[l];
|
|
1450
|
+
return f(d, o.formatLong);
|
|
1490
1451
|
}
|
|
1491
|
-
return
|
|
1492
|
-
}).join("").match(
|
|
1493
|
-
if (
|
|
1452
|
+
return d;
|
|
1453
|
+
}).join("").match(Xr).map((d) => {
|
|
1454
|
+
if (d === "''")
|
|
1494
1455
|
return { isToken: !1, value: "'" };
|
|
1495
|
-
const
|
|
1496
|
-
if (
|
|
1497
|
-
return { isToken: !1, value:
|
|
1498
|
-
if (
|
|
1499
|
-
return { isToken: !0, value:
|
|
1500
|
-
if (
|
|
1456
|
+
const l = d[0];
|
|
1457
|
+
if (l === "'")
|
|
1458
|
+
return { isToken: !1, value: Jr(d) };
|
|
1459
|
+
if (gt[l])
|
|
1460
|
+
return { isToken: !0, value: d };
|
|
1461
|
+
if (l.match(Kr))
|
|
1501
1462
|
throw new RangeError(
|
|
1502
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
1463
|
+
"Format string contains an unescaped latin alphabet character `" + l + "`"
|
|
1503
1464
|
);
|
|
1504
|
-
return { isToken: !1, value:
|
|
1465
|
+
return { isToken: !1, value: d };
|
|
1505
1466
|
});
|
|
1506
|
-
o.localize.preprocessor && (c = o.localize.preprocessor(
|
|
1507
|
-
const
|
|
1508
|
-
firstWeekContainsDate:
|
|
1509
|
-
weekStartsOn:
|
|
1467
|
+
o.localize.preprocessor && (c = o.localize.preprocessor(s, c));
|
|
1468
|
+
const u = {
|
|
1469
|
+
firstWeekContainsDate: i,
|
|
1470
|
+
weekStartsOn: a,
|
|
1510
1471
|
locale: o
|
|
1511
1472
|
};
|
|
1512
|
-
return c.map((
|
|
1513
|
-
if (!
|
|
1514
|
-
const
|
|
1515
|
-
(!n?.useAdditionalWeekYearTokens &&
|
|
1516
|
-
const f =
|
|
1517
|
-
return f(
|
|
1473
|
+
return c.map((d) => {
|
|
1474
|
+
if (!d.isToken) return d.value;
|
|
1475
|
+
const l = d.value;
|
|
1476
|
+
(!n?.useAdditionalWeekYearTokens && $r(l) || !n?.useAdditionalDayOfYearTokens && Gr(l)) && Rr(l, t, String(e));
|
|
1477
|
+
const f = gt[l[0]];
|
|
1478
|
+
return f(s, l, o.localize, u);
|
|
1518
1479
|
}).join("");
|
|
1519
1480
|
}
|
|
1520
|
-
function
|
|
1521
|
-
const t = e.match(
|
|
1481
|
+
function Jr(e) {
|
|
1482
|
+
const t = e.match(Vr);
|
|
1522
1483
|
return t ? t[1].replace(Zr, "'") : e;
|
|
1523
1484
|
}
|
|
1524
|
-
function Jr(e, t) {
|
|
1525
|
-
const n = P(e, t?.in), r = n.getFullYear(), o = n.getMonth(), a = I(n, 0);
|
|
1526
|
-
return a.setFullYear(r, o + 1, 0), a.setHours(0, 0, 0, 0), a.getDate();
|
|
1527
|
-
}
|
|
1528
1485
|
function Lr(e, t) {
|
|
1529
|
-
|
|
1486
|
+
const n = P(e, t?.in), r = n.getFullYear(), o = n.getMonth(), i = I(n, 0);
|
|
1487
|
+
return i.setFullYear(r, o + 1, 0), i.setHours(0, 0, 0, 0), i.getDate();
|
|
1530
1488
|
}
|
|
1531
1489
|
function eo(e, t) {
|
|
1532
|
-
return P(e, t?.in).
|
|
1490
|
+
return P(e, t?.in).getMonth();
|
|
1533
1491
|
}
|
|
1534
1492
|
function to(e, t) {
|
|
1535
|
-
return
|
|
1493
|
+
return P(e, t?.in).getFullYear();
|
|
1536
1494
|
}
|
|
1537
1495
|
function no(e, t) {
|
|
1496
|
+
return +P(e) > +P(t);
|
|
1497
|
+
}
|
|
1498
|
+
function ro(e, t) {
|
|
1538
1499
|
return +P(e) < +P(t);
|
|
1539
1500
|
}
|
|
1540
|
-
function
|
|
1541
|
-
const [r, o] =
|
|
1501
|
+
function oo(e, t, n) {
|
|
1502
|
+
const [r, o] = me(
|
|
1542
1503
|
n?.in,
|
|
1543
1504
|
e,
|
|
1544
1505
|
t
|
|
1545
1506
|
);
|
|
1546
1507
|
return r.getFullYear() === o.getFullYear() && r.getMonth() === o.getMonth();
|
|
1547
1508
|
}
|
|
1548
|
-
function
|
|
1549
|
-
const [r, o] =
|
|
1509
|
+
function so(e, t, n) {
|
|
1510
|
+
const [r, o] = me(
|
|
1550
1511
|
n?.in,
|
|
1551
1512
|
e,
|
|
1552
1513
|
t
|
|
1553
1514
|
);
|
|
1554
1515
|
return r.getFullYear() === o.getFullYear();
|
|
1555
1516
|
}
|
|
1556
|
-
function so(e, t, n) {
|
|
1557
|
-
const r = P(e, n?.in), o = r.getFullYear(), a = r.getDate(), s = I(e, 0);
|
|
1558
|
-
s.setFullYear(o, t, 15), s.setHours(0, 0, 0, 0);
|
|
1559
|
-
const i = Jr(s);
|
|
1560
|
-
return r.setMonth(t, Math.min(a, i)), r;
|
|
1561
|
-
}
|
|
1562
1517
|
function ao(e, t, n) {
|
|
1518
|
+
const r = P(e, n?.in), o = r.getFullYear(), i = r.getDate(), a = I(e, 0);
|
|
1519
|
+
a.setFullYear(o, t, 15), a.setHours(0, 0, 0, 0);
|
|
1520
|
+
const s = Lr(a);
|
|
1521
|
+
return r.setMonth(t, Math.min(i, s)), r;
|
|
1522
|
+
}
|
|
1523
|
+
function io(e, t, n) {
|
|
1563
1524
|
const r = P(e, n?.in);
|
|
1564
1525
|
return isNaN(+r) ? I(e, NaN) : (r.setFullYear(t), r);
|
|
1565
1526
|
}
|
|
1566
|
-
const
|
|
1567
|
-
function
|
|
1568
|
-
const n = t.startOfMonth(e), r = n.getDay() > 0 ? n.getDay() : 7, o = t.addDays(e, -r + 1),
|
|
1569
|
-
return t.getMonth(e) === t.getMonth(
|
|
1527
|
+
const Mt = 5, co = 4;
|
|
1528
|
+
function uo(e, t) {
|
|
1529
|
+
const n = t.startOfMonth(e), r = n.getDay() > 0 ? n.getDay() : 7, o = t.addDays(e, -r + 1), i = t.addDays(o, Mt * 7 - 1);
|
|
1530
|
+
return t.getMonth(e) === t.getMonth(i) ? Mt : co;
|
|
1570
1531
|
}
|
|
1571
|
-
function
|
|
1532
|
+
function At(e, t) {
|
|
1572
1533
|
const n = t.startOfMonth(e), r = n.getDay();
|
|
1573
1534
|
return r === 1 ? n : r === 0 ? t.addDays(n, -6) : t.addDays(n, -1 * (r - 1));
|
|
1574
1535
|
}
|
|
1575
|
-
function
|
|
1576
|
-
const n =
|
|
1536
|
+
function lo(e, t) {
|
|
1537
|
+
const n = At(e, t), r = uo(e, t);
|
|
1577
1538
|
return t.addDays(n, r * 7 - 1);
|
|
1578
1539
|
}
|
|
1579
|
-
const
|
|
1580
|
-
...
|
|
1540
|
+
const qt = {
|
|
1541
|
+
...fe,
|
|
1581
1542
|
labels: {
|
|
1582
1543
|
labelDayButton: (e, t, n, r) => {
|
|
1583
1544
|
let o;
|
|
1584
|
-
r && typeof r.format == "function" ? o = r.format.bind(r) : o = (
|
|
1585
|
-
let
|
|
1586
|
-
return t.today && (
|
|
1545
|
+
r && typeof r.format == "function" ? o = r.format.bind(r) : o = (a, s) => we(a, s, { locale: fe, ...n });
|
|
1546
|
+
let i = o(e, "PPPP");
|
|
1547
|
+
return t.today && (i = `Today, ${i}`), t.selected && (i = `${i}, selected`), i;
|
|
1587
1548
|
},
|
|
1588
1549
|
labelMonthDropdown: "Choose the Month",
|
|
1589
1550
|
labelNext: "Go to the Next Month",
|
|
@@ -1592,23 +1553,23 @@ const At = {
|
|
|
1592
1553
|
labelYearDropdown: "Choose the Year",
|
|
1593
1554
|
labelGrid: (e, t, n) => {
|
|
1594
1555
|
let r;
|
|
1595
|
-
return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (o,
|
|
1556
|
+
return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (o, i) => we(o, i, { locale: fe, ...t }), r(e, "LLLL yyyy");
|
|
1596
1557
|
},
|
|
1597
1558
|
labelGridcell: (e, t, n, r) => {
|
|
1598
1559
|
let o;
|
|
1599
|
-
r && typeof r.format == "function" ? o = r.format.bind(r) : o = (
|
|
1600
|
-
let
|
|
1601
|
-
return t?.today && (
|
|
1560
|
+
r && typeof r.format == "function" ? o = r.format.bind(r) : o = (a, s) => we(a, s, { locale: fe, ...n });
|
|
1561
|
+
let i = o(e, "PPPP");
|
|
1562
|
+
return t?.today && (i = `Today, ${i}`), i;
|
|
1602
1563
|
},
|
|
1603
1564
|
labelNav: "Navigation bar",
|
|
1604
1565
|
labelWeekNumberHeader: "Week Number",
|
|
1605
1566
|
labelWeekday: (e, t, n) => {
|
|
1606
1567
|
let r;
|
|
1607
|
-
return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (o,
|
|
1568
|
+
return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (o, i) => we(o, i, { locale: fe, ...t }), r(e, "cccc");
|
|
1608
1569
|
}
|
|
1609
1570
|
}
|
|
1610
1571
|
};
|
|
1611
|
-
class
|
|
1572
|
+
class G {
|
|
1612
1573
|
/**
|
|
1613
1574
|
* Creates an instance of `DateLib`.
|
|
1614
1575
|
*
|
|
@@ -1616,18 +1577,18 @@ class j {
|
|
|
1616
1577
|
* @param overrides Custom overrides for the date library functions.
|
|
1617
1578
|
*/
|
|
1618
1579
|
constructor(t, n) {
|
|
1619
|
-
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ?
|
|
1620
|
-
const o = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(r) :
|
|
1621
|
-
if (
|
|
1580
|
+
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? z.tz(this.options.timeZone) : new this.Date(), this.newDate = (r, o, i) => this.overrides?.newDate ? this.overrides.newDate(r, o, i) : this.options.timeZone ? new z(r, o, i, this.options.timeZone) : new Date(r, o, i), this.addDays = (r, o) => this.overrides?.addDays ? this.overrides.addDays(r, o) : Yt(r, o), this.addMonths = (r, o) => this.overrides?.addMonths ? this.overrides.addMonths(r, o) : Tt(r, o), this.addWeeks = (r, o) => this.overrides?.addWeeks ? this.overrides.addWeeks(r, o) : Qn(r, o), this.addYears = (r, o) => this.overrides?.addYears ? this.overrides.addYears(r, o) : Xn(r, o), this.differenceInCalendarDays = (r, o) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, o) : Ue(r, o), this.differenceInCalendarMonths = (r, o) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, o) : Et(r, o), this.eachMonthOfInterval = (r) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : Ln(r), this.eachYearOfInterval = (r) => {
|
|
1581
|
+
const o = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(r) : nr(r), i = new Set(o.map((s) => this.getYear(s)));
|
|
1582
|
+
if (i.size === o.length)
|
|
1622
1583
|
return o;
|
|
1623
|
-
const
|
|
1624
|
-
return
|
|
1625
|
-
|
|
1626
|
-
}),
|
|
1627
|
-
}, this.endOfBroadcastWeek = (r) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) :
|
|
1628
|
-
const
|
|
1629
|
-
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(
|
|
1630
|
-
}, this.getISOWeek = (r) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(r) :
|
|
1584
|
+
const a = [];
|
|
1585
|
+
return i.forEach((s) => {
|
|
1586
|
+
a.push(new Date(s, 0, 1));
|
|
1587
|
+
}), a;
|
|
1588
|
+
}, this.endOfBroadcastWeek = (r) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : lo(r, this), this.endOfISOWeek = (r) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(r) : rr(r), this.endOfMonth = (r) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(r) : Jn(r), this.endOfWeek = (r, o) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(r, o) : It(r, this.options), this.endOfYear = (r) => this.overrides?.endOfYear ? this.overrides.endOfYear(r) : tr(r), this.format = (r, o, i) => {
|
|
1589
|
+
const a = this.overrides?.format ? this.overrides.format(r, o, this.options) : we(r, o, this.options);
|
|
1590
|
+
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(a) : a;
|
|
1591
|
+
}, this.getISOWeek = (r) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(r) : Ve(r), this.getMonth = (r, o) => this.overrides?.getMonth ? this.overrides.getMonth(r, this.options) : eo(r, this.options), this.getYear = (r, o) => this.overrides?.getYear ? this.overrides.getYear(r, this.options) : to(r, this.options), this.getWeek = (r, o) => this.overrides?.getWeek ? this.overrides.getWeek(r, this.options) : Ze(r, this.options), this.isAfter = (r, o) => this.overrides?.isAfter ? this.overrides.isAfter(r, o) : no(r, o), this.isBefore = (r, o) => this.overrides?.isBefore ? this.overrides.isBefore(r, o) : ro(r, o), this.isDate = (r) => this.overrides?.isDate ? this.overrides.isDate(r) : Pt(r), this.isSameDay = (r, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(r, o) : Zn(r, o), this.isSameMonth = (r, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(r, o) : oo(r, o), this.isSameYear = (r, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(r, o) : so(r, o), this.max = (r) => this.overrides?.max ? this.overrides.max(r) : Un(r), this.min = (r) => this.overrides?.min ? this.overrides.min(r) : Vn(r), this.setMonth = (r, o) => this.overrides?.setMonth ? this.overrides.setMonth(r, o) : ao(r, o), this.setYear = (r, o) => this.overrides?.setYear ? this.overrides.setYear(r, o) : io(r, o), this.startOfBroadcastWeek = (r, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : At(r, this), this.startOfDay = (r) => this.overrides?.startOfDay ? this.overrides.startOfDay(r) : ke(r), this.startOfISOWeek = (r) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(r) : Me(r), this.startOfMonth = (r) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(r) : er(r), this.startOfWeek = (r, o) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(r, this.options) : he(r, this.options), this.startOfYear = (r) => this.overrides?.startOfYear ? this.overrides.startOfYear(r) : Bt(r), this.options = { locale: qt, ...t }, this.overrides = n;
|
|
1631
1592
|
}
|
|
1632
1593
|
/**
|
|
1633
1594
|
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
@@ -1671,7 +1632,7 @@ class j {
|
|
|
1671
1632
|
*/
|
|
1672
1633
|
getMonthYearOrder() {
|
|
1673
1634
|
const t = this.options.locale?.code;
|
|
1674
|
-
return t &&
|
|
1635
|
+
return t && G.yearFirstLocales.has(t) ? "year-first" : "month-first";
|
|
1675
1636
|
}
|
|
1676
1637
|
/**
|
|
1677
1638
|
* Formats the month/year pair respecting locale conventions.
|
|
@@ -1679,10 +1640,10 @@ class j {
|
|
|
1679
1640
|
* @since 9.11.0
|
|
1680
1641
|
*/
|
|
1681
1642
|
formatMonthYear(t) {
|
|
1682
|
-
const { locale: n, timeZone: r, numerals: o } = this.options,
|
|
1683
|
-
if (
|
|
1643
|
+
const { locale: n, timeZone: r, numerals: o } = this.options, i = n?.code;
|
|
1644
|
+
if (i && G.yearFirstLocales.has(i))
|
|
1684
1645
|
try {
|
|
1685
|
-
return new Intl.DateTimeFormat(
|
|
1646
|
+
return new Intl.DateTimeFormat(i, {
|
|
1686
1647
|
month: "long",
|
|
1687
1648
|
year: "numeric",
|
|
1688
1649
|
timeZone: r,
|
|
@@ -1690,11 +1651,11 @@ class j {
|
|
|
1690
1651
|
}).format(t);
|
|
1691
1652
|
} catch {
|
|
1692
1653
|
}
|
|
1693
|
-
const
|
|
1694
|
-
return this.format(t,
|
|
1654
|
+
const a = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
1655
|
+
return this.format(t, a);
|
|
1695
1656
|
}
|
|
1696
1657
|
}
|
|
1697
|
-
|
|
1658
|
+
G.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
1698
1659
|
"eu",
|
|
1699
1660
|
"hu",
|
|
1700
1661
|
"ja",
|
|
@@ -1713,9 +1674,9 @@ j.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
|
1713
1674
|
"zh-HK",
|
|
1714
1675
|
"zh-TW"
|
|
1715
1676
|
]);
|
|
1716
|
-
const
|
|
1717
|
-
class
|
|
1718
|
-
constructor(t, n, r =
|
|
1677
|
+
const ee = new G();
|
|
1678
|
+
class jt {
|
|
1679
|
+
constructor(t, n, r = ee) {
|
|
1719
1680
|
this.date = t, this.displayMonth = n, this.outside = !!(n && !r.isSameMonth(t, n)), this.dateLib = r, this.isoDate = r.format(t, "yyyy-MM-dd"), this.displayMonthId = r.format(n, "yyyy-MM"), this.dateMonthId = r.format(t, "yyyy-MM");
|
|
1720
1681
|
}
|
|
1721
1682
|
/**
|
|
@@ -1729,23 +1690,23 @@ class qt {
|
|
|
1729
1690
|
return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
|
|
1730
1691
|
}
|
|
1731
1692
|
}
|
|
1732
|
-
class
|
|
1693
|
+
class fo {
|
|
1733
1694
|
constructor(t, n) {
|
|
1734
1695
|
this.date = t, this.weeks = n;
|
|
1735
1696
|
}
|
|
1736
1697
|
}
|
|
1737
|
-
class
|
|
1698
|
+
class ho {
|
|
1738
1699
|
constructor(t, n) {
|
|
1739
1700
|
this.days = n, this.weekNumber = t;
|
|
1740
1701
|
}
|
|
1741
1702
|
}
|
|
1742
|
-
function
|
|
1703
|
+
function mo(e) {
|
|
1743
1704
|
return h.createElement("button", { ...e });
|
|
1744
1705
|
}
|
|
1745
|
-
function
|
|
1706
|
+
function yo(e) {
|
|
1746
1707
|
return h.createElement("span", { ...e });
|
|
1747
1708
|
}
|
|
1748
|
-
function
|
|
1709
|
+
function go(e) {
|
|
1749
1710
|
const { size: t = 24, orientation: n = "left", className: r } = e;
|
|
1750
1711
|
return (
|
|
1751
1712
|
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
|
|
@@ -1759,11 +1720,11 @@ function yo(e) {
|
|
|
1759
1720
|
)
|
|
1760
1721
|
);
|
|
1761
1722
|
}
|
|
1762
|
-
function
|
|
1723
|
+
function bo(e) {
|
|
1763
1724
|
const { day: t, modifiers: n, ...r } = e;
|
|
1764
1725
|
return h.createElement("td", { ...r });
|
|
1765
1726
|
}
|
|
1766
|
-
function
|
|
1727
|
+
function po(e) {
|
|
1767
1728
|
const { day: t, modifiers: n, ...r } = e, o = h.useRef(null);
|
|
1768
1729
|
return h.useEffect(() => {
|
|
1769
1730
|
n.focused && o.current?.focus();
|
|
@@ -1777,35 +1738,35 @@ var F;
|
|
|
1777
1738
|
(function(e) {
|
|
1778
1739
|
e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
|
|
1779
1740
|
})(F || (F = {}));
|
|
1780
|
-
var
|
|
1741
|
+
var Z;
|
|
1781
1742
|
(function(e) {
|
|
1782
1743
|
e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
|
|
1783
|
-
})(
|
|
1784
|
-
var
|
|
1744
|
+
})(Z || (Z = {}));
|
|
1745
|
+
var j;
|
|
1785
1746
|
(function(e) {
|
|
1786
1747
|
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";
|
|
1787
|
-
})(
|
|
1788
|
-
function
|
|
1789
|
-
const { options: t, className: n, components: r, classNames: o, ...
|
|
1748
|
+
})(j || (j = {}));
|
|
1749
|
+
function wo(e) {
|
|
1750
|
+
const { options: t, className: n, components: r, classNames: o, ...i } = e, a = [o[y.Dropdown], n].join(" "), s = t?.find(({ value: c }) => c === i.value);
|
|
1790
1751
|
return h.createElement(
|
|
1791
1752
|
"span",
|
|
1792
|
-
{ "data-disabled":
|
|
1793
|
-
h.createElement(r.Select, { className:
|
|
1753
|
+
{ "data-disabled": i.disabled, className: o[y.DropdownRoot] },
|
|
1754
|
+
h.createElement(r.Select, { className: a, ...i }, t?.map(({ value: c, label: u, disabled: d }) => h.createElement(r.Option, { key: c, value: c, disabled: d }, u))),
|
|
1794
1755
|
h.createElement(
|
|
1795
1756
|
"span",
|
|
1796
1757
|
{ className: o[y.CaptionLabel], "aria-hidden": !0 },
|
|
1797
|
-
|
|
1758
|
+
s?.label,
|
|
1798
1759
|
h.createElement(r.Chevron, { orientation: "down", size: 18, className: o[y.Chevron] })
|
|
1799
1760
|
)
|
|
1800
1761
|
);
|
|
1801
1762
|
}
|
|
1802
|
-
function wo(e) {
|
|
1803
|
-
return h.createElement("div", { ...e });
|
|
1804
|
-
}
|
|
1805
1763
|
function Mo(e) {
|
|
1806
1764
|
return h.createElement("div", { ...e });
|
|
1807
1765
|
}
|
|
1808
1766
|
function ko(e) {
|
|
1767
|
+
return h.createElement("div", { ...e });
|
|
1768
|
+
}
|
|
1769
|
+
function Do(e) {
|
|
1809
1770
|
const { calendarMonth: t, displayIndex: n, ...r } = e;
|
|
1810
1771
|
return h.createElement("div", { ...r }, e.children);
|
|
1811
1772
|
}
|
|
@@ -1813,209 +1774,209 @@ function vo(e) {
|
|
|
1813
1774
|
const { calendarMonth: t, displayIndex: n, ...r } = e;
|
|
1814
1775
|
return h.createElement("div", { ...r });
|
|
1815
1776
|
}
|
|
1816
|
-
function
|
|
1777
|
+
function Oo(e) {
|
|
1817
1778
|
return h.createElement("table", { ...e });
|
|
1818
1779
|
}
|
|
1819
|
-
function
|
|
1780
|
+
function Wo(e) {
|
|
1820
1781
|
return h.createElement("div", { ...e });
|
|
1821
1782
|
}
|
|
1822
|
-
const
|
|
1823
|
-
function
|
|
1824
|
-
const e =
|
|
1783
|
+
const Gt = _n(void 0);
|
|
1784
|
+
function ye() {
|
|
1785
|
+
const e = Pn(Gt);
|
|
1825
1786
|
if (e === void 0)
|
|
1826
1787
|
throw new Error("useDayPicker() must be used within a custom component.");
|
|
1827
1788
|
return e;
|
|
1828
1789
|
}
|
|
1829
|
-
function
|
|
1830
|
-
const { components: t } =
|
|
1790
|
+
function So(e) {
|
|
1791
|
+
const { components: t } = ye();
|
|
1831
1792
|
return h.createElement(t.Dropdown, { ...e });
|
|
1832
1793
|
}
|
|
1833
1794
|
function No(e) {
|
|
1834
|
-
const { onPreviousClick: t, onNextClick: n, previousMonth: r, nextMonth: o, ...
|
|
1795
|
+
const { onPreviousClick: t, onNextClick: n, previousMonth: r, nextMonth: o, ...i } = e, { components: a, classNames: s, labels: { labelPrevious: c, labelNext: u } } = ye(), d = R((f) => {
|
|
1835
1796
|
o && n?.(f);
|
|
1836
|
-
}, [o, n]),
|
|
1797
|
+
}, [o, n]), l = R((f) => {
|
|
1837
1798
|
r && t?.(f);
|
|
1838
1799
|
}, [r, t]);
|
|
1839
1800
|
return h.createElement(
|
|
1840
1801
|
"nav",
|
|
1841
|
-
{ ...
|
|
1802
|
+
{ ...i },
|
|
1842
1803
|
h.createElement(
|
|
1843
|
-
|
|
1844
|
-
{ type: "button", className:
|
|
1845
|
-
h.createElement(
|
|
1804
|
+
a.PreviousMonthButton,
|
|
1805
|
+
{ type: "button", className: s[y.PreviousMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled": r ? void 0 : !0, "aria-label": c(r), onClick: l },
|
|
1806
|
+
h.createElement(a.Chevron, { disabled: r ? void 0 : !0, className: s[y.Chevron], orientation: "left" })
|
|
1846
1807
|
),
|
|
1847
1808
|
h.createElement(
|
|
1848
|
-
|
|
1849
|
-
{ type: "button", className:
|
|
1850
|
-
h.createElement(
|
|
1809
|
+
a.NextMonthButton,
|
|
1810
|
+
{ type: "button", className: s[y.NextMonthButton], tabIndex: o ? void 0 : -1, "aria-disabled": o ? void 0 : !0, "aria-label": u(o), onClick: d },
|
|
1811
|
+
h.createElement(a.Chevron, { disabled: o ? void 0 : !0, orientation: "right", className: s[y.Chevron] })
|
|
1851
1812
|
)
|
|
1852
1813
|
);
|
|
1853
1814
|
}
|
|
1854
|
-
function
|
|
1855
|
-
const { components: t } =
|
|
1815
|
+
function Co(e) {
|
|
1816
|
+
const { components: t } = ye();
|
|
1856
1817
|
return h.createElement(t.Button, { ...e });
|
|
1857
1818
|
}
|
|
1858
|
-
function
|
|
1819
|
+
function xo(e) {
|
|
1859
1820
|
return h.createElement("option", { ...e });
|
|
1860
1821
|
}
|
|
1861
|
-
function
|
|
1862
|
-
const { components: t } =
|
|
1822
|
+
function Yo(e) {
|
|
1823
|
+
const { components: t } = ye();
|
|
1863
1824
|
return h.createElement(t.Button, { ...e });
|
|
1864
1825
|
}
|
|
1865
1826
|
function To(e) {
|
|
1866
1827
|
const { rootRef: t, ...n } = e;
|
|
1867
1828
|
return h.createElement("div", { ...n, ref: t });
|
|
1868
1829
|
}
|
|
1869
|
-
function
|
|
1830
|
+
function _o(e) {
|
|
1870
1831
|
return h.createElement("select", { ...e });
|
|
1871
1832
|
}
|
|
1872
|
-
function
|
|
1833
|
+
function Po(e) {
|
|
1873
1834
|
const { week: t, ...n } = e;
|
|
1874
1835
|
return h.createElement("tr", { ...n });
|
|
1875
1836
|
}
|
|
1876
|
-
function
|
|
1837
|
+
function Eo(e) {
|
|
1877
1838
|
return h.createElement("th", { ...e });
|
|
1878
1839
|
}
|
|
1879
|
-
function
|
|
1840
|
+
function Fo(e) {
|
|
1880
1841
|
return h.createElement(
|
|
1881
1842
|
"thead",
|
|
1882
1843
|
{ "aria-hidden": !0 },
|
|
1883
1844
|
h.createElement("tr", { ...e })
|
|
1884
1845
|
);
|
|
1885
1846
|
}
|
|
1886
|
-
function
|
|
1847
|
+
function Bo(e) {
|
|
1887
1848
|
const { week: t, ...n } = e;
|
|
1888
1849
|
return h.createElement("th", { ...n });
|
|
1889
1850
|
}
|
|
1890
|
-
function
|
|
1851
|
+
function Io(e) {
|
|
1891
1852
|
return h.createElement("th", { ...e });
|
|
1892
1853
|
}
|
|
1893
|
-
function
|
|
1854
|
+
function Ho(e) {
|
|
1894
1855
|
return h.createElement("tbody", { ...e });
|
|
1895
1856
|
}
|
|
1896
|
-
function
|
|
1897
|
-
const { components: t } =
|
|
1857
|
+
function zo(e) {
|
|
1858
|
+
const { components: t } = ye();
|
|
1898
1859
|
return h.createElement(t.Dropdown, { ...e });
|
|
1899
1860
|
}
|
|
1900
1861
|
const Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1901
1862
|
__proto__: null,
|
|
1902
|
-
Button:
|
|
1903
|
-
CaptionLabel:
|
|
1904
|
-
Chevron:
|
|
1905
|
-
Day:
|
|
1906
|
-
DayButton:
|
|
1907
|
-
Dropdown:
|
|
1908
|
-
DropdownNav:
|
|
1909
|
-
Footer:
|
|
1910
|
-
Month:
|
|
1863
|
+
Button: mo,
|
|
1864
|
+
CaptionLabel: yo,
|
|
1865
|
+
Chevron: go,
|
|
1866
|
+
Day: bo,
|
|
1867
|
+
DayButton: po,
|
|
1868
|
+
Dropdown: wo,
|
|
1869
|
+
DropdownNav: Mo,
|
|
1870
|
+
Footer: ko,
|
|
1871
|
+
Month: Do,
|
|
1911
1872
|
MonthCaption: vo,
|
|
1912
|
-
MonthGrid:
|
|
1913
|
-
Months:
|
|
1914
|
-
MonthsDropdown:
|
|
1873
|
+
MonthGrid: Oo,
|
|
1874
|
+
Months: Wo,
|
|
1875
|
+
MonthsDropdown: So,
|
|
1915
1876
|
Nav: No,
|
|
1916
|
-
NextMonthButton:
|
|
1917
|
-
Option:
|
|
1918
|
-
PreviousMonthButton:
|
|
1877
|
+
NextMonthButton: Co,
|
|
1878
|
+
Option: xo,
|
|
1879
|
+
PreviousMonthButton: Yo,
|
|
1919
1880
|
Root: To,
|
|
1920
|
-
Select:
|
|
1921
|
-
Week:
|
|
1922
|
-
WeekNumber:
|
|
1923
|
-
WeekNumberHeader:
|
|
1924
|
-
Weekday:
|
|
1925
|
-
Weekdays:
|
|
1926
|
-
Weeks:
|
|
1927
|
-
YearsDropdown:
|
|
1881
|
+
Select: _o,
|
|
1882
|
+
Week: Po,
|
|
1883
|
+
WeekNumber: Bo,
|
|
1884
|
+
WeekNumberHeader: Io,
|
|
1885
|
+
Weekday: Eo,
|
|
1886
|
+
Weekdays: Fo,
|
|
1887
|
+
Weeks: Ho,
|
|
1888
|
+
YearsDropdown: zo
|
|
1928
1889
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1929
|
-
function re(e, t, n = !1, r =
|
|
1930
|
-
let { from: o, to:
|
|
1931
|
-
const { differenceInCalendarDays:
|
|
1932
|
-
return o &&
|
|
1890
|
+
function re(e, t, n = !1, r = ee) {
|
|
1891
|
+
let { from: o, to: i } = e;
|
|
1892
|
+
const { differenceInCalendarDays: a, isSameDay: s } = r;
|
|
1893
|
+
return o && i ? (a(i, o) < 0 && ([o, i] = [i, o]), a(t, o) >= (n ? 1 : 0) && a(i, t) >= (n ? 1 : 0)) : !n && i ? s(i, t) : !n && o ? s(o, t) : !1;
|
|
1933
1894
|
}
|
|
1934
|
-
function
|
|
1895
|
+
function Ke(e) {
|
|
1935
1896
|
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
1936
1897
|
}
|
|
1937
|
-
function
|
|
1898
|
+
function xe(e) {
|
|
1938
1899
|
return !!(e && typeof e == "object" && "from" in e);
|
|
1939
1900
|
}
|
|
1940
|
-
function
|
|
1901
|
+
function Je(e) {
|
|
1941
1902
|
return !!(e && typeof e == "object" && "after" in e);
|
|
1942
1903
|
}
|
|
1943
|
-
function
|
|
1904
|
+
function Le(e) {
|
|
1944
1905
|
return !!(e && typeof e == "object" && "before" in e);
|
|
1945
1906
|
}
|
|
1946
|
-
function
|
|
1907
|
+
function $t(e) {
|
|
1947
1908
|
return !!(e && typeof e == "object" && "dayOfWeek" in e);
|
|
1948
1909
|
}
|
|
1949
|
-
function
|
|
1910
|
+
function Rt(e, t) {
|
|
1950
1911
|
return Array.isArray(e) && e.every(t.isDate);
|
|
1951
1912
|
}
|
|
1952
|
-
function oe(e, t, n =
|
|
1953
|
-
const r = Array.isArray(t) ? t : [t], { isSameDay: o, differenceInCalendarDays:
|
|
1954
|
-
return r.some((
|
|
1955
|
-
if (typeof
|
|
1956
|
-
return
|
|
1957
|
-
if (n.isDate(
|
|
1958
|
-
return o(e,
|
|
1959
|
-
if (
|
|
1960
|
-
return
|
|
1961
|
-
if (
|
|
1962
|
-
return re(
|
|
1963
|
-
if (
|
|
1964
|
-
return Array.isArray(
|
|
1965
|
-
if (
|
|
1966
|
-
const c =
|
|
1967
|
-
return s
|
|
1913
|
+
function oe(e, t, n = ee) {
|
|
1914
|
+
const r = Array.isArray(t) ? t : [t], { isSameDay: o, differenceInCalendarDays: i, isAfter: a } = n;
|
|
1915
|
+
return r.some((s) => {
|
|
1916
|
+
if (typeof s == "boolean")
|
|
1917
|
+
return s;
|
|
1918
|
+
if (n.isDate(s))
|
|
1919
|
+
return o(e, s);
|
|
1920
|
+
if (Rt(s, n))
|
|
1921
|
+
return s.some((c) => o(e, c));
|
|
1922
|
+
if (xe(s))
|
|
1923
|
+
return re(s, e, !1, n);
|
|
1924
|
+
if ($t(s))
|
|
1925
|
+
return Array.isArray(s.dayOfWeek) ? s.dayOfWeek.includes(e.getDay()) : s.dayOfWeek === e.getDay();
|
|
1926
|
+
if (Ke(s)) {
|
|
1927
|
+
const c = i(s.before, e), u = i(s.after, e), d = c > 0, l = u < 0;
|
|
1928
|
+
return a(s.before, s.after) ? l && d : d || l;
|
|
1968
1929
|
}
|
|
1969
|
-
return
|
|
1930
|
+
return Je(s) ? i(e, s.after) > 0 : Le(s) ? i(s.before, e) > 0 : typeof s == "function" ? s(e) : !1;
|
|
1970
1931
|
});
|
|
1971
1932
|
}
|
|
1972
1933
|
function qo(e, t, n, r, o) {
|
|
1973
|
-
const { disabled:
|
|
1934
|
+
const { disabled: i, hidden: a, modifiers: s, showOutsideDays: c, broadcastCalendar: u, today: d = o.today() } = t, { isSameDay: l, isSameMonth: f, startOfMonth: g, isBefore: v, endOfMonth: W, isAfter: w } = o, D = n && g(n), x = r && W(r), M = {
|
|
1974
1935
|
[F.focused]: [],
|
|
1975
1936
|
[F.outside]: [],
|
|
1976
1937
|
[F.disabled]: [],
|
|
1977
1938
|
[F.hidden]: [],
|
|
1978
1939
|
[F.today]: []
|
|
1979
1940
|
}, O = {};
|
|
1980
|
-
for (const
|
|
1981
|
-
const { date: m, displayMonth:
|
|
1982
|
-
!
|
|
1983
|
-
E &&
|
|
1984
|
-
const ue =
|
|
1985
|
-
ue && oe(m, ue, o) && (O[
|
|
1941
|
+
for (const p of e) {
|
|
1942
|
+
const { date: m, displayMonth: S } = p, E = !!(S && !f(m, S)), H = !!(D && v(m, D)), B = !!(x && w(m, x)), K = !!(i && oe(m, i, o)), se = !!(a && oe(m, a, o)) || H || B || // Broadcast calendar will show outside days as default
|
|
1943
|
+
!u && !c && E || u && c === !1 && E, te = l(m, d);
|
|
1944
|
+
E && M.outside.push(p), K && M.disabled.push(p), se && M.hidden.push(p), te && M.today.push(p), s && Object.keys(s).forEach(($) => {
|
|
1945
|
+
const ue = s?.[$];
|
|
1946
|
+
ue && oe(m, ue, o) && (O[$] ? O[$].push(p) : O[$] = [p]);
|
|
1986
1947
|
});
|
|
1987
1948
|
}
|
|
1988
|
-
return (
|
|
1949
|
+
return (p) => {
|
|
1989
1950
|
const m = {
|
|
1990
1951
|
[F.focused]: !1,
|
|
1991
1952
|
[F.disabled]: !1,
|
|
1992
1953
|
[F.hidden]: !1,
|
|
1993
1954
|
[F.outside]: !1,
|
|
1994
1955
|
[F.today]: !1
|
|
1995
|
-
},
|
|
1996
|
-
for (const E in
|
|
1997
|
-
const H =
|
|
1998
|
-
m[E] = H.some((B) => B ===
|
|
1956
|
+
}, S = {};
|
|
1957
|
+
for (const E in M) {
|
|
1958
|
+
const H = M[E];
|
|
1959
|
+
m[E] = H.some((B) => B === p);
|
|
1999
1960
|
}
|
|
2000
1961
|
for (const E in O)
|
|
2001
|
-
|
|
1962
|
+
S[E] = O[E].some((H) => H === p);
|
|
2002
1963
|
return {
|
|
2003
1964
|
...m,
|
|
2004
1965
|
// custom modifiers should override all the previous ones
|
|
2005
|
-
...
|
|
1966
|
+
...S
|
|
2006
1967
|
};
|
|
2007
1968
|
};
|
|
2008
1969
|
}
|
|
2009
|
-
function
|
|
2010
|
-
return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [
|
|
1970
|
+
function jo(e, t, n = {}) {
|
|
1971
|
+
return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [i]) => (n[i] ? o.push(n[i]) : t[F[i]] ? o.push(t[F[i]]) : t[Z[i]] && o.push(t[Z[i]]), o), [t[y.Day]]);
|
|
2011
1972
|
}
|
|
2012
|
-
function
|
|
1973
|
+
function Go(e) {
|
|
2013
1974
|
return {
|
|
2014
1975
|
...Ao,
|
|
2015
1976
|
...e
|
|
2016
1977
|
};
|
|
2017
1978
|
}
|
|
2018
|
-
function
|
|
1979
|
+
function $o(e) {
|
|
2019
1980
|
const t = {
|
|
2020
1981
|
"data-mode": e.mode ?? void 0,
|
|
2021
1982
|
"data-required": "required" in e ? e.required : void 0,
|
|
@@ -2028,141 +1989,141 @@ function Go(e) {
|
|
|
2028
1989
|
n.startsWith("data-") && (t[n] = r);
|
|
2029
1990
|
}), t;
|
|
2030
1991
|
}
|
|
2031
|
-
function
|
|
1992
|
+
function Qt() {
|
|
2032
1993
|
const e = {};
|
|
2033
1994
|
for (const t in y)
|
|
2034
1995
|
e[y[t]] = `rdp-${y[t]}`;
|
|
2035
1996
|
for (const t in F)
|
|
2036
1997
|
e[F[t]] = `rdp-${F[t]}`;
|
|
2037
|
-
for (const t in
|
|
2038
|
-
e[
|
|
2039
|
-
for (const t in
|
|
2040
|
-
e[
|
|
1998
|
+
for (const t in Z)
|
|
1999
|
+
e[Z[t]] = `rdp-${Z[t]}`;
|
|
2000
|
+
for (const t in j)
|
|
2001
|
+
e[j[t]] = `rdp-${j[t]}`;
|
|
2041
2002
|
return e;
|
|
2042
2003
|
}
|
|
2043
|
-
function
|
|
2044
|
-
return (n ?? new
|
|
2004
|
+
function Xt(e, t, n) {
|
|
2005
|
+
return (n ?? new G(t)).formatMonthYear(e);
|
|
2045
2006
|
}
|
|
2046
|
-
const
|
|
2047
|
-
function
|
|
2048
|
-
return (n ?? new
|
|
2007
|
+
const Ro = Xt;
|
|
2008
|
+
function Qo(e, t, n) {
|
|
2009
|
+
return (n ?? new G(t)).format(e, "d");
|
|
2049
2010
|
}
|
|
2050
|
-
function
|
|
2011
|
+
function Xo(e, t = ee) {
|
|
2051
2012
|
return t.format(e, "LLLL");
|
|
2052
2013
|
}
|
|
2053
|
-
function
|
|
2054
|
-
return (n ?? new
|
|
2014
|
+
function Uo(e, t, n) {
|
|
2015
|
+
return (n ?? new G(t)).format(e, "cccccc");
|
|
2055
2016
|
}
|
|
2056
|
-
function
|
|
2017
|
+
function Vo(e, t = ee) {
|
|
2057
2018
|
return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
|
|
2058
2019
|
}
|
|
2059
2020
|
function Zo() {
|
|
2060
2021
|
return "";
|
|
2061
2022
|
}
|
|
2062
|
-
function
|
|
2023
|
+
function Ut(e, t = ee) {
|
|
2063
2024
|
return t.format(e, "yyyy");
|
|
2064
2025
|
}
|
|
2065
|
-
const
|
|
2026
|
+
const Ko = Ut, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2066
2027
|
__proto__: null,
|
|
2067
|
-
formatCaption:
|
|
2068
|
-
formatDay:
|
|
2069
|
-
formatMonthCaption:
|
|
2070
|
-
formatMonthDropdown:
|
|
2071
|
-
formatWeekNumber:
|
|
2028
|
+
formatCaption: Xt,
|
|
2029
|
+
formatDay: Qo,
|
|
2030
|
+
formatMonthCaption: Ro,
|
|
2031
|
+
formatMonthDropdown: Xo,
|
|
2032
|
+
formatWeekNumber: Vo,
|
|
2072
2033
|
formatWeekNumberHeader: Zo,
|
|
2073
|
-
formatWeekdayName:
|
|
2074
|
-
formatYearCaption:
|
|
2075
|
-
formatYearDropdown:
|
|
2034
|
+
formatWeekdayName: Uo,
|
|
2035
|
+
formatYearCaption: Ko,
|
|
2036
|
+
formatYearDropdown: Ut
|
|
2076
2037
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2077
|
-
function
|
|
2038
|
+
function Lo(e) {
|
|
2078
2039
|
return e?.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e?.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
|
|
2079
|
-
...
|
|
2040
|
+
...Jo,
|
|
2080
2041
|
...e
|
|
2081
2042
|
};
|
|
2082
2043
|
}
|
|
2083
|
-
function
|
|
2084
|
-
let o = (r ?? new
|
|
2044
|
+
function et(e, t, n, r) {
|
|
2045
|
+
let o = (r ?? new G(n)).format(e, "PPPP");
|
|
2085
2046
|
return t.today && (o = `Today, ${o}`), t.selected && (o = `${o}, selected`), o;
|
|
2086
2047
|
}
|
|
2087
|
-
const
|
|
2088
|
-
function
|
|
2089
|
-
return (n ?? new
|
|
2048
|
+
const es = et;
|
|
2049
|
+
function tt(e, t, n) {
|
|
2050
|
+
return (n ?? new G(t)).formatMonthYear(e);
|
|
2090
2051
|
}
|
|
2091
|
-
const
|
|
2092
|
-
function
|
|
2093
|
-
let o = (r ?? new
|
|
2052
|
+
const ts = tt;
|
|
2053
|
+
function Vt(e, t, n, r) {
|
|
2054
|
+
let o = (r ?? new G(n)).format(e, "PPPP");
|
|
2094
2055
|
return t?.today && (o = `Today, ${o}`), o;
|
|
2095
2056
|
}
|
|
2096
|
-
function
|
|
2057
|
+
function Zt(e) {
|
|
2097
2058
|
return "Choose the Month";
|
|
2098
2059
|
}
|
|
2099
|
-
function
|
|
2060
|
+
function Kt() {
|
|
2100
2061
|
return "";
|
|
2101
2062
|
}
|
|
2102
|
-
const
|
|
2103
|
-
function
|
|
2104
|
-
return
|
|
2063
|
+
const ns = "Go to the Next Month";
|
|
2064
|
+
function nt(e, t) {
|
|
2065
|
+
return ns;
|
|
2105
2066
|
}
|
|
2106
|
-
function
|
|
2067
|
+
function rt(e) {
|
|
2107
2068
|
return "Go to the Previous Month";
|
|
2108
2069
|
}
|
|
2109
|
-
function
|
|
2110
|
-
return (n ?? new
|
|
2070
|
+
function Jt(e, t, n) {
|
|
2071
|
+
return (n ?? new G(t)).format(e, "cccc");
|
|
2111
2072
|
}
|
|
2112
|
-
function
|
|
2073
|
+
function Lt(e, t) {
|
|
2113
2074
|
return `Week ${e}`;
|
|
2114
2075
|
}
|
|
2115
|
-
function
|
|
2076
|
+
function en(e) {
|
|
2116
2077
|
return "Week Number";
|
|
2117
2078
|
}
|
|
2118
|
-
function
|
|
2079
|
+
function tn(e) {
|
|
2119
2080
|
return "Choose the Year";
|
|
2120
2081
|
}
|
|
2121
|
-
const
|
|
2082
|
+
const rs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2122
2083
|
__proto__: null,
|
|
2123
|
-
labelCaption:
|
|
2124
|
-
labelDay:
|
|
2125
|
-
labelDayButton:
|
|
2126
|
-
labelGrid:
|
|
2127
|
-
labelGridcell:
|
|
2128
|
-
labelMonthDropdown:
|
|
2129
|
-
labelNav:
|
|
2130
|
-
labelNext:
|
|
2131
|
-
labelPrevious:
|
|
2132
|
-
labelWeekNumber:
|
|
2133
|
-
labelWeekNumberHeader:
|
|
2134
|
-
labelWeekday:
|
|
2135
|
-
labelYearDropdown:
|
|
2136
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2137
|
-
function
|
|
2084
|
+
labelCaption: ts,
|
|
2085
|
+
labelDay: es,
|
|
2086
|
+
labelDayButton: et,
|
|
2087
|
+
labelGrid: tt,
|
|
2088
|
+
labelGridcell: Vt,
|
|
2089
|
+
labelMonthDropdown: Zt,
|
|
2090
|
+
labelNav: Kt,
|
|
2091
|
+
labelNext: nt,
|
|
2092
|
+
labelPrevious: rt,
|
|
2093
|
+
labelWeekNumber: Lt,
|
|
2094
|
+
labelWeekNumberHeader: en,
|
|
2095
|
+
labelWeekday: Jt,
|
|
2096
|
+
labelYearDropdown: tn
|
|
2097
|
+
}, Symbol.toStringTag, { value: "Module" })), V = (e, t, n) => t || (n ? typeof n == "function" ? n : (...r) => n : e);
|
|
2098
|
+
function os(e, t) {
|
|
2138
2099
|
const n = t.locale?.labels ?? {};
|
|
2139
2100
|
return {
|
|
2140
|
-
...
|
|
2101
|
+
...rs,
|
|
2141
2102
|
...e ?? {},
|
|
2142
|
-
labelDayButton:
|
|
2143
|
-
labelMonthDropdown:
|
|
2144
|
-
labelNext:
|
|
2145
|
-
labelPrevious:
|
|
2146
|
-
labelWeekNumber:
|
|
2147
|
-
labelYearDropdown:
|
|
2148
|
-
labelGrid:
|
|
2149
|
-
labelGridcell:
|
|
2150
|
-
labelNav:
|
|
2151
|
-
labelWeekNumberHeader:
|
|
2152
|
-
labelWeekday:
|
|
2103
|
+
labelDayButton: V(et, e?.labelDayButton, n.labelDayButton),
|
|
2104
|
+
labelMonthDropdown: V(Zt, e?.labelMonthDropdown, n.labelMonthDropdown),
|
|
2105
|
+
labelNext: V(nt, e?.labelNext, n.labelNext),
|
|
2106
|
+
labelPrevious: V(rt, e?.labelPrevious, n.labelPrevious),
|
|
2107
|
+
labelWeekNumber: V(Lt, e?.labelWeekNumber, n.labelWeekNumber),
|
|
2108
|
+
labelYearDropdown: V(tn, e?.labelYearDropdown, n.labelYearDropdown),
|
|
2109
|
+
labelGrid: V(tt, e?.labelGrid, n.labelGrid),
|
|
2110
|
+
labelGridcell: V(Vt, e?.labelGridcell, n.labelGridcell),
|
|
2111
|
+
labelNav: V(Kt, e?.labelNav, n.labelNav),
|
|
2112
|
+
labelWeekNumberHeader: V(en, e?.labelWeekNumberHeader, n.labelWeekNumberHeader),
|
|
2113
|
+
labelWeekday: V(Jt, e?.labelWeekday, n.labelWeekday)
|
|
2153
2114
|
};
|
|
2154
2115
|
}
|
|
2155
|
-
function
|
|
2156
|
-
const { startOfMonth:
|
|
2116
|
+
function ss(e, t, n, r, o) {
|
|
2117
|
+
const { startOfMonth: i, startOfYear: a, endOfYear: s, eachMonthOfInterval: c, getMonth: u } = o;
|
|
2157
2118
|
return c({
|
|
2158
|
-
start:
|
|
2159
|
-
end:
|
|
2119
|
+
start: a(e),
|
|
2120
|
+
end: s(e)
|
|
2160
2121
|
}).map((f) => {
|
|
2161
|
-
const g = r.formatMonthDropdown(f, o),
|
|
2162
|
-
return { value:
|
|
2122
|
+
const g = r.formatMonthDropdown(f, o), v = u(f), W = t && f < i(t) || n && f > i(n) || !1;
|
|
2123
|
+
return { value: v, label: g, disabled: W };
|
|
2163
2124
|
});
|
|
2164
2125
|
}
|
|
2165
|
-
function
|
|
2126
|
+
function as(e, t = {}, n = {}) {
|
|
2166
2127
|
let r = { ...t?.[y.Day] };
|
|
2167
2128
|
return Object.entries(e).filter(([, o]) => o === !0).forEach(([o]) => {
|
|
2168
2129
|
r = {
|
|
@@ -2171,19 +2132,19 @@ function ss(e, t = {}, n = {}) {
|
|
|
2171
2132
|
};
|
|
2172
2133
|
}), r;
|
|
2173
2134
|
}
|
|
2174
|
-
function
|
|
2175
|
-
const o = r ?? e.today(),
|
|
2176
|
-
for (let
|
|
2177
|
-
const c = e.addDays(
|
|
2178
|
-
|
|
2135
|
+
function is(e, t, n, r) {
|
|
2136
|
+
const o = r ?? e.today(), i = n ? e.startOfBroadcastWeek(o, e) : t ? e.startOfISOWeek(o) : e.startOfWeek(o), a = [];
|
|
2137
|
+
for (let s = 0; s < 7; s++) {
|
|
2138
|
+
const c = e.addDays(i, s);
|
|
2139
|
+
a.push(c);
|
|
2179
2140
|
}
|
|
2180
|
-
return
|
|
2141
|
+
return a;
|
|
2181
2142
|
}
|
|
2182
|
-
function
|
|
2143
|
+
function cs(e, t, n, r, o = !1) {
|
|
2183
2144
|
if (!e || !t)
|
|
2184
2145
|
return;
|
|
2185
|
-
const { startOfYear:
|
|
2186
|
-
return o &&
|
|
2146
|
+
const { startOfYear: i, endOfYear: a, eachYearOfInterval: s, getYear: c } = r, u = i(e), d = a(t), l = s({ start: u, end: d });
|
|
2147
|
+
return o && l.reverse(), l.map((f) => {
|
|
2187
2148
|
const g = n.formatYearDropdown(f, r);
|
|
2188
2149
|
return {
|
|
2189
2150
|
value: c(f),
|
|
@@ -2192,185 +2153,280 @@ function is(e, t, n, r, o = !1) {
|
|
|
2192
2153
|
};
|
|
2193
2154
|
});
|
|
2194
2155
|
}
|
|
2156
|
+
function us(e, t = {}) {
|
|
2157
|
+
const { weekStartsOn: n, locale: r } = t, o = n ?? r?.options?.weekStartsOn ?? 0, i = (s) => {
|
|
2158
|
+
const c = typeof s == "number" || typeof s == "string" ? new Date(s) : s;
|
|
2159
|
+
return new z(c.getFullYear(), c.getMonth(), c.getDate(), 12, 0, 0, e);
|
|
2160
|
+
}, a = (s) => {
|
|
2161
|
+
const c = i(s);
|
|
2162
|
+
return new Date(c.getFullYear(), c.getMonth(), c.getDate(), 0, 0, 0, 0);
|
|
2163
|
+
};
|
|
2164
|
+
return {
|
|
2165
|
+
today: () => i(z.tz(e)),
|
|
2166
|
+
newDate: (s, c, u) => new z(s, c, u, 12, 0, 0, e),
|
|
2167
|
+
startOfDay: (s) => i(s),
|
|
2168
|
+
startOfWeek: (s, c) => {
|
|
2169
|
+
const u = i(s), d = c?.weekStartsOn ?? o, l = (u.getDay() - d + 7) % 7;
|
|
2170
|
+
return u.setDate(u.getDate() - l), u;
|
|
2171
|
+
},
|
|
2172
|
+
startOfISOWeek: (s) => {
|
|
2173
|
+
const c = i(s), u = (c.getDay() - 1 + 7) % 7;
|
|
2174
|
+
return c.setDate(c.getDate() - u), c;
|
|
2175
|
+
},
|
|
2176
|
+
startOfMonth: (s) => {
|
|
2177
|
+
const c = i(s);
|
|
2178
|
+
return c.setDate(1), c;
|
|
2179
|
+
},
|
|
2180
|
+
startOfYear: (s) => {
|
|
2181
|
+
const c = i(s);
|
|
2182
|
+
return c.setMonth(0, 1), c;
|
|
2183
|
+
},
|
|
2184
|
+
endOfWeek: (s, c) => {
|
|
2185
|
+
const u = i(s), f = (((c?.weekStartsOn ?? o) + 6) % 7 - u.getDay() + 7) % 7;
|
|
2186
|
+
return u.setDate(u.getDate() + f), u;
|
|
2187
|
+
},
|
|
2188
|
+
endOfISOWeek: (s) => {
|
|
2189
|
+
const c = i(s), u = (7 - c.getDay()) % 7;
|
|
2190
|
+
return c.setDate(c.getDate() + u), c;
|
|
2191
|
+
},
|
|
2192
|
+
endOfMonth: (s) => {
|
|
2193
|
+
const c = i(s);
|
|
2194
|
+
return c.setMonth(c.getMonth() + 1, 0), c;
|
|
2195
|
+
},
|
|
2196
|
+
endOfYear: (s) => {
|
|
2197
|
+
const c = i(s);
|
|
2198
|
+
return c.setMonth(11, 31), c;
|
|
2199
|
+
},
|
|
2200
|
+
eachMonthOfInterval: (s) => {
|
|
2201
|
+
const c = i(s.start), u = i(s.end), d = [], l = new z(c.getFullYear(), c.getMonth(), 1, 12, 0, 0, e), f = u.getFullYear() * 12 + u.getMonth();
|
|
2202
|
+
for (; l.getFullYear() * 12 + l.getMonth() <= f; )
|
|
2203
|
+
d.push(new z(l, e)), l.setMonth(l.getMonth() + 1, 1);
|
|
2204
|
+
return d;
|
|
2205
|
+
},
|
|
2206
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
2207
|
+
// mutate the same TZDate, and return it.
|
|
2208
|
+
addDays: (s, c) => {
|
|
2209
|
+
const u = i(s);
|
|
2210
|
+
return u.setDate(u.getDate() + c), u;
|
|
2211
|
+
},
|
|
2212
|
+
addWeeks: (s, c) => {
|
|
2213
|
+
const u = i(s);
|
|
2214
|
+
return u.setDate(u.getDate() + c * 7), u;
|
|
2215
|
+
},
|
|
2216
|
+
addMonths: (s, c) => {
|
|
2217
|
+
const u = i(s);
|
|
2218
|
+
return u.setMonth(u.getMonth() + c), u;
|
|
2219
|
+
},
|
|
2220
|
+
addYears: (s, c) => {
|
|
2221
|
+
const u = i(s);
|
|
2222
|
+
return u.setFullYear(u.getFullYear() + c), u;
|
|
2223
|
+
},
|
|
2224
|
+
eachYearOfInterval: (s) => {
|
|
2225
|
+
const c = i(s.start), u = i(s.end), d = [], l = new z(c.getFullYear(), 0, 1, 12, 0, 0, e);
|
|
2226
|
+
for (; l.getFullYear() <= u.getFullYear(); )
|
|
2227
|
+
d.push(new z(l, e)), l.setFullYear(l.getFullYear() + 1, 0, 1);
|
|
2228
|
+
return d;
|
|
2229
|
+
},
|
|
2230
|
+
getWeek: (s, c) => {
|
|
2231
|
+
const u = a(s);
|
|
2232
|
+
return Ze(u, {
|
|
2233
|
+
weekStartsOn: c?.weekStartsOn ?? o,
|
|
2234
|
+
firstWeekContainsDate: c?.firstWeekContainsDate ?? r?.options?.firstWeekContainsDate ?? 1
|
|
2235
|
+
});
|
|
2236
|
+
},
|
|
2237
|
+
getISOWeek: (s) => {
|
|
2238
|
+
const c = a(s);
|
|
2239
|
+
return Ve(c);
|
|
2240
|
+
},
|
|
2241
|
+
differenceInCalendarDays: (s, c) => {
|
|
2242
|
+
const u = a(s), d = a(c);
|
|
2243
|
+
return Ue(u, d);
|
|
2244
|
+
},
|
|
2245
|
+
differenceInCalendarMonths: (s, c) => {
|
|
2246
|
+
const u = a(s), d = a(c);
|
|
2247
|
+
return Et(u, d);
|
|
2248
|
+
}
|
|
2249
|
+
};
|
|
2250
|
+
}
|
|
2195
2251
|
const ve = (e) => e instanceof HTMLElement ? e : null, qe = (e) => [
|
|
2196
2252
|
...e.querySelectorAll("[data-animated-month]") ?? []
|
|
2197
|
-
],
|
|
2198
|
-
function
|
|
2199
|
-
const
|
|
2200
|
-
|
|
2201
|
-
const
|
|
2202
|
-
if (
|
|
2253
|
+
], ls = (e) => ve(e.querySelector("[data-animated-month]")), je = (e) => ve(e.querySelector("[data-animated-caption]")), Ge = (e) => ve(e.querySelector("[data-animated-weeks]")), ds = (e) => ve(e.querySelector("[data-animated-nav]")), fs = (e) => ve(e.querySelector("[data-animated-weekdays]"));
|
|
2254
|
+
function hs(e, t, { classNames: n, months: r, focused: o, dateLib: i }) {
|
|
2255
|
+
const a = Ne(null), s = Ne(r), c = Ne(!1);
|
|
2256
|
+
En(() => {
|
|
2257
|
+
const u = s.current;
|
|
2258
|
+
if (s.current = r, !t || !e.current || // safety check because the ref can be set to anything by consumers
|
|
2203
2259
|
!(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
2204
|
-
r.length === 0 ||
|
|
2260
|
+
r.length === 0 || u.length === 0 || r.length !== u.length)
|
|
2205
2261
|
return;
|
|
2206
|
-
const
|
|
2207
|
-
if (W instanceof HTMLElement ? (qe(W).forEach((
|
|
2208
|
-
if (!(
|
|
2262
|
+
const d = i.isSameMonth(r[0].date, u[0].date), l = i.isAfter(r[0].date, u[0].date), f = l ? n[j.caption_after_enter] : n[j.caption_before_enter], g = l ? n[j.weeks_after_enter] : n[j.weeks_before_enter], v = a.current, W = e.current.cloneNode(!0);
|
|
2263
|
+
if (W instanceof HTMLElement ? (qe(W).forEach((M) => {
|
|
2264
|
+
if (!(M instanceof HTMLElement))
|
|
2209
2265
|
return;
|
|
2210
|
-
const O =
|
|
2211
|
-
O &&
|
|
2212
|
-
const
|
|
2213
|
-
|
|
2214
|
-
const m =
|
|
2266
|
+
const O = ls(M);
|
|
2267
|
+
O && M.contains(O) && M.removeChild(O);
|
|
2268
|
+
const p = je(M);
|
|
2269
|
+
p && p.classList.remove(f);
|
|
2270
|
+
const m = Ge(M);
|
|
2215
2271
|
m && m.classList.remove(g);
|
|
2216
|
-
}),
|
|
2272
|
+
}), a.current = W) : a.current = null, c.current || d || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
|
|
2217
2273
|
o)
|
|
2218
2274
|
return;
|
|
2219
|
-
const
|
|
2220
|
-
if (
|
|
2275
|
+
const w = v instanceof HTMLElement ? qe(v) : [], D = qe(e.current);
|
|
2276
|
+
if (D?.every((x) => x instanceof HTMLElement) && w && w.every((x) => x instanceof HTMLElement)) {
|
|
2221
2277
|
c.current = !0, e.current.style.isolation = "isolate";
|
|
2222
|
-
const x =
|
|
2223
|
-
x && (x.style.zIndex = "1"),
|
|
2224
|
-
const
|
|
2225
|
-
if (!
|
|
2278
|
+
const x = ds(e.current);
|
|
2279
|
+
x && (x.style.zIndex = "1"), D.forEach((M, O) => {
|
|
2280
|
+
const p = w[O];
|
|
2281
|
+
if (!p)
|
|
2226
2282
|
return;
|
|
2227
|
-
|
|
2228
|
-
const m =
|
|
2283
|
+
M.style.position = "relative", M.style.overflow = "hidden";
|
|
2284
|
+
const m = je(M);
|
|
2229
2285
|
m && m.classList.add(f);
|
|
2230
|
-
const
|
|
2231
|
-
|
|
2286
|
+
const S = Ge(M);
|
|
2287
|
+
S && S.classList.add(g);
|
|
2232
2288
|
const E = () => {
|
|
2233
|
-
c.current = !1, e.current && (e.current.style.isolation = ""), x && (x.style.zIndex = ""), m && m.classList.remove(f),
|
|
2289
|
+
c.current = !1, e.current && (e.current.style.isolation = ""), x && (x.style.zIndex = ""), m && m.classList.remove(f), S && S.classList.remove(g), M.style.position = "", M.style.overflow = "", M.contains(p) && M.removeChild(p);
|
|
2234
2290
|
};
|
|
2235
|
-
|
|
2236
|
-
const H =
|
|
2291
|
+
p.style.pointerEvents = "none", p.style.position = "absolute", p.style.overflow = "hidden", p.setAttribute("aria-hidden", "true");
|
|
2292
|
+
const H = fs(p);
|
|
2237
2293
|
H && (H.style.opacity = "0");
|
|
2238
|
-
const B =
|
|
2239
|
-
B && (B.classList.add(
|
|
2240
|
-
const
|
|
2241
|
-
|
|
2294
|
+
const B = je(p);
|
|
2295
|
+
B && (B.classList.add(l ? n[j.caption_before_exit] : n[j.caption_after_exit]), B.addEventListener("animationend", E));
|
|
2296
|
+
const K = Ge(p);
|
|
2297
|
+
K && K.classList.add(l ? n[j.weeks_before_exit] : n[j.weeks_after_exit]), M.insertBefore(p, M.firstChild);
|
|
2242
2298
|
});
|
|
2243
2299
|
}
|
|
2244
2300
|
});
|
|
2245
2301
|
}
|
|
2246
|
-
function
|
|
2247
|
-
const o = e[0],
|
|
2248
|
-
for (let
|
|
2249
|
-
const
|
|
2250
|
-
B.push(
|
|
2302
|
+
function ms(e, t, n, r) {
|
|
2303
|
+
const o = e[0], i = e[e.length - 1], { ISOWeek: a, fixedWeeks: s, broadcastCalendar: c } = n ?? {}, { addDays: u, differenceInCalendarDays: d, differenceInCalendarMonths: l, endOfBroadcastWeek: f, endOfISOWeek: g, endOfMonth: v, endOfWeek: W, isAfter: w, startOfBroadcastWeek: D, startOfISOWeek: x, startOfWeek: M } = r, O = c ? D(o, r) : a ? x(o) : M(o), p = c ? f(i) : a ? g(v(i)) : W(v(i)), m = t && (c ? f(t) : a ? g(t) : W(t)), S = m && w(p, m) ? m : p, E = d(S, O), H = l(i, o) + 1, B = [];
|
|
2304
|
+
for (let te = 0; te <= E; te++) {
|
|
2305
|
+
const $ = u(O, te);
|
|
2306
|
+
B.push($);
|
|
2251
2307
|
}
|
|
2252
2308
|
const se = (c ? 35 : 42) * H;
|
|
2253
|
-
if (
|
|
2254
|
-
const
|
|
2255
|
-
for (let
|
|
2256
|
-
const ue =
|
|
2309
|
+
if (s && B.length < se) {
|
|
2310
|
+
const te = se - B.length;
|
|
2311
|
+
for (let $ = 0; $ < te; $++) {
|
|
2312
|
+
const ue = u(B[B.length - 1], 1);
|
|
2257
2313
|
B.push(ue);
|
|
2258
2314
|
}
|
|
2259
2315
|
}
|
|
2260
2316
|
return B;
|
|
2261
2317
|
}
|
|
2262
|
-
function
|
|
2318
|
+
function ys(e) {
|
|
2263
2319
|
const t = [];
|
|
2264
2320
|
return e.reduce((n, r) => {
|
|
2265
|
-
const o = r.weeks.reduce((
|
|
2321
|
+
const o = r.weeks.reduce((i, a) => i.concat(a.days.slice()), t.slice());
|
|
2266
2322
|
return n.concat(o.slice());
|
|
2267
2323
|
}, t.slice());
|
|
2268
2324
|
}
|
|
2269
|
-
function
|
|
2270
|
-
const { numberOfMonths: o = 1 } = n,
|
|
2271
|
-
for (let
|
|
2272
|
-
const
|
|
2273
|
-
if (t &&
|
|
2325
|
+
function gs(e, t, n, r) {
|
|
2326
|
+
const { numberOfMonths: o = 1 } = n, i = [];
|
|
2327
|
+
for (let a = 0; a < o; a++) {
|
|
2328
|
+
const s = r.addMonths(e, a);
|
|
2329
|
+
if (t && s > t)
|
|
2274
2330
|
break;
|
|
2275
|
-
|
|
2331
|
+
i.push(s);
|
|
2276
2332
|
}
|
|
2277
|
-
return
|
|
2278
|
-
}
|
|
2279
|
-
function
|
|
2280
|
-
const { month: o, defaultMonth:
|
|
2281
|
-
let c = o ||
|
|
2282
|
-
const { differenceInCalendarMonths:
|
|
2283
|
-
if (n &&
|
|
2284
|
-
const f = -1 * (
|
|
2285
|
-
c =
|
|
2333
|
+
return i;
|
|
2334
|
+
}
|
|
2335
|
+
function kt(e, t, n, r) {
|
|
2336
|
+
const { month: o, defaultMonth: i, today: a = r.today(), numberOfMonths: s = 1 } = e;
|
|
2337
|
+
let c = o || i || a;
|
|
2338
|
+
const { differenceInCalendarMonths: u, addMonths: d, startOfMonth: l } = r;
|
|
2339
|
+
if (n && u(n, c) < s - 1) {
|
|
2340
|
+
const f = -1 * (s - 1);
|
|
2341
|
+
c = d(n, f);
|
|
2286
2342
|
}
|
|
2287
|
-
return t &&
|
|
2288
|
-
}
|
|
2289
|
-
function
|
|
2290
|
-
const { addDays: o, endOfBroadcastWeek:
|
|
2291
|
-
const
|
|
2292
|
-
if (n.fixedWeeks &&
|
|
2293
|
-
const
|
|
2294
|
-
const H = O -
|
|
2343
|
+
return t && u(c, t) < 0 && (c = t), l(c);
|
|
2344
|
+
}
|
|
2345
|
+
function bs(e, t, n, r) {
|
|
2346
|
+
const { addDays: o, endOfBroadcastWeek: i, endOfISOWeek: a, endOfMonth: s, endOfWeek: c, getISOWeek: u, getWeek: d, startOfBroadcastWeek: l, startOfISOWeek: f, startOfWeek: g } = r, v = e.reduce((W, w) => {
|
|
2347
|
+
const D = n.broadcastCalendar ? l(w, r) : n.ISOWeek ? f(w) : g(w), x = n.broadcastCalendar ? i(w) : n.ISOWeek ? a(s(w)) : c(s(w)), M = t.filter((S) => S >= D && S <= x), O = n.broadcastCalendar ? 35 : 42;
|
|
2348
|
+
if (n.fixedWeeks && M.length < O) {
|
|
2349
|
+
const S = t.filter((E) => {
|
|
2350
|
+
const H = O - M.length;
|
|
2295
2351
|
return E > x && E <= o(x, H);
|
|
2296
2352
|
});
|
|
2297
|
-
|
|
2353
|
+
M.push(...S);
|
|
2298
2354
|
}
|
|
2299
|
-
const
|
|
2300
|
-
const H = n.ISOWeek ?
|
|
2301
|
-
return B ? B.days.push(
|
|
2302
|
-
}, []), m = new
|
|
2355
|
+
const p = M.reduce((S, E) => {
|
|
2356
|
+
const H = n.ISOWeek ? u(E) : d(E), B = S.find((se) => se.weekNumber === H), K = new jt(E, w, r);
|
|
2357
|
+
return B ? B.days.push(K) : S.push(new ho(H, [K])), S;
|
|
2358
|
+
}, []), m = new fo(w, p);
|
|
2303
2359
|
return W.push(m), W;
|
|
2304
2360
|
}, []);
|
|
2305
|
-
return n.reverseMonths ?
|
|
2361
|
+
return n.reverseMonths ? v.reverse() : v;
|
|
2306
2362
|
}
|
|
2307
|
-
function
|
|
2363
|
+
function ps(e, t) {
|
|
2308
2364
|
let { startMonth: n, endMonth: r } = e;
|
|
2309
|
-
const { startOfYear: o, startOfDay:
|
|
2310
|
-
!n &&
|
|
2311
|
-
const
|
|
2312
|
-
return n ? n =
|
|
2313
|
-
n &&
|
|
2314
|
-
r &&
|
|
2365
|
+
const { startOfYear: o, startOfDay: i, startOfMonth: a, endOfMonth: s, addYears: c, endOfYear: u, newDate: d, today: l } = t, { fromYear: f, toYear: g, fromMonth: v, toMonth: W } = e;
|
|
2366
|
+
!n && v && (n = v), !n && f && (n = t.newDate(f, 0, 1)), !r && W && (r = W), !r && g && (r = d(g, 11, 31));
|
|
2367
|
+
const w = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
|
|
2368
|
+
return n ? n = a(n) : f ? n = d(f, 0, 1) : !n && w && (n = o(c(e.today ?? l(), -100))), r ? r = s(r) : g ? r = d(g, 11, 31) : !r && w && (r = u(e.today ?? l())), [
|
|
2369
|
+
n && i(n),
|
|
2370
|
+
r && i(r)
|
|
2315
2371
|
];
|
|
2316
2372
|
}
|
|
2317
|
-
function
|
|
2373
|
+
function ws(e, t, n, r) {
|
|
2318
2374
|
if (n.disableNavigation)
|
|
2319
2375
|
return;
|
|
2320
|
-
const { pagedNavigation: o, numberOfMonths:
|
|
2376
|
+
const { pagedNavigation: o, numberOfMonths: i = 1 } = n, { startOfMonth: a, addMonths: s, differenceInCalendarMonths: c } = r, u = o ? i : 1, d = a(e);
|
|
2321
2377
|
if (!t)
|
|
2322
|
-
return
|
|
2323
|
-
if (!(c(t, e) <
|
|
2324
|
-
return
|
|
2378
|
+
return s(d, u);
|
|
2379
|
+
if (!(c(t, e) < i))
|
|
2380
|
+
return s(d, u);
|
|
2325
2381
|
}
|
|
2326
|
-
function
|
|
2382
|
+
function Ms(e, t, n, r) {
|
|
2327
2383
|
if (n.disableNavigation)
|
|
2328
2384
|
return;
|
|
2329
|
-
const { pagedNavigation: o, numberOfMonths:
|
|
2385
|
+
const { pagedNavigation: o, numberOfMonths: i } = n, { startOfMonth: a, addMonths: s, differenceInCalendarMonths: c } = r, u = o ? i ?? 1 : 1, d = a(e);
|
|
2330
2386
|
if (!t)
|
|
2331
|
-
return
|
|
2332
|
-
if (!(c(
|
|
2333
|
-
return
|
|
2387
|
+
return s(d, -u);
|
|
2388
|
+
if (!(c(d, t) <= 0))
|
|
2389
|
+
return s(d, -u);
|
|
2334
2390
|
}
|
|
2335
|
-
function
|
|
2391
|
+
function ks(e) {
|
|
2336
2392
|
const t = [];
|
|
2337
2393
|
return e.reduce((n, r) => n.concat(r.weeks.slice()), t.slice());
|
|
2338
2394
|
}
|
|
2339
|
-
function
|
|
2340
|
-
const [n, r] =
|
|
2395
|
+
function Ye(e, t) {
|
|
2396
|
+
const [n, r] = Re(e);
|
|
2341
2397
|
return [t === void 0 ? n : t, r];
|
|
2342
2398
|
}
|
|
2343
|
-
function
|
|
2344
|
-
const [n, r] =
|
|
2345
|
-
|
|
2399
|
+
function Ds(e, t) {
|
|
2400
|
+
const [n, r] = ps(e, t), { startOfMonth: o, endOfMonth: i } = t, a = kt(e, n, r, t), [s, c] = Ye(
|
|
2401
|
+
a,
|
|
2346
2402
|
// initialMonth is always computed from props.month if provided
|
|
2347
|
-
e.month ?
|
|
2403
|
+
e.month ? a : void 0
|
|
2348
2404
|
);
|
|
2349
|
-
|
|
2350
|
-
const O =
|
|
2405
|
+
Fn(() => {
|
|
2406
|
+
const O = kt(e, n, r, t);
|
|
2351
2407
|
c(O);
|
|
2352
2408
|
}, [e.timeZone]);
|
|
2353
|
-
const { months:
|
|
2354
|
-
const O =
|
|
2409
|
+
const { months: u, weeks: d, days: l, previousMonth: f, nextMonth: g } = Ce(() => {
|
|
2410
|
+
const O = gs(s, r, { numberOfMonths: e.numberOfMonths }, t), p = ms(O, e.endMonth ? i(e.endMonth) : void 0, {
|
|
2355
2411
|
ISOWeek: e.ISOWeek,
|
|
2356
2412
|
fixedWeeks: e.fixedWeeks,
|
|
2357
2413
|
broadcastCalendar: e.broadcastCalendar
|
|
2358
|
-
}, t), m =
|
|
2414
|
+
}, t), m = bs(O, p, {
|
|
2359
2415
|
broadcastCalendar: e.broadcastCalendar,
|
|
2360
2416
|
fixedWeeks: e.fixedWeeks,
|
|
2361
2417
|
ISOWeek: e.ISOWeek,
|
|
2362
2418
|
reverseMonths: e.reverseMonths
|
|
2363
|
-
}, t),
|
|
2419
|
+
}, t), S = ks(m), E = ys(m), H = Ms(s, n, e, t), B = ws(s, r, e, t);
|
|
2364
2420
|
return {
|
|
2365
2421
|
months: m,
|
|
2366
|
-
weeks:
|
|
2422
|
+
weeks: S,
|
|
2367
2423
|
days: E,
|
|
2368
2424
|
previousMonth: H,
|
|
2369
2425
|
nextMonth: B
|
|
2370
2426
|
};
|
|
2371
2427
|
}, [
|
|
2372
2428
|
t,
|
|
2373
|
-
|
|
2429
|
+
s.getTime(),
|
|
2374
2430
|
r?.getTime(),
|
|
2375
2431
|
n?.getTime(),
|
|
2376
2432
|
e.disableNavigation,
|
|
@@ -2381,178 +2437,178 @@ function Ms(e, t) {
|
|
|
2381
2437
|
e.numberOfMonths,
|
|
2382
2438
|
e.pagedNavigation,
|
|
2383
2439
|
e.reverseMonths
|
|
2384
|
-
]), { disableNavigation:
|
|
2385
|
-
if (
|
|
2440
|
+
]), { disableNavigation: v, onMonthChange: W } = e, w = (O) => d.some((p) => p.days.some((m) => m.isEqualTo(O))), D = (O) => {
|
|
2441
|
+
if (v)
|
|
2386
2442
|
return;
|
|
2387
|
-
let
|
|
2388
|
-
n &&
|
|
2443
|
+
let p = o(O);
|
|
2444
|
+
n && p < o(n) && (p = o(n)), r && p > o(r) && (p = o(r)), c(p), W?.(p);
|
|
2389
2445
|
};
|
|
2390
2446
|
return {
|
|
2391
|
-
months:
|
|
2392
|
-
weeks:
|
|
2393
|
-
days:
|
|
2447
|
+
months: u,
|
|
2448
|
+
weeks: d,
|
|
2449
|
+
days: l,
|
|
2394
2450
|
navStart: n,
|
|
2395
2451
|
navEnd: r,
|
|
2396
2452
|
previousMonth: f,
|
|
2397
2453
|
nextMonth: g,
|
|
2398
|
-
goToMonth:
|
|
2454
|
+
goToMonth: D,
|
|
2399
2455
|
goToDay: (O) => {
|
|
2400
|
-
|
|
2456
|
+
w(O) || D(O.date);
|
|
2401
2457
|
}
|
|
2402
2458
|
};
|
|
2403
2459
|
}
|
|
2404
|
-
var
|
|
2460
|
+
var J;
|
|
2405
2461
|
(function(e) {
|
|
2406
2462
|
e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
|
|
2407
|
-
})(
|
|
2408
|
-
function
|
|
2463
|
+
})(J || (J = {}));
|
|
2464
|
+
function Dt(e) {
|
|
2409
2465
|
return !e[F.disabled] && !e[F.hidden] && !e[F.outside];
|
|
2410
2466
|
}
|
|
2411
|
-
function
|
|
2412
|
-
let o,
|
|
2413
|
-
for (const
|
|
2414
|
-
const
|
|
2415
|
-
|
|
2467
|
+
function vs(e, t, n, r) {
|
|
2468
|
+
let o, i = -1;
|
|
2469
|
+
for (const a of e) {
|
|
2470
|
+
const s = t(a);
|
|
2471
|
+
Dt(s) && (s[F.focused] && i < J.FocusedModifier ? (o = a, i = J.FocusedModifier) : r?.isEqualTo(a) && i < J.LastFocused ? (o = a, i = J.LastFocused) : n(a.date) && i < J.Selected ? (o = a, i = J.Selected) : s[F.today] && i < J.Today && (o = a, i = J.Today));
|
|
2416
2472
|
}
|
|
2417
|
-
return o || (o = e.find((
|
|
2473
|
+
return o || (o = e.find((a) => Dt(t(a)))), o;
|
|
2418
2474
|
}
|
|
2419
|
-
function
|
|
2420
|
-
const { ISOWeek:
|
|
2475
|
+
function Os(e, t, n, r, o, i, a) {
|
|
2476
|
+
const { ISOWeek: s, broadcastCalendar: c } = i, { addDays: u, addMonths: d, addWeeks: l, addYears: f, endOfBroadcastWeek: g, endOfISOWeek: v, endOfWeek: W, max: w, min: D, startOfBroadcastWeek: x, startOfISOWeek: M, startOfWeek: O } = a;
|
|
2421
2477
|
let m = {
|
|
2422
|
-
day:
|
|
2423
|
-
week:
|
|
2424
|
-
month:
|
|
2478
|
+
day: u,
|
|
2479
|
+
week: l,
|
|
2480
|
+
month: d,
|
|
2425
2481
|
year: f,
|
|
2426
|
-
startOfWeek: (
|
|
2427
|
-
endOfWeek: (
|
|
2482
|
+
startOfWeek: (S) => c ? x(S, a) : s ? M(S) : O(S),
|
|
2483
|
+
endOfWeek: (S) => c ? g(S) : s ? v(S) : W(S)
|
|
2428
2484
|
}[e](n, t === "after" ? 1 : -1);
|
|
2429
|
-
return t === "before" && r ? m =
|
|
2485
|
+
return t === "before" && r ? m = w([r, m]) : t === "after" && o && (m = D([o, m])), m;
|
|
2430
2486
|
}
|
|
2431
|
-
function
|
|
2432
|
-
if (
|
|
2487
|
+
function nn(e, t, n, r, o, i, a, s = 0) {
|
|
2488
|
+
if (s > 365)
|
|
2433
2489
|
return;
|
|
2434
|
-
const c =
|
|
2435
|
-
return !
|
|
2490
|
+
const c = Os(e, t, n.date, r, o, i, a), u = !!(i.disabled && oe(c, i.disabled, a)), d = !!(i.hidden && oe(c, i.hidden, a)), l = c, f = new jt(c, l, a);
|
|
2491
|
+
return !u && !d ? f : nn(e, t, f, r, o, i, a, s + 1);
|
|
2436
2492
|
}
|
|
2437
|
-
function
|
|
2438
|
-
const { autoFocus:
|
|
2493
|
+
function Ws(e, t, n, r, o) {
|
|
2494
|
+
const { autoFocus: i } = e, [a, s] = Re(), c = vs(t.days, n, r || (() => !1), a), [u, d] = Re(i ? c : void 0);
|
|
2439
2495
|
return {
|
|
2440
2496
|
isFocusTarget: (W) => !!c?.isEqualTo(W),
|
|
2441
|
-
setFocused:
|
|
2442
|
-
focused:
|
|
2497
|
+
setFocused: d,
|
|
2498
|
+
focused: u,
|
|
2443
2499
|
blur: () => {
|
|
2444
|
-
|
|
2500
|
+
s(u), d(void 0);
|
|
2445
2501
|
},
|
|
2446
|
-
moveFocus: (W,
|
|
2447
|
-
if (!
|
|
2502
|
+
moveFocus: (W, w) => {
|
|
2503
|
+
if (!u)
|
|
2448
2504
|
return;
|
|
2449
|
-
const
|
|
2450
|
-
|
|
2505
|
+
const D = nn(W, w, u, t.navStart, t.navEnd, e, o);
|
|
2506
|
+
D && (e.disableNavigation && !t.days.some((M) => M.isEqualTo(D)) || (t.goToDay(D), d(D)));
|
|
2451
2507
|
}
|
|
2452
2508
|
};
|
|
2453
2509
|
}
|
|
2454
|
-
function
|
|
2455
|
-
const { selected: n, required: r, onSelect: o } = e, [
|
|
2510
|
+
function Ss(e, t) {
|
|
2511
|
+
const { selected: n, required: r, onSelect: o } = e, [i, a] = Ye(n, o ? n : void 0), s = o ? n : i, { isSameDay: c } = t, u = (g) => s?.some((v) => c(v, g)) ?? !1, { min: d, max: l } = e;
|
|
2456
2512
|
return {
|
|
2457
|
-
selected:
|
|
2458
|
-
select: (g,
|
|
2459
|
-
let
|
|
2460
|
-
if (
|
|
2461
|
-
if (
|
|
2513
|
+
selected: s,
|
|
2514
|
+
select: (g, v, W) => {
|
|
2515
|
+
let w = [...s ?? []];
|
|
2516
|
+
if (u(g)) {
|
|
2517
|
+
if (s?.length === d || r && s?.length === 1)
|
|
2462
2518
|
return;
|
|
2463
|
-
|
|
2519
|
+
w = s?.filter((D) => !c(D, g));
|
|
2464
2520
|
} else
|
|
2465
|
-
|
|
2466
|
-
return o ||
|
|
2521
|
+
s?.length === l ? w = [g] : w = [...w, g];
|
|
2522
|
+
return o || a(w), o?.(w, g, v, W), w;
|
|
2467
2523
|
},
|
|
2468
|
-
isSelected:
|
|
2524
|
+
isSelected: u
|
|
2469
2525
|
};
|
|
2470
2526
|
}
|
|
2471
|
-
function
|
|
2472
|
-
const { from:
|
|
2473
|
-
let
|
|
2474
|
-
if (!
|
|
2475
|
-
|
|
2476
|
-
else if (
|
|
2477
|
-
c(
|
|
2478
|
-
else if (
|
|
2479
|
-
if (c(
|
|
2480
|
-
o ?
|
|
2527
|
+
function Ns(e, t, n = 0, r = 0, o = !1, i = ee) {
|
|
2528
|
+
const { from: a, to: s } = t || {}, { isSameDay: c, isAfter: u, isBefore: d } = i;
|
|
2529
|
+
let l;
|
|
2530
|
+
if (!a && !s)
|
|
2531
|
+
l = { from: e, to: n > 0 ? void 0 : e };
|
|
2532
|
+
else if (a && !s)
|
|
2533
|
+
c(a, e) ? n === 0 ? l = { from: a, to: e } : o ? l = { from: a, to: void 0 } : l = void 0 : d(e, a) ? l = { from: e, to: a } : l = { from: a, to: e };
|
|
2534
|
+
else if (a && s)
|
|
2535
|
+
if (c(a, e) && c(s, e))
|
|
2536
|
+
o ? l = { from: a, to: s } : l = void 0;
|
|
2537
|
+
else if (c(a, e))
|
|
2538
|
+
l = { from: a, to: n > 0 ? void 0 : e };
|
|
2481
2539
|
else if (c(s, e))
|
|
2482
|
-
|
|
2483
|
-
else if (
|
|
2484
|
-
|
|
2485
|
-
else if (
|
|
2486
|
-
|
|
2487
|
-
else if (
|
|
2488
|
-
|
|
2489
|
-
else if (d(e, i))
|
|
2490
|
-
u = { from: s, to: e };
|
|
2540
|
+
l = { from: e, to: n > 0 ? void 0 : e };
|
|
2541
|
+
else if (d(e, a))
|
|
2542
|
+
l = { from: e, to: s };
|
|
2543
|
+
else if (u(e, a))
|
|
2544
|
+
l = { from: a, to: e };
|
|
2545
|
+
else if (u(e, s))
|
|
2546
|
+
l = { from: a, to: e };
|
|
2491
2547
|
else
|
|
2492
2548
|
throw new Error("Invalid range");
|
|
2493
|
-
if (
|
|
2494
|
-
const f =
|
|
2495
|
-
r > 0 && f > r ?
|
|
2549
|
+
if (l?.from && l?.to) {
|
|
2550
|
+
const f = i.differenceInCalendarDays(l.to, l.from);
|
|
2551
|
+
r > 0 && f > r ? l = { from: e, to: void 0 } : n > 1 && f < n && (l = { from: e, to: void 0 });
|
|
2496
2552
|
}
|
|
2497
|
-
return
|
|
2553
|
+
return l;
|
|
2498
2554
|
}
|
|
2499
|
-
function
|
|
2555
|
+
function Cs(e, t, n = ee) {
|
|
2500
2556
|
const r = Array.isArray(t) ? t : [t];
|
|
2501
2557
|
let o = e.from;
|
|
2502
|
-
const
|
|
2503
|
-
for (let
|
|
2558
|
+
const i = n.differenceInCalendarDays(e.to, e.from), a = Math.min(i, 6);
|
|
2559
|
+
for (let s = 0; s <= a; s++) {
|
|
2504
2560
|
if (r.includes(o.getDay()))
|
|
2505
2561
|
return !0;
|
|
2506
2562
|
o = n.addDays(o, 1);
|
|
2507
2563
|
}
|
|
2508
2564
|
return !1;
|
|
2509
2565
|
}
|
|
2510
|
-
function
|
|
2566
|
+
function vt(e, t, n = ee) {
|
|
2511
2567
|
return re(e, t.from, !1, n) || re(e, t.to, !1, n) || re(t, e.from, !1, n) || re(t, e.to, !1, n);
|
|
2512
2568
|
}
|
|
2513
|
-
function
|
|
2569
|
+
function xs(e, t, n = ee) {
|
|
2514
2570
|
const r = Array.isArray(t) ? t : [t];
|
|
2515
|
-
if (r.filter((
|
|
2516
|
-
from: n.addDays(
|
|
2517
|
-
to: n.addDays(
|
|
2518
|
-
}, n) : oe(e.from,
|
|
2571
|
+
if (r.filter((s) => typeof s != "function").some((s) => typeof s == "boolean" ? s : n.isDate(s) ? re(e, s, !1, n) : Rt(s, n) ? s.some((c) => re(e, c, !1, n)) : xe(s) ? s.from && s.to ? vt(e, { from: s.from, to: s.to }, n) : !1 : $t(s) ? Cs(e, s.dayOfWeek, n) : Ke(s) ? n.isAfter(s.before, s.after) ? vt(e, {
|
|
2572
|
+
from: n.addDays(s.after, 1),
|
|
2573
|
+
to: n.addDays(s.before, -1)
|
|
2574
|
+
}, n) : oe(e.from, s, n) || oe(e.to, s, n) : Je(s) || Le(s) ? oe(e.from, s, n) || oe(e.to, s, n) : !1))
|
|
2519
2575
|
return !0;
|
|
2520
|
-
const
|
|
2521
|
-
if (
|
|
2522
|
-
let
|
|
2576
|
+
const a = r.filter((s) => typeof s == "function");
|
|
2577
|
+
if (a.length) {
|
|
2578
|
+
let s = e.from;
|
|
2523
2579
|
const c = n.differenceInCalendarDays(e.to, e.from);
|
|
2524
|
-
for (let
|
|
2525
|
-
if (
|
|
2580
|
+
for (let u = 0; u <= c; u++) {
|
|
2581
|
+
if (a.some((d) => d(s)))
|
|
2526
2582
|
return !0;
|
|
2527
|
-
|
|
2583
|
+
s = n.addDays(s, 1);
|
|
2528
2584
|
}
|
|
2529
2585
|
}
|
|
2530
2586
|
return !1;
|
|
2531
2587
|
}
|
|
2532
|
-
function
|
|
2533
|
-
const { disabled: n, excludeDisabled: r, selected: o, required:
|
|
2588
|
+
function Ys(e, t) {
|
|
2589
|
+
const { disabled: n, excludeDisabled: r, selected: o, required: i, onSelect: a } = e, [s, c] = Ye(o, a ? o : void 0), u = a ? o : s;
|
|
2534
2590
|
return {
|
|
2535
|
-
selected:
|
|
2536
|
-
select: (f, g,
|
|
2537
|
-
const { min: W, max:
|
|
2538
|
-
return r && n &&
|
|
2591
|
+
selected: u,
|
|
2592
|
+
select: (f, g, v) => {
|
|
2593
|
+
const { min: W, max: w } = e, D = f ? Ns(f, u, W, w, i, t) : void 0;
|
|
2594
|
+
return r && n && D?.from && D.to && xs({ from: D.from, to: D.to }, n, t) && (D.from = f, D.to = void 0), a || c(D), a?.(D, f, g, v), D;
|
|
2539
2595
|
},
|
|
2540
|
-
isSelected: (f) =>
|
|
2596
|
+
isSelected: (f) => u && re(u, f, !1, t)
|
|
2541
2597
|
};
|
|
2542
2598
|
}
|
|
2543
|
-
function
|
|
2544
|
-
const { selected: n, required: r, onSelect: o } = e, [
|
|
2599
|
+
function Ts(e, t) {
|
|
2600
|
+
const { selected: n, required: r, onSelect: o } = e, [i, a] = Ye(n, o ? n : void 0), s = o ? n : i, { isSameDay: c } = t;
|
|
2545
2601
|
return {
|
|
2546
|
-
selected:
|
|
2547
|
-
select: (
|
|
2548
|
-
let
|
|
2549
|
-
return !r &&
|
|
2602
|
+
selected: s,
|
|
2603
|
+
select: (l, f, g) => {
|
|
2604
|
+
let v = l;
|
|
2605
|
+
return !r && s && s && c(l, s) && (v = void 0), o || a(v), o?.(v, l, f, g), v;
|
|
2550
2606
|
},
|
|
2551
|
-
isSelected: (
|
|
2607
|
+
isSelected: (l) => s ? c(s, l) : !1
|
|
2552
2608
|
};
|
|
2553
2609
|
}
|
|
2554
|
-
function
|
|
2555
|
-
const n =
|
|
2610
|
+
function _s(e, t) {
|
|
2611
|
+
const n = Ts(e, t), r = Ss(e, t), o = Ys(e, t);
|
|
2556
2612
|
switch (e.mode) {
|
|
2557
2613
|
case "single":
|
|
2558
2614
|
return n;
|
|
@@ -2564,58 +2620,64 @@ function Ts(e, t) {
|
|
|
2564
2620
|
return;
|
|
2565
2621
|
}
|
|
2566
2622
|
}
|
|
2567
|
-
function
|
|
2568
|
-
return e instanceof
|
|
2623
|
+
function Q(e, t) {
|
|
2624
|
+
return e instanceof z && e.timeZone === t ? e : new z(e, t);
|
|
2625
|
+
}
|
|
2626
|
+
function de(e, t, n) {
|
|
2627
|
+
return Q(e, t);
|
|
2569
2628
|
}
|
|
2570
|
-
function
|
|
2571
|
-
return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ?
|
|
2629
|
+
function Ot(e, t, n) {
|
|
2630
|
+
return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? de(e, t) : Array.isArray(e) ? e.map((r) => r instanceof Date ? de(r, t) : r) : xe(e) ? {
|
|
2572
2631
|
...e,
|
|
2573
|
-
from: e.from ?
|
|
2574
|
-
to: e.to ?
|
|
2575
|
-
} :
|
|
2576
|
-
before:
|
|
2577
|
-
after:
|
|
2578
|
-
} :
|
|
2579
|
-
after:
|
|
2580
|
-
} :
|
|
2581
|
-
before:
|
|
2632
|
+
from: e.from ? Q(e.from, t) : e.from,
|
|
2633
|
+
to: e.to ? Q(e.to, t) : e.to
|
|
2634
|
+
} : Ke(e) ? {
|
|
2635
|
+
before: de(e.before, t),
|
|
2636
|
+
after: de(e.after, t)
|
|
2637
|
+
} : Je(e) ? {
|
|
2638
|
+
after: de(e.after, t)
|
|
2639
|
+
} : Le(e) ? {
|
|
2640
|
+
before: de(e.before, t)
|
|
2582
2641
|
} : e;
|
|
2583
2642
|
}
|
|
2584
|
-
function
|
|
2585
|
-
return e && (Array.isArray(e) ? e.map((
|
|
2643
|
+
function $e(e, t, n) {
|
|
2644
|
+
return e && (Array.isArray(e) ? e.map((r) => Ot(r, t)) : Ot(e, t));
|
|
2586
2645
|
}
|
|
2587
|
-
function
|
|
2646
|
+
function Ps(e) {
|
|
2588
2647
|
let t = e;
|
|
2589
2648
|
const n = t.timeZone;
|
|
2590
2649
|
if (n && (t = {
|
|
2591
2650
|
...e,
|
|
2592
2651
|
timeZone: n
|
|
2593
|
-
}, t.today && (t.today =
|
|
2594
|
-
from: t.selected.from ?
|
|
2595
|
-
to: t.selected.to ?
|
|
2596
|
-
}), t.disabled !== void 0 && (t.disabled =
|
|
2597
|
-
const
|
|
2652
|
+
}, t.today && (t.today = Q(t.today, n)), t.month && (t.month = Q(t.month, n)), t.defaultMonth && (t.defaultMonth = Q(t.defaultMonth, n)), t.startMonth && (t.startMonth = Q(t.startMonth, n)), t.endMonth && (t.endMonth = Q(t.endMonth, n)), t.mode === "single" && t.selected ? t.selected = Q(t.selected, n) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((k) => Q(k, n)) : t.mode === "range" && t.selected && (t.selected = {
|
|
2653
|
+
from: t.selected.from ? Q(t.selected.from, n) : t.selected.from,
|
|
2654
|
+
to: t.selected.to ? Q(t.selected.to, n) : t.selected.to
|
|
2655
|
+
}), t.disabled !== void 0 && (t.disabled = $e(t.disabled, n)), t.hidden !== void 0 && (t.hidden = $e(t.hidden, n)), t.modifiers)) {
|
|
2656
|
+
const k = {};
|
|
2598
2657
|
Object.keys(t.modifiers).forEach((T) => {
|
|
2599
|
-
|
|
2600
|
-
}), t.modifiers =
|
|
2658
|
+
k[T] = $e(t.modifiers?.[T], n);
|
|
2659
|
+
}), t.modifiers = k;
|
|
2601
2660
|
}
|
|
2602
|
-
const { components: r, formatters: o, labels:
|
|
2603
|
-
const
|
|
2604
|
-
|
|
2605
|
-
|
|
2661
|
+
const { components: r, formatters: o, labels: i, dateLib: a, locale: s, classNames: c } = Ce(() => {
|
|
2662
|
+
const k = { ...qt, ...t.locale }, T = t.broadcastCalendar ? 1 : t.weekStartsOn, b = t.noonSafe && t.timeZone ? us(t.timeZone, {
|
|
2663
|
+
weekStartsOn: T,
|
|
2664
|
+
locale: k
|
|
2665
|
+
}) : void 0, Y = t.dateLib && b ? { ...b, ...t.dateLib } : t.dateLib ?? b, A = new G({
|
|
2666
|
+
locale: k,
|
|
2667
|
+
weekStartsOn: T,
|
|
2606
2668
|
firstWeekContainsDate: t.firstWeekContainsDate,
|
|
2607
2669
|
useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
|
|
2608
2670
|
useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
|
|
2609
2671
|
timeZone: t.timeZone,
|
|
2610
2672
|
numerals: t.numerals
|
|
2611
|
-
},
|
|
2673
|
+
}, Y);
|
|
2612
2674
|
return {
|
|
2613
|
-
dateLib:
|
|
2614
|
-
components:
|
|
2615
|
-
formatters:
|
|
2616
|
-
labels:
|
|
2617
|
-
locale:
|
|
2618
|
-
classNames: {
|
|
2675
|
+
dateLib: A,
|
|
2676
|
+
components: Go(t.components),
|
|
2677
|
+
formatters: Lo(t.formatters),
|
|
2678
|
+
labels: os(t.labels, A.options),
|
|
2679
|
+
locale: k,
|
|
2680
|
+
classNames: { ...Qt(), ...t.classNames }
|
|
2619
2681
|
};
|
|
2620
2682
|
}, [
|
|
2621
2683
|
t.locale,
|
|
@@ -2627,92 +2689,93 @@ function Ys(e) {
|
|
|
2627
2689
|
t.timeZone,
|
|
2628
2690
|
t.numerals,
|
|
2629
2691
|
t.dateLib,
|
|
2692
|
+
t.noonSafe,
|
|
2630
2693
|
t.components,
|
|
2631
2694
|
t.formatters,
|
|
2632
2695
|
t.labels,
|
|
2633
2696
|
t.classNames
|
|
2634
2697
|
]);
|
|
2635
|
-
t.today || (t = { ...t, today:
|
|
2636
|
-
const { captionLayout:
|
|
2637
|
-
|
|
2638
|
-
}, [
|
|
2639
|
-
|
|
2640
|
-
}, [
|
|
2641
|
-
|
|
2642
|
-
}, [
|
|
2643
|
-
|
|
2644
|
-
}, [W,
|
|
2645
|
-
|
|
2646
|
-
}, [
|
|
2698
|
+
t.today || (t = { ...t, today: a.today() });
|
|
2699
|
+
const { captionLayout: u, mode: d, navLayout: l, numberOfMonths: f = 1, onDayBlur: g, onDayClick: v, onDayFocus: W, onDayKeyDown: w, onDayMouseEnter: D, onDayMouseLeave: x, onNextClick: M, onPrevClick: O, showWeekNumber: p, styles: m } = t, { formatCaption: S, formatDay: E, formatMonthDropdown: H, formatWeekNumber: B, formatWeekNumberHeader: K, formatWeekdayName: se, formatYearDropdown: te } = o, $ = Ds(t, a), { days: ue, months: Oe, navStart: Te, navEnd: _e, previousMonth: X, nextMonth: U, goToMonth: ne } = $, Pe = qo(ue, t, Te, _e, a), { isSelected: Ee, select: Fe, selected: We } = _s(t, a) ?? {}, { blur: ot, focused: st, isFocusTarget: rn, moveFocus: at, setFocused: Se } = Ws(t, $, Pe, Ee ?? (() => !1), a), { labelDayButton: on, labelGridcell: sn, labelGrid: an, labelMonthDropdown: cn, labelNav: it, labelPrevious: un, labelNext: ln, labelWeekday: dn, labelWeekNumber: fn, labelWeekNumberHeader: hn, labelYearDropdown: mn } = i, yn = Ce(() => is(a, t.ISOWeek, t.broadcastCalendar, t.today), [a, t.ISOWeek, t.broadcastCalendar, t.today]), ct = d !== void 0 || v !== void 0, Be = R(() => {
|
|
2700
|
+
X && (ne(X), O?.(X));
|
|
2701
|
+
}, [X, ne, O]), Ie = R(() => {
|
|
2702
|
+
U && (ne(U), M?.(U));
|
|
2703
|
+
}, [ne, U, M]), gn = R((k, T) => (b) => {
|
|
2704
|
+
b.preventDefault(), b.stopPropagation(), Se(k), !T.disabled && (Fe?.(k.date, T, b), v?.(k.date, T, b));
|
|
2705
|
+
}, [Fe, v, Se]), bn = R((k, T) => (b) => {
|
|
2706
|
+
Se(k), W?.(k.date, T, b);
|
|
2707
|
+
}, [W, Se]), pn = R((k, T) => (b) => {
|
|
2708
|
+
ot(), g?.(k.date, T, b);
|
|
2709
|
+
}, [ot, g]), wn = R((k, T) => (b) => {
|
|
2647
2710
|
const Y = {
|
|
2648
2711
|
ArrowLeft: [
|
|
2649
|
-
|
|
2712
|
+
b.shiftKey ? "month" : "day",
|
|
2650
2713
|
t.dir === "rtl" ? "after" : "before"
|
|
2651
2714
|
],
|
|
2652
2715
|
ArrowRight: [
|
|
2653
|
-
|
|
2716
|
+
b.shiftKey ? "month" : "day",
|
|
2654
2717
|
t.dir === "rtl" ? "before" : "after"
|
|
2655
2718
|
],
|
|
2656
|
-
ArrowDown: [
|
|
2657
|
-
ArrowUp: [
|
|
2658
|
-
PageUp: [
|
|
2659
|
-
PageDown: [
|
|
2719
|
+
ArrowDown: [b.shiftKey ? "year" : "week", "after"],
|
|
2720
|
+
ArrowUp: [b.shiftKey ? "year" : "week", "before"],
|
|
2721
|
+
PageUp: [b.shiftKey ? "year" : "month", "before"],
|
|
2722
|
+
PageDown: [b.shiftKey ? "year" : "month", "after"],
|
|
2660
2723
|
Home: ["startOfWeek", "before"],
|
|
2661
2724
|
End: ["endOfWeek", "after"]
|
|
2662
2725
|
};
|
|
2663
|
-
if (Y[
|
|
2664
|
-
|
|
2665
|
-
const [
|
|
2666
|
-
|
|
2726
|
+
if (Y[b.key]) {
|
|
2727
|
+
b.preventDefault(), b.stopPropagation();
|
|
2728
|
+
const [A, N] = Y[b.key];
|
|
2729
|
+
at(A, N);
|
|
2667
2730
|
}
|
|
2668
|
-
|
|
2669
|
-
}, [
|
|
2670
|
-
|
|
2671
|
-
}, [
|
|
2672
|
-
x?.(
|
|
2673
|
-
}, [x]),
|
|
2674
|
-
const
|
|
2675
|
-
|
|
2676
|
-
}, [
|
|
2677
|
-
const
|
|
2678
|
-
|
|
2679
|
-
}, [
|
|
2731
|
+
w?.(k.date, T, b);
|
|
2732
|
+
}, [at, w, t.dir]), Mn = R((k, T) => (b) => {
|
|
2733
|
+
D?.(k.date, T, b);
|
|
2734
|
+
}, [D]), kn = R((k, T) => (b) => {
|
|
2735
|
+
x?.(k.date, T, b);
|
|
2736
|
+
}, [x]), Dn = R((k) => (T) => {
|
|
2737
|
+
const b = Number(T.target.value), Y = a.setMonth(a.startOfMonth(k), b);
|
|
2738
|
+
ne(Y);
|
|
2739
|
+
}, [a, ne]), vn = R((k) => (T) => {
|
|
2740
|
+
const b = Number(T.target.value), Y = a.setYear(a.startOfMonth(k), b);
|
|
2741
|
+
ne(Y);
|
|
2742
|
+
}, [a, ne]), { className: On, style: Wn } = Ce(() => ({
|
|
2680
2743
|
className: [c[y.Root], t.className].filter(Boolean).join(" "),
|
|
2681
2744
|
style: { ...m?.[y.Root], ...t.style }
|
|
2682
|
-
}), [c, t.className, t.style, m]),
|
|
2683
|
-
|
|
2745
|
+
}), [c, t.className, t.style, m]), Sn = $o(t), ut = Ne(null);
|
|
2746
|
+
hs(ut, !!t.animate, {
|
|
2684
2747
|
classNames: c,
|
|
2685
|
-
months:
|
|
2686
|
-
focused:
|
|
2687
|
-
dateLib:
|
|
2748
|
+
months: Oe,
|
|
2749
|
+
focused: st,
|
|
2750
|
+
dateLib: a
|
|
2688
2751
|
});
|
|
2689
|
-
const
|
|
2752
|
+
const Nn = {
|
|
2690
2753
|
dayPickerProps: t,
|
|
2691
|
-
selected:
|
|
2692
|
-
select:
|
|
2693
|
-
isSelected:
|
|
2694
|
-
months:
|
|
2695
|
-
nextMonth:
|
|
2696
|
-
previousMonth:
|
|
2697
|
-
goToMonth:
|
|
2698
|
-
getModifiers:
|
|
2754
|
+
selected: We,
|
|
2755
|
+
select: Fe,
|
|
2756
|
+
isSelected: Ee,
|
|
2757
|
+
months: Oe,
|
|
2758
|
+
nextMonth: U,
|
|
2759
|
+
previousMonth: X,
|
|
2760
|
+
goToMonth: ne,
|
|
2761
|
+
getModifiers: Pe,
|
|
2699
2762
|
components: r,
|
|
2700
2763
|
classNames: c,
|
|
2701
2764
|
styles: m,
|
|
2702
|
-
labels:
|
|
2765
|
+
labels: i,
|
|
2703
2766
|
formatters: o
|
|
2704
2767
|
};
|
|
2705
2768
|
return h.createElement(
|
|
2706
|
-
|
|
2707
|
-
{ value:
|
|
2769
|
+
Gt.Provider,
|
|
2770
|
+
{ value: Nn },
|
|
2708
2771
|
h.createElement(
|
|
2709
2772
|
r.Root,
|
|
2710
|
-
{ rootRef: t.animate ?
|
|
2773
|
+
{ rootRef: t.animate ? ut : void 0, className: On, style: Wn, dir: t.dir, id: t.id, lang: t.lang, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...Sn },
|
|
2711
2774
|
h.createElement(
|
|
2712
2775
|
r.Months,
|
|
2713
2776
|
{ className: c[y.Months], style: m?.[y.Months] },
|
|
2714
|
-
!t.hideNavigation && !
|
|
2715
|
-
|
|
2777
|
+
!t.hideNavigation && !l && h.createElement(r.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[y.Nav], style: m?.[y.Nav], "aria-label": it(), onPreviousClick: Be, onNextClick: Ie, previousMonth: X, nextMonth: U }),
|
|
2778
|
+
Oe.map((k, T) => h.createElement(
|
|
2716
2779
|
r.Month,
|
|
2717
2780
|
{
|
|
2718
2781
|
"data-animated-month": t.animate ? "true" : void 0,
|
|
@@ -2721,19 +2784,19 @@ function Ys(e) {
|
|
|
2721
2784
|
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
|
|
2722
2785
|
key: T,
|
|
2723
2786
|
displayIndex: T,
|
|
2724
|
-
calendarMonth:
|
|
2787
|
+
calendarMonth: k
|
|
2725
2788
|
},
|
|
2726
|
-
|
|
2789
|
+
l === "around" && !t.hideNavigation && T === 0 && h.createElement(
|
|
2727
2790
|
r.PreviousMonthButton,
|
|
2728
|
-
{ type: "button", className: c[y.PreviousMonthButton], tabIndex:
|
|
2729
|
-
h.createElement(r.Chevron, { disabled:
|
|
2791
|
+
{ type: "button", className: c[y.PreviousMonthButton], tabIndex: X ? void 0 : -1, "aria-disabled": X ? void 0 : !0, "aria-label": un(X), onClick: Be, "data-animated-button": t.animate ? "true" : void 0 },
|
|
2792
|
+
h.createElement(r.Chevron, { disabled: X ? void 0 : !0, className: c[y.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
|
|
2730
2793
|
),
|
|
2731
|
-
h.createElement(r.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: c[y.MonthCaption], style: m?.[y.MonthCaption], calendarMonth:
|
|
2794
|
+
h.createElement(r.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: c[y.MonthCaption], style: m?.[y.MonthCaption], calendarMonth: k, displayIndex: T }, u?.startsWith("dropdown") ? h.createElement(
|
|
2732
2795
|
r.DropdownNav,
|
|
2733
2796
|
{ className: c[y.Dropdowns], style: m?.[y.Dropdowns] },
|
|
2734
2797
|
(() => {
|
|
2735
|
-
const
|
|
2736
|
-
return
|
|
2798
|
+
const b = u === "dropdown" || u === "dropdown-months" ? h.createElement(r.MonthsDropdown, { key: "month", className: c[y.MonthsDropdown], "aria-label": cn(), classNames: c, components: r, disabled: !!t.disableNavigation, onChange: Dn(k.date), options: ss(k.date, Te, _e, o, a), style: m?.[y.Dropdown], value: a.getMonth(k.date) }) : h.createElement("span", { key: "month" }, H(k.date, a)), Y = u === "dropdown" || u === "dropdown-years" ? h.createElement(r.YearsDropdown, { key: "year", className: c[y.YearsDropdown], "aria-label": mn(a.options), classNames: c, components: r, disabled: !!t.disableNavigation, onChange: vn(k.date), options: cs(Te, _e, o, a, !!t.reverseYears), style: m?.[y.Dropdown], value: a.getYear(k.date) }) : h.createElement("span", { key: "year" }, te(k.date, a));
|
|
2799
|
+
return a.getMonthYearOrder() === "year-first" ? [Y, b] : [b, Y];
|
|
2737
2800
|
})(),
|
|
2738
2801
|
h.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
2739
2802
|
border: 0,
|
|
@@ -2746,37 +2809,37 @@ function Ys(e) {
|
|
|
2746
2809
|
width: "1px",
|
|
2747
2810
|
whiteSpace: "nowrap",
|
|
2748
2811
|
wordWrap: "normal"
|
|
2749
|
-
} },
|
|
2750
|
-
) : h.createElement(r.CaptionLabel, { className: c[y.CaptionLabel], role: "status", "aria-live": "polite" },
|
|
2751
|
-
|
|
2812
|
+
} }, S(k.date, a.options, a))
|
|
2813
|
+
) : h.createElement(r.CaptionLabel, { className: c[y.CaptionLabel], role: "status", "aria-live": "polite" }, S(k.date, a.options, a))),
|
|
2814
|
+
l === "around" && !t.hideNavigation && T === f - 1 && h.createElement(
|
|
2752
2815
|
r.NextMonthButton,
|
|
2753
|
-
{ type: "button", className: c[y.NextMonthButton], tabIndex:
|
|
2754
|
-
h.createElement(r.Chevron, { disabled:
|
|
2816
|
+
{ type: "button", className: c[y.NextMonthButton], tabIndex: U ? void 0 : -1, "aria-disabled": U ? void 0 : !0, "aria-label": ln(U), onClick: Ie, "data-animated-button": t.animate ? "true" : void 0 },
|
|
2817
|
+
h.createElement(r.Chevron, { disabled: U ? void 0 : !0, className: c[y.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
|
|
2755
2818
|
),
|
|
2756
|
-
T === f - 1 &&
|
|
2819
|
+
T === f - 1 && l === "after" && !t.hideNavigation && h.createElement(r.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[y.Nav], style: m?.[y.Nav], "aria-label": it(), onPreviousClick: Be, onNextClick: Ie, previousMonth: X, nextMonth: U }),
|
|
2757
2820
|
h.createElement(
|
|
2758
2821
|
r.MonthGrid,
|
|
2759
|
-
{ role: "grid", "aria-multiselectable":
|
|
2822
|
+
{ role: "grid", "aria-multiselectable": d === "multiple" || d === "range", "aria-label": an(k.date, a.options, a) || void 0, className: c[y.MonthGrid], style: m?.[y.MonthGrid] },
|
|
2760
2823
|
!t.hideWeekdays && h.createElement(
|
|
2761
2824
|
r.Weekdays,
|
|
2762
2825
|
{ "data-animated-weekdays": t.animate ? "true" : void 0, className: c[y.Weekdays], style: m?.[y.Weekdays] },
|
|
2763
|
-
|
|
2764
|
-
|
|
2826
|
+
p && h.createElement(r.WeekNumberHeader, { "aria-label": hn(a.options), className: c[y.WeekNumberHeader], style: m?.[y.WeekNumberHeader], scope: "col" }, K()),
|
|
2827
|
+
yn.map((b) => h.createElement(r.Weekday, { "aria-label": dn(b, a.options, a), className: c[y.Weekday], key: String(b), style: m?.[y.Weekday], scope: "col" }, se(b, a.options, a)))
|
|
2765
2828
|
),
|
|
2766
|
-
h.createElement(r.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: c[y.Weeks], style: m?.[y.Weeks] },
|
|
2829
|
+
h.createElement(r.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: c[y.Weeks], style: m?.[y.Weeks] }, k.weeks.map((b) => h.createElement(
|
|
2767
2830
|
r.Week,
|
|
2768
|
-
{ className: c[y.Week], key:
|
|
2769
|
-
|
|
2770
|
-
locale:
|
|
2771
|
-
}), className: c[y.WeekNumber], scope: "row", role: "rowheader" }, B(
|
|
2772
|
-
|
|
2773
|
-
const { date:
|
|
2774
|
-
if (
|
|
2775
|
-
const { from:
|
|
2776
|
-
|
|
2831
|
+
{ className: c[y.Week], key: b.weekNumber, style: m?.[y.Week], week: b },
|
|
2832
|
+
p && h.createElement(r.WeekNumber, { week: b, style: m?.[y.WeekNumber], "aria-label": fn(b.weekNumber, {
|
|
2833
|
+
locale: s
|
|
2834
|
+
}), className: c[y.WeekNumber], scope: "row", role: "rowheader" }, B(b.weekNumber, a)),
|
|
2835
|
+
b.days.map((Y) => {
|
|
2836
|
+
const { date: A } = Y, N = Pe(Y);
|
|
2837
|
+
if (N[F.focused] = !N.hidden && !!st?.isEqualTo(Y), N[Z.selected] = Ee?.(A) || N.selected, xe(We)) {
|
|
2838
|
+
const { from: He, to: ze } = We;
|
|
2839
|
+
N[Z.range_start] = !!(He && ze && a.isSameDay(A, He)), N[Z.range_end] = !!(He && ze && a.isSameDay(A, ze)), N[Z.range_middle] = re(We, A, !0, a);
|
|
2777
2840
|
}
|
|
2778
|
-
const
|
|
2779
|
-
return h.createElement(r.Day, { key: `${Y.isoDate}_${Y.displayMonthId}`, day: Y, modifiers:
|
|
2841
|
+
const Cn = as(N, m, t.modifiersStyles), xn = jo(N, c, t.modifiersClassNames), Yn = !ct && !N.hidden ? sn(A, N, a.options, a) : void 0;
|
|
2842
|
+
return h.createElement(r.Day, { key: `${Y.isoDate}_${Y.displayMonthId}`, day: Y, modifiers: N, className: xn.join(" "), style: Cn, role: "gridcell", "aria-selected": N.selected || void 0, "aria-label": Yn, "data-day": Y.isoDate, "data-month": Y.outside ? Y.dateMonthId : void 0, "data-selected": N.selected || void 0, "data-disabled": N.disabled || void 0, "data-hidden": N.hidden || void 0, "data-outside": Y.outside || void 0, "data-focused": N.focused || void 0, "data-today": N.today || void 0 }, !N.hidden && ct ? h.createElement(r.DayButton, { className: c[y.DayButton], style: m?.[y.DayButton], type: "button", day: Y, modifiers: N, disabled: !N.focused && N.disabled || void 0, "aria-disabled": N.focused && N.disabled || void 0, tabIndex: rn(Y) ? 0 : -1, "aria-label": on(A, N, a.options, a), onClick: gn(Y, N), onBlur: pn(Y, N), onFocus: bn(Y, N), onKeyDown: wn(Y, N), onMouseEnter: Mn(Y, N), onMouseLeave: kn(Y, N) }, E(A, a.options, a)) : !N.hidden && E(Y.date, a.options, a));
|
|
2780
2843
|
})
|
|
2781
2844
|
)))
|
|
2782
2845
|
)
|
|
@@ -2786,62 +2849,64 @@ function Ys(e) {
|
|
|
2786
2849
|
)
|
|
2787
2850
|
);
|
|
2788
2851
|
}
|
|
2789
|
-
function
|
|
2790
|
-
return t === "left" ? /* @__PURE__ */ q(
|
|
2852
|
+
function Es({ className: e, orientation: t, ...n }) {
|
|
2853
|
+
return t === "left" ? /* @__PURE__ */ q(Nt, { className: C("size-4", e), ...n }) : t === "right" ? /* @__PURE__ */ q(St, { className: C("size-4", e), ...n }) : /* @__PURE__ */ q(In, { className: C("size-4", e), ...n });
|
|
2791
2854
|
}
|
|
2792
|
-
function
|
|
2855
|
+
function qs({
|
|
2793
2856
|
className: e,
|
|
2794
2857
|
classNames: t,
|
|
2795
2858
|
showOutsideDays: n = !0,
|
|
2796
2859
|
captionLayout: r = "label",
|
|
2797
2860
|
buttonVariant: o = "ghost",
|
|
2798
|
-
formatters:
|
|
2799
|
-
components:
|
|
2800
|
-
...
|
|
2861
|
+
formatters: i,
|
|
2862
|
+
components: a,
|
|
2863
|
+
...s
|
|
2801
2864
|
}) {
|
|
2802
|
-
const c =
|
|
2803
|
-
function
|
|
2865
|
+
const c = Qt();
|
|
2866
|
+
function u({ className: d }) {
|
|
2804
2867
|
const {
|
|
2805
|
-
nextMonth:
|
|
2868
|
+
nextMonth: l,
|
|
2806
2869
|
previousMonth: f,
|
|
2807
2870
|
goToMonth: g,
|
|
2808
|
-
dayPickerProps: { onPrevClick:
|
|
2809
|
-
} =
|
|
2810
|
-
f && (g(f),
|
|
2811
|
-
},
|
|
2812
|
-
|
|
2871
|
+
dayPickerProps: { onPrevClick: v, onNextClick: W }
|
|
2872
|
+
} = ye(), w = !f, D = !l, x = () => {
|
|
2873
|
+
f && (g(f), v?.(f));
|
|
2874
|
+
}, M = () => {
|
|
2875
|
+
l && (g(l), W?.(l));
|
|
2813
2876
|
};
|
|
2814
|
-
return /* @__PURE__ */
|
|
2877
|
+
return /* @__PURE__ */ Tn("nav", { className: C("flex items-center gap-1", d), children: [
|
|
2815
2878
|
/* @__PURE__ */ q(
|
|
2816
|
-
|
|
2879
|
+
Qe,
|
|
2817
2880
|
{
|
|
2881
|
+
type: "button",
|
|
2818
2882
|
variant: o,
|
|
2819
2883
|
size: "icon",
|
|
2820
2884
|
className: "size-(--cell-size) bg-transparent p-0 opacity-80 hover:bg-transparent hover:opacity-100",
|
|
2821
|
-
tabIndex:
|
|
2822
|
-
disabled:
|
|
2823
|
-
"aria-label":
|
|
2885
|
+
tabIndex: w ? -1 : void 0,
|
|
2886
|
+
disabled: w,
|
|
2887
|
+
"aria-label": rt(),
|
|
2824
2888
|
onClick: x,
|
|
2825
|
-
children: /* @__PURE__ */ q(
|
|
2889
|
+
children: /* @__PURE__ */ q(Nt, { className: "size-4" })
|
|
2826
2890
|
}
|
|
2827
2891
|
),
|
|
2828
2892
|
/* @__PURE__ */ q(
|
|
2829
|
-
|
|
2893
|
+
Qe,
|
|
2830
2894
|
{
|
|
2895
|
+
type: "button",
|
|
2831
2896
|
variant: o,
|
|
2832
2897
|
size: "icon",
|
|
2833
2898
|
className: "size-(--cell-size) bg-transparent p-0 opacity-80 hover:bg-transparent hover:opacity-100",
|
|
2834
|
-
tabIndex:
|
|
2835
|
-
disabled:
|
|
2836
|
-
"aria-label":
|
|
2837
|
-
onClick:
|
|
2838
|
-
children: /* @__PURE__ */ q(
|
|
2899
|
+
tabIndex: D ? -1 : void 0,
|
|
2900
|
+
disabled: D,
|
|
2901
|
+
"aria-label": nt(),
|
|
2902
|
+
onClick: M,
|
|
2903
|
+
children: /* @__PURE__ */ q(St, { className: "size-4" })
|
|
2839
2904
|
}
|
|
2840
2905
|
)
|
|
2841
2906
|
] });
|
|
2842
2907
|
}
|
|
2843
2908
|
return /* @__PURE__ */ q(
|
|
2844
|
-
|
|
2909
|
+
Ps,
|
|
2845
2910
|
{
|
|
2846
2911
|
showOutsideDays: n,
|
|
2847
2912
|
className: C(
|
|
@@ -2853,8 +2918,8 @@ function As({
|
|
|
2853
2918
|
"data-testid": "calendar-root",
|
|
2854
2919
|
captionLayout: r,
|
|
2855
2920
|
formatters: {
|
|
2856
|
-
formatMonthDropdown: (
|
|
2857
|
-
...
|
|
2921
|
+
formatMonthDropdown: (d) => d.toLocaleString("default", { month: "short" }),
|
|
2922
|
+
...i
|
|
2858
2923
|
},
|
|
2859
2924
|
classNames: {
|
|
2860
2925
|
root: C("w-fit", c.root),
|
|
@@ -2864,8 +2929,8 @@ function As({
|
|
|
2864
2929
|
),
|
|
2865
2930
|
month: C("flex w-full flex-col gap-4", c.month),
|
|
2866
2931
|
nav: C("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", c.nav),
|
|
2867
|
-
button_previous: C(
|
|
2868
|
-
button_next: C(
|
|
2932
|
+
button_previous: C(dt({ variant: o }), "size-(--cell-size) select-none p-0 aria-disabled:opacity-50", c.button_previous),
|
|
2933
|
+
button_next: C(dt({ variant: o }), "size-(--cell-size) select-none p-0 aria-disabled:opacity-50", c.button_next),
|
|
2869
2934
|
month_caption: C(
|
|
2870
2935
|
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
2871
2936
|
c.month_caption
|
|
@@ -2936,36 +3001,37 @@ function As({
|
|
|
2936
3001
|
...t
|
|
2937
3002
|
},
|
|
2938
3003
|
components: {
|
|
2939
|
-
Root: ({ className:
|
|
3004
|
+
Root: ({ className: d, rootRef: l, ...f }) => /* @__PURE__ */ q(
|
|
2940
3005
|
"div",
|
|
2941
3006
|
{
|
|
2942
3007
|
"data-slot": "calendar",
|
|
2943
|
-
|
|
2944
|
-
|
|
3008
|
+
"data-calendar-submit-ignore": "true",
|
|
3009
|
+
ref: l,
|
|
3010
|
+
className: C(d),
|
|
2945
3011
|
...f
|
|
2946
3012
|
}
|
|
2947
3013
|
),
|
|
2948
|
-
Chevron: (
|
|
2949
|
-
Nav:
|
|
2950
|
-
DayButton:
|
|
2951
|
-
WeekNumber: ({ children:
|
|
2952
|
-
...
|
|
3014
|
+
Chevron: (d) => /* @__PURE__ */ q(Es, { ...d }),
|
|
3015
|
+
Nav: u,
|
|
3016
|
+
DayButton: Fs,
|
|
3017
|
+
WeekNumber: ({ children: d, ...l }) => /* @__PURE__ */ q("td", { ...l, children: /* @__PURE__ */ q("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children: d }) }),
|
|
3018
|
+
...a
|
|
2953
3019
|
},
|
|
2954
|
-
...
|
|
3020
|
+
...s
|
|
2955
3021
|
}
|
|
2956
3022
|
);
|
|
2957
3023
|
}
|
|
2958
|
-
function
|
|
3024
|
+
function Fs({
|
|
2959
3025
|
className: e,
|
|
2960
3026
|
day: t,
|
|
2961
3027
|
modifiers: n,
|
|
2962
3028
|
...r
|
|
2963
3029
|
}) {
|
|
2964
|
-
const o =
|
|
2965
|
-
return
|
|
3030
|
+
const o = lt.useRef(null);
|
|
3031
|
+
return lt.useEffect(() => {
|
|
2966
3032
|
n.focused && o.current?.focus();
|
|
2967
3033
|
}, [n.focused]), /* @__PURE__ */ q(
|
|
2968
|
-
|
|
3034
|
+
Qe,
|
|
2969
3035
|
{
|
|
2970
3036
|
ref: o,
|
|
2971
3037
|
variant: "ghost",
|
|
@@ -2976,15 +3042,14 @@ function Ps({
|
|
|
2976
3042
|
month: "long",
|
|
2977
3043
|
day: "numeric"
|
|
2978
3044
|
}),
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
)
|
|
2982
|
-
...r
|
|
3045
|
+
...r,
|
|
3046
|
+
type: "button",
|
|
3047
|
+
className: C(e)
|
|
2983
3048
|
}
|
|
2984
3049
|
);
|
|
2985
3050
|
}
|
|
2986
3051
|
export {
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
3052
|
+
qs as C,
|
|
3053
|
+
Fs as a,
|
|
3054
|
+
Nt as b
|
|
2990
3055
|
};
|