@adamosuiteservices/ui 2.10.13 → 2.11.14

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