@cloudflare/kumo 1.5.0 → 1.6.0

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