codeforlife 2.10.5 → 2.10.7
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.
- package/README.md +10 -6
- package/dist/components/App.d.ts +1 -1
- package/dist/components/OrderedGrid.d.ts +10 -8
- package/dist/components/form/DatePickerField.d.ts +3 -3
- package/dist/components/form/index.cjs.js +1 -1
- package/dist/components/form/index.es.js +1 -1
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.cjs.js.map +1 -1
- package/dist/components/index.es.js +101 -99
- package/dist/components/index.es.js.map +1 -1
- package/dist/index-CI5O_yH6.js +1189 -0
- package/dist/index-CI5O_yH6.js.map +1 -0
- package/dist/index-CXYppxE3.cjs +2 -0
- package/dist/index-CXYppxE3.cjs.map +1 -0
- package/dist/{index-VverRavP.js → index-D8Gc0IWi.js} +31 -32
- package/dist/index-D8Gc0IWi.js.map +1 -0
- package/dist/index-DCI-3m7f.cjs +5 -0
- package/dist/index-DCI-3m7f.cjs.map +1 -0
- package/dist/theme/components/MuiGrid.d.ts +3 -0
- package/dist/theme/components/_components.d.ts +1 -5
- package/dist/theme/components/index.cjs.js +1 -1
- package/dist/theme/components/index.es.js +1 -1
- package/dist/theme/index.cjs.js +1 -1
- package/dist/theme/index.es.js +1 -1
- package/dist/theme/typography.d.ts +2 -2
- package/dist/utils/theme.cjs.js +1 -1
- package/dist/utils/theme.es.js +1 -1
- package/package.json +7 -7
- package/dist/index-C-3iPCa4.js +0 -1111
- package/dist/index-C-3iPCa4.js.map +0 -1
- package/dist/index-CIj5ef8a.cjs +0 -5
- package/dist/index-CIj5ef8a.cjs.map +0 -1
- package/dist/index-VverRavP.js.map +0 -1
- package/dist/index-ifedknoZ.cjs +0 -2
- package/dist/index-ifedknoZ.cjs.map +0 -1
- package/dist/theme/components/MuiGrid2.d.ts +0 -3
package/dist/index-C-3iPCa4.js
DELETED
|
@@ -1,1111 +0,0 @@
|
|
|
1
|
-
import { j as l } from "./jsx-runtime-C7wFtzyj.js";
|
|
2
|
-
import { CircularProgress as zt, Button as Dt, Autocomplete as At, TextField as ft, FormControl as Et, FormControlLabel as Bt, Checkbox as _t, FormHelperText as wt, InputAdornment as mt, IconButton as $t } from "@mui/material";
|
|
3
|
-
import { useState as U, useEffect as I, forwardRef as Ut, Children as It, useRef as Vt } from "react";
|
|
4
|
-
import { S as Ht } from "./api-BvUiTeR7.js";
|
|
5
|
-
import { u as Nt } from "./api-Cs4Y-WeI.js";
|
|
6
|
-
import { Field as $, Formik as Wt, Form as qt } from "formik";
|
|
7
|
-
import { string as V, number as Rt, bool as Gt, date as Zt, array as Xt } from "yup";
|
|
8
|
-
import { schemaToFieldValidator as H, submitForm as Qt } from "./utils/form.es.js";
|
|
9
|
-
import { getNestedProperty as D, COUNTRY_ISO_CODE_MAPPING as Kt, COUNTRY_ISO_CODES as Jt, getKeyPaths as te, UK_COUNTIES as ee } from "./utils/general.es.js";
|
|
10
|
-
import "./en-gb-B_rK7Jx1.js";
|
|
11
|
-
import { LocalizationProvider as re, DatePicker as se } from "@mui/x-date-pickers";
|
|
12
|
-
import j from "dayjs";
|
|
13
|
-
import { EmailOutlined as ne, PersonOutlined as ie, Visibility as oe, VisibilityOff as ae } from "@mui/icons-material";
|
|
14
|
-
import "./settings/index.es.js";
|
|
15
|
-
import "./session-oI-Ht2C8.js";
|
|
16
|
-
import "js-cookie";
|
|
17
|
-
import { u as ue } from "./schemas-D3tO0rys.js";
|
|
18
|
-
import "./urls-5m9PgoEX.js";
|
|
19
|
-
function N(n) {
|
|
20
|
-
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
21
|
-
}
|
|
22
|
-
function dt() {
|
|
23
|
-
return dt = Object.assign ? Object.assign.bind() : function(n) {
|
|
24
|
-
for (var o = 1; o < arguments.length; o++) {
|
|
25
|
-
var i = arguments[o];
|
|
26
|
-
for (var t in i) ({}).hasOwnProperty.call(i, t) && (n[t] = i[t]);
|
|
27
|
-
}
|
|
28
|
-
return n;
|
|
29
|
-
}, dt.apply(null, arguments);
|
|
30
|
-
}
|
|
31
|
-
const ce = ({
|
|
32
|
-
useLazyListQuery: n,
|
|
33
|
-
filterOptions: o,
|
|
34
|
-
getOptionLabel: i,
|
|
35
|
-
getOptionKey: t = (a) => a.id,
|
|
36
|
-
searchKey: e,
|
|
37
|
-
...r
|
|
38
|
-
}) => {
|
|
39
|
-
const [a, u] = U(""), [s, { isLoading: d, isError: c }] = n(), [{ limit: g, offset: y }, M] = Nt(), [{ options: Y, hasMore: T }, f] = U({ options: {}, hasMore: !0 });
|
|
40
|
-
I(
|
|
41
|
-
() => {
|
|
42
|
-
const x = { limit: g, offset: y, ...o };
|
|
43
|
-
a && (x[e] = a), s(x, !0).unwrap().then(({ data: O, offset: C, limit: b, count: w }) => {
|
|
44
|
-
f(({ options: k }) => {
|
|
45
|
-
const P = { ...k };
|
|
46
|
-
return O.forEach((F) => {
|
|
47
|
-
P[t(F)] = F;
|
|
48
|
-
}), { options: P, hasMore: C + b < w };
|
|
49
|
-
});
|
|
50
|
-
}).catch((O) => {
|
|
51
|
-
O && console.error(O);
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
55
|
-
[
|
|
56
|
-
s,
|
|
57
|
-
g,
|
|
58
|
-
y,
|
|
59
|
-
e,
|
|
60
|
-
a,
|
|
61
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
|
-
...Object.values(o || {})
|
|
63
|
-
]
|
|
64
|
-
);
|
|
65
|
-
let h = Object.keys(Y);
|
|
66
|
-
if (!h.length) return /* @__PURE__ */ l.jsx(l.Fragment, {});
|
|
67
|
-
typeof t(Object.values(Y)[0]) == "number" && (h = h.map(Number));
|
|
68
|
-
function m() {
|
|
69
|
-
M(({ page: x, limit: O }) => ({ page: x + 1, limit: O }));
|
|
70
|
-
}
|
|
71
|
-
const p = ({ children: x, ...O }, C) => {
|
|
72
|
-
const b = It.toArray(x);
|
|
73
|
-
return d ? b.push(/* @__PURE__ */ l.jsx(zt, {}, "is-loading")) : (c && b.push(/* @__PURE__ */ l.jsx(Ht, {}, "is-error")), T && b.push(
|
|
74
|
-
/* @__PURE__ */ l.jsx(Dt, { onClick: m, children: "Load more" }, "load-more")
|
|
75
|
-
)), /* @__PURE__ */ l.jsx(
|
|
76
|
-
"ul",
|
|
77
|
-
{
|
|
78
|
-
...O,
|
|
79
|
-
ref: C,
|
|
80
|
-
onScroll: (w) => {
|
|
81
|
-
!d && w.currentTarget.clientHeight + w.currentTarget.scrollTop >= w.currentTarget.scrollHeight && m();
|
|
82
|
-
},
|
|
83
|
-
children: b
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
return /* @__PURE__ */ l.jsx(
|
|
88
|
-
rt,
|
|
89
|
-
{
|
|
90
|
-
options: h,
|
|
91
|
-
getOptionLabel: (x) => i(Y[x]),
|
|
92
|
-
onInputChange: (x, O, C) => {
|
|
93
|
-
u(C === "input" ? O : "");
|
|
94
|
-
},
|
|
95
|
-
ListboxComponent: Ut(p),
|
|
96
|
-
...r
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
}, rt = ({
|
|
100
|
-
textFieldProps: n,
|
|
101
|
-
options: o,
|
|
102
|
-
validateOptions: i,
|
|
103
|
-
...t
|
|
104
|
-
}) => {
|
|
105
|
-
const { id: e, name: r, required: a, ...u } = n, s = r.split("."), d = "not a valid option";
|
|
106
|
-
let c = typeof o[0] == "string" ? V().oneOf(o, d) : Rt().oneOf(o, d);
|
|
107
|
-
a && (c = c.required());
|
|
108
|
-
const g = {
|
|
109
|
-
name: r,
|
|
110
|
-
type: typeof o[0] == "string" ? "text" : "number",
|
|
111
|
-
validate: H(c, i)
|
|
112
|
-
};
|
|
113
|
-
return /* @__PURE__ */ l.jsx($, { ...g, children: ({ form: y, meta: M }) => {
|
|
114
|
-
const Y = D(
|
|
115
|
-
y.values,
|
|
116
|
-
s
|
|
117
|
-
), T = D(y.touched, s), f = D(y.errors, s);
|
|
118
|
-
return /* @__PURE__ */ l.jsx(
|
|
119
|
-
At,
|
|
120
|
-
{
|
|
121
|
-
options: o,
|
|
122
|
-
defaultValue: M.initialValue === "" ? void 0 : M.initialValue,
|
|
123
|
-
renderInput: ({
|
|
124
|
-
id: h,
|
|
125
|
-
// eslint-disable-line @typescript-eslint/no-unused-vars
|
|
126
|
-
...m
|
|
127
|
-
}) => /* @__PURE__ */ l.jsx(
|
|
128
|
-
ft,
|
|
129
|
-
{
|
|
130
|
-
id: e ?? r,
|
|
131
|
-
name: r,
|
|
132
|
-
required: a,
|
|
133
|
-
type: "text",
|
|
134
|
-
value: Y,
|
|
135
|
-
error: T && !!f,
|
|
136
|
-
helperText: T && f,
|
|
137
|
-
...u,
|
|
138
|
-
...m
|
|
139
|
-
}
|
|
140
|
-
),
|
|
141
|
-
onChange: (h, m) => {
|
|
142
|
-
y.setFieldValue(r, m ?? void 0, !0);
|
|
143
|
-
},
|
|
144
|
-
onBlur: y.handleBlur,
|
|
145
|
-
...t
|
|
146
|
-
}
|
|
147
|
-
);
|
|
148
|
-
} });
|
|
149
|
-
}, he = ({
|
|
150
|
-
id: n,
|
|
151
|
-
name: o,
|
|
152
|
-
formControlLabelProps: i,
|
|
153
|
-
required: t = !1,
|
|
154
|
-
errorMessage: e = "this is a required field",
|
|
155
|
-
validateOptions: r,
|
|
156
|
-
...a
|
|
157
|
-
}) => {
|
|
158
|
-
const u = o.split(".");
|
|
159
|
-
let s = Gt();
|
|
160
|
-
t && (s = s.oneOf([!0], e));
|
|
161
|
-
const d = {
|
|
162
|
-
name: o,
|
|
163
|
-
type: "checkbox",
|
|
164
|
-
validate: H(s, r)
|
|
165
|
-
};
|
|
166
|
-
return /* @__PURE__ */ l.jsx($, { ...d, children: ({ form: c, meta: g }) => {
|
|
167
|
-
const y = D(c.touched, u), M = D(c.errors, u), Y = D(
|
|
168
|
-
c.values,
|
|
169
|
-
u
|
|
170
|
-
), T = y && !!M;
|
|
171
|
-
return /* @__PURE__ */ l.jsxs(Et, { error: T, required: t, children: [
|
|
172
|
-
/* @__PURE__ */ l.jsx(
|
|
173
|
-
Bt,
|
|
174
|
-
{
|
|
175
|
-
control: /* @__PURE__ */ l.jsx(
|
|
176
|
-
_t,
|
|
177
|
-
{
|
|
178
|
-
defaultChecked: g.initialValue,
|
|
179
|
-
id: n ?? o,
|
|
180
|
-
name: o,
|
|
181
|
-
value: Y,
|
|
182
|
-
onChange: c.handleChange,
|
|
183
|
-
onBlur: c.handleBlur,
|
|
184
|
-
...a
|
|
185
|
-
}
|
|
186
|
-
),
|
|
187
|
-
...i
|
|
188
|
-
}
|
|
189
|
-
),
|
|
190
|
-
T && /* @__PURE__ */ l.jsx(wt, { children: M })
|
|
191
|
-
] });
|
|
192
|
-
} });
|
|
193
|
-
}, le = ({
|
|
194
|
-
textFieldProps: n,
|
|
195
|
-
...o
|
|
196
|
-
}) => {
|
|
197
|
-
const {
|
|
198
|
-
name: i = "country",
|
|
199
|
-
label: t = "Country",
|
|
200
|
-
placeholder: e = "Select your country",
|
|
201
|
-
...r
|
|
202
|
-
} = n || {};
|
|
203
|
-
return /* @__PURE__ */ l.jsx(
|
|
204
|
-
rt,
|
|
205
|
-
{
|
|
206
|
-
options: Jt,
|
|
207
|
-
getOptionLabel: (a) => Kt[a],
|
|
208
|
-
textFieldProps: { name: i, label: t, placeholder: e, ...r },
|
|
209
|
-
...o
|
|
210
|
-
}
|
|
211
|
-
);
|
|
212
|
-
};
|
|
213
|
-
var Q = { exports: {} }, de = Q.exports, yt;
|
|
214
|
-
function fe() {
|
|
215
|
-
return yt || (yt = 1, (function(n, o) {
|
|
216
|
-
(function(i, t) {
|
|
217
|
-
n.exports = t();
|
|
218
|
-
})(de, (function() {
|
|
219
|
-
var i = "week", t = "year";
|
|
220
|
-
return function(e, r, a) {
|
|
221
|
-
var u = r.prototype;
|
|
222
|
-
u.week = function(s) {
|
|
223
|
-
if (s === void 0 && (s = null), s !== null) return this.add(7 * (s - this.week()), "day");
|
|
224
|
-
var d = this.$locale().yearStart || 1;
|
|
225
|
-
if (this.month() === 11 && this.date() > 25) {
|
|
226
|
-
var c = a(this).startOf(t).add(1, t).date(d), g = a(this).endOf(i);
|
|
227
|
-
if (c.isBefore(g)) return 1;
|
|
228
|
-
}
|
|
229
|
-
var y = a(this).startOf(t).date(d).startOf(i).subtract(1, "millisecond"), M = this.diff(y, i, !0);
|
|
230
|
-
return M < 0 ? a(this).startOf("week").week() : Math.ceil(M);
|
|
231
|
-
}, u.weeks = function(s) {
|
|
232
|
-
return s === void 0 && (s = null), this.week(s);
|
|
233
|
-
};
|
|
234
|
-
};
|
|
235
|
-
}));
|
|
236
|
-
})(Q)), Q.exports;
|
|
237
|
-
}
|
|
238
|
-
var me = fe();
|
|
239
|
-
const pe = /* @__PURE__ */ N(me);
|
|
240
|
-
var K = { exports: {} }, ge = K.exports, Mt;
|
|
241
|
-
function ye() {
|
|
242
|
-
return Mt || (Mt = 1, (function(n, o) {
|
|
243
|
-
(function(i, t) {
|
|
244
|
-
n.exports = t();
|
|
245
|
-
})(ge, (function() {
|
|
246
|
-
var i = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, e = /\d/, r = /\d\d/, a = /\d\d?/, u = /\d*[^-_:/,()\s\d]+/, s = {}, d = function(f) {
|
|
247
|
-
return (f = +f) + (f > 68 ? 1900 : 2e3);
|
|
248
|
-
}, c = function(f) {
|
|
249
|
-
return function(h) {
|
|
250
|
-
this[f] = +h;
|
|
251
|
-
};
|
|
252
|
-
}, g = [/[+-]\d\d:?(\d\d)?|Z/, function(f) {
|
|
253
|
-
(this.zone || (this.zone = {})).offset = (function(h) {
|
|
254
|
-
if (!h || h === "Z") return 0;
|
|
255
|
-
var m = h.match(/([+-]|\d\d)/g), p = 60 * m[1] + (+m[2] || 0);
|
|
256
|
-
return p === 0 ? 0 : m[0] === "+" ? -p : p;
|
|
257
|
-
})(f);
|
|
258
|
-
}], y = function(f) {
|
|
259
|
-
var h = s[f];
|
|
260
|
-
return h && (h.indexOf ? h : h.s.concat(h.f));
|
|
261
|
-
}, M = function(f, h) {
|
|
262
|
-
var m, p = s.meridiem;
|
|
263
|
-
if (p) {
|
|
264
|
-
for (var x = 1; x <= 24; x += 1) if (f.indexOf(p(x, 0, h)) > -1) {
|
|
265
|
-
m = x > 12;
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
|
-
} else m = f === (h ? "pm" : "PM");
|
|
269
|
-
return m;
|
|
270
|
-
}, Y = { A: [u, function(f) {
|
|
271
|
-
this.afternoon = M(f, !1);
|
|
272
|
-
}], a: [u, function(f) {
|
|
273
|
-
this.afternoon = M(f, !0);
|
|
274
|
-
}], Q: [e, function(f) {
|
|
275
|
-
this.month = 3 * (f - 1) + 1;
|
|
276
|
-
}], S: [e, function(f) {
|
|
277
|
-
this.milliseconds = 100 * +f;
|
|
278
|
-
}], SS: [r, function(f) {
|
|
279
|
-
this.milliseconds = 10 * +f;
|
|
280
|
-
}], SSS: [/\d{3}/, function(f) {
|
|
281
|
-
this.milliseconds = +f;
|
|
282
|
-
}], s: [a, c("seconds")], ss: [a, c("seconds")], m: [a, c("minutes")], mm: [a, c("minutes")], H: [a, c("hours")], h: [a, c("hours")], HH: [a, c("hours")], hh: [a, c("hours")], D: [a, c("day")], DD: [r, c("day")], Do: [u, function(f) {
|
|
283
|
-
var h = s.ordinal, m = f.match(/\d+/);
|
|
284
|
-
if (this.day = m[0], h) for (var p = 1; p <= 31; p += 1) h(p).replace(/\[|\]/g, "") === f && (this.day = p);
|
|
285
|
-
}], w: [a, c("week")], ww: [r, c("week")], M: [a, c("month")], MM: [r, c("month")], MMM: [u, function(f) {
|
|
286
|
-
var h = y("months"), m = (y("monthsShort") || h.map((function(p) {
|
|
287
|
-
return p.slice(0, 3);
|
|
288
|
-
}))).indexOf(f) + 1;
|
|
289
|
-
if (m < 1) throw new Error();
|
|
290
|
-
this.month = m % 12 || m;
|
|
291
|
-
}], MMMM: [u, function(f) {
|
|
292
|
-
var h = y("months").indexOf(f) + 1;
|
|
293
|
-
if (h < 1) throw new Error();
|
|
294
|
-
this.month = h % 12 || h;
|
|
295
|
-
}], Y: [/[+-]?\d+/, c("year")], YY: [r, function(f) {
|
|
296
|
-
this.year = d(f);
|
|
297
|
-
}], YYYY: [/\d{4}/, c("year")], Z: g, ZZ: g };
|
|
298
|
-
function T(f) {
|
|
299
|
-
var h, m;
|
|
300
|
-
h = f, m = s && s.formats;
|
|
301
|
-
for (var p = (f = h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(P, F, v) {
|
|
302
|
-
var S = v && v.toUpperCase();
|
|
303
|
-
return F || m[v] || i[v] || m[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(z, A, E) {
|
|
304
|
-
return A || E.slice(1);
|
|
305
|
-
}));
|
|
306
|
-
}))).match(t), x = p.length, O = 0; O < x; O += 1) {
|
|
307
|
-
var C = p[O], b = Y[C], w = b && b[0], k = b && b[1];
|
|
308
|
-
p[O] = k ? { regex: w, parser: k } : C.replace(/^\[|\]$/g, "");
|
|
309
|
-
}
|
|
310
|
-
return function(P) {
|
|
311
|
-
for (var F = {}, v = 0, S = 0; v < x; v += 1) {
|
|
312
|
-
var z = p[v];
|
|
313
|
-
if (typeof z == "string") S += z.length;
|
|
314
|
-
else {
|
|
315
|
-
var A = z.regex, E = z.parser, q = P.slice(S), _ = A.exec(q)[0];
|
|
316
|
-
E.call(F, _), P = P.replace(_, "");
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
return (function(B) {
|
|
320
|
-
var R = B.afternoon;
|
|
321
|
-
if (R !== void 0) {
|
|
322
|
-
var L = B.hours;
|
|
323
|
-
R ? L < 12 && (B.hours += 12) : L === 12 && (B.hours = 0), delete B.afternoon;
|
|
324
|
-
}
|
|
325
|
-
})(F), F;
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
return function(f, h, m) {
|
|
329
|
-
m.p.customParseFormat = !0, f && f.parseTwoDigitYear && (d = f.parseTwoDigitYear);
|
|
330
|
-
var p = h.prototype, x = p.parse;
|
|
331
|
-
p.parse = function(O) {
|
|
332
|
-
var C = O.date, b = O.utc, w = O.args;
|
|
333
|
-
this.$u = b;
|
|
334
|
-
var k = w[1];
|
|
335
|
-
if (typeof k == "string") {
|
|
336
|
-
var P = w[2] === !0, F = w[3] === !0, v = P || F, S = w[2];
|
|
337
|
-
F && (S = w[2]), s = this.$locale(), !P && S && (s = m.Ls[S]), this.$d = (function(q, _, B, R) {
|
|
338
|
-
try {
|
|
339
|
-
if (["x", "X"].indexOf(_) > -1) return new Date((_ === "X" ? 1e3 : 1) * q);
|
|
340
|
-
var L = T(_)(q), st = L.year, G = L.month, kt = L.day, Ft = L.hours, St = L.minutes, Pt = L.seconds, vt = L.milliseconds, pt = L.zone, gt = L.week, nt = /* @__PURE__ */ new Date(), it = kt || (st || G ? 1 : nt.getDate()), ot = st || nt.getFullYear(), Z = 0;
|
|
341
|
-
st && !G || (Z = G > 0 ? G - 1 : nt.getMonth());
|
|
342
|
-
var X, at = Ft || 0, ut = St || 0, ct = Pt || 0, ht = vt || 0;
|
|
343
|
-
return pt ? new Date(Date.UTC(ot, Z, it, at, ut, ct, ht + 60 * pt.offset * 1e3)) : B ? new Date(Date.UTC(ot, Z, it, at, ut, ct, ht)) : (X = new Date(ot, Z, it, at, ut, ct, ht), gt && (X = R(X).week(gt).toDate()), X);
|
|
344
|
-
} catch {
|
|
345
|
-
return /* @__PURE__ */ new Date("");
|
|
346
|
-
}
|
|
347
|
-
})(C, k, b, m), this.init(), S && S !== !0 && (this.$L = this.locale(S).$L), v && C != this.format(k) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
|
|
348
|
-
} else if (k instanceof Array) for (var z = k.length, A = 1; A <= z; A += 1) {
|
|
349
|
-
w[1] = k[A - 1];
|
|
350
|
-
var E = m.apply(this, w);
|
|
351
|
-
if (E.isValid()) {
|
|
352
|
-
this.$d = E.$d, this.$L = E.$L, this.init();
|
|
353
|
-
break;
|
|
354
|
-
}
|
|
355
|
-
A === z && (this.$d = /* @__PURE__ */ new Date(""));
|
|
356
|
-
}
|
|
357
|
-
else x.call(this, O);
|
|
358
|
-
};
|
|
359
|
-
};
|
|
360
|
-
}));
|
|
361
|
-
})(K)), K.exports;
|
|
362
|
-
}
|
|
363
|
-
var Me = ye();
|
|
364
|
-
const xe = /* @__PURE__ */ N(Me);
|
|
365
|
-
var J = { exports: {} }, Te = J.exports, xt;
|
|
366
|
-
function Oe() {
|
|
367
|
-
return xt || (xt = 1, (function(n, o) {
|
|
368
|
-
(function(i, t) {
|
|
369
|
-
n.exports = t();
|
|
370
|
-
})(Te, (function() {
|
|
371
|
-
var i = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
|
|
372
|
-
return function(t, e, r) {
|
|
373
|
-
var a = e.prototype, u = a.format;
|
|
374
|
-
r.en.formats = i, a.format = function(s) {
|
|
375
|
-
s === void 0 && (s = "YYYY-MM-DDTHH:mm:ssZ");
|
|
376
|
-
var d = this.$locale().formats, c = (function(g, y) {
|
|
377
|
-
return g.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(M, Y, T) {
|
|
378
|
-
var f = T && T.toUpperCase();
|
|
379
|
-
return Y || y[T] || i[T] || y[f].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(h, m, p) {
|
|
380
|
-
return m || p.slice(1);
|
|
381
|
-
}));
|
|
382
|
-
}));
|
|
383
|
-
})(s, d === void 0 ? {} : d);
|
|
384
|
-
return u.call(this, c);
|
|
385
|
-
};
|
|
386
|
-
};
|
|
387
|
-
}));
|
|
388
|
-
})(J)), J.exports;
|
|
389
|
-
}
|
|
390
|
-
var Ye = Oe();
|
|
391
|
-
const je = /* @__PURE__ */ N(Ye);
|
|
392
|
-
var tt = { exports: {} }, De = tt.exports, Tt;
|
|
393
|
-
function we() {
|
|
394
|
-
return Tt || (Tt = 1, (function(n, o) {
|
|
395
|
-
(function(i, t) {
|
|
396
|
-
n.exports = t();
|
|
397
|
-
})(De, (function() {
|
|
398
|
-
return function(i, t, e) {
|
|
399
|
-
t.prototype.isBetween = function(r, a, u, s) {
|
|
400
|
-
var d = e(r), c = e(a), g = (s = s || "()")[0] === "(", y = s[1] === ")";
|
|
401
|
-
return (g ? this.isAfter(d, u) : !this.isBefore(d, u)) && (y ? this.isBefore(c, u) : !this.isAfter(c, u)) || (g ? this.isBefore(d, u) : !this.isAfter(d, u)) && (y ? this.isAfter(c, u) : !this.isBefore(c, u));
|
|
402
|
-
};
|
|
403
|
-
};
|
|
404
|
-
}));
|
|
405
|
-
})(tt)), tt.exports;
|
|
406
|
-
}
|
|
407
|
-
var be = we();
|
|
408
|
-
const Le = /* @__PURE__ */ N(be);
|
|
409
|
-
var et = { exports: {} }, Ce = et.exports, Ot;
|
|
410
|
-
function ke() {
|
|
411
|
-
return Ot || (Ot = 1, (function(n, o) {
|
|
412
|
-
(function(i, t) {
|
|
413
|
-
n.exports = t();
|
|
414
|
-
})(Ce, (function() {
|
|
415
|
-
return function(i, t) {
|
|
416
|
-
var e = t.prototype, r = e.format;
|
|
417
|
-
e.format = function(a) {
|
|
418
|
-
var u = this, s = this.$locale();
|
|
419
|
-
if (!this.isValid()) return r.bind(this)(a);
|
|
420
|
-
var d = this.$utils(), c = (a || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, (function(g) {
|
|
421
|
-
switch (g) {
|
|
422
|
-
case "Q":
|
|
423
|
-
return Math.ceil((u.$M + 1) / 3);
|
|
424
|
-
case "Do":
|
|
425
|
-
return s.ordinal(u.$D);
|
|
426
|
-
case "gggg":
|
|
427
|
-
return u.weekYear();
|
|
428
|
-
case "GGGG":
|
|
429
|
-
return u.isoWeekYear();
|
|
430
|
-
case "wo":
|
|
431
|
-
return s.ordinal(u.week(), "W");
|
|
432
|
-
case "w":
|
|
433
|
-
case "ww":
|
|
434
|
-
return d.s(u.week(), g === "w" ? 1 : 2, "0");
|
|
435
|
-
case "W":
|
|
436
|
-
case "WW":
|
|
437
|
-
return d.s(u.isoWeek(), g === "W" ? 1 : 2, "0");
|
|
438
|
-
case "k":
|
|
439
|
-
case "kk":
|
|
440
|
-
return d.s(String(u.$H === 0 ? 24 : u.$H), g === "k" ? 1 : 2, "0");
|
|
441
|
-
case "X":
|
|
442
|
-
return Math.floor(u.$d.getTime() / 1e3);
|
|
443
|
-
case "x":
|
|
444
|
-
return u.$d.getTime();
|
|
445
|
-
case "z":
|
|
446
|
-
return "[" + u.offsetName() + "]";
|
|
447
|
-
case "zzz":
|
|
448
|
-
return "[" + u.offsetName("long") + "]";
|
|
449
|
-
default:
|
|
450
|
-
return g;
|
|
451
|
-
}
|
|
452
|
-
}));
|
|
453
|
-
return r.bind(this)(c);
|
|
454
|
-
};
|
|
455
|
-
};
|
|
456
|
-
}));
|
|
457
|
-
})(et)), et.exports;
|
|
458
|
-
}
|
|
459
|
-
var Fe = ke();
|
|
460
|
-
const Se = /* @__PURE__ */ N(Fe), Yt = /* @__PURE__ */ new Set();
|
|
461
|
-
function Pe(n, o = "warning") {
|
|
462
|
-
if (process.env.NODE_ENV === "production")
|
|
463
|
-
return;
|
|
464
|
-
const i = Array.isArray(n) ? n.join(`
|
|
465
|
-
`) : n;
|
|
466
|
-
Yt.has(i) || (Yt.add(i), o === "error" ? console.error(i) : console.warn(i));
|
|
467
|
-
}
|
|
468
|
-
j.extend(je);
|
|
469
|
-
j.extend(pe);
|
|
470
|
-
j.extend(Le);
|
|
471
|
-
j.extend(Se);
|
|
472
|
-
const ve = {
|
|
473
|
-
// Year
|
|
474
|
-
YY: "year",
|
|
475
|
-
YYYY: {
|
|
476
|
-
sectionType: "year",
|
|
477
|
-
contentType: "digit",
|
|
478
|
-
maxLength: 4
|
|
479
|
-
},
|
|
480
|
-
// Month
|
|
481
|
-
M: {
|
|
482
|
-
sectionType: "month",
|
|
483
|
-
contentType: "digit",
|
|
484
|
-
maxLength: 2
|
|
485
|
-
},
|
|
486
|
-
MM: "month",
|
|
487
|
-
MMM: {
|
|
488
|
-
sectionType: "month",
|
|
489
|
-
contentType: "letter"
|
|
490
|
-
},
|
|
491
|
-
MMMM: {
|
|
492
|
-
sectionType: "month",
|
|
493
|
-
contentType: "letter"
|
|
494
|
-
},
|
|
495
|
-
// Day of the month
|
|
496
|
-
D: {
|
|
497
|
-
sectionType: "day",
|
|
498
|
-
contentType: "digit",
|
|
499
|
-
maxLength: 2
|
|
500
|
-
},
|
|
501
|
-
DD: "day",
|
|
502
|
-
Do: {
|
|
503
|
-
sectionType: "day",
|
|
504
|
-
contentType: "digit-with-letter"
|
|
505
|
-
},
|
|
506
|
-
// Day of the week
|
|
507
|
-
d: {
|
|
508
|
-
sectionType: "weekDay",
|
|
509
|
-
contentType: "digit",
|
|
510
|
-
maxLength: 2
|
|
511
|
-
},
|
|
512
|
-
dd: {
|
|
513
|
-
sectionType: "weekDay",
|
|
514
|
-
contentType: "letter"
|
|
515
|
-
},
|
|
516
|
-
ddd: {
|
|
517
|
-
sectionType: "weekDay",
|
|
518
|
-
contentType: "letter"
|
|
519
|
-
},
|
|
520
|
-
dddd: {
|
|
521
|
-
sectionType: "weekDay",
|
|
522
|
-
contentType: "letter"
|
|
523
|
-
},
|
|
524
|
-
// Meridiem
|
|
525
|
-
A: "meridiem",
|
|
526
|
-
a: "meridiem",
|
|
527
|
-
// Hours
|
|
528
|
-
H: {
|
|
529
|
-
sectionType: "hours",
|
|
530
|
-
contentType: "digit",
|
|
531
|
-
maxLength: 2
|
|
532
|
-
},
|
|
533
|
-
HH: "hours",
|
|
534
|
-
h: {
|
|
535
|
-
sectionType: "hours",
|
|
536
|
-
contentType: "digit",
|
|
537
|
-
maxLength: 2
|
|
538
|
-
},
|
|
539
|
-
hh: "hours",
|
|
540
|
-
// Minutes
|
|
541
|
-
m: {
|
|
542
|
-
sectionType: "minutes",
|
|
543
|
-
contentType: "digit",
|
|
544
|
-
maxLength: 2
|
|
545
|
-
},
|
|
546
|
-
mm: "minutes",
|
|
547
|
-
// Seconds
|
|
548
|
-
s: {
|
|
549
|
-
sectionType: "seconds",
|
|
550
|
-
contentType: "digit",
|
|
551
|
-
maxLength: 2
|
|
552
|
-
},
|
|
553
|
-
ss: "seconds"
|
|
554
|
-
}, ze = {
|
|
555
|
-
year: "YYYY",
|
|
556
|
-
month: "MMMM",
|
|
557
|
-
monthShort: "MMM",
|
|
558
|
-
dayOfMonth: "D",
|
|
559
|
-
dayOfMonthFull: "Do",
|
|
560
|
-
weekday: "dddd",
|
|
561
|
-
weekdayShort: "dd",
|
|
562
|
-
hours24h: "HH",
|
|
563
|
-
hours12h: "hh",
|
|
564
|
-
meridiem: "A",
|
|
565
|
-
minutes: "mm",
|
|
566
|
-
seconds: "ss",
|
|
567
|
-
fullDate: "ll",
|
|
568
|
-
keyboardDate: "L",
|
|
569
|
-
shortDate: "MMM D",
|
|
570
|
-
normalDate: "D MMMM",
|
|
571
|
-
normalDateWithWeekday: "ddd, MMM D",
|
|
572
|
-
fullTime: "LT",
|
|
573
|
-
fullTime12h: "hh:mm A",
|
|
574
|
-
fullTime24h: "HH:mm",
|
|
575
|
-
keyboardDateTime: "L LT",
|
|
576
|
-
keyboardDateTime12h: "L hh:mm A",
|
|
577
|
-
keyboardDateTime24h: "L HH:mm"
|
|
578
|
-
}, lt = ["Missing UTC plugin", "To be able to use UTC or timezones, you have to enable the `utc` plugin", "Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
|
|
579
|
-
`), jt = ["Missing timezone plugin", "To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin", "Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(`
|
|
580
|
-
`), Ae = (n, o) => o ? (...i) => n(...i).locale(o) : n;
|
|
581
|
-
class Ee {
|
|
582
|
-
constructor({
|
|
583
|
-
locale: o,
|
|
584
|
-
formats: i
|
|
585
|
-
} = {}) {
|
|
586
|
-
this.isMUIAdapter = !0, this.isTimezoneCompatible = !0, this.lib = "dayjs", this.dayjs = void 0, this.locale = void 0, this.formats = void 0, this.escapedCharacters = {
|
|
587
|
-
start: "[",
|
|
588
|
-
end: "]"
|
|
589
|
-
}, this.formatTokenMap = ve, this.setLocaleToValue = (t) => {
|
|
590
|
-
const e = this.getCurrentLocaleCode();
|
|
591
|
-
return e === t.locale() ? t : t.locale(e);
|
|
592
|
-
}, this.hasUTCPlugin = () => typeof j.utc < "u", this.hasTimezonePlugin = () => typeof j.tz < "u", this.isSame = (t, e, r) => {
|
|
593
|
-
const a = this.setTimezone(e, this.getTimezone(t));
|
|
594
|
-
return t.format(r) === a.format(r);
|
|
595
|
-
}, this.cleanTimezone = (t) => {
|
|
596
|
-
switch (t) {
|
|
597
|
-
case "default":
|
|
598
|
-
return;
|
|
599
|
-
case "system":
|
|
600
|
-
return j.tz.guess();
|
|
601
|
-
default:
|
|
602
|
-
return t;
|
|
603
|
-
}
|
|
604
|
-
}, this.createSystemDate = (t) => {
|
|
605
|
-
if (this.hasUTCPlugin() && this.hasTimezonePlugin()) {
|
|
606
|
-
const e = j.tz.guess();
|
|
607
|
-
return e !== "UTC" ? j.tz(t, e) : j(t);
|
|
608
|
-
}
|
|
609
|
-
return j(t);
|
|
610
|
-
}, this.createUTCDate = (t) => {
|
|
611
|
-
if (!this.hasUTCPlugin())
|
|
612
|
-
throw new Error(lt);
|
|
613
|
-
return j.utc(t);
|
|
614
|
-
}, this.createTZDate = (t, e) => {
|
|
615
|
-
if (!this.hasUTCPlugin())
|
|
616
|
-
throw new Error(lt);
|
|
617
|
-
if (!this.hasTimezonePlugin())
|
|
618
|
-
throw new Error(jt);
|
|
619
|
-
const r = t !== void 0 && !t.endsWith("Z");
|
|
620
|
-
return j(t).tz(this.cleanTimezone(e), r);
|
|
621
|
-
}, this.getLocaleFormats = () => {
|
|
622
|
-
const t = j.Ls, e = this.locale || "en";
|
|
623
|
-
let r = t[e];
|
|
624
|
-
return r === void 0 && (process.env.NODE_ENV !== "production" && Pe(["MUI X: Your locale has not been found.", "Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale.", "Or you forget to import the locale from 'dayjs/locale/{localeUsed}'", "fallback on English locale."]), r = t.en), r.formats;
|
|
625
|
-
}, this.adjustOffset = (t) => {
|
|
626
|
-
if (!this.hasTimezonePlugin())
|
|
627
|
-
return t;
|
|
628
|
-
const e = this.getTimezone(t);
|
|
629
|
-
if (e !== "UTC") {
|
|
630
|
-
const r = t.tz(this.cleanTimezone(e), !0);
|
|
631
|
-
if (r.$offset === (t.$offset ?? 0))
|
|
632
|
-
return t;
|
|
633
|
-
t.$offset = r.$offset;
|
|
634
|
-
}
|
|
635
|
-
return t;
|
|
636
|
-
}, this.date = (t, e = "default") => {
|
|
637
|
-
if (t === null)
|
|
638
|
-
return null;
|
|
639
|
-
let r;
|
|
640
|
-
return e === "UTC" ? r = this.createUTCDate(t) : e === "system" || e === "default" && !this.hasTimezonePlugin() ? r = this.createSystemDate(t) : r = this.createTZDate(t, e), this.locale === void 0 ? r : r.locale(this.locale);
|
|
641
|
-
}, this.getInvalidDate = () => j(/* @__PURE__ */ new Date("Invalid date")), this.getTimezone = (t) => {
|
|
642
|
-
if (this.hasTimezonePlugin()) {
|
|
643
|
-
const e = t.$x?.$timezone;
|
|
644
|
-
if (e)
|
|
645
|
-
return e;
|
|
646
|
-
}
|
|
647
|
-
return this.hasUTCPlugin() && t.isUTC() ? "UTC" : "system";
|
|
648
|
-
}, this.setTimezone = (t, e) => {
|
|
649
|
-
if (this.getTimezone(t) === e)
|
|
650
|
-
return t;
|
|
651
|
-
if (e === "UTC") {
|
|
652
|
-
if (!this.hasUTCPlugin())
|
|
653
|
-
throw new Error(lt);
|
|
654
|
-
return t.utc();
|
|
655
|
-
}
|
|
656
|
-
if (e === "system")
|
|
657
|
-
return t.local();
|
|
658
|
-
if (!this.hasTimezonePlugin()) {
|
|
659
|
-
if (e === "default")
|
|
660
|
-
return t;
|
|
661
|
-
throw new Error(jt);
|
|
662
|
-
}
|
|
663
|
-
return j.tz(t, this.cleanTimezone(e));
|
|
664
|
-
}, this.toJsDate = (t) => t.toDate(), this.parse = (t, e) => t === "" ? null : this.dayjs(t, e, this.locale, !0), this.getCurrentLocaleCode = () => this.locale || "en", this.is12HourCycleInCurrentLocale = () => /A|a/.test(this.getLocaleFormats().LT || ""), this.expandFormat = (t) => {
|
|
665
|
-
const e = this.getLocaleFormats(), r = (a) => a.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (u, s, d) => s || d.slice(1));
|
|
666
|
-
return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (a, u, s) => {
|
|
667
|
-
const d = s && s.toUpperCase();
|
|
668
|
-
return u || e[s] || r(e[d]);
|
|
669
|
-
});
|
|
670
|
-
}, this.isValid = (t) => t == null ? !1 : t.isValid(), this.format = (t, e) => this.formatByString(t, this.formats[e]), this.formatByString = (t, e) => this.dayjs(t).format(e), this.formatNumber = (t) => t, this.isEqual = (t, e) => t === null && e === null ? !0 : t === null || e === null ? !1 : t.toDate().getTime() === e.toDate().getTime(), this.isSameYear = (t, e) => this.isSame(t, e, "YYYY"), this.isSameMonth = (t, e) => this.isSame(t, e, "YYYY-MM"), this.isSameDay = (t, e) => this.isSame(t, e, "YYYY-MM-DD"), this.isSameHour = (t, e) => t.isSame(e, "hour"), this.isAfter = (t, e) => t > e, this.isAfterYear = (t, e) => this.hasUTCPlugin() ? !this.isSameYear(t, e) && t.utc() > e.utc() : t.isAfter(e, "year"), this.isAfterDay = (t, e) => this.hasUTCPlugin() ? !this.isSameDay(t, e) && t.utc() > e.utc() : t.isAfter(e, "day"), this.isBefore = (t, e) => t < e, this.isBeforeYear = (t, e) => this.hasUTCPlugin() ? !this.isSameYear(t, e) && t.utc() < e.utc() : t.isBefore(e, "year"), this.isBeforeDay = (t, e) => this.hasUTCPlugin() ? !this.isSameDay(t, e) && t.utc() < e.utc() : t.isBefore(e, "day"), this.isWithinRange = (t, [e, r]) => t >= e && t <= r, this.startOfYear = (t) => this.adjustOffset(t.startOf("year")), this.startOfMonth = (t) => this.adjustOffset(t.startOf("month")), this.startOfWeek = (t) => this.adjustOffset(this.setLocaleToValue(t).startOf("week")), this.startOfDay = (t) => this.adjustOffset(t.startOf("day")), this.endOfYear = (t) => this.adjustOffset(t.endOf("year")), this.endOfMonth = (t) => this.adjustOffset(t.endOf("month")), this.endOfWeek = (t) => this.adjustOffset(this.setLocaleToValue(t).endOf("week")), this.endOfDay = (t) => this.adjustOffset(t.endOf("day")), this.addYears = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "year") : t.add(e, "year")), this.addMonths = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "month") : t.add(e, "month")), this.addWeeks = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "week") : t.add(e, "week")), this.addDays = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "day") : t.add(e, "day")), this.addHours = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "hour") : t.add(e, "hour")), this.addMinutes = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "minute") : t.add(e, "minute")), this.addSeconds = (t, e) => this.adjustOffset(e < 0 ? t.subtract(Math.abs(e), "second") : t.add(e, "second")), this.getYear = (t) => t.year(), this.getMonth = (t) => t.month(), this.getDate = (t) => t.date(), this.getHours = (t) => t.hour(), this.getMinutes = (t) => t.minute(), this.getSeconds = (t) => t.second(), this.getMilliseconds = (t) => t.millisecond(), this.setYear = (t, e) => this.adjustOffset(t.set("year", e)), this.setMonth = (t, e) => this.adjustOffset(t.set("month", e)), this.setDate = (t, e) => this.adjustOffset(t.set("date", e)), this.setHours = (t, e) => this.adjustOffset(t.set("hour", e)), this.setMinutes = (t, e) => this.adjustOffset(t.set("minute", e)), this.setSeconds = (t, e) => this.adjustOffset(t.set("second", e)), this.setMilliseconds = (t, e) => this.adjustOffset(t.set("millisecond", e)), this.getDaysInMonth = (t) => t.daysInMonth(), this.getWeekArray = (t) => {
|
|
671
|
-
const e = this.startOfWeek(this.startOfMonth(t)), r = this.endOfWeek(this.endOfMonth(t));
|
|
672
|
-
let a = 0, u = e;
|
|
673
|
-
const s = [];
|
|
674
|
-
for (; u < r; ) {
|
|
675
|
-
const d = Math.floor(a / 7);
|
|
676
|
-
s[d] = s[d] || [], s[d].push(u), u = this.addDays(u, 1), a += 1;
|
|
677
|
-
}
|
|
678
|
-
return s;
|
|
679
|
-
}, this.getWeekNumber = (t) => t.week(), this.getYearRange = ([t, e]) => {
|
|
680
|
-
const r = this.startOfYear(t), a = this.endOfYear(e), u = [];
|
|
681
|
-
let s = r;
|
|
682
|
-
for (; this.isBefore(s, a); )
|
|
683
|
-
u.push(s), s = this.addYears(s, 1);
|
|
684
|
-
return u;
|
|
685
|
-
}, this.dayjs = Ae(j, o), this.locale = o, this.formats = dt({}, ze, i), j.extend(xe);
|
|
686
|
-
}
|
|
687
|
-
getDayOfWeek(o) {
|
|
688
|
-
return o.day() + 1;
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
const Be = ({
|
|
692
|
-
name: n,
|
|
693
|
-
required: o,
|
|
694
|
-
minDate: i,
|
|
695
|
-
maxDate: t,
|
|
696
|
-
validateOptions: e,
|
|
697
|
-
...r
|
|
698
|
-
}) => {
|
|
699
|
-
const a = n.split(".");
|
|
700
|
-
function u(c) {
|
|
701
|
-
return c.locale("en-gb").format("L");
|
|
702
|
-
}
|
|
703
|
-
let s = Zt();
|
|
704
|
-
o && (s = s.required()), i && (s = s.min(
|
|
705
|
-
i,
|
|
706
|
-
`this field must be after or equal to ${u(i)}`
|
|
707
|
-
)), t && (s = s.max(
|
|
708
|
-
t,
|
|
709
|
-
`this field must be before or equal to ${u(t)}`
|
|
710
|
-
));
|
|
711
|
-
const d = {
|
|
712
|
-
name: n,
|
|
713
|
-
type: "date",
|
|
714
|
-
validate: H(s, e)
|
|
715
|
-
};
|
|
716
|
-
return /* @__PURE__ */ l.jsx($, { ...d, children: ({ form: c }) => {
|
|
717
|
-
const g = D(c.errors, a), y = D(c.touched, a);
|
|
718
|
-
let M = D(
|
|
719
|
-
c.values,
|
|
720
|
-
a
|
|
721
|
-
);
|
|
722
|
-
M = M ? j(M) : null;
|
|
723
|
-
function Y(T) {
|
|
724
|
-
c.setFieldValue(
|
|
725
|
-
n,
|
|
726
|
-
T && T.isValid() ? T.format("YYYY-MM-DD") : null,
|
|
727
|
-
!0
|
|
728
|
-
);
|
|
729
|
-
}
|
|
730
|
-
return /* @__PURE__ */ l.jsx(
|
|
731
|
-
re,
|
|
732
|
-
{
|
|
733
|
-
dateAdapter: Ee,
|
|
734
|
-
adapterLocale: "en-gb",
|
|
735
|
-
children: /* @__PURE__ */ l.jsx(
|
|
736
|
-
se,
|
|
737
|
-
{
|
|
738
|
-
name: n,
|
|
739
|
-
value: M,
|
|
740
|
-
minDate: i,
|
|
741
|
-
maxDate: t,
|
|
742
|
-
onChange: Y,
|
|
743
|
-
slotProps: {
|
|
744
|
-
textField: {
|
|
745
|
-
id: n,
|
|
746
|
-
onChange: (T) => {
|
|
747
|
-
Y(T);
|
|
748
|
-
},
|
|
749
|
-
onBlur: c.handleBlur,
|
|
750
|
-
required: o,
|
|
751
|
-
error: y && !!g,
|
|
752
|
-
helperText: y && g
|
|
753
|
-
}
|
|
754
|
-
},
|
|
755
|
-
...r
|
|
756
|
-
}
|
|
757
|
-
)
|
|
758
|
-
}
|
|
759
|
-
);
|
|
760
|
-
} });
|
|
761
|
-
}, W = ({
|
|
762
|
-
id: n,
|
|
763
|
-
name: o,
|
|
764
|
-
schema: i,
|
|
765
|
-
type: t = "text",
|
|
766
|
-
required: e = !1,
|
|
767
|
-
dirty: r = !1,
|
|
768
|
-
unique: a = !1,
|
|
769
|
-
uniqueCaseInsensitive: u = !1,
|
|
770
|
-
split: s,
|
|
771
|
-
validateOptions: d,
|
|
772
|
-
...c
|
|
773
|
-
}) => {
|
|
774
|
-
const [g, y] = U(""), M = o.split(".");
|
|
775
|
-
function Y() {
|
|
776
|
-
let h = i;
|
|
777
|
-
if (h = e ? h.required() : h.optional(), r && !s && (h = h.notOneOf(
|
|
778
|
-
[g],
|
|
779
|
-
"cannot be initial value"
|
|
780
|
-
)), !s) return h;
|
|
781
|
-
let m = Xt().of(h);
|
|
782
|
-
return m = e ? m.required().min(1) : m.optional(), (a || u) && (m = m.test({
|
|
783
|
-
message: "cannot have duplicates",
|
|
784
|
-
test: (p) => Array.isArray(p) && p.length >= 2 && p.every((x) => typeof x == "string") ? new Set(
|
|
785
|
-
u ? p.map((x) => x.toLowerCase()) : p
|
|
786
|
-
).size === p.length : !0
|
|
787
|
-
})), r && (m = m.notOneOf(
|
|
788
|
-
[g],
|
|
789
|
-
"cannot be initial value"
|
|
790
|
-
)), m;
|
|
791
|
-
}
|
|
792
|
-
const T = {
|
|
793
|
-
name: o,
|
|
794
|
-
type: t,
|
|
795
|
-
validate: H(Y(), d)
|
|
796
|
-
}, f = ({ form: h }) => {
|
|
797
|
-
const m = D(
|
|
798
|
-
h.initialValues,
|
|
799
|
-
M
|
|
800
|
-
), p = D(
|
|
801
|
-
h.values,
|
|
802
|
-
M
|
|
803
|
-
), x = D(h.errors, M), O = D(h.touched, M);
|
|
804
|
-
return I(() => {
|
|
805
|
-
y(m);
|
|
806
|
-
}, [m]), I(() => {
|
|
807
|
-
h.setFieldValue(
|
|
808
|
-
o,
|
|
809
|
-
s && typeof p == "string" ? p.split(s) : p,
|
|
810
|
-
!0
|
|
811
|
-
);
|
|
812
|
-
}, [p]), /* @__PURE__ */ l.jsx(
|
|
813
|
-
ft,
|
|
814
|
-
{
|
|
815
|
-
id: n ?? o,
|
|
816
|
-
name: o,
|
|
817
|
-
type: t,
|
|
818
|
-
required: e,
|
|
819
|
-
value: p,
|
|
820
|
-
onChange: h.handleChange,
|
|
821
|
-
onBlur: h.handleBlur,
|
|
822
|
-
error: O && !!x,
|
|
823
|
-
helperText: O && x,
|
|
824
|
-
...c
|
|
825
|
-
}
|
|
826
|
-
);
|
|
827
|
-
};
|
|
828
|
-
return /* @__PURE__ */ l.jsx($, { ...T, children: f });
|
|
829
|
-
}, _e = ({
|
|
830
|
-
name: n = "email",
|
|
831
|
-
label: o = "Email address",
|
|
832
|
-
placeholder: i = "Enter your email address",
|
|
833
|
-
InputProps: t = {},
|
|
834
|
-
...e
|
|
835
|
-
}) => /* @__PURE__ */ l.jsx(
|
|
836
|
-
W,
|
|
837
|
-
{
|
|
838
|
-
type: "email",
|
|
839
|
-
schema: V().email(),
|
|
840
|
-
name: n,
|
|
841
|
-
label: o,
|
|
842
|
-
placeholder: i,
|
|
843
|
-
InputProps: {
|
|
844
|
-
endAdornment: /* @__PURE__ */ l.jsx(mt, { position: "end", children: /* @__PURE__ */ l.jsx(ne, {}) }),
|
|
845
|
-
...t
|
|
846
|
-
},
|
|
847
|
-
...e
|
|
848
|
-
}
|
|
849
|
-
), $e = ({
|
|
850
|
-
name: n = "first_name",
|
|
851
|
-
label: o = "First name",
|
|
852
|
-
placeholder: i = "Enter your first name",
|
|
853
|
-
InputProps: t = {},
|
|
854
|
-
...e
|
|
855
|
-
}) => /* @__PURE__ */ l.jsx(
|
|
856
|
-
W,
|
|
857
|
-
{
|
|
858
|
-
schema: ue.first_name,
|
|
859
|
-
name: n,
|
|
860
|
-
label: o,
|
|
861
|
-
placeholder: i,
|
|
862
|
-
InputProps: {
|
|
863
|
-
endAdornment: /* @__PURE__ */ l.jsx(mt, { position: "end", children: /* @__PURE__ */ l.jsx(ie, {}) }),
|
|
864
|
-
...t
|
|
865
|
-
},
|
|
866
|
-
...e
|
|
867
|
-
}
|
|
868
|
-
), bt = {
|
|
869
|
-
behavior: "smooth",
|
|
870
|
-
block: "start"
|
|
871
|
-
}, Ue = ({
|
|
872
|
-
scrollIntoViewOptions: n = bt,
|
|
873
|
-
...o
|
|
874
|
-
}) => {
|
|
875
|
-
const i = Vt(null);
|
|
876
|
-
return I(() => {
|
|
877
|
-
i.current && i.current.scrollIntoView(n);
|
|
878
|
-
}, [n]), /* @__PURE__ */ l.jsx(wt, { ref: i, error: !0, ...o });
|
|
879
|
-
}, Lt = ({
|
|
880
|
-
children: n,
|
|
881
|
-
scrollIntoViewOptions: o = bt,
|
|
882
|
-
nonFieldErrorsProps: i,
|
|
883
|
-
fieldRefs: t = [],
|
|
884
|
-
...e
|
|
885
|
-
}) => /* @__PURE__ */ l.jsx(Wt, { ...e, children: (r) => {
|
|
886
|
-
const a = !!Object.keys(r.errors).length, u = a && typeof r.errors.__all__ == "string";
|
|
887
|
-
if (a && !u && r.isSubmitting && t.length) {
|
|
888
|
-
const s = te(r.errors), d = t.find(({ name: c }) => s.includes(c))?.inputRef.current;
|
|
889
|
-
d && d.scrollIntoView(o);
|
|
890
|
-
}
|
|
891
|
-
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
892
|
-
u && /* @__PURE__ */ l.jsx(Ue, { ...i, children: r.errors.__all__ }),
|
|
893
|
-
/* @__PURE__ */ l.jsx(qt, { children: typeof n == "function" ? n(r) : n })
|
|
894
|
-
] });
|
|
895
|
-
} }), Ie = ({
|
|
896
|
-
useMutation: n,
|
|
897
|
-
submitOptions: o,
|
|
898
|
-
...i
|
|
899
|
-
}) => {
|
|
900
|
-
const [t] = n();
|
|
901
|
-
return /* @__PURE__ */ l.jsx(
|
|
902
|
-
Lt,
|
|
903
|
-
{
|
|
904
|
-
...i,
|
|
905
|
-
onSubmit: Qt(
|
|
906
|
-
t,
|
|
907
|
-
i.initialValues,
|
|
908
|
-
o
|
|
909
|
-
)
|
|
910
|
-
}
|
|
911
|
-
);
|
|
912
|
-
}, Ve = (n) => "onSubmit" in n ? /* @__PURE__ */ l.jsx(Lt, { ...n }) : Ie(n), He = ({
|
|
913
|
-
name: n = "otp",
|
|
914
|
-
label: o = "OTP",
|
|
915
|
-
placeholder: i = "Enter your OTP",
|
|
916
|
-
...t
|
|
917
|
-
}) => /* @__PURE__ */ l.jsx(
|
|
918
|
-
W,
|
|
919
|
-
{
|
|
920
|
-
name: n,
|
|
921
|
-
label: o,
|
|
922
|
-
schema: V().matches(/^[0-9]{6}$/, "Must be exactly 6 digits."),
|
|
923
|
-
placeholder: i,
|
|
924
|
-
required: !0,
|
|
925
|
-
...t
|
|
926
|
-
}
|
|
927
|
-
), Ne = ({
|
|
928
|
-
id: n,
|
|
929
|
-
repeatName: o,
|
|
930
|
-
setValue: i,
|
|
931
|
-
fieldProps: t,
|
|
932
|
-
name: e,
|
|
933
|
-
label: r,
|
|
934
|
-
placeholder: a,
|
|
935
|
-
type: u,
|
|
936
|
-
...s
|
|
937
|
-
}) => {
|
|
938
|
-
const { form: d } = t, c = e.split("."), g = D(d.values, c), y = o.split("."), M = D(
|
|
939
|
-
d.values,
|
|
940
|
-
y
|
|
941
|
-
), Y = D(
|
|
942
|
-
d.touched,
|
|
943
|
-
y
|
|
944
|
-
), T = D(d.errors, y);
|
|
945
|
-
return I(() => {
|
|
946
|
-
i(g);
|
|
947
|
-
}, [i, g]), /* @__PURE__ */ l.jsx(
|
|
948
|
-
ft,
|
|
949
|
-
{
|
|
950
|
-
required: !0,
|
|
951
|
-
type: u,
|
|
952
|
-
label: r ?? `Repeat ${e.replace("_", " ")}`,
|
|
953
|
-
placeholder: a ?? `Enter your ${e.replace("_", " ")} again`,
|
|
954
|
-
id: n ?? o,
|
|
955
|
-
name: o,
|
|
956
|
-
value: M,
|
|
957
|
-
onChange: d.handleChange,
|
|
958
|
-
onBlur: d.handleBlur,
|
|
959
|
-
error: Y && !!T,
|
|
960
|
-
helperText: Y && T,
|
|
961
|
-
...s
|
|
962
|
-
}
|
|
963
|
-
);
|
|
964
|
-
}, Ct = ({
|
|
965
|
-
name: n,
|
|
966
|
-
type: o = "text",
|
|
967
|
-
validateOptions: i,
|
|
968
|
-
...t
|
|
969
|
-
}) => {
|
|
970
|
-
const [e, r] = U(""), a = `${n}_repeat`, u = {
|
|
971
|
-
name: a,
|
|
972
|
-
type: o,
|
|
973
|
-
validate: H(
|
|
974
|
-
V().required().equals([e], "does not match"),
|
|
975
|
-
i
|
|
976
|
-
)
|
|
977
|
-
};
|
|
978
|
-
return /* @__PURE__ */ l.jsx($, { ...u, children: (s) => /* @__PURE__ */ l.jsx(
|
|
979
|
-
Ne,
|
|
980
|
-
{
|
|
981
|
-
name: n,
|
|
982
|
-
type: o,
|
|
983
|
-
repeatName: a,
|
|
984
|
-
setValue: r,
|
|
985
|
-
fieldProps: s,
|
|
986
|
-
...t
|
|
987
|
-
}
|
|
988
|
-
) });
|
|
989
|
-
}, We = ({
|
|
990
|
-
name: n = "password",
|
|
991
|
-
label: o = "Password",
|
|
992
|
-
placeholder: i = "Enter your password",
|
|
993
|
-
schema: t = V(),
|
|
994
|
-
InputProps: e = {},
|
|
995
|
-
withRepeatField: r = !1,
|
|
996
|
-
repeatFieldProps: a = {},
|
|
997
|
-
...u
|
|
998
|
-
}) => {
|
|
999
|
-
const [s, d] = U(!1), c = s ? "text" : "password", g = /* @__PURE__ */ l.jsx(mt, { position: "end", children: /* @__PURE__ */ l.jsx(
|
|
1000
|
-
$t,
|
|
1001
|
-
{
|
|
1002
|
-
onClick: () => {
|
|
1003
|
-
d((y) => !y);
|
|
1004
|
-
},
|
|
1005
|
-
edge: "end",
|
|
1006
|
-
children: s ? /* @__PURE__ */ l.jsx(oe, {}) : /* @__PURE__ */ l.jsx(ae, {})
|
|
1007
|
-
}
|
|
1008
|
-
) });
|
|
1009
|
-
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
1010
|
-
/* @__PURE__ */ l.jsx(
|
|
1011
|
-
W,
|
|
1012
|
-
{
|
|
1013
|
-
autoComplete: "off",
|
|
1014
|
-
type: c,
|
|
1015
|
-
name: n,
|
|
1016
|
-
label: o,
|
|
1017
|
-
schema: t,
|
|
1018
|
-
placeholder: i,
|
|
1019
|
-
InputProps: { endAdornment: g, ...e },
|
|
1020
|
-
...u
|
|
1021
|
-
}
|
|
1022
|
-
),
|
|
1023
|
-
r && /* @__PURE__ */ l.jsx(
|
|
1024
|
-
Ct,
|
|
1025
|
-
{
|
|
1026
|
-
name: n,
|
|
1027
|
-
type: c,
|
|
1028
|
-
...a,
|
|
1029
|
-
InputProps: { endAdornment: g, ...a.InputProps }
|
|
1030
|
-
}
|
|
1031
|
-
)
|
|
1032
|
-
] });
|
|
1033
|
-
}, qe = ({
|
|
1034
|
-
children: n = "Submit",
|
|
1035
|
-
...o
|
|
1036
|
-
}) => {
|
|
1037
|
-
function i(t, e) {
|
|
1038
|
-
e = e || {};
|
|
1039
|
-
for (const r in t) {
|
|
1040
|
-
const a = t[r];
|
|
1041
|
-
e[r] = a instanceof Object && a.constructor === Object ? i(a, e) : !0;
|
|
1042
|
-
}
|
|
1043
|
-
return e;
|
|
1044
|
-
}
|
|
1045
|
-
return /* @__PURE__ */ l.jsx($, { name: "submit", type: "submit", children: ({ form: t }) => /* @__PURE__ */ l.jsx(
|
|
1046
|
-
Dt,
|
|
1047
|
-
{
|
|
1048
|
-
type: "button",
|
|
1049
|
-
onClick: () => {
|
|
1050
|
-
t.setTouched(i(t.values), !0).then((e) => {
|
|
1051
|
-
const r = !!(e && Object.keys(e).length);
|
|
1052
|
-
t.setSubmitting(r), r || t.submitForm();
|
|
1053
|
-
});
|
|
1054
|
-
},
|
|
1055
|
-
...o,
|
|
1056
|
-
children: n
|
|
1057
|
-
}
|
|
1058
|
-
) });
|
|
1059
|
-
}, Re = ({
|
|
1060
|
-
textFieldProps: n,
|
|
1061
|
-
...o
|
|
1062
|
-
}) => {
|
|
1063
|
-
const {
|
|
1064
|
-
name: i = "uk_county",
|
|
1065
|
-
label: t = "UK county",
|
|
1066
|
-
placeholder: e = "Select your UK county",
|
|
1067
|
-
...r
|
|
1068
|
-
} = n || {};
|
|
1069
|
-
return /* @__PURE__ */ l.jsx(
|
|
1070
|
-
rt,
|
|
1071
|
-
{
|
|
1072
|
-
options: ee,
|
|
1073
|
-
textFieldProps: { name: i, label: t, placeholder: e, ...r },
|
|
1074
|
-
...o
|
|
1075
|
-
}
|
|
1076
|
-
);
|
|
1077
|
-
}, fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1078
|
-
__proto__: null,
|
|
1079
|
-
ApiAutocompleteField: ce,
|
|
1080
|
-
AutocompleteField: rt,
|
|
1081
|
-
CheckboxField: he,
|
|
1082
|
-
CountryField: le,
|
|
1083
|
-
DatePickerField: Be,
|
|
1084
|
-
EmailField: _e,
|
|
1085
|
-
FirstNameField: $e,
|
|
1086
|
-
Form: Ve,
|
|
1087
|
-
OtpField: He,
|
|
1088
|
-
PasswordField: We,
|
|
1089
|
-
RepeatField: Ct,
|
|
1090
|
-
SubmitButton: qe,
|
|
1091
|
-
TextField: W,
|
|
1092
|
-
UkCountyField: Re
|
|
1093
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1094
|
-
export {
|
|
1095
|
-
ce as A,
|
|
1096
|
-
he as C,
|
|
1097
|
-
Be as D,
|
|
1098
|
-
_e as E,
|
|
1099
|
-
$e as F,
|
|
1100
|
-
He as O,
|
|
1101
|
-
We as P,
|
|
1102
|
-
Ct as R,
|
|
1103
|
-
qe as S,
|
|
1104
|
-
W as T,
|
|
1105
|
-
Re as U,
|
|
1106
|
-
rt as a,
|
|
1107
|
-
le as b,
|
|
1108
|
-
Ve as c,
|
|
1109
|
-
fr as i
|
|
1110
|
-
};
|
|
1111
|
-
//# sourceMappingURL=index-C-3iPCa4.js.map
|