@krosoft/react 0.0.87 → 0.0.89

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 (37) hide show
  1. package/dist/{AppSubTitle-DaFa30Qp.js → AppSubTitle-RKbtrPJr.js} +1 -1
  2. package/dist/{AppTitle-COtcNGNr.js → AppTitle-DCQpP2qE.js} +27 -27
  3. package/dist/AppVerticalTabs-pK3i9ZTD.js +110 -0
  4. package/dist/FormDialog-CXLQG83d.js +250 -0
  5. package/dist/{MetricCard-L5ETuqBs.js → MetricCard-DB1ME6tD.js} +3 -3
  6. package/dist/{SearchInput-BxnaShYy.js → SearchInput-D_SLIZ2y.js} +37 -37
  7. package/dist/{TableFilter-RzydxKBF.js → TableFilter-DXTOY-oa.js} +22 -22
  8. package/dist/{TableSettings-Bwysm3KH.js → TableSettings-CBtuAPgM.js} +27 -27
  9. package/dist/{ThemeSelector-mZBbr2qt.js → ThemeSelector-CU8JmN2b.js} +14 -15
  10. package/dist/{Topbar-DzFClMWt.js → Topbar-BzZxu1Zi.js} +28 -29
  11. package/dist/{badge-DCS7KMnM.js → badge-DyRSpnOb.js} +3 -3
  12. package/dist/components/core/cards/index.js +1 -1
  13. package/dist/components/core/dialogs/index.js +12 -11
  14. package/dist/components/core/filters/index.js +1 -1
  15. package/dist/components/core/index.js +55 -54
  16. package/dist/components/core/inputs/index.js +1 -1
  17. package/dist/components/core/layouts/index.js +2 -2
  18. package/dist/components/core/navbar/index.js +1 -1
  19. package/dist/components/core/table/index.js +1 -1
  20. package/dist/components/core/tabs/index.js +1 -1
  21. package/dist/components/core/theme/index.js +1 -1
  22. package/dist/components/index.js +136 -108
  23. package/dist/components/ui/index.d.ts +8 -0
  24. package/dist/components/ui/index.d.ts.map +1 -1
  25. package/dist/components/ui/index.js +89 -50
  26. package/dist/ellipsis-vertical-CqrunffH.js +15 -0
  27. package/dist/{select-C6w0ck7-.js → select-B5wF6jxC.js} +6 -6
  28. package/dist/skeleton-CJ1F2tD3.js +8 -0
  29. package/dist/tabs-BYqvMsA6.js +6628 -0
  30. package/dist/tooltip-BzTGwm2E.js +2505 -0
  31. package/package.json +2 -2
  32. package/dist/AppVerticalTabs-aeKDheVe.js +0 -829
  33. package/dist/FormDialog-B3u7bHU_.js +0 -472
  34. package/dist/dropdown-menu-BDcm9kW8.js +0 -1086
  35. package/dist/index-DUnCfjrC.js +0 -2176
  36. package/dist/popover-PsZp711z.js +0 -4533
  37. package/dist/tooltip-CtjaR1qq.js +0 -337
