@opennsw/jsonforms-renderers 0.3.0 → 0.3.1

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