@konstructio/ui 0.1.0-alpha.9 → 0.1.1-alpha.1

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