@@ -1,4533 +0,0 @@
1
- import { jsx as m, jsxs as pe, Fragment as Ae } from "react/jsx-runtime";
2
- import * as f from "react";
3
- import k, { createContext as Wo, useContext as _o, useCallback as te, useRef as Xe, useLayoutEffect as Ro, useState as kt, useEffect as Fo, useMemo as Ue } from "react";
4
- import { c as et, P as xe, h as Q, f as tt, u as ve, i as j, q as Io, a as nt, r as Ao, l as Ze, s as fn, t as Yo, n as Bo, o as $o, p as Ho, m as hn, D as mn, v as qo, e as Qe, b as mt, d as gn, C as jo, g as Vo, A as yn, j as Go } from "./index-DUnCfjrC.js";
5
- import { c as $ } from "./index-gWiv5-6R.js";
6
- import { n as zo, C as Ko, j as Xo, P as xt, R as pn, l as vn, k as wn, F as bn } from "./select-C6w0ck7-.js";
7
- import * as Uo from "react-dom";
8
- import { c as Nt } from "./createLucideIcon-CRdjzt2A.js";
9
- const Qo = et(
10
- "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
11
- {
12
- variants: {
13
- variant: {
14
- default: "bg-background text-foreground",
15
- destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
16
- }
17
- },
18
- defaultVariants: {
19
- variant: "default"
20
- }
21
- }
22
- ), Zo = f.forwardRef(
23
- ({ className: e, variant: t, ...n }, r) => /* @__PURE__ */ m("div", { ref: r, role: "alert", className: $(Qo({ variant: t }), e), ...n })
24
- );
25
- Zo.displayName = "Alert";
26
- const Jo = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m("h5", { ref: n, className: $("mb-1 font-medium leading-none tracking-tight", e), ...t }));
27
- Jo.displayName = "AlertTitle";
28
- const Lo = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m("div", { ref: n, className: $("text-sm [&_p]:leading-relaxed", e), ...t }));
29
- Lo.displayName = "AlertDescription";
30
- var rt = "Checkbox", [ea] = nt(rt), [ta, Tt] = ea(rt);
31
- function na(e) {
32
- const {
33
- __scopeCheckbox: t,
34
- checked: n,
35
- children: r,
36
- defaultChecked: o,
37
- disabled: a,
38
- form: s,
39
- name: i,
40
- onCheckedChange: c,
41
- required: u,
42
- value: l = "on",
43
- // @ts-expect-error
44
- internal_do_not_use_render: d
45
- } = e, [y, w] = tt({
46
- prop: n,
47
- defaultProp: o ?? !1,
48
- onChange: c,
49
- caller: rt
50
- }), [C, b] = f.useState(null), [v, O] = f.useState(null), g = f.useRef(!1), p = C ? !!s || !!C.closest("form") : (
51
- // We set this to true by default so that events bubble to forms without JS (SSR)
52
- !0
53
- ), x = {
54
- checked: y,
55
- disabled: a,
56
- setChecked: w,
57
- control: C,
58
- setControl: b,
59
- name: i,
60
- form: s,
61
- value: l,
62
- hasConsumerStoppedPropagationRef: g,
63
- required: u,
64
- defaultChecked: De(o) ? !1 : o,
65
- isFormControl: p,
66
- bubbleInput: v,
67
- setBubbleInput: O
68
- };
69
- return /* @__PURE__ */ m(
70
- ta,
71
- {
72
- scope: t,
73
- ...x,
74
- children: ra(d) ? d(x) : r
75
- }
76
- );
77
- }
78
- var Dn = "CheckboxTrigger", kn = f.forwardRef(
79
- ({ __scopeCheckbox: e, onKeyDown: t, onClick: n, ...r }, o) => {
80
- const {
81
- control: a,
82
- value: s,
83
- disabled: i,
84
- checked: c,
85
- required: u,
86
- setControl: l,
87
- setChecked: d,
88
- hasConsumerStoppedPropagationRef: y,
89
- isFormControl: w,
90
- bubbleInput: C
91
- } = Tt(Dn, e), b = ve(o, l), v = f.useRef(c);
92
- return f.useEffect(() => {
93
- const O = a == null ? void 0 : a.form;
94
- if (O) {
95
- const g = () => d(v.current);
96
- return O.addEventListener("reset", g), () => O.removeEventListener("reset", g);
97
- }
98
- }, [a, d]), /* @__PURE__ */ m(
99
- Q.button,
100
- {
101
- type: "button",
102
- role: "checkbox",
103
- "aria-checked": De(c) ? "mixed" : c,
104
- "aria-required": u,
105
- "data-state": Nn(c),
106
- "data-disabled": i ? "" : void 0,
107
- disabled: i,
108
- value: s,
109
- ...r,
110
- ref: b,
111
- onKeyDown: j(t, (O) => {
112
- O.key === "Enter" && O.preventDefault();
113
- }),
114
- onClick: j(n, (O) => {
115
- d((g) => De(g) ? !0 : !g), C && w && (y.current = O.isPropagationStopped(), y.current || O.stopPropagation());
116
- })
117
- }
118
- );
119
- }
120
- );
121
- kn.displayName = Dn;
122
- var St = f.forwardRef(
123
- (e, t) => {
124
- const {
125
- __scopeCheckbox: n,
126
- name: r,
127
- checked: o,
128
- defaultChecked: a,
129
- required: s,
130
- disabled: i,
131
- value: c,
132
- onCheckedChange: u,
133
- form: l,
134
- ...d
135
- } = e;
136
- return /* @__PURE__ */ m(
137
- na,
138
- {
139
- __scopeCheckbox: n,
140
- checked: o,
141
- defaultChecked: a,
142
- disabled: i,
143
- required: s,
144
- onCheckedChange: u,
145
- name: r,
146
- form: l,
147
- value: c,
148
- internal_do_not_use_render: ({ isFormControl: y }) => /* @__PURE__ */ pe(Ae, { children: [
149
- /* @__PURE__ */ m(
150
- kn,
151
- {
152
- ...d,
153
- ref: t,
154
- __scopeCheckbox: n
155
- }
156
- ),
157
- y && /* @__PURE__ */ m(
158
- xn,
159
- {
160
- __scopeCheckbox: n
161
- }
162
- )
163
- ] })
164
- }
165
- );
166
- }
167
- );
168
- St.displayName = rt;
169
- var Mn = "CheckboxIndicator", On = f.forwardRef(
170
- (e, t) => {
171
- const { __scopeCheckbox: n, forceMount: r, ...o } = e, a = Tt(Mn, n);
172
- return /* @__PURE__ */ m(
173
- xe,
174
- {
175
- present: r || De(a.checked) || a.checked === !0,
176
- children: /* @__PURE__ */ m(
177
- Q.span,
178
- {
179
- "data-state": Nn(a.checked),
180
- "data-disabled": a.disabled ? "" : void 0,
181
- ...o,
182
- ref: t,
183
- style: { pointerEvents: "none", ...e.style }
184
- }
185
- )
186
- }
187
- );
188
- }
189
- );
190
- On.displayName = Mn;
191
- var Cn = "CheckboxBubbleInput", xn = f.forwardRef(
192
- ({ __scopeCheckbox: e, ...t }, n) => {
193
- const {
194
- control: r,
195
- hasConsumerStoppedPropagationRef: o,
196
- checked: a,
197
- defaultChecked: s,
198
- required: i,
199
- disabled: c,
200
- name: u,
201
- value: l,
202
- form: d,
203
- bubbleInput: y,
204
- setBubbleInput: w
205
- } = Tt(Cn, e), C = ve(n, w), b = zo(a), v = Io(r);
206
- f.useEffect(() => {
207
- const g = y;
208
- if (!g) return;
209
- const p = window.HTMLInputElement.prototype, M = Object.getOwnPropertyDescriptor(
210
- p,
211
- "checked"
212
- ).set, h = !o.current;
213
- if (b !== a && M) {
214
- const N = new Event("click", { bubbles: h });
215
- g.indeterminate = De(a), M.call(g, De(a) ? !1 : a), g.dispatchEvent(N);
216
- }
217
- }, [y, b, a, o]);
218
- const O = f.useRef(De(a) ? !1 : a);
219
- return /* @__PURE__ */ m(
220
- Q.input,
221
- {
222
- type: "checkbox",
223
- "aria-hidden": !0,
224
- defaultChecked: s ?? O.current,
225
- required: i,
226
- disabled: c,
227
- name: u,
228
- value: l,
229
- form: d,
230
- ...t,
231
- tabIndex: -1,
232
- ref: C,
233
- style: {
234
- ...t.style,
235
- ...v,
236
- position: "absolute",
237
- pointerEvents: "none",
238
- opacity: 0,
239
- margin: 0,
240
- // We transform because the input is absolutely positioned but we have
241
- // rendered it **after** the button. This pulls it back to sit on top
242
- // of the button.
243
- transform: "translateX(-100%)"
244
- }
245
- }
246
- );
247
- }
248
- );
249
- xn.displayName = Cn;
250
- function ra(e) {
251
- return typeof e == "function";
252
- }
253
- function De(e) {
254
- return e === "indeterminate";
255
- }
256
- function Nn(e) {
257
- return De(e) ? "indeterminate" : e ? "checked" : "unchecked";
258
- }
259
- /**
260
- * @license lucide-react v1.16.0 - ISC
261
- *
262
- * This source code is licensed under the ISC license.
263
- * See the LICENSE file in the root directory of this source tree.
264
- */
265
- const oa = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], aa = Nt("chevron-left", oa);
266
- /**
267
- * @license lucide-react v1.16.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */
272
- const sa = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], ia = Nt("chevron-right", sa);
273
- /**
274
- * @license lucide-react v1.16.0 - ISC
275
- *
276
- * This source code is licensed under the ISC license.
277
- * See the LICENSE file in the root directory of this source tree.
278
- */
279
- const ca = [
280
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
281
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
282
- ], Tn = Nt("x", ca), ua = f.forwardRef(
283
- ({ className: e, ...t }, n) => /* @__PURE__ */ m(
284
- St,
285
- {
286
- ref: n,
287
- className: $(
288
- "peer size-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",
289
- e
290
- ),
291
- ...t,
292
- children: /* @__PURE__ */ m(On, { className: $("flex items-center justify-center text-current"), children: t.checked === "indeterminate" ? /* @__PURE__ */ m("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 3, className: "size-3", children: /* @__PURE__ */ m("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) }) : /* @__PURE__ */ m(Ko, { className: "size-3" }) })
293
- }
294
- )
295
- );
296
- ua.displayName = St.displayName;
297
- const la = f.forwardRef(({ className: e, type: t, ...n }, r) => /* @__PURE__ */ m(
298
- "input",
299
- {
300
- type: t,
301
- className: $(
302
- "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
303
- e
304
- ),
305
- ref: r,
306
- ...n
307
- }
308
- ));
309
- la.displayName = "Input";
310
- var Pt = "ToastProvider", [Et, da, fa] = Xo("Toast"), [Sn] = nt("Toast", [fa]), [ha, ot] = Sn(Pt), Pn = (e) => {
311
- const {
312
- __scopeToast: t,
313
- label: n = "Notification",
314
- duration: r = 5e3,
315
- swipeDirection: o = "right",
316
- swipeThreshold: a = 50,
317
- children: s
318
- } = e, [i, c] = f.useState(null), [u, l] = f.useState(0), d = f.useRef(!1), y = f.useRef(!1);
319
- return n.trim() || console.error(
320
- `Invalid prop \`label\` supplied to \`${Pt}\`. Expected non-empty \`string\`.`
321
- ), /* @__PURE__ */ m(Et.Provider, { scope: t, children: /* @__PURE__ */ m(
322
- ha,
323
- {
324
- scope: t,
325
- label: n,
326
- duration: r,
327
- swipeDirection: o,
328
- swipeThreshold: a,
329
- toastCount: u,
330
- viewport: i,
331
- onViewportChange: c,
332
- onToastAdd: f.useCallback(() => l((w) => w + 1), []),
333
- onToastRemove: f.useCallback(() => l((w) => w - 1), []),
334
- isFocusedToastEscapeKeyDownRef: d,
335
- isClosePausedRef: y,
336
- children: s
337
- }
338
- ) });
339
- };
340
- Pn.displayName = Pt;
341
- var En = "ToastViewport", ma = ["F8"], Mt = "toast.viewportPause", Ot = "toast.viewportResume", Wn = f.forwardRef(
342
- (e, t) => {
343
- const {
344
- __scopeToast: n,
345
- hotkey: r = ma,
346
- label: o = "Notifications ({hotkey})",
347
- ...a
348
- } = e, s = ot(En, n), i = da(n), c = f.useRef(null), u = f.useRef(null), l = f.useRef(null), d = f.useRef(null), y = ve(t, d, s.onViewportChange), w = r.join("+").replace(/Key/g, "").replace(/Digit/g, ""), C = s.toastCount > 0;
349
- f.useEffect(() => {
350
- const v = (O) => {
351
- var p;
352
- r.length !== 0 && r.every((x) => O[x] || O.code === x) && ((p = d.current) == null || p.focus());
353
- };
354
- return document.addEventListener("keydown", v), () => document.removeEventListener("keydown", v);
355
- }, [r]), f.useEffect(() => {
356
- const v = c.current, O = d.current;
357
- if (C && v && O) {
358
- const g = () => {
359
- if (!s.isClosePausedRef.current) {
360
- const h = new CustomEvent(Mt);
361
- O.dispatchEvent(h), s.isClosePausedRef.current = !0;
362
- }
363
- }, p = () => {
364
- if (s.isClosePausedRef.current) {
365
- const h = new CustomEvent(Ot);
366
- O.dispatchEvent(h), s.isClosePausedRef.current = !1;
367
- }
368
- }, x = (h) => {
369
- !v.contains(h.relatedTarget) && p();
370
- }, M = () => {
371
- v.contains(document.activeElement) || p();
372
- };
373
- return v.addEventListener("focusin", g), v.addEventListener("focusout", x), v.addEventListener("pointermove", g), v.addEventListener("pointerleave", M), window.addEventListener("blur", g), window.addEventListener("focus", p), () => {
374
- v.removeEventListener("focusin", g), v.removeEventListener("focusout", x), v.removeEventListener("pointermove", g), v.removeEventListener("pointerleave", M), window.removeEventListener("blur", g), window.removeEventListener("focus", p);
375
- };
376
- }
377
- }, [C, s.isClosePausedRef]);
378
- const b = f.useCallback(
379
- ({ tabbingDirection: v }) => {
380
- const g = i().map((p) => {
381
- const x = p.ref.current, M = [x, ...Na(x)];
382
- return v === "forwards" ? M : M.reverse();
383
- });
384
- return (v === "forwards" ? g.reverse() : g).flat();
385
- },
386
- [i]
387
- );
388
- return f.useEffect(() => {
389
- const v = d.current;
390
- if (v) {
391
- const O = (g) => {
392
- var M, h, N;
393
- const p = g.altKey || g.ctrlKey || g.metaKey;
394
- if (g.key === "Tab" && !p) {
395
- const E = document.activeElement, _ = g.shiftKey;
396
- if (g.target === v && _) {
397
- (M = u.current) == null || M.focus();
398
- return;
399
- }
400
- const G = b({ tabbingDirection: _ ? "backwards" : "forwards" }), K = G.findIndex((T) => T === E);
401
- gt(G.slice(K + 1)) ? g.preventDefault() : _ ? (h = u.current) == null || h.focus() : (N = l.current) == null || N.focus();
402
- }
403
- };
404
- return v.addEventListener("keydown", O), () => v.removeEventListener("keydown", O);
405
- }
406
- }, [i, b]), /* @__PURE__ */ pe(
407
- Ao,
408
- {
409
- ref: c,
410
- role: "region",
411
- "aria-label": o.replace("{hotkey}", w),
412
- tabIndex: -1,
413
- style: { pointerEvents: C ? void 0 : "none" },
414
- children: [
415
- C && /* @__PURE__ */ m(
416
- Ct,
417
- {
418
- ref: u,
419
- onFocusFromOutsideViewport: () => {
420
- const v = b({
421
- tabbingDirection: "forwards"
422
- });
423
- gt(v);
424
- }
425
- }
426
- ),
427
- /* @__PURE__ */ m(Et.Slot, { scope: n, children: /* @__PURE__ */ m(Q.ol, { tabIndex: -1, ...a, ref: y }) }),
428
- C && /* @__PURE__ */ m(
429
- Ct,
430
- {
431
- ref: l,
432
- onFocusFromOutsideViewport: () => {
433
- const v = b({
434
- tabbingDirection: "backwards"
435
- });
436
- gt(v);
437
- }
438
- }
439
- )
440
- ]
441
- }
442
- );
443
- }
444
- );
445
- Wn.displayName = En;
446
- var _n = "ToastFocusProxy", Ct = f.forwardRef(
447
- (e, t) => {
448
- const { __scopeToast: n, onFocusFromOutsideViewport: r, ...o } = e, a = ot(_n, n);
449
- return /* @__PURE__ */ m(
450
- fn,
451
- {
452
- tabIndex: 0,
453
- ...o,
454
- ref: t,
455
- style: { position: "fixed" },
456
- onFocus: (s) => {
457
- var u;
458
- const i = s.relatedTarget;
459
- !((u = a.viewport) != null && u.contains(i)) && r();
460
- }
461
- }
462
- );
463
- }
464
- );
465
- Ct.displayName = _n;
466
- var $e = "Toast", ga = "toast.swipeStart", ya = "toast.swipeMove", pa = "toast.swipeCancel", va = "toast.swipeEnd", Rn = f.forwardRef(
467
- (e, t) => {
468
- const { forceMount: n, open: r, defaultOpen: o, onOpenChange: a, ...s } = e, [i, c] = tt({
469
- prop: r,
470
- defaultProp: o ?? !0,
471
- onChange: a,
472
- caller: $e
473
- });
474
- return /* @__PURE__ */ m(xe, { present: n || i, children: /* @__PURE__ */ m(
475
- Da,
476
- {
477
- open: i,
478
- ...s,
479
- ref: t,
480
- onClose: () => c(!1),
481
- onPause: Ze(e.onPause),
482
- onResume: Ze(e.onResume),
483
- onSwipeStart: j(e.onSwipeStart, (u) => {
484
- u.currentTarget.setAttribute("data-swipe", "start");
485
- }),
486
- onSwipeMove: j(e.onSwipeMove, (u) => {
487
- const { x: l, y: d } = u.detail.delta;
488
- u.currentTarget.setAttribute("data-swipe", "move"), u.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${l}px`), u.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${d}px`);
489
- }),
490
- onSwipeCancel: j(e.onSwipeCancel, (u) => {
491
- u.currentTarget.setAttribute("data-swipe", "cancel"), u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"), u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
492
- }),
493
- onSwipeEnd: j(e.onSwipeEnd, (u) => {
494
- const { x: l, y: d } = u.detail.delta;
495
- u.currentTarget.setAttribute("data-swipe", "end"), u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"), u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"), u.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${l}px`), u.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${d}px`), c(!1);
496
- })
497
- }
498
- ) });
499
- }
500
- );
501
- Rn.displayName = $e;
502
- var [wa, ba] = Sn($e, {
503
- onClose() {
504
- }
505
- }), Da = f.forwardRef(
506
- (e, t) => {
507
- const {
508
- __scopeToast: n,
509
- type: r = "foreground",
510
- duration: o,
511
- open: a,
512
- onClose: s,
513
- onEscapeKeyDown: i,
514
- onPause: c,
515
- onResume: u,
516
- onSwipeStart: l,
517
- onSwipeMove: d,
518
- onSwipeCancel: y,
519
- onSwipeEnd: w,
520
- ...C
521
- } = e, b = ot($e, n), [v, O] = f.useState(null), g = ve(t, (T) => O(T)), p = f.useRef(null), x = f.useRef(null), M = o || b.duration, h = f.useRef(0), N = f.useRef(M), E = f.useRef(0), { onToastAdd: _, onToastRemove: I } = b, B = Ze(() => {
522
- var z;
523
- (v == null ? void 0 : v.contains(document.activeElement)) && ((z = b.viewport) == null || z.focus()), s();
524
- }), G = f.useCallback(
525
- (T) => {
526
- !T || T === 1 / 0 || (window.clearTimeout(E.current), h.current = (/* @__PURE__ */ new Date()).getTime(), E.current = window.setTimeout(B, T));
527
- },
528
- [B]
529
- );
530
- f.useEffect(() => {
531
- const T = b.viewport;
532
- if (T) {
533
- const z = () => {
534
- G(N.current), u == null || u();
535
- }, Z = () => {
536
- const fe = (/* @__PURE__ */ new Date()).getTime() - h.current;
537
- N.current = N.current - fe, window.clearTimeout(E.current), c == null || c();
538
- };
539
- return T.addEventListener(Mt, Z), T.addEventListener(Ot, z), () => {
540
- T.removeEventListener(Mt, Z), T.removeEventListener(Ot, z);
541
- };
542
- }
543
- }, [b.viewport, M, c, u, G]), f.useEffect(() => {
544
- a && !b.isClosePausedRef.current && G(M);
545
- }, [a, M, b.isClosePausedRef, G]), f.useEffect(() => (_(), () => I()), [_, I]);
546
- const K = f.useMemo(() => v ? Hn(v) : null, [v]);
547
- return b.viewport ? /* @__PURE__ */ pe(Ae, { children: [
548
- K && /* @__PURE__ */ m(
549
- ka,
550
- {
551
- __scopeToast: n,
552
- role: "status",
553
- "aria-live": r === "foreground" ? "assertive" : "polite",
554
- children: K
555
- }
556
- ),
557
- /* @__PURE__ */ m(wa, { scope: n, onClose: B, children: Uo.createPortal(
558
- /* @__PURE__ */ m(Et.ItemSlot, { scope: n, children: /* @__PURE__ */ m(
559
- Yo,
560
- {
561
- asChild: !0,
562
- onEscapeKeyDown: j(i, () => {
563
- b.isFocusedToastEscapeKeyDownRef.current || B(), b.isFocusedToastEscapeKeyDownRef.current = !1;
564
- }),
565
- children: /* @__PURE__ */ m(
566
- Q.li,
567
- {
568
- tabIndex: 0,
569
- "data-state": a ? "open" : "closed",
570
- "data-swipe-direction": b.swipeDirection,
571
- ...C,
572
- ref: g,
573
- style: { userSelect: "none", touchAction: "none", ...e.style },
574
- onKeyDown: j(e.onKeyDown, (T) => {
575
- T.key === "Escape" && (i == null || i(T.nativeEvent), T.nativeEvent.defaultPrevented || (b.isFocusedToastEscapeKeyDownRef.current = !0, B()));
576
- }),
577
- onPointerDown: j(e.onPointerDown, (T) => {
578
- T.button === 0 && (p.current = { x: T.clientX, y: T.clientY });
579
- }),
580
- onPointerMove: j(e.onPointerMove, (T) => {
581
- if (!p.current) return;
582
- const z = T.clientX - p.current.x, Z = T.clientY - p.current.y, fe = !!x.current, he = ["left", "right"].includes(b.swipeDirection), X = ["left", "up"].includes(b.swipeDirection) ? Math.min : Math.max, J = he ? X(0, z) : 0, re = he ? 0 : X(0, Z), Me = T.pointerType === "touch" ? 10 : 2, ie = { x: J, y: re }, we = { originalEvent: T, delta: ie };
583
- fe ? (x.current = ie, Ke(ya, d, we, {
584
- discrete: !1
585
- })) : Qt(ie, b.swipeDirection, Me) ? (x.current = ie, Ke(ga, l, we, {
586
- discrete: !1
587
- }), T.target.setPointerCapture(T.pointerId)) : (Math.abs(z) > Me || Math.abs(Z) > Me) && (p.current = null);
588
- }),
589
- onPointerUp: j(e.onPointerUp, (T) => {
590
- const z = x.current, Z = T.target;
591
- if (Z.hasPointerCapture(T.pointerId) && Z.releasePointerCapture(T.pointerId), x.current = null, p.current = null, z) {
592
- const fe = T.currentTarget, he = { originalEvent: T, delta: z };
593
- Qt(z, b.swipeDirection, b.swipeThreshold) ? Ke(va, w, he, {
594
- discrete: !0
595
- }) : Ke(
596
- pa,
597
- y,
598
- he,
599
- {
600
- discrete: !0
601
- }
602
- ), fe.addEventListener("click", (X) => X.preventDefault(), {
603
- once: !0
604
- });
605
- }
606
- })
607
- }
608
- )
609
- }
610
- ) }),
611
- b.viewport
612
- ) })
613
- ] }) : null;
614
- }
615
- ), ka = (e) => {
616
- const { __scopeToast: t, children: n, ...r } = e, o = ot($e, t), [a, s] = f.useState(!1), [i, c] = f.useState(!1);
617
- return Ca(() => s(!0)), f.useEffect(() => {
618
- const u = window.setTimeout(() => c(!0), 1e3);
619
- return () => window.clearTimeout(u);
620
- }, []), i ? null : /* @__PURE__ */ m(xt, { asChild: !0, children: /* @__PURE__ */ m(fn, { ...r, children: a && /* @__PURE__ */ pe(Ae, { children: [
621
- o.label,
622
- " ",
623
- n
624
- ] }) }) });
625
- }, Ma = "ToastTitle", Fn = f.forwardRef(
626
- (e, t) => {
627
- const { __scopeToast: n, ...r } = e;
628
- return /* @__PURE__ */ m(Q.div, { ...r, ref: t });
629
- }
630
- );
631
- Fn.displayName = Ma;
632
- var Oa = "ToastDescription", In = f.forwardRef(
633
- (e, t) => {
634
- const { __scopeToast: n, ...r } = e;
635
- return /* @__PURE__ */ m(Q.div, { ...r, ref: t });
636
- }
637
- );
638
- In.displayName = Oa;
639
- var An = "ToastAction", Yn = f.forwardRef(
640
- (e, t) => {
641
- const { altText: n, ...r } = e;
642
- return n.trim() ? /* @__PURE__ */ m($n, { altText: n, asChild: !0, children: /* @__PURE__ */ m(Wt, { ...r, ref: t }) }) : (console.error(
643
- `Invalid prop \`altText\` supplied to \`${An}\`. Expected non-empty \`string\`.`
644
- ), null);
645
- }
646
- );
647
- Yn.displayName = An;
648
- var Bn = "ToastClose", Wt = f.forwardRef(
649
- (e, t) => {
650
- const { __scopeToast: n, ...r } = e, o = ba(Bn, n);
651
- return /* @__PURE__ */ m($n, { asChild: !0, children: /* @__PURE__ */ m(
652
- Q.button,
653
- {
654
- type: "button",
655
- ...r,
656
- ref: t,
657
- onClick: j(e.onClick, o.onClose)
658
- }
659
- ) });
660
- }
661
- );
662
- Wt.displayName = Bn;
663
- var $n = f.forwardRef((e, t) => {
664
- const { __scopeToast: n, altText: r, ...o } = e;
665
- return /* @__PURE__ */ m(
666
- Q.div,
667
- {
668
- "data-radix-toast-announce-exclude": "",
669
- "data-radix-toast-announce-alt": r || void 0,
670
- ...o,
671
- ref: t
672
- }
673
- );
674
- });
675
- function Hn(e) {
676
- const t = [];
677
- return Array.from(e.childNodes).forEach((r) => {
678
- if (r.nodeType === r.TEXT_NODE && r.textContent && t.push(r.textContent), xa(r)) {
679
- const o = r.ariaHidden || r.hidden || r.style.display === "none", a = r.dataset.radixToastAnnounceExclude === "";
680
- if (!o)
681
- if (a) {
682
- const s = r.dataset.radixToastAnnounceAlt;
683
- s && t.push(s);
684
- } else
685
- t.push(...Hn(r));
686
- }
687
- }), t;
688
- }
689
- function Ke(e, t, n, { discrete: r }) {
690
- const o = n.originalEvent.currentTarget, a = new CustomEvent(e, { bubbles: !0, cancelable: !0, detail: n });
691
- t && o.addEventListener(e, t, { once: !0 }), r ? Bo(o, a) : o.dispatchEvent(a);
692
- }
693
- var Qt = (e, t, n = 0) => {
694
- const r = Math.abs(e.x), o = Math.abs(e.y), a = r > o;
695
- return t === "left" || t === "right" ? a && r > n : !a && o > n;
696
- };
697
- function Ca(e = () => {
698
- }) {
699
- const t = Ze(e);
700
- $o(() => {
701
- let n = 0, r = 0;
702
- return n = window.requestAnimationFrame(() => r = window.requestAnimationFrame(t)), () => {
703
- window.cancelAnimationFrame(n), window.cancelAnimationFrame(r);
704
- };
705
- }, [t]);
706
- }
707
- function xa(e) {
708
- return e.nodeType === e.ELEMENT_NODE;
709
- }
710
- function Na(e) {
711
- const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
712
- acceptNode: (r) => {
713
- const o = r.tagName === "INPUT" && r.type === "hidden";
714
- return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
715
- }
716
- });
717
- for (; n.nextNode(); ) t.push(n.currentNode);
718
- return t;
719
- }
720
- function gt(e) {
721
- const t = document.activeElement;
722
- return e.some((n) => n === t ? !0 : (n.focus(), document.activeElement !== t));
723
- }
724
- var Ta = Pn, qn = Wn, jn = Rn, Vn = Fn, Gn = In, zn = Yn, Kn = Wt;
725
- const Wu = Ta, Sa = f.forwardRef(
726
- ({ className: e, ...t }, n) => /* @__PURE__ */ m(
727
- qn,
728
- {
729
- ref: n,
730
- className: $(
731
- "fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",
732
- e
733
- ),
734
- ...t
735
- }
736
- )
737
- );
738
- Sa.displayName = qn.displayName;
739
- const Pa = et(
740
- "group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
741
- {
742
- variants: {
743
- variant: {
744
- default: "border bg-background text-foreground",
745
- destructive: "destructive group border-destructive bg-destructive text-destructive-foreground"
746
- }
747
- },
748
- defaultVariants: {
749
- variant: "default"
750
- }
751
- }
752
- ), Ea = f.forwardRef(({ className: e, variant: t, ...n }, r) => /* @__PURE__ */ m(jn, { ref: r, className: $(Pa({ variant: t }), e), ...n }));
753
- Ea.displayName = jn.displayName;
754
- const Wa = f.forwardRef(
755
- ({ className: e, ...t }, n) => /* @__PURE__ */ m(
756
- zn,
757
- {
758
- ref: n,
759
- className: $(
760
- "inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",
761
- e
762
- ),
763
- ...t
764
- }
765
- )
766
- );
767
- Wa.displayName = zn.displayName;
768
- const _a = f.forwardRef(
769
- ({ className: e, ...t }, n) => /* @__PURE__ */ m(
770
- Kn,
771
- {
772
- ref: n,
773
- className: $(
774
- "absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",
775
- e
776
- ),
777
- "toast-close": "",
778
- ...t,
779
- children: /* @__PURE__ */ m(Tn, { className: "size-4" })
780
- }
781
- )
782
- );
783
- _a.displayName = Kn.displayName;
784
- const Ra = f.forwardRef(
785
- ({ className: e, ...t }, n) => /* @__PURE__ */ m(Vn, { ref: n, className: $("text-sm font-semibold", e), ...t })
786
- );
787
- Ra.displayName = Vn.displayName;
788
- const Fa = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(Gn, { ref: n, className: $("text-sm opacity-90", e), ...t }));
789
- Fa.displayName = Gn.displayName;
790
- var Ia = [
791
- "a",
792
- "button",
793
- "div",
794
- "form",
795
- "h2",
796
- "h3",
797
- "img",
798
- "input",
799
- "label",
800
- "li",
801
- "nav",
802
- "ol",
803
- "p",
804
- "select",
805
- "span",
806
- "svg",
807
- "ul"
808
- ], Aa = Ia.reduce((e, t) => {
809
- const n = Ho(`Primitive.${t}`), r = f.forwardRef((o, a) => {
810
- const { asChild: s, ...i } = o, c = s ? n : t;
811
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ m(c, { ...i, ref: a });
812
- });
813
- return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
814
- }, {}), Ya = "Label", Xn = f.forwardRef((e, t) => /* @__PURE__ */ m(
815
- Aa.label,
816
- {
817
- ...e,
818
- ref: t,
819
- onMouseDown: (n) => {
820
- var o;
821
- n.target.closest("button, input, select, textarea") || ((o = e.onMouseDown) == null || o.call(e, n), !n.defaultPrevented && n.detail > 1 && n.preventDefault());
822
- }
823
- }
824
- ));
825
- Xn.displayName = Ya;
826
- var Ba = Xn;
827
- const $a = et("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"), Ha = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(Ba, { ref: n, className: $($a(), e), ...t }));
828
- Ha.displayName = "Label";
829
- // @__NO_SIDE_EFFECTS__
830
- function qa(e) {
831
- const t = /* @__PURE__ */ ja(e), n = f.forwardRef((r, o) => {
832
- const { children: a, ...s } = r, i = f.Children.toArray(a), c = i.find(Ga);
833
- if (c) {
834
- const u = c.props.children, l = i.map((d) => d === c ? f.Children.count(u) > 1 ? f.Children.only(null) : f.isValidElement(u) ? u.props.children : null : d);
835
- return /* @__PURE__ */ m(t, { ...s, ref: o, children: f.isValidElement(u) ? f.cloneElement(u, void 0, l) : null });
836
- }
837
- return /* @__PURE__ */ m(t, { ...s, ref: o, children: a });
838
- });
839
- return n.displayName = `${e}.Slot`, n;
840
- }
841
- // @__NO_SIDE_EFFECTS__
842
- function ja(e) {
843
- const t = f.forwardRef((n, r) => {
844
- const { children: o, ...a } = n;
845
- if (f.isValidElement(o)) {
846
- const s = Ka(o), i = za(a, o.props);
847
- return o.type !== f.Fragment && (i.ref = r ? hn(r, s) : s), f.cloneElement(o, i);
848
- }
849
- return f.Children.count(o) > 1 ? f.Children.only(null) : null;
850
- });
851
- return t.displayName = `${e}.SlotClone`, t;
852
- }
853
- var Va = Symbol("radix.slottable");
854
- function Ga(e) {
855
- return f.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Va;
856
- }
857
- function za(e, t) {
858
- const n = { ...t };
859
- for (const r in t) {
860
- const o = e[r], a = t[r];
861
- /^on[A-Z]/.test(r) ? o && a ? n[r] = (...i) => {
862
- const c = a(...i);
863
- return o(...i), c;
864
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...a } : r === "className" && (n[r] = [o, a].filter(Boolean).join(" "));
865
- }
866
- return { ...e, ...n };
867
- }
868
- function Ka(e) {
869
- var r, o;
870
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
871
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
872
- }
873
- var at = "Dialog", [Un] = nt(at), [Xa, se] = Un(at), Qn = (e) => {
874
- const {
875
- __scopeDialog: t,
876
- children: n,
877
- open: r,
878
- defaultOpen: o,
879
- onOpenChange: a,
880
- modal: s = !0
881
- } = e, i = f.useRef(null), c = f.useRef(null), [u, l] = tt({
882
- prop: r,
883
- defaultProp: o ?? !1,
884
- onChange: a,
885
- caller: at
886
- });
887
- return /* @__PURE__ */ m(
888
- Xa,
889
- {
890
- scope: t,
891
- triggerRef: i,
892
- contentRef: c,
893
- contentId: Qe(),
894
- titleId: Qe(),
895
- descriptionId: Qe(),
896
- open: u,
897
- onOpenChange: l,
898
- onOpenToggle: f.useCallback(() => l((d) => !d), [l]),
899
- modal: s,
900
- children: n
901
- }
902
- );
903
- };
904
- Qn.displayName = at;
905
- var Zn = "DialogTrigger", Jn = f.forwardRef(
906
- (e, t) => {
907
- const { __scopeDialog: n, ...r } = e, o = se(Zn, n), a = ve(t, o.triggerRef);
908
- return /* @__PURE__ */ m(
909
- Q.button,
910
- {
911
- type: "button",
912
- "aria-haspopup": "dialog",
913
- "aria-expanded": o.open,
914
- "aria-controls": o.contentId,
915
- "data-state": Ft(o.open),
916
- ...r,
917
- ref: a,
918
- onClick: j(e.onClick, o.onOpenToggle)
919
- }
920
- );
921
- }
922
- );
923
- Jn.displayName = Zn;
924
- var _t = "DialogPortal", [Ua, Ln] = Un(_t, {
925
- forceMount: void 0
926
- }), er = (e) => {
927
- const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, a = se(_t, t);
928
- return /* @__PURE__ */ m(Ua, { scope: t, forceMount: n, children: f.Children.map(r, (s) => /* @__PURE__ */ m(xe, { present: n || a.open, children: /* @__PURE__ */ m(xt, { asChild: !0, container: o, children: s }) })) });
929
- };
930
- er.displayName = _t;
931
- var Je = "DialogOverlay", tr = f.forwardRef(
932
- (e, t) => {
933
- const n = Ln(Je, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, a = se(Je, e.__scopeDialog);
934
- return a.modal ? /* @__PURE__ */ m(xe, { present: r || a.open, children: /* @__PURE__ */ m(Za, { ...o, ref: t }) }) : null;
935
- }
936
- );
937
- tr.displayName = Je;
938
- var Qa = /* @__PURE__ */ qa("DialogOverlay.RemoveScroll"), Za = f.forwardRef(
939
- (e, t) => {
940
- const { __scopeDialog: n, ...r } = e, o = se(Je, n);
941
- return (
942
- // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
943
- // ie. when `Overlay` and `Content` are siblings
944
- /* @__PURE__ */ m(pn, { as: Qa, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ m(
945
- Q.div,
946
- {
947
- "data-state": Ft(o.open),
948
- ...r,
949
- ref: t,
950
- style: { pointerEvents: "auto", ...r.style }
951
- }
952
- ) })
953
- );
954
- }
955
- ), Ce = "DialogContent", nr = f.forwardRef(
956
- (e, t) => {
957
- const n = Ln(Ce, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, a = se(Ce, e.__scopeDialog);
958
- return /* @__PURE__ */ m(xe, { present: r || a.open, children: a.modal ? /* @__PURE__ */ m(Ja, { ...o, ref: t }) : /* @__PURE__ */ m(La, { ...o, ref: t }) });
959
- }
960
- );
961
- nr.displayName = Ce;
962
- var Ja = f.forwardRef(
963
- (e, t) => {
964
- const n = se(Ce, e.__scopeDialog), r = f.useRef(null), o = ve(t, n.contentRef, r);
965
- return f.useEffect(() => {
966
- const a = r.current;
967
- if (a) return vn(a);
968
- }, []), /* @__PURE__ */ m(
969
- rr,
970
- {
971
- ...e,
972
- ref: o,
973
- trapFocus: n.open,
974
- disableOutsidePointerEvents: !0,
975
- onCloseAutoFocus: j(e.onCloseAutoFocus, (a) => {
976
- var s;
977
- a.preventDefault(), (s = n.triggerRef.current) == null || s.focus();
978
- }),
979
- onPointerDownOutside: j(e.onPointerDownOutside, (a) => {
980
- const s = a.detail.originalEvent, i = s.button === 0 && s.ctrlKey === !0;
981
- (s.button === 2 || i) && a.preventDefault();
982
- }),
983
- onFocusOutside: j(
984
- e.onFocusOutside,
985
- (a) => a.preventDefault()
986
- )
987
- }
988
- );
989
- }
990
- ), La = f.forwardRef(
991
- (e, t) => {
992
- const n = se(Ce, e.__scopeDialog), r = f.useRef(!1), o = f.useRef(!1);
993
- return /* @__PURE__ */ m(
994
- rr,
995
- {
996
- ...e,
997
- ref: t,
998
- trapFocus: !1,
999
- disableOutsidePointerEvents: !1,
1000
- onCloseAutoFocus: (a) => {
1001
- var s, i;
1002
- (s = e.onCloseAutoFocus) == null || s.call(e, a), a.defaultPrevented || (r.current || (i = n.triggerRef.current) == null || i.focus(), a.preventDefault()), r.current = !1, o.current = !1;
1003
- },
1004
- onInteractOutside: (a) => {
1005
- var c, u;
1006
- (c = e.onInteractOutside) == null || c.call(e, a), a.defaultPrevented || (r.current = !0, a.detail.originalEvent.type === "pointerdown" && (o.current = !0));
1007
- const s = a.target;
1008
- ((u = n.triggerRef.current) == null ? void 0 : u.contains(s)) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && o.current && a.preventDefault();
1009
- }
1010
- }
1011
- );
1012
- }
1013
- ), rr = f.forwardRef(
1014
- (e, t) => {
1015
- const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: a, ...s } = e, i = se(Ce, n), c = f.useRef(null), u = ve(t, c);
1016
- return wn(), /* @__PURE__ */ pe(Ae, { children: [
1017
- /* @__PURE__ */ m(
1018
- bn,
1019
- {
1020
- asChild: !0,
1021
- loop: !0,
1022
- trapped: r,
1023
- onMountAutoFocus: o,
1024
- onUnmountAutoFocus: a,
1025
- children: /* @__PURE__ */ m(
1026
- mn,
1027
- {
1028
- role: "dialog",
1029
- id: i.contentId,
1030
- "aria-describedby": i.descriptionId,
1031
- "aria-labelledby": i.titleId,
1032
- "data-state": Ft(i.open),
1033
- ...s,
1034
- ref: u,
1035
- onDismiss: () => i.onOpenChange(!1)
1036
- }
1037
- )
1038
- }
1039
- ),
1040
- /* @__PURE__ */ pe(Ae, { children: [
1041
- /* @__PURE__ */ m(es, { titleId: i.titleId }),
1042
- /* @__PURE__ */ m(ns, { contentRef: c, descriptionId: i.descriptionId })
1043
- ] })
1044
- ] });
1045
- }
1046
- ), Rt = "DialogTitle", or = f.forwardRef(
1047
- (e, t) => {
1048
- const { __scopeDialog: n, ...r } = e, o = se(Rt, n);
1049
- return /* @__PURE__ */ m(Q.h2, { id: o.titleId, ...r, ref: t });
1050
- }
1051
- );
1052
- or.displayName = Rt;
1053
- var ar = "DialogDescription", sr = f.forwardRef(
1054
- (e, t) => {
1055
- const { __scopeDialog: n, ...r } = e, o = se(ar, n);
1056
- return /* @__PURE__ */ m(Q.p, { id: o.descriptionId, ...r, ref: t });
1057
- }
1058
- );
1059
- sr.displayName = ar;
1060
- var ir = "DialogClose", cr = f.forwardRef(
1061
- (e, t) => {
1062
- const { __scopeDialog: n, ...r } = e, o = se(ir, n);
1063
- return /* @__PURE__ */ m(
1064
- Q.button,
1065
- {
1066
- type: "button",
1067
- ...r,
1068
- ref: t,
1069
- onClick: j(e.onClick, () => o.onOpenChange(!1))
1070
- }
1071
- );
1072
- }
1073
- );
1074
- cr.displayName = ir;
1075
- function Ft(e) {
1076
- return e ? "open" : "closed";
1077
- }
1078
- var ur = "DialogTitleWarning", [_u, lr] = qo(ur, {
1079
- contentName: Ce,
1080
- titleName: Rt,
1081
- docsSlug: "dialog"
1082
- }), es = ({ titleId: e }) => {
1083
- const t = lr(ur), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1084
-
1085
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
1086
-
1087
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
1088
- return f.useEffect(() => {
1089
- e && (document.getElementById(e) || console.error(n));
1090
- }, [n, e]), null;
1091
- }, ts = "DialogDescriptionWarning", ns = ({ contentRef: e, descriptionId: t }) => {
1092
- const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${lr(ts).contentName}}.`;
1093
- return f.useEffect(() => {
1094
- var a;
1095
- const o = (a = e.current) == null ? void 0 : a.getAttribute("aria-describedby");
1096
- t && o && (document.getElementById(t) || console.warn(r));
1097
- }, [r, e, t]), null;
1098
- }, rs = Qn, os = Jn, as = er, dr = tr, fr = nr, hr = or, mr = sr, gr = cr;
1099
- const Ru = rs, Fu = os, Iu = gr, ss = as, yr = f.forwardRef(
1100
- ({ className: e, ...t }, n) => /* @__PURE__ */ m(
1101
- dr,
1102
- {
1103
- className: $(
1104
- "fixed inset-0 z-[70] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1105
- e
1106
- ),
1107
- ...t,
1108
- ref: n
1109
- }
1110
- )
1111
- );
1112
- yr.displayName = dr.displayName;
1113
- const is = et(
1114
- "fixed z-[70] gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
1115
- {
1116
- variants: {
1117
- side: {
1118
- top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
1119
- bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
1120
- left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
1121
- right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
1122
- }
1123
- },
1124
- defaultVariants: {
1125
- side: "right"
1126
- }
1127
- }
1128
- ), cs = f.forwardRef(
1129
- ({ side: e = "right", className: t, children: n, ...r }, o) => /* @__PURE__ */ pe(ss, { children: [
1130
- /* @__PURE__ */ m(yr, {}),
1131
- /* @__PURE__ */ pe(fr, { ref: o, className: $(is({ side: e }), t), ...r, children: [
1132
- n,
1133
- /* @__PURE__ */ pe(gr, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
1134
- /* @__PURE__ */ m(Tn, { className: "size-4" }),
1135
- /* @__PURE__ */ m("span", { className: "sr-only", children: "Close" })
1136
- ] })
1137
- ] })
1138
- ] })
1139
- );
1140
- cs.displayName = fr.displayName;
1141
- const us = ({ className: e, ...t }) => /* @__PURE__ */ m("div", { className: $("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
1142
- us.displayName = "SheetHeader";
1143
- const ls = ({ className: e, ...t }) => /* @__PURE__ */ m("div", { className: $("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
1144
- ls.displayName = "SheetFooter";
1145
- const ds = f.forwardRef(
1146
- ({ className: e, ...t }, n) => /* @__PURE__ */ m(hr, { ref: n, className: $("text-lg font-semibold text-foreground", e), ...t })
1147
- );
1148
- ds.displayName = hr.displayName;
1149
- const fs = f.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ m(mr, { ref: n, className: $("text-sm text-muted-foreground", e), ...t }));
1150
- fs.displayName = mr.displayName;
1151
- function hs(e, t, n = "long") {
1152
- return new Intl.DateTimeFormat("en-US", {
1153
- // Enforces engine to render the time. Without the option JavaScriptCore omits it.
1154
- hour: "numeric",
1155
- timeZone: e,
1156
- timeZoneName: n
1157
- }).format(t).split(/\s/g).slice(2).join(" ");
1158
- }
1159
- const yt = {}, Fe = {};
1160
- function me(e, t) {
1161
- try {
1162
- const r = (yt[e] || (yt[e] = new Intl.DateTimeFormat("en-US", {
1163
- timeZone: e,
1164
- timeZoneName: "longOffset"
1165
- }).format))(t).split("GMT")[1];
1166
- return r in Fe ? Fe[r] : Zt(r, r.split(":"));
1167
- } catch {
1168
- if (e in Fe) return Fe[e];
1169
- const n = e == null ? void 0 : e.match(ms);
1170
- return n ? Zt(e, n.slice(1)) : NaN;
1171
- }
1172
- }
1173
- const ms = /([+-]\d\d):?(\d\d)?/;
1174
- function Zt(e, t) {
1175
- const n = +(t[0] || 0), r = +(t[1] || 0), o = +(t[2] || 0) / 60;
1176
- return Fe[e] = n * 60 + r > 0 ? n * 60 + r + o : n * 60 - r - o;
1177
- }
1178
- class le extends Date {
1179
- //#region static
1180
- constructor(...t) {
1181
- super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(me(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)), pr(this, t)) : this.setTime(Date.now());
1182
- }
1183
- static tz(t, ...n) {
1184
- return n.length ? new le(...n, t) : new le(Date.now(), t);
1185
- }
1186
- //#endregion
1187
- //#region time zone
1188
- withTimeZone(t) {
1189
- return new le(+this, t);
1190
- }
1191
- getTimezoneOffset() {
1192
- const t = -me(this.timeZone, this);
1193
- return t > 0 ? Math.floor(t) : Math.ceil(t);
1194
- }
1195
- //#endregion
1196
- //#region time
1197
- setTime(t) {
1198
- return Date.prototype.setTime.apply(this, arguments), Le(this), +this;
1199
- }
1200
- //#endregion
1201
- //#region date-fns integration
1202
- [Symbol.for("constructDateFrom")](t) {
1203
- return new le(+new Date(t), this.timeZone);
1204
- }
1205
- //#endregion
1206
- }
1207
- const Jt = /^(get|set)(?!UTC)/;
1208
- Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
1209
- if (!Jt.test(e)) return;
1210
- const t = e.replace(Jt, "$1UTC");
1211
- le.prototype[t] && (e.startsWith("get") ? le.prototype[e] = function() {
1212
- return this.internal[t]();
1213
- } : (le.prototype[e] = function() {
1214
- return Date.prototype[t].apply(this.internal, arguments), gs(this), +this;
1215
- }, le.prototype[t] = function() {
1216
- return Date.prototype[t].apply(this, arguments), Le(this), +this;
1217
- }));
1218
- });
1219
- function Le(e) {
1220
- e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - // Round after converting minutes to seconds to avoid fractional offset
1221
- // precision errors from historical offsets.
1222
- Math.round(-me(e.timeZone, e) * 60));
1223
- }
1224
- function gs(e) {
1225
- 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()), pr(e);
1226
- }
1227
- function pr(e, t) {
1228
- const n = Array.isArray(t) ? ys(t) : +e.internal, r = me(e.timeZone, e), o = r > 0 ? Math.floor(r) : Math.ceil(r), a = /* @__PURE__ */ new Date(+e);
1229
- a.setUTCHours(a.getUTCHours() - 1);
1230
- const s = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), i = -(/* @__PURE__ */ new Date(+a)).getTimezoneOffset(), c = s - i;
1231
- let u = s;
1232
- if (c && s !== o) {
1233
- const _ = Date.prototype.getHours.apply(e), I = Array.isArray(t) ? t[3] || 0 : e.internal.getUTCHours();
1234
- if (_ !== I) {
1235
- const B = /* @__PURE__ */ new Date(+e), G = s - o;
1236
- G && B.setUTCMinutes(B.getUTCMinutes() + G);
1237
- const K = me(e.timeZone, B);
1238
- (K > 0 ? Math.floor(K) : Math.ceil(K)) === o && (u = i);
1239
- }
1240
- }
1241
- const l = u - o;
1242
- l && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + l);
1243
- const d = /* @__PURE__ */ new Date(+e);
1244
- d.setUTCSeconds(0);
1245
- const y = s > 0 ? d.getSeconds() : (d.getSeconds() - 60) % 60, w = Math.round(-(me(e.timeZone, e) * 60)) % 60;
1246
- (w || y) && Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + w + y);
1247
- const C = me(e.timeZone, e), b = C > 0 ? Math.floor(C) : Math.ceil(C), O = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - b, g = b !== o, p = O - l, x = b - o, M = n - b * 60 * 1e3, h = x > 0 && Lt(e) - n === x * 60 * 1e3 && Lt(e, M) !== n;
1248
- if (g && p && !h) {
1249
- Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + p);
1250
- const _ = me(e.timeZone, e), I = _ > 0 ? Math.floor(_) : Math.ceil(_), B = b - I;
1251
- B && p < 0 && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + B);
1252
- }
1253
- Le(e);
1254
- const E = (t ? n : n + w * 1e3) - +e.internal;
1255
- E && Math.abs(E) < 1800 * 1e3 && (Date.prototype.setTime.call(e, +e + E), Le(e));
1256
- }
1257
- function ys(e) {
1258
- return Date.UTC(e[0], e.length > 1 ? e[1] : 0, e.length > 2 ? e[2] : 1, ...e.slice(3));
1259
- }
1260
- function Lt(e, t) {
1261
- const n = new Date(t ?? +e);
1262
- return n.setUTCSeconds(n.getUTCSeconds() - Math.round(-me(e.timeZone, n) * 60)), +n;
1263
- }
1264
- class U extends le {
1265
- //#region static
1266
- static tz(t, ...n) {
1267
- return n.length ? new U(...n, t) : new U(Date.now(), t);
1268
- }
1269
- //#endregion
1270
- //#region representation
1271
- toISOString() {
1272
- const [t, n, r] = this.tzComponents(), o = `${t}${n}:${r}`;
1273
- return this.internal.toISOString().slice(0, -1) + o;
1274
- }
1275
- toString() {
1276
- return `${this.toDateString()} ${this.toTimeString()}`;
1277
- }
1278
- toDateString() {
1279
- const [t, n, r, o] = this.internal.toUTCString().split(" ");
1280
- return `${t == null ? void 0 : t.slice(0, -1)} ${r} ${n} ${o}`;
1281
- }
1282
- toTimeString() {
1283
- const t = this.internal.toUTCString().split(" ")[4], [n, r, o] = this.tzComponents();
1284
- return `${t} GMT${n}${r}${o} (${hs(this.timeZone, this)})`;
1285
- }
1286
- toLocaleString(t, n) {
1287
- return Date.prototype.toLocaleString.call(this, t, {
1288
- ...n,
1289
- timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
1290
- });
1291
- }
1292
- toLocaleDateString(t, n) {
1293
- return Date.prototype.toLocaleDateString.call(this, t, {
1294
- ...n,
1295
- timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
1296
- });
1297
- }
1298
- toLocaleTimeString(t, n) {
1299
- return Date.prototype.toLocaleTimeString.call(this, t, {
1300
- ...n,
1301
- timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
1302
- });
1303
- }
1304
- //#endregion
1305
- //#region private
1306
- tzComponents() {
1307
- 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");
1308
- return [n, r, o];
1309
- }
1310
- //#endregion
1311
- withTimeZone(t) {
1312
- return new U(+this, t);
1313
- }
1314
- //#region date-fns integration
1315
- [Symbol.for("constructDateFrom")](t) {
1316
- return new U(+new Date(t), this.timeZone);
1317
- }
1318
- //#endregion
1319
- }
1320
- const vr = 6048e5, ps = 864e5, en = Symbol.for("constructDateFrom");
1321
- function V(e, t) {
1322
- return typeof e == "function" ? e(t) : e && typeof e == "object" && en in e ? e[en](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
1323
- }
1324
- function Y(e, t) {
1325
- return V(t || e, e);
1326
- }
1327
- function wr(e, t, n) {
1328
- const r = Y(e, n == null ? void 0 : n.in);
1329
- return isNaN(t) ? V(e, NaN) : (t && r.setDate(r.getDate() + t), r);
1330
- }
1331
- function br(e, t, n) {
1332
- const r = Y(e, n == null ? void 0 : n.in);
1333
- if (isNaN(t)) return V(e, NaN);
1334
- if (!t)
1335
- return r;
1336
- const o = r.getDate(), a = V(e, r.getTime());
1337
- a.setMonth(r.getMonth() + t + 1, 0);
1338
- const s = a.getDate();
1339
- return o >= s ? a : (r.setFullYear(
1340
- a.getFullYear(),
1341
- a.getMonth(),
1342
- o
1343
- ), r);
1344
- }
1345
- let vs = {};
1346
- function He() {
1347
- return vs;
1348
- }
1349
- function Pe(e, t) {
1350
- var i, c, u, l;
1351
- const n = He(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.weekStartsOn) ?? 0, o = Y(e, t == null ? void 0 : t.in), a = o.getDay(), s = (a < r ? 7 : 0) + a - r;
1352
- return o.setDate(o.getDate() - s), o.setHours(0, 0, 0, 0), o;
1353
- }
1354
- function Ye(e, t) {
1355
- return Pe(e, { ...t, weekStartsOn: 1 });
1356
- }
1357
- function Dr(e, t) {
1358
- const n = Y(e, t == null ? void 0 : t.in), r = n.getFullYear(), o = V(n, 0);
1359
- o.setFullYear(r + 1, 0, 4), o.setHours(0, 0, 0, 0);
1360
- const a = Ye(o), s = V(n, 0);
1361
- s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0);
1362
- const i = Ye(s);
1363
- return n.getTime() >= a.getTime() ? r + 1 : n.getTime() >= i.getTime() ? r : r - 1;
1364
- }
1365
- function tn(e) {
1366
- const t = Y(e), n = new Date(
1367
- Date.UTC(
1368
- t.getFullYear(),
1369
- t.getMonth(),
1370
- t.getDate(),
1371
- t.getHours(),
1372
- t.getMinutes(),
1373
- t.getSeconds(),
1374
- t.getMilliseconds()
1375
- )
1376
- );
1377
- return n.setUTCFullYear(t.getFullYear()), +e - +n;
1378
- }
1379
- function We(e, ...t) {
1380
- const n = V.bind(
1381
- null,
1382
- t.find((r) => typeof r == "object")
1383
- );
1384
- return t.map(n);
1385
- }
1386
- function Be(e, t) {
1387
- const n = Y(e, t == null ? void 0 : t.in);
1388
- return n.setHours(0, 0, 0, 0), n;
1389
- }
1390
- function It(e, t, n) {
1391
- const [r, o] = We(
1392
- n == null ? void 0 : n.in,
1393
- e,
1394
- t
1395
- ), a = Be(r), s = Be(o), i = +a - tn(a), c = +s - tn(s);
1396
- return Math.round((i - c) / ps);
1397
- }
1398
- function ws(e, t) {
1399
- const n = Dr(e, t), r = V(e, 0);
1400
- return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), Ye(r);
1401
- }
1402
- function bs(e, t, n) {
1403
- return wr(e, t * 7, n);
1404
- }
1405
- function Ds(e, t, n) {
1406
- return br(e, t * 12, n);
1407
- }
1408
- function ks(e, t) {
1409
- let n, r = t == null ? void 0 : t.in;
1410
- return e.forEach((o) => {
1411
- !r && typeof o == "object" && (r = V.bind(null, o));
1412
- const a = Y(o, r);
1413
- (!n || n < a || isNaN(+a)) && (n = a);
1414
- }), V(r, n || NaN);
1415
- }
1416
- function Ms(e, t) {
1417
- let n, r = t == null ? void 0 : t.in;
1418
- return e.forEach((o) => {
1419
- !r && typeof o == "object" && (r = V.bind(null, o));
1420
- const a = Y(o, r);
1421
- (!n || n > a || isNaN(+a)) && (n = a);
1422
- }), V(r, n || NaN);
1423
- }
1424
- function Os(e, t, n) {
1425
- const [r, o] = We(
1426
- n == null ? void 0 : n.in,
1427
- e,
1428
- t
1429
- );
1430
- return +Be(r) == +Be(o);
1431
- }
1432
- function kr(e) {
1433
- return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
1434
- }
1435
- function Cs(e) {
1436
- return !(!kr(e) && typeof e != "number" || isNaN(+Y(e)));
1437
- }
1438
- function Mr(e, t, n) {
1439
- const [r, o] = We(
1440
- n == null ? void 0 : n.in,
1441
- e,
1442
- t
1443
- ), a = r.getFullYear() - o.getFullYear(), s = r.getMonth() - o.getMonth();
1444
- return a * 12 + s;
1445
- }
1446
- function xs(e, t) {
1447
- const n = Y(e, t == null ? void 0 : t.in), r = n.getMonth();
1448
- return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
1449
- }
1450
- function Or(e, t) {
1451
- const [n, r] = We(e, t.start, t.end);
1452
- return { start: n, end: r };
1453
- }
1454
- function Ns(e, t) {
1455
- const { start: n, end: r } = Or(t == null ? void 0 : t.in, e);
1456
- let o = +n > +r;
1457
- const a = o ? +n : +r, s = o ? r : n;
1458
- s.setHours(0, 0, 0, 0), s.setDate(1);
1459
- let i = 1;
1460
- const c = [];
1461
- for (; +s <= a; )
1462
- c.push(V(n, s)), s.setMonth(s.getMonth() + i);
1463
- return o ? c.reverse() : c;
1464
- }
1465
- function Ts(e, t) {
1466
- const n = Y(e, t == null ? void 0 : t.in);
1467
- return n.setDate(1), n.setHours(0, 0, 0, 0), n;
1468
- }
1469
- function Ss(e, t) {
1470
- const n = Y(e, t == null ? void 0 : t.in), r = n.getFullYear();
1471
- return n.setFullYear(r + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
1472
- }
1473
- function Cr(e, t) {
1474
- const n = Y(e, t == null ? void 0 : t.in);
1475
- return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
1476
- }
1477
- function Ps(e, t) {
1478
- const { start: n, end: r } = Or(t == null ? void 0 : t.in, e);
1479
- let o = +n > +r;
1480
- const a = o ? +n : +r, s = o ? r : n;
1481
- s.setHours(0, 0, 0, 0), s.setMonth(0, 1);
1482
- let i = 1;
1483
- const c = [];
1484
- for (; +s <= a; )
1485
- c.push(V(n, s)), s.setFullYear(s.getFullYear() + i);
1486
- return o ? c.reverse() : c;
1487
- }
1488
- function xr(e, t) {
1489
- var i, c, u, l;
1490
- const n = He(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.weekStartsOn) ?? 0, o = Y(e, t == null ? void 0 : t.in), a = o.getDay(), s = (a < r ? -7 : 0) + 6 - (a - r);
1491
- return o.setDate(o.getDate() + s), o.setHours(23, 59, 59, 999), o;
1492
- }
1493
- function Es(e, t) {
1494
- return xr(e, { ...t, weekStartsOn: 1 });
1495
- }
1496
- const Ws = {
1497
- lessThanXSeconds: {
1498
- one: "less than a second",
1499
- other: "less than {{count}} seconds"
1500
- },
1501
- xSeconds: {
1502
- one: "1 second",
1503
- other: "{{count}} seconds"
1504
- },
1505
- halfAMinute: "half a minute",
1506
- lessThanXMinutes: {
1507
- one: "less than a minute",
1508
- other: "less than {{count}} minutes"
1509
- },
1510
- xMinutes: {
1511
- one: "1 minute",
1512
- other: "{{count}} minutes"
1513
- },
1514
- aboutXHours: {
1515
- one: "about 1 hour",
1516
- other: "about {{count}} hours"
1517
- },
1518
- xHours: {
1519
- one: "1 hour",
1520
- other: "{{count}} hours"
1521
- },
1522
- xDays: {
1523
- one: "1 day",
1524
- other: "{{count}} days"
1525
- },
1526
- aboutXWeeks: {
1527
- one: "about 1 week",
1528
- other: "about {{count}} weeks"
1529
- },
1530
- xWeeks: {
1531
- one: "1 week",
1532
- other: "{{count}} weeks"
1533
- },
1534
- aboutXMonths: {
1535
- one: "about 1 month",
1536
- other: "about {{count}} months"
1537
- },
1538
- xMonths: {
1539
- one: "1 month",
1540
- other: "{{count}} months"
1541
- },
1542
- aboutXYears: {
1543
- one: "about 1 year",
1544
- other: "about {{count}} years"
1545
- },
1546
- xYears: {
1547
- one: "1 year",
1548
- other: "{{count}} years"
1549
- },
1550
- overXYears: {
1551
- one: "over 1 year",
1552
- other: "over {{count}} years"
1553
- },
1554
- almostXYears: {
1555
- one: "almost 1 year",
1556
- other: "almost {{count}} years"
1557
- }
1558
- }, _s = (e, t, n) => {
1559
- let r;
1560
- const o = Ws[e];
1561
- return typeof o == "string" ? r = o : t === 1 ? r = o.one : r = o.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
1562
- };
1563
- function pt(e) {
1564
- return (t = {}) => {
1565
- const n = t.width ? String(t.width) : e.defaultWidth;
1566
- return e.formats[n] || e.formats[e.defaultWidth];
1567
- };
1568
- }
1569
- const Rs = {
1570
- full: "EEEE, MMMM do, y",
1571
- long: "MMMM do, y",
1572
- medium: "MMM d, y",
1573
- short: "MM/dd/yyyy"
1574
- }, Fs = {
1575
- full: "h:mm:ss a zzzz",
1576
- long: "h:mm:ss a z",
1577
- medium: "h:mm:ss a",
1578
- short: "h:mm a"
1579
- }, Is = {
1580
- full: "{{date}} 'at' {{time}}",
1581
- long: "{{date}} 'at' {{time}}",
1582
- medium: "{{date}}, {{time}}",
1583
- short: "{{date}}, {{time}}"
1584
- }, As = {
1585
- date: pt({
1586
- formats: Rs,
1587
- defaultWidth: "full"
1588
- }),
1589
- time: pt({
1590
- formats: Fs,
1591
- defaultWidth: "full"
1592
- }),
1593
- dateTime: pt({
1594
- formats: Is,
1595
- defaultWidth: "full"
1596
- })
1597
- }, Ys = {
1598
- lastWeek: "'last' eeee 'at' p",
1599
- yesterday: "'yesterday at' p",
1600
- today: "'today at' p",
1601
- tomorrow: "'tomorrow at' p",
1602
- nextWeek: "eeee 'at' p",
1603
- other: "P"
1604
- }, Bs = (e, t, n, r) => Ys[e];
1605
- function _e(e) {
1606
- return (t, n) => {
1607
- const r = n != null && n.context ? String(n.context) : "standalone";
1608
- let o;
1609
- if (r === "formatting" && e.formattingValues) {
1610
- const s = e.defaultFormattingWidth || e.defaultWidth, i = n != null && n.width ? String(n.width) : s;
1611
- o = e.formattingValues[i] || e.formattingValues[s];
1612
- } else {
1613
- const s = e.defaultWidth, i = n != null && n.width ? String(n.width) : e.defaultWidth;
1614
- o = e.values[i] || e.values[s];
1615
- }
1616
- const a = e.argumentCallback ? e.argumentCallback(t) : t;
1617
- return o[a];
1618
- };
1619
- }
1620
- const $s = {
1621
- narrow: ["B", "A"],
1622
- abbreviated: ["BC", "AD"],
1623
- wide: ["Before Christ", "Anno Domini"]
1624
- }, Hs = {
1625
- narrow: ["1", "2", "3", "4"],
1626
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
1627
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
1628
- }, qs = {
1629
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
1630
- abbreviated: [
1631
- "Jan",
1632
- "Feb",
1633
- "Mar",
1634
- "Apr",
1635
- "May",
1636
- "Jun",
1637
- "Jul",
1638
- "Aug",
1639
- "Sep",
1640
- "Oct",
1641
- "Nov",
1642
- "Dec"
1643
- ],
1644
- wide: [
1645
- "January",
1646
- "February",
1647
- "March",
1648
- "April",
1649
- "May",
1650
- "June",
1651
- "July",
1652
- "August",
1653
- "September",
1654
- "October",
1655
- "November",
1656
- "December"
1657
- ]
1658
- }, js = {
1659
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
1660
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
1661
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1662
- wide: [
1663
- "Sunday",
1664
- "Monday",
1665
- "Tuesday",
1666
- "Wednesday",
1667
- "Thursday",
1668
- "Friday",
1669
- "Saturday"
1670
- ]
1671
- }, Vs = {
1672
- narrow: {
1673
- am: "a",
1674
- pm: "p",
1675
- midnight: "mi",
1676
- noon: "n",
1677
- morning: "morning",
1678
- afternoon: "afternoon",
1679
- evening: "evening",
1680
- night: "night"
1681
- },
1682
- abbreviated: {
1683
- am: "AM",
1684
- pm: "PM",
1685
- midnight: "midnight",
1686
- noon: "noon",
1687
- morning: "morning",
1688
- afternoon: "afternoon",
1689
- evening: "evening",
1690
- night: "night"
1691
- },
1692
- wide: {
1693
- am: "a.m.",
1694
- pm: "p.m.",
1695
- midnight: "midnight",
1696
- noon: "noon",
1697
- morning: "morning",
1698
- afternoon: "afternoon",
1699
- evening: "evening",
1700
- night: "night"
1701
- }
1702
- }, Gs = {
1703
- narrow: {
1704
- am: "a",
1705
- pm: "p",
1706
- midnight: "mi",
1707
- noon: "n",
1708
- morning: "in the morning",
1709
- afternoon: "in the afternoon",
1710
- evening: "in the evening",
1711
- night: "at night"
1712
- },
1713
- abbreviated: {
1714
- am: "AM",
1715
- pm: "PM",
1716
- midnight: "midnight",
1717
- noon: "noon",
1718
- morning: "in the morning",
1719
- afternoon: "in the afternoon",
1720
- evening: "in the evening",
1721
- night: "at night"
1722
- },
1723
- wide: {
1724
- am: "a.m.",
1725
- pm: "p.m.",
1726
- midnight: "midnight",
1727
- noon: "noon",
1728
- morning: "in the morning",
1729
- afternoon: "in the afternoon",
1730
- evening: "in the evening",
1731
- night: "at night"
1732
- }
1733
- }, zs = (e, t) => {
1734
- const n = Number(e), r = n % 100;
1735
- if (r > 20 || r < 10)
1736
- switch (r % 10) {
1737
- case 1:
1738
- return n + "st";
1739
- case 2:
1740
- return n + "nd";
1741
- case 3:
1742
- return n + "rd";
1743
- }
1744
- return n + "th";
1745
- }, Ks = {
1746
- ordinalNumber: zs,
1747
- era: _e({
1748
- values: $s,
1749
- defaultWidth: "wide"
1750
- }),
1751
- quarter: _e({
1752
- values: Hs,
1753
- defaultWidth: "wide",
1754
- argumentCallback: (e) => e - 1
1755
- }),
1756
- month: _e({
1757
- values: qs,
1758
- defaultWidth: "wide"
1759
- }),
1760
- day: _e({
1761
- values: js,
1762
- defaultWidth: "wide"
1763
- }),
1764
- dayPeriod: _e({
1765
- values: Vs,
1766
- defaultWidth: "wide",
1767
- formattingValues: Gs,
1768
- defaultFormattingWidth: "wide"
1769
- })
1770
- };
1771
- function Re(e) {
1772
- return (t, n = {}) => {
1773
- const r = n.width, o = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], a = t.match(o);
1774
- if (!a)
1775
- return null;
1776
- const s = a[0], i = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(i) ? Us(i, (d) => d.test(s)) : (
1777
- // [TODO] -- I challenge you to fix the type
1778
- Xs(i, (d) => d.test(s))
1779
- );
1780
- let u;
1781
- u = e.valueCallback ? e.valueCallback(c) : c, u = n.valueCallback ? (
1782
- // [TODO] -- I challenge you to fix the type
1783
- n.valueCallback(u)
1784
- ) : u;
1785
- const l = t.slice(s.length);
1786
- return { value: u, rest: l };
1787
- };
1788
- }
1789
- function Xs(e, t) {
1790
- for (const n in e)
1791
- if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
1792
- return n;
1793
- }
1794
- function Us(e, t) {
1795
- for (let n = 0; n < e.length; n++)
1796
- if (t(e[n]))
1797
- return n;
1798
- }
1799
- function Qs(e) {
1800
- return (t, n = {}) => {
1801
- const r = t.match(e.matchPattern);
1802
- if (!r) return null;
1803
- const o = r[0], a = t.match(e.parsePattern);
1804
- if (!a) return null;
1805
- let s = e.valueCallback ? e.valueCallback(a[0]) : a[0];
1806
- s = n.valueCallback ? n.valueCallback(s) : s;
1807
- const i = t.slice(o.length);
1808
- return { value: s, rest: i };
1809
- };
1810
- }
1811
- const Zs = /^(\d+)(th|st|nd|rd)?/i, Js = /\d+/i, Ls = {
1812
- narrow: /^(b|a)/i,
1813
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1814
- wide: /^(before christ|before common era|anno domini|common era)/i
1815
- }, ei = {
1816
- any: [/^b/i, /^(a|c)/i]
1817
- }, ti = {
1818
- narrow: /^[1234]/i,
1819
- abbreviated: /^q[1234]/i,
1820
- wide: /^[1234](th|st|nd|rd)? quarter/i
1821
- }, ni = {
1822
- any: [/1/i, /2/i, /3/i, /4/i]
1823
- }, ri = {
1824
- narrow: /^[jfmasond]/i,
1825
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1826
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1827
- }, oi = {
1828
- narrow: [
1829
- /^j/i,
1830
- /^f/i,
1831
- /^m/i,
1832
- /^a/i,
1833
- /^m/i,
1834
- /^j/i,
1835
- /^j/i,
1836
- /^a/i,
1837
- /^s/i,
1838
- /^o/i,
1839
- /^n/i,
1840
- /^d/i
1841
- ],
1842
- any: [
1843
- /^ja/i,
1844
- /^f/i,
1845
- /^mar/i,
1846
- /^ap/i,
1847
- /^may/i,
1848
- /^jun/i,
1849
- /^jul/i,
1850
- /^au/i,
1851
- /^s/i,
1852
- /^o/i,
1853
- /^n/i,
1854
- /^d/i
1855
- ]
1856
- }, ai = {
1857
- narrow: /^[smtwf]/i,
1858
- short: /^(su|mo|tu|we|th|fr|sa)/i,
1859
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1860
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1861
- }, si = {
1862
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1863
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1864
- }, ii = {
1865
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1866
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1867
- }, ci = {
1868
- any: {
1869
- am: /^a/i,
1870
- pm: /^p/i,
1871
- midnight: /^mi/i,
1872
- noon: /^no/i,
1873
- morning: /morning/i,
1874
- afternoon: /afternoon/i,
1875
- evening: /evening/i,
1876
- night: /night/i
1877
- }
1878
- }, ui = {
1879
- ordinalNumber: Qs({
1880
- matchPattern: Zs,
1881
- parsePattern: Js,
1882
- valueCallback: (e) => parseInt(e, 10)
1883
- }),
1884
- era: Re({
1885
- matchPatterns: Ls,
1886
- defaultMatchWidth: "wide",
1887
- parsePatterns: ei,
1888
- defaultParseWidth: "any"
1889
- }),
1890
- quarter: Re({
1891
- matchPatterns: ti,
1892
- defaultMatchWidth: "wide",
1893
- parsePatterns: ni,
1894
- defaultParseWidth: "any",
1895
- valueCallback: (e) => e + 1
1896
- }),
1897
- month: Re({
1898
- matchPatterns: ri,
1899
- defaultMatchWidth: "wide",
1900
- parsePatterns: oi,
1901
- defaultParseWidth: "any"
1902
- }),
1903
- day: Re({
1904
- matchPatterns: ai,
1905
- defaultMatchWidth: "wide",
1906
- parsePatterns: si,
1907
- defaultParseWidth: "any"
1908
- }),
1909
- dayPeriod: Re({
1910
- matchPatterns: ii,
1911
- defaultMatchWidth: "any",
1912
- parsePatterns: ci,
1913
- defaultParseWidth: "any"
1914
- })
1915
- }, Se = {
1916
- code: "en-US",
1917
- formatDistance: _s,
1918
- formatLong: As,
1919
- formatRelative: Bs,
1920
- localize: Ks,
1921
- match: ui,
1922
- options: {
1923
- weekStartsOn: 0,
1924
- firstWeekContainsDate: 1
1925
- }
1926
- };
1927
- function li(e, t) {
1928
- const n = Y(e, t == null ? void 0 : t.in);
1929
- return It(n, Cr(n)) + 1;
1930
- }
1931
- function At(e, t) {
1932
- const n = Y(e, t == null ? void 0 : t.in), r = +Ye(n) - +ws(n);
1933
- return Math.round(r / vr) + 1;
1934
- }
1935
- function Nr(e, t) {
1936
- var l, d, y, w;
1937
- const n = Y(e, t == null ? void 0 : t.in), r = n.getFullYear(), o = He(), a = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((d = (l = t == null ? void 0 : t.locale) == null ? void 0 : l.options) == null ? void 0 : d.firstWeekContainsDate) ?? o.firstWeekContainsDate ?? ((w = (y = o.locale) == null ? void 0 : y.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, s = V((t == null ? void 0 : t.in) || e, 0);
1938
- s.setFullYear(r + 1, 0, a), s.setHours(0, 0, 0, 0);
1939
- const i = Pe(s, t), c = V((t == null ? void 0 : t.in) || e, 0);
1940
- c.setFullYear(r, 0, a), c.setHours(0, 0, 0, 0);
1941
- const u = Pe(c, t);
1942
- return +n >= +i ? r + 1 : +n >= +u ? r : r - 1;
1943
- }
1944
- function di(e, t) {
1945
- var i, c, u, l;
1946
- const n = He(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((c = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, o = Nr(e, t), a = V((t == null ? void 0 : t.in) || e, 0);
1947
- return a.setFullYear(o, 0, r), a.setHours(0, 0, 0, 0), Pe(a, t);
1948
- }
1949
- function Yt(e, t) {
1950
- const n = Y(e, t == null ? void 0 : t.in), r = +Pe(n, t) - +di(n, t);
1951
- return Math.round(r / vr) + 1;
1952
- }
1953
- function A(e, t) {
1954
- const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
1955
- return n + r;
1956
- }
1957
- const be = {
1958
- // Year
1959
- y(e, t) {
1960
- const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
1961
- return A(t === "yy" ? r % 100 : r, t.length);
1962
- },
1963
- // Month
1964
- M(e, t) {
1965
- const n = e.getMonth();
1966
- return t === "M" ? String(n + 1) : A(n + 1, 2);
1967
- },
1968
- // Day of the month
1969
- d(e, t) {
1970
- return A(e.getDate(), t.length);
1971
- },
1972
- // AM or PM
1973
- a(e, t) {
1974
- const n = e.getHours() / 12 >= 1 ? "pm" : "am";
1975
- switch (t) {
1976
- case "a":
1977
- case "aa":
1978
- return n.toUpperCase();
1979
- case "aaa":
1980
- return n;
1981
- case "aaaaa":
1982
- return n[0];
1983
- case "aaaa":
1984
- default:
1985
- return n === "am" ? "a.m." : "p.m.";
1986
- }
1987
- },
1988
- // Hour [1-12]
1989
- h(e, t) {
1990
- return A(e.getHours() % 12 || 12, t.length);
1991
- },
1992
- // Hour [0-23]
1993
- H(e, t) {
1994
- return A(e.getHours(), t.length);
1995
- },
1996
- // Minute
1997
- m(e, t) {
1998
- return A(e.getMinutes(), t.length);
1999
- },
2000
- // Second
2001
- s(e, t) {
2002
- return A(e.getSeconds(), t.length);
2003
- },
2004
- // Fraction of second
2005
- S(e, t) {
2006
- const n = t.length, r = e.getMilliseconds(), o = Math.trunc(
2007
- r * Math.pow(10, n - 3)
2008
- );
2009
- return A(o, t.length);
2010
- }
2011
- }, Ne = {
2012
- midnight: "midnight",
2013
- noon: "noon",
2014
- morning: "morning",
2015
- afternoon: "afternoon",
2016
- evening: "evening",
2017
- night: "night"
2018
- }, nn = {
2019
- // Era
2020
- G: function(e, t, n) {
2021
- const r = e.getFullYear() > 0 ? 1 : 0;
2022
- switch (t) {
2023
- // AD, BC
2024
- case "G":
2025
- case "GG":
2026
- case "GGG":
2027
- return n.era(r, { width: "abbreviated" });
2028
- // A, B
2029
- case "GGGGG":
2030
- return n.era(r, { width: "narrow" });
2031
- // Anno Domini, Before Christ
2032
- case "GGGG":
2033
- default:
2034
- return n.era(r, { width: "wide" });
2035
- }
2036
- },
2037
- // Year
2038
- y: function(e, t, n) {
2039
- if (t === "yo") {
2040
- const r = e.getFullYear(), o = r > 0 ? r : 1 - r;
2041
- return n.ordinalNumber(o, { unit: "year" });
2042
- }
2043
- return be.y(e, t);
2044
- },
2045
- // Local week-numbering year
2046
- Y: function(e, t, n, r) {
2047
- const o = Nr(e, r), a = o > 0 ? o : 1 - o;
2048
- if (t === "YY") {
2049
- const s = a % 100;
2050
- return A(s, 2);
2051
- }
2052
- return t === "Yo" ? n.ordinalNumber(a, { unit: "year" }) : A(a, t.length);
2053
- },
2054
- // ISO week-numbering year
2055
- R: function(e, t) {
2056
- const n = Dr(e);
2057
- return A(n, t.length);
2058
- },
2059
- // Extended year. This is a single number designating the year of this calendar system.
2060
- // The main difference between `y` and `u` localizers are B.C. years:
2061
- // | Year | `y` | `u` |
2062
- // |------|-----|-----|
2063
- // | AC 1 | 1 | 1 |
2064
- // | BC 1 | 1 | 0 |
2065
- // | BC 2 | 2 | -1 |
2066
- // Also `yy` always returns the last two digits of a year,
2067
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
2068
- u: function(e, t) {
2069
- const n = e.getFullYear();
2070
- return A(n, t.length);
2071
- },
2072
- // Quarter
2073
- Q: function(e, t, n) {
2074
- const r = Math.ceil((e.getMonth() + 1) / 3);
2075
- switch (t) {
2076
- // 1, 2, 3, 4
2077
- case "Q":
2078
- return String(r);
2079
- // 01, 02, 03, 04
2080
- case "QQ":
2081
- return A(r, 2);
2082
- // 1st, 2nd, 3rd, 4th
2083
- case "Qo":
2084
- return n.ordinalNumber(r, { unit: "quarter" });
2085
- // Q1, Q2, Q3, Q4
2086
- case "QQQ":
2087
- return n.quarter(r, {
2088
- width: "abbreviated",
2089
- context: "formatting"
2090
- });
2091
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
2092
- case "QQQQQ":
2093
- return n.quarter(r, {
2094
- width: "narrow",
2095
- context: "formatting"
2096
- });
2097
- // 1st quarter, 2nd quarter, ...
2098
- case "QQQQ":
2099
- default:
2100
- return n.quarter(r, {
2101
- width: "wide",
2102
- context: "formatting"
2103
- });
2104
- }
2105
- },
2106
- // Stand-alone quarter
2107
- q: function(e, t, n) {
2108
- const r = Math.ceil((e.getMonth() + 1) / 3);
2109
- switch (t) {
2110
- // 1, 2, 3, 4
2111
- case "q":
2112
- return String(r);
2113
- // 01, 02, 03, 04
2114
- case "qq":
2115
- return A(r, 2);
2116
- // 1st, 2nd, 3rd, 4th
2117
- case "qo":
2118
- return n.ordinalNumber(r, { unit: "quarter" });
2119
- // Q1, Q2, Q3, Q4
2120
- case "qqq":
2121
- return n.quarter(r, {
2122
- width: "abbreviated",
2123
- context: "standalone"
2124
- });
2125
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
2126
- case "qqqqq":
2127
- return n.quarter(r, {
2128
- width: "narrow",
2129
- context: "standalone"
2130
- });
2131
- // 1st quarter, 2nd quarter, ...
2132
- case "qqqq":
2133
- default:
2134
- return n.quarter(r, {
2135
- width: "wide",
2136
- context: "standalone"
2137
- });
2138
- }
2139
- },
2140
- // Month
2141
- M: function(e, t, n) {
2142
- const r = e.getMonth();
2143
- switch (t) {
2144
- case "M":
2145
- case "MM":
2146
- return be.M(e, t);
2147
- // 1st, 2nd, ..., 12th
2148
- case "Mo":
2149
- return n.ordinalNumber(r + 1, { unit: "month" });
2150
- // Jan, Feb, ..., Dec
2151
- case "MMM":
2152
- return n.month(r, {
2153
- width: "abbreviated",
2154
- context: "formatting"
2155
- });
2156
- // J, F, ..., D
2157
- case "MMMMM":
2158
- return n.month(r, {
2159
- width: "narrow",
2160
- context: "formatting"
2161
- });
2162
- // January, February, ..., December
2163
- case "MMMM":
2164
- default:
2165
- return n.month(r, { width: "wide", context: "formatting" });
2166
- }
2167
- },
2168
- // Stand-alone month
2169
- L: function(e, t, n) {
2170
- const r = e.getMonth();
2171
- switch (t) {
2172
- // 1, 2, ..., 12
2173
- case "L":
2174
- return String(r + 1);
2175
- // 01, 02, ..., 12
2176
- case "LL":
2177
- return A(r + 1, 2);
2178
- // 1st, 2nd, ..., 12th
2179
- case "Lo":
2180
- return n.ordinalNumber(r + 1, { unit: "month" });
2181
- // Jan, Feb, ..., Dec
2182
- case "LLL":
2183
- return n.month(r, {
2184
- width: "abbreviated",
2185
- context: "standalone"
2186
- });
2187
- // J, F, ..., D
2188
- case "LLLLL":
2189
- return n.month(r, {
2190
- width: "narrow",
2191
- context: "standalone"
2192
- });
2193
- // January, February, ..., December
2194
- case "LLLL":
2195
- default:
2196
- return n.month(r, { width: "wide", context: "standalone" });
2197
- }
2198
- },
2199
- // Local week of year
2200
- w: function(e, t, n, r) {
2201
- const o = Yt(e, r);
2202
- return t === "wo" ? n.ordinalNumber(o, { unit: "week" }) : A(o, t.length);
2203
- },
2204
- // ISO week of year
2205
- I: function(e, t, n) {
2206
- const r = At(e);
2207
- return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : A(r, t.length);
2208
- },
2209
- // Day of the month
2210
- d: function(e, t, n) {
2211
- return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : be.d(e, t);
2212
- },
2213
- // Day of year
2214
- D: function(e, t, n) {
2215
- const r = li(e);
2216
- return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : A(r, t.length);
2217
- },
2218
- // Day of week
2219
- E: function(e, t, n) {
2220
- const r = e.getDay();
2221
- switch (t) {
2222
- // Tue
2223
- case "E":
2224
- case "EE":
2225
- case "EEE":
2226
- return n.day(r, {
2227
- width: "abbreviated",
2228
- context: "formatting"
2229
- });
2230
- // T
2231
- case "EEEEE":
2232
- return n.day(r, {
2233
- width: "narrow",
2234
- context: "formatting"
2235
- });
2236
- // Tu
2237
- case "EEEEEE":
2238
- return n.day(r, {
2239
- width: "short",
2240
- context: "formatting"
2241
- });
2242
- // Tuesday
2243
- case "EEEE":
2244
- default:
2245
- return n.day(r, {
2246
- width: "wide",
2247
- context: "formatting"
2248
- });
2249
- }
2250
- },
2251
- // Local day of week
2252
- e: function(e, t, n, r) {
2253
- const o = e.getDay(), a = (o - r.weekStartsOn + 8) % 7 || 7;
2254
- switch (t) {
2255
- // Numerical value (Nth day of week with current locale or weekStartsOn)
2256
- case "e":
2257
- return String(a);
2258
- // Padded numerical value
2259
- case "ee":
2260
- return A(a, 2);
2261
- // 1st, 2nd, ..., 7th
2262
- case "eo":
2263
- return n.ordinalNumber(a, { unit: "day" });
2264
- case "eee":
2265
- return n.day(o, {
2266
- width: "abbreviated",
2267
- context: "formatting"
2268
- });
2269
- // T
2270
- case "eeeee":
2271
- return n.day(o, {
2272
- width: "narrow",
2273
- context: "formatting"
2274
- });
2275
- // Tu
2276
- case "eeeeee":
2277
- return n.day(o, {
2278
- width: "short",
2279
- context: "formatting"
2280
- });
2281
- // Tuesday
2282
- case "eeee":
2283
- default:
2284
- return n.day(o, {
2285
- width: "wide",
2286
- context: "formatting"
2287
- });
2288
- }
2289
- },
2290
- // Stand-alone local day of week
2291
- c: function(e, t, n, r) {
2292
- const o = e.getDay(), a = (o - r.weekStartsOn + 8) % 7 || 7;
2293
- switch (t) {
2294
- // Numerical value (same as in `e`)
2295
- case "c":
2296
- return String(a);
2297
- // Padded numerical value
2298
- case "cc":
2299
- return A(a, t.length);
2300
- // 1st, 2nd, ..., 7th
2301
- case "co":
2302
- return n.ordinalNumber(a, { unit: "day" });
2303
- case "ccc":
2304
- return n.day(o, {
2305
- width: "abbreviated",
2306
- context: "standalone"
2307
- });
2308
- // T
2309
- case "ccccc":
2310
- return n.day(o, {
2311
- width: "narrow",
2312
- context: "standalone"
2313
- });
2314
- // Tu
2315
- case "cccccc":
2316
- return n.day(o, {
2317
- width: "short",
2318
- context: "standalone"
2319
- });
2320
- // Tuesday
2321
- case "cccc":
2322
- default:
2323
- return n.day(o, {
2324
- width: "wide",
2325
- context: "standalone"
2326
- });
2327
- }
2328
- },
2329
- // ISO day of week
2330
- i: function(e, t, n) {
2331
- const r = e.getDay(), o = r === 0 ? 7 : r;
2332
- switch (t) {
2333
- // 2
2334
- case "i":
2335
- return String(o);
2336
- // 02
2337
- case "ii":
2338
- return A(o, t.length);
2339
- // 2nd
2340
- case "io":
2341
- return n.ordinalNumber(o, { unit: "day" });
2342
- // Tue
2343
- case "iii":
2344
- return n.day(r, {
2345
- width: "abbreviated",
2346
- context: "formatting"
2347
- });
2348
- // T
2349
- case "iiiii":
2350
- return n.day(r, {
2351
- width: "narrow",
2352
- context: "formatting"
2353
- });
2354
- // Tu
2355
- case "iiiiii":
2356
- return n.day(r, {
2357
- width: "short",
2358
- context: "formatting"
2359
- });
2360
- // Tuesday
2361
- case "iiii":
2362
- default:
2363
- return n.day(r, {
2364
- width: "wide",
2365
- context: "formatting"
2366
- });
2367
- }
2368
- },
2369
- // AM or PM
2370
- a: function(e, t, n) {
2371
- const o = e.getHours() / 12 >= 1 ? "pm" : "am";
2372
- switch (t) {
2373
- case "a":
2374
- case "aa":
2375
- return n.dayPeriod(o, {
2376
- width: "abbreviated",
2377
- context: "formatting"
2378
- });
2379
- case "aaa":
2380
- return n.dayPeriod(o, {
2381
- width: "abbreviated",
2382
- context: "formatting"
2383
- }).toLowerCase();
2384
- case "aaaaa":
2385
- return n.dayPeriod(o, {
2386
- width: "narrow",
2387
- context: "formatting"
2388
- });
2389
- case "aaaa":
2390
- default:
2391
- return n.dayPeriod(o, {
2392
- width: "wide",
2393
- context: "formatting"
2394
- });
2395
- }
2396
- },
2397
- // AM, PM, midnight, noon
2398
- b: function(e, t, n) {
2399
- const r = e.getHours();
2400
- let o;
2401
- switch (r === 12 ? o = Ne.noon : r === 0 ? o = Ne.midnight : o = r / 12 >= 1 ? "pm" : "am", t) {
2402
- case "b":
2403
- case "bb":
2404
- return n.dayPeriod(o, {
2405
- width: "abbreviated",
2406
- context: "formatting"
2407
- });
2408
- case "bbb":
2409
- return n.dayPeriod(o, {
2410
- width: "abbreviated",
2411
- context: "formatting"
2412
- }).toLowerCase();
2413
- case "bbbbb":
2414
- return n.dayPeriod(o, {
2415
- width: "narrow",
2416
- context: "formatting"
2417
- });
2418
- case "bbbb":
2419
- default:
2420
- return n.dayPeriod(o, {
2421
- width: "wide",
2422
- context: "formatting"
2423
- });
2424
- }
2425
- },
2426
- // in the morning, in the afternoon, in the evening, at night
2427
- B: function(e, t, n) {
2428
- const r = e.getHours();
2429
- let o;
2430
- switch (r >= 17 ? o = Ne.evening : r >= 12 ? o = Ne.afternoon : r >= 4 ? o = Ne.morning : o = Ne.night, t) {
2431
- case "B":
2432
- case "BB":
2433
- case "BBB":
2434
- return n.dayPeriod(o, {
2435
- width: "abbreviated",
2436
- context: "formatting"
2437
- });
2438
- case "BBBBB":
2439
- return n.dayPeriod(o, {
2440
- width: "narrow",
2441
- context: "formatting"
2442
- });
2443
- case "BBBB":
2444
- default:
2445
- return n.dayPeriod(o, {
2446
- width: "wide",
2447
- context: "formatting"
2448
- });
2449
- }
2450
- },
2451
- // Hour [1-12]
2452
- h: function(e, t, n) {
2453
- if (t === "ho") {
2454
- let r = e.getHours() % 12;
2455
- return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
2456
- }
2457
- return be.h(e, t);
2458
- },
2459
- // Hour [0-23]
2460
- H: function(e, t, n) {
2461
- return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : be.H(e, t);
2462
- },
2463
- // Hour [0-11]
2464
- K: function(e, t, n) {
2465
- const r = e.getHours() % 12;
2466
- return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : A(r, t.length);
2467
- },
2468
- // Hour [1-24]
2469
- k: function(e, t, n) {
2470
- let r = e.getHours();
2471
- return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : A(r, t.length);
2472
- },
2473
- // Minute
2474
- m: function(e, t, n) {
2475
- return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : be.m(e, t);
2476
- },
2477
- // Second
2478
- s: function(e, t, n) {
2479
- return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : be.s(e, t);
2480
- },
2481
- // Fraction of second
2482
- S: function(e, t) {
2483
- return be.S(e, t);
2484
- },
2485
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
2486
- X: function(e, t, n) {
2487
- const r = e.getTimezoneOffset();
2488
- if (r === 0)
2489
- return "Z";
2490
- switch (t) {
2491
- // Hours and optional minutes
2492
- case "X":
2493
- return on(r);
2494
- // Hours, minutes and optional seconds without `:` delimiter
2495
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2496
- // so this token always has the same output as `XX`
2497
- case "XXXX":
2498
- case "XX":
2499
- return Oe(r);
2500
- // Hours, minutes and optional seconds with `:` delimiter
2501
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2502
- // so this token always has the same output as `XXX`
2503
- case "XXXXX":
2504
- case "XXX":
2505
- // Hours and minutes with `:` delimiter
2506
- default:
2507
- return Oe(r, ":");
2508
- }
2509
- },
2510
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
2511
- x: function(e, t, n) {
2512
- const r = e.getTimezoneOffset();
2513
- switch (t) {
2514
- // Hours and optional minutes
2515
- case "x":
2516
- return on(r);
2517
- // Hours, minutes and optional seconds without `:` delimiter
2518
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2519
- // so this token always has the same output as `xx`
2520
- case "xxxx":
2521
- case "xx":
2522
- return Oe(r);
2523
- // Hours, minutes and optional seconds with `:` delimiter
2524
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2525
- // so this token always has the same output as `xxx`
2526
- case "xxxxx":
2527
- case "xxx":
2528
- // Hours and minutes with `:` delimiter
2529
- default:
2530
- return Oe(r, ":");
2531
- }
2532
- },
2533
- // Timezone (GMT)
2534
- O: function(e, t, n) {
2535
- const r = e.getTimezoneOffset();
2536
- switch (t) {
2537
- // Short
2538
- case "O":
2539
- case "OO":
2540
- case "OOO":
2541
- return "GMT" + rn(r, ":");
2542
- // Long
2543
- case "OOOO":
2544
- default:
2545
- return "GMT" + Oe(r, ":");
2546
- }
2547
- },
2548
- // Timezone (specific non-location)
2549
- z: function(e, t, n) {
2550
- const r = e.getTimezoneOffset();
2551
- switch (t) {
2552
- // Short
2553
- case "z":
2554
- case "zz":
2555
- case "zzz":
2556
- return "GMT" + rn(r, ":");
2557
- // Long
2558
- case "zzzz":
2559
- default:
2560
- return "GMT" + Oe(r, ":");
2561
- }
2562
- },
2563
- // Seconds timestamp
2564
- t: function(e, t, n) {
2565
- const r = Math.trunc(+e / 1e3);
2566
- return A(r, t.length);
2567
- },
2568
- // Milliseconds timestamp
2569
- T: function(e, t, n) {
2570
- return A(+e, t.length);
2571
- }
2572
- };
2573
- function rn(e, t = "") {
2574
- const n = e > 0 ? "-" : "+", r = Math.abs(e), o = Math.trunc(r / 60), a = r % 60;
2575
- return a === 0 ? n + String(o) : n + String(o) + t + A(a, 2);
2576
- }
2577
- function on(e, t) {
2578
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + A(Math.abs(e) / 60, 2) : Oe(e, t);
2579
- }
2580
- function Oe(e, t = "") {
2581
- const n = e > 0 ? "-" : "+", r = Math.abs(e), o = A(Math.trunc(r / 60), 2), a = A(r % 60, 2);
2582
- return n + o + t + a;
2583
- }
2584
- const an = (e, t) => {
2585
- switch (e) {
2586
- case "P":
2587
- return t.date({ width: "short" });
2588
- case "PP":
2589
- return t.date({ width: "medium" });
2590
- case "PPP":
2591
- return t.date({ width: "long" });
2592
- case "PPPP":
2593
- default:
2594
- return t.date({ width: "full" });
2595
- }
2596
- }, Tr = (e, t) => {
2597
- switch (e) {
2598
- case "p":
2599
- return t.time({ width: "short" });
2600
- case "pp":
2601
- return t.time({ width: "medium" });
2602
- case "ppp":
2603
- return t.time({ width: "long" });
2604
- case "pppp":
2605
- default:
2606
- return t.time({ width: "full" });
2607
- }
2608
- }, fi = (e, t) => {
2609
- const n = e.match(/(P+)(p+)?/) || [], r = n[1], o = n[2];
2610
- if (!o)
2611
- return an(e, t);
2612
- let a;
2613
- switch (r) {
2614
- case "P":
2615
- a = t.dateTime({ width: "short" });
2616
- break;
2617
- case "PP":
2618
- a = t.dateTime({ width: "medium" });
2619
- break;
2620
- case "PPP":
2621
- a = t.dateTime({ width: "long" });
2622
- break;
2623
- case "PPPP":
2624
- default:
2625
- a = t.dateTime({ width: "full" });
2626
- break;
2627
- }
2628
- return a.replace("{{date}}", an(r, t)).replace("{{time}}", Tr(o, t));
2629
- }, hi = {
2630
- p: Tr,
2631
- P: fi
2632
- }, mi = /^D+$/, gi = /^Y+$/, yi = ["D", "DD", "YY", "YYYY"];
2633
- function pi(e) {
2634
- return mi.test(e);
2635
- }
2636
- function vi(e) {
2637
- return gi.test(e);
2638
- }
2639
- function wi(e, t, n) {
2640
- const r = bi(e, t, n);
2641
- if (console.warn(r), yi.includes(e)) throw new RangeError(r);
2642
- }
2643
- function bi(e, t, n) {
2644
- const r = e[0] === "Y" ? "years" : "days of the month";
2645
- 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`;
2646
- }
2647
- const Di = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ki = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Mi = /^'([^]*?)'?$/, Oi = /''/g, Ci = /[a-zA-Z]/;
2648
- function Ie(e, t, n) {
2649
- var l, d, y, w, C, b, v, O;
2650
- const r = He(), o = (n == null ? void 0 : n.locale) ?? r.locale ?? Se, a = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((d = (l = n == null ? void 0 : n.locale) == null ? void 0 : l.options) == null ? void 0 : d.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((w = (y = r.locale) == null ? void 0 : y.options) == null ? void 0 : w.firstWeekContainsDate) ?? 1, s = (n == null ? void 0 : n.weekStartsOn) ?? ((b = (C = n == null ? void 0 : n.locale) == null ? void 0 : C.options) == null ? void 0 : b.weekStartsOn) ?? r.weekStartsOn ?? ((O = (v = r.locale) == null ? void 0 : v.options) == null ? void 0 : O.weekStartsOn) ?? 0, i = Y(e, n == null ? void 0 : n.in);
2651
- if (!Cs(i))
2652
- throw new RangeError("Invalid time value");
2653
- let c = t.match(ki).map((g) => {
2654
- const p = g[0];
2655
- if (p === "p" || p === "P") {
2656
- const x = hi[p];
2657
- return x(g, o.formatLong);
2658
- }
2659
- return g;
2660
- }).join("").match(Di).map((g) => {
2661
- if (g === "''")
2662
- return { isToken: !1, value: "'" };
2663
- const p = g[0];
2664
- if (p === "'")
2665
- return { isToken: !1, value: xi(g) };
2666
- if (nn[p])
2667
- return { isToken: !0, value: g };
2668
- if (p.match(Ci))
2669
- throw new RangeError(
2670
- "Format string contains an unescaped latin alphabet character `" + p + "`"
2671
- );
2672
- return { isToken: !1, value: g };
2673
- });
2674
- o.localize.preprocessor && (c = o.localize.preprocessor(i, c));
2675
- const u = {
2676
- firstWeekContainsDate: a,
2677
- weekStartsOn: s,
2678
- locale: o
2679
- };
2680
- return c.map((g) => {
2681
- if (!g.isToken) return g.value;
2682
- const p = g.value;
2683
- (!(n != null && n.useAdditionalWeekYearTokens) && vi(p) || !(n != null && n.useAdditionalDayOfYearTokens) && pi(p)) && wi(p, t, String(e));
2684
- const x = nn[p[0]];
2685
- return x(i, p, o.localize, u);
2686
- }).join("");
2687
- }
2688
- function xi(e) {
2689
- const t = e.match(Mi);
2690
- return t ? t[1].replace(Oi, "'") : e;
2691
- }
2692
- function Ni(e, t) {
2693
- const n = Y(e, t == null ? void 0 : t.in), r = n.getFullYear(), o = n.getMonth(), a = V(n, 0);
2694
- return a.setFullYear(r, o + 1, 0), a.setHours(0, 0, 0, 0), a.getDate();
2695
- }
2696
- function Ti(e, t) {
2697
- return Y(e, t == null ? void 0 : t.in).getMonth();
2698
- }
2699
- function Si(e, t) {
2700
- return Y(e, t == null ? void 0 : t.in).getFullYear();
2701
- }
2702
- function Pi(e, t) {
2703
- return +Y(e) > +Y(t);
2704
- }
2705
- function Ei(e, t) {
2706
- return +Y(e) < +Y(t);
2707
- }
2708
- function Wi(e, t, n) {
2709
- const [r, o] = We(
2710
- n == null ? void 0 : n.in,
2711
- e,
2712
- t
2713
- );
2714
- return r.getFullYear() === o.getFullYear() && r.getMonth() === o.getMonth();
2715
- }
2716
- function _i(e, t, n) {
2717
- const [r, o] = We(
2718
- n == null ? void 0 : n.in,
2719
- e,
2720
- t
2721
- );
2722
- return r.getFullYear() === o.getFullYear();
2723
- }
2724
- function Ri(e, t, n) {
2725
- const r = Y(e, n == null ? void 0 : n.in), o = r.getFullYear(), a = r.getDate(), s = V(e, 0);
2726
- s.setFullYear(o, t, 15), s.setHours(0, 0, 0, 0);
2727
- const i = Ni(s);
2728
- return r.setMonth(t, Math.min(a, i)), r;
2729
- }
2730
- function Fi(e, t, n) {
2731
- const r = Y(e, n == null ? void 0 : n.in);
2732
- return isNaN(+r) ? V(e, NaN) : (r.setFullYear(t), r);
2733
- }
2734
- const sn = 5, Ii = 4;
2735
- function Ai(e, t) {
2736
- const n = t.startOfMonth(e), r = n.getDay() > 0 ? n.getDay() : 7, o = t.addDays(e, -r + 1), a = t.addDays(o, sn * 7 - 1);
2737
- return t.getMonth(e) === t.getMonth(a) ? sn : Ii;
2738
- }
2739
- function Sr(e, t) {
2740
- const n = t.startOfMonth(e), r = n.getDay();
2741
- return r === 1 ? n : r === 0 ? t.addDays(n, -6) : t.addDays(n, -1 * (r - 1));
2742
- }
2743
- function Yi(e, t) {
2744
- const n = Sr(e, t), r = Ai(e, t);
2745
- return t.addDays(n, r * 7 - 1);
2746
- }
2747
- const Pr = {
2748
- ...Se,
2749
- labels: {
2750
- labelDayButton: (e, t, n, r) => {
2751
- let o;
2752
- r && typeof r.format == "function" ? o = r.format.bind(r) : o = (s, i) => Ie(s, i, { locale: Se, ...n });
2753
- let a = o(e, "PPPP");
2754
- return t.today && (a = `Today, ${a}`), t.selected && (a = `${a}, selected`), a;
2755
- },
2756
- labelMonthDropdown: "Choose the Month",
2757
- labelNext: "Go to the Next Month",
2758
- labelPrevious: "Go to the Previous Month",
2759
- labelWeekNumber: (e) => `Week ${e}`,
2760
- labelYearDropdown: "Choose the Year",
2761
- labelGrid: (e, t, n) => {
2762
- let r;
2763
- return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (o, a) => Ie(o, a, { locale: Se, ...t }), r(e, "LLLL yyyy");
2764
- },
2765
- labelGridcell: (e, t, n, r) => {
2766
- let o;
2767
- r && typeof r.format == "function" ? o = r.format.bind(r) : o = (s, i) => Ie(s, i, { locale: Se, ...n });
2768
- let a = o(e, "PPPP");
2769
- return t != null && t.today && (a = `Today, ${a}`), a;
2770
- },
2771
- labelNav: "Navigation bar",
2772
- labelWeekNumberHeader: "Week Number",
2773
- labelWeekday: (e, t, n) => {
2774
- let r;
2775
- return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (o, a) => Ie(o, a, { locale: Se, ...t }), r(e, "cccc");
2776
- }
2777
- }
2778
- };
2779
- class ee {
2780
- /**
2781
- * Creates an instance of `DateLib`.
2782
- *
2783
- * @param options Configuration options for the date library.
2784
- * @param overrides Custom overrides for the date library functions.
2785
- */
2786
- constructor(t, n) {
2787
- this.today = () => {
2788
- var o;
2789
- if ((o = this.overrides) != null && o.today)
2790
- return this.overrides.today();
2791
- if (this.options.timeZone)
2792
- return U.tz(this.options.timeZone);
2793
- const r = this.options.Date ?? Date;
2794
- return new r();
2795
- }, this.newDate = (r, o, a) => {
2796
- var s;
2797
- return (s = this.overrides) != null && s.newDate ? this.overrides.newDate(r, o, a) : this.options.timeZone ? new U(r, o, a, this.options.timeZone) : new Date(r, o, a);
2798
- }, this.addDays = (r, o) => {
2799
- var a;
2800
- return (a = this.overrides) != null && a.addDays ? this.overrides.addDays(r, o) : wr(r, o);
2801
- }, this.addMonths = (r, o) => {
2802
- var a;
2803
- return (a = this.overrides) != null && a.addMonths ? this.overrides.addMonths(r, o) : br(r, o);
2804
- }, this.addWeeks = (r, o) => {
2805
- var a;
2806
- return (a = this.overrides) != null && a.addWeeks ? this.overrides.addWeeks(r, o) : bs(r, o);
2807
- }, this.addYears = (r, o) => {
2808
- var a;
2809
- return (a = this.overrides) != null && a.addYears ? this.overrides.addYears(r, o) : Ds(r, o);
2810
- }, this.differenceInCalendarDays = (r, o) => {
2811
- var a;
2812
- return (a = this.overrides) != null && a.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, o) : It(r, o);
2813
- }, this.differenceInCalendarMonths = (r, o) => {
2814
- var a;
2815
- return (a = this.overrides) != null && a.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, o) : Mr(r, o);
2816
- }, this.eachMonthOfInterval = (r) => {
2817
- var o;
2818
- return (o = this.overrides) != null && o.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : Ns(r);
2819
- }, this.eachYearOfInterval = (r) => {
2820
- var i;
2821
- const o = (i = this.overrides) != null && i.eachYearOfInterval ? this.overrides.eachYearOfInterval(r) : Ps(r), a = new Set(o.map((c) => this.getYear(c)));
2822
- if (a.size === o.length)
2823
- return o;
2824
- const s = [];
2825
- return a.forEach((c) => {
2826
- s.push(new Date(c, 0, 1));
2827
- }), s;
2828
- }, this.endOfBroadcastWeek = (r) => {
2829
- var o;
2830
- return (o = this.overrides) != null && o.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : Yi(r, this);
2831
- }, this.endOfISOWeek = (r) => {
2832
- var o;
2833
- return (o = this.overrides) != null && o.endOfISOWeek ? this.overrides.endOfISOWeek(r) : Es(r);
2834
- }, this.endOfMonth = (r) => {
2835
- var o;
2836
- return (o = this.overrides) != null && o.endOfMonth ? this.overrides.endOfMonth(r) : xs(r);
2837
- }, this.endOfWeek = (r, o) => {
2838
- var a;
2839
- return (a = this.overrides) != null && a.endOfWeek ? this.overrides.endOfWeek(r, o) : xr(r, this.options);
2840
- }, this.endOfYear = (r) => {
2841
- var o;
2842
- return (o = this.overrides) != null && o.endOfYear ? this.overrides.endOfYear(r) : Ss(r);
2843
- }, this.format = (r, o, a) => {
2844
- var i;
2845
- const s = (i = this.overrides) != null && i.format ? this.overrides.format(r, o, this.options) : Ie(r, o, this.options);
2846
- return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(s) : s;
2847
- }, this.getISOWeek = (r) => {
2848
- var o;
2849
- return (o = this.overrides) != null && o.getISOWeek ? this.overrides.getISOWeek(r) : At(r);
2850
- }, this.getMonth = (r, o) => {
2851
- var a;
2852
- return (a = this.overrides) != null && a.getMonth ? this.overrides.getMonth(r, this.options) : Ti(r, this.options);
2853
- }, this.getYear = (r, o) => {
2854
- var a;
2855
- return (a = this.overrides) != null && a.getYear ? this.overrides.getYear(r, this.options) : Si(r, this.options);
2856
- }, this.getWeek = (r, o) => {
2857
- var a;
2858
- return (a = this.overrides) != null && a.getWeek ? this.overrides.getWeek(r, this.options) : Yt(r, this.options);
2859
- }, this.isAfter = (r, o) => {
2860
- var a;
2861
- return (a = this.overrides) != null && a.isAfter ? this.overrides.isAfter(r, o) : Pi(r, o);
2862
- }, this.isBefore = (r, o) => {
2863
- var a;
2864
- return (a = this.overrides) != null && a.isBefore ? this.overrides.isBefore(r, o) : Ei(r, o);
2865
- }, this.isDate = (r) => {
2866
- var o;
2867
- return (o = this.overrides) != null && o.isDate ? this.overrides.isDate(r) : kr(r);
2868
- }, this.isSameDay = (r, o) => {
2869
- var a;
2870
- return (a = this.overrides) != null && a.isSameDay ? this.overrides.isSameDay(r, o) : Os(r, o);
2871
- }, this.isSameMonth = (r, o) => {
2872
- var a;
2873
- return (a = this.overrides) != null && a.isSameMonth ? this.overrides.isSameMonth(r, o) : Wi(r, o);
2874
- }, this.isSameYear = (r, o) => {
2875
- var a;
2876
- return (a = this.overrides) != null && a.isSameYear ? this.overrides.isSameYear(r, o) : _i(r, o);
2877
- }, this.max = (r) => {
2878
- var o;
2879
- return (o = this.overrides) != null && o.max ? this.overrides.max(r) : ks(r);
2880
- }, this.min = (r) => {
2881
- var o;
2882
- return (o = this.overrides) != null && o.min ? this.overrides.min(r) : Ms(r);
2883
- }, this.setMonth = (r, o) => {
2884
- var a;
2885
- return (a = this.overrides) != null && a.setMonth ? this.overrides.setMonth(r, o) : Ri(r, o);
2886
- }, this.setYear = (r, o) => {
2887
- var a;
2888
- return (a = this.overrides) != null && a.setYear ? this.overrides.setYear(r, o) : Fi(r, o);
2889
- }, this.startOfBroadcastWeek = (r, o) => {
2890
- var a;
2891
- return (a = this.overrides) != null && a.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : Sr(r, this);
2892
- }, this.startOfDay = (r) => {
2893
- var o;
2894
- return (o = this.overrides) != null && o.startOfDay ? this.overrides.startOfDay(r) : Be(r);
2895
- }, this.startOfISOWeek = (r) => {
2896
- var o;
2897
- return (o = this.overrides) != null && o.startOfISOWeek ? this.overrides.startOfISOWeek(r) : Ye(r);
2898
- }, this.startOfMonth = (r) => {
2899
- var o;
2900
- return (o = this.overrides) != null && o.startOfMonth ? this.overrides.startOfMonth(r) : Ts(r);
2901
- }, this.startOfWeek = (r, o) => {
2902
- var a;
2903
- return (a = this.overrides) != null && a.startOfWeek ? this.overrides.startOfWeek(r, this.options) : Pe(r, this.options);
2904
- }, this.startOfYear = (r) => {
2905
- var o;
2906
- return (o = this.overrides) != null && o.startOfYear ? this.overrides.startOfYear(r) : Cr(r);
2907
- }, this.options = { locale: Pr, ...t }, this.overrides = n;
2908
- }
2909
- /**
2910
- * Generates a mapping of Arabic digits (0-9) to the target numbering system
2911
- * digits.
2912
- *
2913
- * @since 9.5.0
2914
- * @returns A record mapping Arabic digits to the target numerals.
2915
- */
2916
- getDigitMap() {
2917
- const { numerals: t = "latn" } = this.options, n = new Intl.NumberFormat("en-US", {
2918
- numberingSystem: t
2919
- }), r = {};
2920
- for (let o = 0; o < 10; o++)
2921
- r[o.toString()] = n.format(o);
2922
- return r;
2923
- }
2924
- /**
2925
- * Replaces Arabic digits in a string with the target numbering system digits.
2926
- *
2927
- * @since 9.5.0
2928
- * @param input The string containing Arabic digits.
2929
- * @returns The string with digits replaced.
2930
- */
2931
- replaceDigits(t) {
2932
- const n = this.getDigitMap();
2933
- return t.replace(/\d/g, (r) => n[r] || r);
2934
- }
2935
- /**
2936
- * Formats a number using the configured numbering system.
2937
- *
2938
- * @since 9.5.0
2939
- * @param value The number to format.
2940
- * @returns The formatted number as a string.
2941
- */
2942
- formatNumber(t) {
2943
- return this.replaceDigits(t.toString());
2944
- }
2945
- /**
2946
- * Returns the preferred ordering for month and year labels for the current
2947
- * locale.
2948
- */
2949
- getMonthYearOrder() {
2950
- var n;
2951
- const t = (n = this.options.locale) == null ? void 0 : n.code;
2952
- return t && ee.yearFirstLocales.has(t) ? "year-first" : "month-first";
2953
- }
2954
- /**
2955
- * Formats the month/year pair respecting locale conventions.
2956
- *
2957
- * @since 9.11.0
2958
- */
2959
- formatMonthYear(t) {
2960
- const { locale: n, timeZone: r, numerals: o } = this.options, a = n == null ? void 0 : n.code;
2961
- if (a && ee.yearFirstLocales.has(a))
2962
- try {
2963
- return new Intl.DateTimeFormat(a, {
2964
- month: "long",
2965
- year: "numeric",
2966
- timeZone: r,
2967
- numberingSystem: o
2968
- }).format(t);
2969
- } catch {
2970
- }
2971
- const s = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
2972
- return this.format(t, s);
2973
- }
2974
- }
2975
- ee.yearFirstLocales = /* @__PURE__ */ new Set([
2976
- "eu",
2977
- "hu",
2978
- "ja",
2979
- "ja-Hira",
2980
- "ja-JP",
2981
- "ko",
2982
- "ko-KR",
2983
- "lt",
2984
- "lt-LT",
2985
- "lv",
2986
- "lv-LV",
2987
- "mn",
2988
- "mn-MN",
2989
- "zh",
2990
- "zh-CN",
2991
- "zh-HK",
2992
- "zh-TW"
2993
- ]);
2994
- const de = new ee();
2995
- class Er {
2996
- constructor(t, n, r = de) {
2997
- this.date = t, this.displayMonth = n, this.outside = !!(n && !r.isSameMonth(t, n)), this.dateLib = r, this.isoDate = r.format(t, "yyyy-MM-dd"), this.displayMonthId = r.format(n, "yyyy-MM"), this.dateMonthId = r.format(t, "yyyy-MM");
2998
- }
2999
- /**
3000
- * Checks if this day is equal to another `CalendarDay`, considering both the
3001
- * date and the displayed month.
3002
- *
3003
- * @param day The `CalendarDay` to compare with.
3004
- * @returns `true` if the days are equal, otherwise `false`.
3005
- */
3006
- isEqualTo(t) {
3007
- return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
3008
- }
3009
- }
3010
- class Bi {
3011
- constructor(t, n) {
3012
- this.date = t, this.weeks = n;
3013
- }
3014
- }
3015
- class $i {
3016
- constructor(t, n) {
3017
- this.days = n, this.weekNumber = t;
3018
- }
3019
- }
3020
- function Hi(e) {
3021
- return k.createElement("span", { ...e });
3022
- }
3023
- function qi(e) {
3024
- const { size: t = 24, orientation: n = "left", className: r, style: o } = e;
3025
- return k.createElement(
3026
- "svg",
3027
- { className: r, style: o, width: t, height: t, viewBox: "0 0 24 24" },
3028
- n === "up" && k.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
3029
- n === "down" && k.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
3030
- n === "left" && k.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
3031
- n === "right" && k.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
3032
- );
3033
- }
3034
- function ji(e) {
3035
- const { day: t, modifiers: n, ...r } = e;
3036
- return k.createElement("td", { ...r });
3037
- }
3038
- function Vi(e) {
3039
- const { day: t, modifiers: n, ...r } = e, o = k.useRef(null);
3040
- return k.useEffect(() => {
3041
- var a;
3042
- n.focused && ((a = o.current) == null || a.focus());
3043
- }, [n.focused]), k.createElement("button", { ref: o, ...r });
3044
- }
3045
- var D;
3046
- (function(e) {
3047
- 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";
3048
- })(D || (D = {}));
3049
- var H;
3050
- (function(e) {
3051
- e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
3052
- })(H || (H = {}));
3053
- var ae;
3054
- (function(e) {
3055
- e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
3056
- })(ae || (ae = {}));
3057
- var L;
3058
- (function(e) {
3059
- 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";
3060
- })(L || (L = {}));
3061
- const Wr = Wo(void 0);
3062
- function st() {
3063
- const e = _o(Wr);
3064
- if (e === void 0)
3065
- throw new Error("useDayPicker() must be used within a custom component.");
3066
- return e;
3067
- }
3068
- function Gi(e) {
3069
- const { options: t, className: n, ...r } = e, { classNames: o, components: a, styles: s } = st(), i = [o[D.Dropdown], n].join(" "), c = t == null ? void 0 : t.find(({ value: u }) => u === r.value);
3070
- return k.createElement(
3071
- "span",
3072
- { "data-disabled": r.disabled, className: o[D.DropdownRoot], style: s == null ? void 0 : s[D.DropdownRoot] },
3073
- k.createElement(a.Select, { className: i, ...r }, t == null ? void 0 : t.map(({ value: u, label: l, disabled: d }) => k.createElement(a.Option, { key: u, value: u, disabled: d }, l))),
3074
- k.createElement(
3075
- "span",
3076
- { className: o[D.CaptionLabel], style: s == null ? void 0 : s[D.CaptionLabel], "aria-hidden": !0 },
3077
- c == null ? void 0 : c.label,
3078
- k.createElement(a.Chevron, { orientation: "down", size: 18, className: o[D.Chevron], style: s == null ? void 0 : s[D.Chevron] })
3079
- )
3080
- );
3081
- }
3082
- function zi(e) {
3083
- return k.createElement("div", { ...e });
3084
- }
3085
- function Ki(e) {
3086
- return k.createElement("div", { ...e });
3087
- }
3088
- function Xi(e) {
3089
- const { calendarMonth: t, displayIndex: n, ...r } = e;
3090
- return k.createElement("div", { ...r }, e.children);
3091
- }
3092
- function Ui(e) {
3093
- const { calendarMonth: t, displayIndex: n, ...r } = e;
3094
- return k.createElement("div", { ...r });
3095
- }
3096
- function Qi(e) {
3097
- return k.createElement("table", { ...e });
3098
- }
3099
- function Zi(e) {
3100
- return k.createElement("div", { ...e });
3101
- }
3102
- function Ji(e) {
3103
- const { components: t } = st();
3104
- return k.createElement(t.Dropdown, { ...e });
3105
- }
3106
- function Li(e) {
3107
- const { onPreviousClick: t, onNextClick: n, previousMonth: r, nextMonth: o, ...a } = e, { components: s, classNames: i, styles: c, labels: { labelPrevious: u, labelNext: l } } = st(), d = te((w) => {
3108
- o && (n == null || n(w));
3109
- }, [o, n]), y = te((w) => {
3110
- r && (t == null || t(w));
3111
- }, [r, t]);
3112
- return k.createElement(
3113
- "nav",
3114
- { ...a },
3115
- k.createElement(
3116
- s.PreviousMonthButton,
3117
- { type: "button", className: i[D.PreviousMonthButton], style: c == null ? void 0 : c[D.PreviousMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled": r ? void 0 : !0, "aria-label": u(r), onClick: y },
3118
- k.createElement(s.Chevron, { disabled: r ? void 0 : !0, className: i[D.Chevron], style: c == null ? void 0 : c[D.Chevron], orientation: "left" })
3119
- ),
3120
- k.createElement(
3121
- s.NextMonthButton,
3122
- { type: "button", className: i[D.NextMonthButton], style: c == null ? void 0 : c[D.NextMonthButton], tabIndex: o ? void 0 : -1, "aria-disabled": o ? void 0 : !0, "aria-label": l(o), onClick: d },
3123
- k.createElement(s.Chevron, { disabled: o ? void 0 : !0, orientation: "right", className: i[D.Chevron], style: c == null ? void 0 : c[D.Chevron] })
3124
- )
3125
- );
3126
- }
3127
- function ec(e) {
3128
- return k.createElement("button", { ...e });
3129
- }
3130
- function tc(e) {
3131
- return k.createElement("option", { ...e });
3132
- }
3133
- function nc(e) {
3134
- return k.createElement("button", { ...e });
3135
- }
3136
- function rc(e) {
3137
- const { rootRef: t, ...n } = e;
3138
- return k.createElement("div", { ...n, ref: t });
3139
- }
3140
- function oc(e) {
3141
- return k.createElement("select", { ...e });
3142
- }
3143
- function ac(e) {
3144
- const { week: t, ...n } = e;
3145
- return k.createElement("tr", { ...n });
3146
- }
3147
- function sc(e) {
3148
- return k.createElement("th", { ...e });
3149
- }
3150
- function ic(e) {
3151
- return k.createElement(
3152
- "thead",
3153
- { "aria-hidden": !0 },
3154
- k.createElement("tr", { ...e })
3155
- );
3156
- }
3157
- function cc(e) {
3158
- const { week: t, ...n } = e;
3159
- return k.createElement("th", { ...n });
3160
- }
3161
- function uc(e) {
3162
- return k.createElement("th", { ...e });
3163
- }
3164
- function lc(e) {
3165
- return k.createElement("tbody", { ...e });
3166
- }
3167
- function dc(e) {
3168
- const { components: t } = st();
3169
- return k.createElement(t.Dropdown, { ...e });
3170
- }
3171
- const fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3172
- __proto__: null,
3173
- CaptionLabel: Hi,
3174
- Chevron: qi,
3175
- Day: ji,
3176
- DayButton: Vi,
3177
- Dropdown: Gi,
3178
- DropdownNav: zi,
3179
- Footer: Ki,
3180
- Month: Xi,
3181
- MonthCaption: Ui,
3182
- MonthGrid: Qi,
3183
- Months: Zi,
3184
- MonthsDropdown: Ji,
3185
- Nav: Li,
3186
- NextMonthButton: ec,
3187
- Option: tc,
3188
- PreviousMonthButton: nc,
3189
- Root: rc,
3190
- Select: oc,
3191
- Week: ac,
3192
- WeekNumber: cc,
3193
- WeekNumberHeader: uc,
3194
- Weekday: sc,
3195
- Weekdays: ic,
3196
- Weeks: lc,
3197
- YearsDropdown: dc
3198
- }, Symbol.toStringTag, { value: "Module" }));
3199
- function ge(e, t, n = !1, r = de) {
3200
- let { from: o, to: a } = e;
3201
- const { differenceInCalendarDays: s, isSameDay: i } = r;
3202
- return o && a ? (s(a, o) < 0 && ([o, a] = [a, o]), s(t, o) >= (n ? 1 : 0) && s(a, t) >= (n ? 1 : 0)) : !n && a ? i(a, t) : !n && o ? i(o, t) : !1;
3203
- }
3204
- function Bt(e) {
3205
- return !!(e && typeof e == "object" && "before" in e && "after" in e);
3206
- }
3207
- function it(e) {
3208
- return !!(e && typeof e == "object" && "from" in e);
3209
- }
3210
- function $t(e) {
3211
- return !!(e && typeof e == "object" && "after" in e);
3212
- }
3213
- function Ht(e) {
3214
- return !!(e && typeof e == "object" && "before" in e);
3215
- }
3216
- function _r(e) {
3217
- return !!(e && typeof e == "object" && "dayOfWeek" in e);
3218
- }
3219
- function Rr(e, t) {
3220
- return Array.isArray(e) && e.every(t.isDate);
3221
- }
3222
- function ye(e, t, n = de) {
3223
- const r = Array.isArray(t) ? t : [t], { isSameDay: o, differenceInCalendarDays: a, isAfter: s } = n;
3224
- return r.some((i) => {
3225
- if (typeof i == "boolean")
3226
- return i;
3227
- if (n.isDate(i))
3228
- return o(e, i);
3229
- if (Rr(i, n))
3230
- return i.some((c) => o(e, c));
3231
- if (it(i))
3232
- return ge(i, e, !1, n);
3233
- if (_r(i))
3234
- return Array.isArray(i.dayOfWeek) ? i.dayOfWeek.includes(e.getDay()) : i.dayOfWeek === e.getDay();
3235
- if (Bt(i)) {
3236
- const c = a(i.before, e), u = a(i.after, e), l = c > 0, d = u < 0;
3237
- return s(i.before, i.after) ? d && l : l || d;
3238
- }
3239
- return $t(i) ? a(e, i.after) > 0 : Ht(i) ? a(i.before, e) > 0 : typeof i == "function" ? i(e) : !1;
3240
- });
3241
- }
3242
- function hc(e, t, n, r, o) {
3243
- const { disabled: a, hidden: s, modifiers: i, showOutsideDays: c, broadcastCalendar: u, today: l = o.today() } = t, { isSameDay: d, isSameMonth: y, startOfMonth: w, isBefore: C, endOfMonth: b, isAfter: v } = o, O = n && w(n), g = r && b(r), p = {
3244
- [H.focused]: [],
3245
- [H.outside]: [],
3246
- [H.disabled]: [],
3247
- [H.hidden]: [],
3248
- [H.today]: []
3249
- }, x = {};
3250
- for (const M of e) {
3251
- const { date: h, displayMonth: N } = M, E = !!(N && !y(h, N)), _ = !!(O && C(h, O)), I = !!(g && v(h, g)), B = !!(a && ye(h, a, o)), G = !!(s && ye(h, s, o)) || _ || I || // Broadcast calendar will show outside days as default
3252
- !u && !c && E || u && c === !1 && E, K = d(h, l);
3253
- E && p.outside.push(M), B && p.disabled.push(M), G && p.hidden.push(M), K && p.today.push(M), i && Object.keys(i).forEach((T) => {
3254
- const z = i == null ? void 0 : i[T];
3255
- z && ye(h, z, o) && (x[T] ? x[T].push(M) : x[T] = [M]);
3256
- });
3257
- }
3258
- return (M) => {
3259
- const h = {
3260
- [H.focused]: !1,
3261
- [H.disabled]: !1,
3262
- [H.hidden]: !1,
3263
- [H.outside]: !1,
3264
- [H.today]: !1
3265
- }, N = {};
3266
- for (const E in p) {
3267
- const _ = p[E];
3268
- h[E] = _.some((I) => I === M);
3269
- }
3270
- for (const E in x)
3271
- N[E] = x[E].some((_) => _ === M);
3272
- return {
3273
- ...h,
3274
- // custom modifiers should override all the previous ones
3275
- ...N
3276
- };
3277
- };
3278
- }
3279
- function mc(e, t, n = {}) {
3280
- return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [a]) => (n[a] ? o.push(n[a]) : t[H[a]] ? o.push(t[H[a]]) : t[ae[a]] && o.push(t[ae[a]]), o), [t[D.Day]]);
3281
- }
3282
- function gc(e) {
3283
- return {
3284
- ...fc,
3285
- ...e
3286
- };
3287
- }
3288
- function yc(e) {
3289
- const t = {
3290
- "data-mode": e.mode ?? void 0,
3291
- "data-required": "required" in e ? e.required : void 0,
3292
- "data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
3293
- "data-week-numbers": e.showWeekNumber || void 0,
3294
- "data-broadcast-calendar": e.broadcastCalendar || void 0,
3295
- "data-nav-layout": e.navLayout || void 0
3296
- };
3297
- return Object.entries(e).forEach(([n, r]) => {
3298
- n.startsWith("data-") && (t[n] = r);
3299
- }), t;
3300
- }
3301
- function pc() {
3302
- const e = {};
3303
- for (const t in D)
3304
- e[D[t]] = `rdp-${D[t]}`;
3305
- for (const t in H)
3306
- e[H[t]] = `rdp-${H[t]}`;
3307
- for (const t in ae)
3308
- e[ae[t]] = `rdp-${ae[t]}`;
3309
- for (const t in L)
3310
- e[L[t]] = `rdp-${L[t]}`;
3311
- return e;
3312
- }
3313
- function vc(e, t, n) {
3314
- return (n ?? new ee(t)).formatMonthYear(e);
3315
- }
3316
- function wc(e, t, n) {
3317
- return (n ?? new ee(t)).format(e, "d");
3318
- }
3319
- function bc(e, t = de) {
3320
- return t.format(e, "LLLL");
3321
- }
3322
- function Dc(e, t, n) {
3323
- return (n ?? new ee(t)).format(e, "cccccc");
3324
- }
3325
- function kc(e, t = de) {
3326
- return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
3327
- }
3328
- function Mc() {
3329
- return "";
3330
- }
3331
- function Oc(e, t = de) {
3332
- return t.format(e, "yyyy");
3333
- }
3334
- const Cc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3335
- __proto__: null,
3336
- formatCaption: vc,
3337
- formatDay: wc,
3338
- formatMonthDropdown: bc,
3339
- formatWeekNumber: kc,
3340
- formatWeekNumberHeader: Mc,
3341
- formatWeekdayName: Dc,
3342
- formatYearDropdown: Oc
3343
- }, Symbol.toStringTag, { value: "Module" }));
3344
- function xc(e) {
3345
- return {
3346
- ...Cc,
3347
- ...e
3348
- };
3349
- }
3350
- function Fr(e, t, n, r) {
3351
- let o = (r ?? new ee(n)).format(e, "PPPP");
3352
- return t.today && (o = `Today, ${o}`), t.selected && (o = `${o}, selected`), o;
3353
- }
3354
- function Ir(e, t, n) {
3355
- return (n ?? new ee(t)).formatMonthYear(e);
3356
- }
3357
- function Ar(e, t, n, r) {
3358
- let o = (r ?? new ee(n)).format(e, "PPPP");
3359
- return t != null && t.today && (o = `Today, ${o}`), o;
3360
- }
3361
- function Yr(e) {
3362
- return "Choose the Month";
3363
- }
3364
- function Br() {
3365
- return "";
3366
- }
3367
- const Nc = "Go to the Next Month";
3368
- function $r(e, t) {
3369
- return Nc;
3370
- }
3371
- function Hr(e) {
3372
- return "Go to the Previous Month";
3373
- }
3374
- function qr(e, t, n) {
3375
- return (n ?? new ee(t)).format(e, "cccc");
3376
- }
3377
- function jr(e, t) {
3378
- return `Week ${e}`;
3379
- }
3380
- function Vr(e) {
3381
- return "Week Number";
3382
- }
3383
- function Gr(e) {
3384
- return "Choose the Year";
3385
- }
3386
- const Tc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3387
- __proto__: null,
3388
- labelDayButton: Fr,
3389
- labelGrid: Ir,
3390
- labelGridcell: Ar,
3391
- labelMonthDropdown: Yr,
3392
- labelNav: Br,
3393
- labelNext: $r,
3394
- labelPrevious: Hr,
3395
- labelWeekNumber: jr,
3396
- labelWeekNumberHeader: Vr,
3397
- labelWeekday: qr,
3398
- labelYearDropdown: Gr
3399
- }, Symbol.toStringTag, { value: "Module" })), oe = (e, t, n) => t || (n ? typeof n == "function" ? n : (...r) => n : e);
3400
- function Sc(e, t) {
3401
- var r;
3402
- const n = ((r = t.locale) == null ? void 0 : r.labels) ?? {};
3403
- return {
3404
- ...Tc,
3405
- ...e ?? {},
3406
- labelDayButton: oe(Fr, e == null ? void 0 : e.labelDayButton, n.labelDayButton),
3407
- labelMonthDropdown: oe(Yr, e == null ? void 0 : e.labelMonthDropdown, n.labelMonthDropdown),
3408
- labelNext: oe($r, e == null ? void 0 : e.labelNext, n.labelNext),
3409
- labelPrevious: oe(Hr, e == null ? void 0 : e.labelPrevious, n.labelPrevious),
3410
- labelWeekNumber: oe(jr, e == null ? void 0 : e.labelWeekNumber, n.labelWeekNumber),
3411
- labelYearDropdown: oe(Gr, e == null ? void 0 : e.labelYearDropdown, n.labelYearDropdown),
3412
- labelGrid: oe(Ir, e == null ? void 0 : e.labelGrid, n.labelGrid),
3413
- labelGridcell: oe(Ar, e == null ? void 0 : e.labelGridcell, n.labelGridcell),
3414
- labelNav: oe(Br, e == null ? void 0 : e.labelNav, n.labelNav),
3415
- labelWeekNumberHeader: oe(Vr, e == null ? void 0 : e.labelWeekNumberHeader, n.labelWeekNumberHeader),
3416
- labelWeekday: oe(qr, e == null ? void 0 : e.labelWeekday, n.labelWeekday)
3417
- };
3418
- }
3419
- function Pc(e, t, n, r, o) {
3420
- const { startOfMonth: a, startOfYear: s, endOfYear: i, eachMonthOfInterval: c, getMonth: u } = o;
3421
- return c({
3422
- start: s(e),
3423
- end: i(e)
3424
- }).map((y) => {
3425
- const w = r.formatMonthDropdown(y, o), C = u(y), b = t && y < a(t) || n && y > a(n) || !1;
3426
- return { value: C, label: w, disabled: b };
3427
- });
3428
- }
3429
- function Ec(e, t = {}, n = {}) {
3430
- let r = { ...t == null ? void 0 : t[D.Day] };
3431
- return Object.entries(e).filter(([, o]) => o === !0).forEach(([o]) => {
3432
- r = {
3433
- ...r,
3434
- ...n == null ? void 0 : n[o]
3435
- };
3436
- }), r;
3437
- }
3438
- function Wc(e, t, n, r) {
3439
- const o = r ?? e.today(), a = n ? e.startOfBroadcastWeek(o, e) : t ? e.startOfISOWeek(o) : e.startOfWeek(o), s = [];
3440
- for (let i = 0; i < 7; i++) {
3441
- const c = e.addDays(a, i);
3442
- s.push(c);
3443
- }
3444
- return s;
3445
- }
3446
- function _c(e, t, n, r, o = !1) {
3447
- if (!e || !t)
3448
- return;
3449
- const { startOfYear: a, endOfYear: s, eachYearOfInterval: i, getYear: c } = r, u = a(e), l = s(t), d = i({ start: u, end: l });
3450
- return o && d.reverse(), d.map((y) => {
3451
- const w = n.formatYearDropdown(y, r);
3452
- return {
3453
- value: c(y),
3454
- label: w,
3455
- disabled: !1
3456
- };
3457
- });
3458
- }
3459
- function Rc(e, t = {}) {
3460
- var i;
3461
- const { weekStartsOn: n, locale: r } = t, o = n ?? ((i = r == null ? void 0 : r.options) == null ? void 0 : i.weekStartsOn) ?? 0, a = (c) => {
3462
- const u = typeof c == "number" || typeof c == "string" ? new Date(c) : c;
3463
- return new U(u.getFullYear(), u.getMonth(), u.getDate(), 12, 0, 0, e);
3464
- }, s = (c) => {
3465
- const u = a(c);
3466
- return new Date(u.getFullYear(), u.getMonth(), u.getDate(), 0, 0, 0, 0);
3467
- };
3468
- return {
3469
- today: () => a(U.tz(e)),
3470
- newDate: (c, u, l) => new U(c, u, l, 12, 0, 0, e),
3471
- startOfDay: (c) => a(c),
3472
- startOfWeek: (c, u) => {
3473
- const l = a(c), d = (u == null ? void 0 : u.weekStartsOn) ?? o, y = (l.getDay() - d + 7) % 7;
3474
- return l.setDate(l.getDate() - y), l;
3475
- },
3476
- startOfISOWeek: (c) => {
3477
- const u = a(c), l = (u.getDay() - 1 + 7) % 7;
3478
- return u.setDate(u.getDate() - l), u;
3479
- },
3480
- startOfMonth: (c) => {
3481
- const u = a(c);
3482
- return u.setDate(1), u;
3483
- },
3484
- startOfYear: (c) => {
3485
- const u = a(c);
3486
- return u.setMonth(0, 1), u;
3487
- },
3488
- endOfWeek: (c, u) => {
3489
- const l = a(c), w = ((((u == null ? void 0 : u.weekStartsOn) ?? o) + 6) % 7 - l.getDay() + 7) % 7;
3490
- return l.setDate(l.getDate() + w), l;
3491
- },
3492
- endOfISOWeek: (c) => {
3493
- const u = a(c), l = (7 - u.getDay()) % 7;
3494
- return u.setDate(u.getDate() + l), u;
3495
- },
3496
- endOfMonth: (c) => {
3497
- const u = a(c);
3498
- return u.setMonth(u.getMonth() + 1, 0), u;
3499
- },
3500
- endOfYear: (c) => {
3501
- const u = a(c);
3502
- return u.setMonth(11, 31), u;
3503
- },
3504
- eachMonthOfInterval: (c) => {
3505
- const u = a(c.start), l = a(c.end), d = [], y = new U(u.getFullYear(), u.getMonth(), 1, 12, 0, 0, e), w = l.getFullYear() * 12 + l.getMonth();
3506
- for (; y.getFullYear() * 12 + y.getMonth() <= w; )
3507
- d.push(new U(y, e)), y.setMonth(y.getMonth() + 1, 1);
3508
- return d;
3509
- },
3510
- // Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
3511
- // mutate the same TZDate, and return it.
3512
- addDays: (c, u) => {
3513
- const l = a(c);
3514
- return l.setDate(l.getDate() + u), l;
3515
- },
3516
- addWeeks: (c, u) => {
3517
- const l = a(c);
3518
- return l.setDate(l.getDate() + u * 7), l;
3519
- },
3520
- addMonths: (c, u) => {
3521
- const l = a(c);
3522
- return l.setMonth(l.getMonth() + u), l;
3523
- },
3524
- addYears: (c, u) => {
3525
- const l = a(c);
3526
- return l.setFullYear(l.getFullYear() + u), l;
3527
- },
3528
- eachYearOfInterval: (c) => {
3529
- const u = a(c.start), l = a(c.end), d = [], y = new U(u.getFullYear(), 0, 1, 12, 0, 0, e);
3530
- for (; y.getFullYear() <= l.getFullYear(); )
3531
- d.push(new U(y, e)), y.setFullYear(y.getFullYear() + 1, 0, 1);
3532
- return d;
3533
- },
3534
- getWeek: (c, u) => {
3535
- var d;
3536
- const l = s(c);
3537
- return Yt(l, {
3538
- weekStartsOn: (u == null ? void 0 : u.weekStartsOn) ?? o,
3539
- firstWeekContainsDate: (u == null ? void 0 : u.firstWeekContainsDate) ?? ((d = r == null ? void 0 : r.options) == null ? void 0 : d.firstWeekContainsDate) ?? 1
3540
- });
3541
- },
3542
- getISOWeek: (c) => {
3543
- const u = s(c);
3544
- return At(u);
3545
- },
3546
- differenceInCalendarDays: (c, u) => {
3547
- const l = s(c), d = s(u);
3548
- return It(l, d);
3549
- },
3550
- differenceInCalendarMonths: (c, u) => {
3551
- const l = s(c), d = s(u);
3552
- return Mr(l, d);
3553
- }
3554
- };
3555
- }
3556
- const qe = (e) => e instanceof HTMLElement ? e : null, vt = (e) => [
3557
- ...e.querySelectorAll("[data-animated-month]") ?? []
3558
- ], Fc = (e) => qe(e.querySelector("[data-animated-month]")), wt = (e) => qe(e.querySelector("[data-animated-caption]")), bt = (e) => qe(e.querySelector("[data-animated-weeks]")), Ic = (e) => qe(e.querySelector("[data-animated-nav]")), Ac = (e) => qe(e.querySelector("[data-animated-weekdays]"));
3559
- function Yc(e, t, { classNames: n, months: r, focused: o, dateLib: a }) {
3560
- const s = Xe(null), i = Xe(r), c = Xe(!1);
3561
- Ro(() => {
3562
- const u = i.current;
3563
- if (i.current = r, !t || !e.current || // safety check because the ref can be set to anything by consumers
3564
- !(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
3565
- r.length === 0 || u.length === 0 || r.length !== u.length)
3566
- return;
3567
- const l = a.isSameMonth(r[0].date, u[0].date), d = a.isAfter(r[0].date, u[0].date), y = d ? n[L.caption_after_enter] : n[L.caption_before_enter], w = d ? n[L.weeks_after_enter] : n[L.weeks_before_enter], C = s.current, b = e.current.cloneNode(!0);
3568
- if (b instanceof HTMLElement ? (vt(b).forEach((p) => {
3569
- if (!(p instanceof HTMLElement))
3570
- return;
3571
- const x = Fc(p);
3572
- x && p.contains(x) && p.removeChild(x);
3573
- const M = wt(p);
3574
- M && M.classList.remove(y);
3575
- const h = bt(p);
3576
- h && h.classList.remove(w);
3577
- }), s.current = b) : s.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
3578
- o)
3579
- return;
3580
- const v = C instanceof HTMLElement ? vt(C) : [], O = vt(e.current);
3581
- if (O != null && O.every((g) => g instanceof HTMLElement) && (v != null && v.every((g) => g instanceof HTMLElement))) {
3582
- c.current = !0, e.current.style.isolation = "isolate";
3583
- const g = Ic(e.current);
3584
- g && (g.style.zIndex = "1"), O.forEach((p, x) => {
3585
- const M = v[x];
3586
- if (!M)
3587
- return;
3588
- p.style.position = "relative", p.style.overflow = "hidden";
3589
- const h = wt(p);
3590
- h && h.classList.add(y);
3591
- const N = bt(p);
3592
- N && N.classList.add(w);
3593
- const E = () => {
3594
- c.current = !1, e.current && (e.current.style.isolation = ""), g && (g.style.zIndex = ""), h && h.classList.remove(y), N && N.classList.remove(w), p.style.position = "", p.style.overflow = "", p.contains(M) && p.removeChild(M);
3595
- };
3596
- M.style.pointerEvents = "none", M.style.position = "absolute", M.style.overflow = "hidden", M.setAttribute("aria-hidden", "true");
3597
- const _ = Ac(M);
3598
- _ && (_.style.opacity = "0");
3599
- const I = wt(M);
3600
- I && (I.classList.add(d ? n[L.caption_before_exit] : n[L.caption_after_exit]), I.addEventListener("animationend", E));
3601
- const B = bt(M);
3602
- B && B.classList.add(d ? n[L.weeks_before_exit] : n[L.weeks_after_exit]), p.insertBefore(M, p.firstChild);
3603
- });
3604
- }
3605
- });
3606
- }
3607
- function Bc(e, t, n, r) {
3608
- const o = e[0], a = e[e.length - 1], { ISOWeek: s, fixedWeeks: i, broadcastCalendar: c } = n ?? {}, { addDays: u, differenceInCalendarDays: l, differenceInCalendarMonths: d, endOfBroadcastWeek: y, endOfISOWeek: w, endOfMonth: C, endOfWeek: b, isAfter: v, startOfBroadcastWeek: O, startOfISOWeek: g, startOfWeek: p } = r, x = c ? O(o, r) : s ? g(o) : p(o), M = c ? y(a) : s ? w(C(a)) : b(C(a)), h = t && (c ? y(t) : s ? w(t) : b(t)), N = h && v(M, h) ? h : M, E = l(N, x), _ = d(a, o) + 1, I = [];
3609
- for (let K = 0; K <= E; K++) {
3610
- const T = u(x, K);
3611
- I.push(T);
3612
- }
3613
- const G = (c ? 35 : 42) * _;
3614
- if (i && I.length < G) {
3615
- const K = G - I.length;
3616
- for (let T = 0; T < K; T++) {
3617
- const z = u(I[I.length - 1], 1);
3618
- I.push(z);
3619
- }
3620
- }
3621
- return I;
3622
- }
3623
- function $c(e) {
3624
- const t = [];
3625
- return e.reduce((n, r) => {
3626
- const o = r.weeks.reduce((a, s) => a.concat(s.days.slice()), t.slice());
3627
- return n.concat(o.slice());
3628
- }, t.slice());
3629
- }
3630
- function Hc(e, t, n, r) {
3631
- const { numberOfMonths: o = 1 } = n, a = [];
3632
- for (let s = 0; s < o; s++) {
3633
- const i = r.addMonths(e, s);
3634
- if (t && i > t)
3635
- break;
3636
- a.push(i);
3637
- }
3638
- return a;
3639
- }
3640
- function cn(e, t, n, r) {
3641
- const { month: o, defaultMonth: a, today: s = r.today(), numberOfMonths: i = 1 } = e;
3642
- let c = o || a || s;
3643
- const { differenceInCalendarMonths: u, addMonths: l, startOfMonth: d } = r;
3644
- if (n && u(n, c) < i - 1) {
3645
- const y = -1 * (i - 1);
3646
- c = l(n, y);
3647
- }
3648
- return t && u(c, t) < 0 && (c = t), d(c);
3649
- }
3650
- function qc(e, t, n, r) {
3651
- const { addDays: o, endOfBroadcastWeek: a, endOfISOWeek: s, endOfMonth: i, endOfWeek: c, getISOWeek: u, getWeek: l, startOfBroadcastWeek: d, startOfISOWeek: y, startOfWeek: w } = r, C = e.reduce((b, v) => {
3652
- const O = n.broadcastCalendar ? d(v, r) : n.ISOWeek ? y(v) : w(v), g = n.broadcastCalendar ? a(v) : n.ISOWeek ? s(i(v)) : c(i(v)), p = t.filter((N) => N >= O && N <= g), x = n.broadcastCalendar ? 35 : 42;
3653
- if (n.fixedWeeks && p.length < x) {
3654
- const N = t.filter((E) => {
3655
- const _ = x - p.length;
3656
- return E > g && E <= o(g, _);
3657
- });
3658
- p.push(...N);
3659
- }
3660
- const M = p.reduce((N, E) => {
3661
- const _ = n.ISOWeek ? u(E) : l(E), I = N.find((G) => G.weekNumber === _), B = new Er(E, v, r);
3662
- return I ? I.days.push(B) : N.push(new $i(_, [B])), N;
3663
- }, []), h = new Bi(v, M);
3664
- return b.push(h), b;
3665
- }, []);
3666
- return n.reverseMonths ? C.reverse() : C;
3667
- }
3668
- function jc(e, t) {
3669
- let { startMonth: n, endMonth: r } = e;
3670
- const { startOfYear: o, startOfDay: a, startOfMonth: s, endOfMonth: i, addYears: c, endOfYear: u, today: l } = t, d = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
3671
- return n ? n = s(n) : !n && d && (n = o(c(e.today ?? l(), -100))), r ? r = i(r) : !r && d && (r = u(e.today ?? l())), [
3672
- n && a(n),
3673
- r && a(r)
3674
- ];
3675
- }
3676
- function Vc(e, t, n, r) {
3677
- if (n.disableNavigation)
3678
- return;
3679
- const { pagedNavigation: o, numberOfMonths: a = 1 } = n, { startOfMonth: s, addMonths: i, differenceInCalendarMonths: c } = r, u = o ? a : 1, l = s(e);
3680
- if (!t)
3681
- return i(l, u);
3682
- if (!(c(t, e) < a))
3683
- return i(l, u);
3684
- }
3685
- function Gc(e, t, n, r) {
3686
- if (n.disableNavigation)
3687
- return;
3688
- const { pagedNavigation: o, numberOfMonths: a } = n, { startOfMonth: s, addMonths: i, differenceInCalendarMonths: c } = r, u = o ? a ?? 1 : 1, l = s(e);
3689
- if (!t)
3690
- return i(l, -u);
3691
- if (!(c(l, t) <= 0))
3692
- return i(l, -u);
3693
- }
3694
- function zc(e) {
3695
- const t = [];
3696
- return e.reduce((n, r) => n.concat(r.weeks.slice()), t.slice());
3697
- }
3698
- function ct(e, t) {
3699
- const [n, r] = kt(e);
3700
- return [t === void 0 ? n : t, r];
3701
- }
3702
- function Kc(e, t) {
3703
- var x;
3704
- const [n, r] = jc(e, t), { startOfMonth: o, endOfMonth: a } = t, s = cn(e, n, r, t), [i, c] = ct(
3705
- s,
3706
- // initialMonth is always computed from props.month if provided
3707
- e.month ? s : void 0
3708
- );
3709
- Fo(() => {
3710
- const M = cn(e, n, r, t);
3711
- c(M);
3712
- }, [e.timeZone]);
3713
- const { months: u, weeks: l, days: d, previousMonth: y, nextMonth: w } = Ue(() => {
3714
- const M = Hc(i, r, { numberOfMonths: e.numberOfMonths }, t), h = Bc(M, e.endMonth ? a(e.endMonth) : void 0, {
3715
- ISOWeek: e.ISOWeek,
3716
- fixedWeeks: e.fixedWeeks,
3717
- broadcastCalendar: e.broadcastCalendar
3718
- }, t), N = qc(M, h, {
3719
- broadcastCalendar: e.broadcastCalendar,
3720
- fixedWeeks: e.fixedWeeks,
3721
- ISOWeek: e.ISOWeek,
3722
- reverseMonths: e.reverseMonths
3723
- }, t), E = zc(N), _ = $c(N), I = Gc(i, n, e, t), B = Vc(i, r, e, t);
3724
- return {
3725
- months: N,
3726
- weeks: E,
3727
- days: _,
3728
- previousMonth: I,
3729
- nextMonth: B
3730
- };
3731
- }, [
3732
- t,
3733
- i.getTime(),
3734
- r == null ? void 0 : r.getTime(),
3735
- n == null ? void 0 : n.getTime(),
3736
- e.disableNavigation,
3737
- e.broadcastCalendar,
3738
- (x = e.endMonth) == null ? void 0 : x.getTime(),
3739
- e.fixedWeeks,
3740
- e.ISOWeek,
3741
- e.numberOfMonths,
3742
- e.pagedNavigation,
3743
- e.reverseMonths
3744
- ]), { disableNavigation: C, onMonthChange: b } = e, v = (M) => l.some((h) => h.days.some((N) => N.isEqualTo(M))), O = (M) => {
3745
- if (C)
3746
- return;
3747
- let h = o(M);
3748
- n && h < o(n) && (h = o(n)), r && h > o(r) && (h = o(r)), c(h), b == null || b(h);
3749
- };
3750
- return {
3751
- months: u,
3752
- weeks: l,
3753
- days: d,
3754
- navStart: n,
3755
- navEnd: r,
3756
- previousMonth: y,
3757
- nextMonth: w,
3758
- goToMonth: O,
3759
- goToDay: (M) => {
3760
- v(M) || O(M.date);
3761
- }
3762
- };
3763
- }
3764
- var ue;
3765
- (function(e) {
3766
- e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
3767
- })(ue || (ue = {}));
3768
- function un(e) {
3769
- return !e[H.disabled] && !e[H.hidden] && !e[H.outside];
3770
- }
3771
- function Xc(e, t, n, r) {
3772
- let o, a = -1;
3773
- for (const s of e) {
3774
- const i = t(s);
3775
- un(i) && (i[H.focused] && a < ue.FocusedModifier ? (o = s, a = ue.FocusedModifier) : r != null && r.isEqualTo(s) && a < ue.LastFocused ? (o = s, a = ue.LastFocused) : n(s.date) && a < ue.Selected ? (o = s, a = ue.Selected) : i[H.today] && a < ue.Today && (o = s, a = ue.Today));
3776
- }
3777
- return o || (o = e.find((s) => un(t(s)))), o;
3778
- }
3779
- function Uc(e, t, n, r, o, a, s) {
3780
- const { ISOWeek: i, broadcastCalendar: c } = a, { addDays: u, addMonths: l, addWeeks: d, addYears: y, endOfBroadcastWeek: w, endOfISOWeek: C, endOfWeek: b, max: v, min: O, startOfBroadcastWeek: g, startOfISOWeek: p, startOfWeek: x } = s;
3781
- let h = {
3782
- day: u,
3783
- week: d,
3784
- month: l,
3785
- year: y,
3786
- startOfWeek: (N) => c ? g(N, s) : i ? p(N) : x(N),
3787
- endOfWeek: (N) => c ? w(N) : i ? C(N) : b(N)
3788
- }[e](n, t === "after" ? 1 : -1);
3789
- return t === "before" && r ? h = v([r, h]) : t === "after" && o && (h = O([o, h])), h;
3790
- }
3791
- function zr(e, t, n, r, o, a, s, i = 0) {
3792
- if (i > 365)
3793
- return;
3794
- const c = Uc(e, t, n.date, r, o, a, s), u = !!(a.disabled && ye(c, a.disabled, s)), l = !!(a.hidden && ye(c, a.hidden, s)), d = c, y = new Er(c, d, s);
3795
- return !u && !l ? y : zr(e, t, y, r, o, a, s, i + 1);
3796
- }
3797
- function Qc(e, t, n, r, o) {
3798
- const { autoFocus: a } = e, [s, i] = kt(), c = Xc(t.days, n, r || (() => !1), s), [u, l] = kt(a ? c : void 0);
3799
- return {
3800
- isFocusTarget: (b) => !!(c != null && c.isEqualTo(b)),
3801
- setFocused: l,
3802
- focused: u,
3803
- blur: () => {
3804
- i(u), l(void 0);
3805
- },
3806
- moveFocus: (b, v) => {
3807
- if (!u)
3808
- return;
3809
- const O = zr(b, v, u, t.navStart, t.navEnd, e, o);
3810
- O && (e.disableNavigation && !t.days.some((p) => p.isEqualTo(O)) || (t.goToDay(O), l(O)));
3811
- }
3812
- };
3813
- }
3814
- function Zc(e, t) {
3815
- const { selected: n, required: r, onSelect: o } = e, [a, s] = ct(n, o ? n : void 0), i = o ? n : a, { isSameDay: c } = t, u = (w) => (i == null ? void 0 : i.some((C) => c(C, w))) ?? !1, { min: l, max: d } = e;
3816
- return {
3817
- selected: i,
3818
- select: (w, C, b) => {
3819
- let v = [...i ?? []];
3820
- if (u(w)) {
3821
- if ((i == null ? void 0 : i.length) === l || r && (i == null ? void 0 : i.length) === 1)
3822
- return;
3823
- v = i == null ? void 0 : i.filter((O) => !c(O, w));
3824
- } else
3825
- (i == null ? void 0 : i.length) === d ? v = [w] : v = [...v, w];
3826
- return o || s(v), o == null || o(v, w, C, b), v;
3827
- },
3828
- isSelected: u
3829
- };
3830
- }
3831
- function Jc(e, t, n = 0, r = 0, o = !1, a = de) {
3832
- const { from: s, to: i } = t || {}, { isSameDay: c, isAfter: u, isBefore: l } = a;
3833
- let d;
3834
- if (!s && !i)
3835
- d = { from: e, to: n > 0 ? void 0 : e };
3836
- else if (s && !i)
3837
- c(s, e) ? n === 0 ? d = { from: s, to: e } : o ? d = { from: s, to: void 0 } : d = void 0 : l(e, s) ? d = { from: e, to: s } : d = { from: s, to: e };
3838
- else if (s && i)
3839
- if (c(s, e) && c(i, e))
3840
- o ? d = { from: s, to: i } : d = void 0;
3841
- else if (c(s, e))
3842
- d = { from: s, to: n > 0 ? void 0 : e };
3843
- else if (c(i, e))
3844
- d = { from: e, to: n > 0 ? void 0 : e };
3845
- else if (l(e, s))
3846
- d = { from: e, to: i };
3847
- else if (u(e, s))
3848
- d = { from: s, to: e };
3849
- else if (u(e, i))
3850
- d = { from: s, to: e };
3851
- else
3852
- throw new Error("Invalid range");
3853
- if (d != null && d.from && (d != null && d.to)) {
3854
- const y = a.differenceInCalendarDays(d.to, d.from);
3855
- r > 0 && y > r ? d = { from: e, to: void 0 } : n > 1 && y < n && (d = { from: e, to: void 0 });
3856
- }
3857
- return d;
3858
- }
3859
- function Lc(e, t, n = de) {
3860
- const r = Array.isArray(t) ? t : [t];
3861
- let o = e.from;
3862
- const a = n.differenceInCalendarDays(e.to, e.from), s = Math.min(a, 6);
3863
- for (let i = 0; i <= s; i++) {
3864
- if (r.includes(o.getDay()))
3865
- return !0;
3866
- o = n.addDays(o, 1);
3867
- }
3868
- return !1;
3869
- }
3870
- function ln(e, t, n = de) {
3871
- return ge(e, t.from, !1, n) || ge(e, t.to, !1, n) || ge(t, e.from, !1, n) || ge(t, e.to, !1, n);
3872
- }
3873
- function eu(e, t, n = de) {
3874
- const r = Array.isArray(t) ? t : [t];
3875
- if (r.filter((i) => typeof i != "function").some((i) => typeof i == "boolean" ? i : n.isDate(i) ? ge(e, i, !1, n) : Rr(i, n) ? i.some((c) => ge(e, c, !1, n)) : it(i) ? i.from && i.to ? ln(e, { from: i.from, to: i.to }, n) : !1 : _r(i) ? Lc(e, i.dayOfWeek, n) : Bt(i) ? n.isAfter(i.before, i.after) ? ln(e, {
3876
- from: n.addDays(i.after, 1),
3877
- to: n.addDays(i.before, -1)
3878
- }, n) : ye(e.from, i, n) || ye(e.to, i, n) : $t(i) || Ht(i) ? ye(e.from, i, n) || ye(e.to, i, n) : !1))
3879
- return !0;
3880
- const s = r.filter((i) => typeof i == "function");
3881
- if (s.length) {
3882
- let i = e.from;
3883
- const c = n.differenceInCalendarDays(e.to, e.from);
3884
- for (let u = 0; u <= c; u++) {
3885
- if (s.some((l) => l(i)))
3886
- return !0;
3887
- i = n.addDays(i, 1);
3888
- }
3889
- }
3890
- return !1;
3891
- }
3892
- function tu(e, t) {
3893
- const { disabled: n, excludeDisabled: r, resetOnSelect: o, selected: a, required: s, onSelect: i } = e, [c, u] = ct(a, i ? a : void 0), l = i ? a : c;
3894
- return {
3895
- selected: l,
3896
- select: (w, C, b) => {
3897
- const { min: v, max: O } = e;
3898
- let g;
3899
- if (w) {
3900
- const p = l == null ? void 0 : l.from, x = l == null ? void 0 : l.to, M = !!p && !!x, h = !!p && !!x && t.isSameDay(p, x) && t.isSameDay(w, p);
3901
- o && (M || !(l != null && l.from)) ? !s && h ? g = void 0 : g = { from: w, to: void 0 } : g = Jc(w, l, v, O, s, t);
3902
- }
3903
- return r && n && (g != null && g.from) && g.to && eu({ from: g.from, to: g.to }, n, t) && (g.from = w, g.to = void 0), i || u(g), i == null || i(g, w, C, b), g;
3904
- },
3905
- isSelected: (w) => l && ge(l, w, !1, t)
3906
- };
3907
- }
3908
- function nu(e, t) {
3909
- const { selected: n, required: r, onSelect: o } = e, [a, s] = ct(n, o ? n : void 0), i = o ? n : a, { isSameDay: c } = t;
3910
- return {
3911
- selected: i,
3912
- select: (d, y, w) => {
3913
- let C = d;
3914
- return !r && i && i && c(d, i) && (C = void 0), o || s(C), o == null || o(C, d, y, w), C;
3915
- },
3916
- isSelected: (d) => i ? c(i, d) : !1
3917
- };
3918
- }
3919
- function ru(e, t) {
3920
- const n = nu(e, t), r = Zc(e, t), o = tu(e, t);
3921
- switch (e.mode) {
3922
- case "single":
3923
- return n;
3924
- case "multiple":
3925
- return r;
3926
- case "range":
3927
- return o;
3928
- default:
3929
- return;
3930
- }
3931
- }
3932
- function ne(e, t) {
3933
- return e instanceof U && e.timeZone === t ? e : new U(e, t);
3934
- }
3935
- function Te(e, t, n) {
3936
- return ne(e, t);
3937
- }
3938
- function dn(e, t, n) {
3939
- return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? Te(e, t) : Array.isArray(e) ? e.map((r) => r instanceof Date ? Te(r, t) : r) : it(e) ? {
3940
- ...e,
3941
- from: e.from ? ne(e.from, t) : e.from,
3942
- to: e.to ? ne(e.to, t) : e.to
3943
- } : Bt(e) ? {
3944
- before: Te(e.before, t),
3945
- after: Te(e.after, t)
3946
- } : $t(e) ? {
3947
- after: Te(e.after, t)
3948
- } : Ht(e) ? {
3949
- before: Te(e.before, t)
3950
- } : e;
3951
- }
3952
- function Dt(e, t, n) {
3953
- return e && (Array.isArray(e) ? e.map((r) => dn(r, t)) : dn(e, t));
3954
- }
3955
- function ou(e) {
3956
- var Ut;
3957
- let t = e;
3958
- const n = t.timeZone;
3959
- if (n && (t = {
3960
- ...e,
3961
- timeZone: n
3962
- }, t.today && (t.today = ne(t.today, n)), t.month && (t.month = ne(t.month, n)), t.defaultMonth && (t.defaultMonth = ne(t.defaultMonth, n)), t.startMonth && (t.startMonth = ne(t.startMonth, n)), t.endMonth && (t.endMonth = ne(t.endMonth, n)), t.mode === "single" && t.selected ? t.selected = ne(t.selected, n) : t.mode === "multiple" && t.selected ? t.selected = (Ut = t.selected) == null ? void 0 : Ut.map((S) => ne(S, n)) : t.mode === "range" && t.selected && (t.selected = {
3963
- from: t.selected.from ? ne(t.selected.from, n) : t.selected.from,
3964
- to: t.selected.to ? ne(t.selected.to, n) : t.selected.to
3965
- }), t.disabled !== void 0 && (t.disabled = Dt(t.disabled, n)), t.hidden !== void 0 && (t.hidden = Dt(t.hidden, n)), t.modifiers)) {
3966
- const S = {};
3967
- Object.keys(t.modifiers).forEach((W) => {
3968
- var P;
3969
- S[W] = Dt((P = t.modifiers) == null ? void 0 : P[W], n);
3970
- }), t.modifiers = S;
3971
- }
3972
- const { components: r, formatters: o, labels: a, dateLib: s, locale: i, classNames: c } = Ue(() => {
3973
- const S = { ...Pr, ...t.locale }, W = t.broadcastCalendar ? 1 : t.weekStartsOn, P = t.noonSafe && t.timeZone ? Rc(t.timeZone, {
3974
- weekStartsOn: W,
3975
- locale: S
3976
- }) : void 0, q = t.dateLib && P ? { ...P, ...t.dateLib } : t.dateLib ?? P, F = new ee({
3977
- locale: S,
3978
- weekStartsOn: W,
3979
- firstWeekContainsDate: t.firstWeekContainsDate,
3980
- useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
3981
- useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
3982
- timeZone: t.timeZone,
3983
- numerals: t.numerals
3984
- }, q);
3985
- return {
3986
- dateLib: F,
3987
- components: gc(t.components),
3988
- formatters: xc(t.formatters),
3989
- labels: Sc(t.labels, F.options),
3990
- locale: S,
3991
- classNames: { ...pc(), ...t.classNames }
3992
- };
3993
- }, [
3994
- t.locale,
3995
- t.broadcastCalendar,
3996
- t.weekStartsOn,
3997
- t.firstWeekContainsDate,
3998
- t.useAdditionalWeekYearTokens,
3999
- t.useAdditionalDayOfYearTokens,
4000
- t.timeZone,
4001
- t.numerals,
4002
- t.dateLib,
4003
- t.noonSafe,
4004
- t.components,
4005
- t.formatters,
4006
- t.labels,
4007
- t.classNames
4008
- ]);
4009
- t.today || (t = { ...t, today: s.today() });
4010
- const { captionLayout: u, mode: l, navLayout: d, numberOfMonths: y = 1, onDayBlur: w, onDayClick: C, onDayFocus: b, onDayKeyDown: v, onDayMouseEnter: O, onDayMouseLeave: g, onNextClick: p, onPrevClick: x, showWeekNumber: M, styles: h } = t, { formatCaption: N, formatDay: E, formatMonthDropdown: _, formatWeekNumber: I, formatWeekNumberHeader: B, formatWeekdayName: G, formatYearDropdown: K } = o, T = Kc(t, s), { days: z, months: Z, navStart: fe, navEnd: he, previousMonth: X, nextMonth: J, goToMonth: re } = T, Me = hc(z, t, fe, he, s), { isSelected: ie, select: we, selected: Ve } = ru(t, s) ?? {}, { blur: jt, focused: Ge, isFocusTarget: oo, moveFocus: Vt, setFocused: ze } = Qc(t, T, Me, ie ?? (() => !1), s), { labelDayButton: ao, labelGridcell: so, labelGrid: io, labelMonthDropdown: co, labelNav: Gt, labelPrevious: uo, labelNext: lo, labelWeekday: fo, labelWeekNumber: ho, labelWeekNumberHeader: mo, labelYearDropdown: go } = a, yo = Ue(() => Wc(s, t.ISOWeek, t.broadcastCalendar, t.today), [s, t.ISOWeek, t.broadcastCalendar, t.today]), zt = l !== void 0 || C !== void 0, lt = te(() => {
4011
- X && (re(X), x == null || x(X));
4012
- }, [X, re, x]), dt = te(() => {
4013
- J && (re(J), p == null || p(J));
4014
- }, [re, J, p]), po = te((S, W) => (P) => {
4015
- P.preventDefault(), P.stopPropagation(), ze(S), !W.disabled && (we == null || we(S.date, W, P), C == null || C(S.date, W, P));
4016
- }, [we, C, ze]), vo = te((S, W) => (P) => {
4017
- ze(S), b == null || b(S.date, W, P);
4018
- }, [b, ze]), wo = te((S, W) => (P) => {
4019
- jt(), w == null || w(S.date, W, P);
4020
- }, [jt, w]), bo = te((S, W) => (P) => {
4021
- const q = {
4022
- ArrowLeft: [
4023
- P.shiftKey ? "month" : "day",
4024
- t.dir === "rtl" ? "after" : "before"
4025
- ],
4026
- ArrowRight: [
4027
- P.shiftKey ? "month" : "day",
4028
- t.dir === "rtl" ? "before" : "after"
4029
- ],
4030
- ArrowDown: [P.shiftKey ? "year" : "week", "after"],
4031
- ArrowUp: [P.shiftKey ? "year" : "week", "before"],
4032
- PageUp: [P.shiftKey ? "year" : "month", "before"],
4033
- PageDown: [P.shiftKey ? "year" : "month", "after"],
4034
- Home: ["startOfWeek", "before"],
4035
- End: ["endOfWeek", "after"]
4036
- };
4037
- if (q[P.key]) {
4038
- P.preventDefault(), P.stopPropagation();
4039
- const [F, ce] = q[P.key];
4040
- Vt(F, ce);
4041
- }
4042
- v == null || v(S.date, W, P);
4043
- }, [Vt, v, t.dir]), Do = te((S, W) => (P) => {
4044
- O == null || O(S.date, W, P);
4045
- }, [O]), ko = te((S, W) => (P) => {
4046
- g == null || g(S.date, W, P);
4047
- }, [g]), Mo = te((S, W) => (P) => {
4048
- const q = Number(P.target.value), F = s.setMonth(s.startOfMonth(S), q);
4049
- re(s.addMonths(F, -W));
4050
- }, [s, re]), Oo = te((S, W) => (P) => {
4051
- const q = Number(P.target.value), F = s.setYear(s.startOfMonth(S), q);
4052
- re(s.addMonths(F, -W));
4053
- }, [s, re]), { className: Co, style: xo } = Ue(() => ({
4054
- className: [c[D.Root], t.className].filter(Boolean).join(" "),
4055
- style: { ...h == null ? void 0 : h[D.Root], ...t.style }
4056
- }), [c, t.className, t.style, h]), No = yc(t), Kt = (S) => {
4057
- const W = h == null ? void 0 : h[D.Dropdown], P = h == null ? void 0 : h[S];
4058
- if (!(!W && !P))
4059
- return {
4060
- ...W,
4061
- ...P
4062
- };
4063
- }, Xt = Xe(null);
4064
- Yc(Xt, !!t.animate, {
4065
- classNames: c,
4066
- months: Z,
4067
- focused: Ge,
4068
- dateLib: s
4069
- });
4070
- const To = {
4071
- dayPickerProps: t,
4072
- selected: Ve,
4073
- select: we,
4074
- isSelected: ie,
4075
- months: Z,
4076
- nextMonth: J,
4077
- previousMonth: X,
4078
- goToMonth: re,
4079
- getModifiers: Me,
4080
- components: r,
4081
- classNames: c,
4082
- styles: h,
4083
- labels: a,
4084
- formatters: o
4085
- };
4086
- return k.createElement(
4087
- Wr.Provider,
4088
- { value: To },
4089
- k.createElement(
4090
- r.Root,
4091
- { rootRef: t.animate ? Xt : void 0, className: Co, style: xo, dir: t.dir, id: t.id, lang: t.lang ?? i.code, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...No },
4092
- k.createElement(
4093
- r.Months,
4094
- { className: c[D.Months], style: h == null ? void 0 : h[D.Months] },
4095
- !t.hideNavigation && !d && k.createElement(r.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[D.Nav], style: h == null ? void 0 : h[D.Nav], "aria-label": Gt(), onPreviousClick: lt, onNextClick: dt, previousMonth: X, nextMonth: J }),
4096
- Z.map((S, W) => {
4097
- const P = t.reverseMonths ? Z.length - 1 - W : W;
4098
- return k.createElement(
4099
- r.Month,
4100
- {
4101
- "data-animated-month": t.animate ? "true" : void 0,
4102
- className: c[D.Month],
4103
- style: h == null ? void 0 : h[D.Month],
4104
- // biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
4105
- key: W,
4106
- displayIndex: W,
4107
- calendarMonth: S
4108
- },
4109
- d === "around" && !t.hideNavigation && W === 0 && k.createElement(
4110
- r.PreviousMonthButton,
4111
- { type: "button", className: c[D.PreviousMonthButton], style: h == null ? void 0 : h[D.PreviousMonthButton], tabIndex: X ? void 0 : -1, "aria-disabled": X ? void 0 : !0, "aria-label": uo(X), onClick: lt, "data-animated-button": t.animate ? "true" : void 0 },
4112
- k.createElement(r.Chevron, { disabled: X ? void 0 : !0, className: c[D.Chevron], style: h == null ? void 0 : h[D.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
4113
- ),
4114
- k.createElement(r.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: c[D.MonthCaption], style: h == null ? void 0 : h[D.MonthCaption], calendarMonth: S, displayIndex: W }, u != null && u.startsWith("dropdown") ? k.createElement(
4115
- r.DropdownNav,
4116
- { className: c[D.Dropdowns], style: h == null ? void 0 : h[D.Dropdowns] },
4117
- (() => {
4118
- const q = u === "dropdown" || u === "dropdown-months" ? k.createElement(r.MonthsDropdown, { key: "month", className: c[D.MonthsDropdown], "aria-label": co(), disabled: !!t.disableNavigation, onChange: Mo(S.date, P), options: Pc(S.date, fe, he, o, s), style: Kt(D.MonthsDropdown), value: s.getMonth(S.date) }) : k.createElement("span", { key: "month" }, _(S.date, s)), F = u === "dropdown" || u === "dropdown-years" ? k.createElement(r.YearsDropdown, { key: "year", className: c[D.YearsDropdown], "aria-label": go(s.options), disabled: !!t.disableNavigation, onChange: Oo(S.date, P), options: _c(fe, he, o, s, !!t.reverseYears), style: Kt(D.YearsDropdown), value: s.getYear(S.date) }) : k.createElement("span", { key: "year" }, K(S.date, s));
4119
- return s.getMonthYearOrder() === "year-first" ? [F, q] : [q, F];
4120
- })(),
4121
- k.createElement("span", { role: "status", "aria-live": "polite", style: {
4122
- border: 0,
4123
- clip: "rect(0 0 0 0)",
4124
- height: "1px",
4125
- margin: "-1px",
4126
- overflow: "hidden",
4127
- padding: 0,
4128
- position: "absolute",
4129
- width: "1px",
4130
- whiteSpace: "nowrap",
4131
- wordWrap: "normal"
4132
- } }, N(S.date, s.options, s))
4133
- ) : k.createElement(r.CaptionLabel, { className: c[D.CaptionLabel], style: h == null ? void 0 : h[D.CaptionLabel], role: "status", "aria-live": "polite" }, N(S.date, s.options, s))),
4134
- d === "around" && !t.hideNavigation && W === y - 1 && k.createElement(
4135
- r.NextMonthButton,
4136
- { type: "button", className: c[D.NextMonthButton], style: h == null ? void 0 : h[D.NextMonthButton], tabIndex: J ? void 0 : -1, "aria-disabled": J ? void 0 : !0, "aria-label": lo(J), onClick: dt, "data-animated-button": t.animate ? "true" : void 0 },
4137
- k.createElement(r.Chevron, { disabled: J ? void 0 : !0, className: c[D.Chevron], style: h == null ? void 0 : h[D.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
4138
- ),
4139
- W === y - 1 && d === "after" && !t.hideNavigation && k.createElement(r.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[D.Nav], style: h == null ? void 0 : h[D.Nav], "aria-label": Gt(), onPreviousClick: lt, onNextClick: dt, previousMonth: X, nextMonth: J }),
4140
- k.createElement(
4141
- r.MonthGrid,
4142
- { role: "grid", "aria-multiselectable": l === "multiple" || l === "range", "aria-label": io(S.date, s.options, s) || void 0, className: c[D.MonthGrid], style: h == null ? void 0 : h[D.MonthGrid] },
4143
- !t.hideWeekdays && k.createElement(
4144
- r.Weekdays,
4145
- { "data-animated-weekdays": t.animate ? "true" : void 0, className: c[D.Weekdays], style: h == null ? void 0 : h[D.Weekdays] },
4146
- M && k.createElement(r.WeekNumberHeader, { "aria-label": mo(s.options), className: c[D.WeekNumberHeader], style: h == null ? void 0 : h[D.WeekNumberHeader], scope: "col" }, B()),
4147
- yo.map((q) => k.createElement(r.Weekday, { "aria-label": fo(q, s.options, s), className: c[D.Weekday], key: String(q), style: h == null ? void 0 : h[D.Weekday], scope: "col" }, G(q, s.options, s)))
4148
- ),
4149
- k.createElement(r.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: c[D.Weeks], style: h == null ? void 0 : h[D.Weeks] }, S.weeks.map((q) => k.createElement(
4150
- r.Week,
4151
- { className: c[D.Week], key: q.weekNumber, style: h == null ? void 0 : h[D.Week], week: q },
4152
- M && k.createElement(r.WeekNumber, { week: q, style: h == null ? void 0 : h[D.WeekNumber], "aria-label": ho(q.weekNumber, {
4153
- locale: i
4154
- }), className: c[D.WeekNumber], scope: "row", role: "rowheader" }, I(q.weekNumber, s)),
4155
- q.days.map((F) => {
4156
- const { date: ce } = F, R = Me(F);
4157
- if (R[H.focused] = !R.hidden && !!(Ge != null && Ge.isEqualTo(F)), R[ae.selected] = (ie == null ? void 0 : ie(ce)) || R.selected, it(Ve)) {
4158
- const { from: ft, to: ht } = Ve;
4159
- R[ae.range_start] = !!(ft && ht && s.isSameDay(ce, ft)), R[ae.range_end] = !!(ft && ht && s.isSameDay(ce, ht)), R[ae.range_middle] = ge(Ve, ce, !0, s);
4160
- }
4161
- const So = Ec(R, h, t.modifiersStyles), Po = mc(R, c, t.modifiersClassNames), Eo = !zt && !R.hidden ? so(ce, R, s.options, s) : void 0;
4162
- return k.createElement(r.Day, { key: `${F.isoDate}_${F.displayMonthId}`, day: F, modifiers: R, className: Po.join(" "), style: So, role: "gridcell", "aria-selected": R.selected || void 0, "aria-label": Eo, "data-day": F.isoDate, "data-month": F.outside ? F.dateMonthId : void 0, "data-selected": R.selected || void 0, "data-disabled": R.disabled || void 0, "data-hidden": R.hidden || void 0, "data-outside": F.outside || void 0, "data-focused": R.focused || void 0, "data-today": R.today || void 0 }, !R.hidden && zt ? k.createElement(r.DayButton, { className: c[D.DayButton], style: h == null ? void 0 : h[D.DayButton], type: "button", day: F, modifiers: R, disabled: !R.focused && R.disabled || void 0, "aria-disabled": R.focused && R.disabled || void 0, tabIndex: oo(F) ? 0 : -1, "aria-label": ao(ce, R, s.options, s), onClick: po(F, R), onBlur: wo(F, R), onFocus: vo(F, R), onKeyDown: bo(F, R), onMouseEnter: Do(F, R), onMouseLeave: ko(F, R) }, E(ce, s.options, s)) : !R.hidden && E(F.date, s.options, s));
4163
- })
4164
- )))
4165
- )
4166
- );
4167
- })
4168
- ),
4169
- t.footer && k.createElement(r.Footer, { className: c[D.Footer], style: h == null ? void 0 : h[D.Footer], role: "status", "aria-live": "polite" }, t.footer)
4170
- )
4171
- );
4172
- }
4173
- function au({ className: e, classNames: t, showOutsideDays: n = !0, ...r }) {
4174
- return /* @__PURE__ */ m(
4175
- ou,
4176
- {
4177
- showOutsideDays: n,
4178
- className: $("p-3 pointer-events-auto", e),
4179
- classNames: {
4180
- months: "flex flex-col gap-2 relative sm:flex-row",
4181
- month: "flex flex-col gap-4",
4182
- month_caption: "flex justify-center pt-1 relative items-center w-full",
4183
- caption_label: "text-sm font-medium",
4184
- nav: "flex items-center gap-1 absolute h-7 w-full z-10",
4185
- button_previous: $(mt({ variant: "outline" }), "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100", "absolute left-1"),
4186
- button_next: $(mt({ variant: "outline" }), "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100", "absolute right-1"),
4187
- weekdays: "flex justify-center",
4188
- weekday: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem] text-center flex items-center justify-center",
4189
- week: "flex w-full mt-2",
4190
- day: $(
4191
- "group relative size-9 p-0 text-center text-sm focus-within:relative focus-within:z-20",
4192
- "[&:has([aria-selected].day-range-end)]:rounded-r-md",
4193
- "[&:has([aria-selected])]:bg-accent",
4194
- "first:[&:has([aria-selected])]:rounded-l-md",
4195
- "last:[&:has([aria-selected])]:rounded-r-md",
4196
- "[&:has([aria-selected].day-outside)]:bg-accent/50"
4197
- ),
4198
- day_button: $(mt({ variant: "ghost" }), "size-9 p-0 font-normal aria-selected:opacity-100"),
4199
- range_start: "day-range-start rounded-l-md",
4200
- range_end: "day-range-end rounded-r-md",
4201
- selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
4202
- today: "bg-accent text-accent-foreground",
4203
- outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
4204
- disabled: "text-muted-foreground opacity-50",
4205
- range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
4206
- hidden: "invisible",
4207
- ...t
4208
- },
4209
- components: {
4210
- Chevron: ({ orientation: o, ...a }) => /* @__PURE__ */ m(o === "left" ? aa : ia, { className: "size-4", ...a })
4211
- },
4212
- ...r
4213
- }
4214
- );
4215
- }
4216
- au.displayName = "Calendar";
4217
- // @__NO_SIDE_EFFECTS__
4218
- function su(e) {
4219
- const t = /* @__PURE__ */ iu(e), n = f.forwardRef((r, o) => {
4220
- const { children: a, ...s } = r, i = f.Children.toArray(a), c = i.find(uu);
4221
- if (c) {
4222
- const u = c.props.children, l = i.map((d) => d === c ? f.Children.count(u) > 1 ? f.Children.only(null) : f.isValidElement(u) ? u.props.children : null : d);
4223
- return /* @__PURE__ */ m(t, { ...s, ref: o, children: f.isValidElement(u) ? f.cloneElement(u, void 0, l) : null });
4224
- }
4225
- return /* @__PURE__ */ m(t, { ...s, ref: o, children: a });
4226
- });
4227
- return n.displayName = `${e}.Slot`, n;
4228
- }
4229
- // @__NO_SIDE_EFFECTS__
4230
- function iu(e) {
4231
- const t = f.forwardRef((n, r) => {
4232
- const { children: o, ...a } = n;
4233
- if (f.isValidElement(o)) {
4234
- const s = du(o), i = lu(a, o.props);
4235
- return o.type !== f.Fragment && (i.ref = r ? hn(r, s) : s), f.cloneElement(o, i);
4236
- }
4237
- return f.Children.count(o) > 1 ? f.Children.only(null) : null;
4238
- });
4239
- return t.displayName = `${e}.SlotClone`, t;
4240
- }
4241
- var cu = Symbol("radix.slottable");
4242
- function uu(e) {
4243
- return f.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === cu;
4244
- }
4245
- function lu(e, t) {
4246
- const n = { ...t };
4247
- for (const r in t) {
4248
- const o = e[r], a = t[r];
4249
- /^on[A-Z]/.test(r) ? o && a ? n[r] = (...i) => {
4250
- const c = a(...i);
4251
- return o(...i), c;
4252
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...a } : r === "className" && (n[r] = [o, a].filter(Boolean).join(" "));
4253
- }
4254
- return { ...e, ...n };
4255
- }
4256
- function du(e) {
4257
- var r, o;
4258
- let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
4259
- return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
4260
- }
4261
- var ut = "Popover", [Kr] = nt(ut, [
4262
- gn
4263
- ]), je = gn(), [fu, ke] = Kr(ut), Xr = (e) => {
4264
- const {
4265
- __scopePopover: t,
4266
- children: n,
4267
- open: r,
4268
- defaultOpen: o,
4269
- onOpenChange: a,
4270
- modal: s = !1
4271
- } = e, i = je(t), c = f.useRef(null), [u, l] = f.useState(!1), [d, y] = tt({
4272
- prop: r,
4273
- defaultProp: o ?? !1,
4274
- onChange: a,
4275
- caller: ut
4276
- });
4277
- return /* @__PURE__ */ m(Vo, { ...i, children: /* @__PURE__ */ m(
4278
- fu,
4279
- {
4280
- scope: t,
4281
- contentId: Qe(),
4282
- triggerRef: c,
4283
- open: d,
4284
- onOpenChange: y,
4285
- onOpenToggle: f.useCallback(() => y((w) => !w), [y]),
4286
- hasCustomAnchor: u,
4287
- onCustomAnchorAdd: f.useCallback(() => l(!0), []),
4288
- onCustomAnchorRemove: f.useCallback(() => l(!1), []),
4289
- modal: s,
4290
- children: n
4291
- }
4292
- ) });
4293
- };
4294
- Xr.displayName = ut;
4295
- var Ur = "PopoverAnchor", hu = f.forwardRef(
4296
- (e, t) => {
4297
- const { __scopePopover: n, ...r } = e, o = ke(Ur, n), a = je(n), { onCustomAnchorAdd: s, onCustomAnchorRemove: i } = o;
4298
- return f.useEffect(() => (s(), () => i()), [s, i]), /* @__PURE__ */ m(yn, { ...a, ...r, ref: t });
4299
- }
4300
- );
4301
- hu.displayName = Ur;
4302
- var Qr = "PopoverTrigger", Zr = f.forwardRef(
4303
- (e, t) => {
4304
- const { __scopePopover: n, ...r } = e, o = ke(Qr, n), a = je(n), s = ve(t, o.triggerRef), i = /* @__PURE__ */ m(
4305
- Q.button,
4306
- {
4307
- type: "button",
4308
- "aria-haspopup": "dialog",
4309
- "aria-expanded": o.open,
4310
- "aria-controls": o.contentId,
4311
- "data-state": no(o.open),
4312
- ...r,
4313
- ref: s,
4314
- onClick: j(e.onClick, o.onOpenToggle)
4315
- }
4316
- );
4317
- return o.hasCustomAnchor ? i : /* @__PURE__ */ m(yn, { asChild: !0, ...a, children: i });
4318
- }
4319
- );
4320
- Zr.displayName = Qr;
4321
- var qt = "PopoverPortal", [mu, gu] = Kr(qt, {
4322
- forceMount: void 0
4323
- }), Jr = (e) => {
4324
- const { __scopePopover: t, forceMount: n, children: r, container: o } = e, a = ke(qt, t);
4325
- return /* @__PURE__ */ m(mu, { scope: t, forceMount: n, children: /* @__PURE__ */ m(xe, { present: n || a.open, children: /* @__PURE__ */ m(xt, { asChild: !0, container: o, children: r }) }) });
4326
- };
4327
- Jr.displayName = qt;
4328
- var Ee = "PopoverContent", Lr = f.forwardRef(
4329
- (e, t) => {
4330
- const n = gu(Ee, e.__scopePopover), { forceMount: r = n.forceMount, ...o } = e, a = ke(Ee, e.__scopePopover);
4331
- return /* @__PURE__ */ m(xe, { present: r || a.open, children: a.modal ? /* @__PURE__ */ m(pu, { ...o, ref: t }) : /* @__PURE__ */ m(vu, { ...o, ref: t }) });
4332
- }
4333
- );
4334
- Lr.displayName = Ee;
4335
- var yu = /* @__PURE__ */ su("PopoverContent.RemoveScroll"), pu = f.forwardRef(
4336
- (e, t) => {
4337
- const n = ke(Ee, e.__scopePopover), r = f.useRef(null), o = ve(t, r), a = f.useRef(!1);
4338
- return f.useEffect(() => {
4339
- const s = r.current;
4340
- if (s) return vn(s);
4341
- }, []), /* @__PURE__ */ m(pn, { as: yu, allowPinchZoom: !0, children: /* @__PURE__ */ m(
4342
- eo,
4343
- {
4344
- ...e,
4345
- ref: o,
4346
- trapFocus: n.open,
4347
- disableOutsidePointerEvents: !0,
4348
- onCloseAutoFocus: j(e.onCloseAutoFocus, (s) => {
4349
- var i;
4350
- s.preventDefault(), a.current || (i = n.triggerRef.current) == null || i.focus();
4351
- }),
4352
- onPointerDownOutside: j(
4353
- e.onPointerDownOutside,
4354
- (s) => {
4355
- const i = s.detail.originalEvent, c = i.button === 0 && i.ctrlKey === !0, u = i.button === 2 || c;
4356
- a.current = u;
4357
- },
4358
- { checkForDefaultPrevented: !1 }
4359
- ),
4360
- onFocusOutside: j(
4361
- e.onFocusOutside,
4362
- (s) => s.preventDefault(),
4363
- { checkForDefaultPrevented: !1 }
4364
- )
4365
- }
4366
- ) });
4367
- }
4368
- ), vu = f.forwardRef(
4369
- (e, t) => {
4370
- const n = ke(Ee, e.__scopePopover), r = f.useRef(!1), o = f.useRef(!1);
4371
- return /* @__PURE__ */ m(
4372
- eo,
4373
- {
4374
- ...e,
4375
- ref: t,
4376
- trapFocus: !1,
4377
- disableOutsidePointerEvents: !1,
4378
- onCloseAutoFocus: (a) => {
4379
- var s, i;
4380
- (s = e.onCloseAutoFocus) == null || s.call(e, a), a.defaultPrevented || (r.current || (i = n.triggerRef.current) == null || i.focus(), a.preventDefault()), r.current = !1, o.current = !1;
4381
- },
4382
- onInteractOutside: (a) => {
4383
- var c, u;
4384
- (c = e.onInteractOutside) == null || c.call(e, a), a.defaultPrevented || (r.current = !0, a.detail.originalEvent.type === "pointerdown" && (o.current = !0));
4385
- const s = a.target;
4386
- ((u = n.triggerRef.current) == null ? void 0 : u.contains(s)) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && o.current && a.preventDefault();
4387
- }
4388
- }
4389
- );
4390
- }
4391
- ), eo = f.forwardRef(
4392
- (e, t) => {
4393
- const {
4394
- __scopePopover: n,
4395
- trapFocus: r,
4396
- onOpenAutoFocus: o,
4397
- onCloseAutoFocus: a,
4398
- disableOutsidePointerEvents: s,
4399
- onEscapeKeyDown: i,
4400
- onPointerDownOutside: c,
4401
- onFocusOutside: u,
4402
- onInteractOutside: l,
4403
- ...d
4404
- } = e, y = ke(Ee, n), w = je(n);
4405
- return wn(), /* @__PURE__ */ m(
4406
- bn,
4407
- {
4408
- asChild: !0,
4409
- loop: !0,
4410
- trapped: r,
4411
- onMountAutoFocus: o,
4412
- onUnmountAutoFocus: a,
4413
- children: /* @__PURE__ */ m(
4414
- mn,
4415
- {
4416
- asChild: !0,
4417
- disableOutsidePointerEvents: s,
4418
- onInteractOutside: l,
4419
- onEscapeKeyDown: i,
4420
- onPointerDownOutside: c,
4421
- onFocusOutside: u,
4422
- onDismiss: () => y.onOpenChange(!1),
4423
- children: /* @__PURE__ */ m(
4424
- jo,
4425
- {
4426
- "data-state": no(y.open),
4427
- role: "dialog",
4428
- id: y.contentId,
4429
- ...w,
4430
- ...d,
4431
- ref: t,
4432
- style: {
4433
- ...d.style,
4434
- "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
4435
- "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
4436
- "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
4437
- "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
4438
- "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
4439
- }
4440
- }
4441
- )
4442
- }
4443
- )
4444
- }
4445
- );
4446
- }
4447
- ), to = "PopoverClose", wu = f.forwardRef(
4448
- (e, t) => {
4449
- const { __scopePopover: n, ...r } = e, o = ke(to, n);
4450
- return /* @__PURE__ */ m(
4451
- Q.button,
4452
- {
4453
- type: "button",
4454
- ...r,
4455
- ref: t,
4456
- onClick: j(e.onClick, () => o.onOpenChange(!1))
4457
- }
4458
- );
4459
- }
4460
- );
4461
- wu.displayName = to;
4462
- var bu = "PopoverArrow", Du = f.forwardRef(
4463
- (e, t) => {
4464
- const { __scopePopover: n, ...r } = e, o = je(n);
4465
- return /* @__PURE__ */ m(Go, { ...o, ...r, ref: t });
4466
- }
4467
- );
4468
- Du.displayName = bu;
4469
- function no(e) {
4470
- return e ? "open" : "closed";
4471
- }
4472
- var ku = Xr, Mu = Zr, Ou = Jr, ro = Lr;
4473
- const Au = ku, Yu = Mu, Cu = f.forwardRef(
4474
- ({ className: e, align: t = "center", sideOffset: n = 4, ...r }, o) => /* @__PURE__ */ m(Ou, { children: /* @__PURE__ */ m(
4475
- ro,
4476
- {
4477
- ref: o,
4478
- align: t,
4479
- sideOffset: n,
4480
- className: $(
4481
- "z-[100] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
4482
- e
4483
- ),
4484
- ...r
4485
- }
4486
- ) })
4487
- );
4488
- Cu.displayName = ro.displayName;
4489
- export {
4490
- Zo as A,
4491
- aa as B,
4492
- au as C,
4493
- mr as D,
4494
- pt as E,
4495
- _e as F,
4496
- Re as G,
4497
- Qs as H,
4498
- la as I,
4499
- Ie as J,
4500
- Ha as L,
4501
- dr as O,
4502
- Au as P,
4503
- rs as R,
4504
- Ru as S,
4505
- Ea as T,
4506
- Tn as X,
4507
- Lo as a,
4508
- Jo as b,
4509
- ua as c,
4510
- Cu as d,
4511
- Yu as e,
4512
- Iu as f,
4513
- cs as g,
4514
- fs as h,
4515
- ls as i,
4516
- us as j,
4517
- yr as k,
4518
- ss as l,
4519
- ds as m,
4520
- Fu as n,
4521
- Wa as o,
4522
- _a as p,
4523
- Fa as q,
4524
- Wu as r,
4525
- Ra as s,
4526
- Sa as t,
4527
- ia as u,
4528
- as as v,
4529
- fr as w,
4530
- gr as x,
4531
- hr as y,
4532
- os as z
4533
- };