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