prometeo-design-system 3.1.4 → 3.1.6
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/{DatePicker-CehTiXGa.js → DatePicker-6eb-0Ns5.js} +1339 -1237
- package/dist/DatePicker.es.js +1 -1
- package/dist/Icons/Reassignment.d.ts +6 -0
- package/dist/Icons/Reassignment.es.js +22 -0
- package/dist/Icons/ReassignmentFill.d.ts +6 -0
- package/dist/Icons/ReassignmentFill.es.js +52 -0
- package/dist/Icons/Send.d.ts +6 -0
- package/dist/Icons/Send.es.js +24 -0
- package/dist/Icons/components/Reassignment.d.ts +4 -0
- package/dist/Icons/components/ReassignmentFill.d.ts +4 -0
- package/dist/Icons/components/Send.d.ts +4 -0
- package/dist/Icons/index.d.ts +3 -0
- package/dist/Icons/types.d.ts +6 -0
- package/dist/Icons.es.js +56 -50
- package/dist/NotificationCard.d.ts +6 -0
- package/dist/NotificationCard.es.js +50 -0
- package/dist/PyrionNavigationDrawer.d.ts +6 -0
- package/dist/PyrionNavigationDrawer.es.js +962 -0
- package/dist/RecurrentDatePicker.es.js +2 -2
- package/dist/RecurrentDatePickerRRule.es.js +1 -1
- package/dist/Select.es.js +1059 -2
- package/dist/SelectSearch.es.js +67 -66
- package/dist/TicketCard.d.ts +6 -0
- package/dist/TicketCard.es.js +130 -0
- package/dist/badge-B1IK_-i5.js +87 -0
- package/dist/components/NotificationCard/index.d.ts +3 -0
- package/dist/components/PyrionNavigationDrawer/index.d.ts +3 -0
- package/dist/components/TicketCard/index.d.ts +3 -0
- package/dist/exports/NotificationCard.d.ts +2 -0
- package/dist/exports/PyrionNavigationDrawer.d.ts +2 -0
- package/dist/exports/TicketCard.d.ts +2 -0
- package/dist/exports/usePyrionNavigation.d.ts +1 -0
- package/dist/prometeo-design-system.es.js +287 -365
- package/dist/usePyrionNavigation.d.ts +4 -0
- package/dist/usePyrionNavigation.es.js +4 -0
- package/dist/utils-X4-h3cum.js +54 -0
- package/package.json +17 -1
- package/dist/Select-BdxmkrjB.js +0 -1111
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { c as
|
|
7
|
-
import { Calendar as
|
|
8
|
-
import
|
|
9
|
-
function
|
|
1
|
+
import { j as U } from "./jsx-runtime-GkKLlHH4.js";
|
|
2
|
+
import h, { createContext as Tn, useContext as Yn, useCallback as q, useRef as Ee, useLayoutEffect as En, useState as Se, useEffect as _e, useMemo as ie, memo as Fn } from "react";
|
|
3
|
+
import _n from "./InputMultiple.es.js";
|
|
4
|
+
import In from "./Input.es.js";
|
|
5
|
+
import { createPortal as Bn } from "react-dom";
|
|
6
|
+
import { c as tt } from "./cn-B6yFEsav.js";
|
|
7
|
+
import { Calendar as Bt } from "./Icons/Calendar.es.js";
|
|
8
|
+
import jt from "./Button.es.js";
|
|
9
|
+
function jn(e, t, o = "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, o = "long") {
|
|
|
14
14
|
timeZoneName: o
|
|
15
15
|
}).format(t).split(/\s/g).slice(2).join(" ");
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const $n = {}, Je = {};
|
|
18
18
|
function Be(e, t) {
|
|
19
19
|
try {
|
|
20
|
-
const n = (
|
|
20
|
+
const n = ($n[e] ||= new Intl.DateTimeFormat("en-US", {
|
|
21
21
|
timeZone: e,
|
|
22
22
|
timeZoneName: "longOffset"
|
|
23
23
|
}).format)(t).split("GMT")[1];
|
|
24
|
-
return n in
|
|
24
|
+
return n in Je ? Je[n] : $t(n, n.split(":"));
|
|
25
25
|
} catch {
|
|
26
|
-
if (e in
|
|
27
|
-
const o = e?.match(
|
|
28
|
-
return o ?
|
|
26
|
+
if (e in Je) return Je[e];
|
|
27
|
+
const o = e?.match(An);
|
|
28
|
+
return o ? $t(e, o.slice(1)) : NaN;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
function
|
|
31
|
+
const An = /([+-]\d\d):?(\d\d)?/;
|
|
32
|
+
function $t(e, t) {
|
|
33
33
|
const o = +(t[0] || 0), n = +(t[1] || 0), r = +(t[2] || 0) / 60;
|
|
34
|
-
return
|
|
34
|
+
return Je[e] = o * 60 + n > 0 ? o * 60 + n + r : o * 60 - n - r;
|
|
35
35
|
}
|
|
36
|
-
class
|
|
36
|
+
class De 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(Be(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(Be(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)), Zt(this), Nt(this)) : this.setTime(Date.now());
|
|
40
40
|
}
|
|
41
41
|
static tz(t, ...o) {
|
|
42
|
-
return o.length ? new
|
|
42
|
+
return o.length ? new De(...o, t) : new De(Date.now(), t);
|
|
43
43
|
}
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region time zone
|
|
46
46
|
withTimeZone(t) {
|
|
47
|
-
return new
|
|
47
|
+
return new De(+this, t);
|
|
48
48
|
}
|
|
49
49
|
getTimezoneOffset() {
|
|
50
50
|
const t = -Be(this.timeZone, this);
|
|
@@ -53,55 +53,55 @@ class Me 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), Nt(this), +this;
|
|
57
57
|
}
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region date-fns integration
|
|
60
60
|
[/* @__PURE__ */ Symbol.for("constructDateFrom")](t) {
|
|
61
|
-
return new
|
|
61
|
+
return new De(+new Date(t), this.timeZone);
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const At = /^(get|set)(?!UTC)/;
|
|
66
66
|
Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
|
|
67
|
-
if (!
|
|
68
|
-
const t = e.replace(
|
|
69
|
-
|
|
67
|
+
if (!At.test(e)) return;
|
|
68
|
+
const t = e.replace(At, "$1UTC");
|
|
69
|
+
De.prototype[t] && (e.startsWith("get") ? De.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
|
+
} : (De.prototype[e] = function() {
|
|
72
|
+
return Date.prototype[t].apply(this.internal, arguments), Hn(this), +this;
|
|
73
|
+
}, De.prototype[t] = function() {
|
|
74
|
+
return Date.prototype[t].apply(this, arguments), Nt(this), +this;
|
|
75
75
|
}));
|
|
76
76
|
});
|
|
77
|
-
function
|
|
77
|
+
function Nt(e) {
|
|
78
78
|
e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-Be(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 Hn(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()), Zt(e);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function Zt(e) {
|
|
84
84
|
const t = Be(e.timeZone, e), o = t > 0 ? Math.floor(t) : Math.ceil(t), n = /* @__PURE__ */ new Date(+e);
|
|
85
85
|
n.setUTCHours(n.getUTCHours() - 1);
|
|
86
|
-
const r = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(),
|
|
87
|
-
|
|
86
|
+
const r = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), i = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), s = r - i, a = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
|
|
87
|
+
s && a && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + s);
|
|
88
88
|
const c = r - o;
|
|
89
89
|
c && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + c);
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
(
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
90
|
+
const l = /* @__PURE__ */ new Date(+e);
|
|
91
|
+
l.setUTCSeconds(0);
|
|
92
|
+
const d = r > 0 ? l.getSeconds() : (l.getSeconds() - 60) % 60, u = Math.round(-(Be(e.timeZone, e) * 60)) % 60;
|
|
93
|
+
(u || d) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + u), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + u + d));
|
|
94
|
+
const f = Be(e.timeZone, e), M = f > 0 ? Math.floor(f) : Math.ceil(f), C = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - M, W = M !== o, v = C - c;
|
|
95
|
+
if (W && v) {
|
|
96
96
|
Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + v);
|
|
97
97
|
const g = Be(e.timeZone, e), p = g > 0 ? Math.floor(g) : Math.ceil(g), S = M - p;
|
|
98
98
|
S && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + S), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + S));
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
class
|
|
101
|
+
class J extends De {
|
|
102
102
|
//#region static
|
|
103
103
|
static tz(t, ...o) {
|
|
104
|
-
return o.length ? new
|
|
104
|
+
return o.length ? new J(...o, t) : new J(Date.now(), t);
|
|
105
105
|
}
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region representation
|
|
@@ -118,7 +118,7 @@ class Se extends Me {
|
|
|
118
118
|
}
|
|
119
119
|
toTimeString() {
|
|
120
120
|
const t = this.internal.toUTCString().split(" ")[4], [o, n, r] = this.tzComponents();
|
|
121
|
-
return `${t} GMT${o}${n}${r} (${
|
|
121
|
+
return `${t} GMT${o}${n}${r} (${jn(this.timeZone, this)})`;
|
|
122
122
|
}
|
|
123
123
|
toLocaleString(t, o) {
|
|
124
124
|
return Date.prototype.toLocaleString.call(this, t, {
|
|
@@ -146,59 +146,59 @@ class Se extends Me {
|
|
|
146
146
|
}
|
|
147
147
|
//#endregion
|
|
148
148
|
withTimeZone(t) {
|
|
149
|
-
return new
|
|
149
|
+
return new J(+this, t);
|
|
150
150
|
}
|
|
151
151
|
//#region date-fns integration
|
|
152
152
|
[/* @__PURE__ */ Symbol.for("constructDateFrom")](t) {
|
|
153
|
-
return new
|
|
153
|
+
return new J(+new Date(t), this.timeZone);
|
|
154
154
|
}
|
|
155
155
|
//#endregion
|
|
156
156
|
}
|
|
157
|
-
const
|
|
158
|
-
function
|
|
159
|
-
return typeof e == "function" ? e(t) : e && typeof e == "object" &&
|
|
157
|
+
const Jt = 6048e5, qn = 864e5, Ht = /* @__PURE__ */ Symbol.for("constructDateFrom");
|
|
158
|
+
function Q(e, t) {
|
|
159
|
+
return typeof e == "function" ? e(t) : e && typeof e == "object" && Ht in e ? e[Ht](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
160
160
|
}
|
|
161
161
|
function B(e, t) {
|
|
162
|
-
return
|
|
162
|
+
return Q(t || e, e);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function en(e, t, o) {
|
|
165
165
|
const n = B(e, o?.in);
|
|
166
|
-
return isNaN(t) ?
|
|
166
|
+
return isNaN(t) ? Q(e, NaN) : (t && n.setDate(n.getDate() + t), n);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function tn(e, t, o) {
|
|
169
169
|
const n = B(e, o?.in);
|
|
170
|
-
if (isNaN(t)) return
|
|
170
|
+
if (isNaN(t)) return Q(e, NaN);
|
|
171
171
|
if (!t)
|
|
172
172
|
return n;
|
|
173
|
-
const r = n.getDate(),
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
return r >=
|
|
177
|
-
|
|
178
|
-
|
|
173
|
+
const r = n.getDate(), i = Q(e, n.getTime());
|
|
174
|
+
i.setMonth(n.getMonth() + t + 1, 0);
|
|
175
|
+
const s = i.getDate();
|
|
176
|
+
return r >= s ? i : (n.setFullYear(
|
|
177
|
+
i.getFullYear(),
|
|
178
|
+
i.getMonth(),
|
|
179
179
|
r
|
|
180
180
|
), n);
|
|
181
181
|
}
|
|
182
|
-
let
|
|
183
|
-
function
|
|
184
|
-
return
|
|
182
|
+
let Rn = {};
|
|
183
|
+
function rt() {
|
|
184
|
+
return Rn;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
const o =
|
|
188
|
-
return r.setDate(r.getDate() -
|
|
186
|
+
function Le(e, t) {
|
|
187
|
+
const o = rt(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? o.weekStartsOn ?? o.locale?.options?.weekStartsOn ?? 0, r = B(e, t?.in), i = r.getDay(), s = (i < n ? 7 : 0) + i - n;
|
|
188
|
+
return r.setDate(r.getDate() - s), r.setHours(0, 0, 0, 0), r;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
return
|
|
190
|
+
function nt(e, t) {
|
|
191
|
+
return Le(e, { ...t, weekStartsOn: 1 });
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
const o = B(e, t?.in), n = o.getFullYear(), r =
|
|
193
|
+
function nn(e, t) {
|
|
194
|
+
const o = B(e, t?.in), n = o.getFullYear(), r = Q(o, 0);
|
|
195
195
|
r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
return o.getTime() >=
|
|
196
|
+
const i = nt(r), s = Q(o, 0);
|
|
197
|
+
s.setFullYear(n, 0, 4), s.setHours(0, 0, 0, 0);
|
|
198
|
+
const a = nt(s);
|
|
199
|
+
return o.getTime() >= i.getTime() ? n + 1 : o.getTime() >= a.getTime() ? n : n - 1;
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function qt(e) {
|
|
202
202
|
const t = B(e), o = new Date(
|
|
203
203
|
Date.UTC(
|
|
204
204
|
t.getFullYear(),
|
|
@@ -213,122 +213,122 @@ function jt(e) {
|
|
|
213
213
|
return o.setUTCFullYear(t.getFullYear()), +e - +o;
|
|
214
214
|
}
|
|
215
215
|
function Qe(e, ...t) {
|
|
216
|
-
const o =
|
|
216
|
+
const o = Q.bind(
|
|
217
217
|
null,
|
|
218
218
|
t.find((n) => typeof n == "object")
|
|
219
219
|
);
|
|
220
220
|
return t.map(o);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function ot(e, t) {
|
|
223
223
|
const o = B(e, t?.in);
|
|
224
224
|
return o.setHours(0, 0, 0, 0), o;
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function xt(e, t, o) {
|
|
227
227
|
const [n, r] = Qe(
|
|
228
228
|
o?.in,
|
|
229
229
|
e,
|
|
230
230
|
t
|
|
231
|
-
),
|
|
232
|
-
return Math.round((
|
|
231
|
+
), i = ot(n), s = ot(r), a = +i - qt(i), c = +s - qt(s);
|
|
232
|
+
return Math.round((a - c) / qn);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
const o =
|
|
236
|
-
return n.setFullYear(o, 0, 4), n.setHours(0, 0, 0, 0),
|
|
237
|
-
}
|
|
238
|
-
function Rn(e, t, o) {
|
|
239
|
-
return Lt(e, t * 7, o);
|
|
234
|
+
function zn(e, t) {
|
|
235
|
+
const o = nn(e, t), n = Q(e, 0);
|
|
236
|
+
return n.setFullYear(o, 0, 4), n.setHours(0, 0, 0, 0), nt(n);
|
|
240
237
|
}
|
|
241
238
|
function Gn(e, t, o) {
|
|
242
|
-
return
|
|
239
|
+
return en(e, t * 7, o);
|
|
243
240
|
}
|
|
244
|
-
function
|
|
241
|
+
function Vn(e, t, o) {
|
|
242
|
+
return tn(e, t * 12, o);
|
|
243
|
+
}
|
|
244
|
+
function Xn(e, t) {
|
|
245
245
|
let o, n = t?.in;
|
|
246
246
|
return e.forEach((r) => {
|
|
247
|
-
!n && typeof r == "object" && (n =
|
|
248
|
-
const
|
|
249
|
-
(!o || o <
|
|
250
|
-
}),
|
|
247
|
+
!n && typeof r == "object" && (n = Q.bind(null, r));
|
|
248
|
+
const i = B(r, n);
|
|
249
|
+
(!o || o < i || isNaN(+i)) && (o = i);
|
|
250
|
+
}), Q(n, o || NaN);
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function Ln(e, t) {
|
|
253
253
|
let o, n = t?.in;
|
|
254
254
|
return e.forEach((r) => {
|
|
255
|
-
!n && typeof r == "object" && (n =
|
|
256
|
-
const
|
|
257
|
-
(!o || o >
|
|
258
|
-
}),
|
|
255
|
+
!n && typeof r == "object" && (n = Q.bind(null, r));
|
|
256
|
+
const i = B(r, n);
|
|
257
|
+
(!o || o > i || isNaN(+i)) && (o = i);
|
|
258
|
+
}), Q(n, o || NaN);
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function Qn(e, t, o) {
|
|
261
261
|
const [n, r] = Qe(
|
|
262
262
|
o?.in,
|
|
263
263
|
e,
|
|
264
264
|
t
|
|
265
265
|
);
|
|
266
|
-
return +
|
|
266
|
+
return +ot(n) == +ot(r);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function on(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 Un(e) {
|
|
272
|
+
return !(!on(e) && typeof e != "number" || isNaN(+B(e)));
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function rn(e, t, o) {
|
|
275
275
|
const [n, r] = Qe(
|
|
276
276
|
o?.in,
|
|
277
277
|
e,
|
|
278
278
|
t
|
|
279
|
-
),
|
|
280
|
-
return
|
|
279
|
+
), i = n.getFullYear() - r.getFullYear(), s = n.getMonth() - r.getMonth();
|
|
280
|
+
return i * 12 + s;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Kn(e, t) {
|
|
283
283
|
const o = B(e, t?.in), n = o.getMonth();
|
|
284
284
|
return o.setFullYear(o.getFullYear(), n + 1, 0), o.setHours(23, 59, 59, 999), o;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function an(e, t) {
|
|
287
287
|
const [o, n] = Qe(e, t.start, t.end);
|
|
288
288
|
return { start: o, end: n };
|
|
289
289
|
}
|
|
290
290
|
function Zn(e, t) {
|
|
291
|
-
const { start: o, end: n } =
|
|
291
|
+
const { start: o, end: n } = an(t?.in, e);
|
|
292
292
|
let r = +o > +n;
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
let
|
|
293
|
+
const i = r ? +o : +n, s = r ? n : o;
|
|
294
|
+
s.setHours(0, 0, 0, 0), s.setDate(1);
|
|
295
|
+
let a = 1;
|
|
296
296
|
const c = [];
|
|
297
|
-
for (; +
|
|
298
|
-
c.push(
|
|
297
|
+
for (; +s <= i; )
|
|
298
|
+
c.push(Q(o, s)), s.setMonth(s.getMonth() + a);
|
|
299
299
|
return r ? c.reverse() : c;
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function Jn(e, t) {
|
|
302
302
|
const o = B(e, t?.in);
|
|
303
303
|
return o.setDate(1), o.setHours(0, 0, 0, 0), o;
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function eo(e, t) {
|
|
306
306
|
const o = B(e, t?.in), n = o.getFullYear();
|
|
307
307
|
return o.setFullYear(n + 1, 0, 0), o.setHours(23, 59, 59, 999), o;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function sn(e, t) {
|
|
310
310
|
const o = B(e, t?.in);
|
|
311
311
|
return o.setFullYear(o.getFullYear(), 0, 1), o.setHours(0, 0, 0, 0), o;
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
const { start: o, end: n } =
|
|
313
|
+
function to(e, t) {
|
|
314
|
+
const { start: o, end: n } = an(t?.in, e);
|
|
315
315
|
let r = +o > +n;
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
let
|
|
316
|
+
const i = r ? +o : +n, s = r ? n : o;
|
|
317
|
+
s.setHours(0, 0, 0, 0), s.setMonth(0, 1);
|
|
318
|
+
let a = 1;
|
|
319
319
|
const c = [];
|
|
320
|
-
for (; +
|
|
321
|
-
c.push(
|
|
320
|
+
for (; +s <= i; )
|
|
321
|
+
c.push(Q(o, s)), s.setFullYear(s.getFullYear() + a);
|
|
322
322
|
return r ? c.reverse() : c;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
const o =
|
|
326
|
-
return r.setDate(r.getDate() +
|
|
324
|
+
function cn(e, t) {
|
|
325
|
+
const o = rt(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? o.weekStartsOn ?? o.locale?.options?.weekStartsOn ?? 0, r = B(e, t?.in), i = r.getDay(), s = (i < n ? -7 : 0) + 6 - (i - n);
|
|
326
|
+
return r.setDate(r.getDate() + s), r.setHours(23, 59, 59, 999), r;
|
|
327
327
|
}
|
|
328
|
-
function
|
|
329
|
-
return
|
|
328
|
+
function no(e, t) {
|
|
329
|
+
return cn(e, { ...t, weekStartsOn: 1 });
|
|
330
330
|
}
|
|
331
|
-
const
|
|
331
|
+
const oo = {
|
|
332
332
|
lessThanXSeconds: {
|
|
333
333
|
one: "less than a second",
|
|
334
334
|
other: "less than {{count}} seconds"
|
|
@@ -390,73 +390,73 @@ const no = {
|
|
|
390
390
|
one: "almost 1 year",
|
|
391
391
|
other: "almost {{count}} years"
|
|
392
392
|
}
|
|
393
|
-
},
|
|
393
|
+
}, ro = (e, t, o) => {
|
|
394
394
|
let n;
|
|
395
|
-
const r =
|
|
395
|
+
const r = oo[e];
|
|
396
396
|
return typeof r == "string" ? n = r : t === 1 ? n = r.one : n = r.other.replace("{{count}}", t.toString()), o?.addSuffix ? o.comparison && o.comparison > 0 ? "in " + n : n + " ago" : n;
|
|
397
397
|
};
|
|
398
|
-
function
|
|
398
|
+
function Xe(e) {
|
|
399
399
|
return (t = {}) => {
|
|
400
400
|
const o = t.width ? String(t.width) : e.defaultWidth;
|
|
401
401
|
return e.formats[o] || e.formats[e.defaultWidth];
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
|
-
const
|
|
404
|
+
const ao = {
|
|
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
|
+
}, so = {
|
|
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
|
+
}, io = {
|
|
415
415
|
full: "{{date}} 'at' {{time}}",
|
|
416
416
|
long: "{{date}} 'at' {{time}}",
|
|
417
417
|
medium: "{{date}}, {{time}}",
|
|
418
418
|
short: "{{date}}, {{time}}"
|
|
419
|
-
},
|
|
420
|
-
date:
|
|
421
|
-
formats: ro,
|
|
422
|
-
defaultWidth: "full"
|
|
423
|
-
}),
|
|
424
|
-
time: Ve({
|
|
419
|
+
}, co = {
|
|
420
|
+
date: Xe({
|
|
425
421
|
formats: ao,
|
|
426
422
|
defaultWidth: "full"
|
|
427
423
|
}),
|
|
428
|
-
|
|
424
|
+
time: Xe({
|
|
429
425
|
formats: so,
|
|
430
426
|
defaultWidth: "full"
|
|
427
|
+
}),
|
|
428
|
+
dateTime: Xe({
|
|
429
|
+
formats: io,
|
|
430
|
+
defaultWidth: "full"
|
|
431
431
|
})
|
|
432
|
-
},
|
|
432
|
+
}, lo = {
|
|
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
|
+
}, uo = (e, t, o, n) => lo[e];
|
|
440
|
+
function we(e) {
|
|
441
441
|
return (t, o) => {
|
|
442
442
|
const n = o?.context ? String(o.context) : "standalone";
|
|
443
443
|
let r;
|
|
444
444
|
if (n === "formatting" && e.formattingValues) {
|
|
445
|
-
const
|
|
446
|
-
r = e.formattingValues[
|
|
445
|
+
const s = e.defaultFormattingWidth || e.defaultWidth, a = o?.width ? String(o.width) : s;
|
|
446
|
+
r = e.formattingValues[a] || e.formattingValues[s];
|
|
447
447
|
} else {
|
|
448
|
-
const
|
|
449
|
-
r = e.values[
|
|
448
|
+
const s = e.defaultWidth, a = o?.width ? String(o.width) : e.defaultWidth;
|
|
449
|
+
r = e.values[a] || e.values[s];
|
|
450
450
|
}
|
|
451
|
-
const
|
|
452
|
-
return r[
|
|
451
|
+
const i = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
452
|
+
return r[i];
|
|
453
453
|
};
|
|
454
454
|
}
|
|
455
|
-
const
|
|
455
|
+
const fo = {
|
|
456
456
|
narrow: ["B", "A"],
|
|
457
457
|
abbreviated: ["BC", "AD"],
|
|
458
458
|
wide: ["Before Christ", "Anno Domini"]
|
|
459
|
-
},
|
|
459
|
+
}, ho = {
|
|
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"]
|
|
@@ -490,7 +490,7 @@ const uo = {
|
|
|
490
490
|
"November",
|
|
491
491
|
"December"
|
|
492
492
|
]
|
|
493
|
-
},
|
|
493
|
+
}, yo = {
|
|
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 uo = {
|
|
|
503
503
|
"Friday",
|
|
504
504
|
"Saturday"
|
|
505
505
|
]
|
|
506
|
-
},
|
|
506
|
+
}, go = {
|
|
507
507
|
narrow: {
|
|
508
508
|
am: "a",
|
|
509
509
|
pm: "p",
|
|
@@ -534,7 +534,7 @@ const uo = {
|
|
|
534
534
|
evening: "evening",
|
|
535
535
|
night: "night"
|
|
536
536
|
}
|
|
537
|
-
},
|
|
537
|
+
}, po = {
|
|
538
538
|
narrow: {
|
|
539
539
|
am: "a",
|
|
540
540
|
pm: "p",
|
|
@@ -565,7 +565,7 @@ const uo = {
|
|
|
565
565
|
evening: "in the evening",
|
|
566
566
|
night: "at night"
|
|
567
567
|
}
|
|
568
|
-
},
|
|
568
|
+
}, bo = (e, t) => {
|
|
569
569
|
const o = Number(e), n = o % 100;
|
|
570
570
|
if (n > 20 || n < 10)
|
|
571
571
|
switch (n % 10) {
|
|
@@ -577,89 +577,89 @@ const uo = {
|
|
|
577
577
|
return o + "rd";
|
|
578
578
|
}
|
|
579
579
|
return o + "th";
|
|
580
|
-
},
|
|
581
|
-
ordinalNumber:
|
|
582
|
-
era:
|
|
583
|
-
values:
|
|
580
|
+
}, wo = {
|
|
581
|
+
ordinalNumber: bo,
|
|
582
|
+
era: we({
|
|
583
|
+
values: fo,
|
|
584
584
|
defaultWidth: "wide"
|
|
585
585
|
}),
|
|
586
|
-
quarter:
|
|
587
|
-
values:
|
|
586
|
+
quarter: we({
|
|
587
|
+
values: ho,
|
|
588
588
|
defaultWidth: "wide",
|
|
589
589
|
argumentCallback: (e) => e - 1
|
|
590
590
|
}),
|
|
591
|
-
month:
|
|
591
|
+
month: we({
|
|
592
592
|
values: mo,
|
|
593
593
|
defaultWidth: "wide"
|
|
594
594
|
}),
|
|
595
|
-
day:
|
|
596
|
-
values:
|
|
595
|
+
day: we({
|
|
596
|
+
values: yo,
|
|
597
597
|
defaultWidth: "wide"
|
|
598
598
|
}),
|
|
599
|
-
dayPeriod:
|
|
600
|
-
values:
|
|
599
|
+
dayPeriod: we({
|
|
600
|
+
values: go,
|
|
601
601
|
defaultWidth: "wide",
|
|
602
|
-
formattingValues:
|
|
602
|
+
formattingValues: po,
|
|
603
603
|
defaultFormattingWidth: "wide"
|
|
604
604
|
})
|
|
605
605
|
};
|
|
606
|
-
function
|
|
606
|
+
function Me(e) {
|
|
607
607
|
return (t, o = {}) => {
|
|
608
|
-
const n = o.width, r = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth],
|
|
609
|
-
if (!
|
|
608
|
+
const n = o.width, r = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth], i = t.match(r);
|
|
609
|
+
if (!i)
|
|
610
610
|
return null;
|
|
611
|
-
const
|
|
611
|
+
const s = i[0], a = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(a) ? Do(a, (u) => u.test(s)) : (
|
|
612
612
|
// [TODO] -- I challenge you to fix the type
|
|
613
|
-
|
|
613
|
+
Mo(a, (u) => u.test(s))
|
|
614
614
|
);
|
|
615
|
-
let
|
|
616
|
-
|
|
615
|
+
let l;
|
|
616
|
+
l = e.valueCallback ? e.valueCallback(c) : c, l = o.valueCallback ? (
|
|
617
617
|
// [TODO] -- I challenge you to fix the type
|
|
618
|
-
o.valueCallback(
|
|
619
|
-
) :
|
|
620
|
-
const
|
|
621
|
-
return { value:
|
|
618
|
+
o.valueCallback(l)
|
|
619
|
+
) : l;
|
|
620
|
+
const d = t.slice(s.length);
|
|
621
|
+
return { value: l, rest: d };
|
|
622
622
|
};
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function Mo(e, t) {
|
|
625
625
|
for (const o in e)
|
|
626
626
|
if (Object.prototype.hasOwnProperty.call(e, o) && t(e[o]))
|
|
627
627
|
return o;
|
|
628
628
|
}
|
|
629
|
-
function
|
|
629
|
+
function Do(e, t) {
|
|
630
630
|
for (let o = 0; o < e.length; o++)
|
|
631
631
|
if (t(e[o]))
|
|
632
632
|
return o;
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function ln(e) {
|
|
635
635
|
return (t, o = {}) => {
|
|
636
636
|
const n = t.match(e.matchPattern);
|
|
637
637
|
if (!n) return null;
|
|
638
|
-
const r = n[0],
|
|
639
|
-
if (!
|
|
640
|
-
let
|
|
641
|
-
|
|
642
|
-
const
|
|
643
|
-
return { value:
|
|
638
|
+
const r = n[0], i = t.match(e.parsePattern);
|
|
639
|
+
if (!i) return null;
|
|
640
|
+
let s = e.valueCallback ? e.valueCallback(i[0]) : i[0];
|
|
641
|
+
s = o.valueCallback ? o.valueCallback(s) : s;
|
|
642
|
+
const a = t.slice(r.length);
|
|
643
|
+
return { value: s, rest: a };
|
|
644
644
|
};
|
|
645
645
|
}
|
|
646
|
-
const
|
|
646
|
+
const vo = /^(\d+)(th|st|nd|rd)?/i, ko = /\d+/i, Oo = {
|
|
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
|
-
}, Oo = {
|
|
651
|
-
any: [/^b/i, /^(a|c)/i]
|
|
652
650
|
}, Wo = {
|
|
651
|
+
any: [/^b/i, /^(a|c)/i]
|
|
652
|
+
}, So = {
|
|
653
653
|
narrow: /^[1234]/i,
|
|
654
654
|
abbreviated: /^q[1234]/i,
|
|
655
655
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
656
|
-
}, So = {
|
|
657
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
658
656
|
}, No = {
|
|
657
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
658
|
+
}, Co = {
|
|
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
|
+
}, xo = {
|
|
663
663
|
narrow: [
|
|
664
664
|
/^j/i,
|
|
665
665
|
/^f/i,
|
|
@@ -688,18 +688,18 @@ const Do = /^(\d+)(th|st|nd|rd)?/i, vo = /\d+/i, ko = {
|
|
|
688
688
|
/^n/i,
|
|
689
689
|
/^d/i
|
|
690
690
|
]
|
|
691
|
-
},
|
|
691
|
+
}, Po = {
|
|
692
692
|
narrow: /^[smtwf]/i,
|
|
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
|
+
}, To = {
|
|
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
|
+
}, Yo = {
|
|
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
|
+
}, Eo = {
|
|
703
703
|
any: {
|
|
704
704
|
am: /^a/i,
|
|
705
705
|
pm: /^p/i,
|
|
@@ -710,50 +710,50 @@ const Do = /^(\d+)(th|st|nd|rd)?/i, vo = /\d+/i, ko = {
|
|
|
710
710
|
evening: /evening/i,
|
|
711
711
|
night: /night/i
|
|
712
712
|
}
|
|
713
|
-
},
|
|
714
|
-
ordinalNumber:
|
|
715
|
-
matchPattern:
|
|
716
|
-
parsePattern:
|
|
713
|
+
}, Fo = {
|
|
714
|
+
ordinalNumber: ln({
|
|
715
|
+
matchPattern: vo,
|
|
716
|
+
parsePattern: ko,
|
|
717
717
|
valueCallback: (e) => parseInt(e, 10)
|
|
718
718
|
}),
|
|
719
|
-
era:
|
|
720
|
-
matchPatterns:
|
|
719
|
+
era: Me({
|
|
720
|
+
matchPatterns: Oo,
|
|
721
721
|
defaultMatchWidth: "wide",
|
|
722
|
-
parsePatterns:
|
|
722
|
+
parsePatterns: Wo,
|
|
723
723
|
defaultParseWidth: "any"
|
|
724
724
|
}),
|
|
725
|
-
quarter:
|
|
726
|
-
matchPatterns:
|
|
725
|
+
quarter: Me({
|
|
726
|
+
matchPatterns: So,
|
|
727
727
|
defaultMatchWidth: "wide",
|
|
728
|
-
parsePatterns:
|
|
728
|
+
parsePatterns: No,
|
|
729
729
|
defaultParseWidth: "any",
|
|
730
730
|
valueCallback: (e) => e + 1
|
|
731
731
|
}),
|
|
732
|
-
month:
|
|
733
|
-
matchPatterns:
|
|
732
|
+
month: Me({
|
|
733
|
+
matchPatterns: Co,
|
|
734
734
|
defaultMatchWidth: "wide",
|
|
735
|
-
parsePatterns:
|
|
735
|
+
parsePatterns: xo,
|
|
736
736
|
defaultParseWidth: "any"
|
|
737
737
|
}),
|
|
738
|
-
day:
|
|
739
|
-
matchPatterns:
|
|
738
|
+
day: Me({
|
|
739
|
+
matchPatterns: Po,
|
|
740
740
|
defaultMatchWidth: "wide",
|
|
741
|
-
parsePatterns:
|
|
741
|
+
parsePatterns: To,
|
|
742
742
|
defaultParseWidth: "any"
|
|
743
743
|
}),
|
|
744
|
-
dayPeriod:
|
|
745
|
-
matchPatterns:
|
|
744
|
+
dayPeriod: Me({
|
|
745
|
+
matchPatterns: Yo,
|
|
746
746
|
defaultMatchWidth: "any",
|
|
747
|
-
parsePatterns:
|
|
747
|
+
parsePatterns: Eo,
|
|
748
748
|
defaultParseWidth: "any"
|
|
749
749
|
})
|
|
750
|
-
},
|
|
750
|
+
}, Ve = {
|
|
751
751
|
code: "en-US",
|
|
752
|
-
formatDistance:
|
|
753
|
-
formatLong:
|
|
754
|
-
formatRelative:
|
|
755
|
-
localize:
|
|
756
|
-
match:
|
|
752
|
+
formatDistance: ro,
|
|
753
|
+
formatLong: co,
|
|
754
|
+
formatRelative: uo,
|
|
755
|
+
localize: wo,
|
|
756
|
+
match: Fo,
|
|
757
757
|
options: {
|
|
758
758
|
weekStartsOn: 0,
|
|
759
759
|
firstWeekContainsDate: 1
|
|
@@ -761,27 +761,27 @@ const Do = /^(\d+)(th|st|nd|rd)?/i, vo = /\d+/i, ko = {
|
|
|
761
761
|
};
|
|
762
762
|
function _o(e, t) {
|
|
763
763
|
const o = B(e, t?.in);
|
|
764
|
-
return
|
|
764
|
+
return xt(o, sn(o)) + 1;
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
const o = B(e, t?.in), n = +
|
|
768
|
-
return Math.round(n /
|
|
766
|
+
function Pt(e, t) {
|
|
767
|
+
const o = B(e, t?.in), n = +nt(o) - +zn(o);
|
|
768
|
+
return Math.round(n / Jt) + 1;
|
|
769
769
|
}
|
|
770
|
-
function
|
|
771
|
-
const o = B(e, t?.in), n = o.getFullYear(), r =
|
|
772
|
-
|
|
773
|
-
const
|
|
774
|
-
c.setFullYear(n, 0,
|
|
775
|
-
const
|
|
776
|
-
return +o >= +
|
|
770
|
+
function un(e, t) {
|
|
771
|
+
const o = B(e, t?.in), n = o.getFullYear(), r = rt(), i = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, s = Q(t?.in || e, 0);
|
|
772
|
+
s.setFullYear(n + 1, 0, i), s.setHours(0, 0, 0, 0);
|
|
773
|
+
const a = Le(s, t), c = Q(t?.in || e, 0);
|
|
774
|
+
c.setFullYear(n, 0, i), c.setHours(0, 0, 0, 0);
|
|
775
|
+
const l = Le(c, t);
|
|
776
|
+
return +o >= +a ? n + 1 : +o >= +l ? n : n - 1;
|
|
777
777
|
}
|
|
778
|
-
function
|
|
779
|
-
const o =
|
|
780
|
-
return
|
|
778
|
+
function Io(e, t) {
|
|
779
|
+
const o = rt(), n = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, r = un(e, t), i = Q(t?.in || e, 0);
|
|
780
|
+
return i.setFullYear(r, 0, n), i.setHours(0, 0, 0, 0), Le(i, t);
|
|
781
781
|
}
|
|
782
|
-
function
|
|
783
|
-
const o = B(e, t?.in), n = +
|
|
784
|
-
return Math.round(n /
|
|
782
|
+
function Tt(e, t) {
|
|
783
|
+
const o = B(e, t?.in), n = +Le(o, t) - +Io(o, t);
|
|
784
|
+
return Math.round(n / Jt) + 1;
|
|
785
785
|
}
|
|
786
786
|
function I(e, t) {
|
|
787
787
|
const o = e < 0 ? "-" : "", n = Math.abs(e).toString().padStart(t, "0");
|
|
@@ -840,14 +840,14 @@ const Ye = {
|
|
|
840
840
|
);
|
|
841
841
|
return I(r, t.length);
|
|
842
842
|
}
|
|
843
|
-
},
|
|
843
|
+
}, ze = {
|
|
844
844
|
midnight: "midnight",
|
|
845
845
|
noon: "noon",
|
|
846
846
|
morning: "morning",
|
|
847
847
|
afternoon: "afternoon",
|
|
848
848
|
evening: "evening",
|
|
849
849
|
night: "night"
|
|
850
|
-
},
|
|
850
|
+
}, Rt = {
|
|
851
851
|
// Era
|
|
852
852
|
G: function(e, t, o) {
|
|
853
853
|
const n = e.getFullYear() > 0 ? 1 : 0;
|
|
@@ -874,16 +874,16 @@ const Ye = {
|
|
|
874
874
|
},
|
|
875
875
|
// Local week-numbering year
|
|
876
876
|
Y: function(e, t, o, n) {
|
|
877
|
-
const r =
|
|
877
|
+
const r = un(e, n), i = r > 0 ? r : 1 - r;
|
|
878
878
|
if (t === "YY") {
|
|
879
|
-
const
|
|
880
|
-
return I(
|
|
879
|
+
const s = i % 100;
|
|
880
|
+
return I(s, 2);
|
|
881
881
|
}
|
|
882
|
-
return t === "Yo" ? o.ordinalNumber(
|
|
882
|
+
return t === "Yo" ? o.ordinalNumber(i, { unit: "year" }) : I(i, t.length);
|
|
883
883
|
},
|
|
884
884
|
// ISO week-numbering year
|
|
885
885
|
R: function(e, t) {
|
|
886
|
-
const o =
|
|
886
|
+
const o = nn(e);
|
|
887
887
|
return I(o, t.length);
|
|
888
888
|
},
|
|
889
889
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
@@ -1020,12 +1020,12 @@ const Ye = {
|
|
|
1020
1020
|
},
|
|
1021
1021
|
// Local week of year
|
|
1022
1022
|
w: function(e, t, o, n) {
|
|
1023
|
-
const r =
|
|
1023
|
+
const r = Tt(e, n);
|
|
1024
1024
|
return t === "wo" ? o.ordinalNumber(r, { unit: "week" }) : I(r, t.length);
|
|
1025
1025
|
},
|
|
1026
1026
|
// ISO week of year
|
|
1027
1027
|
I: function(e, t, o) {
|
|
1028
|
-
const n =
|
|
1028
|
+
const n = Pt(e);
|
|
1029
1029
|
return t === "Io" ? o.ordinalNumber(n, { unit: "week" }) : I(n, t.length);
|
|
1030
1030
|
},
|
|
1031
1031
|
// Day of the month
|
|
@@ -1070,17 +1070,17 @@ const Ye = {
|
|
|
1070
1070
|
},
|
|
1071
1071
|
// Local day of week
|
|
1072
1072
|
e: function(e, t, o, n) {
|
|
1073
|
-
const r = e.getDay(),
|
|
1073
|
+
const r = e.getDay(), i = (r - n.weekStartsOn + 8) % 7 || 7;
|
|
1074
1074
|
switch (t) {
|
|
1075
1075
|
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
1076
1076
|
case "e":
|
|
1077
|
-
return String(
|
|
1077
|
+
return String(i);
|
|
1078
1078
|
// Padded numerical value
|
|
1079
1079
|
case "ee":
|
|
1080
|
-
return I(
|
|
1080
|
+
return I(i, 2);
|
|
1081
1081
|
// 1st, 2nd, ..., 7th
|
|
1082
1082
|
case "eo":
|
|
1083
|
-
return o.ordinalNumber(
|
|
1083
|
+
return o.ordinalNumber(i, { unit: "day" });
|
|
1084
1084
|
case "eee":
|
|
1085
1085
|
return o.day(r, {
|
|
1086
1086
|
width: "abbreviated",
|
|
@@ -1107,17 +1107,17 @@ const Ye = {
|
|
|
1107
1107
|
},
|
|
1108
1108
|
// Stand-alone local day of week
|
|
1109
1109
|
c: function(e, t, o, n) {
|
|
1110
|
-
const r = e.getDay(),
|
|
1110
|
+
const r = e.getDay(), i = (r - n.weekStartsOn + 8) % 7 || 7;
|
|
1111
1111
|
switch (t) {
|
|
1112
1112
|
// Numerical value (same as in `e`)
|
|
1113
1113
|
case "c":
|
|
1114
|
-
return String(
|
|
1114
|
+
return String(i);
|
|
1115
1115
|
// Padded numerical value
|
|
1116
1116
|
case "cc":
|
|
1117
|
-
return I(
|
|
1117
|
+
return I(i, t.length);
|
|
1118
1118
|
// 1st, 2nd, ..., 7th
|
|
1119
1119
|
case "co":
|
|
1120
|
-
return o.ordinalNumber(
|
|
1120
|
+
return o.ordinalNumber(i, { unit: "day" });
|
|
1121
1121
|
case "ccc":
|
|
1122
1122
|
return o.day(r, {
|
|
1123
1123
|
width: "abbreviated",
|
|
@@ -1211,7 +1211,7 @@ const Ye = {
|
|
|
1211
1211
|
b: function(e, t, o) {
|
|
1212
1212
|
const n = e.getHours();
|
|
1213
1213
|
let r;
|
|
1214
|
-
switch (n === 12 ? r =
|
|
1214
|
+
switch (n === 12 ? r = ze.noon : n === 0 ? r = ze.midnight : r = n / 12 >= 1 ? "pm" : "am", t) {
|
|
1215
1215
|
case "b":
|
|
1216
1216
|
case "bb":
|
|
1217
1217
|
return o.dayPeriod(r, {
|
|
@@ -1239,7 +1239,7 @@ const Ye = {
|
|
|
1239
1239
|
B: function(e, t, o) {
|
|
1240
1240
|
const n = e.getHours();
|
|
1241
1241
|
let r;
|
|
1242
|
-
switch (n >= 17 ? r =
|
|
1242
|
+
switch (n >= 17 ? r = ze.evening : n >= 12 ? r = ze.afternoon : n >= 4 ? r = ze.morning : r = ze.night, t) {
|
|
1243
1243
|
case "B":
|
|
1244
1244
|
case "BB":
|
|
1245
1245
|
case "BBB":
|
|
@@ -1301,7 +1301,7 @@ const Ye = {
|
|
|
1301
1301
|
switch (t) {
|
|
1302
1302
|
// Hours and optional minutes
|
|
1303
1303
|
case "X":
|
|
1304
|
-
return
|
|
1304
|
+
return Gt(n);
|
|
1305
1305
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1306
1306
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1307
1307
|
// so this token always has the same output as `XX`
|
|
@@ -1319,7 +1319,7 @@ const Ye = {
|
|
|
1319
1319
|
switch (t) {
|
|
1320
1320
|
// Hours and optional minutes
|
|
1321
1321
|
case "x":
|
|
1322
|
-
return
|
|
1322
|
+
return Gt(n);
|
|
1323
1323
|
// Hours, minutes and optional seconds without `:` delimiter
|
|
1324
1324
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
1325
1325
|
// so this token always has the same output as `xx`
|
|
@@ -1339,7 +1339,7 @@ const Ye = {
|
|
|
1339
1339
|
case "O":
|
|
1340
1340
|
case "OO":
|
|
1341
1341
|
case "OOO":
|
|
1342
|
-
return "GMT" +
|
|
1342
|
+
return "GMT" + zt(n, ":");
|
|
1343
1343
|
default:
|
|
1344
1344
|
return "GMT" + Ie(n, ":");
|
|
1345
1345
|
}
|
|
@@ -1352,7 +1352,7 @@ const Ye = {
|
|
|
1352
1352
|
case "z":
|
|
1353
1353
|
case "zz":
|
|
1354
1354
|
case "zzz":
|
|
1355
|
-
return "GMT" +
|
|
1355
|
+
return "GMT" + zt(n, ":");
|
|
1356
1356
|
default:
|
|
1357
1357
|
return "GMT" + Ie(n, ":");
|
|
1358
1358
|
}
|
|
@@ -1367,18 +1367,18 @@ const Ye = {
|
|
|
1367
1367
|
return I(+e, t.length);
|
|
1368
1368
|
}
|
|
1369
1369
|
};
|
|
1370
|
-
function
|
|
1371
|
-
const o = e > 0 ? "-" : "+", n = Math.abs(e), r = Math.trunc(n / 60),
|
|
1372
|
-
return
|
|
1370
|
+
function zt(e, t = "") {
|
|
1371
|
+
const o = e > 0 ? "-" : "+", n = Math.abs(e), r = Math.trunc(n / 60), i = n % 60;
|
|
1372
|
+
return i === 0 ? o + String(r) : o + String(r) + t + I(i, 2);
|
|
1373
1373
|
}
|
|
1374
|
-
function
|
|
1374
|
+
function Gt(e, t) {
|
|
1375
1375
|
return e % 60 === 0 ? (e > 0 ? "-" : "+") + I(Math.abs(e) / 60, 2) : Ie(e, t);
|
|
1376
1376
|
}
|
|
1377
1377
|
function Ie(e, t = "") {
|
|
1378
|
-
const o = e > 0 ? "-" : "+", n = Math.abs(e), r = I(Math.trunc(n / 60), 2),
|
|
1379
|
-
return o + r + t +
|
|
1378
|
+
const o = e > 0 ? "-" : "+", n = Math.abs(e), r = I(Math.trunc(n / 60), 2), i = I(n % 60, 2);
|
|
1379
|
+
return o + r + t + i;
|
|
1380
1380
|
}
|
|
1381
|
-
const
|
|
1381
|
+
const Vt = (e, t) => {
|
|
1382
1382
|
switch (e) {
|
|
1383
1383
|
case "P":
|
|
1384
1384
|
return t.date({ width: "short" });
|
|
@@ -1389,7 +1389,7 @@ const qt = (e, t) => {
|
|
|
1389
1389
|
default:
|
|
1390
1390
|
return t.date({ width: "full" });
|
|
1391
1391
|
}
|
|
1392
|
-
},
|
|
1392
|
+
}, dn = (e, t) => {
|
|
1393
1393
|
switch (e) {
|
|
1394
1394
|
case "p":
|
|
1395
1395
|
return t.time({ width: "short" });
|
|
@@ -1400,105 +1400,105 @@ const qt = (e, t) => {
|
|
|
1400
1400
|
default:
|
|
1401
1401
|
return t.time({ width: "full" });
|
|
1402
1402
|
}
|
|
1403
|
-
},
|
|
1403
|
+
}, Bo = (e, t) => {
|
|
1404
1404
|
const o = e.match(/(P+)(p+)?/) || [], n = o[1], r = o[2];
|
|
1405
1405
|
if (!r)
|
|
1406
|
-
return
|
|
1407
|
-
let
|
|
1406
|
+
return Vt(e, t);
|
|
1407
|
+
let i;
|
|
1408
1408
|
switch (n) {
|
|
1409
1409
|
case "P":
|
|
1410
|
-
|
|
1410
|
+
i = t.dateTime({ width: "short" });
|
|
1411
1411
|
break;
|
|
1412
1412
|
case "PP":
|
|
1413
|
-
|
|
1413
|
+
i = t.dateTime({ width: "medium" });
|
|
1414
1414
|
break;
|
|
1415
1415
|
case "PPP":
|
|
1416
|
-
|
|
1416
|
+
i = t.dateTime({ width: "long" });
|
|
1417
1417
|
break;
|
|
1418
1418
|
default:
|
|
1419
|
-
|
|
1419
|
+
i = t.dateTime({ width: "full" });
|
|
1420
1420
|
break;
|
|
1421
1421
|
}
|
|
1422
|
-
return
|
|
1423
|
-
},
|
|
1424
|
-
p:
|
|
1425
|
-
P:
|
|
1426
|
-
},
|
|
1427
|
-
function Ho(e) {
|
|
1428
|
-
return jo.test(e);
|
|
1429
|
-
}
|
|
1422
|
+
return i.replace("{{date}}", Vt(n, t)).replace("{{time}}", dn(r, t));
|
|
1423
|
+
}, jo = {
|
|
1424
|
+
p: dn,
|
|
1425
|
+
P: Bo
|
|
1426
|
+
}, $o = /^D+$/, Ao = /^Y+$/, Ho = ["D", "DD", "YY", "YYYY"];
|
|
1430
1427
|
function qo(e) {
|
|
1431
1428
|
return $o.test(e);
|
|
1432
1429
|
}
|
|
1433
|
-
function Ro(e
|
|
1430
|
+
function Ro(e) {
|
|
1431
|
+
return Ao.test(e);
|
|
1432
|
+
}
|
|
1433
|
+
function zo(e, t, o) {
|
|
1434
1434
|
const n = Go(e, t, o);
|
|
1435
|
-
if (console.warn(n),
|
|
1435
|
+
if (console.warn(n), Ho.includes(e)) throw new RangeError(n);
|
|
1436
1436
|
}
|
|
1437
1437
|
function Go(e, t, o) {
|
|
1438
1438
|
const n = e[0] === "Y" ? "years" : "days of the month";
|
|
1439
1439
|
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1440
1440
|
}
|
|
1441
|
-
const
|
|
1442
|
-
function
|
|
1443
|
-
const n =
|
|
1444
|
-
if (!
|
|
1441
|
+
const Vo = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Xo = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Lo = /^'([^]*?)'?$/, Qo = /''/g, Uo = /[a-zA-Z]/;
|
|
1442
|
+
function et(e, t, o) {
|
|
1443
|
+
const n = rt(), r = o?.locale ?? n.locale ?? Ve, i = o?.firstWeekContainsDate ?? o?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, s = o?.weekStartsOn ?? o?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, a = B(e, o?.in);
|
|
1444
|
+
if (!Un(a))
|
|
1445
1445
|
throw new RangeError("Invalid time value");
|
|
1446
|
-
let c = t.match(
|
|
1447
|
-
const
|
|
1448
|
-
if (
|
|
1449
|
-
const
|
|
1450
|
-
return d
|
|
1446
|
+
let c = t.match(Xo).map((d) => {
|
|
1447
|
+
const u = d[0];
|
|
1448
|
+
if (u === "p" || u === "P") {
|
|
1449
|
+
const f = jo[u];
|
|
1450
|
+
return f(d, r.formatLong);
|
|
1451
1451
|
}
|
|
1452
|
-
return
|
|
1453
|
-
}).join("").match(
|
|
1454
|
-
if (
|
|
1452
|
+
return d;
|
|
1453
|
+
}).join("").match(Vo).map((d) => {
|
|
1454
|
+
if (d === "''")
|
|
1455
1455
|
return { isToken: !1, value: "'" };
|
|
1456
|
-
const
|
|
1457
|
-
if (
|
|
1458
|
-
return { isToken: !1, value:
|
|
1459
|
-
if (
|
|
1460
|
-
return { isToken: !0, value:
|
|
1461
|
-
if (
|
|
1456
|
+
const u = d[0];
|
|
1457
|
+
if (u === "'")
|
|
1458
|
+
return { isToken: !1, value: Ko(d) };
|
|
1459
|
+
if (Rt[u])
|
|
1460
|
+
return { isToken: !0, value: d };
|
|
1461
|
+
if (u.match(Uo))
|
|
1462
1462
|
throw new RangeError(
|
|
1463
|
-
"Format string contains an unescaped latin alphabet character `" +
|
|
1463
|
+
"Format string contains an unescaped latin alphabet character `" + u + "`"
|
|
1464
1464
|
);
|
|
1465
|
-
return { isToken: !1, value:
|
|
1465
|
+
return { isToken: !1, value: d };
|
|
1466
1466
|
});
|
|
1467
|
-
r.localize.preprocessor && (c = r.localize.preprocessor(
|
|
1468
|
-
const
|
|
1469
|
-
firstWeekContainsDate:
|
|
1470
|
-
weekStartsOn:
|
|
1467
|
+
r.localize.preprocessor && (c = r.localize.preprocessor(a, c));
|
|
1468
|
+
const l = {
|
|
1469
|
+
firstWeekContainsDate: i,
|
|
1470
|
+
weekStartsOn: s,
|
|
1471
1471
|
locale: r
|
|
1472
1472
|
};
|
|
1473
|
-
return c.map((
|
|
1474
|
-
if (!
|
|
1475
|
-
const
|
|
1476
|
-
(!o?.useAdditionalWeekYearTokens &&
|
|
1477
|
-
const
|
|
1478
|
-
return
|
|
1473
|
+
return c.map((d) => {
|
|
1474
|
+
if (!d.isToken) return d.value;
|
|
1475
|
+
const u = d.value;
|
|
1476
|
+
(!o?.useAdditionalWeekYearTokens && Ro(u) || !o?.useAdditionalDayOfYearTokens && qo(u)) && zo(u, t, String(e));
|
|
1477
|
+
const f = Rt[u[0]];
|
|
1478
|
+
return f(a, u, r.localize, l);
|
|
1479
1479
|
}).join("");
|
|
1480
1480
|
}
|
|
1481
|
-
function
|
|
1482
|
-
const t = e.match(
|
|
1481
|
+
function Ko(e) {
|
|
1482
|
+
const t = e.match(Lo);
|
|
1483
1483
|
return t ? t[1].replace(Qo, "'") : e;
|
|
1484
1484
|
}
|
|
1485
1485
|
function Zo(e, t) {
|
|
1486
|
-
const o = B(e, t?.in), n = o.getFullYear(), r = o.getMonth(),
|
|
1487
|
-
return
|
|
1486
|
+
const o = B(e, t?.in), n = o.getFullYear(), r = o.getMonth(), i = Q(o, 0);
|
|
1487
|
+
return i.setFullYear(n, r + 1, 0), i.setHours(0, 0, 0, 0), i.getDate();
|
|
1488
1488
|
}
|
|
1489
|
-
function
|
|
1489
|
+
function Jo(e, t) {
|
|
1490
1490
|
return B(e, t?.in).getMonth();
|
|
1491
1491
|
}
|
|
1492
|
-
function
|
|
1492
|
+
function er(e, t) {
|
|
1493
1493
|
return B(e, t?.in).getFullYear();
|
|
1494
1494
|
}
|
|
1495
|
-
function
|
|
1495
|
+
function tr(e, t) {
|
|
1496
1496
|
return +B(e) > +B(t);
|
|
1497
1497
|
}
|
|
1498
|
-
function
|
|
1498
|
+
function nr(e, t) {
|
|
1499
1499
|
return +B(e) < +B(t);
|
|
1500
1500
|
}
|
|
1501
|
-
function
|
|
1501
|
+
function or(e, t, o) {
|
|
1502
1502
|
const [n, r] = Qe(
|
|
1503
1503
|
o?.in,
|
|
1504
1504
|
e,
|
|
@@ -1506,7 +1506,7 @@ function nr(e, t, o) {
|
|
|
1506
1506
|
);
|
|
1507
1507
|
return n.getFullYear() === r.getFullYear() && n.getMonth() === r.getMonth();
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1509
|
+
function rr(e, t, o) {
|
|
1510
1510
|
const [n, r] = Qe(
|
|
1511
1511
|
o?.in,
|
|
1512
1512
|
e,
|
|
@@ -1514,30 +1514,30 @@ function or(e, t, o) {
|
|
|
1514
1514
|
);
|
|
1515
1515
|
return n.getFullYear() === r.getFullYear();
|
|
1516
1516
|
}
|
|
1517
|
-
function rr(e, t, o) {
|
|
1518
|
-
const n = B(e, o?.in), r = n.getFullYear(), s = n.getDate(), a = U(e, 0);
|
|
1519
|
-
a.setFullYear(r, t, 15), a.setHours(0, 0, 0, 0);
|
|
1520
|
-
const i = Zo(a);
|
|
1521
|
-
return n.setMonth(t, Math.min(s, i)), n;
|
|
1522
|
-
}
|
|
1523
1517
|
function ar(e, t, o) {
|
|
1518
|
+
const n = B(e, o?.in), r = n.getFullYear(), i = n.getDate(), s = Q(e, 0);
|
|
1519
|
+
s.setFullYear(r, t, 15), s.setHours(0, 0, 0, 0);
|
|
1520
|
+
const a = Zo(s);
|
|
1521
|
+
return n.setMonth(t, Math.min(i, a)), n;
|
|
1522
|
+
}
|
|
1523
|
+
function sr(e, t, o) {
|
|
1524
1524
|
const n = B(e, o?.in);
|
|
1525
|
-
return isNaN(+n) ?
|
|
1525
|
+
return isNaN(+n) ? Q(e, NaN) : (n.setFullYear(t), n);
|
|
1526
1526
|
}
|
|
1527
|
-
const
|
|
1528
|
-
function
|
|
1529
|
-
const o = t.startOfMonth(e), n = o.getDay() > 0 ? o.getDay() : 7, r = t.addDays(e, -n + 1),
|
|
1530
|
-
return t.getMonth(e) === t.getMonth(
|
|
1527
|
+
const Xt = 5, ir = 4;
|
|
1528
|
+
function cr(e, t) {
|
|
1529
|
+
const o = t.startOfMonth(e), n = o.getDay() > 0 ? o.getDay() : 7, r = t.addDays(e, -n + 1), i = t.addDays(r, Xt * 7 - 1);
|
|
1530
|
+
return t.getMonth(e) === t.getMonth(i) ? Xt : ir;
|
|
1531
1531
|
}
|
|
1532
|
-
function
|
|
1532
|
+
function fn(e, t) {
|
|
1533
1533
|
const o = t.startOfMonth(e), n = o.getDay();
|
|
1534
1534
|
return n === 1 ? o : n === 0 ? t.addDays(o, -6) : t.addDays(o, -1 * (n - 1));
|
|
1535
1535
|
}
|
|
1536
|
-
function
|
|
1537
|
-
const o =
|
|
1536
|
+
function lr(e, t) {
|
|
1537
|
+
const o = fn(e, t), n = cr(e, t);
|
|
1538
1538
|
return t.addDays(o, n * 7 - 1);
|
|
1539
1539
|
}
|
|
1540
|
-
const
|
|
1540
|
+
const ur = {
|
|
1541
1541
|
lessThanXSeconds: {
|
|
1542
1542
|
one: "menos de un segundo",
|
|
1543
1543
|
other: "menos de {{count}} segundos"
|
|
@@ -1599,16 +1599,16 @@ const lr = {
|
|
|
1599
1599
|
one: "casi 1 año",
|
|
1600
1600
|
other: "casi {{count}} años"
|
|
1601
1601
|
}
|
|
1602
|
-
},
|
|
1602
|
+
}, dr = (e, t, o) => {
|
|
1603
1603
|
let n;
|
|
1604
|
-
const r =
|
|
1604
|
+
const r = ur[e];
|
|
1605
1605
|
return typeof r == "string" ? n = r : t === 1 ? n = r.one : n = r.other.replace("{{count}}", t.toString()), o?.addSuffix ? o.comparison && o.comparison > 0 ? "en " + n : "hace " + n : n;
|
|
1606
|
-
},
|
|
1606
|
+
}, fr = {
|
|
1607
1607
|
full: "EEEE, d 'de' MMMM 'de' y",
|
|
1608
1608
|
long: "d 'de' MMMM 'de' y",
|
|
1609
1609
|
medium: "d MMM y",
|
|
1610
1610
|
short: "dd/MM/y"
|
|
1611
|
-
},
|
|
1611
|
+
}, hr = {
|
|
1612
1612
|
full: "HH:mm:ss zzzz",
|
|
1613
1613
|
long: "HH:mm:ss z",
|
|
1614
1614
|
medium: "HH:mm:ss",
|
|
@@ -1618,42 +1618,42 @@ const lr = {
|
|
|
1618
1618
|
long: "{{date}} 'a las' {{time}}",
|
|
1619
1619
|
medium: "{{date}}, {{time}}",
|
|
1620
1620
|
short: "{{date}}, {{time}}"
|
|
1621
|
-
},
|
|
1622
|
-
date:
|
|
1623
|
-
formats:
|
|
1621
|
+
}, yr = {
|
|
1622
|
+
date: Xe({
|
|
1623
|
+
formats: fr,
|
|
1624
1624
|
defaultWidth: "full"
|
|
1625
1625
|
}),
|
|
1626
|
-
time:
|
|
1627
|
-
formats:
|
|
1626
|
+
time: Xe({
|
|
1627
|
+
formats: hr,
|
|
1628
1628
|
defaultWidth: "full"
|
|
1629
1629
|
}),
|
|
1630
|
-
dateTime:
|
|
1630
|
+
dateTime: Xe({
|
|
1631
1631
|
formats: mr,
|
|
1632
1632
|
defaultWidth: "full"
|
|
1633
1633
|
})
|
|
1634
|
-
},
|
|
1634
|
+
}, gr = {
|
|
1635
1635
|
lastWeek: "'el' eeee 'pasado a la' p",
|
|
1636
1636
|
yesterday: "'ayer a la' p",
|
|
1637
1637
|
today: "'hoy a la' p",
|
|
1638
1638
|
tomorrow: "'mañana a la' p",
|
|
1639
1639
|
nextWeek: "eeee 'a la' p",
|
|
1640
1640
|
other: "P"
|
|
1641
|
-
},
|
|
1641
|
+
}, pr = {
|
|
1642
1642
|
lastWeek: "'el' eeee 'pasado a las' p",
|
|
1643
1643
|
yesterday: "'ayer a las' p",
|
|
1644
1644
|
today: "'hoy a las' p",
|
|
1645
1645
|
tomorrow: "'mañana a las' p",
|
|
1646
1646
|
nextWeek: "eeee 'a las' p",
|
|
1647
1647
|
other: "P"
|
|
1648
|
-
},
|
|
1648
|
+
}, br = (e, t, o, n) => t.getHours() !== 1 ? pr[e] : gr[e], wr = {
|
|
1649
1649
|
narrow: ["AC", "DC"],
|
|
1650
1650
|
abbreviated: ["AC", "DC"],
|
|
1651
1651
|
wide: ["antes de cristo", "después de cristo"]
|
|
1652
|
-
},
|
|
1652
|
+
}, Mr = {
|
|
1653
1653
|
narrow: ["1", "2", "3", "4"],
|
|
1654
1654
|
abbreviated: ["T1", "T2", "T3", "T4"],
|
|
1655
1655
|
wide: ["1º trimestre", "2º trimestre", "3º trimestre", "4º trimestre"]
|
|
1656
|
-
},
|
|
1656
|
+
}, Dr = {
|
|
1657
1657
|
narrow: ["e", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
|
|
1658
1658
|
abbreviated: [
|
|
1659
1659
|
"ene",
|
|
@@ -1683,7 +1683,7 @@ const lr = {
|
|
|
1683
1683
|
"noviembre",
|
|
1684
1684
|
"diciembre"
|
|
1685
1685
|
]
|
|
1686
|
-
},
|
|
1686
|
+
}, vr = {
|
|
1687
1687
|
narrow: ["d", "l", "m", "m", "j", "v", "s"],
|
|
1688
1688
|
short: ["do", "lu", "ma", "mi", "ju", "vi", "sá"],
|
|
1689
1689
|
abbreviated: ["dom", "lun", "mar", "mié", "jue", "vie", "sáb"],
|
|
@@ -1696,7 +1696,7 @@ const lr = {
|
|
|
1696
1696
|
"viernes",
|
|
1697
1697
|
"sábado"
|
|
1698
1698
|
]
|
|
1699
|
-
},
|
|
1699
|
+
}, kr = {
|
|
1700
1700
|
narrow: {
|
|
1701
1701
|
am: "a",
|
|
1702
1702
|
pm: "p",
|
|
@@ -1727,7 +1727,7 @@ const lr = {
|
|
|
1727
1727
|
evening: "tarde",
|
|
1728
1728
|
night: "noche"
|
|
1729
1729
|
}
|
|
1730
|
-
},
|
|
1730
|
+
}, Or = {
|
|
1731
1731
|
narrow: {
|
|
1732
1732
|
am: "a",
|
|
1733
1733
|
pm: "p",
|
|
@@ -1758,52 +1758,52 @@ const lr = {
|
|
|
1758
1758
|
evening: "de la tarde",
|
|
1759
1759
|
night: "de la noche"
|
|
1760
1760
|
}
|
|
1761
|
-
},
|
|
1762
|
-
ordinalNumber:
|
|
1763
|
-
era:
|
|
1764
|
-
values:
|
|
1761
|
+
}, Wr = (e, t) => Number(e) + "º", Sr = {
|
|
1762
|
+
ordinalNumber: Wr,
|
|
1763
|
+
era: we({
|
|
1764
|
+
values: wr,
|
|
1765
1765
|
defaultWidth: "wide"
|
|
1766
1766
|
}),
|
|
1767
|
-
quarter:
|
|
1768
|
-
values:
|
|
1767
|
+
quarter: we({
|
|
1768
|
+
values: Mr,
|
|
1769
1769
|
defaultWidth: "wide",
|
|
1770
1770
|
argumentCallback: (e) => Number(e) - 1
|
|
1771
1771
|
}),
|
|
1772
|
-
month:
|
|
1773
|
-
values: Mr,
|
|
1774
|
-
defaultWidth: "wide"
|
|
1775
|
-
}),
|
|
1776
|
-
day: be({
|
|
1772
|
+
month: we({
|
|
1777
1773
|
values: Dr,
|
|
1778
1774
|
defaultWidth: "wide"
|
|
1779
1775
|
}),
|
|
1780
|
-
|
|
1776
|
+
day: we({
|
|
1781
1777
|
values: vr,
|
|
1778
|
+
defaultWidth: "wide"
|
|
1779
|
+
}),
|
|
1780
|
+
dayPeriod: we({
|
|
1781
|
+
values: kr,
|
|
1782
1782
|
defaultWidth: "wide",
|
|
1783
|
-
formattingValues:
|
|
1783
|
+
formattingValues: Or,
|
|
1784
1784
|
defaultFormattingWidth: "wide"
|
|
1785
1785
|
})
|
|
1786
|
-
},
|
|
1786
|
+
}, Nr = /^(\d+)(º)?/i, Cr = /\d+/i, xr = {
|
|
1787
1787
|
narrow: /^(ac|dc|a|d)/i,
|
|
1788
1788
|
abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
|
|
1789
1789
|
wide: /^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i
|
|
1790
|
-
},
|
|
1790
|
+
}, Pr = {
|
|
1791
1791
|
any: [/^ac/i, /^dc/i],
|
|
1792
1792
|
wide: [
|
|
1793
1793
|
/^(antes de cristo|antes de la era com[uú]n)/i,
|
|
1794
1794
|
/^(despu[eé]s de cristo|era com[uú]n)/i
|
|
1795
1795
|
]
|
|
1796
|
-
},
|
|
1796
|
+
}, Tr = {
|
|
1797
1797
|
narrow: /^[1234]/i,
|
|
1798
1798
|
abbreviated: /^T[1234]/i,
|
|
1799
1799
|
wide: /^[1234](º)? trimestre/i
|
|
1800
|
-
}, Tr = {
|
|
1801
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1802
1800
|
}, Yr = {
|
|
1801
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1802
|
+
}, Er = {
|
|
1803
1803
|
narrow: /^[efmajsond]/i,
|
|
1804
1804
|
abbreviated: /^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,
|
|
1805
1805
|
wide: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i
|
|
1806
|
-
},
|
|
1806
|
+
}, Fr = {
|
|
1807
1807
|
narrow: [
|
|
1808
1808
|
/^e/i,
|
|
1809
1809
|
/^f/i,
|
|
@@ -1837,13 +1837,13 @@ const lr = {
|
|
|
1837
1837
|
short: /^(do|lu|ma|mi|ju|vi|s[áa])/i,
|
|
1838
1838
|
abbreviated: /^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,
|
|
1839
1839
|
wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i
|
|
1840
|
-
},
|
|
1840
|
+
}, Ir = {
|
|
1841
1841
|
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
|
|
1842
1842
|
any: [/^do/i, /^lu/i, /^ma/i, /^mi/i, /^ju/i, /^vi/i, /^sa/i]
|
|
1843
|
-
},
|
|
1843
|
+
}, Br = {
|
|
1844
1844
|
narrow: /^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,
|
|
1845
1845
|
any: /^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i
|
|
1846
|
-
},
|
|
1846
|
+
}, jr = {
|
|
1847
1847
|
any: {
|
|
1848
1848
|
am: /^a/i,
|
|
1849
1849
|
pm: /^p/i,
|
|
@@ -1854,64 +1854,64 @@ const lr = {
|
|
|
1854
1854
|
evening: /tarde/i,
|
|
1855
1855
|
night: /noche/i
|
|
1856
1856
|
}
|
|
1857
|
-
},
|
|
1858
|
-
ordinalNumber:
|
|
1859
|
-
matchPattern:
|
|
1860
|
-
parsePattern:
|
|
1857
|
+
}, $r = {
|
|
1858
|
+
ordinalNumber: ln({
|
|
1859
|
+
matchPattern: Nr,
|
|
1860
|
+
parsePattern: Cr,
|
|
1861
1861
|
valueCallback: function(e) {
|
|
1862
1862
|
return parseInt(e, 10);
|
|
1863
1863
|
}
|
|
1864
1864
|
}),
|
|
1865
|
-
era:
|
|
1866
|
-
matchPatterns:
|
|
1865
|
+
era: Me({
|
|
1866
|
+
matchPatterns: xr,
|
|
1867
1867
|
defaultMatchWidth: "wide",
|
|
1868
|
-
parsePatterns:
|
|
1868
|
+
parsePatterns: Pr,
|
|
1869
1869
|
defaultParseWidth: "any"
|
|
1870
1870
|
}),
|
|
1871
|
-
quarter:
|
|
1872
|
-
matchPatterns:
|
|
1871
|
+
quarter: Me({
|
|
1872
|
+
matchPatterns: Tr,
|
|
1873
1873
|
defaultMatchWidth: "wide",
|
|
1874
|
-
parsePatterns:
|
|
1874
|
+
parsePatterns: Yr,
|
|
1875
1875
|
defaultParseWidth: "any",
|
|
1876
1876
|
valueCallback: (e) => e + 1
|
|
1877
1877
|
}),
|
|
1878
|
-
month:
|
|
1879
|
-
matchPatterns:
|
|
1878
|
+
month: Me({
|
|
1879
|
+
matchPatterns: Er,
|
|
1880
1880
|
defaultMatchWidth: "wide",
|
|
1881
|
-
parsePatterns:
|
|
1881
|
+
parsePatterns: Fr,
|
|
1882
1882
|
defaultParseWidth: "any"
|
|
1883
1883
|
}),
|
|
1884
|
-
day:
|
|
1884
|
+
day: Me({
|
|
1885
1885
|
matchPatterns: _r,
|
|
1886
1886
|
defaultMatchWidth: "wide",
|
|
1887
|
-
parsePatterns:
|
|
1887
|
+
parsePatterns: Ir,
|
|
1888
1888
|
defaultParseWidth: "any"
|
|
1889
1889
|
}),
|
|
1890
|
-
dayPeriod:
|
|
1891
|
-
matchPatterns:
|
|
1890
|
+
dayPeriod: Me({
|
|
1891
|
+
matchPatterns: Br,
|
|
1892
1892
|
defaultMatchWidth: "any",
|
|
1893
|
-
parsePatterns:
|
|
1893
|
+
parsePatterns: jr,
|
|
1894
1894
|
defaultParseWidth: "any"
|
|
1895
1895
|
})
|
|
1896
|
-
},
|
|
1896
|
+
}, Dt = {
|
|
1897
1897
|
code: "es",
|
|
1898
|
-
formatDistance:
|
|
1899
|
-
formatLong:
|
|
1900
|
-
formatRelative:
|
|
1901
|
-
localize:
|
|
1902
|
-
match:
|
|
1898
|
+
formatDistance: dr,
|
|
1899
|
+
formatLong: yr,
|
|
1900
|
+
formatRelative: br,
|
|
1901
|
+
localize: Sr,
|
|
1902
|
+
match: $r,
|
|
1903
1903
|
options: {
|
|
1904
1904
|
weekStartsOn: 1,
|
|
1905
1905
|
firstWeekContainsDate: 1
|
|
1906
1906
|
}
|
|
1907
|
-
},
|
|
1908
|
-
...
|
|
1907
|
+
}, hn = {
|
|
1908
|
+
...Ve,
|
|
1909
1909
|
labels: {
|
|
1910
1910
|
labelDayButton: (e, t, o, n) => {
|
|
1911
1911
|
let r;
|
|
1912
|
-
n && typeof n.format == "function" ? r = n.format.bind(n) : r = (
|
|
1913
|
-
let
|
|
1914
|
-
return t.today && (
|
|
1912
|
+
n && typeof n.format == "function" ? r = n.format.bind(n) : r = (s, a) => et(s, a, { locale: Ve, ...o });
|
|
1913
|
+
let i = r(e, "PPPP");
|
|
1914
|
+
return t.today && (i = `Today, ${i}`), t.selected && (i = `${i}, selected`), i;
|
|
1915
1915
|
},
|
|
1916
1916
|
labelMonthDropdown: "Choose the Month",
|
|
1917
1917
|
labelNext: "Go to the Next Month",
|
|
@@ -1920,23 +1920,23 @@ const lr = {
|
|
|
1920
1920
|
labelYearDropdown: "Choose the Year",
|
|
1921
1921
|
labelGrid: (e, t, o) => {
|
|
1922
1922
|
let n;
|
|
1923
|
-
return o && typeof o.format == "function" ? n = o.format.bind(o) : n = (r,
|
|
1923
|
+
return o && typeof o.format == "function" ? n = o.format.bind(o) : n = (r, i) => et(r, i, { locale: Ve, ...t }), n(e, "LLLL yyyy");
|
|
1924
1924
|
},
|
|
1925
1925
|
labelGridcell: (e, t, o, n) => {
|
|
1926
1926
|
let r;
|
|
1927
|
-
n && typeof n.format == "function" ? r = n.format.bind(n) : r = (
|
|
1928
|
-
let
|
|
1929
|
-
return t?.today && (
|
|
1927
|
+
n && typeof n.format == "function" ? r = n.format.bind(n) : r = (s, a) => et(s, a, { locale: Ve, ...o });
|
|
1928
|
+
let i = r(e, "PPPP");
|
|
1929
|
+
return t?.today && (i = `Today, ${i}`), i;
|
|
1930
1930
|
},
|
|
1931
1931
|
labelNav: "Navigation bar",
|
|
1932
1932
|
labelWeekNumberHeader: "Week Number",
|
|
1933
1933
|
labelWeekday: (e, t, o) => {
|
|
1934
1934
|
let n;
|
|
1935
|
-
return o && typeof o.format == "function" ? n = o.format.bind(o) : n = (r,
|
|
1935
|
+
return o && typeof o.format == "function" ? n = o.format.bind(o) : n = (r, i) => et(r, i, { locale: Ve, ...t }), n(e, "cccc");
|
|
1936
1936
|
}
|
|
1937
1937
|
}
|
|
1938
1938
|
};
|
|
1939
|
-
class
|
|
1939
|
+
class ce {
|
|
1940
1940
|
/**
|
|
1941
1941
|
* Creates an instance of `DateLib`.
|
|
1942
1942
|
*
|
|
@@ -1944,18 +1944,18 @@ class ie {
|
|
|
1944
1944
|
* @param overrides Custom overrides for the date library functions.
|
|
1945
1945
|
*/
|
|
1946
1946
|
constructor(t, o) {
|
|
1947
|
-
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ?
|
|
1948
|
-
const r = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(n) :
|
|
1949
|
-
if (
|
|
1947
|
+
this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? J.tz(this.options.timeZone) : new this.Date(), this.newDate = (n, r, i) => this.overrides?.newDate ? this.overrides.newDate(n, r, i) : this.options.timeZone ? new J(n, r, i, this.options.timeZone) : new Date(n, r, i), this.addDays = (n, r) => this.overrides?.addDays ? this.overrides.addDays(n, r) : en(n, r), this.addMonths = (n, r) => this.overrides?.addMonths ? this.overrides.addMonths(n, r) : tn(n, r), this.addWeeks = (n, r) => this.overrides?.addWeeks ? this.overrides.addWeeks(n, r) : Gn(n, r), this.addYears = (n, r) => this.overrides?.addYears ? this.overrides.addYears(n, r) : Vn(n, r), this.differenceInCalendarDays = (n, r) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(n, r) : xt(n, r), this.differenceInCalendarMonths = (n, r) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(n, r) : rn(n, r), this.eachMonthOfInterval = (n) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(n) : Zn(n), this.eachYearOfInterval = (n) => {
|
|
1948
|
+
const r = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(n) : to(n), i = new Set(r.map((a) => this.getYear(a)));
|
|
1949
|
+
if (i.size === r.length)
|
|
1950
1950
|
return r;
|
|
1951
|
-
const
|
|
1952
|
-
return
|
|
1953
|
-
|
|
1954
|
-
}),
|
|
1955
|
-
}, this.endOfBroadcastWeek = (n) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(n) :
|
|
1956
|
-
const
|
|
1957
|
-
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(
|
|
1958
|
-
}, this.getISOWeek = (n) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(n) :
|
|
1951
|
+
const s = [];
|
|
1952
|
+
return i.forEach((a) => {
|
|
1953
|
+
s.push(new Date(a, 0, 1));
|
|
1954
|
+
}), s;
|
|
1955
|
+
}, this.endOfBroadcastWeek = (n) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(n) : lr(n, this), this.endOfISOWeek = (n) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(n) : no(n), this.endOfMonth = (n) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(n) : Kn(n), this.endOfWeek = (n, r) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(n, r) : cn(n, this.options), this.endOfYear = (n) => this.overrides?.endOfYear ? this.overrides.endOfYear(n) : eo(n), this.format = (n, r, i) => {
|
|
1956
|
+
const s = this.overrides?.format ? this.overrides.format(n, r, this.options) : et(n, r, this.options);
|
|
1957
|
+
return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(s) : s;
|
|
1958
|
+
}, this.getISOWeek = (n) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(n) : Pt(n), this.getMonth = (n, r) => this.overrides?.getMonth ? this.overrides.getMonth(n, this.options) : Jo(n, this.options), this.getYear = (n, r) => this.overrides?.getYear ? this.overrides.getYear(n, this.options) : er(n, this.options), this.getWeek = (n, r) => this.overrides?.getWeek ? this.overrides.getWeek(n, this.options) : Tt(n, this.options), this.isAfter = (n, r) => this.overrides?.isAfter ? this.overrides.isAfter(n, r) : tr(n, r), this.isBefore = (n, r) => this.overrides?.isBefore ? this.overrides.isBefore(n, r) : nr(n, r), this.isDate = (n) => this.overrides?.isDate ? this.overrides.isDate(n) : on(n), this.isSameDay = (n, r) => this.overrides?.isSameDay ? this.overrides.isSameDay(n, r) : Qn(n, r), this.isSameMonth = (n, r) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(n, r) : or(n, r), this.isSameYear = (n, r) => this.overrides?.isSameYear ? this.overrides.isSameYear(n, r) : rr(n, r), this.max = (n) => this.overrides?.max ? this.overrides.max(n) : Xn(n), this.min = (n) => this.overrides?.min ? this.overrides.min(n) : Ln(n), this.setMonth = (n, r) => this.overrides?.setMonth ? this.overrides.setMonth(n, r) : ar(n, r), this.setYear = (n, r) => this.overrides?.setYear ? this.overrides.setYear(n, r) : sr(n, r), this.startOfBroadcastWeek = (n, r) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(n, this) : fn(n, this), this.startOfDay = (n) => this.overrides?.startOfDay ? this.overrides.startOfDay(n) : ot(n), this.startOfISOWeek = (n) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(n) : nt(n), this.startOfMonth = (n) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(n) : Jn(n), this.startOfWeek = (n, r) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(n, this.options) : Le(n, this.options), this.startOfYear = (n) => this.overrides?.startOfYear ? this.overrides.startOfYear(n) : sn(n), this.options = { locale: hn, ...t }, this.overrides = o;
|
|
1959
1959
|
}
|
|
1960
1960
|
/**
|
|
1961
1961
|
* Generates a mapping of Arabic digits (0-9) to the target numbering system
|
|
@@ -1999,7 +1999,7 @@ class ie {
|
|
|
1999
1999
|
*/
|
|
2000
2000
|
getMonthYearOrder() {
|
|
2001
2001
|
const t = this.options.locale?.code;
|
|
2002
|
-
return t &&
|
|
2002
|
+
return t && ce.yearFirstLocales.has(t) ? "year-first" : "month-first";
|
|
2003
2003
|
}
|
|
2004
2004
|
/**
|
|
2005
2005
|
* Formats the month/year pair respecting locale conventions.
|
|
@@ -2007,10 +2007,10 @@ class ie {
|
|
|
2007
2007
|
* @since 9.11.0
|
|
2008
2008
|
*/
|
|
2009
2009
|
formatMonthYear(t) {
|
|
2010
|
-
const { locale: o, timeZone: n, numerals: r } = this.options,
|
|
2011
|
-
if (
|
|
2010
|
+
const { locale: o, timeZone: n, numerals: r } = this.options, i = o?.code;
|
|
2011
|
+
if (i && ce.yearFirstLocales.has(i))
|
|
2012
2012
|
try {
|
|
2013
|
-
return new Intl.DateTimeFormat(
|
|
2013
|
+
return new Intl.DateTimeFormat(i, {
|
|
2014
2014
|
month: "long",
|
|
2015
2015
|
year: "numeric",
|
|
2016
2016
|
timeZone: n,
|
|
@@ -2018,11 +2018,11 @@ class ie {
|
|
|
2018
2018
|
}).format(t);
|
|
2019
2019
|
} catch {
|
|
2020
2020
|
}
|
|
2021
|
-
const
|
|
2022
|
-
return this.format(t,
|
|
2021
|
+
const s = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
|
|
2022
|
+
return this.format(t, s);
|
|
2023
2023
|
}
|
|
2024
2024
|
}
|
|
2025
|
-
|
|
2025
|
+
ce.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
2026
2026
|
"eu",
|
|
2027
2027
|
"hu",
|
|
2028
2028
|
"ja",
|
|
@@ -2041,9 +2041,9 @@ ie.yearFirstLocales = /* @__PURE__ */ new Set([
|
|
|
2041
2041
|
"zh-HK",
|
|
2042
2042
|
"zh-TW"
|
|
2043
2043
|
]);
|
|
2044
|
-
const
|
|
2045
|
-
class
|
|
2046
|
-
constructor(t, o, n =
|
|
2044
|
+
const ve = new ce();
|
|
2045
|
+
class mn {
|
|
2046
|
+
constructor(t, o, n = ve) {
|
|
2047
2047
|
this.date = t, this.displayMonth = o, this.outside = !!(o && !n.isSameMonth(t, o)), this.dateLib = n, this.isoDate = n.format(t, "yyyy-MM-dd"), this.displayMonthId = n.format(o, "yyyy-MM"), this.dateMonthId = n.format(t, "yyyy-MM");
|
|
2048
2048
|
}
|
|
2049
2049
|
/**
|
|
@@ -2057,45 +2057,45 @@ class fn {
|
|
|
2057
2057
|
return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
|
|
2058
2058
|
}
|
|
2059
2059
|
}
|
|
2060
|
-
class
|
|
2060
|
+
class Ar {
|
|
2061
2061
|
constructor(t, o) {
|
|
2062
2062
|
this.date = t, this.weeks = o;
|
|
2063
2063
|
}
|
|
2064
2064
|
}
|
|
2065
|
-
class
|
|
2065
|
+
class Hr {
|
|
2066
2066
|
constructor(t, o) {
|
|
2067
2067
|
this.days = o, this.weekNumber = t;
|
|
2068
2068
|
}
|
|
2069
2069
|
}
|
|
2070
|
-
function Hr(e) {
|
|
2071
|
-
return m.createElement("button", { ...e });
|
|
2072
|
-
}
|
|
2073
2070
|
function qr(e) {
|
|
2074
|
-
return
|
|
2071
|
+
return h.createElement("button", { ...e });
|
|
2075
2072
|
}
|
|
2076
2073
|
function Rr(e) {
|
|
2074
|
+
return h.createElement("span", { ...e });
|
|
2075
|
+
}
|
|
2076
|
+
function zr(e) {
|
|
2077
2077
|
const { size: t = 24, orientation: o = "left", className: n } = e;
|
|
2078
2078
|
return (
|
|
2079
2079
|
// biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
|
|
2080
|
-
|
|
2080
|
+
h.createElement(
|
|
2081
2081
|
"svg",
|
|
2082
2082
|
{ className: n, width: t, height: t, viewBox: "0 0 24 24" },
|
|
2083
|
-
o === "up" &&
|
|
2084
|
-
o === "down" &&
|
|
2085
|
-
o === "left" &&
|
|
2086
|
-
o === "right" &&
|
|
2083
|
+
o === "up" && h.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
|
|
2084
|
+
o === "down" && h.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
|
|
2085
|
+
o === "left" && h.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
|
|
2086
|
+
o === "right" && h.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
|
|
2087
2087
|
)
|
|
2088
2088
|
);
|
|
2089
2089
|
}
|
|
2090
2090
|
function Gr(e) {
|
|
2091
2091
|
const { day: t, modifiers: o, ...n } = e;
|
|
2092
|
-
return
|
|
2092
|
+
return h.createElement("td", { ...n });
|
|
2093
2093
|
}
|
|
2094
|
-
function
|
|
2095
|
-
const { day: t, modifiers: o, ...n } = e, r =
|
|
2096
|
-
return
|
|
2094
|
+
function Vr(e) {
|
|
2095
|
+
const { day: t, modifiers: o, ...n } = e, r = h.useRef(null);
|
|
2096
|
+
return h.useEffect(() => {
|
|
2097
2097
|
o.focused && r.current?.focus();
|
|
2098
|
-
}, [o.focused]),
|
|
2098
|
+
}, [o.focused]), h.createElement("button", { ref: r, ...n });
|
|
2099
2099
|
}
|
|
2100
2100
|
var b;
|
|
2101
2101
|
(function(e) {
|
|
@@ -2105,200 +2105,200 @@ var R;
|
|
|
2105
2105
|
(function(e) {
|
|
2106
2106
|
e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
|
|
2107
2107
|
})(R || (R = {}));
|
|
2108
|
-
var
|
|
2108
|
+
var he;
|
|
2109
2109
|
(function(e) {
|
|
2110
2110
|
e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
|
|
2111
|
-
})(
|
|
2112
|
-
var
|
|
2111
|
+
})(he || (he = {}));
|
|
2112
|
+
var se;
|
|
2113
2113
|
(function(e) {
|
|
2114
2114
|
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";
|
|
2115
|
-
})(
|
|
2116
|
-
function
|
|
2117
|
-
const { options: t, className: o, components: n, classNames: r, ...
|
|
2118
|
-
return
|
|
2115
|
+
})(se || (se = {}));
|
|
2116
|
+
function Xr(e) {
|
|
2117
|
+
const { options: t, className: o, components: n, classNames: r, ...i } = e, s = [r[b.Dropdown], o].join(" "), a = t?.find(({ value: c }) => c === i.value);
|
|
2118
|
+
return h.createElement(
|
|
2119
2119
|
"span",
|
|
2120
|
-
{ "data-disabled":
|
|
2121
|
-
|
|
2122
|
-
|
|
2120
|
+
{ "data-disabled": i.disabled, className: r[b.DropdownRoot] },
|
|
2121
|
+
h.createElement(n.Select, { className: s, ...i }, t?.map(({ value: c, label: l, disabled: d }) => h.createElement(n.Option, { key: c, value: c, disabled: d }, l))),
|
|
2122
|
+
h.createElement(
|
|
2123
2123
|
"span",
|
|
2124
2124
|
{ className: r[b.CaptionLabel], "aria-hidden": !0 },
|
|
2125
|
-
|
|
2126
|
-
|
|
2125
|
+
a?.label,
|
|
2126
|
+
h.createElement(n.Chevron, { orientation: "down", size: 18, className: r[b.Chevron] })
|
|
2127
2127
|
)
|
|
2128
2128
|
);
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2131
|
-
return
|
|
2130
|
+
function Lr(e) {
|
|
2131
|
+
return h.createElement("div", { ...e });
|
|
2132
2132
|
}
|
|
2133
2133
|
function Qr(e) {
|
|
2134
|
-
return
|
|
2134
|
+
return h.createElement("div", { ...e });
|
|
2135
2135
|
}
|
|
2136
2136
|
function Ur(e) {
|
|
2137
2137
|
const { calendarMonth: t, displayIndex: o, ...n } = e;
|
|
2138
|
-
return
|
|
2138
|
+
return h.createElement("div", { ...n }, e.children);
|
|
2139
2139
|
}
|
|
2140
|
-
function
|
|
2140
|
+
function Kr(e) {
|
|
2141
2141
|
const { calendarMonth: t, displayIndex: o, ...n } = e;
|
|
2142
|
-
return
|
|
2142
|
+
return h.createElement("div", { ...n });
|
|
2143
2143
|
}
|
|
2144
2144
|
function Zr(e) {
|
|
2145
|
-
return
|
|
2145
|
+
return h.createElement("table", { ...e });
|
|
2146
2146
|
}
|
|
2147
|
-
function
|
|
2148
|
-
return
|
|
2147
|
+
function Jr(e) {
|
|
2148
|
+
return h.createElement("div", { ...e });
|
|
2149
2149
|
}
|
|
2150
|
-
const
|
|
2151
|
-
function
|
|
2152
|
-
const e =
|
|
2150
|
+
const yn = Tn(void 0);
|
|
2151
|
+
function at() {
|
|
2152
|
+
const e = Yn(yn);
|
|
2153
2153
|
if (e === void 0)
|
|
2154
2154
|
throw new Error("useDayPicker() must be used within a custom component.");
|
|
2155
2155
|
return e;
|
|
2156
2156
|
}
|
|
2157
|
-
function Jr(e) {
|
|
2158
|
-
const { components: t } = rt();
|
|
2159
|
-
return m.createElement(t.Dropdown, { ...e });
|
|
2160
|
-
}
|
|
2161
2157
|
function ea(e) {
|
|
2162
|
-
const {
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2158
|
+
const { components: t } = at();
|
|
2159
|
+
return h.createElement(t.Dropdown, { ...e });
|
|
2160
|
+
}
|
|
2161
|
+
function ta(e) {
|
|
2162
|
+
const { onPreviousClick: t, onNextClick: o, previousMonth: n, nextMonth: r, ...i } = e, { components: s, classNames: a, labels: { labelPrevious: c, labelNext: l } } = at(), d = q((f) => {
|
|
2163
|
+
r && o?.(f);
|
|
2164
|
+
}, [r, o]), u = q((f) => {
|
|
2165
|
+
n && t?.(f);
|
|
2166
2166
|
}, [n, t]);
|
|
2167
|
-
return
|
|
2167
|
+
return h.createElement(
|
|
2168
2168
|
"nav",
|
|
2169
|
-
{ ...
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
{ type: "button", className:
|
|
2173
|
-
|
|
2169
|
+
{ ...i },
|
|
2170
|
+
h.createElement(
|
|
2171
|
+
s.PreviousMonthButton,
|
|
2172
|
+
{ type: "button", className: a[b.PreviousMonthButton], tabIndex: n ? void 0 : -1, "aria-disabled": n ? void 0 : !0, "aria-label": c(n), onClick: u },
|
|
2173
|
+
h.createElement(s.Chevron, { disabled: n ? void 0 : !0, className: a[b.Chevron], orientation: "left" })
|
|
2174
2174
|
),
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
{ type: "button", className:
|
|
2178
|
-
|
|
2175
|
+
h.createElement(
|
|
2176
|
+
s.NextMonthButton,
|
|
2177
|
+
{ type: "button", className: a[b.NextMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled": r ? void 0 : !0, "aria-label": l(r), onClick: d },
|
|
2178
|
+
h.createElement(s.Chevron, { disabled: r ? void 0 : !0, orientation: "right", className: a[b.Chevron] })
|
|
2179
2179
|
)
|
|
2180
2180
|
);
|
|
2181
2181
|
}
|
|
2182
|
-
function ta(e) {
|
|
2183
|
-
const { components: t } = rt();
|
|
2184
|
-
return m.createElement(t.Button, { ...e });
|
|
2185
|
-
}
|
|
2186
2182
|
function na(e) {
|
|
2187
|
-
|
|
2183
|
+
const { components: t } = at();
|
|
2184
|
+
return h.createElement(t.Button, { ...e });
|
|
2188
2185
|
}
|
|
2189
2186
|
function oa(e) {
|
|
2190
|
-
|
|
2191
|
-
return m.createElement(t.Button, { ...e });
|
|
2187
|
+
return h.createElement("option", { ...e });
|
|
2192
2188
|
}
|
|
2193
2189
|
function ra(e) {
|
|
2194
|
-
const {
|
|
2195
|
-
return
|
|
2190
|
+
const { components: t } = at();
|
|
2191
|
+
return h.createElement(t.Button, { ...e });
|
|
2196
2192
|
}
|
|
2197
2193
|
function aa(e) {
|
|
2198
|
-
|
|
2194
|
+
const { rootRef: t, ...o } = e;
|
|
2195
|
+
return h.createElement("div", { ...o, ref: t });
|
|
2199
2196
|
}
|
|
2200
2197
|
function sa(e) {
|
|
2201
|
-
|
|
2202
|
-
return m.createElement("tr", { ...o });
|
|
2198
|
+
return h.createElement("select", { ...e });
|
|
2203
2199
|
}
|
|
2204
2200
|
function ia(e) {
|
|
2205
|
-
|
|
2201
|
+
const { week: t, ...o } = e;
|
|
2202
|
+
return h.createElement("tr", { ...o });
|
|
2206
2203
|
}
|
|
2207
2204
|
function ca(e) {
|
|
2208
|
-
return
|
|
2205
|
+
return h.createElement("th", { ...e });
|
|
2206
|
+
}
|
|
2207
|
+
function la(e) {
|
|
2208
|
+
return h.createElement(
|
|
2209
2209
|
"thead",
|
|
2210
2210
|
{ "aria-hidden": !0 },
|
|
2211
|
-
|
|
2211
|
+
h.createElement("tr", { ...e })
|
|
2212
2212
|
);
|
|
2213
2213
|
}
|
|
2214
|
-
function la(e) {
|
|
2215
|
-
const { week: t, ...o } = e;
|
|
2216
|
-
return m.createElement("th", { ...o });
|
|
2217
|
-
}
|
|
2218
2214
|
function ua(e) {
|
|
2219
|
-
|
|
2215
|
+
const { week: t, ...o } = e;
|
|
2216
|
+
return h.createElement("th", { ...o });
|
|
2220
2217
|
}
|
|
2221
2218
|
function da(e) {
|
|
2222
|
-
return
|
|
2219
|
+
return h.createElement("th", { ...e });
|
|
2223
2220
|
}
|
|
2224
2221
|
function fa(e) {
|
|
2225
|
-
|
|
2226
|
-
|
|
2222
|
+
return h.createElement("tbody", { ...e });
|
|
2223
|
+
}
|
|
2224
|
+
function ha(e) {
|
|
2225
|
+
const { components: t } = at();
|
|
2226
|
+
return h.createElement(t.Dropdown, { ...e });
|
|
2227
2227
|
}
|
|
2228
2228
|
const ma = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2229
2229
|
__proto__: null,
|
|
2230
|
-
Button:
|
|
2231
|
-
CaptionLabel:
|
|
2232
|
-
Chevron:
|
|
2230
|
+
Button: qr,
|
|
2231
|
+
CaptionLabel: Rr,
|
|
2232
|
+
Chevron: zr,
|
|
2233
2233
|
Day: Gr,
|
|
2234
|
-
DayButton:
|
|
2235
|
-
Dropdown:
|
|
2236
|
-
DropdownNav:
|
|
2234
|
+
DayButton: Vr,
|
|
2235
|
+
Dropdown: Xr,
|
|
2236
|
+
DropdownNav: Lr,
|
|
2237
2237
|
Footer: Qr,
|
|
2238
2238
|
Month: Ur,
|
|
2239
|
-
MonthCaption:
|
|
2239
|
+
MonthCaption: Kr,
|
|
2240
2240
|
MonthGrid: Zr,
|
|
2241
|
-
Months:
|
|
2242
|
-
MonthsDropdown:
|
|
2243
|
-
Nav:
|
|
2244
|
-
NextMonthButton:
|
|
2245
|
-
Option:
|
|
2246
|
-
PreviousMonthButton:
|
|
2247
|
-
Root:
|
|
2248
|
-
Select:
|
|
2249
|
-
Week:
|
|
2250
|
-
WeekNumber:
|
|
2251
|
-
WeekNumberHeader:
|
|
2252
|
-
Weekday:
|
|
2253
|
-
Weekdays:
|
|
2254
|
-
Weeks:
|
|
2255
|
-
YearsDropdown:
|
|
2241
|
+
Months: Jr,
|
|
2242
|
+
MonthsDropdown: ea,
|
|
2243
|
+
Nav: ta,
|
|
2244
|
+
NextMonthButton: na,
|
|
2245
|
+
Option: oa,
|
|
2246
|
+
PreviousMonthButton: ra,
|
|
2247
|
+
Root: aa,
|
|
2248
|
+
Select: sa,
|
|
2249
|
+
Week: ia,
|
|
2250
|
+
WeekNumber: ua,
|
|
2251
|
+
WeekNumberHeader: da,
|
|
2252
|
+
Weekday: ca,
|
|
2253
|
+
Weekdays: la,
|
|
2254
|
+
Weeks: fa,
|
|
2255
|
+
YearsDropdown: ha
|
|
2256
2256
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2257
|
-
function Ne(e, t, o = !1, n =
|
|
2258
|
-
let { from: r, to:
|
|
2259
|
-
const { differenceInCalendarDays:
|
|
2260
|
-
return r &&
|
|
2257
|
+
function Ne(e, t, o = !1, n = ve) {
|
|
2258
|
+
let { from: r, to: i } = e;
|
|
2259
|
+
const { differenceInCalendarDays: s, isSameDay: a } = n;
|
|
2260
|
+
return r && i ? (s(i, r) < 0 && ([r, i] = [i, r]), s(t, r) >= (o ? 1 : 0) && s(i, t) >= (o ? 1 : 0)) : !o && i ? a(i, t) : !o && r ? a(r, t) : !1;
|
|
2261
2261
|
}
|
|
2262
|
-
function
|
|
2262
|
+
function Yt(e) {
|
|
2263
2263
|
return !!(e && typeof e == "object" && "before" in e && "after" in e);
|
|
2264
2264
|
}
|
|
2265
|
-
function
|
|
2265
|
+
function dt(e) {
|
|
2266
2266
|
return !!(e && typeof e == "object" && "from" in e);
|
|
2267
2267
|
}
|
|
2268
|
-
function
|
|
2268
|
+
function Et(e) {
|
|
2269
2269
|
return !!(e && typeof e == "object" && "after" in e);
|
|
2270
2270
|
}
|
|
2271
|
-
function
|
|
2271
|
+
function Ft(e) {
|
|
2272
2272
|
return !!(e && typeof e == "object" && "before" in e);
|
|
2273
2273
|
}
|
|
2274
|
-
function
|
|
2274
|
+
function gn(e) {
|
|
2275
2275
|
return !!(e && typeof e == "object" && "dayOfWeek" in e);
|
|
2276
2276
|
}
|
|
2277
|
-
function
|
|
2277
|
+
function pn(e, t) {
|
|
2278
2278
|
return Array.isArray(e) && e.every(t.isDate);
|
|
2279
2279
|
}
|
|
2280
|
-
function Ce(e, t, o =
|
|
2281
|
-
const n = Array.isArray(t) ? t : [t], { isSameDay: r, differenceInCalendarDays:
|
|
2282
|
-
return n.some((
|
|
2283
|
-
if (typeof
|
|
2284
|
-
return
|
|
2285
|
-
if (o.isDate(
|
|
2286
|
-
return r(e,
|
|
2287
|
-
if (
|
|
2288
|
-
return
|
|
2289
|
-
if (
|
|
2290
|
-
return Ne(
|
|
2291
|
-
if (
|
|
2292
|
-
return Array.isArray(
|
|
2293
|
-
if (
|
|
2294
|
-
const c =
|
|
2295
|
-
return a
|
|
2280
|
+
function Ce(e, t, o = ve) {
|
|
2281
|
+
const n = Array.isArray(t) ? t : [t], { isSameDay: r, differenceInCalendarDays: i, isAfter: s } = o;
|
|
2282
|
+
return n.some((a) => {
|
|
2283
|
+
if (typeof a == "boolean")
|
|
2284
|
+
return a;
|
|
2285
|
+
if (o.isDate(a))
|
|
2286
|
+
return r(e, a);
|
|
2287
|
+
if (pn(a, o))
|
|
2288
|
+
return a.some((c) => r(e, c));
|
|
2289
|
+
if (dt(a))
|
|
2290
|
+
return Ne(a, e, !1, o);
|
|
2291
|
+
if (gn(a))
|
|
2292
|
+
return Array.isArray(a.dayOfWeek) ? a.dayOfWeek.includes(e.getDay()) : a.dayOfWeek === e.getDay();
|
|
2293
|
+
if (Yt(a)) {
|
|
2294
|
+
const c = i(a.before, e), l = i(a.after, e), d = c > 0, u = l < 0;
|
|
2295
|
+
return s(a.before, a.after) ? u && d : d || u;
|
|
2296
2296
|
}
|
|
2297
|
-
return
|
|
2297
|
+
return Et(a) ? i(e, a.after) > 0 : Ft(a) ? i(a.before, e) > 0 : typeof a == "function" ? a(e) : !1;
|
|
2298
2298
|
});
|
|
2299
2299
|
}
|
|
2300
|
-
function
|
|
2301
|
-
const { disabled:
|
|
2300
|
+
function ya(e, t, o, n, r) {
|
|
2301
|
+
const { disabled: i, hidden: s, modifiers: a, showOutsideDays: c, broadcastCalendar: l, today: d = r.today() } = t, { isSameDay: u, isSameMonth: f, startOfMonth: M, isBefore: w, endOfMonth: C, isAfter: W } = r, v = o && M(o), g = n && C(n), p = {
|
|
2302
2302
|
[R.focused]: [],
|
|
2303
2303
|
[R.outside]: [],
|
|
2304
2304
|
[R.disabled]: [],
|
|
@@ -2306,11 +2306,11 @@ function ha(e, t, o, n, r) {
|
|
|
2306
2306
|
[R.today]: []
|
|
2307
2307
|
}, S = {};
|
|
2308
2308
|
for (const D of e) {
|
|
2309
|
-
const { date: y, displayMonth:
|
|
2310
|
-
!
|
|
2311
|
-
x && p.outside.push(D), K && p.disabled.push(D), V && p.hidden.push(D),
|
|
2312
|
-
const me =
|
|
2313
|
-
me && Ce(y, me, r) && (S[
|
|
2309
|
+
const { date: y, displayMonth: O } = D, x = !!(O && !f(y, O)), j = !!(v && w(y, v)), F = !!(g && W(y, g)), K = !!(i && Ce(y, i, r)), V = !!(s && Ce(y, s, r)) || j || F || // Broadcast calendar will show outside days as default
|
|
2310
|
+
!l && !c && x || l && c === !1 && x, z = u(y, d);
|
|
2311
|
+
x && p.outside.push(D), K && p.disabled.push(D), V && p.hidden.push(D), z && p.today.push(D), a && Object.keys(a).forEach((_) => {
|
|
2312
|
+
const me = a?.[_];
|
|
2313
|
+
me && Ce(y, me, r) && (S[_] ? S[_].push(D) : S[_] = [D]);
|
|
2314
2314
|
});
|
|
2315
2315
|
}
|
|
2316
2316
|
return (D) => {
|
|
@@ -2320,30 +2320,30 @@ function ha(e, t, o, n, r) {
|
|
|
2320
2320
|
[R.hidden]: !1,
|
|
2321
2321
|
[R.outside]: !1,
|
|
2322
2322
|
[R.today]: !1
|
|
2323
|
-
},
|
|
2323
|
+
}, O = {};
|
|
2324
2324
|
for (const x in p) {
|
|
2325
2325
|
const j = p[x];
|
|
2326
|
-
y[x] = j.some((
|
|
2326
|
+
y[x] = j.some((F) => F === D);
|
|
2327
2327
|
}
|
|
2328
2328
|
for (const x in S)
|
|
2329
|
-
|
|
2329
|
+
O[x] = S[x].some((j) => j === D);
|
|
2330
2330
|
return {
|
|
2331
2331
|
...y,
|
|
2332
2332
|
// custom modifiers should override all the previous ones
|
|
2333
|
-
...
|
|
2333
|
+
...O
|
|
2334
2334
|
};
|
|
2335
2335
|
};
|
|
2336
2336
|
}
|
|
2337
|
-
function
|
|
2338
|
-
return Object.entries(e).filter(([, r]) => r === !0).reduce((r, [
|
|
2337
|
+
function ga(e, t, o = {}) {
|
|
2338
|
+
return Object.entries(e).filter(([, r]) => r === !0).reduce((r, [i]) => (o[i] ? r.push(o[i]) : t[R[i]] ? r.push(t[R[i]]) : t[he[i]] && r.push(t[he[i]]), r), [t[b.Day]]);
|
|
2339
2339
|
}
|
|
2340
|
-
function
|
|
2340
|
+
function pa(e) {
|
|
2341
2341
|
return {
|
|
2342
2342
|
...ma,
|
|
2343
2343
|
...e
|
|
2344
2344
|
};
|
|
2345
2345
|
}
|
|
2346
|
-
function
|
|
2346
|
+
function ba(e) {
|
|
2347
2347
|
const t = {
|
|
2348
2348
|
"data-mode": e.mode ?? void 0,
|
|
2349
2349
|
"data-required": "required" in e ? e.required : void 0,
|
|
@@ -2356,137 +2356,137 @@ function pa(e) {
|
|
|
2356
2356
|
o.startsWith("data-") && (t[o] = n);
|
|
2357
2357
|
}), t;
|
|
2358
2358
|
}
|
|
2359
|
-
function
|
|
2359
|
+
function wa() {
|
|
2360
2360
|
const e = {};
|
|
2361
2361
|
for (const t in b)
|
|
2362
2362
|
e[b[t]] = `rdp-${b[t]}`;
|
|
2363
2363
|
for (const t in R)
|
|
2364
2364
|
e[R[t]] = `rdp-${R[t]}`;
|
|
2365
|
-
for (const t in
|
|
2366
|
-
e[
|
|
2367
|
-
for (const t in
|
|
2368
|
-
e[
|
|
2365
|
+
for (const t in he)
|
|
2366
|
+
e[he[t]] = `rdp-${he[t]}`;
|
|
2367
|
+
for (const t in se)
|
|
2368
|
+
e[se[t]] = `rdp-${se[t]}`;
|
|
2369
2369
|
return e;
|
|
2370
2370
|
}
|
|
2371
|
-
function
|
|
2372
|
-
return (o ?? new
|
|
2371
|
+
function bn(e, t, o) {
|
|
2372
|
+
return (o ?? new ce(t)).formatMonthYear(e);
|
|
2373
2373
|
}
|
|
2374
|
-
const
|
|
2375
|
-
function
|
|
2376
|
-
return (o ?? new
|
|
2374
|
+
const Ma = bn;
|
|
2375
|
+
function Da(e, t, o) {
|
|
2376
|
+
return (o ?? new ce(t)).format(e, "d");
|
|
2377
2377
|
}
|
|
2378
|
-
function
|
|
2378
|
+
function va(e, t = ve) {
|
|
2379
2379
|
return t.format(e, "LLLL");
|
|
2380
2380
|
}
|
|
2381
|
-
function
|
|
2382
|
-
return (o ?? new
|
|
2381
|
+
function ka(e, t, o) {
|
|
2382
|
+
return (o ?? new ce(t)).format(e, "cccccc");
|
|
2383
2383
|
}
|
|
2384
|
-
function
|
|
2384
|
+
function Oa(e, t = ve) {
|
|
2385
2385
|
return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
|
|
2386
2386
|
}
|
|
2387
|
-
function
|
|
2387
|
+
function Wa() {
|
|
2388
2388
|
return "";
|
|
2389
2389
|
}
|
|
2390
|
-
function
|
|
2390
|
+
function wn(e, t = ve) {
|
|
2391
2391
|
return t.format(e, "yyyy");
|
|
2392
2392
|
}
|
|
2393
|
-
const
|
|
2393
|
+
const Sa = wn, Na = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2394
2394
|
__proto__: null,
|
|
2395
|
-
formatCaption:
|
|
2396
|
-
formatDay:
|
|
2397
|
-
formatMonthCaption:
|
|
2398
|
-
formatMonthDropdown:
|
|
2399
|
-
formatWeekNumber:
|
|
2400
|
-
formatWeekNumberHeader:
|
|
2401
|
-
formatWeekdayName:
|
|
2402
|
-
formatYearCaption:
|
|
2403
|
-
formatYearDropdown:
|
|
2395
|
+
formatCaption: bn,
|
|
2396
|
+
formatDay: Da,
|
|
2397
|
+
formatMonthCaption: Ma,
|
|
2398
|
+
formatMonthDropdown: va,
|
|
2399
|
+
formatWeekNumber: Oa,
|
|
2400
|
+
formatWeekNumberHeader: Wa,
|
|
2401
|
+
formatWeekdayName: ka,
|
|
2402
|
+
formatYearCaption: Sa,
|
|
2403
|
+
formatYearDropdown: wn
|
|
2404
2404
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2405
|
-
function
|
|
2405
|
+
function Ca(e) {
|
|
2406
2406
|
return e?.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e?.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
|
|
2407
|
-
...
|
|
2407
|
+
...Na,
|
|
2408
2408
|
...e
|
|
2409
2409
|
};
|
|
2410
2410
|
}
|
|
2411
|
-
function
|
|
2412
|
-
let r = (n ?? new
|
|
2411
|
+
function _t(e, t, o, n) {
|
|
2412
|
+
let r = (n ?? new ce(o)).format(e, "PPPP");
|
|
2413
2413
|
return t.today && (r = `Today, ${r}`), t.selected && (r = `${r}, selected`), r;
|
|
2414
2414
|
}
|
|
2415
|
-
const
|
|
2416
|
-
function
|
|
2417
|
-
return (o ?? new
|
|
2415
|
+
const xa = _t;
|
|
2416
|
+
function It(e, t, o) {
|
|
2417
|
+
return (o ?? new ce(t)).formatMonthYear(e);
|
|
2418
2418
|
}
|
|
2419
|
-
const
|
|
2420
|
-
function
|
|
2421
|
-
let r = (n ?? new
|
|
2419
|
+
const Pa = It;
|
|
2420
|
+
function Mn(e, t, o, n) {
|
|
2421
|
+
let r = (n ?? new ce(o)).format(e, "PPPP");
|
|
2422
2422
|
return t?.today && (r = `Today, ${r}`), r;
|
|
2423
2423
|
}
|
|
2424
|
-
function
|
|
2424
|
+
function Dn(e) {
|
|
2425
2425
|
return "Choose the Month";
|
|
2426
2426
|
}
|
|
2427
|
-
function
|
|
2427
|
+
function vn() {
|
|
2428
2428
|
return "";
|
|
2429
2429
|
}
|
|
2430
|
-
const
|
|
2431
|
-
function
|
|
2432
|
-
return
|
|
2430
|
+
const Ta = "Go to the Next Month";
|
|
2431
|
+
function kn(e, t) {
|
|
2432
|
+
return Ta;
|
|
2433
2433
|
}
|
|
2434
|
-
function
|
|
2434
|
+
function On(e) {
|
|
2435
2435
|
return "Go to the Previous Month";
|
|
2436
2436
|
}
|
|
2437
|
-
function
|
|
2438
|
-
return (o ?? new
|
|
2437
|
+
function Wn(e, t, o) {
|
|
2438
|
+
return (o ?? new ce(t)).format(e, "cccc");
|
|
2439
2439
|
}
|
|
2440
|
-
function
|
|
2440
|
+
function Sn(e, t) {
|
|
2441
2441
|
return `Week ${e}`;
|
|
2442
2442
|
}
|
|
2443
|
-
function
|
|
2443
|
+
function Nn(e) {
|
|
2444
2444
|
return "Week Number";
|
|
2445
2445
|
}
|
|
2446
|
-
function
|
|
2446
|
+
function Cn(e) {
|
|
2447
2447
|
return "Choose the Year";
|
|
2448
2448
|
}
|
|
2449
|
-
const
|
|
2449
|
+
const Ya = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2450
2450
|
__proto__: null,
|
|
2451
|
-
labelCaption:
|
|
2452
|
-
labelDay:
|
|
2453
|
-
labelDayButton:
|
|
2454
|
-
labelGrid:
|
|
2455
|
-
labelGridcell:
|
|
2456
|
-
labelMonthDropdown:
|
|
2457
|
-
labelNav:
|
|
2458
|
-
labelNext:
|
|
2459
|
-
labelPrevious:
|
|
2460
|
-
labelWeekNumber:
|
|
2461
|
-
labelWeekNumberHeader:
|
|
2462
|
-
labelWeekday:
|
|
2463
|
-
labelYearDropdown:
|
|
2464
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2465
|
-
function
|
|
2451
|
+
labelCaption: Pa,
|
|
2452
|
+
labelDay: xa,
|
|
2453
|
+
labelDayButton: _t,
|
|
2454
|
+
labelGrid: It,
|
|
2455
|
+
labelGridcell: Mn,
|
|
2456
|
+
labelMonthDropdown: Dn,
|
|
2457
|
+
labelNav: vn,
|
|
2458
|
+
labelNext: kn,
|
|
2459
|
+
labelPrevious: On,
|
|
2460
|
+
labelWeekNumber: Sn,
|
|
2461
|
+
labelWeekNumberHeader: Nn,
|
|
2462
|
+
labelWeekday: Wn,
|
|
2463
|
+
labelYearDropdown: Cn
|
|
2464
|
+
}, Symbol.toStringTag, { value: "Module" })), fe = (e, t, o) => t || (o ? typeof o == "function" ? o : (...n) => o : e);
|
|
2465
|
+
function Ea(e, t) {
|
|
2466
2466
|
const o = t.locale?.labels ?? {};
|
|
2467
2467
|
return {
|
|
2468
|
-
...
|
|
2468
|
+
...Ya,
|
|
2469
2469
|
...e ?? {},
|
|
2470
|
-
labelDayButton:
|
|
2471
|
-
labelMonthDropdown:
|
|
2472
|
-
labelNext:
|
|
2473
|
-
labelPrevious:
|
|
2474
|
-
labelWeekNumber:
|
|
2475
|
-
labelYearDropdown:
|
|
2476
|
-
labelGrid:
|
|
2477
|
-
labelGridcell:
|
|
2478
|
-
labelNav:
|
|
2479
|
-
labelWeekNumberHeader:
|
|
2480
|
-
labelWeekday:
|
|
2470
|
+
labelDayButton: fe(_t, e?.labelDayButton, o.labelDayButton),
|
|
2471
|
+
labelMonthDropdown: fe(Dn, e?.labelMonthDropdown, o.labelMonthDropdown),
|
|
2472
|
+
labelNext: fe(kn, e?.labelNext, o.labelNext),
|
|
2473
|
+
labelPrevious: fe(On, e?.labelPrevious, o.labelPrevious),
|
|
2474
|
+
labelWeekNumber: fe(Sn, e?.labelWeekNumber, o.labelWeekNumber),
|
|
2475
|
+
labelYearDropdown: fe(Cn, e?.labelYearDropdown, o.labelYearDropdown),
|
|
2476
|
+
labelGrid: fe(It, e?.labelGrid, o.labelGrid),
|
|
2477
|
+
labelGridcell: fe(Mn, e?.labelGridcell, o.labelGridcell),
|
|
2478
|
+
labelNav: fe(vn, e?.labelNav, o.labelNav),
|
|
2479
|
+
labelWeekNumberHeader: fe(Nn, e?.labelWeekNumberHeader, o.labelWeekNumberHeader),
|
|
2480
|
+
labelWeekday: fe(Wn, e?.labelWeekday, o.labelWeekday)
|
|
2481
2481
|
};
|
|
2482
2482
|
}
|
|
2483
|
-
function
|
|
2484
|
-
const { startOfMonth:
|
|
2483
|
+
function Fa(e, t, o, n, r) {
|
|
2484
|
+
const { startOfMonth: i, startOfYear: s, endOfYear: a, eachMonthOfInterval: c, getMonth: l } = r;
|
|
2485
2485
|
return c({
|
|
2486
|
-
start:
|
|
2487
|
-
end:
|
|
2488
|
-
}).map((
|
|
2489
|
-
const M = n.formatMonthDropdown(
|
|
2486
|
+
start: s(e),
|
|
2487
|
+
end: a(e)
|
|
2488
|
+
}).map((f) => {
|
|
2489
|
+
const M = n.formatMonthDropdown(f, r), w = l(f), C = t && f < i(t) || o && f > i(o) || !1;
|
|
2490
2490
|
return { value: w, label: M, disabled: C };
|
|
2491
2491
|
});
|
|
2492
2492
|
}
|
|
@@ -2499,206 +2499,301 @@ function _a(e, t = {}, o = {}) {
|
|
|
2499
2499
|
};
|
|
2500
2500
|
}), n;
|
|
2501
2501
|
}
|
|
2502
|
-
function
|
|
2503
|
-
const r = n ?? e.today(),
|
|
2504
|
-
for (let
|
|
2505
|
-
const c = e.addDays(
|
|
2506
|
-
|
|
2502
|
+
function Ia(e, t, o, n) {
|
|
2503
|
+
const r = n ?? e.today(), i = o ? e.startOfBroadcastWeek(r, e) : t ? e.startOfISOWeek(r) : e.startOfWeek(r), s = [];
|
|
2504
|
+
for (let a = 0; a < 7; a++) {
|
|
2505
|
+
const c = e.addDays(i, a);
|
|
2506
|
+
s.push(c);
|
|
2507
2507
|
}
|
|
2508
|
-
return
|
|
2508
|
+
return s;
|
|
2509
2509
|
}
|
|
2510
|
-
function
|
|
2510
|
+
function Ba(e, t, o, n, r = !1) {
|
|
2511
2511
|
if (!e || !t)
|
|
2512
2512
|
return;
|
|
2513
|
-
const { startOfYear:
|
|
2514
|
-
return r &&
|
|
2515
|
-
const M = o.formatYearDropdown(
|
|
2513
|
+
const { startOfYear: i, endOfYear: s, eachYearOfInterval: a, getYear: c } = n, l = i(e), d = s(t), u = a({ start: l, end: d });
|
|
2514
|
+
return r && u.reverse(), u.map((f) => {
|
|
2515
|
+
const M = o.formatYearDropdown(f, n);
|
|
2516
2516
|
return {
|
|
2517
|
-
value: c(
|
|
2517
|
+
value: c(f),
|
|
2518
2518
|
label: M,
|
|
2519
2519
|
disabled: !1
|
|
2520
2520
|
};
|
|
2521
2521
|
});
|
|
2522
2522
|
}
|
|
2523
|
-
|
|
2523
|
+
function ja(e, t = {}) {
|
|
2524
|
+
const { weekStartsOn: o, locale: n } = t, r = o ?? n?.options?.weekStartsOn ?? 0, i = (a) => {
|
|
2525
|
+
const c = typeof a == "number" || typeof a == "string" ? new Date(a) : a;
|
|
2526
|
+
return new J(c.getFullYear(), c.getMonth(), c.getDate(), 12, 0, 0, e);
|
|
2527
|
+
}, s = (a) => {
|
|
2528
|
+
const c = i(a);
|
|
2529
|
+
return new Date(c.getFullYear(), c.getMonth(), c.getDate(), 0, 0, 0, 0);
|
|
2530
|
+
};
|
|
2531
|
+
return {
|
|
2532
|
+
today: () => i(J.tz(e)),
|
|
2533
|
+
newDate: (a, c, l) => new J(a, c, l, 12, 0, 0, e),
|
|
2534
|
+
startOfDay: (a) => i(a),
|
|
2535
|
+
startOfWeek: (a, c) => {
|
|
2536
|
+
const l = i(a), d = c?.weekStartsOn ?? r, u = (l.getDay() - d + 7) % 7;
|
|
2537
|
+
return l.setDate(l.getDate() - u), l;
|
|
2538
|
+
},
|
|
2539
|
+
startOfISOWeek: (a) => {
|
|
2540
|
+
const c = i(a), l = (c.getDay() - 1 + 7) % 7;
|
|
2541
|
+
return c.setDate(c.getDate() - l), c;
|
|
2542
|
+
},
|
|
2543
|
+
startOfMonth: (a) => {
|
|
2544
|
+
const c = i(a);
|
|
2545
|
+
return c.setDate(1), c;
|
|
2546
|
+
},
|
|
2547
|
+
startOfYear: (a) => {
|
|
2548
|
+
const c = i(a);
|
|
2549
|
+
return c.setMonth(0, 1), c;
|
|
2550
|
+
},
|
|
2551
|
+
endOfWeek: (a, c) => {
|
|
2552
|
+
const l = i(a), f = (((c?.weekStartsOn ?? r) + 6) % 7 - l.getDay() + 7) % 7;
|
|
2553
|
+
return l.setDate(l.getDate() + f), l;
|
|
2554
|
+
},
|
|
2555
|
+
endOfISOWeek: (a) => {
|
|
2556
|
+
const c = i(a), l = (7 - c.getDay()) % 7;
|
|
2557
|
+
return c.setDate(c.getDate() + l), c;
|
|
2558
|
+
},
|
|
2559
|
+
endOfMonth: (a) => {
|
|
2560
|
+
const c = i(a);
|
|
2561
|
+
return c.setMonth(c.getMonth() + 1, 0), c;
|
|
2562
|
+
},
|
|
2563
|
+
endOfYear: (a) => {
|
|
2564
|
+
const c = i(a);
|
|
2565
|
+
return c.setMonth(11, 31), c;
|
|
2566
|
+
},
|
|
2567
|
+
eachMonthOfInterval: (a) => {
|
|
2568
|
+
const c = i(a.start), l = i(a.end), d = [], u = new J(c.getFullYear(), c.getMonth(), 1, 12, 0, 0, e), f = l.getFullYear() * 12 + l.getMonth();
|
|
2569
|
+
for (; u.getFullYear() * 12 + u.getMonth() <= f; )
|
|
2570
|
+
d.push(new J(u, e)), u.setMonth(u.getMonth() + 1, 1);
|
|
2571
|
+
return d;
|
|
2572
|
+
},
|
|
2573
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
2574
|
+
// mutate the same TZDate, and return it.
|
|
2575
|
+
addDays: (a, c) => {
|
|
2576
|
+
const l = i(a);
|
|
2577
|
+
return l.setDate(l.getDate() + c), l;
|
|
2578
|
+
},
|
|
2579
|
+
addWeeks: (a, c) => {
|
|
2580
|
+
const l = i(a);
|
|
2581
|
+
return l.setDate(l.getDate() + c * 7), l;
|
|
2582
|
+
},
|
|
2583
|
+
addMonths: (a, c) => {
|
|
2584
|
+
const l = i(a);
|
|
2585
|
+
return l.setMonth(l.getMonth() + c), l;
|
|
2586
|
+
},
|
|
2587
|
+
addYears: (a, c) => {
|
|
2588
|
+
const l = i(a);
|
|
2589
|
+
return l.setFullYear(l.getFullYear() + c), l;
|
|
2590
|
+
},
|
|
2591
|
+
eachYearOfInterval: (a) => {
|
|
2592
|
+
const c = i(a.start), l = i(a.end), d = [], u = new J(c.getFullYear(), 0, 1, 12, 0, 0, e);
|
|
2593
|
+
for (; u.getFullYear() <= l.getFullYear(); )
|
|
2594
|
+
d.push(new J(u, e)), u.setFullYear(u.getFullYear() + 1, 0, 1);
|
|
2595
|
+
return d;
|
|
2596
|
+
},
|
|
2597
|
+
getWeek: (a, c) => {
|
|
2598
|
+
const l = s(a);
|
|
2599
|
+
return Tt(l, {
|
|
2600
|
+
weekStartsOn: c?.weekStartsOn ?? r,
|
|
2601
|
+
firstWeekContainsDate: c?.firstWeekContainsDate ?? n?.options?.firstWeekContainsDate ?? 1
|
|
2602
|
+
});
|
|
2603
|
+
},
|
|
2604
|
+
getISOWeek: (a) => {
|
|
2605
|
+
const c = s(a);
|
|
2606
|
+
return Pt(c);
|
|
2607
|
+
},
|
|
2608
|
+
differenceInCalendarDays: (a, c) => {
|
|
2609
|
+
const l = s(a), d = s(c);
|
|
2610
|
+
return xt(l, d);
|
|
2611
|
+
},
|
|
2612
|
+
differenceInCalendarMonths: (a, c) => {
|
|
2613
|
+
const l = s(a), d = s(c);
|
|
2614
|
+
return rn(l, d);
|
|
2615
|
+
}
|
|
2616
|
+
};
|
|
2617
|
+
}
|
|
2618
|
+
const st = (e) => e instanceof HTMLElement ? e : null, vt = (e) => [
|
|
2524
2619
|
...e.querySelectorAll("[data-animated-month]") ?? []
|
|
2525
|
-
],
|
|
2526
|
-
function
|
|
2527
|
-
const
|
|
2528
|
-
|
|
2529
|
-
const
|
|
2530
|
-
if (
|
|
2620
|
+
], $a = (e) => st(e.querySelector("[data-animated-month]")), kt = (e) => st(e.querySelector("[data-animated-caption]")), Ot = (e) => st(e.querySelector("[data-animated-weeks]")), Aa = (e) => st(e.querySelector("[data-animated-nav]")), Ha = (e) => st(e.querySelector("[data-animated-weekdays]"));
|
|
2621
|
+
function qa(e, t, { classNames: o, months: n, focused: r, dateLib: i }) {
|
|
2622
|
+
const s = Ee(null), a = Ee(n), c = Ee(!1);
|
|
2623
|
+
En(() => {
|
|
2624
|
+
const l = a.current;
|
|
2625
|
+
if (a.current = n, !t || !e.current || // safety check because the ref can be set to anything by consumers
|
|
2531
2626
|
!(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
|
|
2532
|
-
n.length === 0 ||
|
|
2627
|
+
n.length === 0 || l.length === 0 || n.length !== l.length)
|
|
2533
2628
|
return;
|
|
2534
|
-
const
|
|
2535
|
-
if (C instanceof HTMLElement ? (
|
|
2629
|
+
const d = i.isSameMonth(n[0].date, l[0].date), u = i.isAfter(n[0].date, l[0].date), f = u ? o[se.caption_after_enter] : o[se.caption_before_enter], M = u ? o[se.weeks_after_enter] : o[se.weeks_before_enter], w = s.current, C = e.current.cloneNode(!0);
|
|
2630
|
+
if (C instanceof HTMLElement ? (vt(C).forEach((p) => {
|
|
2536
2631
|
if (!(p instanceof HTMLElement))
|
|
2537
2632
|
return;
|
|
2538
|
-
const S =
|
|
2633
|
+
const S = $a(p);
|
|
2539
2634
|
S && p.contains(S) && p.removeChild(S);
|
|
2540
|
-
const D =
|
|
2541
|
-
D && D.classList.remove(
|
|
2542
|
-
const y =
|
|
2635
|
+
const D = kt(p);
|
|
2636
|
+
D && D.classList.remove(f);
|
|
2637
|
+
const y = Ot(p);
|
|
2543
2638
|
y && y.classList.remove(M);
|
|
2544
|
-
}),
|
|
2639
|
+
}), s.current = C) : s.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
|
|
2545
2640
|
r)
|
|
2546
2641
|
return;
|
|
2547
|
-
const
|
|
2548
|
-
if (v?.every((g) => g instanceof HTMLElement) &&
|
|
2642
|
+
const W = w instanceof HTMLElement ? vt(w) : [], v = vt(e.current);
|
|
2643
|
+
if (v?.every((g) => g instanceof HTMLElement) && W && W.every((g) => g instanceof HTMLElement)) {
|
|
2549
2644
|
c.current = !0, e.current.style.isolation = "isolate";
|
|
2550
|
-
const g =
|
|
2645
|
+
const g = Aa(e.current);
|
|
2551
2646
|
g && (g.style.zIndex = "1"), v.forEach((p, S) => {
|
|
2552
|
-
const D =
|
|
2647
|
+
const D = W[S];
|
|
2553
2648
|
if (!D)
|
|
2554
2649
|
return;
|
|
2555
2650
|
p.style.position = "relative", p.style.overflow = "hidden";
|
|
2556
|
-
const y =
|
|
2557
|
-
y && y.classList.add(
|
|
2558
|
-
const
|
|
2559
|
-
|
|
2651
|
+
const y = kt(p);
|
|
2652
|
+
y && y.classList.add(f);
|
|
2653
|
+
const O = Ot(p);
|
|
2654
|
+
O && O.classList.add(M);
|
|
2560
2655
|
const x = () => {
|
|
2561
|
-
c.current = !1, e.current && (e.current.style.isolation = ""), g && (g.style.zIndex = ""), y && y.classList.remove(
|
|
2656
|
+
c.current = !1, e.current && (e.current.style.isolation = ""), g && (g.style.zIndex = ""), y && y.classList.remove(f), O && O.classList.remove(M), p.style.position = "", p.style.overflow = "", p.contains(D) && p.removeChild(D);
|
|
2562
2657
|
};
|
|
2563
2658
|
D.style.pointerEvents = "none", D.style.position = "absolute", D.style.overflow = "hidden", D.setAttribute("aria-hidden", "true");
|
|
2564
|
-
const j =
|
|
2659
|
+
const j = Ha(D);
|
|
2565
2660
|
j && (j.style.opacity = "0");
|
|
2566
|
-
const
|
|
2567
|
-
|
|
2568
|
-
const K =
|
|
2569
|
-
K && K.classList.add(
|
|
2661
|
+
const F = kt(D);
|
|
2662
|
+
F && (F.classList.add(u ? o[se.caption_before_exit] : o[se.caption_after_exit]), F.addEventListener("animationend", x));
|
|
2663
|
+
const K = Ot(D);
|
|
2664
|
+
K && K.classList.add(u ? o[se.weeks_before_exit] : o[se.weeks_after_exit]), p.insertBefore(D, p.firstChild);
|
|
2570
2665
|
});
|
|
2571
2666
|
}
|
|
2572
2667
|
});
|
|
2573
2668
|
}
|
|
2574
|
-
function
|
|
2575
|
-
const r = e[0],
|
|
2576
|
-
for (let
|
|
2577
|
-
const
|
|
2578
|
-
|
|
2669
|
+
function Ra(e, t, o, n) {
|
|
2670
|
+
const r = e[0], i = e[e.length - 1], { ISOWeek: s, fixedWeeks: a, broadcastCalendar: c } = o ?? {}, { addDays: l, differenceInCalendarDays: d, differenceInCalendarMonths: u, endOfBroadcastWeek: f, endOfISOWeek: M, endOfMonth: w, endOfWeek: C, isAfter: W, startOfBroadcastWeek: v, startOfISOWeek: g, startOfWeek: p } = n, S = c ? v(r, n) : s ? g(r) : p(r), D = c ? f(i) : s ? M(w(i)) : C(w(i)), y = t && (c ? f(t) : s ? M(t) : C(t)), O = y && W(D, y) ? y : D, x = d(O, S), j = u(i, r) + 1, F = [];
|
|
2671
|
+
for (let z = 0; z <= x; z++) {
|
|
2672
|
+
const _ = l(S, z);
|
|
2673
|
+
F.push(_);
|
|
2579
2674
|
}
|
|
2580
2675
|
const V = (c ? 35 : 42) * j;
|
|
2581
|
-
if (
|
|
2582
|
-
const
|
|
2583
|
-
for (let
|
|
2584
|
-
const me =
|
|
2585
|
-
|
|
2676
|
+
if (a && F.length < V) {
|
|
2677
|
+
const z = V - F.length;
|
|
2678
|
+
for (let _ = 0; _ < z; _++) {
|
|
2679
|
+
const me = l(F[F.length - 1], 1);
|
|
2680
|
+
F.push(me);
|
|
2586
2681
|
}
|
|
2587
2682
|
}
|
|
2588
|
-
return
|
|
2683
|
+
return F;
|
|
2589
2684
|
}
|
|
2590
|
-
function
|
|
2685
|
+
function za(e) {
|
|
2591
2686
|
const t = [];
|
|
2592
2687
|
return e.reduce((o, n) => {
|
|
2593
|
-
const r = n.weeks.reduce((
|
|
2688
|
+
const r = n.weeks.reduce((i, s) => i.concat(s.days.slice()), t.slice());
|
|
2594
2689
|
return o.concat(r.slice());
|
|
2595
2690
|
}, t.slice());
|
|
2596
2691
|
}
|
|
2597
|
-
function
|
|
2598
|
-
const { numberOfMonths: r = 1 } = o,
|
|
2599
|
-
for (let
|
|
2600
|
-
const
|
|
2601
|
-
if (t &&
|
|
2692
|
+
function Ga(e, t, o, n) {
|
|
2693
|
+
const { numberOfMonths: r = 1 } = o, i = [];
|
|
2694
|
+
for (let s = 0; s < r; s++) {
|
|
2695
|
+
const a = n.addMonths(e, s);
|
|
2696
|
+
if (t && a > t)
|
|
2602
2697
|
break;
|
|
2603
|
-
|
|
2698
|
+
i.push(a);
|
|
2604
2699
|
}
|
|
2605
|
-
return
|
|
2606
|
-
}
|
|
2607
|
-
function
|
|
2608
|
-
const { month: r, defaultMonth:
|
|
2609
|
-
let c = r ||
|
|
2610
|
-
const { differenceInCalendarMonths:
|
|
2611
|
-
if (o &&
|
|
2612
|
-
const
|
|
2613
|
-
c =
|
|
2700
|
+
return i;
|
|
2701
|
+
}
|
|
2702
|
+
function Lt(e, t, o, n) {
|
|
2703
|
+
const { month: r, defaultMonth: i, today: s = n.today(), numberOfMonths: a = 1 } = e;
|
|
2704
|
+
let c = r || i || s;
|
|
2705
|
+
const { differenceInCalendarMonths: l, addMonths: d, startOfMonth: u } = n;
|
|
2706
|
+
if (o && l(o, c) < a - 1) {
|
|
2707
|
+
const f = -1 * (a - 1);
|
|
2708
|
+
c = d(o, f);
|
|
2614
2709
|
}
|
|
2615
|
-
return t &&
|
|
2710
|
+
return t && l(c, t) < 0 && (c = t), u(c);
|
|
2616
2711
|
}
|
|
2617
|
-
function
|
|
2618
|
-
const { addDays: r, endOfBroadcastWeek:
|
|
2619
|
-
const v = o.broadcastCalendar ?
|
|
2712
|
+
function Va(e, t, o, n) {
|
|
2713
|
+
const { addDays: r, endOfBroadcastWeek: i, endOfISOWeek: s, endOfMonth: a, endOfWeek: c, getISOWeek: l, getWeek: d, startOfBroadcastWeek: u, startOfISOWeek: f, startOfWeek: M } = n, w = e.reduce((C, W) => {
|
|
2714
|
+
const v = o.broadcastCalendar ? u(W, n) : o.ISOWeek ? f(W) : M(W), g = o.broadcastCalendar ? i(W) : o.ISOWeek ? s(a(W)) : c(a(W)), p = t.filter((O) => O >= v && O <= g), S = o.broadcastCalendar ? 35 : 42;
|
|
2620
2715
|
if (o.fixedWeeks && p.length < S) {
|
|
2621
|
-
const
|
|
2716
|
+
const O = t.filter((x) => {
|
|
2622
2717
|
const j = S - p.length;
|
|
2623
2718
|
return x > g && x <= r(g, j);
|
|
2624
2719
|
});
|
|
2625
|
-
p.push(...
|
|
2720
|
+
p.push(...O);
|
|
2626
2721
|
}
|
|
2627
|
-
const D = p.reduce((
|
|
2628
|
-
const j = o.ISOWeek ?
|
|
2629
|
-
return
|
|
2630
|
-
}, []), y = new
|
|
2722
|
+
const D = p.reduce((O, x) => {
|
|
2723
|
+
const j = o.ISOWeek ? l(x) : d(x), F = O.find((V) => V.weekNumber === j), K = new mn(x, W, n);
|
|
2724
|
+
return F ? F.days.push(K) : O.push(new Hr(j, [K])), O;
|
|
2725
|
+
}, []), y = new Ar(W, D);
|
|
2631
2726
|
return C.push(y), C;
|
|
2632
2727
|
}, []);
|
|
2633
2728
|
return o.reverseMonths ? w.reverse() : w;
|
|
2634
2729
|
}
|
|
2635
|
-
function
|
|
2730
|
+
function Xa(e, t) {
|
|
2636
2731
|
let { startMonth: o, endMonth: n } = e;
|
|
2637
|
-
const { startOfYear: r, startOfDay:
|
|
2638
|
-
!o && w && (o = w), !o &&
|
|
2639
|
-
const
|
|
2640
|
-
return o ? o =
|
|
2641
|
-
o &&
|
|
2642
|
-
n &&
|
|
2732
|
+
const { startOfYear: r, startOfDay: i, startOfMonth: s, endOfMonth: a, addYears: c, endOfYear: l, newDate: d, today: u } = t, { fromYear: f, toYear: M, fromMonth: w, toMonth: C } = e;
|
|
2733
|
+
!o && w && (o = w), !o && f && (o = t.newDate(f, 0, 1)), !n && C && (n = C), !n && M && (n = d(M, 11, 31));
|
|
2734
|
+
const W = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
|
|
2735
|
+
return o ? o = s(o) : f ? o = d(f, 0, 1) : !o && W && (o = r(c(e.today ?? u(), -100))), n ? n = a(n) : M ? n = d(M, 11, 31) : !n && W && (n = l(e.today ?? u())), [
|
|
2736
|
+
o && i(o),
|
|
2737
|
+
n && i(n)
|
|
2643
2738
|
];
|
|
2644
2739
|
}
|
|
2645
|
-
function
|
|
2740
|
+
function La(e, t, o, n) {
|
|
2646
2741
|
if (o.disableNavigation)
|
|
2647
2742
|
return;
|
|
2648
|
-
const { pagedNavigation: r, numberOfMonths:
|
|
2743
|
+
const { pagedNavigation: r, numberOfMonths: i = 1 } = o, { startOfMonth: s, addMonths: a, differenceInCalendarMonths: c } = n, l = r ? i : 1, d = s(e);
|
|
2649
2744
|
if (!t)
|
|
2650
|
-
return
|
|
2651
|
-
if (!(c(t, e) <
|
|
2652
|
-
return
|
|
2745
|
+
return a(d, l);
|
|
2746
|
+
if (!(c(t, e) < i))
|
|
2747
|
+
return a(d, l);
|
|
2653
2748
|
}
|
|
2654
|
-
function
|
|
2749
|
+
function Qa(e, t, o, n) {
|
|
2655
2750
|
if (o.disableNavigation)
|
|
2656
2751
|
return;
|
|
2657
|
-
const { pagedNavigation: r, numberOfMonths:
|
|
2752
|
+
const { pagedNavigation: r, numberOfMonths: i } = o, { startOfMonth: s, addMonths: a, differenceInCalendarMonths: c } = n, l = r ? i ?? 1 : 1, d = s(e);
|
|
2658
2753
|
if (!t)
|
|
2659
|
-
return
|
|
2660
|
-
if (!(c(
|
|
2661
|
-
return
|
|
2754
|
+
return a(d, -l);
|
|
2755
|
+
if (!(c(d, t) <= 0))
|
|
2756
|
+
return a(d, -l);
|
|
2662
2757
|
}
|
|
2663
|
-
function
|
|
2758
|
+
function Ua(e) {
|
|
2664
2759
|
const t = [];
|
|
2665
2760
|
return e.reduce((o, n) => o.concat(n.weeks.slice()), t.slice());
|
|
2666
2761
|
}
|
|
2667
|
-
function
|
|
2668
|
-
const [o, n] =
|
|
2762
|
+
function ft(e, t) {
|
|
2763
|
+
const [o, n] = Se(e);
|
|
2669
2764
|
return [t === void 0 ? o : t, n];
|
|
2670
2765
|
}
|
|
2671
|
-
function
|
|
2672
|
-
const [o, n] =
|
|
2673
|
-
|
|
2766
|
+
function Ka(e, t) {
|
|
2767
|
+
const [o, n] = Xa(e, t), { startOfMonth: r, endOfMonth: i } = t, s = Lt(e, o, n, t), [a, c] = ft(
|
|
2768
|
+
s,
|
|
2674
2769
|
// initialMonth is always computed from props.month if provided
|
|
2675
|
-
e.month ?
|
|
2770
|
+
e.month ? s : void 0
|
|
2676
2771
|
);
|
|
2677
|
-
|
|
2678
|
-
const S =
|
|
2772
|
+
_e(() => {
|
|
2773
|
+
const S = Lt(e, o, n, t);
|
|
2679
2774
|
c(S);
|
|
2680
2775
|
}, [e.timeZone]);
|
|
2681
|
-
const { months:
|
|
2682
|
-
const S =
|
|
2776
|
+
const { months: l, weeks: d, days: u, previousMonth: f, nextMonth: M } = ie(() => {
|
|
2777
|
+
const S = Ga(a, n, { numberOfMonths: e.numberOfMonths }, t), D = Ra(S, e.endMonth ? i(e.endMonth) : void 0, {
|
|
2683
2778
|
ISOWeek: e.ISOWeek,
|
|
2684
2779
|
fixedWeeks: e.fixedWeeks,
|
|
2685
2780
|
broadcastCalendar: e.broadcastCalendar
|
|
2686
|
-
}, t), y =
|
|
2781
|
+
}, t), y = Va(S, D, {
|
|
2687
2782
|
broadcastCalendar: e.broadcastCalendar,
|
|
2688
2783
|
fixedWeeks: e.fixedWeeks,
|
|
2689
2784
|
ISOWeek: e.ISOWeek,
|
|
2690
2785
|
reverseMonths: e.reverseMonths
|
|
2691
|
-
}, t),
|
|
2786
|
+
}, t), O = Ua(y), x = za(y), j = Qa(a, o, e, t), F = La(a, n, e, t);
|
|
2692
2787
|
return {
|
|
2693
2788
|
months: y,
|
|
2694
|
-
weeks:
|
|
2789
|
+
weeks: O,
|
|
2695
2790
|
days: x,
|
|
2696
2791
|
previousMonth: j,
|
|
2697
|
-
nextMonth:
|
|
2792
|
+
nextMonth: F
|
|
2698
2793
|
};
|
|
2699
2794
|
}, [
|
|
2700
2795
|
t,
|
|
2701
|
-
|
|
2796
|
+
a.getTime(),
|
|
2702
2797
|
n?.getTime(),
|
|
2703
2798
|
o?.getTime(),
|
|
2704
2799
|
e.disableNavigation,
|
|
@@ -2709,178 +2804,178 @@ function Ua(e, t) {
|
|
|
2709
2804
|
e.numberOfMonths,
|
|
2710
2805
|
e.pagedNavigation,
|
|
2711
2806
|
e.reverseMonths
|
|
2712
|
-
]), { disableNavigation: w, onMonthChange: C } = e,
|
|
2807
|
+
]), { disableNavigation: w, onMonthChange: C } = e, W = (S) => d.some((D) => D.days.some((y) => y.isEqualTo(S))), v = (S) => {
|
|
2713
2808
|
if (w)
|
|
2714
2809
|
return;
|
|
2715
2810
|
let D = r(S);
|
|
2716
2811
|
o && D < r(o) && (D = r(o)), n && D > r(n) && (D = r(n)), c(D), C?.(D);
|
|
2717
2812
|
};
|
|
2718
2813
|
return {
|
|
2719
|
-
months:
|
|
2720
|
-
weeks:
|
|
2721
|
-
days:
|
|
2814
|
+
months: l,
|
|
2815
|
+
weeks: d,
|
|
2816
|
+
days: u,
|
|
2722
2817
|
navStart: o,
|
|
2723
2818
|
navEnd: n,
|
|
2724
|
-
previousMonth:
|
|
2819
|
+
previousMonth: f,
|
|
2725
2820
|
nextMonth: M,
|
|
2726
2821
|
goToMonth: v,
|
|
2727
2822
|
goToDay: (S) => {
|
|
2728
|
-
|
|
2823
|
+
W(S) || v(S.date);
|
|
2729
2824
|
}
|
|
2730
2825
|
};
|
|
2731
2826
|
}
|
|
2732
|
-
var
|
|
2827
|
+
var be;
|
|
2733
2828
|
(function(e) {
|
|
2734
2829
|
e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
|
|
2735
|
-
})(
|
|
2736
|
-
function
|
|
2830
|
+
})(be || (be = {}));
|
|
2831
|
+
function Qt(e) {
|
|
2737
2832
|
return !e[R.disabled] && !e[R.hidden] && !e[R.outside];
|
|
2738
2833
|
}
|
|
2739
|
-
function
|
|
2740
|
-
let r,
|
|
2741
|
-
for (const
|
|
2742
|
-
const
|
|
2743
|
-
|
|
2834
|
+
function Za(e, t, o, n) {
|
|
2835
|
+
let r, i = -1;
|
|
2836
|
+
for (const s of e) {
|
|
2837
|
+
const a = t(s);
|
|
2838
|
+
Qt(a) && (a[R.focused] && i < be.FocusedModifier ? (r = s, i = be.FocusedModifier) : n?.isEqualTo(s) && i < be.LastFocused ? (r = s, i = be.LastFocused) : o(s.date) && i < be.Selected ? (r = s, i = be.Selected) : a[R.today] && i < be.Today && (r = s, i = be.Today));
|
|
2744
2839
|
}
|
|
2745
|
-
return r || (r = e.find((
|
|
2840
|
+
return r || (r = e.find((s) => Qt(t(s)))), r;
|
|
2746
2841
|
}
|
|
2747
|
-
function
|
|
2748
|
-
const { ISOWeek:
|
|
2842
|
+
function Ja(e, t, o, n, r, i, s) {
|
|
2843
|
+
const { ISOWeek: a, broadcastCalendar: c } = i, { addDays: l, addMonths: d, addWeeks: u, addYears: f, endOfBroadcastWeek: M, endOfISOWeek: w, endOfWeek: C, max: W, min: v, startOfBroadcastWeek: g, startOfISOWeek: p, startOfWeek: S } = s;
|
|
2749
2844
|
let y = {
|
|
2750
|
-
day:
|
|
2751
|
-
week:
|
|
2752
|
-
month:
|
|
2753
|
-
year:
|
|
2754
|
-
startOfWeek: (
|
|
2755
|
-
endOfWeek: (
|
|
2845
|
+
day: l,
|
|
2846
|
+
week: u,
|
|
2847
|
+
month: d,
|
|
2848
|
+
year: f,
|
|
2849
|
+
startOfWeek: (O) => c ? g(O, s) : a ? p(O) : S(O),
|
|
2850
|
+
endOfWeek: (O) => c ? M(O) : a ? w(O) : C(O)
|
|
2756
2851
|
}[e](o, t === "after" ? 1 : -1);
|
|
2757
|
-
return t === "before" && n ? y =
|
|
2852
|
+
return t === "before" && n ? y = W([n, y]) : t === "after" && r && (y = v([r, y])), y;
|
|
2758
2853
|
}
|
|
2759
|
-
function
|
|
2760
|
-
if (
|
|
2854
|
+
function xn(e, t, o, n, r, i, s, a = 0) {
|
|
2855
|
+
if (a > 365)
|
|
2761
2856
|
return;
|
|
2762
|
-
const c =
|
|
2763
|
-
return !
|
|
2857
|
+
const c = Ja(e, t, o.date, n, r, i, s), l = !!(i.disabled && Ce(c, i.disabled, s)), d = !!(i.hidden && Ce(c, i.hidden, s)), u = c, f = new mn(c, u, s);
|
|
2858
|
+
return !l && !d ? f : xn(e, t, f, n, r, i, s, a + 1);
|
|
2764
2859
|
}
|
|
2765
|
-
function
|
|
2766
|
-
const { autoFocus:
|
|
2860
|
+
function es(e, t, o, n, r) {
|
|
2861
|
+
const { autoFocus: i } = e, [s, a] = Se(), c = Za(t.days, o, n || (() => !1), s), [l, d] = Se(i ? c : void 0);
|
|
2767
2862
|
return {
|
|
2768
2863
|
isFocusTarget: (C) => !!c?.isEqualTo(C),
|
|
2769
|
-
setFocused:
|
|
2770
|
-
focused:
|
|
2864
|
+
setFocused: d,
|
|
2865
|
+
focused: l,
|
|
2771
2866
|
blur: () => {
|
|
2772
|
-
|
|
2867
|
+
a(l), d(void 0);
|
|
2773
2868
|
},
|
|
2774
|
-
moveFocus: (C,
|
|
2775
|
-
if (!
|
|
2869
|
+
moveFocus: (C, W) => {
|
|
2870
|
+
if (!l)
|
|
2776
2871
|
return;
|
|
2777
|
-
const v =
|
|
2778
|
-
v && (e.disableNavigation && !t.days.some((p) => p.isEqualTo(v)) || (t.goToDay(v),
|
|
2872
|
+
const v = xn(C, W, l, t.navStart, t.navEnd, e, r);
|
|
2873
|
+
v && (e.disableNavigation && !t.days.some((p) => p.isEqualTo(v)) || (t.goToDay(v), d(v)));
|
|
2779
2874
|
}
|
|
2780
2875
|
};
|
|
2781
2876
|
}
|
|
2782
|
-
function
|
|
2783
|
-
const { selected: o, required: n, onSelect: r } = e, [
|
|
2877
|
+
function ts(e, t) {
|
|
2878
|
+
const { selected: o, required: n, onSelect: r } = e, [i, s] = ft(o, r ? o : void 0), a = r ? o : i, { isSameDay: c } = t, l = (M) => a?.some((w) => c(w, M)) ?? !1, { min: d, max: u } = e;
|
|
2784
2879
|
return {
|
|
2785
|
-
selected:
|
|
2880
|
+
selected: a,
|
|
2786
2881
|
select: (M, w, C) => {
|
|
2787
|
-
let
|
|
2788
|
-
if (
|
|
2789
|
-
if (
|
|
2882
|
+
let W = [...a ?? []];
|
|
2883
|
+
if (l(M)) {
|
|
2884
|
+
if (a?.length === d || n && a?.length === 1)
|
|
2790
2885
|
return;
|
|
2791
|
-
|
|
2886
|
+
W = a?.filter((v) => !c(v, M));
|
|
2792
2887
|
} else
|
|
2793
|
-
|
|
2794
|
-
return r ||
|
|
2888
|
+
a?.length === u ? W = [M] : W = [...W, M];
|
|
2889
|
+
return r || s(W), r?.(W, M, w, C), W;
|
|
2795
2890
|
},
|
|
2796
|
-
isSelected:
|
|
2891
|
+
isSelected: l
|
|
2797
2892
|
};
|
|
2798
2893
|
}
|
|
2799
|
-
function
|
|
2800
|
-
const { from:
|
|
2801
|
-
let
|
|
2802
|
-
if (!
|
|
2803
|
-
|
|
2804
|
-
else if (
|
|
2805
|
-
c(
|
|
2806
|
-
else if (
|
|
2807
|
-
if (c(
|
|
2808
|
-
r ?
|
|
2894
|
+
function ns(e, t, o = 0, n = 0, r = !1, i = ve) {
|
|
2895
|
+
const { from: s, to: a } = t || {}, { isSameDay: c, isAfter: l, isBefore: d } = i;
|
|
2896
|
+
let u;
|
|
2897
|
+
if (!s && !a)
|
|
2898
|
+
u = { from: e, to: o > 0 ? void 0 : e };
|
|
2899
|
+
else if (s && !a)
|
|
2900
|
+
c(s, e) ? o === 0 ? u = { from: s, to: e } : r ? u = { from: s, to: void 0 } : u = void 0 : d(e, s) ? u = { from: e, to: s } : u = { from: s, to: e };
|
|
2901
|
+
else if (s && a)
|
|
2902
|
+
if (c(s, e) && c(a, e))
|
|
2903
|
+
r ? u = { from: s, to: a } : u = void 0;
|
|
2904
|
+
else if (c(s, e))
|
|
2905
|
+
u = { from: s, to: o > 0 ? void 0 : e };
|
|
2809
2906
|
else if (c(a, e))
|
|
2810
|
-
|
|
2811
|
-
else if (
|
|
2812
|
-
|
|
2813
|
-
else if (
|
|
2814
|
-
|
|
2815
|
-
else if (
|
|
2816
|
-
|
|
2817
|
-
else if (u(e, i))
|
|
2818
|
-
l = { from: a, to: e };
|
|
2907
|
+
u = { from: e, to: o > 0 ? void 0 : e };
|
|
2908
|
+
else if (d(e, s))
|
|
2909
|
+
u = { from: e, to: a };
|
|
2910
|
+
else if (l(e, s))
|
|
2911
|
+
u = { from: s, to: e };
|
|
2912
|
+
else if (l(e, a))
|
|
2913
|
+
u = { from: s, to: e };
|
|
2819
2914
|
else
|
|
2820
2915
|
throw new Error("Invalid range");
|
|
2821
|
-
if (
|
|
2822
|
-
const
|
|
2823
|
-
n > 0 &&
|
|
2916
|
+
if (u?.from && u?.to) {
|
|
2917
|
+
const f = i.differenceInCalendarDays(u.to, u.from);
|
|
2918
|
+
n > 0 && f > n ? u = { from: e, to: void 0 } : o > 1 && f < o && (u = { from: e, to: void 0 });
|
|
2824
2919
|
}
|
|
2825
|
-
return
|
|
2920
|
+
return u;
|
|
2826
2921
|
}
|
|
2827
|
-
function
|
|
2922
|
+
function os(e, t, o = ve) {
|
|
2828
2923
|
const n = Array.isArray(t) ? t : [t];
|
|
2829
2924
|
let r = e.from;
|
|
2830
|
-
const
|
|
2831
|
-
for (let
|
|
2925
|
+
const i = o.differenceInCalendarDays(e.to, e.from), s = Math.min(i, 6);
|
|
2926
|
+
for (let a = 0; a <= s; a++) {
|
|
2832
2927
|
if (n.includes(r.getDay()))
|
|
2833
2928
|
return !0;
|
|
2834
2929
|
r = o.addDays(r, 1);
|
|
2835
2930
|
}
|
|
2836
2931
|
return !1;
|
|
2837
2932
|
}
|
|
2838
|
-
function
|
|
2933
|
+
function Ut(e, t, o = ve) {
|
|
2839
2934
|
return Ne(e, t.from, !1, o) || Ne(e, t.to, !1, o) || Ne(t, e.from, !1, o) || Ne(t, e.to, !1, o);
|
|
2840
2935
|
}
|
|
2841
|
-
function
|
|
2936
|
+
function rs(e, t, o = ve) {
|
|
2842
2937
|
const n = Array.isArray(t) ? t : [t];
|
|
2843
|
-
if (n.filter((
|
|
2844
|
-
from: o.addDays(
|
|
2845
|
-
to: o.addDays(
|
|
2846
|
-
}, o) : Ce(e.from,
|
|
2938
|
+
if (n.filter((a) => typeof a != "function").some((a) => typeof a == "boolean" ? a : o.isDate(a) ? Ne(e, a, !1, o) : pn(a, o) ? a.some((c) => Ne(e, c, !1, o)) : dt(a) ? a.from && a.to ? Ut(e, { from: a.from, to: a.to }, o) : !1 : gn(a) ? os(e, a.dayOfWeek, o) : Yt(a) ? o.isAfter(a.before, a.after) ? Ut(e, {
|
|
2939
|
+
from: o.addDays(a.after, 1),
|
|
2940
|
+
to: o.addDays(a.before, -1)
|
|
2941
|
+
}, o) : Ce(e.from, a, o) || Ce(e.to, a, o) : Et(a) || Ft(a) ? Ce(e.from, a, o) || Ce(e.to, a, o) : !1))
|
|
2847
2942
|
return !0;
|
|
2848
|
-
const
|
|
2849
|
-
if (
|
|
2850
|
-
let
|
|
2943
|
+
const s = n.filter((a) => typeof a == "function");
|
|
2944
|
+
if (s.length) {
|
|
2945
|
+
let a = e.from;
|
|
2851
2946
|
const c = o.differenceInCalendarDays(e.to, e.from);
|
|
2852
|
-
for (let
|
|
2853
|
-
if (
|
|
2947
|
+
for (let l = 0; l <= c; l++) {
|
|
2948
|
+
if (s.some((d) => d(a)))
|
|
2854
2949
|
return !0;
|
|
2855
|
-
|
|
2950
|
+
a = o.addDays(a, 1);
|
|
2856
2951
|
}
|
|
2857
2952
|
}
|
|
2858
2953
|
return !1;
|
|
2859
2954
|
}
|
|
2860
|
-
function
|
|
2861
|
-
const { disabled: o, excludeDisabled: n, selected: r, required:
|
|
2955
|
+
function as(e, t) {
|
|
2956
|
+
const { disabled: o, excludeDisabled: n, selected: r, required: i, onSelect: s } = e, [a, c] = ft(r, s ? r : void 0), l = s ? r : a;
|
|
2862
2957
|
return {
|
|
2863
|
-
selected:
|
|
2864
|
-
select: (
|
|
2865
|
-
const { min: C, max:
|
|
2866
|
-
return n && o && v?.from && v.to &&
|
|
2958
|
+
selected: l,
|
|
2959
|
+
select: (f, M, w) => {
|
|
2960
|
+
const { min: C, max: W } = e, v = f ? ns(f, l, C, W, i, t) : void 0;
|
|
2961
|
+
return n && o && v?.from && v.to && rs({ from: v.from, to: v.to }, o, t) && (v.from = f, v.to = void 0), s || c(v), s?.(v, f, M, w), v;
|
|
2867
2962
|
},
|
|
2868
|
-
isSelected: (
|
|
2963
|
+
isSelected: (f) => l && Ne(l, f, !1, t)
|
|
2869
2964
|
};
|
|
2870
2965
|
}
|
|
2871
|
-
function
|
|
2872
|
-
const { selected: o, required: n, onSelect: r } = e, [
|
|
2966
|
+
function ss(e, t) {
|
|
2967
|
+
const { selected: o, required: n, onSelect: r } = e, [i, s] = ft(o, r ? o : void 0), a = r ? o : i, { isSameDay: c } = t;
|
|
2873
2968
|
return {
|
|
2874
|
-
selected:
|
|
2875
|
-
select: (
|
|
2876
|
-
let w =
|
|
2877
|
-
return !n &&
|
|
2969
|
+
selected: a,
|
|
2970
|
+
select: (u, f, M) => {
|
|
2971
|
+
let w = u;
|
|
2972
|
+
return !n && a && a && c(u, a) && (w = void 0), r || s(w), r?.(w, u, f, M), w;
|
|
2878
2973
|
},
|
|
2879
|
-
isSelected: (
|
|
2974
|
+
isSelected: (u) => a ? c(a, u) : !1
|
|
2880
2975
|
};
|
|
2881
2976
|
}
|
|
2882
|
-
function
|
|
2883
|
-
const o =
|
|
2977
|
+
function is(e, t) {
|
|
2978
|
+
const o = ss(e, t), n = ts(e, t), r = as(e, t);
|
|
2884
2979
|
switch (e.mode) {
|
|
2885
2980
|
case "single":
|
|
2886
2981
|
return o;
|
|
@@ -2892,58 +2987,64 @@ function as(e, t) {
|
|
|
2892
2987
|
return;
|
|
2893
2988
|
}
|
|
2894
2989
|
}
|
|
2895
|
-
function
|
|
2896
|
-
return e instanceof
|
|
2990
|
+
function de(e, t) {
|
|
2991
|
+
return e instanceof J && e.timeZone === t ? e : new J(e, t);
|
|
2992
|
+
}
|
|
2993
|
+
function Ge(e, t, o) {
|
|
2994
|
+
return de(e, t);
|
|
2897
2995
|
}
|
|
2898
|
-
function
|
|
2899
|
-
return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ?
|
|
2996
|
+
function Kt(e, t, o) {
|
|
2997
|
+
return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? Ge(e, t) : Array.isArray(e) ? e.map((n) => n instanceof Date ? Ge(n, t) : n) : dt(e) ? {
|
|
2900
2998
|
...e,
|
|
2901
|
-
from: e.from ?
|
|
2902
|
-
to: e.to ?
|
|
2903
|
-
} :
|
|
2904
|
-
before:
|
|
2905
|
-
after:
|
|
2906
|
-
} :
|
|
2907
|
-
after:
|
|
2908
|
-
} :
|
|
2909
|
-
before:
|
|
2999
|
+
from: e.from ? de(e.from, t) : e.from,
|
|
3000
|
+
to: e.to ? de(e.to, t) : e.to
|
|
3001
|
+
} : Yt(e) ? {
|
|
3002
|
+
before: Ge(e.before, t),
|
|
3003
|
+
after: Ge(e.after, t)
|
|
3004
|
+
} : Et(e) ? {
|
|
3005
|
+
after: Ge(e.after, t)
|
|
3006
|
+
} : Ft(e) ? {
|
|
3007
|
+
before: Ge(e.before, t)
|
|
2910
3008
|
} : e;
|
|
2911
3009
|
}
|
|
2912
|
-
function
|
|
2913
|
-
return e && (Array.isArray(e) ? e.map((
|
|
3010
|
+
function Wt(e, t, o) {
|
|
3011
|
+
return e && (Array.isArray(e) ? e.map((n) => Kt(n, t)) : Kt(e, t));
|
|
2914
3012
|
}
|
|
2915
|
-
function
|
|
3013
|
+
function St(e) {
|
|
2916
3014
|
let t = e;
|
|
2917
3015
|
const o = t.timeZone;
|
|
2918
3016
|
if (o && (t = {
|
|
2919
3017
|
...e,
|
|
2920
3018
|
timeZone: o
|
|
2921
|
-
}, t.today && (t.today =
|
|
2922
|
-
from: t.selected.from ?
|
|
2923
|
-
to: t.selected.to ?
|
|
2924
|
-
}), t.disabled !== void 0 && (t.disabled =
|
|
3019
|
+
}, t.today && (t.today = de(t.today, o)), t.month && (t.month = de(t.month, o)), t.defaultMonth && (t.defaultMonth = de(t.defaultMonth, o)), t.startMonth && (t.startMonth = de(t.startMonth, o)), t.endMonth && (t.endMonth = de(t.endMonth, o)), t.mode === "single" && t.selected ? t.selected = de(t.selected, o) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((N) => de(N, o)) : t.mode === "range" && t.selected && (t.selected = {
|
|
3020
|
+
from: t.selected.from ? de(t.selected.from, o) : t.selected.from,
|
|
3021
|
+
to: t.selected.to ? de(t.selected.to, o) : t.selected.to
|
|
3022
|
+
}), t.disabled !== void 0 && (t.disabled = Wt(t.disabled, o)), t.hidden !== void 0 && (t.hidden = Wt(t.hidden, o)), t.modifiers)) {
|
|
2925
3023
|
const N = {};
|
|
2926
|
-
Object.keys(t.modifiers).forEach((
|
|
2927
|
-
N[
|
|
3024
|
+
Object.keys(t.modifiers).forEach((E) => {
|
|
3025
|
+
N[E] = Wt(t.modifiers?.[E], o);
|
|
2928
3026
|
}), t.modifiers = N;
|
|
2929
3027
|
}
|
|
2930
|
-
const { components: n, formatters: r, labels:
|
|
2931
|
-
const N = { ...
|
|
3028
|
+
const { components: n, formatters: r, labels: i, dateLib: s, locale: a, classNames: c } = ie(() => {
|
|
3029
|
+
const N = { ...hn, ...t.locale }, E = t.broadcastCalendar ? 1 : t.weekStartsOn, k = t.noonSafe && t.timeZone ? ja(t.timeZone, {
|
|
3030
|
+
weekStartsOn: E,
|
|
3031
|
+
locale: N
|
|
3032
|
+
}) : void 0, Y = t.dateLib && k ? { ...k, ...t.dateLib } : t.dateLib ?? k, ne = new ce({
|
|
2932
3033
|
locale: N,
|
|
2933
|
-
weekStartsOn:
|
|
3034
|
+
weekStartsOn: E,
|
|
2934
3035
|
firstWeekContainsDate: t.firstWeekContainsDate,
|
|
2935
3036
|
useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
|
|
2936
3037
|
useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
|
|
2937
3038
|
timeZone: t.timeZone,
|
|
2938
3039
|
numerals: t.numerals
|
|
2939
|
-
},
|
|
3040
|
+
}, Y);
|
|
2940
3041
|
return {
|
|
2941
|
-
dateLib:
|
|
2942
|
-
components:
|
|
2943
|
-
formatters:
|
|
2944
|
-
labels:
|
|
3042
|
+
dateLib: ne,
|
|
3043
|
+
components: pa(t.components),
|
|
3044
|
+
formatters: Ca(t.formatters),
|
|
3045
|
+
labels: Ea(t.labels, ne.options),
|
|
2945
3046
|
locale: N,
|
|
2946
|
-
classNames: { ...
|
|
3047
|
+
classNames: { ...wa(), ...t.classNames }
|
|
2947
3048
|
};
|
|
2948
3049
|
}, [
|
|
2949
3050
|
t.locale,
|
|
@@ -2955,115 +3056,116 @@ function Wt(e) {
|
|
|
2955
3056
|
t.timeZone,
|
|
2956
3057
|
t.numerals,
|
|
2957
3058
|
t.dateLib,
|
|
3059
|
+
t.noonSafe,
|
|
2958
3060
|
t.components,
|
|
2959
3061
|
t.formatters,
|
|
2960
3062
|
t.labels,
|
|
2961
3063
|
t.classNames
|
|
2962
3064
|
]);
|
|
2963
|
-
t.today || (t = { ...t, today:
|
|
2964
|
-
const { captionLayout:
|
|
2965
|
-
|
|
2966
|
-
}, [
|
|
2967
|
-
X && (
|
|
2968
|
-
}, [
|
|
2969
|
-
|
|
2970
|
-
}, [
|
|
2971
|
-
|
|
2972
|
-
}, [C,
|
|
2973
|
-
Ae(), M?.(N.date,
|
|
2974
|
-
}, [Ae, M]),
|
|
2975
|
-
const
|
|
3065
|
+
t.today || (t = { ...t, today: s.today() });
|
|
3066
|
+
const { captionLayout: l, mode: d, navLayout: u, numberOfMonths: f = 1, onDayBlur: M, onDayClick: w, onDayFocus: C, onDayKeyDown: W, onDayMouseEnter: v, onDayMouseLeave: g, onNextClick: p, onPrevClick: S, showWeekNumber: D, styles: y } = t, { formatCaption: O, formatDay: x, formatMonthDropdown: j, formatWeekNumber: F, formatWeekNumberHeader: K, formatWeekdayName: V, formatYearDropdown: z } = r, _ = Ka(t, s), { days: me, months: ke, navStart: ye, navEnd: je, previousMonth: oe, nextMonth: X, goToMonth: Z } = _, Oe = ya(me, t, ye, je, s), { isSelected: $e, select: Fe, selected: ge } = is(t, s) ?? {}, { blur: Ae, focused: le, isFocusTarget: it, moveFocus: Ue, setFocused: pe } = es(t, _, Oe, $e ?? (() => !1), s), { labelDayButton: ht, labelGridcell: mt, labelGrid: ct, labelMonthDropdown: lt, labelNav: Ke, labelPrevious: xe, labelNext: We, labelWeekday: He, labelWeekNumber: Ze, labelWeekNumberHeader: yt, labelYearDropdown: gt } = i, pt = ie(() => Ia(s, t.ISOWeek, t.broadcastCalendar, t.today), [s, t.ISOWeek, t.broadcastCalendar, t.today]), m = d !== void 0 || w !== void 0, T = q(() => {
|
|
3067
|
+
oe && (Z(oe), S?.(oe));
|
|
3068
|
+
}, [oe, Z, S]), A = q(() => {
|
|
3069
|
+
X && (Z(X), p?.(X));
|
|
3070
|
+
}, [Z, X, p]), L = q((N, E) => (k) => {
|
|
3071
|
+
k.preventDefault(), k.stopPropagation(), pe(N), !E.disabled && (Fe?.(N.date, E, k), w?.(N.date, E, k));
|
|
3072
|
+
}, [Fe, w, pe]), G = q((N, E) => (k) => {
|
|
3073
|
+
pe(N), C?.(N.date, E, k);
|
|
3074
|
+
}, [C, pe]), ee = q((N, E) => (k) => {
|
|
3075
|
+
Ae(), M?.(N.date, E, k);
|
|
3076
|
+
}, [Ae, M]), ae = q((N, E) => (k) => {
|
|
3077
|
+
const Y = {
|
|
2976
3078
|
ArrowLeft: [
|
|
2977
|
-
|
|
3079
|
+
k.shiftKey ? "month" : "day",
|
|
2978
3080
|
t.dir === "rtl" ? "after" : "before"
|
|
2979
3081
|
],
|
|
2980
3082
|
ArrowRight: [
|
|
2981
|
-
|
|
3083
|
+
k.shiftKey ? "month" : "day",
|
|
2982
3084
|
t.dir === "rtl" ? "before" : "after"
|
|
2983
3085
|
],
|
|
2984
|
-
ArrowDown: [
|
|
2985
|
-
ArrowUp: [
|
|
2986
|
-
PageUp: [
|
|
2987
|
-
PageDown: [
|
|
3086
|
+
ArrowDown: [k.shiftKey ? "year" : "week", "after"],
|
|
3087
|
+
ArrowUp: [k.shiftKey ? "year" : "week", "before"],
|
|
3088
|
+
PageUp: [k.shiftKey ? "year" : "month", "before"],
|
|
3089
|
+
PageDown: [k.shiftKey ? "year" : "month", "after"],
|
|
2988
3090
|
Home: ["startOfWeek", "before"],
|
|
2989
3091
|
End: ["endOfWeek", "after"]
|
|
2990
3092
|
};
|
|
2991
|
-
if (
|
|
2992
|
-
|
|
2993
|
-
const [
|
|
2994
|
-
Ue(
|
|
3093
|
+
if (Y[k.key]) {
|
|
3094
|
+
k.preventDefault(), k.stopPropagation();
|
|
3095
|
+
const [ne, P] = Y[k.key];
|
|
3096
|
+
Ue(ne, P);
|
|
2995
3097
|
}
|
|
2996
|
-
|
|
2997
|
-
}, [Ue,
|
|
2998
|
-
v?.(N.date,
|
|
2999
|
-
}, [v]), $ = q((N,
|
|
3000
|
-
g?.(N.date,
|
|
3001
|
-
}, [g]),
|
|
3002
|
-
const
|
|
3003
|
-
|
|
3004
|
-
}, [
|
|
3005
|
-
const
|
|
3006
|
-
|
|
3007
|
-
}, [
|
|
3098
|
+
W?.(N.date, E, k);
|
|
3099
|
+
}, [Ue, W, t.dir]), re = q((N, E) => (k) => {
|
|
3100
|
+
v?.(N.date, E, k);
|
|
3101
|
+
}, [v]), $ = q((N, E) => (k) => {
|
|
3102
|
+
g?.(N.date, E, k);
|
|
3103
|
+
}, [g]), ue = q((N) => (E) => {
|
|
3104
|
+
const k = Number(E.target.value), Y = s.setMonth(s.startOfMonth(N), k);
|
|
3105
|
+
Z(Y);
|
|
3106
|
+
}, [s, Z]), te = q((N) => (E) => {
|
|
3107
|
+
const k = Number(E.target.value), Y = s.setYear(s.startOfMonth(N), k);
|
|
3108
|
+
Z(Y);
|
|
3109
|
+
}, [s, Z]), { className: H, style: qe } = ie(() => ({
|
|
3008
3110
|
className: [c[b.Root], t.className].filter(Boolean).join(" "),
|
|
3009
3111
|
style: { ...y?.[b.Root], ...t.style }
|
|
3010
|
-
}), [c, t.className, t.style, y]), Re =
|
|
3011
|
-
|
|
3112
|
+
}), [c, t.className, t.style, y]), Re = ba(t), Pe = Ee(null);
|
|
3113
|
+
qa(Pe, !!t.animate, {
|
|
3012
3114
|
classNames: c,
|
|
3013
|
-
months:
|
|
3014
|
-
focused:
|
|
3015
|
-
dateLib:
|
|
3115
|
+
months: ke,
|
|
3116
|
+
focused: le,
|
|
3117
|
+
dateLib: s
|
|
3016
3118
|
});
|
|
3017
3119
|
const Te = {
|
|
3018
3120
|
dayPickerProps: t,
|
|
3019
|
-
selected:
|
|
3020
|
-
select:
|
|
3121
|
+
selected: ge,
|
|
3122
|
+
select: Fe,
|
|
3021
3123
|
isSelected: $e,
|
|
3022
|
-
months:
|
|
3124
|
+
months: ke,
|
|
3023
3125
|
nextMonth: X,
|
|
3024
|
-
previousMonth:
|
|
3025
|
-
goToMonth:
|
|
3026
|
-
getModifiers:
|
|
3126
|
+
previousMonth: oe,
|
|
3127
|
+
goToMonth: Z,
|
|
3128
|
+
getModifiers: Oe,
|
|
3027
3129
|
components: n,
|
|
3028
3130
|
classNames: c,
|
|
3029
3131
|
styles: y,
|
|
3030
|
-
labels:
|
|
3132
|
+
labels: i,
|
|
3031
3133
|
formatters: r
|
|
3032
3134
|
};
|
|
3033
|
-
return
|
|
3034
|
-
|
|
3135
|
+
return h.createElement(
|
|
3136
|
+
yn.Provider,
|
|
3035
3137
|
{ value: Te },
|
|
3036
|
-
|
|
3138
|
+
h.createElement(
|
|
3037
3139
|
n.Root,
|
|
3038
3140
|
{ rootRef: t.animate ? Pe : void 0, className: H, style: qe, 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"], ...Re },
|
|
3039
|
-
|
|
3141
|
+
h.createElement(
|
|
3040
3142
|
n.Months,
|
|
3041
3143
|
{ className: c[b.Months], style: y?.[b.Months] },
|
|
3042
|
-
!t.hideNavigation && !
|
|
3043
|
-
|
|
3144
|
+
!t.hideNavigation && !u && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[b.Nav], style: y?.[b.Nav], "aria-label": Ke(), onPreviousClick: T, onNextClick: A, previousMonth: oe, nextMonth: X }),
|
|
3145
|
+
ke.map((N, E) => h.createElement(
|
|
3044
3146
|
n.Month,
|
|
3045
3147
|
{
|
|
3046
3148
|
"data-animated-month": t.animate ? "true" : void 0,
|
|
3047
3149
|
className: c[b.Month],
|
|
3048
3150
|
style: y?.[b.Month],
|
|
3049
3151
|
// biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
|
|
3050
|
-
key:
|
|
3051
|
-
displayIndex:
|
|
3152
|
+
key: E,
|
|
3153
|
+
displayIndex: E,
|
|
3052
3154
|
calendarMonth: N
|
|
3053
3155
|
},
|
|
3054
|
-
|
|
3156
|
+
u === "around" && !t.hideNavigation && E === 0 && h.createElement(
|
|
3055
3157
|
n.PreviousMonthButton,
|
|
3056
|
-
{ type: "button", className: c[b.PreviousMonthButton], tabIndex:
|
|
3057
|
-
|
|
3158
|
+
{ type: "button", className: c[b.PreviousMonthButton], tabIndex: oe ? void 0 : -1, "aria-disabled": oe ? void 0 : !0, "aria-label": xe(oe), onClick: T, "data-animated-button": t.animate ? "true" : void 0 },
|
|
3159
|
+
h.createElement(n.Chevron, { disabled: oe ? void 0 : !0, className: c[b.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
|
|
3058
3160
|
),
|
|
3059
|
-
|
|
3161
|
+
h.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: c[b.MonthCaption], style: y?.[b.MonthCaption], calendarMonth: N, displayIndex: E }, l?.startsWith("dropdown") ? h.createElement(
|
|
3060
3162
|
n.DropdownNav,
|
|
3061
3163
|
{ className: c[b.Dropdowns], style: y?.[b.Dropdowns] },
|
|
3062
3164
|
(() => {
|
|
3063
|
-
const
|
|
3064
|
-
return
|
|
3165
|
+
const k = l === "dropdown" || l === "dropdown-months" ? h.createElement(n.MonthsDropdown, { key: "month", className: c[b.MonthsDropdown], "aria-label": lt(), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: ue(N.date), options: Fa(N.date, ye, je, r, s), style: y?.[b.Dropdown], value: s.getMonth(N.date) }) : h.createElement("span", { key: "month" }, j(N.date, s)), Y = l === "dropdown" || l === "dropdown-years" ? h.createElement(n.YearsDropdown, { key: "year", className: c[b.YearsDropdown], "aria-label": gt(s.options), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: te(N.date), options: Ba(ye, je, r, s, !!t.reverseYears), style: y?.[b.Dropdown], value: s.getYear(N.date) }) : h.createElement("span", { key: "year" }, z(N.date, s));
|
|
3166
|
+
return s.getMonthYearOrder() === "year-first" ? [Y, k] : [k, Y];
|
|
3065
3167
|
})(),
|
|
3066
|
-
|
|
3168
|
+
h.createElement("span", { role: "status", "aria-live": "polite", style: {
|
|
3067
3169
|
border: 0,
|
|
3068
3170
|
clip: "rect(0 0 0 0)",
|
|
3069
3171
|
height: "1px",
|
|
@@ -3074,419 +3176,419 @@ function Wt(e) {
|
|
|
3074
3176
|
width: "1px",
|
|
3075
3177
|
whiteSpace: "nowrap",
|
|
3076
3178
|
wordWrap: "normal"
|
|
3077
|
-
} },
|
|
3078
|
-
) :
|
|
3079
|
-
|
|
3179
|
+
} }, O(N.date, s.options, s))
|
|
3180
|
+
) : h.createElement(n.CaptionLabel, { className: c[b.CaptionLabel], role: "status", "aria-live": "polite" }, O(N.date, s.options, s))),
|
|
3181
|
+
u === "around" && !t.hideNavigation && E === f - 1 && h.createElement(
|
|
3080
3182
|
n.NextMonthButton,
|
|
3081
|
-
{ type: "button", className: c[b.NextMonthButton], tabIndex: X ? void 0 : -1, "aria-disabled": X ? void 0 : !0, "aria-label":
|
|
3082
|
-
|
|
3183
|
+
{ type: "button", className: c[b.NextMonthButton], tabIndex: X ? void 0 : -1, "aria-disabled": X ? void 0 : !0, "aria-label": We(X), onClick: A, "data-animated-button": t.animate ? "true" : void 0 },
|
|
3184
|
+
h.createElement(n.Chevron, { disabled: X ? void 0 : !0, className: c[b.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
|
|
3083
3185
|
),
|
|
3084
|
-
|
|
3085
|
-
|
|
3186
|
+
E === f - 1 && u === "after" && !t.hideNavigation && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[b.Nav], style: y?.[b.Nav], "aria-label": Ke(), onPreviousClick: T, onNextClick: A, previousMonth: oe, nextMonth: X }),
|
|
3187
|
+
h.createElement(
|
|
3086
3188
|
n.MonthGrid,
|
|
3087
|
-
{ role: "grid", "aria-multiselectable":
|
|
3088
|
-
!t.hideWeekdays &&
|
|
3189
|
+
{ role: "grid", "aria-multiselectable": d === "multiple" || d === "range", "aria-label": ct(N.date, s.options, s) || void 0, className: c[b.MonthGrid], style: y?.[b.MonthGrid] },
|
|
3190
|
+
!t.hideWeekdays && h.createElement(
|
|
3089
3191
|
n.Weekdays,
|
|
3090
3192
|
{ "data-animated-weekdays": t.animate ? "true" : void 0, className: c[b.Weekdays], style: y?.[b.Weekdays] },
|
|
3091
|
-
D &&
|
|
3092
|
-
|
|
3193
|
+
D && h.createElement(n.WeekNumberHeader, { "aria-label": yt(s.options), className: c[b.WeekNumberHeader], style: y?.[b.WeekNumberHeader], scope: "col" }, K()),
|
|
3194
|
+
pt.map((k) => h.createElement(n.Weekday, { "aria-label": He(k, s.options, s), className: c[b.Weekday], key: String(k), style: y?.[b.Weekday], scope: "col" }, V(k, s.options, s)))
|
|
3093
3195
|
),
|
|
3094
|
-
|
|
3196
|
+
h.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: c[b.Weeks], style: y?.[b.Weeks] }, N.weeks.map((k) => h.createElement(
|
|
3095
3197
|
n.Week,
|
|
3096
|
-
{ className: c[b.Week], key:
|
|
3097
|
-
D &&
|
|
3098
|
-
locale:
|
|
3099
|
-
}), className: c[b.WeekNumber], scope: "row", role: "rowheader" },
|
|
3100
|
-
|
|
3101
|
-
const { date:
|
|
3102
|
-
if (P[R.focused] = !P.hidden && !!
|
|
3103
|
-
const { from:
|
|
3104
|
-
P[
|
|
3198
|
+
{ className: c[b.Week], key: k.weekNumber, style: y?.[b.Week], week: k },
|
|
3199
|
+
D && h.createElement(n.WeekNumber, { week: k, style: y?.[b.WeekNumber], "aria-label": Ze(k.weekNumber, {
|
|
3200
|
+
locale: a
|
|
3201
|
+
}), className: c[b.WeekNumber], scope: "row", role: "rowheader" }, F(k.weekNumber, s)),
|
|
3202
|
+
k.days.map((Y) => {
|
|
3203
|
+
const { date: ne } = Y, P = Oe(Y);
|
|
3204
|
+
if (P[R.focused] = !P.hidden && !!le?.isEqualTo(Y), P[he.selected] = $e?.(ne) || P.selected, dt(ge)) {
|
|
3205
|
+
const { from: wt, to: Mt } = ge;
|
|
3206
|
+
P[he.range_start] = !!(wt && Mt && s.isSameDay(ne, wt)), P[he.range_end] = !!(wt && Mt && s.isSameDay(ne, Mt)), P[he.range_middle] = Ne(ge, ne, !0, s);
|
|
3105
3207
|
}
|
|
3106
|
-
const
|
|
3107
|
-
return
|
|
3208
|
+
const ut = _a(P, y, t.modifiersStyles), bt = ga(P, c, t.modifiersClassNames), Pn = !m && !P.hidden ? mt(ne, P, s.options, s) : void 0;
|
|
3209
|
+
return h.createElement(n.Day, { key: `${Y.isoDate}_${Y.displayMonthId}`, day: Y, modifiers: P, className: bt.join(" "), style: ut, role: "gridcell", "aria-selected": P.selected || void 0, "aria-label": Pn, "data-day": Y.isoDate, "data-month": Y.outside ? Y.dateMonthId : void 0, "data-selected": P.selected || void 0, "data-disabled": P.disabled || void 0, "data-hidden": P.hidden || void 0, "data-outside": Y.outside || void 0, "data-focused": P.focused || void 0, "data-today": P.today || void 0 }, !P.hidden && m ? h.createElement(n.DayButton, { className: c[b.DayButton], style: y?.[b.DayButton], type: "button", day: Y, modifiers: P, disabled: !P.focused && P.disabled || void 0, "aria-disabled": P.focused && P.disabled || void 0, tabIndex: it(Y) ? 0 : -1, "aria-label": ht(ne, P, s.options, s), onClick: L(Y, P), onBlur: ee(Y, P), onFocus: G(Y, P), onKeyDown: ae(Y, P), onMouseEnter: re(Y, P), onMouseLeave: $(Y, P) }, x(ne, s.options, s)) : !P.hidden && x(Y.date, s.options, s));
|
|
3108
3210
|
})
|
|
3109
3211
|
)))
|
|
3110
3212
|
)
|
|
3111
3213
|
))
|
|
3112
3214
|
),
|
|
3113
|
-
t.footer &&
|
|
3215
|
+
t.footer && h.createElement(n.Footer, { className: c[b.Footer], style: y?.[b.Footer], role: "status", "aria-live": "polite" }, t.footer)
|
|
3114
3216
|
)
|
|
3115
3217
|
);
|
|
3116
3218
|
}
|
|
3117
|
-
const
|
|
3219
|
+
const gs = (e) => {
|
|
3118
3220
|
const {
|
|
3119
3221
|
mode: t = "single",
|
|
3120
3222
|
required: o = !1,
|
|
3121
3223
|
selected: n,
|
|
3122
3224
|
onSelect: r,
|
|
3123
|
-
disabledDates:
|
|
3124
|
-
header:
|
|
3125
|
-
footer:
|
|
3225
|
+
disabledDates: i,
|
|
3226
|
+
header: s,
|
|
3227
|
+
footer: a,
|
|
3126
3228
|
hideOutsideDays: c = !1,
|
|
3127
|
-
numberOfMonths:
|
|
3128
|
-
startMonth:
|
|
3129
|
-
endMonth:
|
|
3130
|
-
showActionButtons:
|
|
3229
|
+
numberOfMonths: l = 1,
|
|
3230
|
+
startMonth: d,
|
|
3231
|
+
endMonth: u,
|
|
3232
|
+
showActionButtons: f = !1,
|
|
3131
3233
|
applyLabel: M = "Aplicar",
|
|
3132
3234
|
cancelLabel: w = "Cancelar",
|
|
3133
3235
|
onApply: C,
|
|
3134
|
-
onCancel:
|
|
3236
|
+
onCancel: W,
|
|
3135
3237
|
hideFooter: v = !1,
|
|
3136
3238
|
variant: g = "input",
|
|
3137
3239
|
inputProps: p,
|
|
3138
3240
|
label: S = "",
|
|
3139
3241
|
name: D = "datepicker",
|
|
3140
3242
|
className: y
|
|
3141
|
-
} = e,
|
|
3142
|
-
|
|
3143
|
-
window.innerWidth < 768 ?
|
|
3144
|
-
}, []),
|
|
3145
|
-
|
|
3146
|
-
}, [n,
|
|
3243
|
+
} = e, O = t === "range" || t === "multiple" ? e.min : void 0, x = t === "range" || t === "multiple" ? e.max : void 0, j = t === "range" ? e.excludeDisabled : void 0, [F, K] = Se({}), [V, z] = Se(!1), [_, me] = Se(!1), [ke, ye] = Se(n), [je, oe] = Se(!1), [X, Z] = Se(""), Oe = Ee(null), $e = Ee(null), Fe = Ee(null), ge = Ee(null), Ae = f ? ke : n, le = f ? n : Ae;
|
|
3244
|
+
_e(() => {
|
|
3245
|
+
window.innerWidth < 768 ? oe(!0) : oe(!1);
|
|
3246
|
+
}, []), _e(() => {
|
|
3247
|
+
f && ye(n);
|
|
3248
|
+
}, [n, f]), _e(() => {
|
|
3147
3249
|
if (g !== "input" || !V) return;
|
|
3148
|
-
const
|
|
3149
|
-
|
|
3250
|
+
const m = (T) => {
|
|
3251
|
+
Oe.current && !Oe.current.contains(T.target) && (z(!1), f && ye(n));
|
|
3150
3252
|
};
|
|
3151
|
-
return document.addEventListener("mousedown",
|
|
3152
|
-
document.removeEventListener("mousedown",
|
|
3253
|
+
return document.addEventListener("mousedown", m), () => {
|
|
3254
|
+
document.removeEventListener("mousedown", m);
|
|
3153
3255
|
};
|
|
3154
|
-
}, [g, V, n,
|
|
3155
|
-
if (!V || g !== "input" || !
|
|
3256
|
+
}, [g, V, n, f]), _e(() => {
|
|
3257
|
+
if (!V || g !== "input" || !Oe.current) {
|
|
3156
3258
|
me(!1);
|
|
3157
3259
|
return;
|
|
3158
3260
|
}
|
|
3159
|
-
const
|
|
3160
|
-
const
|
|
3161
|
-
if (!
|
|
3162
|
-
const
|
|
3163
|
-
let P =
|
|
3164
|
-
|
|
3165
|
-
const
|
|
3261
|
+
const m = 16, T = () => {
|
|
3262
|
+
const G = Oe?.current?.getBoundingClientRect(), ee = $e?.current?.getBoundingClientRect();
|
|
3263
|
+
if (!G || !ee) return;
|
|
3264
|
+
const ae = window.innerHeight, re = window.innerWidth, $ = G.height, ue = G.width, te = ee.left, H = ee.bottom, qe = H, Re = ae - H, Pe = re - ee.left, Te = ue - Pe, N = Te > 0 && Pe >= ue + m, E = qe >= $ + m, k = Re >= $ + m, Y = !k && E, ne = !k && !E;
|
|
3265
|
+
let P = Y ? void 0 : `${H + 8}px`, ut = Y ? `${Re + ee.height + 8}px` : void 0;
|
|
3266
|
+
ne && (P = void 0, ut = `${m}px`);
|
|
3267
|
+
const bt = Te > 0 ? Te : 0;
|
|
3166
3268
|
K(
|
|
3167
3269
|
{
|
|
3168
3270
|
top: P,
|
|
3169
|
-
bottom:
|
|
3271
|
+
bottom: ut,
|
|
3170
3272
|
right: N ? "0" : void 0,
|
|
3171
|
-
left: N ? void 0 : `${te -
|
|
3273
|
+
left: N ? void 0 : `${te - bt}px`
|
|
3172
3274
|
}
|
|
3173
3275
|
), me(!0);
|
|
3174
3276
|
}, A = () => {
|
|
3175
|
-
|
|
3277
|
+
z(!1), me(!1);
|
|
3176
3278
|
};
|
|
3177
3279
|
window.addEventListener("scroll", A, !0);
|
|
3178
|
-
const
|
|
3280
|
+
const L = setTimeout(T, 0);
|
|
3179
3281
|
return () => {
|
|
3180
|
-
clearTimeout(
|
|
3282
|
+
clearTimeout(L), window.removeEventListener("scroll", A, !0);
|
|
3181
3283
|
};
|
|
3182
3284
|
}, [V, g]);
|
|
3183
|
-
const
|
|
3184
|
-
C?.(
|
|
3185
|
-
}, [C, r,
|
|
3186
|
-
|
|
3187
|
-
}, [
|
|
3188
|
-
if (!
|
|
3285
|
+
const it = q(() => {
|
|
3286
|
+
C?.(ke), r?.(ke), g === "input" && z(!1);
|
|
3287
|
+
}, [C, r, ke, g]), Ue = q(() => {
|
|
3288
|
+
ye(n), W?.(), g === "input" && z(!1);
|
|
3289
|
+
}, [W, n, g]), pe = ie(() => {
|
|
3290
|
+
if (!le) return "";
|
|
3189
3291
|
if (t === "single")
|
|
3190
|
-
return
|
|
3292
|
+
return le.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" });
|
|
3191
3293
|
if (t === "range") {
|
|
3192
|
-
const
|
|
3193
|
-
if (!
|
|
3194
|
-
const T =
|
|
3195
|
-
if (!
|
|
3196
|
-
const A =
|
|
3294
|
+
const m = le;
|
|
3295
|
+
if (!m.from) return "";
|
|
3296
|
+
const T = m.from.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" });
|
|
3297
|
+
if (!m.to) return T;
|
|
3298
|
+
const A = m.to.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" });
|
|
3197
3299
|
return `${T} - ${A}`;
|
|
3198
3300
|
}
|
|
3199
3301
|
if (t === "multiple") {
|
|
3200
|
-
const
|
|
3201
|
-
return
|
|
3302
|
+
const m = le;
|
|
3303
|
+
return m.length === 0 ? "" : m.length === 1 ? m[0].toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" }) : `${m.length} fechas seleccionadas`;
|
|
3202
3304
|
}
|
|
3203
3305
|
return "";
|
|
3204
|
-
}, [
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
}, [
|
|
3208
|
-
if (
|
|
3209
|
-
const
|
|
3210
|
-
|
|
3306
|
+
}, [le, t]);
|
|
3307
|
+
_e(() => {
|
|
3308
|
+
Z(pe);
|
|
3309
|
+
}, [pe]), _e(() => {
|
|
3310
|
+
if (ge.current !== null && Fe.current) {
|
|
3311
|
+
const m = ge.current;
|
|
3312
|
+
Fe.current.setSelectionRange(m, m), ge.current = null;
|
|
3211
3313
|
}
|
|
3212
3314
|
}, [X]);
|
|
3213
|
-
const
|
|
3214
|
-
r?.(
|
|
3215
|
-
}, [r]),
|
|
3216
|
-
const T = new Date(parseInt(
|
|
3315
|
+
const ht = ie(() => g === "input" || g === "input-and-calendar", [g]), mt = ie(() => g === "only-calendar" || g === "input-and-calendar" || g === "input", [g]), ct = q((m) => {
|
|
3316
|
+
r?.(m);
|
|
3317
|
+
}, [r]), lt = q((m) => {
|
|
3318
|
+
const T = new Date(parseInt(m.slice(6, 10)), parseInt(m.slice(3, 5)) - 1, parseInt(m.slice(0, 2)));
|
|
3217
3319
|
if (t === "multiple") {
|
|
3218
|
-
const
|
|
3219
|
-
|
|
3320
|
+
const L = (le || []).filter((G) => G.getTime() !== T.getTime());
|
|
3321
|
+
f ? (r?.(L), ye(L)) : ct(L);
|
|
3220
3322
|
}
|
|
3221
|
-
}, [t,
|
|
3222
|
-
if (
|
|
3223
|
-
|
|
3323
|
+
}, [t, le, f, r, ct]), Ke = q((m) => {
|
|
3324
|
+
if (f) {
|
|
3325
|
+
ye(m);
|
|
3224
3326
|
return;
|
|
3225
3327
|
}
|
|
3226
|
-
g === "input" && t === "single" &&
|
|
3227
|
-
}, [
|
|
3228
|
-
if (
|
|
3229
|
-
|
|
3328
|
+
g === "input" && t === "single" && z(!1), r?.(m);
|
|
3329
|
+
}, [f, g, t, r]), xe = q((m) => {
|
|
3330
|
+
if (f) {
|
|
3331
|
+
ye(m);
|
|
3230
3332
|
return;
|
|
3231
3333
|
}
|
|
3232
|
-
r?.(
|
|
3233
|
-
}, [
|
|
3234
|
-
const T =
|
|
3334
|
+
r?.(m);
|
|
3335
|
+
}, [f, r]), We = q((m) => {
|
|
3336
|
+
const T = m.trim();
|
|
3235
3337
|
if (!T) return null;
|
|
3236
|
-
const [A,
|
|
3237
|
-
if (Number.isNaN(ee) || Number.isNaN(
|
|
3238
|
-
const $ = new Date(
|
|
3239
|
-
return $.getFullYear() !==
|
|
3240
|
-
}, []), He = q((
|
|
3241
|
-
const T =
|
|
3338
|
+
const [A, L, G] = T.split("/").map((ue) => ue.trim()), ee = parseInt(A, 10), ae = parseInt(L, 10), re = parseInt(G, 10);
|
|
3339
|
+
if (Number.isNaN(ee) || Number.isNaN(ae) || Number.isNaN(re) || re < 1e3 || re > 9999) return null;
|
|
3340
|
+
const $ = new Date(re, ae - 1, ee);
|
|
3341
|
+
return $.getFullYear() !== re || $.getMonth() !== ae - 1 || $.getDate() !== ee ? null : $;
|
|
3342
|
+
}, []), He = q((m) => {
|
|
3343
|
+
const T = m.trim();
|
|
3242
3344
|
if (!T) return null;
|
|
3243
|
-
const [A,
|
|
3244
|
-
if (!
|
|
3245
|
-
const ee =
|
|
3246
|
-
let $ = { from:
|
|
3345
|
+
const [A, L] = T.split("-"), G = We(A ?? "");
|
|
3346
|
+
if (!G) return null;
|
|
3347
|
+
const ee = L?.trim() ?? "", re = (ee ? We(ee) : void 0) || void 0;
|
|
3348
|
+
let $ = { from: G, to: re };
|
|
3247
3349
|
if ($.to && $.from && $.to.getTime() < $.from.getTime()) {
|
|
3248
|
-
const
|
|
3249
|
-
$ = { from: $.to, to:
|
|
3350
|
+
const ue = $.from;
|
|
3351
|
+
$ = { from: $.to, to: ue };
|
|
3250
3352
|
}
|
|
3251
|
-
if (t === "range" && (
|
|
3353
|
+
if (t === "range" && (O || x) && $.from && $.to) {
|
|
3252
3354
|
const te = Math.round(($.to.getTime() - $.from.getTime()) / 864e5) + 1;
|
|
3253
|
-
if (
|
|
3355
|
+
if (O && te < O || x && te > x) return null;
|
|
3254
3356
|
}
|
|
3255
3357
|
return $;
|
|
3256
|
-
}, [t,
|
|
3257
|
-
const
|
|
3258
|
-
if (!
|
|
3358
|
+
}, [t, O, x, We]), Ze = q(() => {
|
|
3359
|
+
const m = X.trim();
|
|
3360
|
+
if (!m) {
|
|
3259
3361
|
(t === "single" || t === "range") && r?.(void 0);
|
|
3260
3362
|
return;
|
|
3261
3363
|
}
|
|
3262
3364
|
if (t === "single") {
|
|
3263
|
-
const T =
|
|
3365
|
+
const T = We(m);
|
|
3264
3366
|
if (!T) {
|
|
3265
|
-
|
|
3367
|
+
Z(pe);
|
|
3266
3368
|
return;
|
|
3267
3369
|
}
|
|
3268
3370
|
xe(T);
|
|
3269
3371
|
return;
|
|
3270
3372
|
}
|
|
3271
3373
|
if (t === "range") {
|
|
3272
|
-
const T = He(
|
|
3374
|
+
const T = He(m);
|
|
3273
3375
|
if (!T) {
|
|
3274
|
-
|
|
3376
|
+
Z(pe);
|
|
3275
3377
|
return;
|
|
3276
3378
|
}
|
|
3277
3379
|
xe(T);
|
|
3278
3380
|
}
|
|
3279
|
-
}, [X, t,
|
|
3280
|
-
if (
|
|
3281
|
-
|
|
3381
|
+
}, [X, t, We, He, xe, pe]), yt = q((m) => {
|
|
3382
|
+
if (m.key === "Enter") {
|
|
3383
|
+
m.preventDefault(), Ze();
|
|
3282
3384
|
return;
|
|
3283
3385
|
}
|
|
3284
|
-
if (
|
|
3285
|
-
const T =
|
|
3386
|
+
if (m.key === "ArrowUp" || m.key === "ArrowDown") {
|
|
3387
|
+
const T = m.key === "ArrowUp" ? 1 : -1, A = m.currentTarget.selectionStart ?? 0;
|
|
3286
3388
|
if (t === "single") {
|
|
3287
|
-
const
|
|
3288
|
-
if (!
|
|
3289
|
-
|
|
3290
|
-
const
|
|
3291
|
-
A <= 2 ?
|
|
3389
|
+
const L = We(X);
|
|
3390
|
+
if (!L) return;
|
|
3391
|
+
m.preventDefault();
|
|
3392
|
+
const G = new Date(L);
|
|
3393
|
+
A <= 2 ? G.setDate(G.getDate() + T) : A <= 5 ? G.setMonth(G.getMonth() + T) : G.setFullYear(G.getFullYear() + T), ge.current = A, Z(G.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" })), xe(G);
|
|
3292
3394
|
return;
|
|
3293
3395
|
}
|
|
3294
3396
|
if (t === "range") {
|
|
3295
|
-
const
|
|
3296
|
-
if (!
|
|
3297
|
-
|
|
3298
|
-
const
|
|
3299
|
-
|
|
3397
|
+
const L = He(X);
|
|
3398
|
+
if (!L || !L.from) return;
|
|
3399
|
+
m.preventDefault();
|
|
3400
|
+
const ae = X.indexOf("-") === -1 || A <= 9, re = ae ? A : Math.max(0, A - 13), $ = new Date(L.from), ue = L.to ? new Date(L.to) : void 0, te = ae ? $ : ue ?? $;
|
|
3401
|
+
re <= 2 ? te.setDate(te.getDate() + T) : re <= 5 ? te.setMonth(te.getMonth() + T) : te.setFullYear(te.getFullYear() + T);
|
|
3300
3402
|
let H = {
|
|
3301
|
-
from:
|
|
3302
|
-
to:
|
|
3403
|
+
from: ae ? te : $,
|
|
3404
|
+
to: ae ? ue : te
|
|
3303
3405
|
};
|
|
3304
3406
|
if (H.to && H.from && H.to.getTime() < H.from.getTime()) {
|
|
3305
3407
|
const Pe = H.from;
|
|
3306
3408
|
H = { from: H.to, to: Pe };
|
|
3307
3409
|
}
|
|
3308
|
-
if ((
|
|
3410
|
+
if ((O || x) && H.from && H.to) {
|
|
3309
3411
|
const Te = Math.round((H.to.getTime() - H.from.getTime()) / 864e5) + 1;
|
|
3310
|
-
if (
|
|
3412
|
+
if (O && Te < O || x && Te > x) return;
|
|
3311
3413
|
}
|
|
3312
3414
|
if (!H.from) return;
|
|
3313
3415
|
const qe = H.from.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" }), Re = H.to ? H.to.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" }) : "";
|
|
3314
|
-
|
|
3416
|
+
ge.current = A, Z(H.to ? `${qe} - ${Re}` : qe), xe(H);
|
|
3315
3417
|
return;
|
|
3316
3418
|
}
|
|
3317
3419
|
}
|
|
3318
|
-
}, [Ze, t, X,
|
|
3319
|
-
const
|
|
3320
|
-
return /* @__PURE__ */
|
|
3321
|
-
|
|
3420
|
+
}, [Ze, t, X, We, He, O, x, xe]), gt = q(() => {
|
|
3421
|
+
const m = le || [];
|
|
3422
|
+
return /* @__PURE__ */ U.jsx(
|
|
3423
|
+
_n,
|
|
3322
3424
|
{
|
|
3323
3425
|
label: S,
|
|
3324
3426
|
placeholder: "Seleccione una o más fechas",
|
|
3325
3427
|
name: D,
|
|
3326
|
-
value:
|
|
3428
|
+
value: m.sort((T, A) => T.getTime() - A.getTime()).map((T) => T.toLocaleDateString("es-ES", { day: "2-digit", month: "2-digit", year: "numeric" })),
|
|
3327
3429
|
onChange: () => {
|
|
3328
3430
|
},
|
|
3329
|
-
onClick: () =>
|
|
3330
|
-
className:
|
|
3431
|
+
onClick: () => z(!0),
|
|
3432
|
+
className: tt("w-[360px]", p?.className),
|
|
3331
3433
|
readonly: !0,
|
|
3332
|
-
onValueDelete:
|
|
3333
|
-
icon: /* @__PURE__ */
|
|
3434
|
+
onValueDelete: lt,
|
|
3435
|
+
icon: /* @__PURE__ */ U.jsx(Bt, {})
|
|
3334
3436
|
}
|
|
3335
3437
|
);
|
|
3336
|
-
}, [
|
|
3337
|
-
top:
|
|
3338
|
-
left:
|
|
3339
|
-
bottom:
|
|
3340
|
-
right:
|
|
3341
|
-
opacity:
|
|
3438
|
+
}, [le, S, D, lt, p]), pt = ie(() => ({
|
|
3439
|
+
top: F?.top,
|
|
3440
|
+
left: F?.left,
|
|
3441
|
+
bottom: F?.bottom,
|
|
3442
|
+
right: F?.right,
|
|
3443
|
+
opacity: _ && V ? 1 : 0,
|
|
3342
3444
|
transition: "opacity 0.15s linear",
|
|
3343
3445
|
position: "fixed",
|
|
3344
3446
|
zIndex: 1e3,
|
|
3345
|
-
pointerEvents:
|
|
3346
|
-
}), [
|
|
3347
|
-
return /* @__PURE__ */
|
|
3348
|
-
|
|
3447
|
+
pointerEvents: _ && V ? "auto" : "none"
|
|
3448
|
+
}), [F, _, V]);
|
|
3449
|
+
return /* @__PURE__ */ U.jsxs("div", { className: tt("relative w-max flex flex-col gap-2 lg:min-w-[360px] min-w-auto", p?.className), children: [
|
|
3450
|
+
ht && /* @__PURE__ */ U.jsx(
|
|
3349
3451
|
"div",
|
|
3350
3452
|
{
|
|
3351
3453
|
ref: $e,
|
|
3352
3454
|
className: "relative w-full",
|
|
3353
|
-
children: t === "multiple" ?
|
|
3354
|
-
|
|
3455
|
+
children: t === "multiple" ? gt() : /* @__PURE__ */ U.jsx(
|
|
3456
|
+
In,
|
|
3355
3457
|
{
|
|
3356
3458
|
...p,
|
|
3357
|
-
ref:
|
|
3358
|
-
readOnly:
|
|
3359
|
-
icon: /* @__PURE__ */
|
|
3459
|
+
ref: Fe,
|
|
3460
|
+
readOnly: f || p?.readOnly,
|
|
3461
|
+
icon: /* @__PURE__ */ U.jsx(Bt, {}),
|
|
3360
3462
|
iconPosition: "right",
|
|
3361
3463
|
type: "text",
|
|
3362
3464
|
inputMode: p?.inputMode ?? "numeric",
|
|
3363
3465
|
value: X,
|
|
3364
|
-
onChange: (
|
|
3365
|
-
if (
|
|
3366
|
-
p?.onChange?.(
|
|
3466
|
+
onChange: (m) => {
|
|
3467
|
+
if (f) {
|
|
3468
|
+
p?.onChange?.(m);
|
|
3367
3469
|
return;
|
|
3368
3470
|
}
|
|
3369
|
-
|
|
3471
|
+
Z(m.target.value);
|
|
3370
3472
|
},
|
|
3371
3473
|
name: D,
|
|
3372
3474
|
label: S,
|
|
3373
|
-
onFocus: (
|
|
3374
|
-
|
|
3475
|
+
onFocus: (m) => {
|
|
3476
|
+
m.stopPropagation(), p?.onFocus?.(m), g === "input" && z(!0);
|
|
3375
3477
|
},
|
|
3376
|
-
onClick: (
|
|
3377
|
-
|
|
3478
|
+
onClick: (m) => {
|
|
3479
|
+
m.stopPropagation(), g === "input" && !V && z(!0);
|
|
3378
3480
|
},
|
|
3379
|
-
onBlur: (
|
|
3380
|
-
p?.onBlur?.(
|
|
3481
|
+
onBlur: (m) => {
|
|
3482
|
+
p?.onBlur?.(m), f || Ze();
|
|
3381
3483
|
},
|
|
3382
|
-
onKeyDown: (
|
|
3383
|
-
p?.onKeyDown?.(
|
|
3484
|
+
onKeyDown: (m) => {
|
|
3485
|
+
p?.onKeyDown?.(m), f || yt(m);
|
|
3384
3486
|
}
|
|
3385
3487
|
}
|
|
3386
3488
|
)
|
|
3387
3489
|
}
|
|
3388
3490
|
),
|
|
3389
|
-
mt && (g === "input" ? document?.body &&
|
|
3390
|
-
/* @__PURE__ */
|
|
3391
|
-
|
|
3491
|
+
mt && (g === "input" ? document?.body && Bn(
|
|
3492
|
+
/* @__PURE__ */ U.jsx(
|
|
3493
|
+
Ct,
|
|
3392
3494
|
{
|
|
3393
3495
|
mode: t,
|
|
3394
|
-
footer:
|
|
3395
|
-
header:
|
|
3496
|
+
footer: a,
|
|
3497
|
+
header: s,
|
|
3396
3498
|
selected: n,
|
|
3397
|
-
ref:
|
|
3398
|
-
endMonth:
|
|
3499
|
+
ref: Oe,
|
|
3500
|
+
endMonth: u,
|
|
3399
3501
|
required: o,
|
|
3400
|
-
onApply:
|
|
3502
|
+
onApply: it,
|
|
3401
3503
|
onCancel: Ue,
|
|
3402
3504
|
hideFooter: v,
|
|
3403
|
-
startMonth:
|
|
3505
|
+
startMonth: d,
|
|
3404
3506
|
applyLabel: M,
|
|
3405
3507
|
cancelLabel: w,
|
|
3406
3508
|
displayValue: Ae,
|
|
3407
|
-
disabledDates:
|
|
3408
|
-
numberOfMonths: je ? 1 :
|
|
3409
|
-
onSelect:
|
|
3509
|
+
disabledDates: i,
|
|
3510
|
+
numberOfMonths: je ? 1 : l,
|
|
3511
|
+
onSelect: Ke,
|
|
3410
3512
|
hideOutsideDays: c,
|
|
3411
|
-
showActionButtons:
|
|
3412
|
-
min:
|
|
3513
|
+
showActionButtons: f,
|
|
3514
|
+
min: O,
|
|
3413
3515
|
max: x,
|
|
3414
3516
|
excludeDisabled: j,
|
|
3415
|
-
className:
|
|
3416
|
-
style:
|
|
3517
|
+
className: tt("bg-neutral-strong-default text-neutral-default-default shadow", y),
|
|
3518
|
+
style: pt
|
|
3417
3519
|
}
|
|
3418
3520
|
),
|
|
3419
3521
|
document.body
|
|
3420
|
-
) : /* @__PURE__ */
|
|
3421
|
-
|
|
3522
|
+
) : /* @__PURE__ */ U.jsx(
|
|
3523
|
+
Ct,
|
|
3422
3524
|
{
|
|
3423
|
-
min:
|
|
3525
|
+
min: O,
|
|
3424
3526
|
max: x,
|
|
3425
3527
|
mode: t,
|
|
3426
|
-
header:
|
|
3427
|
-
footer:
|
|
3528
|
+
header: s,
|
|
3529
|
+
footer: a,
|
|
3428
3530
|
required: o,
|
|
3429
|
-
endMonth:
|
|
3531
|
+
endMonth: u,
|
|
3430
3532
|
selected: n,
|
|
3431
3533
|
className: y,
|
|
3432
|
-
onApply:
|
|
3433
|
-
startMonth:
|
|
3534
|
+
onApply: it,
|
|
3535
|
+
startMonth: d,
|
|
3434
3536
|
applyLabel: M,
|
|
3435
3537
|
hideFooter: v,
|
|
3436
3538
|
onCancel: Ue,
|
|
3437
3539
|
cancelLabel: w,
|
|
3438
3540
|
displayValue: Ae,
|
|
3439
|
-
disabledDates:
|
|
3440
|
-
numberOfMonths: je ? 1 :
|
|
3441
|
-
onSelect:
|
|
3541
|
+
disabledDates: i,
|
|
3542
|
+
numberOfMonths: je ? 1 : l,
|
|
3543
|
+
onSelect: Ke,
|
|
3442
3544
|
hideOutsideDays: c,
|
|
3443
|
-
showActionButtons:
|
|
3545
|
+
showActionButtons: f,
|
|
3444
3546
|
excludeDisabled: j
|
|
3445
3547
|
}
|
|
3446
3548
|
))
|
|
3447
3549
|
] });
|
|
3448
|
-
},
|
|
3550
|
+
}, Ct = Fn((e) => {
|
|
3449
3551
|
const {
|
|
3450
3552
|
ref: t,
|
|
3451
3553
|
min: o,
|
|
3452
3554
|
max: n,
|
|
3453
3555
|
style: r,
|
|
3454
|
-
header:
|
|
3455
|
-
footer:
|
|
3456
|
-
onApply:
|
|
3556
|
+
header: i,
|
|
3557
|
+
footer: s,
|
|
3558
|
+
onApply: a,
|
|
3457
3559
|
onCancel: c,
|
|
3458
|
-
onSelect:
|
|
3459
|
-
required:
|
|
3460
|
-
endMonth:
|
|
3461
|
-
className:
|
|
3560
|
+
onSelect: l,
|
|
3561
|
+
required: d,
|
|
3562
|
+
endMonth: u,
|
|
3563
|
+
className: f,
|
|
3462
3564
|
startMonth: M,
|
|
3463
3565
|
displayValue: w,
|
|
3464
3566
|
disabledDates: C,
|
|
3465
|
-
excludeDisabled:
|
|
3567
|
+
excludeDisabled: W,
|
|
3466
3568
|
mode: v = "single",
|
|
3467
3569
|
readonly: g = !1,
|
|
3468
3570
|
numberOfMonths: p = 1,
|
|
3469
3571
|
hideFooter: S = !1,
|
|
3470
3572
|
applyLabel: D = "Aplicar",
|
|
3471
3573
|
cancelLabel: y = "Cancelar",
|
|
3472
|
-
hideOutsideDays:
|
|
3574
|
+
hideOutsideDays: O = !1,
|
|
3473
3575
|
showActionButtons: x = !1
|
|
3474
|
-
} = e, j =
|
|
3576
|
+
} = e, j = ie(() => {
|
|
3475
3577
|
if (w) {
|
|
3476
3578
|
if (v === "single")
|
|
3477
3579
|
return w;
|
|
3478
3580
|
if (v === "range") {
|
|
3479
|
-
const
|
|
3480
|
-
return
|
|
3581
|
+
const _ = w;
|
|
3582
|
+
return _.to ? _.to : _.from ? _.from : void 0;
|
|
3481
3583
|
}
|
|
3482
3584
|
if (v === "multiple") {
|
|
3483
|
-
const
|
|
3484
|
-
return
|
|
3585
|
+
const _ = w;
|
|
3586
|
+
return _.length > 0 ? _[_.length - 1] : void 0;
|
|
3485
3587
|
}
|
|
3486
3588
|
}
|
|
3487
|
-
}, [w, v]),
|
|
3488
|
-
formatWeekdayName: (
|
|
3489
|
-
}), []), K =
|
|
3589
|
+
}, [w, v]), F = ie(() => ({
|
|
3590
|
+
formatWeekdayName: (_) => _.toLocaleDateString("es-ES", { weekday: "narrow" }).toUpperCase()
|
|
3591
|
+
}), []), K = ie(() => ({
|
|
3490
3592
|
// Días de la semana (cabecera)
|
|
3491
3593
|
weekday: " prometeo-fonts-body-large text-neutral-default-default h-12 w-12 ",
|
|
3492
3594
|
// Días del mes
|
|
@@ -3507,21 +3609,21 @@ const hs = (e) => {
|
|
|
3507
3609
|
//Contenedor
|
|
3508
3610
|
months: "flex gap-4 justify-center relative w-full flex-wrap overflow-auto ",
|
|
3509
3611
|
root: "px-2 text-neutral-default-default "
|
|
3510
|
-
}), [g]), V =
|
|
3511
|
-
if (
|
|
3512
|
-
const
|
|
3513
|
-
return new Date(
|
|
3514
|
-
}, [
|
|
3515
|
-
const
|
|
3516
|
-
return `${v}-${
|
|
3612
|
+
}), [g]), V = ie(() => {
|
|
3613
|
+
if (u) return u;
|
|
3614
|
+
const _ = /* @__PURE__ */ new Date();
|
|
3615
|
+
return new Date(_.getFullYear() + 20, 11, 31);
|
|
3616
|
+
}, [u]), z = ie(() => {
|
|
3617
|
+
const _ = w ? JSON.stringify(w) : "empty";
|
|
3618
|
+
return `${v}-${_}`;
|
|
3517
3619
|
}, [v, w]);
|
|
3518
|
-
return /* @__PURE__ */
|
|
3620
|
+
return /* @__PURE__ */ U.jsxs(
|
|
3519
3621
|
"div",
|
|
3520
3622
|
{
|
|
3521
3623
|
ref: t,
|
|
3522
|
-
className:
|
|
3624
|
+
className: tt(
|
|
3523
3625
|
"border border-neutral-default-default rounded-lg",
|
|
3524
|
-
|
|
3626
|
+
f
|
|
3525
3627
|
),
|
|
3526
3628
|
style: {
|
|
3527
3629
|
...r,
|
|
@@ -3529,80 +3631,80 @@ const hs = (e) => {
|
|
|
3529
3631
|
overflowX: "auto"
|
|
3530
3632
|
},
|
|
3531
3633
|
children: [
|
|
3532
|
-
|
|
3533
|
-
v === "single" && /* @__PURE__ */
|
|
3534
|
-
|
|
3634
|
+
i && /* @__PURE__ */ U.jsx("div", { className: "pt-6 pl-6 pr-3 pb-2 min-h-[68px]", children: typeof i == "string" ? /* @__PURE__ */ U.jsx("p", { className: "prometeo-fonts-label-large text-neutral-medium-default w-64 ", children: i }) : i }),
|
|
3635
|
+
v === "single" && /* @__PURE__ */ U.jsx(
|
|
3636
|
+
St,
|
|
3535
3637
|
{
|
|
3536
|
-
locale:
|
|
3638
|
+
locale: Dt,
|
|
3537
3639
|
mode: "single",
|
|
3538
3640
|
captionLayout: "dropdown",
|
|
3539
|
-
formatters:
|
|
3641
|
+
formatters: F,
|
|
3540
3642
|
classNames: K,
|
|
3541
|
-
required:
|
|
3643
|
+
required: d,
|
|
3542
3644
|
disabled: C,
|
|
3543
3645
|
selected: w,
|
|
3544
3646
|
defaultMonth: j,
|
|
3545
3647
|
className: "px-3",
|
|
3546
|
-
showOutsideDays: !
|
|
3648
|
+
showOutsideDays: !O,
|
|
3547
3649
|
numberOfMonths: p,
|
|
3548
3650
|
startMonth: M,
|
|
3549
3651
|
endMonth: V,
|
|
3550
3652
|
onSelect: g ? () => {
|
|
3551
|
-
} :
|
|
3653
|
+
} : l
|
|
3552
3654
|
},
|
|
3553
|
-
|
|
3655
|
+
z
|
|
3554
3656
|
),
|
|
3555
|
-
v === "range" && /* @__PURE__ */
|
|
3556
|
-
|
|
3657
|
+
v === "range" && /* @__PURE__ */ U.jsx(
|
|
3658
|
+
St,
|
|
3557
3659
|
{
|
|
3558
3660
|
mode: "range",
|
|
3559
3661
|
captionLayout: "dropdown",
|
|
3560
|
-
formatters:
|
|
3662
|
+
formatters: F,
|
|
3561
3663
|
classNames: K,
|
|
3562
3664
|
numberOfMonths: p,
|
|
3563
3665
|
selected: w,
|
|
3564
3666
|
defaultMonth: j,
|
|
3565
3667
|
onSelect: g ? () => {
|
|
3566
|
-
} :
|
|
3567
|
-
required:
|
|
3668
|
+
} : l,
|
|
3669
|
+
required: d,
|
|
3568
3670
|
disabled: C,
|
|
3569
3671
|
startMonth: M,
|
|
3570
3672
|
endMonth: V,
|
|
3571
3673
|
min: o,
|
|
3572
3674
|
max: n,
|
|
3573
3675
|
pagedNavigation: !0,
|
|
3574
|
-
locale:
|
|
3575
|
-
excludeDisabled:
|
|
3676
|
+
locale: Dt,
|
|
3677
|
+
excludeDisabled: W ?? !0
|
|
3576
3678
|
},
|
|
3577
|
-
|
|
3679
|
+
z
|
|
3578
3680
|
),
|
|
3579
|
-
v === "multiple" && /* @__PURE__ */
|
|
3580
|
-
|
|
3681
|
+
v === "multiple" && /* @__PURE__ */ U.jsx(
|
|
3682
|
+
St,
|
|
3581
3683
|
{
|
|
3582
3684
|
mode: "multiple",
|
|
3583
3685
|
captionLayout: "dropdown",
|
|
3584
|
-
formatters:
|
|
3686
|
+
formatters: F,
|
|
3585
3687
|
classNames: K,
|
|
3586
3688
|
selected: w,
|
|
3587
3689
|
defaultMonth: j,
|
|
3588
3690
|
onSelect: g ? () => {
|
|
3589
|
-
} :
|
|
3590
|
-
required:
|
|
3691
|
+
} : l,
|
|
3692
|
+
required: d,
|
|
3591
3693
|
disabled: C,
|
|
3592
3694
|
startMonth: M,
|
|
3593
|
-
endMonth:
|
|
3695
|
+
endMonth: u,
|
|
3594
3696
|
min: o,
|
|
3595
3697
|
max: n,
|
|
3596
|
-
locale:
|
|
3698
|
+
locale: Dt
|
|
3597
3699
|
},
|
|
3598
|
-
|
|
3700
|
+
z
|
|
3599
3701
|
),
|
|
3600
|
-
!S && /* @__PURE__ */
|
|
3702
|
+
!S && /* @__PURE__ */ U.jsx("div", { className: tt(
|
|
3601
3703
|
"w-full min-h-[40px] pt-2 px-3 pb-3 flex items-center relative"
|
|
3602
|
-
), children: typeof
|
|
3603
|
-
x && /* @__PURE__ */
|
|
3604
|
-
/* @__PURE__ */
|
|
3605
|
-
|
|
3704
|
+
), children: typeof s == "string" ? /* @__PURE__ */ U.jsx("p", { className: "prometeo-fonts-label-large text-neutral-medium-default w-64 ", children: s }) : s }),
|
|
3705
|
+
x && /* @__PURE__ */ U.jsxs("div", { className: "w-full px-3 pb-3 pt-2 flex gap-2 justify-end ", children: [
|
|
3706
|
+
/* @__PURE__ */ U.jsx(
|
|
3707
|
+
jt,
|
|
3606
3708
|
{
|
|
3607
3709
|
variant: "text",
|
|
3608
3710
|
onClick: c,
|
|
@@ -3610,10 +3712,10 @@ const hs = (e) => {
|
|
|
3610
3712
|
children: y
|
|
3611
3713
|
}
|
|
3612
3714
|
),
|
|
3613
|
-
/* @__PURE__ */
|
|
3614
|
-
|
|
3715
|
+
/* @__PURE__ */ U.jsx(
|
|
3716
|
+
jt,
|
|
3615
3717
|
{
|
|
3616
|
-
onClick:
|
|
3718
|
+
onClick: a,
|
|
3617
3719
|
variant: "text",
|
|
3618
3720
|
color: "primary",
|
|
3619
3721
|
children: D
|
|
@@ -3624,8 +3726,8 @@ const hs = (e) => {
|
|
|
3624
3726
|
}
|
|
3625
3727
|
);
|
|
3626
3728
|
});
|
|
3627
|
-
|
|
3729
|
+
Ct.displayName = "Calendar";
|
|
3628
3730
|
export {
|
|
3629
|
-
|
|
3630
|
-
|
|
3731
|
+
Ct as C,
|
|
3732
|
+
gs as D
|
|
3631
3733
|
};
|