finform-react-builder 1.5.4 → 1.5.5
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/dist/index.es.js +851 -839
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,18 +2,18 @@ var Ta = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var fi = (e, t, r) => t.has(e) || Ta("Cannot " + r);
|
|
5
|
-
var v = (e, t, r) => (fi(e, t, "read from private field"), r ? r.call(e) : t.get(e)), ae = (e, t, r) => t.has(e) ? Ta("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r),
|
|
5
|
+
var v = (e, t, r) => (fi(e, t, "read from private field"), r ? r.call(e) : t.get(e)), ae = (e, t, r) => t.has(e) ? Ta("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), Z = (e, t, r, n) => (fi(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r), de = (e, t, r) => (fi(e, t, "access private method"), r);
|
|
6
6
|
var bn = (e, t, r, n) => ({
|
|
7
7
|
set _(i) {
|
|
8
|
-
|
|
8
|
+
Z(e, t, i, r);
|
|
9
9
|
},
|
|
10
10
|
get _() {
|
|
11
11
|
return v(e, t, n);
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
import { jsx as
|
|
14
|
+
import { jsx as $, jsxs as Oe, Fragment as kl } from "react/jsx-runtime";
|
|
15
15
|
import * as Ae from "react";
|
|
16
|
-
import ge, { useMemo as
|
|
16
|
+
import ge, { useMemo as ze, useState as Xt, useRef as xt, useCallback as Pe, useEffect as wt, createElement as io, useReducer as Ol, forwardRef as Tl, useImperativeHandle as _l, Fragment as Cl } from "react";
|
|
17
17
|
import { Box as Se, TextField as wn, Autocomplete as Al, CircularProgress as _r, Chip as zn, Checkbox as _a, FormControlLabel as Sn, Switch as Fl, FormHelperText as Hr, FormControl as mi, Typography as Me, RadioGroup as Ca, Radio as Aa, InputLabel as $l, Select as Dl, MenuItem as En, Stepper as Rl, Step as Pl, StepLabel as jl, Button as Bt, ButtonGroup as Il, createTheme as Ml, ThemeProvider as zl, Paper as ao, Tooltip as Vl, IconButton as Nl, Alert as Ll } from "@mui/material";
|
|
18
18
|
import ql from "@emotion/styled";
|
|
19
19
|
import "@emotion/react";
|
|
@@ -40,7 +40,7 @@ function Ie(e) {
|
|
|
40
40
|
return e;
|
|
41
41
|
return t;
|
|
42
42
|
}
|
|
43
|
-
var ti = (e) => /^\w*$/.test(e), Fe = (e) => e === void 0, aa = (e) => Array.isArray(e) ? e.filter(Boolean) : [], sa = (e) => aa(e.replace(/["|']|\]/g, "").split(/\.|\[/)),
|
|
43
|
+
var ti = (e) => /^\w*$/.test(e), Fe = (e) => e === void 0, aa = (e) => Array.isArray(e) ? e.filter(Boolean) : [], sa = (e) => aa(e.replace(/["|']|\]/g, "").split(/\.|\[/)), q = (e, t, r) => {
|
|
44
44
|
if (!t || !$e(e))
|
|
45
45
|
return r;
|
|
46
46
|
const n = (ti(t) ? [t] : sa(t)).reduce((i, a) => Ue(i) ? i : i[a], e);
|
|
@@ -120,7 +120,7 @@ function Wl(e) {
|
|
|
120
120
|
l.current.isValid && r._setValid(!0);
|
|
121
121
|
}, [r]), ge.useMemo(() => uo(s, r, l.current, !1), [s, r]);
|
|
122
122
|
}
|
|
123
|
-
var bt = (e) => typeof e == "string", po = (e, t, r, n, i) => bt(e) ? (n && t.watch.add(e),
|
|
123
|
+
var bt = (e) => typeof e == "string", po = (e, t, r, n, i) => bt(e) ? (n && t.watch.add(e), q(r, e, i)) : Array.isArray(e) ? e.map((a) => (n && t.watch.add(a), q(r, a))) : (n && (t.watchAll = !0), r);
|
|
124
124
|
function Hl(e) {
|
|
125
125
|
const t = oa(), { control: r = t.control, name: n, defaultValue: i, disabled: a, exact: s } = e || {}, o = ge.useRef(i), [l, p] = ge.useState(r._getWatch(n, o.current));
|
|
126
126
|
return la(() => r._subscribe({
|
|
@@ -136,7 +136,7 @@ function Kl(e) {
|
|
|
136
136
|
const t = oa(), { name: r, disabled: n, control: i = t.control, shouldUnregister: a } = e, s = lo(i._names.array, r), o = Hl({
|
|
137
137
|
control: i,
|
|
138
138
|
name: r,
|
|
139
|
-
defaultValue:
|
|
139
|
+
defaultValue: q(i._formValues, r, q(i._defaultValues, r, e.defaultValue)),
|
|
140
140
|
exact: !0
|
|
141
141
|
}), l = Wl({
|
|
142
142
|
control: i,
|
|
@@ -149,23 +149,23 @@ function Kl(e) {
|
|
|
149
149
|
})), f = ge.useMemo(() => Object.defineProperties({}, {
|
|
150
150
|
invalid: {
|
|
151
151
|
enumerable: !0,
|
|
152
|
-
get: () => !!
|
|
152
|
+
get: () => !!q(l.errors, r)
|
|
153
153
|
},
|
|
154
154
|
isDirty: {
|
|
155
155
|
enumerable: !0,
|
|
156
|
-
get: () => !!
|
|
156
|
+
get: () => !!q(l.dirtyFields, r)
|
|
157
157
|
},
|
|
158
158
|
isTouched: {
|
|
159
159
|
enumerable: !0,
|
|
160
|
-
get: () => !!
|
|
160
|
+
get: () => !!q(l.touchedFields, r)
|
|
161
161
|
},
|
|
162
162
|
isValidating: {
|
|
163
163
|
enumerable: !0,
|
|
164
|
-
get: () => !!
|
|
164
|
+
get: () => !!q(l.validatingFields, r)
|
|
165
165
|
},
|
|
166
166
|
error: {
|
|
167
167
|
enumerable: !0,
|
|
168
|
-
get: () =>
|
|
168
|
+
get: () => q(l.errors, r)
|
|
169
169
|
}
|
|
170
170
|
}), [l, r]), m = ge.useCallback((x) => d.current.onChange({
|
|
171
171
|
target: {
|
|
@@ -175,12 +175,12 @@ function Kl(e) {
|
|
|
175
175
|
type: Vn.CHANGE
|
|
176
176
|
}), [r]), b = ge.useCallback(() => d.current.onBlur({
|
|
177
177
|
target: {
|
|
178
|
-
value:
|
|
178
|
+
value: q(i._formValues, r),
|
|
179
179
|
name: r
|
|
180
180
|
},
|
|
181
181
|
type: Vn.BLUR
|
|
182
182
|
}), [r, i._formValues]), h = ge.useCallback((x) => {
|
|
183
|
-
const y =
|
|
183
|
+
const y = q(i._fields, r);
|
|
184
184
|
y && x && (y._f.ref = {
|
|
185
185
|
focus: () => x.focus && x.focus(),
|
|
186
186
|
select: () => x.select && x.select(),
|
|
@@ -202,12 +202,12 @@ function Kl(e) {
|
|
|
202
202
|
...Ye(p.current.disabled) ? { disabled: p.current.disabled } : {}
|
|
203
203
|
});
|
|
204
204
|
const y = (O, F) => {
|
|
205
|
-
const C =
|
|
205
|
+
const C = q(i._fields, O);
|
|
206
206
|
C && C._f && (C._f.mount = F);
|
|
207
207
|
};
|
|
208
208
|
if (y(r, !0), x) {
|
|
209
|
-
const O = Ie(
|
|
210
|
-
he(i._defaultValues, r, O), Fe(
|
|
209
|
+
const O = Ie(q(i._options.defaultValues, r));
|
|
210
|
+
he(i._defaultValues, r, O), Fe(q(i._formValues, r)) && he(i._formValues, r, O);
|
|
211
211
|
}
|
|
212
212
|
return !s && i.register(r), () => {
|
|
213
213
|
(s ? x && !i._state.action : x) ? i.unregister(r) : y(r, !1);
|
|
@@ -346,7 +346,7 @@ function Pa(e) {
|
|
|
346
346
|
var Zl = (e, t, r, n) => {
|
|
347
347
|
const i = {};
|
|
348
348
|
for (const a of e) {
|
|
349
|
-
const s =
|
|
349
|
+
const s = q(t, a);
|
|
350
350
|
s && he(i, a, s._f);
|
|
351
351
|
}
|
|
352
352
|
return {
|
|
@@ -366,7 +366,7 @@ const Ia = "AsyncFunction";
|
|
|
366
366
|
var Jl = (e) => !!e && !!e.validate && !!(ct(e.validate) && e.validate.constructor.name === Ia || $e(e.validate) && Object.values(e.validate).find((t) => t.constructor.name === Ia)), Xl = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Ma = (e, t, r) => !r && (t.watchAll || t.watch.has(e) || [...t.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
|
|
367
367
|
const tn = (e, t, r, n) => {
|
|
368
368
|
for (const i of r || Object.keys(e)) {
|
|
369
|
-
const a =
|
|
369
|
+
const a = q(e, i);
|
|
370
370
|
if (a) {
|
|
371
371
|
const { _f: s, ...o } = a;
|
|
372
372
|
if (s) {
|
|
@@ -382,7 +382,7 @@ const tn = (e, t, r, n) => {
|
|
|
382
382
|
}
|
|
383
383
|
};
|
|
384
384
|
function za(e, t, r) {
|
|
385
|
-
const n =
|
|
385
|
+
const n = q(e, r);
|
|
386
386
|
if (n || ti(r))
|
|
387
387
|
return {
|
|
388
388
|
error: n,
|
|
@@ -390,7 +390,7 @@ function za(e, t, r) {
|
|
|
390
390
|
};
|
|
391
391
|
const i = r.split(".");
|
|
392
392
|
for (; i.length; ) {
|
|
393
|
-
const a = i.join("."), s =
|
|
393
|
+
const a = i.join("."), s = q(t, a), o = q(e, a);
|
|
394
394
|
if (s && !Array.isArray(s) && r !== a)
|
|
395
395
|
return { name: r };
|
|
396
396
|
if (o && o.type)
|
|
@@ -413,8 +413,8 @@ var ec = (e, t, r, n) => {
|
|
|
413
413
|
r(e);
|
|
414
414
|
const { name: i, ...a } = e;
|
|
415
415
|
return Ke(a) || Object.keys(a).length >= Object.keys(t).length || Object.keys(a).find((s) => t[s] === (!n || lt.all));
|
|
416
|
-
}, tc = (e, t, r) => !e || !t || e === t || en(e).some((n) => n && (r ? n === t : n.startsWith(t) || t.startsWith(n))), rc = (e, t, r, n, i) => i.isOnAll ? !1 : !r && i.isOnTouch ? !(t || e) : (r ? n.isOnBlur : i.isOnBlur) ? !e : (r ? n.isOnChange : i.isOnChange) ? e : !0, nc = (e, t) => !aa(
|
|
417
|
-
const n = en(
|
|
416
|
+
}, tc = (e, t, r) => !e || !t || e === t || en(e).some((n) => n && (r ? n === t : n.startsWith(t) || t.startsWith(n))), rc = (e, t, r, n, i) => i.isOnAll ? !1 : !r && i.isOnTouch ? !(t || e) : (r ? n.isOnBlur : i.isOnBlur) ? !e : (r ? n.isOnChange : i.isOnChange) ? e : !0, nc = (e, t) => !aa(q(e, t)).length && Re(e, t), ic = (e, t, r) => {
|
|
417
|
+
const n = en(q(e, r));
|
|
418
418
|
return he(n, "root", t[r]), he(e, r, n), e;
|
|
419
419
|
}, Pn = (e) => bt(e);
|
|
420
420
|
function Va(e, t, r = "validate") {
|
|
@@ -429,21 +429,21 @@ var vr = (e) => $e(e) && !qn(e) ? e : {
|
|
|
429
429
|
value: e,
|
|
430
430
|
message: ""
|
|
431
431
|
}, Na = async (e, t, r, n, i, a) => {
|
|
432
|
-
const { ref: s, refs: o, required: l, maxLength: p, minLength: d, min: f, max: m, pattern: b, validate: h, name: c, valueAsNumber: x, mount: y } = e._f, O =
|
|
432
|
+
const { ref: s, refs: o, required: l, maxLength: p, minLength: d, min: f, max: m, pattern: b, validate: h, name: c, valueAsNumber: x, mount: y } = e._f, O = q(r, c);
|
|
433
433
|
if (!y || t.has(c))
|
|
434
434
|
return {};
|
|
435
435
|
const F = o ? o[0] : s, C = (k) => {
|
|
436
436
|
i && F.reportValidity && (F.setCustomValidity(Ye(k) ? "" : k || ""), F.reportValidity());
|
|
437
|
-
}, w = {}, M = ua(s), G = pn(s),
|
|
438
|
-
const se = k ? P :
|
|
437
|
+
}, w = {}, M = ua(s), G = pn(s), J = M || G, H = (x || ca(s)) && Fe(s.value) && Fe(O) || Nn(s) && s.value === "" || O === "" || Array.isArray(O) && !O.length, u = fo.bind(null, c, n, w), D = (k, P, z, V = St.maxLength, L = St.minLength) => {
|
|
438
|
+
const se = k ? P : z;
|
|
439
439
|
w[c] = {
|
|
440
|
-
type: k ? V :
|
|
440
|
+
type: k ? V : L,
|
|
441
441
|
message: se,
|
|
442
442
|
ref: s,
|
|
443
|
-
...u(k ? V :
|
|
443
|
+
...u(k ? V : L, se)
|
|
444
444
|
};
|
|
445
445
|
};
|
|
446
|
-
if (a ? !Array.isArray(O) || !O.length : l && (!
|
|
446
|
+
if (a ? !Array.isArray(O) || !O.length : l && (!J && (H || Ue(O)) || Ye(O) && !O || G && !yo(o).isValid || M && !xo(o).isValid)) {
|
|
447
447
|
const { value: k, message: P } = Pn(l) ? { value: !!l, message: l } : vr(l);
|
|
448
448
|
if (k && (w[c] = {
|
|
449
449
|
type: St.required,
|
|
@@ -455,20 +455,20 @@ var vr = (e) => $e(e) && !qn(e) ? e : {
|
|
|
455
455
|
}
|
|
456
456
|
if (!H && (!Ue(f) || !Ue(m))) {
|
|
457
457
|
let k, P;
|
|
458
|
-
const
|
|
458
|
+
const z = vr(m), V = vr(f);
|
|
459
459
|
if (!Ue(O) && !isNaN(O)) {
|
|
460
|
-
const
|
|
461
|
-
Ue(
|
|
460
|
+
const L = s.valueAsNumber || O && +O;
|
|
461
|
+
Ue(z.value) || (k = L > z.value), Ue(V.value) || (P = L < V.value);
|
|
462
462
|
} else {
|
|
463
|
-
const
|
|
464
|
-
bt(
|
|
463
|
+
const L = s.valueAsDate || new Date(O), se = (j) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + j), ce = s.type == "time", ue = s.type == "week";
|
|
464
|
+
bt(z.value) && O && (k = ce ? se(O) > se(z.value) : ue ? O > z.value : L > new Date(z.value)), bt(V.value) && O && (P = ce ? se(O) < se(V.value) : ue ? O < V.value : L < new Date(V.value));
|
|
465
465
|
}
|
|
466
|
-
if ((k || P) && (
|
|
466
|
+
if ((k || P) && (D(!!k, z.message, V.message, St.max, St.min), !n))
|
|
467
467
|
return C(w[c].message), w;
|
|
468
468
|
}
|
|
469
469
|
if ((p || d) && !H && (bt(O) || a && Array.isArray(O))) {
|
|
470
|
-
const k = vr(p), P = vr(d),
|
|
471
|
-
if ((
|
|
470
|
+
const k = vr(p), P = vr(d), z = !Ue(k.value) && O.length > +k.value, V = !Ue(P.value) && O.length < +P.value;
|
|
471
|
+
if ((z || V) && (D(z, k.message, P.message), !n))
|
|
472
472
|
return C(w[c].message), w;
|
|
473
473
|
}
|
|
474
474
|
if (b && !H && bt(O)) {
|
|
@@ -494,11 +494,11 @@ var vr = (e) => $e(e) && !qn(e) ? e : {
|
|
|
494
494
|
for (const P in h) {
|
|
495
495
|
if (!Ke(k) && !n)
|
|
496
496
|
break;
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
...
|
|
500
|
-
...u(P,
|
|
501
|
-
}, C(
|
|
497
|
+
const z = Va(await h[P](O, r), F, P);
|
|
498
|
+
z && (k = {
|
|
499
|
+
...z,
|
|
500
|
+
...u(P, z.message)
|
|
501
|
+
}, C(z.message), n && (w[c] = k));
|
|
502
502
|
}
|
|
503
503
|
if (!Ke(k) && (w[c] = {
|
|
504
504
|
ref: F,
|
|
@@ -579,21 +579,21 @@ function sc(e = {}) {
|
|
|
579
579
|
}));
|
|
580
580
|
}, y = (g, S = [], A, K, E = !0, T = !0) => {
|
|
581
581
|
if (K && A && !t.disabled) {
|
|
582
|
-
if (s.action = !0, T && Array.isArray(
|
|
583
|
-
const B = A(
|
|
582
|
+
if (s.action = !0, T && Array.isArray(q(n, g))) {
|
|
583
|
+
const B = A(q(n, g), K.argA, K.argB);
|
|
584
584
|
E && he(n, g, B);
|
|
585
585
|
}
|
|
586
|
-
if (T && Array.isArray(
|
|
587
|
-
const B = A(
|
|
586
|
+
if (T && Array.isArray(q(r.errors, g))) {
|
|
587
|
+
const B = A(q(r.errors, g), K.argA, K.argB);
|
|
588
588
|
E && he(r.errors, g, B), nc(r.errors, g);
|
|
589
589
|
}
|
|
590
|
-
if ((d.touchedFields || f.touchedFields) && T && Array.isArray(
|
|
591
|
-
const B = A(
|
|
590
|
+
if ((d.touchedFields || f.touchedFields) && T && Array.isArray(q(r.touchedFields, g))) {
|
|
591
|
+
const B = A(q(r.touchedFields, g), K.argA, K.argB);
|
|
592
592
|
E && he(r.touchedFields, g, B);
|
|
593
593
|
}
|
|
594
594
|
(d.dirtyFields || f.dirtyFields) && (r.dirtyFields = Kr(i, a)), m.state.next({
|
|
595
595
|
name: g,
|
|
596
|
-
isDirty:
|
|
596
|
+
isDirty: D(g, S),
|
|
597
597
|
dirtyFields: r.dirtyFields,
|
|
598
598
|
errors: r.errors,
|
|
599
599
|
isValid: r.isValid
|
|
@@ -610,10 +610,10 @@ function sc(e = {}) {
|
|
|
610
610
|
isValid: !1
|
|
611
611
|
});
|
|
612
612
|
}, C = (g, S, A, K) => {
|
|
613
|
-
const E =
|
|
613
|
+
const E = q(n, g);
|
|
614
614
|
if (E) {
|
|
615
|
-
const T =
|
|
616
|
-
Fe(T) || K && K.defaultChecked || S ? he(a, g, S ? T : Pa(E._f)) :
|
|
615
|
+
const T = q(a, g, Fe(A) ? q(i, g) : A);
|
|
616
|
+
Fe(T) || K && K.defaultChecked || S ? he(a, g, S ? T : Pa(E._f)) : z(g, T), s.mount && c();
|
|
617
617
|
}
|
|
618
618
|
}, w = (g, S, A, K, E) => {
|
|
619
619
|
let T = !1, B = !1;
|
|
@@ -622,19 +622,19 @@ function sc(e = {}) {
|
|
|
622
622
|
};
|
|
623
623
|
if (!t.disabled) {
|
|
624
624
|
if (!A || K) {
|
|
625
|
-
(d.isDirty || f.isDirty) && (B = r.isDirty, r.isDirty = ie.isDirty =
|
|
626
|
-
const
|
|
627
|
-
B = !!
|
|
625
|
+
(d.isDirty || f.isDirty) && (B = r.isDirty, r.isDirty = ie.isDirty = D(), T = B !== ie.isDirty);
|
|
626
|
+
const le = Pt(q(i, g), S);
|
|
627
|
+
B = !!q(r.dirtyFields, g), le ? Re(r.dirtyFields, g) : he(r.dirtyFields, g, !0), ie.dirtyFields = r.dirtyFields, T = T || (d.dirtyFields || f.dirtyFields) && B !== !le;
|
|
628
628
|
}
|
|
629
629
|
if (A) {
|
|
630
|
-
const
|
|
631
|
-
|
|
630
|
+
const le = q(r.touchedFields, g);
|
|
631
|
+
le || (he(r.touchedFields, g, A), ie.touchedFields = r.touchedFields, T = T || (d.touchedFields || f.touchedFields) && le !== A);
|
|
632
632
|
}
|
|
633
633
|
T && E && m.state.next(ie);
|
|
634
634
|
}
|
|
635
635
|
return T ? ie : {};
|
|
636
636
|
}, M = (g, S, A, K) => {
|
|
637
|
-
const E =
|
|
637
|
+
const E = q(r.errors, g), T = (d.isValid || f.isValid) && Ye(S) && r.isValid !== S;
|
|
638
638
|
if (t.delayError && A ? (l = h(() => O(g, A)), l(t.delayError)) : (clearTimeout(p), l = null, A ? he(r.errors, g, A) : Re(r.errors, g)), (A ? !Pt(E, A) : E) || !Ke(K) || T) {
|
|
639
639
|
const B = {
|
|
640
640
|
...K,
|
|
@@ -651,11 +651,11 @@ function sc(e = {}) {
|
|
|
651
651
|
x(g, !0);
|
|
652
652
|
const S = await t.resolver(a, t.context, Zl(g || o.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
|
|
653
653
|
return x(g), S;
|
|
654
|
-
},
|
|
654
|
+
}, J = async (g) => {
|
|
655
655
|
const { errors: S } = await G(g);
|
|
656
656
|
if (g)
|
|
657
657
|
for (const A of g) {
|
|
658
|
-
const K =
|
|
658
|
+
const K = q(S, A);
|
|
659
659
|
K ? he(r.errors, A, K) : Re(r.errors, A);
|
|
660
660
|
}
|
|
661
661
|
else
|
|
@@ -669,12 +669,12 @@ function sc(e = {}) {
|
|
|
669
669
|
if (E) {
|
|
670
670
|
const { _f: T, ...B } = E;
|
|
671
671
|
if (T) {
|
|
672
|
-
const ie = o.array.has(T.name),
|
|
673
|
-
|
|
672
|
+
const ie = o.array.has(T.name), le = E._f && Jl(E._f);
|
|
673
|
+
le && d.validatingFields && x([K], !0);
|
|
674
674
|
const je = await Na(E, o.disabled, a, b, t.shouldUseNativeValidation && !S, ie);
|
|
675
|
-
if (
|
|
675
|
+
if (le && d.validatingFields && x([K]), je[T.name] && (A.valid = !1, S))
|
|
676
676
|
break;
|
|
677
|
-
!S && (
|
|
677
|
+
!S && (q(je, T.name) ? ie ? ic(r.errors, je, T.name) : he(r.errors, T.name, je[T.name]) : Re(r.errors, T.name));
|
|
678
678
|
}
|
|
679
679
|
!Ke(B) && await H(B, S, A);
|
|
680
680
|
}
|
|
@@ -682,14 +682,14 @@ function sc(e = {}) {
|
|
|
682
682
|
return A.valid;
|
|
683
683
|
}, u = () => {
|
|
684
684
|
for (const g of o.unMount) {
|
|
685
|
-
const S =
|
|
686
|
-
S && (S._f.refs ? S._f.refs.every((A) => !hi(A)) : !hi(S._f.ref)) &&
|
|
685
|
+
const S = q(n, g);
|
|
686
|
+
S && (S._f.refs ? S._f.refs.every((A) => !hi(A)) : !hi(S._f.ref)) && X(g);
|
|
687
687
|
}
|
|
688
688
|
o.unMount = /* @__PURE__ */ new Set();
|
|
689
|
-
},
|
|
689
|
+
}, D = (g, S) => !t.disabled && (g && S && he(a, g, S), !Pt(j(), i)), k = (g, S, A) => po(g, o, {
|
|
690
690
|
...s.mount ? a : Fe(S) ? i : bt(g) ? { [g]: S } : S
|
|
691
|
-
}, A, S), P = (g) => aa(
|
|
692
|
-
const K =
|
|
691
|
+
}, A, S), P = (g) => aa(q(s.mount ? a : i, g, t.shouldUnregister ? q(i, g, []) : [])), z = (g, S, A = {}) => {
|
|
692
|
+
const K = q(n, g);
|
|
693
693
|
let E = S;
|
|
694
694
|
if (K) {
|
|
695
695
|
const T = K._f;
|
|
@@ -700,24 +700,24 @@ function sc(e = {}) {
|
|
|
700
700
|
values: Ie(a)
|
|
701
701
|
})));
|
|
702
702
|
}
|
|
703
|
-
(A.shouldDirty || A.shouldTouch) && w(g, E, A.shouldTouch, A.shouldDirty, !0), A.shouldValidate &&
|
|
703
|
+
(A.shouldDirty || A.shouldTouch) && w(g, E, A.shouldTouch, A.shouldDirty, !0), A.shouldValidate && ue(g);
|
|
704
704
|
}, V = (g, S, A) => {
|
|
705
705
|
for (const K in S) {
|
|
706
706
|
if (!S.hasOwnProperty(K))
|
|
707
707
|
return;
|
|
708
|
-
const E = S[K], T = g + "." + K, B =
|
|
709
|
-
(o.array.has(g) || $e(E) || B && !B._f) && !tr(E) ? V(T, E, A) :
|
|
708
|
+
const E = S[K], T = g + "." + K, B = q(n, T);
|
|
709
|
+
(o.array.has(g) || $e(E) || B && !B._f) && !tr(E) ? V(T, E, A) : z(T, E, A);
|
|
710
710
|
}
|
|
711
|
-
},
|
|
712
|
-
const K =
|
|
711
|
+
}, L = (g, S, A = {}) => {
|
|
712
|
+
const K = q(n, g), E = o.array.has(g), T = Ie(S);
|
|
713
713
|
he(a, g, T), E ? (m.array.next({
|
|
714
714
|
name: g,
|
|
715
715
|
values: Ie(a)
|
|
716
716
|
}), (d.isDirty || d.dirtyFields || f.isDirty || f.dirtyFields) && A.shouldDirty && m.state.next({
|
|
717
717
|
name: g,
|
|
718
718
|
dirtyFields: Kr(i, a),
|
|
719
|
-
isDirty:
|
|
720
|
-
})) : K && !K._f && !Ue(T) ? V(g, T, A) :
|
|
719
|
+
isDirty: D(g, T)
|
|
720
|
+
})) : K && !K._f && !Ue(T) ? V(g, T, A) : z(g, T, A), Ma(g, o) && m.state.next({ ...r }), m.state.next({
|
|
721
721
|
name: s.mount ? g : void 0,
|
|
722
722
|
values: Ie(a)
|
|
723
723
|
});
|
|
@@ -725,12 +725,12 @@ function sc(e = {}) {
|
|
|
725
725
|
s.mount = !0;
|
|
726
726
|
const S = g.target;
|
|
727
727
|
let A = S.name, K = !0;
|
|
728
|
-
const E =
|
|
729
|
-
K = Number.isNaN(
|
|
728
|
+
const E = q(n, A), T = (le) => {
|
|
729
|
+
K = Number.isNaN(le) || tr(le) && isNaN(le.getTime()) || Pt(le, q(a, A, le));
|
|
730
730
|
}, B = ja(t.mode), ie = ja(t.reValidateMode);
|
|
731
731
|
if (E) {
|
|
732
|
-
let
|
|
733
|
-
const at = S.type ? Pa(E._f) : oo(g), et = g.type === Vn.BLUR || g.type === Vn.FOCUS_OUT, Br = !Xl(E._f) && !t.resolver && !
|
|
732
|
+
let le, je;
|
|
733
|
+
const at = S.type ? Pa(E._f) : oo(g), et = g.type === Vn.BLUR || g.type === Vn.FOCUS_OUT, Br = !Xl(E._f) && !t.resolver && !q(r.errors, A) && !E._f.deps || rc(et, q(r.touchedFields, A), r.isSubmitted, ie, B), Zt = Ma(A, o, et);
|
|
734
734
|
he(a, A, at), et ? (E._f.onBlur && E._f.onBlur(g), l && l(0)) : E._f.onChange && E._f.onChange(g);
|
|
735
735
|
const $t = w(A, at, et), Ur = !Ke($t) || Zt;
|
|
736
736
|
if (!et && m.state.next({
|
|
@@ -743,49 +743,49 @@ function sc(e = {}) {
|
|
|
743
743
|
const { errors: gr } = await G([A]);
|
|
744
744
|
if (T(at), K) {
|
|
745
745
|
const Wr = za(r.errors, n, A), yr = za(gr, n, Wr.name || A);
|
|
746
|
-
|
|
746
|
+
le = yr.error, A = yr.name, je = Ke(gr);
|
|
747
747
|
}
|
|
748
748
|
} else
|
|
749
|
-
x([A], !0),
|
|
750
|
-
K && (E._f.deps &&
|
|
749
|
+
x([A], !0), le = (await Na(E, o.disabled, a, b, t.shouldUseNativeValidation))[A], x([A]), T(at), K && (le ? je = !1 : (d.isValid || f.isValid) && (je = await H(n, !0)));
|
|
750
|
+
K && (E._f.deps && ue(E._f.deps), M(A, je, le, $t));
|
|
751
751
|
}
|
|
752
|
-
},
|
|
753
|
-
if (
|
|
752
|
+
}, ce = (g, S) => {
|
|
753
|
+
if (q(r.errors, S) && g.focus)
|
|
754
754
|
return g.focus(), 1;
|
|
755
|
-
},
|
|
755
|
+
}, ue = async (g, S = {}) => {
|
|
756
756
|
let A, K;
|
|
757
757
|
const E = en(g);
|
|
758
758
|
if (t.resolver) {
|
|
759
|
-
const T = await
|
|
760
|
-
A = Ke(T), K = g ? !E.some((B) =>
|
|
759
|
+
const T = await J(Fe(g) ? g : E);
|
|
760
|
+
A = Ke(T), K = g ? !E.some((B) => q(T, B)) : A;
|
|
761
761
|
} else g ? (K = (await Promise.all(E.map(async (T) => {
|
|
762
|
-
const B =
|
|
762
|
+
const B = q(n, T);
|
|
763
763
|
return await H(B && B._f ? { [T]: B } : B);
|
|
764
764
|
}))).every(Boolean), !(!K && !r.isValid) && c()) : K = A = await H(n);
|
|
765
765
|
return m.state.next({
|
|
766
766
|
...!bt(g) || (d.isValid || f.isValid) && A !== r.isValid ? {} : { name: g },
|
|
767
767
|
...t.resolver || !g ? { isValid: A } : {},
|
|
768
768
|
errors: r.errors
|
|
769
|
-
}), S.shouldFocus && !K && tn(n,
|
|
769
|
+
}), S.shouldFocus && !K && tn(n, ce, g ? E : o.mount), K;
|
|
770
770
|
}, j = (g) => {
|
|
771
771
|
const S = {
|
|
772
772
|
...s.mount ? a : i
|
|
773
773
|
};
|
|
774
|
-
return Fe(g) ? S : bt(g) ?
|
|
775
|
-
},
|
|
776
|
-
invalid: !!
|
|
777
|
-
isDirty: !!
|
|
778
|
-
error:
|
|
779
|
-
isValidating: !!
|
|
780
|
-
isTouched: !!
|
|
781
|
-
}),
|
|
774
|
+
return Fe(g) ? S : bt(g) ? q(S, g) : g.map((A) => q(S, A));
|
|
775
|
+
}, W = (g, S) => ({
|
|
776
|
+
invalid: !!q((S || r).errors, g),
|
|
777
|
+
isDirty: !!q((S || r).dirtyFields, g),
|
|
778
|
+
error: q((S || r).errors, g),
|
|
779
|
+
isValidating: !!q(r.validatingFields, g),
|
|
780
|
+
isTouched: !!q((S || r).touchedFields, g)
|
|
781
|
+
}), N = (g) => {
|
|
782
782
|
g && en(g).forEach((S) => Re(r.errors, S)), m.state.next({
|
|
783
783
|
errors: g ? r.errors : {}
|
|
784
784
|
});
|
|
785
|
-
},
|
|
786
|
-
const K = (
|
|
785
|
+
}, U = (g, S, A) => {
|
|
786
|
+
const K = (q(n, g, { _f: {} })._f || {}).ref, E = q(r.errors, g) || {}, { ref: T, message: B, type: ie, ...le } = E;
|
|
787
787
|
he(r.errors, g, {
|
|
788
|
-
...
|
|
788
|
+
...le,
|
|
789
789
|
...S,
|
|
790
790
|
ref: K
|
|
791
791
|
}), m.state.next({
|
|
@@ -793,9 +793,9 @@ function sc(e = {}) {
|
|
|
793
793
|
errors: r.errors,
|
|
794
794
|
isValid: !1
|
|
795
795
|
}), A && A.shouldFocus && K && K.focus && K.focus();
|
|
796
|
-
},
|
|
796
|
+
}, Y = (g, S) => ct(g) ? m.state.subscribe({
|
|
797
797
|
next: (A) => g(k(void 0, S), A)
|
|
798
|
-
}) : k(g, S, !0),
|
|
798
|
+
}) : k(g, S, !0), ne = (g) => m.state.subscribe({
|
|
799
799
|
next: (S) => {
|
|
800
800
|
tc(g.name, S.name, g.exact) && ec(S, g.formState || d, Ft, g.reRenderRoot) && g.callback({
|
|
801
801
|
values: { ...a },
|
|
@@ -803,25 +803,25 @@ function sc(e = {}) {
|
|
|
803
803
|
...S
|
|
804
804
|
});
|
|
805
805
|
}
|
|
806
|
-
}).unsubscribe,
|
|
806
|
+
}).unsubscribe, re = (g) => (s.mount = !0, f = {
|
|
807
807
|
...f,
|
|
808
808
|
...g.formState
|
|
809
|
-
},
|
|
809
|
+
}, ne({
|
|
810
810
|
...g,
|
|
811
811
|
formState: f
|
|
812
|
-
})),
|
|
812
|
+
})), X = (g, S = {}) => {
|
|
813
813
|
for (const A of g ? en(g) : o.mount)
|
|
814
814
|
o.mount.delete(A), o.array.delete(A), S.keepValue || (Re(n, A), Re(a, A)), !S.keepError && Re(r.errors, A), !S.keepDirty && Re(r.dirtyFields, A), !S.keepTouched && Re(r.touchedFields, A), !S.keepIsValidating && Re(r.validatingFields, A), !t.shouldUnregister && !S.keepDefaultValue && Re(i, A);
|
|
815
815
|
m.state.next({
|
|
816
816
|
values: Ie(a)
|
|
817
817
|
}), m.state.next({
|
|
818
818
|
...r,
|
|
819
|
-
...S.keepDirty ? { isDirty:
|
|
819
|
+
...S.keepDirty ? { isDirty: D() } : {}
|
|
820
820
|
}), !S.keepIsValid && c();
|
|
821
|
-
},
|
|
821
|
+
}, R = ({ disabled: g, name: S }) => {
|
|
822
822
|
(Ye(g) && s.mount || g || o.disabled.has(S)) && (g ? o.disabled.add(S) : o.disabled.delete(S));
|
|
823
|
-
},
|
|
824
|
-
let A =
|
|
823
|
+
}, ee = (g, S = {}) => {
|
|
824
|
+
let A = q(n, g);
|
|
825
825
|
const K = Ye(S.disabled) || Ye(t.disabled);
|
|
826
826
|
return he(n, g, {
|
|
827
827
|
...A || {},
|
|
@@ -831,7 +831,7 @@ function sc(e = {}) {
|
|
|
831
831
|
mount: !0,
|
|
832
832
|
...S
|
|
833
833
|
}
|
|
834
|
-
}), o.mount.add(g), A ?
|
|
834
|
+
}), o.mount.add(g), A ? R({
|
|
835
835
|
disabled: Ye(S.disabled) ? S.disabled : t.disabled,
|
|
836
836
|
name: g
|
|
837
837
|
}) : C(g, !0, S.value), {
|
|
@@ -849,9 +849,9 @@ function sc(e = {}) {
|
|
|
849
849
|
onBlur: se,
|
|
850
850
|
ref: (E) => {
|
|
851
851
|
if (E) {
|
|
852
|
-
|
|
852
|
+
ee(g, S), A = q(n, g);
|
|
853
853
|
const T = Fe(E.value) && E.querySelectorAll && E.querySelectorAll("input,select,textarea")[0] || E, B = Ql(T), ie = A._f.refs || [];
|
|
854
|
-
if (B ? ie.find((
|
|
854
|
+
if (B ? ie.find((le) => le === T) : T === A._f.ref)
|
|
855
855
|
return;
|
|
856
856
|
he(n, g, {
|
|
857
857
|
_f: {
|
|
@@ -860,24 +860,24 @@ function sc(e = {}) {
|
|
|
860
860
|
refs: [
|
|
861
861
|
...ie.filter(hi),
|
|
862
862
|
T,
|
|
863
|
-
...Array.isArray(
|
|
863
|
+
...Array.isArray(q(i, g)) ? [{}] : []
|
|
864
864
|
],
|
|
865
865
|
ref: { type: T.type, name: g }
|
|
866
866
|
} : { ref: T }
|
|
867
867
|
}
|
|
868
868
|
}), C(g, !1, void 0, T);
|
|
869
869
|
} else
|
|
870
|
-
A =
|
|
870
|
+
A = q(n, g, {}), A._f && (A._f.mount = !1), (t.shouldUnregister || S.shouldUnregister) && !(lo(o.array, g) && s.action) && o.unMount.add(g);
|
|
871
871
|
}
|
|
872
872
|
};
|
|
873
|
-
},
|
|
873
|
+
}, Q = () => t.shouldFocusError && tn(n, ce, o.mount), oe = (g) => {
|
|
874
874
|
Ye(g) && (m.state.next({ disabled: g }), tn(n, (S, A) => {
|
|
875
|
-
const K =
|
|
875
|
+
const K = q(n, A);
|
|
876
876
|
K && (S.disabled = K._f.disabled || g, Array.isArray(K._f.refs) && K._f.refs.forEach((E) => {
|
|
877
877
|
E.disabled = K._f.disabled || g;
|
|
878
878
|
}));
|
|
879
879
|
}, 0, !1));
|
|
880
|
-
},
|
|
880
|
+
}, I = (g, S) => async (A) => {
|
|
881
881
|
let K;
|
|
882
882
|
A && (A.preventDefault && A.preventDefault(), A.persist && A.persist());
|
|
883
883
|
let E = Ie(a);
|
|
@@ -901,7 +901,7 @@ function sc(e = {}) {
|
|
|
901
901
|
K = T;
|
|
902
902
|
}
|
|
903
903
|
} else
|
|
904
|
-
S && await S({ ...r.errors }, A),
|
|
904
|
+
S && await S({ ...r.errors }, A), Q(), setTimeout(Q);
|
|
905
905
|
if (m.state.next({
|
|
906
906
|
isSubmitted: !0,
|
|
907
907
|
isSubmitting: !1,
|
|
@@ -911,7 +911,7 @@ function sc(e = {}) {
|
|
|
911
911
|
}), K)
|
|
912
912
|
throw K;
|
|
913
913
|
}, Le = (g, S = {}) => {
|
|
914
|
-
|
|
914
|
+
q(n, g) && (Fe(S.defaultValue) ? L(g, Ie(q(i, g))) : (L(g, S.defaultValue), he(i, g, Ie(S.defaultValue))), S.keepTouched || Re(r.touchedFields, g), S.keepDirty || (Re(r.dirtyFields, g), r.isDirty = S.defaultValue ? D(g, Ie(q(i, g))) : D()), S.keepError || (Re(r.errors, g), d.isValid && c()), m.state.next({ ...r }));
|
|
915
915
|
}, dt = (g, S = {}) => {
|
|
916
916
|
const A = g ? Ie(g) : i, K = Ie(A), E = Ke(g), T = E ? i : K;
|
|
917
917
|
if (S.keepDefaultValues || (i = A), !S.keepValues) {
|
|
@@ -921,15 +921,15 @@ function sc(e = {}) {
|
|
|
921
921
|
...Object.keys(Kr(i, a))
|
|
922
922
|
]);
|
|
923
923
|
for (const ie of Array.from(B))
|
|
924
|
-
|
|
924
|
+
q(r.dirtyFields, ie) ? he(T, ie, q(a, ie)) : L(ie, q(T, ie));
|
|
925
925
|
} else {
|
|
926
926
|
if (ia && Fe(g))
|
|
927
927
|
for (const B of o.mount) {
|
|
928
|
-
const ie =
|
|
928
|
+
const ie = q(n, B);
|
|
929
929
|
if (ie && ie._f) {
|
|
930
|
-
const
|
|
931
|
-
if (Nn(
|
|
932
|
-
const je =
|
|
930
|
+
const le = Array.isArray(ie._f.refs) ? ie._f.refs[0] : ie._f.ref;
|
|
931
|
+
if (Nn(le)) {
|
|
932
|
+
const je = le.closest("form");
|
|
933
933
|
if (je) {
|
|
934
934
|
je.reset();
|
|
935
935
|
break;
|
|
@@ -938,7 +938,7 @@ function sc(e = {}) {
|
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
940
|
for (const B of o.mount)
|
|
941
|
-
|
|
941
|
+
L(B, q(T, B));
|
|
942
942
|
}
|
|
943
943
|
a = Ie(T), m.array.next({
|
|
944
944
|
values: { ...T }
|
|
@@ -965,7 +965,7 @@ function sc(e = {}) {
|
|
|
965
965
|
isSubmitting: !1
|
|
966
966
|
});
|
|
967
967
|
}, At = (g, S) => dt(ct(g) ? g(a) : g, S), vn = (g, S = {}) => {
|
|
968
|
-
const A =
|
|
968
|
+
const A = q(n, g), K = A && A._f;
|
|
969
969
|
if (K) {
|
|
970
970
|
const E = K.refs ? K.refs[0] : K.ref;
|
|
971
971
|
E.focus && (E.focus(), S.shouldSelect && ct(E.select) && E.select());
|
|
@@ -977,19 +977,19 @@ function sc(e = {}) {
|
|
|
977
977
|
};
|
|
978
978
|
}, Yt = {
|
|
979
979
|
control: {
|
|
980
|
-
register:
|
|
981
|
-
unregister:
|
|
982
|
-
getFieldState:
|
|
983
|
-
handleSubmit:
|
|
984
|
-
setError:
|
|
985
|
-
_subscribe:
|
|
980
|
+
register: ee,
|
|
981
|
+
unregister: X,
|
|
982
|
+
getFieldState: W,
|
|
983
|
+
handleSubmit: I,
|
|
984
|
+
setError: U,
|
|
985
|
+
_subscribe: ne,
|
|
986
986
|
_runSchema: G,
|
|
987
|
-
_focusError:
|
|
987
|
+
_focusError: Q,
|
|
988
988
|
_getWatch: k,
|
|
989
|
-
_getDirty:
|
|
989
|
+
_getDirty: D,
|
|
990
990
|
_setValid: c,
|
|
991
991
|
_setFieldArray: y,
|
|
992
|
-
_setDisabledField:
|
|
992
|
+
_setDisabledField: R,
|
|
993
993
|
_setErrors: F,
|
|
994
994
|
_getFieldArray: P,
|
|
995
995
|
_reset: dt,
|
|
@@ -999,7 +999,7 @@ function sc(e = {}) {
|
|
|
999
999
|
});
|
|
1000
1000
|
}),
|
|
1001
1001
|
_removeUnmounted: u,
|
|
1002
|
-
_disableForm:
|
|
1002
|
+
_disableForm: oe,
|
|
1003
1003
|
_subjects: m,
|
|
1004
1004
|
_proxyFormState: d,
|
|
1005
1005
|
get _fields() {
|
|
@@ -1036,20 +1036,20 @@ function sc(e = {}) {
|
|
|
1036
1036
|
};
|
|
1037
1037
|
}
|
|
1038
1038
|
},
|
|
1039
|
-
subscribe:
|
|
1040
|
-
trigger:
|
|
1041
|
-
register:
|
|
1042
|
-
handleSubmit:
|
|
1043
|
-
watch:
|
|
1044
|
-
setValue:
|
|
1039
|
+
subscribe: re,
|
|
1040
|
+
trigger: ue,
|
|
1041
|
+
register: ee,
|
|
1042
|
+
handleSubmit: I,
|
|
1043
|
+
watch: Y,
|
|
1044
|
+
setValue: L,
|
|
1045
1045
|
getValues: j,
|
|
1046
1046
|
reset: At,
|
|
1047
1047
|
resetField: Le,
|
|
1048
|
-
clearErrors:
|
|
1049
|
-
unregister:
|
|
1050
|
-
setError:
|
|
1048
|
+
clearErrors: N,
|
|
1049
|
+
unregister: X,
|
|
1050
|
+
setError: U,
|
|
1051
1051
|
setFocus: vn,
|
|
1052
|
-
getFieldState:
|
|
1052
|
+
getFieldState: W
|
|
1053
1053
|
};
|
|
1054
1054
|
return {
|
|
1055
1055
|
...Yt,
|
|
@@ -1121,7 +1121,7 @@ function oc(e = {}) {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
const La = (e, t, r) => {
|
|
1123
1123
|
if (e && "reportValidity" in e) {
|
|
1124
|
-
const n =
|
|
1124
|
+
const n = q(r, t);
|
|
1125
1125
|
e.setCustomValidity(n && n.message || ""), e.reportValidity();
|
|
1126
1126
|
}
|
|
1127
1127
|
}, bo = (e, t) => {
|
|
@@ -1133,9 +1133,9 @@ const La = (e, t, r) => {
|
|
|
1133
1133
|
t.shouldUseNativeValidation && bo(e, t);
|
|
1134
1134
|
const r = {};
|
|
1135
1135
|
for (const n in e) {
|
|
1136
|
-
const i =
|
|
1136
|
+
const i = q(t.fields, n), a = Object.assign(e[n] || {}, { ref: i && i.ref });
|
|
1137
1137
|
if (cc(t.names || Object.keys(e), n)) {
|
|
1138
|
-
const s = Object.assign({},
|
|
1138
|
+
const s = Object.assign({}, q(r, n));
|
|
1139
1139
|
he(s, "root", a), he(r, n, s);
|
|
1140
1140
|
} else he(r, n, a);
|
|
1141
1141
|
}
|
|
@@ -1339,7 +1339,7 @@ var rr, jt, Ar, Gs, gc = (Gs = class extends fn {
|
|
|
1339
1339
|
ae(this, rr);
|
|
1340
1340
|
ae(this, jt);
|
|
1341
1341
|
ae(this, Ar);
|
|
1342
|
-
|
|
1342
|
+
Z(this, Ar, (t) => {
|
|
1343
1343
|
if (!pr && window.addEventListener) {
|
|
1344
1344
|
const r = () => t();
|
|
1345
1345
|
return window.addEventListener("visibilitychange", r, !1), () => {
|
|
@@ -1353,16 +1353,16 @@ var rr, jt, Ar, Gs, gc = (Gs = class extends fn {
|
|
|
1353
1353
|
}
|
|
1354
1354
|
onUnsubscribe() {
|
|
1355
1355
|
var t;
|
|
1356
|
-
this.hasListeners() || ((t = v(this, jt)) == null || t.call(this),
|
|
1356
|
+
this.hasListeners() || ((t = v(this, jt)) == null || t.call(this), Z(this, jt, void 0));
|
|
1357
1357
|
}
|
|
1358
1358
|
setEventListener(t) {
|
|
1359
1359
|
var r;
|
|
1360
|
-
|
|
1360
|
+
Z(this, Ar, t), (r = v(this, jt)) == null || r.call(this), Z(this, jt, t((n) => {
|
|
1361
1361
|
typeof n == "boolean" ? this.setFocused(n) : this.onFocus();
|
|
1362
1362
|
}));
|
|
1363
1363
|
}
|
|
1364
1364
|
setFocused(t) {
|
|
1365
|
-
v(this, rr) !== t && (
|
|
1365
|
+
v(this, rr) !== t && (Z(this, rr, t), this.onFocus());
|
|
1366
1366
|
}
|
|
1367
1367
|
onFocus() {
|
|
1368
1368
|
const t = this.isFocused();
|
|
@@ -1380,7 +1380,7 @@ var rr, jt, Ar, Gs, gc = (Gs = class extends fn {
|
|
|
1380
1380
|
ae(this, Fr, !0);
|
|
1381
1381
|
ae(this, It);
|
|
1382
1382
|
ae(this, $r);
|
|
1383
|
-
|
|
1383
|
+
Z(this, $r, (t) => {
|
|
1384
1384
|
if (!pr && window.addEventListener) {
|
|
1385
1385
|
const r = () => t(!0), n = () => t(!1);
|
|
1386
1386
|
return window.addEventListener("online", r, !1), window.addEventListener("offline", n, !1), () => {
|
|
@@ -1394,14 +1394,14 @@ var rr, jt, Ar, Gs, gc = (Gs = class extends fn {
|
|
|
1394
1394
|
}
|
|
1395
1395
|
onUnsubscribe() {
|
|
1396
1396
|
var t;
|
|
1397
|
-
this.hasListeners() || ((t = v(this, It)) == null || t.call(this),
|
|
1397
|
+
this.hasListeners() || ((t = v(this, It)) == null || t.call(this), Z(this, It, void 0));
|
|
1398
1398
|
}
|
|
1399
1399
|
setEventListener(t) {
|
|
1400
1400
|
var r;
|
|
1401
|
-
|
|
1401
|
+
Z(this, $r, t), (r = v(this, It)) == null || r.call(this), Z(this, It, t(this.setOnline.bind(this)));
|
|
1402
1402
|
}
|
|
1403
1403
|
setOnline(t) {
|
|
1404
|
-
v(this, Fr) !== t && (
|
|
1404
|
+
v(this, Fr) !== t && (Z(this, Fr, t), this.listeners.forEach((n) => {
|
|
1405
1405
|
n(t);
|
|
1406
1406
|
}));
|
|
1407
1407
|
}
|
|
@@ -1562,7 +1562,7 @@ function bc() {
|
|
|
1562
1562
|
}
|
|
1563
1563
|
};
|
|
1564
1564
|
}
|
|
1565
|
-
var
|
|
1565
|
+
var Ve = bc(), nr, Zs, To = (Zs = class {
|
|
1566
1566
|
constructor() {
|
|
1567
1567
|
ae(this, nr);
|
|
1568
1568
|
}
|
|
@@ -1570,7 +1570,7 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1570
1570
|
this.clearGcTimeout();
|
|
1571
1571
|
}
|
|
1572
1572
|
scheduleGc() {
|
|
1573
|
-
this.clearGcTimeout(), Ri(this.gcTime) &&
|
|
1573
|
+
this.clearGcTimeout(), Ri(this.gcTime) && Z(this, nr, setTimeout(() => {
|
|
1574
1574
|
this.optionalRemove();
|
|
1575
1575
|
}, this.gcTime));
|
|
1576
1576
|
}
|
|
@@ -1581,9 +1581,9 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1581
1581
|
);
|
|
1582
1582
|
}
|
|
1583
1583
|
clearGcTimeout() {
|
|
1584
|
-
v(this, nr) && (clearTimeout(v(this, nr)),
|
|
1584
|
+
v(this, nr) && (clearTimeout(v(this, nr)), Z(this, nr, void 0));
|
|
1585
1585
|
}
|
|
1586
|
-
}, nr = new WeakMap(), Zs), Dr, ir, tt, ar,
|
|
1586
|
+
}, nr = new WeakMap(), Zs), Dr, ir, tt, ar, Ne, ln, sr, st, Ot, Js, wc = (Js = class extends To {
|
|
1587
1587
|
constructor(t) {
|
|
1588
1588
|
super();
|
|
1589
1589
|
ae(this, st);
|
|
@@ -1591,17 +1591,17 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1591
1591
|
ae(this, ir);
|
|
1592
1592
|
ae(this, tt);
|
|
1593
1593
|
ae(this, ar);
|
|
1594
|
-
ae(this,
|
|
1594
|
+
ae(this, Ne);
|
|
1595
1595
|
ae(this, ln);
|
|
1596
1596
|
ae(this, sr);
|
|
1597
|
-
|
|
1597
|
+
Z(this, sr, !1), Z(this, ln, t.defaultOptions), this.setOptions(t.options), this.observers = [], Z(this, ar, t.client), Z(this, tt, v(this, ar).getQueryCache()), this.queryKey = t.queryKey, this.queryHash = t.queryHash, Z(this, Dr, Sc(this.options)), this.state = t.state ?? v(this, Dr), this.scheduleGc();
|
|
1598
1598
|
}
|
|
1599
1599
|
get meta() {
|
|
1600
1600
|
return this.options.meta;
|
|
1601
1601
|
}
|
|
1602
1602
|
get promise() {
|
|
1603
1603
|
var t;
|
|
1604
|
-
return (t = v(this,
|
|
1604
|
+
return (t = v(this, Ne)) == null ? void 0 : t.promise;
|
|
1605
1605
|
}
|
|
1606
1606
|
setOptions(t) {
|
|
1607
1607
|
this.options = { ...v(this, ln), ...t }, this.updateGcTime(this.options.gcTime);
|
|
@@ -1623,8 +1623,8 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
cancel(t) {
|
|
1625
1625
|
var n, i;
|
|
1626
|
-
const r = (n = v(this,
|
|
1627
|
-
return (i = v(this,
|
|
1626
|
+
const r = (n = v(this, Ne)) == null ? void 0 : n.promise;
|
|
1627
|
+
return (i = v(this, Ne)) == null || i.cancel(t), r ? r.then(Qe).catch(Qe) : Promise.resolve();
|
|
1628
1628
|
}
|
|
1629
1629
|
destroy() {
|
|
1630
1630
|
super.destroy(), this.cancel({ silent: !0 });
|
|
@@ -1656,18 +1656,18 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1656
1656
|
onFocus() {
|
|
1657
1657
|
var r;
|
|
1658
1658
|
const t = this.observers.find((n) => n.shouldFetchOnWindowFocus());
|
|
1659
|
-
t == null || t.refetch({ cancelRefetch: !1 }), (r = v(this,
|
|
1659
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (r = v(this, Ne)) == null || r.continue();
|
|
1660
1660
|
}
|
|
1661
1661
|
onOnline() {
|
|
1662
1662
|
var r;
|
|
1663
1663
|
const t = this.observers.find((n) => n.shouldFetchOnReconnect());
|
|
1664
|
-
t == null || t.refetch({ cancelRefetch: !1 }), (r = v(this,
|
|
1664
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (r = v(this, Ne)) == null || r.continue();
|
|
1665
1665
|
}
|
|
1666
1666
|
addObserver(t) {
|
|
1667
1667
|
this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), v(this, tt).notify({ type: "observerAdded", query: this, observer: t }));
|
|
1668
1668
|
}
|
|
1669
1669
|
removeObserver(t) {
|
|
1670
|
-
this.observers.includes(t) && (this.observers = this.observers.filter((r) => r !== t), this.observers.length || (v(this,
|
|
1670
|
+
this.observers.includes(t) && (this.observers = this.observers.filter((r) => r !== t), this.observers.length || (v(this, Ne) && (v(this, sr) ? v(this, Ne).cancel({ revert: !0 }) : v(this, Ne).cancelRetry()), this.scheduleGc()), v(this, tt).notify({ type: "observerRemoved", query: this, observer: t }));
|
|
1671
1671
|
}
|
|
1672
1672
|
getObserversCount() {
|
|
1673
1673
|
return this.observers.length;
|
|
@@ -1680,8 +1680,8 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1680
1680
|
if (this.state.fetchStatus !== "idle") {
|
|
1681
1681
|
if (this.state.data !== void 0 && (r != null && r.cancelRefetch))
|
|
1682
1682
|
this.cancel({ silent: !0 });
|
|
1683
|
-
else if (v(this,
|
|
1684
|
-
return v(this,
|
|
1683
|
+
else if (v(this, Ne))
|
|
1684
|
+
return v(this, Ne).continueRetry(), v(this, Ne).promise;
|
|
1685
1685
|
}
|
|
1686
1686
|
if (t && this.setOptions(t), !this.options.queryFn) {
|
|
1687
1687
|
const m = this.observers.find((b) => b.options.queryFn);
|
|
@@ -1693,7 +1693,7 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1693
1693
|
const n = new AbortController(), i = (m) => {
|
|
1694
1694
|
Object.defineProperty(m, "signal", {
|
|
1695
1695
|
enumerable: !0,
|
|
1696
|
-
get: () => (
|
|
1696
|
+
get: () => (Z(this, sr, !0), n.signal)
|
|
1697
1697
|
});
|
|
1698
1698
|
}, a = () => {
|
|
1699
1699
|
const m = So(this.options, r), h = (() => {
|
|
@@ -1704,7 +1704,7 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1704
1704
|
};
|
|
1705
1705
|
return i(c), c;
|
|
1706
1706
|
})();
|
|
1707
|
-
return
|
|
1707
|
+
return Z(this, sr, !1), this.options.persister ? this.options.persister(
|
|
1708
1708
|
m,
|
|
1709
1709
|
h,
|
|
1710
1710
|
this
|
|
@@ -1720,7 +1720,7 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1720
1720
|
};
|
|
1721
1721
|
return i(m), m;
|
|
1722
1722
|
})();
|
|
1723
|
-
(p = this.options.behavior) == null || p.onFetch(o, this),
|
|
1723
|
+
(p = this.options.behavior) == null || p.onFetch(o, this), Z(this, ir, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((d = o.fetchOptions) == null ? void 0 : d.meta)) && de(this, st, Ot).call(this, { type: "fetch", meta: (f = o.fetchOptions) == null ? void 0 : f.meta });
|
|
1724
1724
|
const l = (m) => {
|
|
1725
1725
|
var b, h, c, x;
|
|
1726
1726
|
gi(m) && m.silent || de(this, st, Ot).call(this, {
|
|
@@ -1737,7 +1737,7 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1737
1737
|
this
|
|
1738
1738
|
)), this.scheduleGc();
|
|
1739
1739
|
};
|
|
1740
|
-
return
|
|
1740
|
+
return Z(this, Ne, Oo({
|
|
1741
1741
|
initialPromise: r == null ? void 0 : r.initialPromise,
|
|
1742
1742
|
fn: o.fetchFn,
|
|
1743
1743
|
abort: n.abort.bind(n),
|
|
@@ -1776,9 +1776,9 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1776
1776
|
retryDelay: o.options.retryDelay,
|
|
1777
1777
|
networkMode: o.options.networkMode,
|
|
1778
1778
|
canRun: () => !0
|
|
1779
|
-
})), v(this,
|
|
1779
|
+
})), v(this, Ne).start();
|
|
1780
1780
|
}
|
|
1781
|
-
}, Dr = new WeakMap(), ir = new WeakMap(), tt = new WeakMap(), ar = new WeakMap(),
|
|
1781
|
+
}, Dr = new WeakMap(), ir = new WeakMap(), tt = new WeakMap(), ar = new WeakMap(), Ne = new WeakMap(), ln = new WeakMap(), sr = new WeakMap(), st = new WeakSet(), Ot = function(t) {
|
|
1782
1782
|
const r = (n) => {
|
|
1783
1783
|
switch (t.type) {
|
|
1784
1784
|
case "failed":
|
|
@@ -1804,7 +1804,7 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1804
1804
|
fetchMeta: t.meta ?? null
|
|
1805
1805
|
};
|
|
1806
1806
|
case "success":
|
|
1807
|
-
return
|
|
1807
|
+
return Z(this, ir, void 0), {
|
|
1808
1808
|
...n,
|
|
1809
1809
|
data: t.data,
|
|
1810
1810
|
dataUpdateCount: n.dataUpdateCount + 1,
|
|
@@ -1842,7 +1842,7 @@ var ze = bc(), nr, Zs, To = (Zs = class {
|
|
|
1842
1842
|
};
|
|
1843
1843
|
}
|
|
1844
1844
|
};
|
|
1845
|
-
this.state = r(this.state),
|
|
1845
|
+
this.state = r(this.state), Ve.batch(() => {
|
|
1846
1846
|
this.observers.forEach((n) => {
|
|
1847
1847
|
n.onQueryUpdate();
|
|
1848
1848
|
}), v(this, tt).notify({ query: this, type: "updated", action: t });
|
|
@@ -1880,7 +1880,7 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
1880
1880
|
constructor(t = {}) {
|
|
1881
1881
|
super();
|
|
1882
1882
|
ae(this, gt);
|
|
1883
|
-
this.config = t,
|
|
1883
|
+
this.config = t, Z(this, gt, /* @__PURE__ */ new Map());
|
|
1884
1884
|
}
|
|
1885
1885
|
build(t, r, n) {
|
|
1886
1886
|
const i = r.queryKey, a = r.queryHash ?? da(i, r);
|
|
@@ -1905,7 +1905,7 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
1905
1905
|
r && (t.destroy(), r === t && v(this, gt).delete(t.queryHash), this.notify({ type: "removed", query: t }));
|
|
1906
1906
|
}
|
|
1907
1907
|
clear() {
|
|
1908
|
-
|
|
1908
|
+
Ve.batch(() => {
|
|
1909
1909
|
this.getAll().forEach((t) => {
|
|
1910
1910
|
this.remove(t);
|
|
1911
1911
|
});
|
|
@@ -1928,21 +1928,21 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
1928
1928
|
return Object.keys(t).length > 0 ? r.filter((n) => Ba(t, n)) : r;
|
|
1929
1929
|
}
|
|
1930
1930
|
notify(t) {
|
|
1931
|
-
|
|
1931
|
+
Ve.batch(() => {
|
|
1932
1932
|
this.listeners.forEach((r) => {
|
|
1933
1933
|
r(t);
|
|
1934
1934
|
});
|
|
1935
1935
|
});
|
|
1936
1936
|
}
|
|
1937
1937
|
onFocus() {
|
|
1938
|
-
|
|
1938
|
+
Ve.batch(() => {
|
|
1939
1939
|
this.getAll().forEach((t) => {
|
|
1940
1940
|
t.onFocus();
|
|
1941
1941
|
});
|
|
1942
1942
|
});
|
|
1943
1943
|
}
|
|
1944
1944
|
onOnline() {
|
|
1945
|
-
|
|
1945
|
+
Ve.batch(() => {
|
|
1946
1946
|
this.getAll().forEach((t) => {
|
|
1947
1947
|
t.onOnline();
|
|
1948
1948
|
});
|
|
@@ -1955,7 +1955,7 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
1955
1955
|
ae(this, yt);
|
|
1956
1956
|
ae(this, qe);
|
|
1957
1957
|
ae(this, or);
|
|
1958
|
-
this.mutationId = t.mutationId,
|
|
1958
|
+
this.mutationId = t.mutationId, Z(this, qe, t.mutationCache), Z(this, yt, []), this.state = t.state || Oc(), this.setOptions(t.options), this.scheduleGc();
|
|
1959
1959
|
}
|
|
1960
1960
|
setOptions(t) {
|
|
1961
1961
|
this.options = t, this.updateGcTime(this.options.gcTime);
|
|
@@ -1971,7 +1971,7 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
1971
1971
|
}));
|
|
1972
1972
|
}
|
|
1973
1973
|
removeObserver(t) {
|
|
1974
|
-
|
|
1974
|
+
Z(this, yt, v(this, yt).filter((r) => r !== t)), this.scheduleGc(), v(this, qe).notify({
|
|
1975
1975
|
type: "observerRemoved",
|
|
1976
1976
|
mutation: this,
|
|
1977
1977
|
observer: t
|
|
@@ -1986,11 +1986,11 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
1986
1986
|
this.execute(this.state.variables);
|
|
1987
1987
|
}
|
|
1988
1988
|
async execute(t) {
|
|
1989
|
-
var a, s, o, l, p, d, f, m, b, h, c, x, y, O, F, C, w, M, G,
|
|
1989
|
+
var a, s, o, l, p, d, f, m, b, h, c, x, y, O, F, C, w, M, G, J;
|
|
1990
1990
|
const r = () => {
|
|
1991
1991
|
de(this, vt, Dt).call(this, { type: "continue" });
|
|
1992
1992
|
};
|
|
1993
|
-
|
|
1993
|
+
Z(this, or, Oo({
|
|
1994
1994
|
fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
|
|
1995
1995
|
onFail: (H, u) => {
|
|
1996
1996
|
de(this, vt, Dt).call(this, { type: "failed", failureCount: H, error: u });
|
|
@@ -2057,7 +2057,7 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
2057
2057
|
this.state.variables,
|
|
2058
2058
|
this.state.context,
|
|
2059
2059
|
this
|
|
2060
|
-
)), await ((
|
|
2060
|
+
)), await ((J = (G = this.options).onSettled) == null ? void 0 : J.call(
|
|
2061
2061
|
G,
|
|
2062
2062
|
void 0,
|
|
2063
2063
|
H,
|
|
@@ -2125,7 +2125,7 @@ var gt, Xs, Ec = (Xs = class extends fn {
|
|
|
2125
2125
|
};
|
|
2126
2126
|
}
|
|
2127
2127
|
};
|
|
2128
|
-
this.state = r(this.state),
|
|
2128
|
+
this.state = r(this.state), Ve.batch(() => {
|
|
2129
2129
|
v(this, yt).forEach((n) => {
|
|
2130
2130
|
n.onMutationUpdate(t);
|
|
2131
2131
|
}), v(this, qe).notify({
|
|
@@ -2154,7 +2154,7 @@ var Tt, ot, cn, to, Tc = (to = class extends fn {
|
|
|
2154
2154
|
ae(this, Tt);
|
|
2155
2155
|
ae(this, ot);
|
|
2156
2156
|
ae(this, cn);
|
|
2157
|
-
this.config = t,
|
|
2157
|
+
this.config = t, Z(this, Tt, /* @__PURE__ */ new Set()), Z(this, ot, /* @__PURE__ */ new Map()), Z(this, cn, 0);
|
|
2158
2158
|
}
|
|
2159
2159
|
build(t, r, n) {
|
|
2160
2160
|
const i = new kc({
|
|
@@ -2208,7 +2208,7 @@ var Tt, ot, cn, to, Tc = (to = class extends fn {
|
|
|
2208
2208
|
return Promise.resolve();
|
|
2209
2209
|
}
|
|
2210
2210
|
clear() {
|
|
2211
|
-
|
|
2211
|
+
Ve.batch(() => {
|
|
2212
2212
|
v(this, Tt).forEach((t) => {
|
|
2213
2213
|
this.notify({ type: "removed", mutation: t });
|
|
2214
2214
|
}), v(this, Tt).clear(), v(this, ot).clear();
|
|
@@ -2227,7 +2227,7 @@ var Tt, ot, cn, to, Tc = (to = class extends fn {
|
|
|
2227
2227
|
return this.getAll().filter((r) => Ua(t, r));
|
|
2228
2228
|
}
|
|
2229
2229
|
notify(t) {
|
|
2230
|
-
|
|
2230
|
+
Ve.batch(() => {
|
|
2231
2231
|
this.listeners.forEach((r) => {
|
|
2232
2232
|
r(t);
|
|
2233
2233
|
});
|
|
@@ -2235,7 +2235,7 @@ var Tt, ot, cn, to, Tc = (to = class extends fn {
|
|
|
2235
2235
|
}
|
|
2236
2236
|
resumePausedMutations() {
|
|
2237
2237
|
const t = this.getAll().filter((r) => r.state.isPaused);
|
|
2238
|
-
return
|
|
2238
|
+
return Ve.batch(
|
|
2239
2239
|
() => Promise.all(
|
|
2240
2240
|
t.map((r) => r.continue().catch(Qe))
|
|
2241
2241
|
)
|
|
@@ -2267,17 +2267,17 @@ function Ka(e) {
|
|
|
2267
2267
|
if (C == null && F.pages.length)
|
|
2268
2268
|
return Promise.resolve(F);
|
|
2269
2269
|
const G = (() => {
|
|
2270
|
-
const
|
|
2270
|
+
const D = {
|
|
2271
2271
|
client: t.client,
|
|
2272
2272
|
queryKey: t.queryKey,
|
|
2273
2273
|
pageParam: C,
|
|
2274
2274
|
direction: w ? "backward" : "forward",
|
|
2275
2275
|
meta: t.options.meta
|
|
2276
2276
|
};
|
|
2277
|
-
return x(
|
|
2278
|
-
})(),
|
|
2277
|
+
return x(D), D;
|
|
2278
|
+
})(), J = await y(G), { maxPages: H } = t.options, u = w ? mc : fc;
|
|
2279
2279
|
return {
|
|
2280
|
-
pages: u(F.pages,
|
|
2280
|
+
pages: u(F.pages, J, H),
|
|
2281
2281
|
pageParams: u(F.pageParams, C, H)
|
|
2282
2282
|
};
|
|
2283
2283
|
};
|
|
@@ -2338,18 +2338,18 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2338
2338
|
ae(this, Vt);
|
|
2339
2339
|
ae(this, jr);
|
|
2340
2340
|
ae(this, Ir);
|
|
2341
|
-
|
|
2341
|
+
Z(this, Ce, e.queryCache || new Ec()), Z(this, Mt, e.mutationCache || new Tc()), Z(this, zt, e.defaultOptions || {}), Z(this, Rr, /* @__PURE__ */ new Map()), Z(this, Pr, /* @__PURE__ */ new Map()), Z(this, Vt, 0);
|
|
2342
2342
|
}
|
|
2343
2343
|
mount() {
|
|
2344
|
-
bn(this, Vt)._++, v(this, Vt) === 1 && (
|
|
2344
|
+
bn(this, Vt)._++, v(this, Vt) === 1 && (Z(this, jr, pa.subscribe(async (e) => {
|
|
2345
2345
|
e && (await this.resumePausedMutations(), v(this, Ce).onFocus());
|
|
2346
|
-
})),
|
|
2346
|
+
})), Z(this, Ir, Un.subscribe(async (e) => {
|
|
2347
2347
|
e && (await this.resumePausedMutations(), v(this, Ce).onOnline());
|
|
2348
2348
|
})));
|
|
2349
2349
|
}
|
|
2350
2350
|
unmount() {
|
|
2351
2351
|
var e, t;
|
|
2352
|
-
bn(this, Vt)._--, v(this, Vt) === 0 && ((e = v(this, jr)) == null || e.call(this),
|
|
2352
|
+
bn(this, Vt)._--, v(this, Vt) === 0 && ((e = v(this, jr)) == null || e.call(this), Z(this, jr, void 0), (t = v(this, Ir)) == null || t.call(this), Z(this, Ir, void 0));
|
|
2353
2353
|
}
|
|
2354
2354
|
isFetching(e) {
|
|
2355
2355
|
return v(this, Ce).findAll({ ...e, fetchStatus: "fetching" }).length;
|
|
@@ -2387,7 +2387,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2387
2387
|
return v(this, Ce).build(this, n).setData(s, { ...r, manual: !0 });
|
|
2388
2388
|
}
|
|
2389
2389
|
setQueriesData(e, t, r) {
|
|
2390
|
-
return
|
|
2390
|
+
return Ve.batch(
|
|
2391
2391
|
() => v(this, Ce).findAll(e).map(({ queryKey: n }) => [
|
|
2392
2392
|
n,
|
|
2393
2393
|
this.setQueryData(n, t, r)
|
|
@@ -2403,7 +2403,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2403
2403
|
}
|
|
2404
2404
|
removeQueries(e) {
|
|
2405
2405
|
const t = v(this, Ce);
|
|
2406
|
-
|
|
2406
|
+
Ve.batch(() => {
|
|
2407
2407
|
t.findAll(e).forEach((r) => {
|
|
2408
2408
|
t.remove(r);
|
|
2409
2409
|
});
|
|
@@ -2411,7 +2411,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2411
2411
|
}
|
|
2412
2412
|
resetQueries(e, t) {
|
|
2413
2413
|
const r = v(this, Ce);
|
|
2414
|
-
return
|
|
2414
|
+
return Ve.batch(() => (r.findAll(e).forEach((n) => {
|
|
2415
2415
|
n.reset();
|
|
2416
2416
|
}), this.refetchQueries(
|
|
2417
2417
|
{
|
|
@@ -2422,13 +2422,13 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2422
2422
|
)));
|
|
2423
2423
|
}
|
|
2424
2424
|
cancelQueries(e, t = {}) {
|
|
2425
|
-
const r = { revert: !0, ...t }, n =
|
|
2425
|
+
const r = { revert: !0, ...t }, n = Ve.batch(
|
|
2426
2426
|
() => v(this, Ce).findAll(e).map((i) => i.cancel(r))
|
|
2427
2427
|
);
|
|
2428
2428
|
return Promise.all(n).then(Qe).catch(Qe);
|
|
2429
2429
|
}
|
|
2430
2430
|
invalidateQueries(e, t = {}) {
|
|
2431
|
-
return
|
|
2431
|
+
return Ve.batch(() => (v(this, Ce).findAll(e).forEach((r) => {
|
|
2432
2432
|
r.invalidate();
|
|
2433
2433
|
}), (e == null ? void 0 : e.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
|
|
2434
2434
|
{
|
|
@@ -2442,7 +2442,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2442
2442
|
const r = {
|
|
2443
2443
|
...t,
|
|
2444
2444
|
cancelRefetch: t.cancelRefetch ?? !0
|
|
2445
|
-
}, n =
|
|
2445
|
+
}, n = Ve.batch(
|
|
2446
2446
|
() => v(this, Ce).findAll(e).filter((i) => !i.isDisabled() && !i.isStatic()).map((i) => {
|
|
2447
2447
|
let a = i.fetch(void 0, r);
|
|
2448
2448
|
return r.throwOnError || (a = a.catch(Qe)), i.state.fetchStatus === "paused" ? Promise.resolve() : a;
|
|
@@ -2483,7 +2483,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2483
2483
|
return v(this, zt);
|
|
2484
2484
|
}
|
|
2485
2485
|
setDefaultOptions(e) {
|
|
2486
|
-
|
|
2486
|
+
Z(this, zt, e);
|
|
2487
2487
|
}
|
|
2488
2488
|
setQueryDefaults(e, t) {
|
|
2489
2489
|
v(this, Rr).set(nn(e), {
|
|
@@ -2555,7 +2555,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2555
2555
|
ae(this, ur);
|
|
2556
2556
|
ae(this, qt);
|
|
2557
2557
|
ae(this, Nr, /* @__PURE__ */ new Set());
|
|
2558
|
-
this.options = r,
|
|
2558
|
+
this.options = r, Z(this, He, t), Z(this, Lt, null), Z(this, Nt, zi()), this.options.experimental_prefetchInRender || v(this, Nt).reject(
|
|
2559
2559
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
2560
2560
|
), this.bindMethods(), this.setOptions(r);
|
|
2561
2561
|
}
|
|
@@ -2608,7 +2608,7 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2608
2608
|
}
|
|
2609
2609
|
getOptimisticResult(t) {
|
|
2610
2610
|
const r = v(this, He).getQueryCache().build(v(this, He), t), n = this.createResult(r, t);
|
|
2611
|
-
return $c(this, n) && (
|
|
2611
|
+
return $c(this, n) && (Z(this, Be, n), Z(this, Mr, this.options), Z(this, lr, v(this, pe).state)), n;
|
|
2612
2612
|
}
|
|
2613
2613
|
getCurrentResult() {
|
|
2614
2614
|
return v(this, Be);
|
|
@@ -2644,8 +2644,8 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2644
2644
|
const n = v(this, pe), i = this.options, a = v(this, Be), s = v(this, lr), o = v(this, Mr), p = t !== n ? t.state : v(this, un), { state: d } = t;
|
|
2645
2645
|
let f = { ...d }, m = !1, b;
|
|
2646
2646
|
if (r._optimisticResults) {
|
|
2647
|
-
const u = this.hasListeners(),
|
|
2648
|
-
(
|
|
2647
|
+
const u = this.hasListeners(), D = !u && Ga(t, r), k = u && Ya(t, n, r, i);
|
|
2648
|
+
(D || k) && (f = {
|
|
2649
2649
|
...f,
|
|
2650
2650
|
..._o(d.data, t.options)
|
|
2651
2651
|
}), r._optimisticResults === "isRestoring" && (f.fetchStatus = "idle");
|
|
@@ -2669,12 +2669,12 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2669
2669
|
b = v(this, zr);
|
|
2670
2670
|
else
|
|
2671
2671
|
try {
|
|
2672
|
-
|
|
2672
|
+
Z(this, dn, r.select), b = r.select(b), b = Mi(a == null ? void 0 : a.data, b, r), Z(this, zr, b), Z(this, Lt, null);
|
|
2673
2673
|
} catch (u) {
|
|
2674
|
-
|
|
2674
|
+
Z(this, Lt, u);
|
|
2675
2675
|
}
|
|
2676
2676
|
v(this, Lt) && (h = v(this, Lt), b = v(this, zr), c = Date.now(), x = "error");
|
|
2677
|
-
const O = f.fetchStatus === "fetching", F = x === "pending", C = x === "error", w = F && O, M = b !== void 0,
|
|
2677
|
+
const O = f.fetchStatus === "fetching", F = x === "pending", C = x === "error", w = F && O, M = b !== void 0, J = {
|
|
2678
2678
|
status: x,
|
|
2679
2679
|
fetchStatus: f.fetchStatus,
|
|
2680
2680
|
isPending: F,
|
|
@@ -2704,9 +2704,9 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2704
2704
|
};
|
|
2705
2705
|
if (this.options.experimental_prefetchInRender) {
|
|
2706
2706
|
const u = (P) => {
|
|
2707
|
-
|
|
2708
|
-
},
|
|
2709
|
-
const P =
|
|
2707
|
+
J.status === "error" ? P.reject(J.error) : J.data !== void 0 && P.resolve(J.data);
|
|
2708
|
+
}, D = () => {
|
|
2709
|
+
const P = Z(this, Nt, J.promise = zi());
|
|
2710
2710
|
u(P);
|
|
2711
2711
|
}, k = v(this, Nt);
|
|
2712
2712
|
switch (k.status) {
|
|
@@ -2714,20 +2714,20 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2714
2714
|
t.queryHash === n.queryHash && u(k);
|
|
2715
2715
|
break;
|
|
2716
2716
|
case "fulfilled":
|
|
2717
|
-
(
|
|
2717
|
+
(J.status === "error" || J.data !== k.value) && D();
|
|
2718
2718
|
break;
|
|
2719
2719
|
case "rejected":
|
|
2720
|
-
(
|
|
2720
|
+
(J.status !== "error" || J.error !== k.reason) && D();
|
|
2721
2721
|
break;
|
|
2722
2722
|
}
|
|
2723
2723
|
}
|
|
2724
|
-
return
|
|
2724
|
+
return J;
|
|
2725
2725
|
}
|
|
2726
2726
|
updateResult() {
|
|
2727
2727
|
const t = v(this, Be), r = this.createResult(v(this, pe), this.options);
|
|
2728
|
-
if (
|
|
2728
|
+
if (Z(this, lr, v(this, pe).state), Z(this, Mr, this.options), v(this, lr).data !== void 0 && Z(this, Vr, v(this, pe)), ji(r, t))
|
|
2729
2729
|
return;
|
|
2730
|
-
|
|
2730
|
+
Z(this, Be, r);
|
|
2731
2731
|
const n = () => {
|
|
2732
2732
|
if (!t)
|
|
2733
2733
|
return !0;
|
|
@@ -2763,29 +2763,29 @@ var Ce, Mt, zt, Rr, Pr, Vt, jr, Ir, ro, Cc = (ro = class {
|
|
|
2763
2763
|
if (pr || v(this, Be).isStale || !Ri(t))
|
|
2764
2764
|
return;
|
|
2765
2765
|
const n = wo(v(this, Be).dataUpdatedAt, t) + 1;
|
|
2766
|
-
|
|
2766
|
+
Z(this, cr, setTimeout(() => {
|
|
2767
2767
|
v(this, Be).isStale || this.updateResult();
|
|
2768
2768
|
}, n));
|
|
2769
2769
|
}, Ni = function() {
|
|
2770
2770
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(v(this, pe)) : this.options.refetchInterval) ?? !1;
|
|
2771
2771
|
}, Li = function(t) {
|
|
2772
|
-
de(this, ye, Ui).call(this),
|
|
2772
|
+
de(this, ye, Ui).call(this), Z(this, qt, t), !(pr || rt(this.options.enabled, v(this, pe)) === !1 || !Ri(v(this, qt)) || v(this, qt) === 0) && Z(this, ur, setInterval(() => {
|
|
2773
2773
|
(this.options.refetchIntervalInBackground || pa.isFocused()) && de(this, ye, Yr).call(this);
|
|
2774
2774
|
}, v(this, qt)));
|
|
2775
2775
|
}, qi = function() {
|
|
2776
2776
|
de(this, ye, Vi).call(this), de(this, ye, Li).call(this, de(this, ye, Ni).call(this));
|
|
2777
2777
|
}, Bi = function() {
|
|
2778
|
-
v(this, cr) && (clearTimeout(v(this, cr)),
|
|
2778
|
+
v(this, cr) && (clearTimeout(v(this, cr)), Z(this, cr, void 0));
|
|
2779
2779
|
}, Ui = function() {
|
|
2780
|
-
v(this, ur) && (clearInterval(v(this, ur)),
|
|
2780
|
+
v(this, ur) && (clearInterval(v(this, ur)), Z(this, ur, void 0));
|
|
2781
2781
|
}, Wi = function() {
|
|
2782
2782
|
const t = v(this, He).getQueryCache().build(v(this, He), this.options);
|
|
2783
2783
|
if (t === v(this, pe))
|
|
2784
2784
|
return;
|
|
2785
2785
|
const r = v(this, pe);
|
|
2786
|
-
|
|
2786
|
+
Z(this, pe, t), Z(this, un, t.state), this.hasListeners() && (r == null || r.removeObserver(this), t.addObserver(this));
|
|
2787
2787
|
}, Co = function(t) {
|
|
2788
|
-
|
|
2788
|
+
Ve.batch(() => {
|
|
2789
2789
|
t.listeners && this.listeners.forEach((r) => {
|
|
2790
2790
|
r(v(this, Be));
|
|
2791
2791
|
}), v(this, He).getQueryCache().notify({
|
|
@@ -2828,7 +2828,7 @@ var Ao = Ae.createContext(
|
|
|
2828
2828
|
children: t
|
|
2829
2829
|
}) => (Ae.useEffect(() => (e.mount(), () => {
|
|
2830
2830
|
e.unmount();
|
|
2831
|
-
}), [e]), /* @__PURE__ */
|
|
2831
|
+
}), [e]), /* @__PURE__ */ $(Ao.Provider, { value: e, children: t })), Fo = Ae.createContext(!1), Pc = () => Ae.useContext(Fo);
|
|
2832
2832
|
Fo.Provider;
|
|
2833
2833
|
function jc() {
|
|
2834
2834
|
let e = !1;
|
|
@@ -2884,7 +2884,7 @@ function Uc(e, t, r) {
|
|
|
2884
2884
|
if (Ae.useSyncExternalStore(
|
|
2885
2885
|
Ae.useCallback(
|
|
2886
2886
|
(x) => {
|
|
2887
|
-
const y = d ? l.subscribe(
|
|
2887
|
+
const y = d ? l.subscribe(Ve.batchCalls(x)) : Qe;
|
|
2888
2888
|
return l.updateResult(), y;
|
|
2889
2889
|
},
|
|
2890
2890
|
[l, d]
|
|
@@ -2932,7 +2932,7 @@ const Hc = ({
|
|
|
2932
2932
|
style: i,
|
|
2933
2933
|
className: a,
|
|
2934
2934
|
onClick: s
|
|
2935
|
-
}) => /* @__PURE__ */
|
|
2935
|
+
}) => /* @__PURE__ */ $(Se, { sx: { textAlign: "center" }, children: /* @__PURE__ */ $(
|
|
2936
2936
|
"img",
|
|
2937
2937
|
{
|
|
2938
2938
|
src: e || "/placeholder-image.png",
|
|
@@ -3002,11 +3002,11 @@ async function Kc(e, t, r, n) {
|
|
|
3002
3002
|
}
|
|
3003
3003
|
}
|
|
3004
3004
|
function Qc(e, t, r, n, i = !1) {
|
|
3005
|
-
const a =
|
|
3005
|
+
const a = ze(() => {
|
|
3006
3006
|
if (!(e != null && e.dependsOn) || !n) return null;
|
|
3007
3007
|
const o = n[e.dependsOn];
|
|
3008
3008
|
return o !== void 0 ? o : null;
|
|
3009
|
-
}, [e == null ? void 0 : e.dependsOn, n]), s =
|
|
3009
|
+
}, [e == null ? void 0 : e.dependsOn, n]), s = ze(() => [
|
|
3010
3010
|
"api-data",
|
|
3011
3011
|
e == null ? void 0 : e.endpoint,
|
|
3012
3012
|
e == null ? void 0 : e.method,
|
|
@@ -3067,11 +3067,11 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3067
3067
|
const s = r[e.name], o = !!s, [l, p] = Xt(!1), d = xt(!1), f = () => {
|
|
3068
3068
|
var k;
|
|
3069
3069
|
return e.required !== void 0 ? e.required : ((k = e.validation) == null ? void 0 : k.required) !== void 0 ? e.validation.required : !1;
|
|
3070
|
-
}, m = (k) => f() ? `${k} *` : k, b = () => e.value !== void 0 ? e.value : e.type === "checkbox" ? !1 : e.type === "select" && e.default ? e.default : e.type === "autocomplete" && e.multiple ? [] : "", h =
|
|
3070
|
+
}, m = (k) => f() ? `${k} *` : k, b = () => e.value !== void 0 ? e.value : e.type === "checkbox" ? !1 : e.type === "select" && e.default ? e.default : e.type === "autocomplete" && e.multiple ? [] : "", h = ze(() => $o(e), [e.apiConfig, e.api_endpoint, e.api_method, e.value_field, e.label_field, e.depends_on, e.conditional]), c = xt(null), x = h != null && h.dependsOn ? a == null ? void 0 : a[h.dependsOn] : null, y = ze(() => {
|
|
3071
3071
|
if (!(h != null && h.dependsOn)) return !1;
|
|
3072
|
-
const k = x, P = c.current,
|
|
3073
|
-
return
|
|
3074
|
-
}, [h == null ? void 0 : h.dependsOn, x]), O =
|
|
3072
|
+
const k = x, P = c.current, z = k !== P;
|
|
3073
|
+
return z && (c.current = k), z;
|
|
3074
|
+
}, [h == null ? void 0 : h.dependsOn, x]), O = ze(() => !0, []), F = ze(() => l && xr(e) && (!(h != null && h.dependsOn) || x), [l, e, h == null ? void 0 : h.dependsOn, x]), C = ze(() => {
|
|
3075
3075
|
if (!(h != null && h.dependsOn) || !a) return {};
|
|
3076
3076
|
const k = {};
|
|
3077
3077
|
return h.dependsOn && a[h.dependsOn] !== void 0 && (k[h.dependsOn] = a[h.dependsOn]), k;
|
|
@@ -3086,7 +3086,7 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3086
3086
|
C,
|
|
3087
3087
|
// Only pass dependent values, not entire formData
|
|
3088
3088
|
F
|
|
3089
|
-
),
|
|
3089
|
+
), J = Pe(() => {
|
|
3090
3090
|
xr(e) && !d.current && (d.current = !0, p(!0));
|
|
3091
3091
|
}, [e]), H = Pe(() => {
|
|
3092
3092
|
xr(e) && !d.current && (d.current = !0, p(!0));
|
|
@@ -3100,10 +3100,10 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3100
3100
|
xr(e) && (h != null && h.dependsOn) && y && d.current && (d.current = !1, p(!1));
|
|
3101
3101
|
}, [y, h == null ? void 0 : h.dependsOn]);
|
|
3102
3102
|
const u = Pe(() => xr(e) ? w : e.type === "select" || e.type === "toggle" || e.type === "radio" || e.type === "autocomplete" ? e.options || [] : [], [e, w]);
|
|
3103
|
-
return O ? /* @__PURE__ */
|
|
3103
|
+
return O ? /* @__PURE__ */ $(Se, { children: (() => {
|
|
3104
3104
|
switch (e.type) {
|
|
3105
3105
|
case "title":
|
|
3106
|
-
return /* @__PURE__ */
|
|
3106
|
+
return /* @__PURE__ */ $(
|
|
3107
3107
|
Me,
|
|
3108
3108
|
{
|
|
3109
3109
|
variant: e.variant || "h4",
|
|
@@ -3115,7 +3115,7 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3115
3115
|
}
|
|
3116
3116
|
);
|
|
3117
3117
|
case "section":
|
|
3118
|
-
return /* @__PURE__ */
|
|
3118
|
+
return /* @__PURE__ */ $(
|
|
3119
3119
|
Me,
|
|
3120
3120
|
{
|
|
3121
3121
|
variant: e.variant || "h6",
|
|
@@ -3130,13 +3130,13 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3130
3130
|
case "email":
|
|
3131
3131
|
case "password":
|
|
3132
3132
|
case "tel":
|
|
3133
|
-
return /* @__PURE__ */
|
|
3133
|
+
return /* @__PURE__ */ $(
|
|
3134
3134
|
pt,
|
|
3135
3135
|
{
|
|
3136
3136
|
name: e.name,
|
|
3137
3137
|
control: t,
|
|
3138
3138
|
defaultValue: b(),
|
|
3139
|
-
render: ({ field: V }) => /* @__PURE__ */
|
|
3139
|
+
render: ({ field: V }) => /* @__PURE__ */ $(
|
|
3140
3140
|
wn,
|
|
3141
3141
|
{
|
|
3142
3142
|
...V,
|
|
@@ -3153,13 +3153,13 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3153
3153
|
}
|
|
3154
3154
|
);
|
|
3155
3155
|
case "number":
|
|
3156
|
-
return /* @__PURE__ */
|
|
3156
|
+
return /* @__PURE__ */ $(
|
|
3157
3157
|
pt,
|
|
3158
3158
|
{
|
|
3159
3159
|
name: e.name,
|
|
3160
3160
|
control: t,
|
|
3161
3161
|
defaultValue: b(),
|
|
3162
|
-
render: ({ field: V }) => /* @__PURE__ */
|
|
3162
|
+
render: ({ field: V }) => /* @__PURE__ */ $(
|
|
3163
3163
|
wn,
|
|
3164
3164
|
{
|
|
3165
3165
|
...V,
|
|
@@ -3181,45 +3181,45 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3181
3181
|
);
|
|
3182
3182
|
case "select":
|
|
3183
3183
|
const k = u();
|
|
3184
|
-
return /* @__PURE__ */
|
|
3184
|
+
return /* @__PURE__ */ $(
|
|
3185
3185
|
pt,
|
|
3186
3186
|
{
|
|
3187
3187
|
name: e.name,
|
|
3188
3188
|
control: t,
|
|
3189
3189
|
defaultValue: b(),
|
|
3190
3190
|
render: ({ field: V }) => /* @__PURE__ */ Oe(mi, { fullWidth: !0, error: o || !!G, children: [
|
|
3191
|
-
/* @__PURE__ */
|
|
3192
|
-
/* @__PURE__ */
|
|
3191
|
+
/* @__PURE__ */ $($l, { id: e.id, children: m(e.label) }),
|
|
3192
|
+
/* @__PURE__ */ $(
|
|
3193
3193
|
Dl,
|
|
3194
3194
|
{
|
|
3195
3195
|
...V,
|
|
3196
3196
|
labelId: e.id,
|
|
3197
3197
|
label: m(e.label),
|
|
3198
3198
|
disabled: e.disabled || M,
|
|
3199
|
-
endAdornment: M ? /* @__PURE__ */
|
|
3200
|
-
onOpen:
|
|
3201
|
-
children: M ? /* @__PURE__ */
|
|
3202
|
-
/* @__PURE__ */
|
|
3203
|
-
/* @__PURE__ */
|
|
3204
|
-
] }) }) : k.length > 0 ? k.map((
|
|
3199
|
+
endAdornment: M ? /* @__PURE__ */ $(_r, { size: 20 }) : void 0,
|
|
3200
|
+
onOpen: J,
|
|
3201
|
+
children: M ? /* @__PURE__ */ $(En, { disabled: !0, children: /* @__PURE__ */ Oe(Se, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
|
|
3202
|
+
/* @__PURE__ */ $(_r, { size: 16 }),
|
|
3203
|
+
/* @__PURE__ */ $(Me, { variant: "body2", children: "Fetching data..." })
|
|
3204
|
+
] }) }) : k.length > 0 ? k.map((L) => /* @__PURE__ */ $(En, { value: L.value, children: L.label }, L.value)) : l && !M ? /* @__PURE__ */ $(En, { disabled: !0, children: /* @__PURE__ */ $(Me, { variant: "body2", color: "text.secondary", children: "No options available" }) }) : /* @__PURE__ */ $(En, { disabled: !0, children: /* @__PURE__ */ $(Me, { variant: "body2", color: "text.secondary", children: "Click to load options" }) })
|
|
3205
3205
|
}
|
|
3206
3206
|
),
|
|
3207
|
-
(o || G) && /* @__PURE__ */
|
|
3207
|
+
(o || G) && /* @__PURE__ */ $(Hr, { children: (s == null ? void 0 : s.message) || (G == null ? void 0 : G.message) })
|
|
3208
3208
|
] })
|
|
3209
3209
|
}
|
|
3210
3210
|
);
|
|
3211
3211
|
case "checkbox":
|
|
3212
|
-
return /* @__PURE__ */
|
|
3212
|
+
return /* @__PURE__ */ $(
|
|
3213
3213
|
pt,
|
|
3214
3214
|
{
|
|
3215
3215
|
name: e.name,
|
|
3216
3216
|
control: t,
|
|
3217
3217
|
defaultValue: b(),
|
|
3218
3218
|
render: ({ field: V }) => /* @__PURE__ */ Oe(Se, { sx: { mt: 1, mb: 0 }, children: [
|
|
3219
|
-
/* @__PURE__ */
|
|
3219
|
+
/* @__PURE__ */ $(
|
|
3220
3220
|
Sn,
|
|
3221
3221
|
{
|
|
3222
|
-
control: /* @__PURE__ */
|
|
3222
|
+
control: /* @__PURE__ */ $(
|
|
3223
3223
|
_a,
|
|
3224
3224
|
{
|
|
3225
3225
|
...V,
|
|
@@ -3231,79 +3231,79 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3231
3231
|
label: m(e.label)
|
|
3232
3232
|
}
|
|
3233
3233
|
),
|
|
3234
|
-
o && /* @__PURE__ */
|
|
3234
|
+
o && /* @__PURE__ */ $(Hr, { error: !0, sx: { ml: 0 }, children: s == null ? void 0 : s.message })
|
|
3235
3235
|
] })
|
|
3236
3236
|
}
|
|
3237
3237
|
);
|
|
3238
3238
|
case "toggle":
|
|
3239
|
-
return /* @__PURE__ */
|
|
3239
|
+
return /* @__PURE__ */ $(
|
|
3240
3240
|
pt,
|
|
3241
3241
|
{
|
|
3242
3242
|
name: e.name,
|
|
3243
3243
|
control: t,
|
|
3244
3244
|
defaultValue: b(),
|
|
3245
3245
|
render: ({ field: V }) => /* @__PURE__ */ Oe(mi, { component: "fieldset", error: o, children: [
|
|
3246
|
-
/* @__PURE__ */
|
|
3247
|
-
/* @__PURE__ */
|
|
3246
|
+
/* @__PURE__ */ $(Me, { variant: "body2", component: "legend", sx: { mb: 1 }, children: m(e.label) }),
|
|
3247
|
+
/* @__PURE__ */ $(
|
|
3248
3248
|
Ca,
|
|
3249
3249
|
{
|
|
3250
3250
|
...V,
|
|
3251
3251
|
row: !0,
|
|
3252
|
-
children: e.options.map((
|
|
3252
|
+
children: e.options.map((L) => /* @__PURE__ */ $(
|
|
3253
3253
|
Sn,
|
|
3254
3254
|
{
|
|
3255
|
-
value:
|
|
3256
|
-
control: /* @__PURE__ */
|
|
3257
|
-
label:
|
|
3255
|
+
value: L.value,
|
|
3256
|
+
control: /* @__PURE__ */ $(Aa, {}),
|
|
3257
|
+
label: L.label
|
|
3258
3258
|
},
|
|
3259
|
-
|
|
3259
|
+
L.value
|
|
3260
3260
|
))
|
|
3261
3261
|
}
|
|
3262
3262
|
),
|
|
3263
|
-
o && /* @__PURE__ */
|
|
3263
|
+
o && /* @__PURE__ */ $(Hr, { error: !0, children: s == null ? void 0 : s.message })
|
|
3264
3264
|
] })
|
|
3265
3265
|
}
|
|
3266
3266
|
);
|
|
3267
3267
|
case "radio":
|
|
3268
|
-
return /* @__PURE__ */
|
|
3268
|
+
return /* @__PURE__ */ $(
|
|
3269
3269
|
pt,
|
|
3270
3270
|
{
|
|
3271
3271
|
name: e.name,
|
|
3272
3272
|
control: t,
|
|
3273
3273
|
defaultValue: b(),
|
|
3274
3274
|
render: ({ field: V }) => /* @__PURE__ */ Oe(mi, { component: "fieldset", error: o, children: [
|
|
3275
|
-
/* @__PURE__ */
|
|
3276
|
-
/* @__PURE__ */
|
|
3275
|
+
/* @__PURE__ */ $(Me, { variant: "body2", component: "legend", sx: { mb: 1 }, children: m(e.label) }),
|
|
3276
|
+
/* @__PURE__ */ $(
|
|
3277
3277
|
Ca,
|
|
3278
3278
|
{
|
|
3279
3279
|
...V,
|
|
3280
|
-
children: e.options.map((
|
|
3280
|
+
children: e.options.map((L) => /* @__PURE__ */ $(
|
|
3281
3281
|
Sn,
|
|
3282
3282
|
{
|
|
3283
|
-
value:
|
|
3284
|
-
control: /* @__PURE__ */
|
|
3285
|
-
label:
|
|
3283
|
+
value: L.value,
|
|
3284
|
+
control: /* @__PURE__ */ $(Aa, {}),
|
|
3285
|
+
label: L.label
|
|
3286
3286
|
},
|
|
3287
|
-
|
|
3287
|
+
L.value
|
|
3288
3288
|
))
|
|
3289
3289
|
}
|
|
3290
3290
|
),
|
|
3291
|
-
o && /* @__PURE__ */
|
|
3291
|
+
o && /* @__PURE__ */ $(Hr, { error: !0, children: s == null ? void 0 : s.message })
|
|
3292
3292
|
] })
|
|
3293
3293
|
}
|
|
3294
3294
|
);
|
|
3295
3295
|
case "switch":
|
|
3296
|
-
return /* @__PURE__ */
|
|
3296
|
+
return /* @__PURE__ */ $(
|
|
3297
3297
|
pt,
|
|
3298
3298
|
{
|
|
3299
3299
|
name: e.name,
|
|
3300
3300
|
control: t,
|
|
3301
3301
|
defaultValue: b(),
|
|
3302
3302
|
render: ({ field: V }) => /* @__PURE__ */ Oe(Se, { sx: { mt: 1, mb: 0 }, children: [
|
|
3303
|
-
/* @__PURE__ */
|
|
3303
|
+
/* @__PURE__ */ $(
|
|
3304
3304
|
Sn,
|
|
3305
3305
|
{
|
|
3306
|
-
control: /* @__PURE__ */
|
|
3306
|
+
control: /* @__PURE__ */ $(
|
|
3307
3307
|
Fl,
|
|
3308
3308
|
{
|
|
3309
3309
|
...V,
|
|
@@ -3315,136 +3315,136 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3315
3315
|
label: m(e.label)
|
|
3316
3316
|
}
|
|
3317
3317
|
),
|
|
3318
|
-
o && /* @__PURE__ */
|
|
3318
|
+
o && /* @__PURE__ */ $(Hr, { error: !0, sx: { ml: 0 }, children: s == null ? void 0 : s.message })
|
|
3319
3319
|
] })
|
|
3320
3320
|
}
|
|
3321
3321
|
);
|
|
3322
3322
|
case "autocomplete":
|
|
3323
|
-
const P = u(),
|
|
3324
|
-
return /* @__PURE__ */
|
|
3323
|
+
const P = u(), z = !!(e.disabled || M || h != null && h.dependsOn && !x);
|
|
3324
|
+
return /* @__PURE__ */ $(
|
|
3325
3325
|
pt,
|
|
3326
3326
|
{
|
|
3327
3327
|
name: e.name,
|
|
3328
3328
|
control: t,
|
|
3329
3329
|
defaultValue: b(),
|
|
3330
3330
|
render: ({ field: V }) => {
|
|
3331
|
-
const
|
|
3332
|
-
if (
|
|
3333
|
-
if (typeof
|
|
3334
|
-
if (typeof
|
|
3335
|
-
if (
|
|
3336
|
-
if (
|
|
3337
|
-
if (
|
|
3331
|
+
const L = V.value, se = e.multiple === !0, ce = (h == null ? void 0 : h.valueField) || e.value_field || "value", ue = (h == null ? void 0 : h.labelField) || e.label_field || "label", j = (N) => {
|
|
3332
|
+
if (N != null) {
|
|
3333
|
+
if (typeof N == "string" || typeof N == "number") return N;
|
|
3334
|
+
if (typeof N == "object") {
|
|
3335
|
+
if (N[ce] !== void 0) return N[ce];
|
|
3336
|
+
if (N.value !== void 0) return N.value;
|
|
3337
|
+
if (N.id !== void 0) return N.id;
|
|
3338
3338
|
}
|
|
3339
3339
|
}
|
|
3340
|
-
},
|
|
3340
|
+
}, W = (() => {
|
|
3341
3341
|
if (se)
|
|
3342
|
-
return (Array.isArray(
|
|
3343
|
-
const
|
|
3344
|
-
const
|
|
3345
|
-
return
|
|
3342
|
+
return (Array.isArray(L) ? L : []).map((U) => {
|
|
3343
|
+
const Y = P.find((ne) => {
|
|
3344
|
+
const re = j(ne);
|
|
3345
|
+
return re !== void 0 && re === U;
|
|
3346
3346
|
});
|
|
3347
|
-
return
|
|
3348
|
-
[
|
|
3349
|
-
[
|
|
3350
|
-
value:
|
|
3351
|
-
label: `Selected: ${
|
|
3347
|
+
return Y || {
|
|
3348
|
+
[ce]: U,
|
|
3349
|
+
[ue]: `Selected: ${U}`,
|
|
3350
|
+
value: U,
|
|
3351
|
+
label: `Selected: ${U}`
|
|
3352
3352
|
};
|
|
3353
3353
|
});
|
|
3354
3354
|
{
|
|
3355
|
-
if (
|
|
3356
|
-
const
|
|
3357
|
-
const
|
|
3358
|
-
return
|
|
3355
|
+
if (L == null || L === "") return null;
|
|
3356
|
+
const N = P.find((U) => {
|
|
3357
|
+
const Y = j(U);
|
|
3358
|
+
return Y !== void 0 && Y === L;
|
|
3359
3359
|
});
|
|
3360
|
-
return
|
|
3361
|
-
[
|
|
3362
|
-
[
|
|
3363
|
-
value:
|
|
3364
|
-
label: `Selected: ${
|
|
3360
|
+
return N || {
|
|
3361
|
+
[ce]: L,
|
|
3362
|
+
[ue]: `Selected: ${L}`,
|
|
3363
|
+
value: L,
|
|
3364
|
+
label: `Selected: ${L}`
|
|
3365
3365
|
};
|
|
3366
3366
|
}
|
|
3367
3367
|
})();
|
|
3368
|
-
return /* @__PURE__ */
|
|
3368
|
+
return /* @__PURE__ */ $(
|
|
3369
3369
|
Al,
|
|
3370
3370
|
{
|
|
3371
3371
|
...V,
|
|
3372
3372
|
id: e.id,
|
|
3373
3373
|
options: P,
|
|
3374
|
-
value:
|
|
3375
|
-
getOptionLabel: (
|
|
3376
|
-
isOptionEqualToValue: (
|
|
3377
|
-
const
|
|
3378
|
-
return
|
|
3374
|
+
value: W,
|
|
3375
|
+
getOptionLabel: (N) => typeof N == "string" ? N : N[ue] || N.label || N.name || "",
|
|
3376
|
+
isOptionEqualToValue: (N, U) => {
|
|
3377
|
+
const Y = j(N), ne = j(U);
|
|
3378
|
+
return Y === void 0 || ne === void 0 ? !1 : Y === ne;
|
|
3379
3379
|
},
|
|
3380
3380
|
multiple: e.multiple,
|
|
3381
3381
|
disableCloseOnSelect: se,
|
|
3382
3382
|
freeSolo: e.freeSolo,
|
|
3383
3383
|
filterOptions: e.filterOptions === !1 ? () => P : void 0,
|
|
3384
|
-
disabled:
|
|
3384
|
+
disabled: z,
|
|
3385
3385
|
loading: M,
|
|
3386
3386
|
onOpen: H,
|
|
3387
|
-
renderOption: (
|
|
3388
|
-
const
|
|
3389
|
-
return /* @__PURE__ */ Oe("li", { ...
|
|
3390
|
-
se && /* @__PURE__ */
|
|
3387
|
+
renderOption: (N, U, { selected: Y }) => {
|
|
3388
|
+
const ne = typeof U == "string" ? U : U[ue] || U.label || U.name || "";
|
|
3389
|
+
return /* @__PURE__ */ Oe("li", { ...N, children: [
|
|
3390
|
+
se && /* @__PURE__ */ $(
|
|
3391
3391
|
_a,
|
|
3392
3392
|
{
|
|
3393
3393
|
style: { marginRight: 8 },
|
|
3394
|
-
checked:
|
|
3394
|
+
checked: Y
|
|
3395
3395
|
}
|
|
3396
3396
|
),
|
|
3397
|
-
|
|
3397
|
+
ne
|
|
3398
3398
|
] });
|
|
3399
3399
|
},
|
|
3400
|
-
renderTags: se ? (
|
|
3401
|
-
const
|
|
3402
|
-
const
|
|
3403
|
-
return /* @__PURE__ */ io(zn, { ...
|
|
3404
|
-
}),
|
|
3405
|
-
return
|
|
3400
|
+
renderTags: se ? (N, U) => {
|
|
3401
|
+
const ne = N.slice(0, 2).map((X, R) => {
|
|
3402
|
+
const ee = typeof X == "string" ? X : X[ue] || X.label || X.name || "", Q = U({ index: R });
|
|
3403
|
+
return /* @__PURE__ */ io(zn, { ...Q, key: R, label: ee, size: "small" });
|
|
3404
|
+
}), re = N.length - 2;
|
|
3405
|
+
return re > 0 && ne.push(/* @__PURE__ */ $(zn, { label: `+${re} more`, size: "small" }, "more")), ne;
|
|
3406
3406
|
} : void 0,
|
|
3407
|
-
renderInput: (
|
|
3407
|
+
renderInput: (N) => /* @__PURE__ */ $(
|
|
3408
3408
|
wn,
|
|
3409
3409
|
{
|
|
3410
|
-
...
|
|
3410
|
+
...N,
|
|
3411
3411
|
label: m(e.label),
|
|
3412
|
-
placeholder:
|
|
3412
|
+
placeholder: z && (h != null && h.dependsOn) && !x ? `Please select ${h.dependsOn.replace(/_/g, " ")} first` : e.placeholder,
|
|
3413
3413
|
error: o || !!G,
|
|
3414
3414
|
helperText: (s == null ? void 0 : s.message) || (G == null ? void 0 : G.message) || "",
|
|
3415
3415
|
InputProps: {
|
|
3416
|
-
...
|
|
3416
|
+
...N.InputProps,
|
|
3417
3417
|
endAdornment: /* @__PURE__ */ Oe(kl, { children: [
|
|
3418
|
-
M ? /* @__PURE__ */
|
|
3419
|
-
|
|
3418
|
+
M ? /* @__PURE__ */ $(_r, { color: "inherit", size: 20 }) : null,
|
|
3419
|
+
N.InputProps.endAdornment
|
|
3420
3420
|
] })
|
|
3421
3421
|
}
|
|
3422
3422
|
}
|
|
3423
3423
|
),
|
|
3424
|
-
onChange: (
|
|
3425
|
-
const
|
|
3424
|
+
onChange: (N, U) => {
|
|
3425
|
+
const Y = (h == null ? void 0 : h.valueField) || e.value_field || "value";
|
|
3426
3426
|
if (se) {
|
|
3427
|
-
const
|
|
3428
|
-
V.onChange(
|
|
3427
|
+
const re = (Array.isArray(U) ? U : []).map((X) => typeof X == "object" && (X[Y] || X.value || X.id) || X);
|
|
3428
|
+
V.onChange(re);
|
|
3429
3429
|
} else {
|
|
3430
|
-
let
|
|
3431
|
-
|
|
3430
|
+
let ne;
|
|
3431
|
+
U && typeof U == "object" ? ne = U[Y] || U.value || U.id || U : ne = U, V.onChange(ne);
|
|
3432
3432
|
}
|
|
3433
3433
|
},
|
|
3434
|
-
noOptionsText:
|
|
3434
|
+
noOptionsText: z && (h != null && h.dependsOn) && !x ? `Please select ${h.dependsOn.replace(/_/g, " ")} first` : M ? "Fetching data..." : l && !M && P.length === 0 ? "No options available" : "Click to load options"
|
|
3435
3435
|
}
|
|
3436
3436
|
);
|
|
3437
3437
|
}
|
|
3438
3438
|
}
|
|
3439
3439
|
);
|
|
3440
3440
|
case "date":
|
|
3441
|
-
return /* @__PURE__ */
|
|
3441
|
+
return /* @__PURE__ */ $(
|
|
3442
3442
|
pt,
|
|
3443
3443
|
{
|
|
3444
3444
|
name: e.name,
|
|
3445
3445
|
control: t,
|
|
3446
3446
|
defaultValue: b(),
|
|
3447
|
-
render: ({ field: V }) => /* @__PURE__ */
|
|
3447
|
+
render: ({ field: V }) => /* @__PURE__ */ $(
|
|
3448
3448
|
wn,
|
|
3449
3449
|
{
|
|
3450
3450
|
...V,
|
|
@@ -3467,13 +3467,13 @@ const Gc = ({ field: e, control: t, errors: r, baseUrl: n, apiHeaders: i, formDa
|
|
|
3467
3467
|
}
|
|
3468
3468
|
);
|
|
3469
3469
|
case "image":
|
|
3470
|
-
return /* @__PURE__ */
|
|
3470
|
+
return /* @__PURE__ */ $(
|
|
3471
3471
|
pt,
|
|
3472
3472
|
{
|
|
3473
3473
|
name: e.name,
|
|
3474
3474
|
control: t,
|
|
3475
3475
|
defaultValue: b(),
|
|
3476
|
-
render: ({ field: V }) => /* @__PURE__ */
|
|
3476
|
+
render: ({ field: V }) => /* @__PURE__ */ $(
|
|
3477
3477
|
Hc,
|
|
3478
3478
|
{
|
|
3479
3479
|
src: V.value || e.defaultValue || e.src,
|
|
@@ -3517,13 +3517,13 @@ function Yc() {
|
|
|
3517
3517
|
setter: function(y) {
|
|
3518
3518
|
var O = d(y);
|
|
3519
3519
|
return l.get(y) || l.set(y, function(C, w) {
|
|
3520
|
-
for (var M = 0, G = O.length,
|
|
3520
|
+
for (var M = 0, G = O.length, J = C; M < G - 1; ) {
|
|
3521
3521
|
var H = O[M];
|
|
3522
3522
|
if (H === "__proto__" || H === "constructor" || H === "prototype")
|
|
3523
3523
|
return C;
|
|
3524
|
-
|
|
3524
|
+
J = J[O[M++]];
|
|
3525
3525
|
}
|
|
3526
|
-
|
|
3526
|
+
J[O[M]] = w;
|
|
3527
3527
|
});
|
|
3528
3528
|
},
|
|
3529
3529
|
getter: function(y, O) {
|
|
@@ -3556,9 +3556,9 @@ function Yc() {
|
|
|
3556
3556
|
return y.match(t) || [""];
|
|
3557
3557
|
}
|
|
3558
3558
|
function m(y, O, F) {
|
|
3559
|
-
var C = y.length, w, M, G,
|
|
3559
|
+
var C = y.length, w, M, G, J;
|
|
3560
3560
|
for (M = 0; M < C; M++)
|
|
3561
|
-
w = y[M], w && (x(w) && (w = '"' + w + '"'),
|
|
3561
|
+
w = y[M], w && (x(w) && (w = '"' + w + '"'), J = b(w), G = !J && /^\d+$/.test(w), O.call(F, w, J, G, M, y));
|
|
3562
3562
|
}
|
|
3563
3563
|
function b(y) {
|
|
3564
3564
|
return typeof y == "string" && y && ["'", '"'].indexOf(y.charAt(0)) !== -1;
|
|
@@ -3886,20 +3886,20 @@ function br(e) {
|
|
|
3886
3886
|
abortEarly: x = s.spec.abortEarly,
|
|
3887
3887
|
disableStackTrace: y = s.spec.disableStackTrace
|
|
3888
3888
|
} = i;
|
|
3889
|
-
function O(
|
|
3890
|
-
return mr.isRef(
|
|
3889
|
+
function O(D) {
|
|
3890
|
+
return mr.isRef(D) ? D.getValue(r, h, c) : D;
|
|
3891
3891
|
}
|
|
3892
|
-
function F(
|
|
3892
|
+
function F(D = {}) {
|
|
3893
3893
|
const k = Object.assign({
|
|
3894
3894
|
value: r,
|
|
3895
3895
|
originalValue: a,
|
|
3896
3896
|
label: s.spec.label,
|
|
3897
|
-
path:
|
|
3897
|
+
path: D.path || n,
|
|
3898
3898
|
spec: s.spec,
|
|
3899
|
-
disableStackTrace:
|
|
3900
|
-
}, f,
|
|
3901
|
-
for (const
|
|
3902
|
-
const P = new Ge(Ge.formatError(
|
|
3899
|
+
disableStackTrace: D.disableStackTrace || y
|
|
3900
|
+
}, f, D.params);
|
|
3901
|
+
for (const z of Object.keys(k)) k[z] = O(k[z]);
|
|
3902
|
+
const P = new Ge(Ge.formatError(D.message || m, k), r, k.path, D.type || p, k.disableStackTrace);
|
|
3903
3903
|
return P.params = k, P;
|
|
3904
3904
|
}
|
|
3905
3905
|
const C = x ? o : l;
|
|
@@ -3914,10 +3914,10 @@ function br(e) {
|
|
|
3914
3914
|
originalValue: a,
|
|
3915
3915
|
schema: s
|
|
3916
3916
|
};
|
|
3917
|
-
const M = (
|
|
3918
|
-
Ge.isError(
|
|
3919
|
-
}, G = (
|
|
3920
|
-
Ge.isError(
|
|
3917
|
+
const M = (D) => {
|
|
3918
|
+
Ge.isError(D) ? C(D) : D ? l(null) : C(F());
|
|
3919
|
+
}, G = (D) => {
|
|
3920
|
+
Ge.isError(D) ? C(D) : o(D);
|
|
3921
3921
|
};
|
|
3922
3922
|
if (b && ut(r))
|
|
3923
3923
|
return M(!0);
|
|
@@ -3929,8 +3929,8 @@ function br(e) {
|
|
|
3929
3929
|
throw new Error(`Validation test of type: "${w.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);
|
|
3930
3930
|
return Promise.resolve(H).then(M, G);
|
|
3931
3931
|
}
|
|
3932
|
-
} catch (
|
|
3933
|
-
G(
|
|
3932
|
+
} catch (D) {
|
|
3933
|
+
G(D);
|
|
3934
3934
|
return;
|
|
3935
3935
|
}
|
|
3936
3936
|
M(H);
|
|
@@ -5276,7 +5276,7 @@ const Au = (e) => {
|
|
|
5276
5276
|
completedSteps: a = []
|
|
5277
5277
|
}) => {
|
|
5278
5278
|
const s = Array.from({ length: t }, (d, f) => f + 1), o = (d) => a.includes(d), l = (d) => d === e || o(d) || d === e + 1 && o(e), p = (d) => n[d - 1] ? n[d - 1] : `Step ${d}`;
|
|
5279
|
-
return /* @__PURE__ */
|
|
5279
|
+
return /* @__PURE__ */ $(Se, { sx: { mb: 3 }, children: /* @__PURE__ */ $(Rl, { activeStep: e - 1, orientation: "horizontal", children: s.map((d) => /* @__PURE__ */ $(Pl, { completed: o(d), children: /* @__PURE__ */ $(
|
|
5280
5280
|
jl,
|
|
5281
5281
|
{
|
|
5282
5282
|
onClick: () => l(d) && r(d),
|
|
@@ -5286,7 +5286,7 @@ const Au = (e) => {
|
|
|
5286
5286
|
opacity: 0.7
|
|
5287
5287
|
} : {}
|
|
5288
5288
|
},
|
|
5289
|
-
children: i && /* @__PURE__ */
|
|
5289
|
+
children: i && /* @__PURE__ */ $(Me, { variant: "body2", component: "span", children: p(d) })
|
|
5290
5290
|
}
|
|
5291
5291
|
) }, d)) }) });
|
|
5292
5292
|
}, $u = ({
|
|
@@ -5308,7 +5308,7 @@ const Au = (e) => {
|
|
|
5308
5308
|
onClick: o.onClick ? () => r(o) : void 0,
|
|
5309
5309
|
sx: o.sx,
|
|
5310
5310
|
children: [
|
|
5311
|
-
o.loading && /* @__PURE__ */
|
|
5311
|
+
o.loading && /* @__PURE__ */ $(_r, { size: 20, sx: { mr: 1 } }),
|
|
5312
5312
|
o.text
|
|
5313
5313
|
]
|
|
5314
5314
|
},
|
|
@@ -5316,9 +5316,9 @@ const Au = (e) => {
|
|
|
5316
5316
|
);
|
|
5317
5317
|
};
|
|
5318
5318
|
return /* @__PURE__ */ Oe(Se, { sx: { mt: 3, display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
5319
|
-
/* @__PURE__ */
|
|
5320
|
-
/* @__PURE__ */
|
|
5321
|
-
/* @__PURE__ */
|
|
5319
|
+
/* @__PURE__ */ $(Se, { sx: { display: "flex", gap: 2 }, children: n.map((o, l) => s(o, l)) }),
|
|
5320
|
+
/* @__PURE__ */ $(Se, { sx: { display: "flex", gap: 2 }, children: i.map((o, l) => s(o, l)) }),
|
|
5321
|
+
/* @__PURE__ */ $(Se, { sx: { display: "flex", gap: 2 }, children: a.map((o, l) => s(o, l)) })
|
|
5322
5322
|
] });
|
|
5323
5323
|
}, Du = ({
|
|
5324
5324
|
config: e,
|
|
@@ -5337,7 +5337,7 @@ const Au = (e) => {
|
|
|
5337
5337
|
y.onClick ? y.onClick() : O === "submit" && t ? t(s) : a && r && (y.text.toLowerCase().includes("next") ? r(n + 1, i) : (y.text.toLowerCase().includes("back") || y.text.toLowerCase().includes("previous")) && r(n - 1, i));
|
|
5338
5338
|
}, c = (y, O) => {
|
|
5339
5339
|
const { buttonType: F, buttonVariant: C } = m(y), w = b(y.color);
|
|
5340
|
-
return /* @__PURE__ */
|
|
5340
|
+
return /* @__PURE__ */ $(
|
|
5341
5341
|
Bt,
|
|
5342
5342
|
{
|
|
5343
5343
|
type: F,
|
|
@@ -5370,7 +5370,7 @@ const Au = (e) => {
|
|
|
5370
5370
|
return { ...y, justifyContent: "flex-end" };
|
|
5371
5371
|
}
|
|
5372
5372
|
};
|
|
5373
|
-
return p === "vertical" ? /* @__PURE__ */
|
|
5373
|
+
return p === "vertical" ? /* @__PURE__ */ $(Se, { sx: x(), children: o.map((y, O) => /* @__PURE__ */ $(Se, { sx: { width: "100%" }, children: c(y, O) }, O)) }) : /* @__PURE__ */ $(Se, { sx: x(), children: /* @__PURE__ */ $(Il, { variant: "outlined", size: "medium", children: o.map((y, O) => c(y, O)) }) });
|
|
5374
5374
|
}, Ru = new Cc({
|
|
5375
5375
|
defaultOptions: {
|
|
5376
5376
|
queries: {
|
|
@@ -5385,7 +5385,7 @@ const Au = (e) => {
|
|
|
5385
5385
|
refetchOnReconnect: !0
|
|
5386
5386
|
}
|
|
5387
5387
|
}
|
|
5388
|
-
}), Em = (e) => /* @__PURE__ */
|
|
5388
|
+
}), Em = (e) => /* @__PURE__ */ $(Rc, { client: Ru, children: /* @__PURE__ */ $(Pu, { ...e }) }), Pu = ({
|
|
5389
5389
|
id: e,
|
|
5390
5390
|
theme: t,
|
|
5391
5391
|
fields: r,
|
|
@@ -5401,88 +5401,99 @@ const Au = (e) => {
|
|
|
5401
5401
|
baseUrl: f,
|
|
5402
5402
|
apiHeaders: m
|
|
5403
5403
|
}) => {
|
|
5404
|
-
var re,
|
|
5405
|
-
const b = [...new Set(r.map((
|
|
5404
|
+
var re, X;
|
|
5405
|
+
const b = [...new Set(r.map((R) => R.step).filter((R) => R != null && R > 0))].sort((R, ee) => (R || 0) - (ee || 0)), h = b.length > 1, c = b.length || 1, [x, y] = Xt(1), O = h ? r.filter((R) => R.step === x) : r, F = ze(() => Au(O), [O]), {
|
|
5406
5406
|
control: C,
|
|
5407
5407
|
handleSubmit: w,
|
|
5408
5408
|
formState: { errors: M },
|
|
5409
5409
|
watch: G,
|
|
5410
|
-
resetField:
|
|
5410
|
+
resetField: J,
|
|
5411
5411
|
trigger: H
|
|
5412
5412
|
} = oc({
|
|
5413
5413
|
resolver: uc(F),
|
|
5414
5414
|
mode: "onChange",
|
|
5415
5415
|
defaultValues: o
|
|
5416
|
-
}), u = G(),
|
|
5416
|
+
}), u = G(), D = xt({});
|
|
5417
5417
|
wt(() => {
|
|
5418
|
-
const
|
|
5419
|
-
for (const
|
|
5420
|
-
const
|
|
5421
|
-
|
|
5422
|
-
}
|
|
5423
|
-
if (
|
|
5424
|
-
for (const { dependentField:
|
|
5425
|
-
const
|
|
5426
|
-
if (
|
|
5418
|
+
const R = [];
|
|
5419
|
+
for (const ee of r) {
|
|
5420
|
+
const Q = ee.depends_on;
|
|
5421
|
+
Q && typeof ee.name == "string" && R.push({ dependentField: ee.name, dependencyName: Q });
|
|
5422
|
+
}
|
|
5423
|
+
if (R.length !== 0)
|
|
5424
|
+
for (const { dependentField: ee, dependencyName: Q } of R) {
|
|
5425
|
+
const oe = D.current[Q], I = u == null ? void 0 : u[Q];
|
|
5426
|
+
if (oe !== I)
|
|
5427
5427
|
try {
|
|
5428
|
-
|
|
5428
|
+
J(ee);
|
|
5429
5429
|
} catch {
|
|
5430
5430
|
}
|
|
5431
|
-
|
|
5431
|
+
D.current[Q] = I;
|
|
5432
5432
|
}
|
|
5433
|
-
}, [r, u,
|
|
5433
|
+
}, [r, u, J]);
|
|
5434
5434
|
const k = xt(i);
|
|
5435
5435
|
wt(() => {
|
|
5436
5436
|
k.current = i;
|
|
5437
5437
|
}, [i]);
|
|
5438
|
-
const P =
|
|
5438
|
+
const P = ze(() => {
|
|
5439
5439
|
try {
|
|
5440
5440
|
return JSON.stringify(u);
|
|
5441
5441
|
} catch {
|
|
5442
5442
|
return String(Date.now());
|
|
5443
5443
|
}
|
|
5444
|
-
}, [u]),
|
|
5444
|
+
}, [u]), z = xt(null);
|
|
5445
5445
|
wt(() => {
|
|
5446
|
-
k.current &&
|
|
5446
|
+
k.current && z.current !== P && (z.current = P, k.current(u));
|
|
5447
5447
|
}, [P]);
|
|
5448
5448
|
const V = async () => {
|
|
5449
5449
|
if (!h) return !0;
|
|
5450
|
-
const
|
|
5451
|
-
for (const
|
|
5452
|
-
if (
|
|
5453
|
-
const
|
|
5454
|
-
let
|
|
5455
|
-
if (
|
|
5450
|
+
const R = r.filter((Q) => Q.step === x);
|
|
5451
|
+
for (const Q of R)
|
|
5452
|
+
if (Q.required) {
|
|
5453
|
+
const oe = u[Q.name];
|
|
5454
|
+
let I = !0;
|
|
5455
|
+
if (Q.type === "checkbox" ? I = oe === !0 : I = oe != null && oe !== "", !I)
|
|
5456
5456
|
return !1;
|
|
5457
5457
|
}
|
|
5458
|
-
return await H() ? !0 : Object.keys(M).filter((
|
|
5459
|
-
const
|
|
5460
|
-
return typeof (
|
|
5458
|
+
return await H() ? !0 : Object.keys(M).filter((oe) => R.some((I) => I.name === oe)).map((oe) => {
|
|
5459
|
+
const I = M[oe];
|
|
5460
|
+
return typeof (I == null ? void 0 : I.message) == "string" ? I.message : `${oe} is invalid`;
|
|
5461
5461
|
}).length === 0;
|
|
5462
|
-
},
|
|
5462
|
+
}, L = ze(() => {
|
|
5463
5463
|
if (!h) return !0;
|
|
5464
|
-
const
|
|
5465
|
-
for (const
|
|
5466
|
-
if (
|
|
5467
|
-
const
|
|
5468
|
-
let
|
|
5469
|
-
if (
|
|
5464
|
+
const R = r.filter((Q) => Q.step === x);
|
|
5465
|
+
for (const Q of R)
|
|
5466
|
+
if (Q.required) {
|
|
5467
|
+
const oe = u[Q.name];
|
|
5468
|
+
let I = !0;
|
|
5469
|
+
if (Q.type === "checkbox" ? I = oe === !0 : I = oe != null && oe !== "", !I)
|
|
5470
5470
|
return !1;
|
|
5471
5471
|
}
|
|
5472
|
-
return Object.keys(M).filter((
|
|
5473
|
-
}, [h, x, r, u, M]), se =
|
|
5474
|
-
|
|
5475
|
-
|
|
5472
|
+
return Object.keys(M).filter((Q) => R.some((oe) => oe.name === Q)).length === 0;
|
|
5473
|
+
}, [h, x, r, u, M]), se = ze(() => {
|
|
5474
|
+
if (h)
|
|
5475
|
+
return L;
|
|
5476
|
+
for (const R of r)
|
|
5477
|
+
if (R.required) {
|
|
5478
|
+
const ee = u[R.name];
|
|
5479
|
+
let Q = !0;
|
|
5480
|
+
if (R.type === "checkbox" ? Q = ee === !0 : Q = ee != null && ee !== "" && !(Array.isArray(ee) && ee.length === 0), !Q)
|
|
5481
|
+
return !1;
|
|
5482
|
+
}
|
|
5483
|
+
return Object.keys(M).length === 0;
|
|
5484
|
+
}, [h, L, r, u, M]), ce = async (R) => {
|
|
5485
|
+
R < 1 || R > c || R > x && h && !await V() || y(R);
|
|
5486
|
+
}, ue = async (R) => {
|
|
5476
5487
|
if (h && x < c) {
|
|
5477
5488
|
console.warn("Form submission attempted on non-final step");
|
|
5478
5489
|
return;
|
|
5479
5490
|
}
|
|
5480
|
-
s && s(
|
|
5481
|
-
},
|
|
5482
|
-
|
|
5483
|
-
},
|
|
5484
|
-
|
|
5485
|
-
},
|
|
5491
|
+
s && s(R), n(R);
|
|
5492
|
+
}, j = async (R) => {
|
|
5493
|
+
R && (R.preventDefault(), R.stopPropagation()), h && x < c && await V() && ce(x + 1);
|
|
5494
|
+
}, W = (R) => {
|
|
5495
|
+
R && (R.preventDefault(), R.stopPropagation()), h && x > 1 && ce(x - 1);
|
|
5496
|
+
}, N = (R) => R.col ? R.col : (R.xs || R.sm || R.md || R.lg || R.xl) && (R.xs || R.sm || R.md || R.lg || R.xl) || 12, U = t ? Ml({
|
|
5486
5497
|
palette: {
|
|
5487
5498
|
primary: {
|
|
5488
5499
|
main: t.primaryColor || "#1976d2"
|
|
@@ -5503,96 +5514,97 @@ const Au = (e) => {
|
|
|
5503
5514
|
spacing: t.spacing || 8,
|
|
5504
5515
|
typography: {
|
|
5505
5516
|
fontFamily: ((re = t.typography) == null ? void 0 : re.fontFamily) || "Roboto, Arial, sans-serif",
|
|
5506
|
-
fontSize: typeof ((
|
|
5517
|
+
fontSize: typeof ((X = t.typography) == null ? void 0 : X.fontSize) == "number" ? t.typography.fontSize : 14
|
|
5507
5518
|
}
|
|
5508
|
-
}) : void 0,
|
|
5519
|
+
}) : void 0, Y = () => d && d.buttons && d.buttons.length > 0 ? /* @__PURE__ */ $(Se, { sx: { mt: 3 }, children: /* @__PURE__ */ $(
|
|
5509
5520
|
Du,
|
|
5510
5521
|
{
|
|
5511
5522
|
config: d,
|
|
5512
5523
|
onSubmit: ue,
|
|
5513
|
-
onStepChange:
|
|
5524
|
+
onStepChange: ce,
|
|
5514
5525
|
currentStep: x,
|
|
5515
5526
|
totalSteps: c,
|
|
5516
5527
|
isMultiStep: h,
|
|
5517
5528
|
formData: u
|
|
5518
5529
|
}
|
|
5519
|
-
) }) : p && p.length > 0 ? /* @__PURE__ */
|
|
5530
|
+
) }) : p && p.length > 0 ? /* @__PURE__ */ $(
|
|
5520
5531
|
$u,
|
|
5521
5532
|
{
|
|
5522
5533
|
buttons: p
|
|
5523
5534
|
}
|
|
5524
|
-
) : l ? /* @__PURE__ */
|
|
5525
|
-
h && x > 1 && /* @__PURE__ */
|
|
5535
|
+
) : l ? /* @__PURE__ */ $(Se, { sx: { mt: 3, display: "flex", justifyContent: "flex-end", flexDirection: "column", alignItems: "flex-end" }, children: /* @__PURE__ */ Oe(Se, { sx: { display: "flex", gap: 2 }, children: [
|
|
5536
|
+
h && x > 1 && /* @__PURE__ */ $(
|
|
5526
5537
|
Bt,
|
|
5527
5538
|
{
|
|
5528
5539
|
type: "button",
|
|
5529
5540
|
variant: "outlined",
|
|
5530
|
-
onClick:
|
|
5541
|
+
onClick: W,
|
|
5531
5542
|
children: "Previous"
|
|
5532
5543
|
}
|
|
5533
5544
|
),
|
|
5534
5545
|
h ? (
|
|
5535
5546
|
// Multi-step form: Show Next for non-final steps, Submit for final step
|
|
5536
|
-
x < c ? /* @__PURE__ */
|
|
5547
|
+
x < c ? /* @__PURE__ */ $(
|
|
5537
5548
|
Bt,
|
|
5538
5549
|
{
|
|
5539
5550
|
type: "button",
|
|
5540
5551
|
variant: "contained",
|
|
5541
5552
|
color: "primary",
|
|
5542
5553
|
size: "large",
|
|
5543
|
-
disabled: !
|
|
5544
|
-
onClick:
|
|
5554
|
+
disabled: !L,
|
|
5555
|
+
onClick: j,
|
|
5545
5556
|
children: "Next"
|
|
5546
5557
|
}
|
|
5547
|
-
) : /* @__PURE__ */
|
|
5558
|
+
) : /* @__PURE__ */ $(
|
|
5548
5559
|
Bt,
|
|
5549
5560
|
{
|
|
5550
5561
|
type: "submit",
|
|
5551
5562
|
variant: "contained",
|
|
5552
5563
|
color: "primary",
|
|
5553
5564
|
size: "large",
|
|
5554
|
-
disabled: !
|
|
5565
|
+
disabled: !L,
|
|
5555
5566
|
children: a
|
|
5556
5567
|
}
|
|
5557
5568
|
)
|
|
5558
5569
|
) : (
|
|
5559
|
-
// Single-step form: Show Submit button
|
|
5560
|
-
/* @__PURE__ */
|
|
5570
|
+
// Single-step form: Show Submit button (disabled if invalid)
|
|
5571
|
+
/* @__PURE__ */ $(
|
|
5561
5572
|
Bt,
|
|
5562
5573
|
{
|
|
5563
5574
|
type: "submit",
|
|
5564
5575
|
variant: "contained",
|
|
5565
5576
|
color: "primary",
|
|
5566
5577
|
size: "large",
|
|
5578
|
+
disabled: !se,
|
|
5567
5579
|
children: a
|
|
5568
5580
|
}
|
|
5569
5581
|
)
|
|
5570
5582
|
)
|
|
5571
|
-
] }) }) : null,
|
|
5583
|
+
] }) }) : null, ne = /* @__PURE__ */ Oe(
|
|
5572
5584
|
Se,
|
|
5573
5585
|
{
|
|
5574
5586
|
component: "form",
|
|
5575
|
-
onSubmit: (
|
|
5587
|
+
onSubmit: (R) => {
|
|
5576
5588
|
if (h && x < c) {
|
|
5577
|
-
|
|
5589
|
+
R.preventDefault(), R.stopPropagation(), L && j();
|
|
5578
5590
|
return;
|
|
5579
5591
|
}
|
|
5580
|
-
w(ue)(
|
|
5592
|
+
w(ue)(R);
|
|
5581
5593
|
},
|
|
5582
5594
|
id: e,
|
|
5583
|
-
onKeyDown: (
|
|
5584
|
-
|
|
5595
|
+
onKeyDown: (R) => {
|
|
5596
|
+
R.key === "Enter" && h && x < c && (R.preventDefault(), L && j());
|
|
5585
5597
|
},
|
|
5586
5598
|
children: [
|
|
5587
|
-
h && /* @__PURE__ */
|
|
5599
|
+
h && /* @__PURE__ */ $(
|
|
5588
5600
|
Fu,
|
|
5589
5601
|
{
|
|
5590
5602
|
currentStep: x,
|
|
5591
5603
|
totalSteps: c,
|
|
5592
|
-
onStepChange:
|
|
5604
|
+
onStepChange: ce
|
|
5593
5605
|
}
|
|
5594
5606
|
),
|
|
5595
|
-
/* @__PURE__ */
|
|
5607
|
+
/* @__PURE__ */ $(
|
|
5596
5608
|
Se,
|
|
5597
5609
|
{
|
|
5598
5610
|
sx: {
|
|
@@ -5600,18 +5612,18 @@ const Au = (e) => {
|
|
|
5600
5612
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
5601
5613
|
gap: 2
|
|
5602
5614
|
},
|
|
5603
|
-
children: O.map((
|
|
5604
|
-
const
|
|
5605
|
-
return /* @__PURE__ */
|
|
5615
|
+
children: O.map((R) => {
|
|
5616
|
+
const ee = N(R);
|
|
5617
|
+
return /* @__PURE__ */ $(
|
|
5606
5618
|
Se,
|
|
5607
5619
|
{
|
|
5608
5620
|
sx: {
|
|
5609
|
-
gridColumn: `span ${
|
|
5621
|
+
gridColumn: `span ${ee}`
|
|
5610
5622
|
},
|
|
5611
|
-
children: /* @__PURE__ */
|
|
5623
|
+
children: /* @__PURE__ */ $(
|
|
5612
5624
|
Gc,
|
|
5613
5625
|
{
|
|
5614
|
-
field:
|
|
5626
|
+
field: R,
|
|
5615
5627
|
control: C,
|
|
5616
5628
|
errors: M,
|
|
5617
5629
|
baseUrl: f,
|
|
@@ -5620,16 +5632,16 @@ const Au = (e) => {
|
|
|
5620
5632
|
}
|
|
5621
5633
|
)
|
|
5622
5634
|
},
|
|
5623
|
-
|
|
5635
|
+
R.name
|
|
5624
5636
|
);
|
|
5625
5637
|
})
|
|
5626
5638
|
}
|
|
5627
5639
|
),
|
|
5628
|
-
|
|
5640
|
+
Y()
|
|
5629
5641
|
]
|
|
5630
5642
|
}
|
|
5631
5643
|
);
|
|
5632
|
-
return
|
|
5644
|
+
return U ? /* @__PURE__ */ $(zl, { theme: U, children: ne }) : ne;
|
|
5633
5645
|
}, ss = (e) => e, ju = () => {
|
|
5634
5646
|
let e = ss;
|
|
5635
5647
|
return {
|
|
@@ -5741,16 +5753,16 @@ var ls;
|
|
|
5741
5753
|
function zu() {
|
|
5742
5754
|
return ls || (ls = 1, process.env.NODE_ENV !== "production" && function() {
|
|
5743
5755
|
var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, a = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, o = e ? Symbol.for("react.context") : 60110, l = e ? Symbol.for("react.async_mode") : 60111, p = e ? Symbol.for("react.concurrent_mode") : 60111, d = e ? Symbol.for("react.forward_ref") : 60112, f = e ? Symbol.for("react.suspense") : 60113, m = e ? Symbol.for("react.suspense_list") : 60120, b = e ? Symbol.for("react.memo") : 60115, h = e ? Symbol.for("react.lazy") : 60116, c = e ? Symbol.for("react.block") : 60121, x = e ? Symbol.for("react.fundamental") : 60117, y = e ? Symbol.for("react.responder") : 60118, O = e ? Symbol.for("react.scope") : 60119;
|
|
5744
|
-
function F(
|
|
5745
|
-
return typeof
|
|
5746
|
-
|
|
5756
|
+
function F(I) {
|
|
5757
|
+
return typeof I == "string" || typeof I == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
5758
|
+
I === n || I === p || I === a || I === i || I === f || I === m || typeof I == "object" && I !== null && (I.$$typeof === h || I.$$typeof === b || I.$$typeof === s || I.$$typeof === o || I.$$typeof === d || I.$$typeof === x || I.$$typeof === y || I.$$typeof === O || I.$$typeof === c);
|
|
5747
5759
|
}
|
|
5748
|
-
function C(
|
|
5749
|
-
if (typeof
|
|
5750
|
-
var Le =
|
|
5760
|
+
function C(I) {
|
|
5761
|
+
if (typeof I == "object" && I !== null) {
|
|
5762
|
+
var Le = I.$$typeof;
|
|
5751
5763
|
switch (Le) {
|
|
5752
5764
|
case t:
|
|
5753
|
-
var dt =
|
|
5765
|
+
var dt = I.type;
|
|
5754
5766
|
switch (dt) {
|
|
5755
5767
|
case l:
|
|
5756
5768
|
case p:
|
|
@@ -5777,47 +5789,47 @@ function zu() {
|
|
|
5777
5789
|
}
|
|
5778
5790
|
}
|
|
5779
5791
|
}
|
|
5780
|
-
var w = l, M = p, G = o,
|
|
5781
|
-
function
|
|
5782
|
-
return
|
|
5792
|
+
var w = l, M = p, G = o, J = s, H = t, u = d, D = n, k = h, P = b, z = r, V = a, L = i, se = f, ce = !1;
|
|
5793
|
+
function ue(I) {
|
|
5794
|
+
return ce || (ce = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), j(I) || C(I) === l;
|
|
5783
5795
|
}
|
|
5784
|
-
function j(
|
|
5785
|
-
return C(
|
|
5796
|
+
function j(I) {
|
|
5797
|
+
return C(I) === p;
|
|
5786
5798
|
}
|
|
5787
|
-
function
|
|
5788
|
-
return C(
|
|
5799
|
+
function W(I) {
|
|
5800
|
+
return C(I) === o;
|
|
5789
5801
|
}
|
|
5790
|
-
function
|
|
5791
|
-
return C(
|
|
5802
|
+
function N(I) {
|
|
5803
|
+
return C(I) === s;
|
|
5792
5804
|
}
|
|
5793
|
-
function
|
|
5794
|
-
return typeof
|
|
5805
|
+
function U(I) {
|
|
5806
|
+
return typeof I == "object" && I !== null && I.$$typeof === t;
|
|
5795
5807
|
}
|
|
5796
|
-
function
|
|
5797
|
-
return C(
|
|
5808
|
+
function Y(I) {
|
|
5809
|
+
return C(I) === d;
|
|
5798
5810
|
}
|
|
5799
|
-
function
|
|
5800
|
-
return C(
|
|
5811
|
+
function ne(I) {
|
|
5812
|
+
return C(I) === n;
|
|
5801
5813
|
}
|
|
5802
|
-
function
|
|
5803
|
-
return C(
|
|
5814
|
+
function re(I) {
|
|
5815
|
+
return C(I) === h;
|
|
5804
5816
|
}
|
|
5805
|
-
function
|
|
5806
|
-
return C(
|
|
5817
|
+
function X(I) {
|
|
5818
|
+
return C(I) === b;
|
|
5807
5819
|
}
|
|
5808
|
-
function
|
|
5809
|
-
return C(
|
|
5820
|
+
function R(I) {
|
|
5821
|
+
return C(I) === r;
|
|
5810
5822
|
}
|
|
5811
|
-
function
|
|
5812
|
-
return C(
|
|
5823
|
+
function ee(I) {
|
|
5824
|
+
return C(I) === a;
|
|
5813
5825
|
}
|
|
5814
|
-
function
|
|
5815
|
-
return C(
|
|
5826
|
+
function Q(I) {
|
|
5827
|
+
return C(I) === i;
|
|
5816
5828
|
}
|
|
5817
|
-
function
|
|
5818
|
-
return C(
|
|
5829
|
+
function oe(I) {
|
|
5830
|
+
return C(I) === f;
|
|
5819
5831
|
}
|
|
5820
|
-
me.AsyncMode = w, me.ConcurrentMode = M, me.ContextConsumer = G, me.ContextProvider =
|
|
5832
|
+
me.AsyncMode = w, me.ConcurrentMode = M, me.ContextConsumer = G, me.ContextProvider = J, me.Element = H, me.ForwardRef = u, me.Fragment = D, me.Lazy = k, me.Memo = P, me.Portal = z, me.Profiler = V, me.StrictMode = L, me.Suspense = se, me.isAsyncMode = ue, me.isConcurrentMode = j, me.isContextConsumer = W, me.isContextProvider = N, me.isElement = U, me.isForwardRef = Y, me.isFragment = ne, me.isLazy = re, me.isMemo = X, me.isPortal = R, me.isProfiler = ee, me.isStrictMode = Q, me.isSuspense = oe, me.isValidElementType = F, me.typeOf = C;
|
|
5821
5833
|
}()), me;
|
|
5822
5834
|
}
|
|
5823
5835
|
var cs;
|
|
@@ -5955,9 +5967,9 @@ function Lu() {
|
|
|
5955
5967
|
return ki = function(o, l) {
|
|
5956
5968
|
var p = typeof Symbol == "function" && Symbol.iterator, d = "@@iterator";
|
|
5957
5969
|
function f(j) {
|
|
5958
|
-
var
|
|
5959
|
-
if (typeof
|
|
5960
|
-
return
|
|
5970
|
+
var W = j && (p && j[p] || j[d]);
|
|
5971
|
+
if (typeof W == "function")
|
|
5972
|
+
return W;
|
|
5961
5973
|
}
|
|
5962
5974
|
var m = "<<anonymous>>", b = {
|
|
5963
5975
|
array: y("array"),
|
|
@@ -5974,217 +5986,217 @@ function Lu() {
|
|
|
5974
5986
|
elementType: w(),
|
|
5975
5987
|
instanceOf: M,
|
|
5976
5988
|
node: u(),
|
|
5977
|
-
objectOf:
|
|
5989
|
+
objectOf: J,
|
|
5978
5990
|
oneOf: G,
|
|
5979
5991
|
oneOfType: H,
|
|
5980
5992
|
shape: k,
|
|
5981
5993
|
exact: P
|
|
5982
5994
|
};
|
|
5983
|
-
function h(j,
|
|
5984
|
-
return j ===
|
|
5995
|
+
function h(j, W) {
|
|
5996
|
+
return j === W ? j !== 0 || 1 / j === 1 / W : j !== j && W !== W;
|
|
5985
5997
|
}
|
|
5986
|
-
function c(j,
|
|
5987
|
-
this.message = j, this.data =
|
|
5998
|
+
function c(j, W) {
|
|
5999
|
+
this.message = j, this.data = W && typeof W == "object" ? W : {}, this.stack = "";
|
|
5988
6000
|
}
|
|
5989
6001
|
c.prototype = Error.prototype;
|
|
5990
6002
|
function x(j) {
|
|
5991
6003
|
if (process.env.NODE_ENV !== "production")
|
|
5992
|
-
var
|
|
5993
|
-
function
|
|
5994
|
-
if (
|
|
6004
|
+
var W = {}, N = 0;
|
|
6005
|
+
function U(ne, re, X, R, ee, Q, oe) {
|
|
6006
|
+
if (R = R || m, Q = Q || X, oe !== r) {
|
|
5995
6007
|
if (l) {
|
|
5996
|
-
var
|
|
6008
|
+
var I = new Error(
|
|
5997
6009
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
5998
6010
|
);
|
|
5999
|
-
throw
|
|
6011
|
+
throw I.name = "Invariant Violation", I;
|
|
6000
6012
|
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
6001
|
-
var Le =
|
|
6002
|
-
!
|
|
6003
|
-
|
|
6004
|
-
"You are manually calling a React.PropTypes validation function for the `" +
|
|
6005
|
-
),
|
|
6013
|
+
var Le = R + ":" + X;
|
|
6014
|
+
!W[Le] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
6015
|
+
N < 3 && (a(
|
|
6016
|
+
"You are manually calling a React.PropTypes validation function for the `" + Q + "` prop on `" + R + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
6017
|
+
), W[Le] = !0, N++);
|
|
6006
6018
|
}
|
|
6007
6019
|
}
|
|
6008
|
-
return
|
|
6020
|
+
return re[X] == null ? ne ? re[X] === null ? new c("The " + ee + " `" + Q + "` is marked as required " + ("in `" + R + "`, but its value is `null`.")) : new c("The " + ee + " `" + Q + "` is marked as required in " + ("`" + R + "`, but its value is `undefined`.")) : null : j(re, X, R, ee, Q);
|
|
6009
6021
|
}
|
|
6010
|
-
var
|
|
6011
|
-
return
|
|
6022
|
+
var Y = U.bind(null, !1);
|
|
6023
|
+
return Y.isRequired = U.bind(null, !0), Y;
|
|
6012
6024
|
}
|
|
6013
6025
|
function y(j) {
|
|
6014
|
-
function
|
|
6015
|
-
var
|
|
6016
|
-
if (
|
|
6017
|
-
var
|
|
6026
|
+
function W(N, U, Y, ne, re, X) {
|
|
6027
|
+
var R = N[U], ee = L(R);
|
|
6028
|
+
if (ee !== j) {
|
|
6029
|
+
var Q = se(R);
|
|
6018
6030
|
return new c(
|
|
6019
|
-
"Invalid " +
|
|
6031
|
+
"Invalid " + ne + " `" + re + "` of type " + ("`" + Q + "` supplied to `" + Y + "`, expected ") + ("`" + j + "`."),
|
|
6020
6032
|
{ expectedType: j }
|
|
6021
6033
|
);
|
|
6022
6034
|
}
|
|
6023
6035
|
return null;
|
|
6024
6036
|
}
|
|
6025
|
-
return x(
|
|
6037
|
+
return x(W);
|
|
6026
6038
|
}
|
|
6027
6039
|
function O() {
|
|
6028
6040
|
return x(s);
|
|
6029
6041
|
}
|
|
6030
6042
|
function F(j) {
|
|
6031
|
-
function
|
|
6043
|
+
function W(N, U, Y, ne, re) {
|
|
6032
6044
|
if (typeof j != "function")
|
|
6033
|
-
return new c("Property `" +
|
|
6034
|
-
var
|
|
6035
|
-
if (!Array.isArray(
|
|
6036
|
-
var
|
|
6037
|
-
return new c("Invalid " +
|
|
6045
|
+
return new c("Property `" + re + "` of component `" + Y + "` has invalid PropType notation inside arrayOf.");
|
|
6046
|
+
var X = N[U];
|
|
6047
|
+
if (!Array.isArray(X)) {
|
|
6048
|
+
var R = L(X);
|
|
6049
|
+
return new c("Invalid " + ne + " `" + re + "` of type " + ("`" + R + "` supplied to `" + Y + "`, expected an array."));
|
|
6038
6050
|
}
|
|
6039
|
-
for (var
|
|
6040
|
-
var
|
|
6041
|
-
if (
|
|
6042
|
-
return
|
|
6051
|
+
for (var ee = 0; ee < X.length; ee++) {
|
|
6052
|
+
var Q = j(X, ee, Y, ne, re + "[" + ee + "]", r);
|
|
6053
|
+
if (Q instanceof Error)
|
|
6054
|
+
return Q;
|
|
6043
6055
|
}
|
|
6044
6056
|
return null;
|
|
6045
6057
|
}
|
|
6046
|
-
return x(
|
|
6058
|
+
return x(W);
|
|
6047
6059
|
}
|
|
6048
6060
|
function C() {
|
|
6049
|
-
function j(
|
|
6050
|
-
var
|
|
6051
|
-
if (!o(
|
|
6052
|
-
var
|
|
6053
|
-
return new c("Invalid " +
|
|
6061
|
+
function j(W, N, U, Y, ne) {
|
|
6062
|
+
var re = W[N];
|
|
6063
|
+
if (!o(re)) {
|
|
6064
|
+
var X = L(re);
|
|
6065
|
+
return new c("Invalid " + Y + " `" + ne + "` of type " + ("`" + X + "` supplied to `" + U + "`, expected a single ReactElement."));
|
|
6054
6066
|
}
|
|
6055
6067
|
return null;
|
|
6056
6068
|
}
|
|
6057
6069
|
return x(j);
|
|
6058
6070
|
}
|
|
6059
6071
|
function w() {
|
|
6060
|
-
function j(
|
|
6061
|
-
var
|
|
6062
|
-
if (!e.isValidElementType(
|
|
6063
|
-
var
|
|
6064
|
-
return new c("Invalid " +
|
|
6072
|
+
function j(W, N, U, Y, ne) {
|
|
6073
|
+
var re = W[N];
|
|
6074
|
+
if (!e.isValidElementType(re)) {
|
|
6075
|
+
var X = L(re);
|
|
6076
|
+
return new c("Invalid " + Y + " `" + ne + "` of type " + ("`" + X + "` supplied to `" + U + "`, expected a single ReactElement type."));
|
|
6065
6077
|
}
|
|
6066
6078
|
return null;
|
|
6067
6079
|
}
|
|
6068
6080
|
return x(j);
|
|
6069
6081
|
}
|
|
6070
6082
|
function M(j) {
|
|
6071
|
-
function
|
|
6072
|
-
if (!(
|
|
6073
|
-
var
|
|
6074
|
-
return new c("Invalid " +
|
|
6083
|
+
function W(N, U, Y, ne, re) {
|
|
6084
|
+
if (!(N[U] instanceof j)) {
|
|
6085
|
+
var X = j.name || m, R = ue(N[U]);
|
|
6086
|
+
return new c("Invalid " + ne + " `" + re + "` of type " + ("`" + R + "` supplied to `" + Y + "`, expected ") + ("instance of `" + X + "`."));
|
|
6075
6087
|
}
|
|
6076
6088
|
return null;
|
|
6077
6089
|
}
|
|
6078
|
-
return x(
|
|
6090
|
+
return x(W);
|
|
6079
6091
|
}
|
|
6080
6092
|
function G(j) {
|
|
6081
6093
|
if (!Array.isArray(j))
|
|
6082
6094
|
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? a(
|
|
6083
6095
|
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
6084
6096
|
) : a("Invalid argument supplied to oneOf, expected an array.")), s;
|
|
6085
|
-
function
|
|
6086
|
-
for (var
|
|
6087
|
-
if (h(
|
|
6097
|
+
function W(N, U, Y, ne, re) {
|
|
6098
|
+
for (var X = N[U], R = 0; R < j.length; R++)
|
|
6099
|
+
if (h(X, j[R]))
|
|
6088
6100
|
return null;
|
|
6089
|
-
var
|
|
6090
|
-
var Le = se(
|
|
6091
|
-
return Le === "symbol" ? String(
|
|
6101
|
+
var ee = JSON.stringify(j, function(oe, I) {
|
|
6102
|
+
var Le = se(I);
|
|
6103
|
+
return Le === "symbol" ? String(I) : I;
|
|
6092
6104
|
});
|
|
6093
|
-
return new c("Invalid " +
|
|
6105
|
+
return new c("Invalid " + ne + " `" + re + "` of value `" + String(X) + "` " + ("supplied to `" + Y + "`, expected one of " + ee + "."));
|
|
6094
6106
|
}
|
|
6095
|
-
return x(
|
|
6107
|
+
return x(W);
|
|
6096
6108
|
}
|
|
6097
|
-
function
|
|
6098
|
-
function
|
|
6109
|
+
function J(j) {
|
|
6110
|
+
function W(N, U, Y, ne, re) {
|
|
6099
6111
|
if (typeof j != "function")
|
|
6100
|
-
return new c("Property `" +
|
|
6101
|
-
var
|
|
6102
|
-
if (
|
|
6103
|
-
return new c("Invalid " +
|
|
6104
|
-
for (var
|
|
6105
|
-
if (n(
|
|
6106
|
-
var
|
|
6107
|
-
if (
|
|
6108
|
-
return
|
|
6112
|
+
return new c("Property `" + re + "` of component `" + Y + "` has invalid PropType notation inside objectOf.");
|
|
6113
|
+
var X = N[U], R = L(X);
|
|
6114
|
+
if (R !== "object")
|
|
6115
|
+
return new c("Invalid " + ne + " `" + re + "` of type " + ("`" + R + "` supplied to `" + Y + "`, expected an object."));
|
|
6116
|
+
for (var ee in X)
|
|
6117
|
+
if (n(X, ee)) {
|
|
6118
|
+
var Q = j(X, ee, Y, ne, re + "." + ee, r);
|
|
6119
|
+
if (Q instanceof Error)
|
|
6120
|
+
return Q;
|
|
6109
6121
|
}
|
|
6110
6122
|
return null;
|
|
6111
6123
|
}
|
|
6112
|
-
return x(
|
|
6124
|
+
return x(W);
|
|
6113
6125
|
}
|
|
6114
6126
|
function H(j) {
|
|
6115
6127
|
if (!Array.isArray(j))
|
|
6116
6128
|
return process.env.NODE_ENV !== "production" && a("Invalid argument supplied to oneOfType, expected an instance of array."), s;
|
|
6117
|
-
for (var
|
|
6118
|
-
var
|
|
6119
|
-
if (typeof
|
|
6129
|
+
for (var W = 0; W < j.length; W++) {
|
|
6130
|
+
var N = j[W];
|
|
6131
|
+
if (typeof N != "function")
|
|
6120
6132
|
return a(
|
|
6121
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " +
|
|
6133
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ce(N) + " at index " + W + "."
|
|
6122
6134
|
), s;
|
|
6123
6135
|
}
|
|
6124
|
-
function
|
|
6125
|
-
for (var
|
|
6126
|
-
var
|
|
6127
|
-
if (
|
|
6136
|
+
function U(Y, ne, re, X, R) {
|
|
6137
|
+
for (var ee = [], Q = 0; Q < j.length; Q++) {
|
|
6138
|
+
var oe = j[Q], I = oe(Y, ne, re, X, R, r);
|
|
6139
|
+
if (I == null)
|
|
6128
6140
|
return null;
|
|
6129
|
-
|
|
6141
|
+
I.data && n(I.data, "expectedType") && ee.push(I.data.expectedType);
|
|
6130
6142
|
}
|
|
6131
|
-
var Le =
|
|
6132
|
-
return new c("Invalid " +
|
|
6143
|
+
var Le = ee.length > 0 ? ", expected one of type [" + ee.join(", ") + "]" : "";
|
|
6144
|
+
return new c("Invalid " + X + " `" + R + "` supplied to " + ("`" + re + "`" + Le + "."));
|
|
6133
6145
|
}
|
|
6134
|
-
return x(
|
|
6146
|
+
return x(U);
|
|
6135
6147
|
}
|
|
6136
6148
|
function u() {
|
|
6137
|
-
function j(
|
|
6138
|
-
return
|
|
6149
|
+
function j(W, N, U, Y, ne) {
|
|
6150
|
+
return z(W[N]) ? null : new c("Invalid " + Y + " `" + ne + "` supplied to " + ("`" + U + "`, expected a ReactNode."));
|
|
6139
6151
|
}
|
|
6140
6152
|
return x(j);
|
|
6141
6153
|
}
|
|
6142
|
-
function
|
|
6154
|
+
function D(j, W, N, U, Y) {
|
|
6143
6155
|
return new c(
|
|
6144
|
-
(j || "React class") + ": " +
|
|
6156
|
+
(j || "React class") + ": " + W + " type `" + N + "." + U + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + Y + "`."
|
|
6145
6157
|
);
|
|
6146
6158
|
}
|
|
6147
6159
|
function k(j) {
|
|
6148
|
-
function
|
|
6149
|
-
var
|
|
6150
|
-
if (
|
|
6151
|
-
return new c("Invalid " +
|
|
6152
|
-
for (var
|
|
6153
|
-
var
|
|
6154
|
-
if (typeof
|
|
6155
|
-
return
|
|
6156
|
-
var
|
|
6157
|
-
if (
|
|
6158
|
-
return
|
|
6160
|
+
function W(N, U, Y, ne, re) {
|
|
6161
|
+
var X = N[U], R = L(X);
|
|
6162
|
+
if (R !== "object")
|
|
6163
|
+
return new c("Invalid " + ne + " `" + re + "` of type `" + R + "` " + ("supplied to `" + Y + "`, expected `object`."));
|
|
6164
|
+
for (var ee in j) {
|
|
6165
|
+
var Q = j[ee];
|
|
6166
|
+
if (typeof Q != "function")
|
|
6167
|
+
return D(Y, ne, re, ee, se(Q));
|
|
6168
|
+
var oe = Q(X, ee, Y, ne, re + "." + ee, r);
|
|
6169
|
+
if (oe)
|
|
6170
|
+
return oe;
|
|
6159
6171
|
}
|
|
6160
6172
|
return null;
|
|
6161
6173
|
}
|
|
6162
|
-
return x(
|
|
6174
|
+
return x(W);
|
|
6163
6175
|
}
|
|
6164
6176
|
function P(j) {
|
|
6165
|
-
function
|
|
6166
|
-
var
|
|
6167
|
-
if (
|
|
6168
|
-
return new c("Invalid " +
|
|
6169
|
-
var
|
|
6170
|
-
for (var
|
|
6171
|
-
var
|
|
6172
|
-
if (n(j,
|
|
6173
|
-
return
|
|
6174
|
-
if (!
|
|
6177
|
+
function W(N, U, Y, ne, re) {
|
|
6178
|
+
var X = N[U], R = L(X);
|
|
6179
|
+
if (R !== "object")
|
|
6180
|
+
return new c("Invalid " + ne + " `" + re + "` of type `" + R + "` " + ("supplied to `" + Y + "`, expected `object`."));
|
|
6181
|
+
var ee = t({}, N[U], j);
|
|
6182
|
+
for (var Q in ee) {
|
|
6183
|
+
var oe = j[Q];
|
|
6184
|
+
if (n(j, Q) && typeof oe != "function")
|
|
6185
|
+
return D(Y, ne, re, Q, se(oe));
|
|
6186
|
+
if (!oe)
|
|
6175
6187
|
return new c(
|
|
6176
|
-
"Invalid " +
|
|
6188
|
+
"Invalid " + ne + " `" + re + "` key `" + Q + "` supplied to `" + Y + "`.\nBad object: " + JSON.stringify(N[U], null, " ") + `
|
|
6177
6189
|
Valid keys: ` + JSON.stringify(Object.keys(j), null, " ")
|
|
6178
6190
|
);
|
|
6179
|
-
var
|
|
6180
|
-
if (
|
|
6181
|
-
return
|
|
6191
|
+
var I = oe(X, Q, Y, ne, re + "." + Q, r);
|
|
6192
|
+
if (I)
|
|
6193
|
+
return I;
|
|
6182
6194
|
}
|
|
6183
6195
|
return null;
|
|
6184
6196
|
}
|
|
6185
|
-
return x(
|
|
6197
|
+
return x(W);
|
|
6186
6198
|
}
|
|
6187
|
-
function
|
|
6199
|
+
function z(j) {
|
|
6188
6200
|
switch (typeof j) {
|
|
6189
6201
|
case "number":
|
|
6190
6202
|
case "string":
|
|
@@ -6194,20 +6206,20 @@ Valid keys: ` + JSON.stringify(Object.keys(j), null, " ")
|
|
|
6194
6206
|
return !j;
|
|
6195
6207
|
case "object":
|
|
6196
6208
|
if (Array.isArray(j))
|
|
6197
|
-
return j.every(
|
|
6209
|
+
return j.every(z);
|
|
6198
6210
|
if (j === null || o(j))
|
|
6199
6211
|
return !0;
|
|
6200
|
-
var
|
|
6201
|
-
if (
|
|
6202
|
-
var
|
|
6203
|
-
if (
|
|
6204
|
-
for (; !(
|
|
6205
|
-
if (!
|
|
6212
|
+
var W = f(j);
|
|
6213
|
+
if (W) {
|
|
6214
|
+
var N = W.call(j), U;
|
|
6215
|
+
if (W !== j.entries) {
|
|
6216
|
+
for (; !(U = N.next()).done; )
|
|
6217
|
+
if (!z(U.value))
|
|
6206
6218
|
return !1;
|
|
6207
6219
|
} else
|
|
6208
|
-
for (; !(
|
|
6209
|
-
var
|
|
6210
|
-
if (
|
|
6220
|
+
for (; !(U = N.next()).done; ) {
|
|
6221
|
+
var Y = U.value;
|
|
6222
|
+
if (Y && !z(Y[1]))
|
|
6211
6223
|
return !1;
|
|
6212
6224
|
}
|
|
6213
6225
|
} else
|
|
@@ -6217,40 +6229,40 @@ Valid keys: ` + JSON.stringify(Object.keys(j), null, " ")
|
|
|
6217
6229
|
return !1;
|
|
6218
6230
|
}
|
|
6219
6231
|
}
|
|
6220
|
-
function V(j,
|
|
6221
|
-
return j === "symbol" ? !0 :
|
|
6232
|
+
function V(j, W) {
|
|
6233
|
+
return j === "symbol" ? !0 : W ? W["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && W instanceof Symbol : !1;
|
|
6222
6234
|
}
|
|
6223
|
-
function
|
|
6224
|
-
var
|
|
6225
|
-
return Array.isArray(j) ? "array" : j instanceof RegExp ? "object" : V(
|
|
6235
|
+
function L(j) {
|
|
6236
|
+
var W = typeof j;
|
|
6237
|
+
return Array.isArray(j) ? "array" : j instanceof RegExp ? "object" : V(W, j) ? "symbol" : W;
|
|
6226
6238
|
}
|
|
6227
6239
|
function se(j) {
|
|
6228
6240
|
if (typeof j > "u" || j === null)
|
|
6229
6241
|
return "" + j;
|
|
6230
|
-
var
|
|
6231
|
-
if (
|
|
6242
|
+
var W = L(j);
|
|
6243
|
+
if (W === "object") {
|
|
6232
6244
|
if (j instanceof Date)
|
|
6233
6245
|
return "date";
|
|
6234
6246
|
if (j instanceof RegExp)
|
|
6235
6247
|
return "regexp";
|
|
6236
6248
|
}
|
|
6237
|
-
return
|
|
6249
|
+
return W;
|
|
6238
6250
|
}
|
|
6239
|
-
function
|
|
6240
|
-
var
|
|
6241
|
-
switch (
|
|
6251
|
+
function ce(j) {
|
|
6252
|
+
var W = se(j);
|
|
6253
|
+
switch (W) {
|
|
6242
6254
|
case "array":
|
|
6243
6255
|
case "object":
|
|
6244
|
-
return "an " +
|
|
6256
|
+
return "an " + W;
|
|
6245
6257
|
case "boolean":
|
|
6246
6258
|
case "date":
|
|
6247
6259
|
case "regexp":
|
|
6248
|
-
return "a " +
|
|
6260
|
+
return "a " + W;
|
|
6249
6261
|
default:
|
|
6250
|
-
return
|
|
6262
|
+
return W;
|
|
6251
6263
|
}
|
|
6252
6264
|
}
|
|
6253
|
-
function
|
|
6265
|
+
function ue(j) {
|
|
6254
6266
|
return !j.constructor || !j.constructor.name ? m : j.constructor.name;
|
|
6255
6267
|
}
|
|
6256
6268
|
return b.checkPropTypes = i, b.resetWarningCache = i.resetWarningCache, b.PropTypes = b, b;
|
|
@@ -6315,7 +6327,7 @@ function Bu() {
|
|
|
6315
6327
|
return _n.exports;
|
|
6316
6328
|
}
|
|
6317
6329
|
var Uu = /* @__PURE__ */ Bu();
|
|
6318
|
-
const
|
|
6330
|
+
const te = /* @__PURE__ */ ma(Uu);
|
|
6319
6331
|
function Go(e) {
|
|
6320
6332
|
var t, r, n = "";
|
|
6321
6333
|
if (typeof e == "string" || typeof e == "number") n += e;
|
|
@@ -6526,7 +6538,7 @@ function rn(e, t) {
|
|
|
6526
6538
|
// No need to clone deep, it's way faster.
|
|
6527
6539
|
}) : e;
|
|
6528
6540
|
}
|
|
6529
|
-
const Gt = process.env.NODE_ENV !== "production" ?
|
|
6541
|
+
const Gt = process.env.NODE_ENV !== "production" ? te.oneOfType([te.number, te.string, te.object, te.array]) : {};
|
|
6530
6542
|
function Yu(e, t) {
|
|
6531
6543
|
if (!e.containerQueries)
|
|
6532
6544
|
return t;
|
|
@@ -7752,32 +7764,32 @@ function lp(e = {}) {
|
|
|
7752
7764
|
};
|
|
7753
7765
|
if (_t(w)) {
|
|
7754
7766
|
const M = rl(w);
|
|
7755
|
-
return M.variants ? function(
|
|
7756
|
-
return Mn(
|
|
7767
|
+
return M.variants ? function(J) {
|
|
7768
|
+
return Mn(J, M);
|
|
7757
7769
|
} : M.style;
|
|
7758
7770
|
}
|
|
7759
7771
|
return w;
|
|
7760
7772
|
}, C = (...w) => {
|
|
7761
|
-
const M = [], G = w.map(F),
|
|
7762
|
-
if (M.push(a), p && b &&
|
|
7763
|
-
var
|
|
7764
|
-
const
|
|
7765
|
-
if (!
|
|
7773
|
+
const M = [], G = w.map(F), J = [];
|
|
7774
|
+
if (M.push(a), p && b && J.push(function(k) {
|
|
7775
|
+
var L, se;
|
|
7776
|
+
const z = (se = (L = k.theme.components) == null ? void 0 : L[p]) == null ? void 0 : se.styleOverrides;
|
|
7777
|
+
if (!z)
|
|
7766
7778
|
return null;
|
|
7767
7779
|
const V = {};
|
|
7768
|
-
for (const
|
|
7769
|
-
V[
|
|
7780
|
+
for (const ce in z)
|
|
7781
|
+
V[ce] = Mn(k, z[ce]);
|
|
7770
7782
|
return b(k, V);
|
|
7771
|
-
}), p && !c &&
|
|
7772
|
-
var V,
|
|
7773
|
-
const P = k.theme,
|
|
7774
|
-
return
|
|
7775
|
-
}), x ||
|
|
7776
|
-
const
|
|
7777
|
-
let
|
|
7778
|
-
|
|
7783
|
+
}), p && !c && J.push(function(k) {
|
|
7784
|
+
var V, L;
|
|
7785
|
+
const P = k.theme, z = (L = (V = P == null ? void 0 : P.components) == null ? void 0 : V[p]) == null ? void 0 : L.variants;
|
|
7786
|
+
return z ? nl(k, z) : null;
|
|
7787
|
+
}), x || J.push(Lr), Array.isArray(G[0])) {
|
|
7788
|
+
const D = G.shift(), k = new Array(M.length).fill(""), P = new Array(J.length).fill("");
|
|
7789
|
+
let z;
|
|
7790
|
+
z = [...k, ...D, ...P], z.raw = [...k, ...D.raw, ...P], M.unshift(z);
|
|
7779
7791
|
}
|
|
7780
|
-
const H = [...M, ...G, ...
|
|
7792
|
+
const H = [...M, ...G, ...J], u = O(...H);
|
|
7781
7793
|
return o.muiName && (u.muiName = o.muiName), process.env.NODE_ENV !== "production" && (u.displayName = cp(p, d, o)), u;
|
|
7782
7794
|
};
|
|
7783
7795
|
return O.withConfig && (C.withConfig = O.withConfig), C;
|
|
@@ -7965,7 +7977,7 @@ function $n(e, t, r) {
|
|
|
7965
7977
|
}
|
|
7966
7978
|
}
|
|
7967
7979
|
const vp = /* @__PURE__ */ Ae.createContext(void 0);
|
|
7968
|
-
process.env.NODE_ENV !== "production" && (
|
|
7980
|
+
process.env.NODE_ENV !== "production" && (te.node, te.object);
|
|
7969
7981
|
function xp(e) {
|
|
7970
7982
|
const {
|
|
7971
7983
|
theme: t,
|
|
@@ -8114,12 +8126,12 @@ function Op(e, t = {}) {
|
|
|
8114
8126
|
}), F;
|
|
8115
8127
|
},
|
|
8116
8128
|
generateStyleSheets: () => {
|
|
8117
|
-
var
|
|
8129
|
+
var J, H;
|
|
8118
8130
|
const F = [], C = e.defaultColorScheme || "light";
|
|
8119
|
-
function w(u,
|
|
8120
|
-
Object.keys(
|
|
8131
|
+
function w(u, D) {
|
|
8132
|
+
Object.keys(D).length && F.push(typeof u == "string" ? {
|
|
8121
8133
|
[u]: {
|
|
8122
|
-
...
|
|
8134
|
+
...D
|
|
8123
8135
|
}
|
|
8124
8136
|
} : u);
|
|
8125
8137
|
}
|
|
@@ -8133,8 +8145,8 @@ function Op(e, t = {}) {
|
|
|
8133
8145
|
if (M) {
|
|
8134
8146
|
const {
|
|
8135
8147
|
css: u
|
|
8136
|
-
} = M,
|
|
8137
|
-
colorScheme:
|
|
8148
|
+
} = M, D = (H = (J = a[C]) == null ? void 0 : J.palette) == null ? void 0 : H.mode, k = !n && D ? {
|
|
8149
|
+
colorScheme: D,
|
|
8138
8150
|
...u
|
|
8139
8151
|
} : {
|
|
8140
8152
|
...u
|
|
@@ -8144,14 +8156,14 @@ function Op(e, t = {}) {
|
|
|
8144
8156
|
}), k);
|
|
8145
8157
|
}
|
|
8146
8158
|
return Object.entries(G).forEach(([u, {
|
|
8147
|
-
css:
|
|
8159
|
+
css: D
|
|
8148
8160
|
}]) => {
|
|
8149
|
-
var
|
|
8150
|
-
const k = (V = (
|
|
8161
|
+
var z, V;
|
|
8162
|
+
const k = (V = (z = a[u]) == null ? void 0 : z.palette) == null ? void 0 : V.mode, P = !n && k ? {
|
|
8151
8163
|
colorScheme: k,
|
|
8152
|
-
...
|
|
8164
|
+
...D
|
|
8153
8165
|
} : {
|
|
8154
|
-
...
|
|
8166
|
+
...D
|
|
8155
8167
|
};
|
|
8156
8168
|
w(r(u, {
|
|
8157
8169
|
...P
|
|
@@ -8909,19 +8921,19 @@ function af(e = {}, ...t) {
|
|
|
8909
8921
|
spacing: rf(p.spacing)
|
|
8910
8922
|
};
|
|
8911
8923
|
Object.keys(C.colorSchemes).forEach((H) => {
|
|
8912
|
-
const u = C.colorSchemes[H].palette,
|
|
8913
|
-
const P = k.split("-"),
|
|
8914
|
-
return m(k, u[
|
|
8924
|
+
const u = C.colorSchemes[H].palette, D = (k) => {
|
|
8925
|
+
const P = k.split("-"), z = P[1], V = P[2];
|
|
8926
|
+
return m(k, u[z][V]);
|
|
8915
8927
|
};
|
|
8916
8928
|
if (u.mode === "light" && (_(u.common, "background", "#fff"), _(u.common, "onBackground", "#000")), u.mode === "dark" && (_(u.common, "background", "#000"), _(u.common, "onBackground", "#fff")), tf(u, ["Alert", "AppBar", "Avatar", "Button", "Chip", "FilledInput", "LinearProgress", "Skeleton", "Slider", "SnackbarContent", "SpeedDialAction", "StepConnector", "StepContent", "Switch", "TableCell", "Tooltip"]), u.mode === "light") {
|
|
8917
|
-
_(u.Alert, "errorColor", be(u.error.light, 0.6)), _(u.Alert, "infoColor", be(u.info.light, 0.6)), _(u.Alert, "successColor", be(u.success.light, 0.6)), _(u.Alert, "warningColor", be(u.warning.light, 0.6)), _(u.Alert, "errorFilledBg",
|
|
8929
|
+
_(u.Alert, "errorColor", be(u.error.light, 0.6)), _(u.Alert, "infoColor", be(u.info.light, 0.6)), _(u.Alert, "successColor", be(u.success.light, 0.6)), _(u.Alert, "warningColor", be(u.warning.light, 0.6)), _(u.Alert, "errorFilledBg", D("palette-error-main")), _(u.Alert, "infoFilledBg", D("palette-info-main")), _(u.Alert, "successFilledBg", D("palette-success-main")), _(u.Alert, "warningFilledBg", D("palette-warning-main")), _(u.Alert, "errorFilledColor", ft(() => u.getContrastText(u.error.main))), _(u.Alert, "infoFilledColor", ft(() => u.getContrastText(u.info.main))), _(u.Alert, "successFilledColor", ft(() => u.getContrastText(u.success.main))), _(u.Alert, "warningFilledColor", ft(() => u.getContrastText(u.warning.main))), _(u.Alert, "errorStandardBg", we(u.error.light, 0.9)), _(u.Alert, "infoStandardBg", we(u.info.light, 0.9)), _(u.Alert, "successStandardBg", we(u.success.light, 0.9)), _(u.Alert, "warningStandardBg", we(u.warning.light, 0.9)), _(u.Alert, "errorIconColor", D("palette-error-main")), _(u.Alert, "infoIconColor", D("palette-info-main")), _(u.Alert, "successIconColor", D("palette-success-main")), _(u.Alert, "warningIconColor", D("palette-warning-main")), _(u.AppBar, "defaultBg", D("palette-grey-100")), _(u.Avatar, "defaultBg", D("palette-grey-400")), _(u.Button, "inheritContainedBg", D("palette-grey-300")), _(u.Button, "inheritContainedHoverBg", D("palette-grey-A100")), _(u.Chip, "defaultBorder", D("palette-grey-400")), _(u.Chip, "defaultAvatarColor", D("palette-grey-700")), _(u.Chip, "defaultIconColor", D("palette-grey-700")), _(u.FilledInput, "bg", "rgba(0, 0, 0, 0.06)"), _(u.FilledInput, "hoverBg", "rgba(0, 0, 0, 0.09)"), _(u.FilledInput, "disabledBg", "rgba(0, 0, 0, 0.12)"), _(u.LinearProgress, "primaryBg", we(u.primary.main, 0.62)), _(u.LinearProgress, "secondaryBg", we(u.secondary.main, 0.62)), _(u.LinearProgress, "errorBg", we(u.error.main, 0.62)), _(u.LinearProgress, "infoBg", we(u.info.main, 0.62)), _(u.LinearProgress, "successBg", we(u.success.main, 0.62)), _(u.LinearProgress, "warningBg", we(u.warning.main, 0.62)), _(u.Skeleton, "bg", `rgba(${D("palette-text-primaryChannel")} / 0.11)`), _(u.Slider, "primaryTrack", we(u.primary.main, 0.62)), _(u.Slider, "secondaryTrack", we(u.secondary.main, 0.62)), _(u.Slider, "errorTrack", we(u.error.main, 0.62)), _(u.Slider, "infoTrack", we(u.info.main, 0.62)), _(u.Slider, "successTrack", we(u.success.main, 0.62)), _(u.Slider, "warningTrack", we(u.warning.main, 0.62));
|
|
8918
8930
|
const k = $n(u.background.default, 0.8);
|
|
8919
|
-
_(u.SnackbarContent, "bg", k), _(u.SnackbarContent, "color", ft(() => u.getContrastText(k))), _(u.SpeedDialAction, "fabHoverBg", $n(u.background.paper, 0.15)), _(u.StepConnector, "border",
|
|
8931
|
+
_(u.SnackbarContent, "bg", k), _(u.SnackbarContent, "color", ft(() => u.getContrastText(k))), _(u.SpeedDialAction, "fabHoverBg", $n(u.background.paper, 0.15)), _(u.StepConnector, "border", D("palette-grey-400")), _(u.StepContent, "border", D("palette-grey-400")), _(u.Switch, "defaultColor", D("palette-common-white")), _(u.Switch, "defaultDisabledColor", D("palette-grey-100")), _(u.Switch, "primaryDisabledColor", we(u.primary.main, 0.62)), _(u.Switch, "secondaryDisabledColor", we(u.secondary.main, 0.62)), _(u.Switch, "errorDisabledColor", we(u.error.main, 0.62)), _(u.Switch, "infoDisabledColor", we(u.info.main, 0.62)), _(u.Switch, "successDisabledColor", we(u.success.main, 0.62)), _(u.Switch, "warningDisabledColor", we(u.warning.main, 0.62)), _(u.TableCell, "border", we(Fn(u.divider, 1), 0.88)), _(u.Tooltip, "bg", Fn(u.grey[700], 0.92));
|
|
8920
8932
|
}
|
|
8921
8933
|
if (u.mode === "dark") {
|
|
8922
|
-
_(u.Alert, "errorColor", we(u.error.light, 0.6)), _(u.Alert, "infoColor", we(u.info.light, 0.6)), _(u.Alert, "successColor", we(u.success.light, 0.6)), _(u.Alert, "warningColor", we(u.warning.light, 0.6)), _(u.Alert, "errorFilledBg",
|
|
8934
|
+
_(u.Alert, "errorColor", we(u.error.light, 0.6)), _(u.Alert, "infoColor", we(u.info.light, 0.6)), _(u.Alert, "successColor", we(u.success.light, 0.6)), _(u.Alert, "warningColor", we(u.warning.light, 0.6)), _(u.Alert, "errorFilledBg", D("palette-error-dark")), _(u.Alert, "infoFilledBg", D("palette-info-dark")), _(u.Alert, "successFilledBg", D("palette-success-dark")), _(u.Alert, "warningFilledBg", D("palette-warning-dark")), _(u.Alert, "errorFilledColor", ft(() => u.getContrastText(u.error.dark))), _(u.Alert, "infoFilledColor", ft(() => u.getContrastText(u.info.dark))), _(u.Alert, "successFilledColor", ft(() => u.getContrastText(u.success.dark))), _(u.Alert, "warningFilledColor", ft(() => u.getContrastText(u.warning.dark))), _(u.Alert, "errorStandardBg", be(u.error.light, 0.9)), _(u.Alert, "infoStandardBg", be(u.info.light, 0.9)), _(u.Alert, "successStandardBg", be(u.success.light, 0.9)), _(u.Alert, "warningStandardBg", be(u.warning.light, 0.9)), _(u.Alert, "errorIconColor", D("palette-error-main")), _(u.Alert, "infoIconColor", D("palette-info-main")), _(u.Alert, "successIconColor", D("palette-success-main")), _(u.Alert, "warningIconColor", D("palette-warning-main")), _(u.AppBar, "defaultBg", D("palette-grey-900")), _(u.AppBar, "darkBg", D("palette-background-paper")), _(u.AppBar, "darkColor", D("palette-text-primary")), _(u.Avatar, "defaultBg", D("palette-grey-600")), _(u.Button, "inheritContainedBg", D("palette-grey-800")), _(u.Button, "inheritContainedHoverBg", D("palette-grey-700")), _(u.Chip, "defaultBorder", D("palette-grey-700")), _(u.Chip, "defaultAvatarColor", D("palette-grey-300")), _(u.Chip, "defaultIconColor", D("palette-grey-300")), _(u.FilledInput, "bg", "rgba(255, 255, 255, 0.09)"), _(u.FilledInput, "hoverBg", "rgba(255, 255, 255, 0.13)"), _(u.FilledInput, "disabledBg", "rgba(255, 255, 255, 0.12)"), _(u.LinearProgress, "primaryBg", be(u.primary.main, 0.5)), _(u.LinearProgress, "secondaryBg", be(u.secondary.main, 0.5)), _(u.LinearProgress, "errorBg", be(u.error.main, 0.5)), _(u.LinearProgress, "infoBg", be(u.info.main, 0.5)), _(u.LinearProgress, "successBg", be(u.success.main, 0.5)), _(u.LinearProgress, "warningBg", be(u.warning.main, 0.5)), _(u.Skeleton, "bg", `rgba(${D("palette-text-primaryChannel")} / 0.13)`), _(u.Slider, "primaryTrack", be(u.primary.main, 0.5)), _(u.Slider, "secondaryTrack", be(u.secondary.main, 0.5)), _(u.Slider, "errorTrack", be(u.error.main, 0.5)), _(u.Slider, "infoTrack", be(u.info.main, 0.5)), _(u.Slider, "successTrack", be(u.success.main, 0.5)), _(u.Slider, "warningTrack", be(u.warning.main, 0.5));
|
|
8923
8935
|
const k = $n(u.background.default, 0.98);
|
|
8924
|
-
_(u.SnackbarContent, "bg", k), _(u.SnackbarContent, "color", ft(() => u.getContrastText(k))), _(u.SpeedDialAction, "fabHoverBg", $n(u.background.paper, 0.15)), _(u.StepConnector, "border",
|
|
8936
|
+
_(u.SnackbarContent, "bg", k), _(u.SnackbarContent, "color", ft(() => u.getContrastText(k))), _(u.SpeedDialAction, "fabHoverBg", $n(u.background.paper, 0.15)), _(u.StepConnector, "border", D("palette-grey-600")), _(u.StepContent, "border", D("palette-grey-600")), _(u.Switch, "defaultColor", D("palette-grey-300")), _(u.Switch, "defaultDisabledColor", D("palette-grey-600")), _(u.Switch, "primaryDisabledColor", be(u.primary.main, 0.55)), _(u.Switch, "secondaryDisabledColor", be(u.secondary.main, 0.55)), _(u.Switch, "errorDisabledColor", be(u.error.main, 0.55)), _(u.Switch, "infoDisabledColor", be(u.info.main, 0.55)), _(u.Switch, "successDisabledColor", be(u.success.main, 0.55)), _(u.Switch, "warningDisabledColor", be(u.warning.main, 0.55)), _(u.TableCell, "border", be(Fn(u.divider, 1), 0.68)), _(u.Tooltip, "bg", Fn(u.grey[700], 0.92));
|
|
8925
8937
|
}
|
|
8926
8938
|
kt(u.background, "default"), kt(u.background, "paper"), kt(u.common, "background"), kt(u.common, "onBackground"), kt(u, "divider"), Object.keys(u).forEach((k) => {
|
|
8927
8939
|
const P = u[k];
|
|
@@ -8936,11 +8948,11 @@ function af(e = {}, ...t) {
|
|
|
8936
8948
|
}, {
|
|
8937
8949
|
vars: M,
|
|
8938
8950
|
generateThemeVars: G,
|
|
8939
|
-
generateStyleSheets:
|
|
8951
|
+
generateStyleSheets: J
|
|
8940
8952
|
} = Op(C, w);
|
|
8941
8953
|
return C.vars = M, Object.entries(C.colorSchemes[C.defaultColorScheme]).forEach(([H, u]) => {
|
|
8942
8954
|
C[H] = u;
|
|
8943
|
-
}), C.generateThemeVars = G, C.generateStyleSheets =
|
|
8955
|
+
}), C.generateThemeVars = G, C.generateStyleSheets = J, C.generateSpacing = function() {
|
|
8944
8956
|
return Xo(p.spacing, va(this));
|
|
8945
8957
|
}, C.getColorSchemeSelector = Tp(o), C.spacing = C.generateSpacing(), C.shouldSkipGeneratingVar = s, C.unstable_sxConfig = {
|
|
8946
8958
|
...di,
|
|
@@ -9015,7 +9027,7 @@ const uf = (e) => cf(e) && e !== "classes", df = lp({
|
|
|
9015
9027
|
defaultTheme: of,
|
|
9016
9028
|
rootShouldForwardProp: uf
|
|
9017
9029
|
}), pf = wp;
|
|
9018
|
-
process.env.NODE_ENV !== "production" && (
|
|
9030
|
+
process.env.NODE_ENV !== "production" && (te.node, te.object.isRequired);
|
|
9019
9031
|
function ff(e) {
|
|
9020
9032
|
return bp(e);
|
|
9021
9033
|
}
|
|
@@ -9172,7 +9184,7 @@ const hf = (e) => {
|
|
|
9172
9184
|
...b,
|
|
9173
9185
|
...h && i.props,
|
|
9174
9186
|
ownerState: c,
|
|
9175
|
-
children: [h ? i.props.children : i, f ? /* @__PURE__ */
|
|
9187
|
+
children: [h ? i.props.children : i, f ? /* @__PURE__ */ $("title", {
|
|
9176
9188
|
children: f
|
|
9177
9189
|
}) : null]
|
|
9178
9190
|
});
|
|
@@ -9185,15 +9197,15 @@ process.env.NODE_ENV !== "production" && (Yn.propTypes = {
|
|
|
9185
9197
|
/**
|
|
9186
9198
|
* Node passed into the SVG element.
|
|
9187
9199
|
*/
|
|
9188
|
-
children:
|
|
9200
|
+
children: te.node,
|
|
9189
9201
|
/**
|
|
9190
9202
|
* Override or extend the styles applied to the component.
|
|
9191
9203
|
*/
|
|
9192
|
-
classes:
|
|
9204
|
+
classes: te.object,
|
|
9193
9205
|
/**
|
|
9194
9206
|
* @ignore
|
|
9195
9207
|
*/
|
|
9196
|
-
className:
|
|
9208
|
+
className: te.string,
|
|
9197
9209
|
/**
|
|
9198
9210
|
* The color of the component.
|
|
9199
9211
|
* It supports both default and custom theme colors, which can be added as shown in the
|
|
@@ -9201,21 +9213,21 @@ process.env.NODE_ENV !== "production" && (Yn.propTypes = {
|
|
|
9201
9213
|
* You can use the `htmlColor` prop to apply a color attribute to the SVG element.
|
|
9202
9214
|
* @default 'inherit'
|
|
9203
9215
|
*/
|
|
9204
|
-
color:
|
|
9216
|
+
color: te.oneOfType([te.oneOf(["inherit", "action", "disabled", "primary", "secondary", "error", "info", "success", "warning"]), te.string]),
|
|
9205
9217
|
/**
|
|
9206
9218
|
* The component used for the root node.
|
|
9207
9219
|
* Either a string to use a HTML element or a component.
|
|
9208
9220
|
*/
|
|
9209
|
-
component:
|
|
9221
|
+
component: te.elementType,
|
|
9210
9222
|
/**
|
|
9211
9223
|
* The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.
|
|
9212
9224
|
* @default 'medium'
|
|
9213
9225
|
*/
|
|
9214
|
-
fontSize:
|
|
9226
|
+
fontSize: te.oneOfType([te.oneOf(["inherit", "large", "medium", "small"]), te.string]),
|
|
9215
9227
|
/**
|
|
9216
9228
|
* Applies a color attribute to the SVG element.
|
|
9217
9229
|
*/
|
|
9218
|
-
htmlColor:
|
|
9230
|
+
htmlColor: te.string,
|
|
9219
9231
|
/**
|
|
9220
9232
|
* If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`
|
|
9221
9233
|
* prop will be ignored.
|
|
@@ -9223,22 +9235,22 @@ process.env.NODE_ENV !== "production" && (Yn.propTypes = {
|
|
|
9223
9235
|
* `component`'s viewBox to the root node.
|
|
9224
9236
|
* @default false
|
|
9225
9237
|
*/
|
|
9226
|
-
inheritViewBox:
|
|
9238
|
+
inheritViewBox: te.bool,
|
|
9227
9239
|
/**
|
|
9228
9240
|
* The shape-rendering attribute. The behavior of the different options is described on the
|
|
9229
9241
|
* [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/shape-rendering).
|
|
9230
9242
|
* If you are having issues with blurry icons you should investigate this prop.
|
|
9231
9243
|
*/
|
|
9232
|
-
shapeRendering:
|
|
9244
|
+
shapeRendering: te.string,
|
|
9233
9245
|
/**
|
|
9234
9246
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
9235
9247
|
*/
|
|
9236
|
-
sx:
|
|
9248
|
+
sx: te.oneOfType([te.arrayOf(te.oneOfType([te.func, te.object, te.bool])), te.func, te.object]),
|
|
9237
9249
|
/**
|
|
9238
9250
|
* Provides a human-readable title for the element that contains it.
|
|
9239
9251
|
* https://www.w3.org/TR/SVG-access/#Equivalent
|
|
9240
9252
|
*/
|
|
9241
|
-
titleAccess:
|
|
9253
|
+
titleAccess: te.string,
|
|
9242
9254
|
/**
|
|
9243
9255
|
* Allows you to redefine what the coordinates without units mean inside an SVG element.
|
|
9244
9256
|
* For example, if the SVG element is 500 (width) by 200 (height),
|
|
@@ -9247,12 +9259,12 @@ process.env.NODE_ENV !== "production" && (Yn.propTypes = {
|
|
|
9247
9259
|
* to bottom right (50,20) and each unit will be worth 10px.
|
|
9248
9260
|
* @default '0 0 24 24'
|
|
9249
9261
|
*/
|
|
9250
|
-
viewBox:
|
|
9262
|
+
viewBox: te.string
|
|
9251
9263
|
});
|
|
9252
9264
|
Yn.muiName = "SvgIcon";
|
|
9253
9265
|
function yn(e, t) {
|
|
9254
9266
|
function r(n, i) {
|
|
9255
|
-
return /* @__PURE__ */
|
|
9267
|
+
return /* @__PURE__ */ $(Yn, {
|
|
9256
9268
|
"data-testid": process.env.NODE_ENV !== "production" ? `${t}Icon` : void 0,
|
|
9257
9269
|
ref: i,
|
|
9258
9270
|
...n,
|
|
@@ -9261,15 +9273,15 @@ function yn(e, t) {
|
|
|
9261
9273
|
}
|
|
9262
9274
|
return process.env.NODE_ENV !== "production" && (r.displayName = `${t}Icon`), r.muiName = Yn.muiName, /* @__PURE__ */ Ae.memo(/* @__PURE__ */ Ae.forwardRef(r));
|
|
9263
9275
|
}
|
|
9264
|
-
const yf = yn(/* @__PURE__ */
|
|
9276
|
+
const yf = yn(/* @__PURE__ */ $("path", {
|
|
9265
9277
|
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"
|
|
9266
|
-
}), "CheckCircle"), vf = yn(/* @__PURE__ */
|
|
9278
|
+
}), "CheckCircle"), vf = yn(/* @__PURE__ */ $("path", {
|
|
9267
9279
|
d: "M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"
|
|
9268
|
-
}), "CloudUpload"), xf = yn(/* @__PURE__ */
|
|
9280
|
+
}), "CloudUpload"), xf = yn(/* @__PURE__ */ $("path", {
|
|
9269
9281
|
d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"
|
|
9270
|
-
}), "Delete"), Zn = yn(/* @__PURE__ */
|
|
9282
|
+
}), "Delete"), Zn = yn(/* @__PURE__ */ $("path", {
|
|
9271
9283
|
d: "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"
|
|
9272
|
-
}), "Description"), dl = yn(/* @__PURE__ */
|
|
9284
|
+
}), "Description"), dl = yn(/* @__PURE__ */ $("path", {
|
|
9273
9285
|
d: "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"
|
|
9274
9286
|
}), "Image");
|
|
9275
9287
|
function hr(e, t, r, n) {
|
|
@@ -11009,7 +11021,7 @@ Oa.propTypes = {
|
|
|
11009
11021
|
* @param {File[]} params.acceptedFiles Accepted files
|
|
11010
11022
|
* @param {FileRejection[]} params.fileRejections Rejected files and why they were rejected
|
|
11011
11023
|
*/
|
|
11012
|
-
children:
|
|
11024
|
+
children: te.func,
|
|
11013
11025
|
/**
|
|
11014
11026
|
* Set accepted file types.
|
|
11015
11027
|
* Checkout https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker types option for more information.
|
|
@@ -11017,90 +11029,90 @@ Oa.propTypes = {
|
|
|
11017
11029
|
* for example, are reported as text/plain under macOS but as application/vnd.ms-excel under
|
|
11018
11030
|
* Windows. In some cases there might not be a mime type set at all (https://github.com/react-dropzone/react-dropzone/issues/276).
|
|
11019
11031
|
*/
|
|
11020
|
-
accept:
|
|
11032
|
+
accept: te.objectOf(te.arrayOf(te.string)),
|
|
11021
11033
|
/**
|
|
11022
11034
|
* Allow drag 'n' drop (or selection from the file dialog) of multiple files
|
|
11023
11035
|
*/
|
|
11024
|
-
multiple:
|
|
11036
|
+
multiple: te.bool,
|
|
11025
11037
|
/**
|
|
11026
11038
|
* If false, allow dropped items to take over the current browser window
|
|
11027
11039
|
*/
|
|
11028
|
-
preventDropOnDocument:
|
|
11040
|
+
preventDropOnDocument: te.bool,
|
|
11029
11041
|
/**
|
|
11030
11042
|
* If true, disables click to open the native file selection dialog
|
|
11031
11043
|
*/
|
|
11032
|
-
noClick:
|
|
11044
|
+
noClick: te.bool,
|
|
11033
11045
|
/**
|
|
11034
11046
|
* If true, disables SPACE/ENTER to open the native file selection dialog.
|
|
11035
11047
|
* Note that it also stops tracking the focus state.
|
|
11036
11048
|
*/
|
|
11037
|
-
noKeyboard:
|
|
11049
|
+
noKeyboard: te.bool,
|
|
11038
11050
|
/**
|
|
11039
11051
|
* If true, disables drag 'n' drop
|
|
11040
11052
|
*/
|
|
11041
|
-
noDrag:
|
|
11053
|
+
noDrag: te.bool,
|
|
11042
11054
|
/**
|
|
11043
11055
|
* If true, stops drag event propagation to parents
|
|
11044
11056
|
*/
|
|
11045
|
-
noDragEventsBubbling:
|
|
11057
|
+
noDragEventsBubbling: te.bool,
|
|
11046
11058
|
/**
|
|
11047
11059
|
* Minimum file size (in bytes)
|
|
11048
11060
|
*/
|
|
11049
|
-
minSize:
|
|
11061
|
+
minSize: te.number,
|
|
11050
11062
|
/**
|
|
11051
11063
|
* Maximum file size (in bytes)
|
|
11052
11064
|
*/
|
|
11053
|
-
maxSize:
|
|
11065
|
+
maxSize: te.number,
|
|
11054
11066
|
/**
|
|
11055
11067
|
* Maximum accepted number of files
|
|
11056
11068
|
* The default value is 0 which means there is no limitation to how many files are accepted.
|
|
11057
11069
|
*/
|
|
11058
|
-
maxFiles:
|
|
11070
|
+
maxFiles: te.number,
|
|
11059
11071
|
/**
|
|
11060
11072
|
* Enable/disable the dropzone
|
|
11061
11073
|
*/
|
|
11062
|
-
disabled:
|
|
11074
|
+
disabled: te.bool,
|
|
11063
11075
|
/**
|
|
11064
11076
|
* Use this to provide a custom file aggregator
|
|
11065
11077
|
*
|
|
11066
11078
|
* @param {(DragEvent|Event|Array<FileSystemFileHandle>)} event A drag event or input change event (if files were selected via the file dialog)
|
|
11067
11079
|
*/
|
|
11068
|
-
getFilesFromEvent:
|
|
11080
|
+
getFilesFromEvent: te.func,
|
|
11069
11081
|
/**
|
|
11070
11082
|
* Cb for when closing the file dialog with no selection
|
|
11071
11083
|
*/
|
|
11072
|
-
onFileDialogCancel:
|
|
11084
|
+
onFileDialogCancel: te.func,
|
|
11073
11085
|
/**
|
|
11074
11086
|
* Cb for when opening the file dialog
|
|
11075
11087
|
*/
|
|
11076
|
-
onFileDialogOpen:
|
|
11088
|
+
onFileDialogOpen: te.func,
|
|
11077
11089
|
/**
|
|
11078
11090
|
* Set to true to use the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
|
|
11079
11091
|
* to open the file picker instead of using an `<input type="file">` click event.
|
|
11080
11092
|
*/
|
|
11081
|
-
useFsAccessApi:
|
|
11093
|
+
useFsAccessApi: te.bool,
|
|
11082
11094
|
/**
|
|
11083
11095
|
* Set to true to focus the root element on render
|
|
11084
11096
|
*/
|
|
11085
|
-
autoFocus:
|
|
11097
|
+
autoFocus: te.bool,
|
|
11086
11098
|
/**
|
|
11087
11099
|
* Cb for when the `dragenter` event occurs.
|
|
11088
11100
|
*
|
|
11089
11101
|
* @param {DragEvent} event
|
|
11090
11102
|
*/
|
|
11091
|
-
onDragEnter:
|
|
11103
|
+
onDragEnter: te.func,
|
|
11092
11104
|
/**
|
|
11093
11105
|
* Cb for when the `dragleave` event occurs
|
|
11094
11106
|
*
|
|
11095
11107
|
* @param {DragEvent} event
|
|
11096
11108
|
*/
|
|
11097
|
-
onDragLeave:
|
|
11109
|
+
onDragLeave: te.func,
|
|
11098
11110
|
/**
|
|
11099
11111
|
* Cb for when the `dragover` event occurs
|
|
11100
11112
|
*
|
|
11101
11113
|
* @param {DragEvent} event
|
|
11102
11114
|
*/
|
|
11103
|
-
onDragOver:
|
|
11115
|
+
onDragOver: te.func,
|
|
11104
11116
|
/**
|
|
11105
11117
|
* Cb for when the `drop` event occurs.
|
|
11106
11118
|
* Note that this callback is invoked after the `getFilesFromEvent` callback is done.
|
|
@@ -11131,7 +11143,7 @@ Oa.propTypes = {
|
|
|
11131
11143
|
* @param {FileRejection[]} fileRejections
|
|
11132
11144
|
* @param {(DragEvent|Event)} event A drag event or input change event (if files were selected via the file dialog)
|
|
11133
11145
|
*/
|
|
11134
|
-
onDrop:
|
|
11146
|
+
onDrop: te.func,
|
|
11135
11147
|
/**
|
|
11136
11148
|
* Cb for when the `drop` event occurs.
|
|
11137
11149
|
* Note that if no files are accepted, this callback is not invoked.
|
|
@@ -11139,7 +11151,7 @@ Oa.propTypes = {
|
|
|
11139
11151
|
* @param {File[]} files
|
|
11140
11152
|
* @param {(DragEvent|Event)} event
|
|
11141
11153
|
*/
|
|
11142
|
-
onDropAccepted:
|
|
11154
|
+
onDropAccepted: te.func,
|
|
11143
11155
|
/**
|
|
11144
11156
|
* Cb for when the `drop` event occurs.
|
|
11145
11157
|
* Note that if no files are rejected, this callback is not invoked.
|
|
@@ -11147,19 +11159,19 @@ Oa.propTypes = {
|
|
|
11147
11159
|
* @param {FileRejection[]} fileRejections
|
|
11148
11160
|
* @param {(DragEvent|Event)} event
|
|
11149
11161
|
*/
|
|
11150
|
-
onDropRejected:
|
|
11162
|
+
onDropRejected: te.func,
|
|
11151
11163
|
/**
|
|
11152
11164
|
* Cb for when there's some error from any of the promises.
|
|
11153
11165
|
*
|
|
11154
11166
|
* @param {Error} error
|
|
11155
11167
|
*/
|
|
11156
|
-
onError:
|
|
11168
|
+
onError: te.func,
|
|
11157
11169
|
/**
|
|
11158
11170
|
* Custom validation function. It must return null if there's no errors.
|
|
11159
11171
|
* @param {File} file
|
|
11160
11172
|
* @returns {FileError|FileError[]|null}
|
|
11161
11173
|
*/
|
|
11162
|
-
validator:
|
|
11174
|
+
validator: te.func
|
|
11163
11175
|
};
|
|
11164
11176
|
var na = {
|
|
11165
11177
|
isFocused: !1,
|
|
@@ -11171,44 +11183,44 @@ var na = {
|
|
|
11171
11183
|
fileRejections: []
|
|
11172
11184
|
};
|
|
11173
11185
|
function Sl() {
|
|
11174
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = ke(ke({}, wl), e), r = t.accept, n = t.disabled, i = t.getFilesFromEvent, a = t.maxSize, s = t.minSize, o = t.multiple, l = t.maxFiles, p = t.onDragEnter, d = t.onDragLeave, f = t.onDragOver, m = t.onDrop, b = t.onDropAccepted, h = t.onDropRejected, c = t.onFileDialogCancel, x = t.onFileDialogOpen, y = t.useFsAccessApi, O = t.autoFocus, F = t.preventDropOnDocument, C = t.noClick, w = t.noKeyboard, M = t.noDrag, G = t.noDragEventsBubbling,
|
|
11186
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = ke(ke({}, wl), e), r = t.accept, n = t.disabled, i = t.getFilesFromEvent, a = t.maxSize, s = t.minSize, o = t.multiple, l = t.maxFiles, p = t.onDragEnter, d = t.onDragLeave, f = t.onDragOver, m = t.onDrop, b = t.onDropAccepted, h = t.onDropRejected, c = t.onFileDialogCancel, x = t.onFileDialogOpen, y = t.useFsAccessApi, O = t.autoFocus, F = t.preventDropOnDocument, C = t.noClick, w = t.noKeyboard, M = t.noDrag, G = t.noDragEventsBubbling, J = t.onError, H = t.validator, u = ze(function() {
|
|
11175
11187
|
return Xf(r);
|
|
11176
|
-
}, [r]),
|
|
11188
|
+
}, [r]), D = ze(function() {
|
|
11177
11189
|
return Jf(r);
|
|
11178
|
-
}, [r]), k =
|
|
11190
|
+
}, [r]), k = ze(function() {
|
|
11179
11191
|
return typeof x == "function" ? x : Qs;
|
|
11180
|
-
}, [x]), P =
|
|
11192
|
+
}, [x]), P = ze(function() {
|
|
11181
11193
|
return typeof c == "function" ? c : Qs;
|
|
11182
|
-
}, [c]),
|
|
11183
|
-
!
|
|
11194
|
+
}, [c]), z = xt(null), V = xt(null), L = Ol(mm, na), se = $i(L, 2), ce = se[0], ue = se[1], j = ce.isFocused, W = ce.isFileDialogActive, N = xt(typeof window < "u" && window.isSecureContext && y && Zf()), U = function() {
|
|
11195
|
+
!N.current && W && setTimeout(function() {
|
|
11184
11196
|
if (V.current) {
|
|
11185
11197
|
var T = V.current.files;
|
|
11186
|
-
T.length || (
|
|
11198
|
+
T.length || (ue({
|
|
11187
11199
|
type: "closeDialog"
|
|
11188
11200
|
}), P());
|
|
11189
11201
|
}
|
|
11190
11202
|
}, 300);
|
|
11191
11203
|
};
|
|
11192
11204
|
wt(function() {
|
|
11193
|
-
return window.addEventListener("focus",
|
|
11194
|
-
window.removeEventListener("focus",
|
|
11205
|
+
return window.addEventListener("focus", U, !1), function() {
|
|
11206
|
+
window.removeEventListener("focus", U, !1);
|
|
11195
11207
|
};
|
|
11196
|
-
}, [V,
|
|
11197
|
-
var
|
|
11198
|
-
|
|
11208
|
+
}, [V, W, P, N]);
|
|
11209
|
+
var Y = xt([]), ne = function(T) {
|
|
11210
|
+
z.current && z.current.contains(T.target) || (T.preventDefault(), Y.current = []);
|
|
11199
11211
|
};
|
|
11200
11212
|
wt(function() {
|
|
11201
|
-
return F && (document.addEventListener("dragover", Hs, !1), document.addEventListener("drop",
|
|
11202
|
-
F && (document.removeEventListener("dragover", Hs), document.removeEventListener("drop",
|
|
11213
|
+
return F && (document.addEventListener("dragover", Hs, !1), document.addEventListener("drop", ne, !1)), function() {
|
|
11214
|
+
F && (document.removeEventListener("dragover", Hs), document.removeEventListener("drop", ne));
|
|
11203
11215
|
};
|
|
11204
|
-
}, [
|
|
11205
|
-
return !n && O &&
|
|
11216
|
+
}, [z, F]), wt(function() {
|
|
11217
|
+
return !n && O && z.current && z.current.focus(), function() {
|
|
11206
11218
|
};
|
|
11207
|
-
}, [
|
|
11208
|
-
var
|
|
11209
|
-
|
|
11210
|
-
}, [
|
|
11211
|
-
E.preventDefault(), E.persist(), g(E),
|
|
11219
|
+
}, [z, O, n]);
|
|
11220
|
+
var re = Pe(function(E) {
|
|
11221
|
+
J ? J(E) : console.error(E);
|
|
11222
|
+
}, [J]), X = Pe(function(E) {
|
|
11223
|
+
E.preventDefault(), E.persist(), g(E), Y.current = [].concat(sm(Y.current), [E.target]), Rn(E) && Promise.resolve(i(E)).then(function(T) {
|
|
11212
11224
|
if (!(Xn(E) && !G)) {
|
|
11213
11225
|
var B = T.length, ie = B > 0 && Kf({
|
|
11214
11226
|
files: T,
|
|
@@ -11218,18 +11230,18 @@ function Sl() {
|
|
|
11218
11230
|
multiple: o,
|
|
11219
11231
|
maxFiles: l,
|
|
11220
11232
|
validator: H
|
|
11221
|
-
}),
|
|
11222
|
-
|
|
11233
|
+
}), le = B > 0 && !ie;
|
|
11234
|
+
ue({
|
|
11223
11235
|
isDragAccept: ie,
|
|
11224
|
-
isDragReject:
|
|
11236
|
+
isDragReject: le,
|
|
11225
11237
|
isDragActive: !0,
|
|
11226
11238
|
type: "setDraggedFiles"
|
|
11227
11239
|
}), p && p(E);
|
|
11228
11240
|
}
|
|
11229
11241
|
}).catch(function(T) {
|
|
11230
|
-
return
|
|
11242
|
+
return re(T);
|
|
11231
11243
|
});
|
|
11232
|
-
}, [i, p,
|
|
11244
|
+
}, [i, p, re, G, u, s, a, o, l, H]), R = Pe(function(E) {
|
|
11233
11245
|
E.preventDefault(), E.persist(), g(E);
|
|
11234
11246
|
var T = Rn(E);
|
|
11235
11247
|
if (T && E.dataTransfer)
|
|
@@ -11238,89 +11250,89 @@ function Sl() {
|
|
|
11238
11250
|
} catch {
|
|
11239
11251
|
}
|
|
11240
11252
|
return T && f && f(E), !1;
|
|
11241
|
-
}, [f, G]),
|
|
11253
|
+
}, [f, G]), ee = Pe(function(E) {
|
|
11242
11254
|
E.preventDefault(), E.persist(), g(E);
|
|
11243
|
-
var T =
|
|
11244
|
-
return
|
|
11255
|
+
var T = Y.current.filter(function(ie) {
|
|
11256
|
+
return z.current && z.current.contains(ie);
|
|
11245
11257
|
}), B = T.indexOf(E.target);
|
|
11246
|
-
B !== -1 && T.splice(B, 1),
|
|
11258
|
+
B !== -1 && T.splice(B, 1), Y.current = T, !(T.length > 0) && (ue({
|
|
11247
11259
|
type: "setDraggedFiles",
|
|
11248
11260
|
isDragActive: !1,
|
|
11249
11261
|
isDragAccept: !1,
|
|
11250
11262
|
isDragReject: !1
|
|
11251
11263
|
}), Rn(E) && d && d(E));
|
|
11252
|
-
}, [
|
|
11264
|
+
}, [z, d, G]), Q = Pe(function(E, T) {
|
|
11253
11265
|
var B = [], ie = [];
|
|
11254
|
-
E.forEach(function(
|
|
11255
|
-
var je = gl(
|
|
11266
|
+
E.forEach(function(le) {
|
|
11267
|
+
var je = gl(le, u), at = $i(je, 2), et = at[0], Br = at[1], Zt = yl(le, s, a), $t = $i(Zt, 2), Ur = $t[0], gr = $t[1], Wr = H ? H(le) : null;
|
|
11256
11268
|
if (et && Ur && !Wr)
|
|
11257
|
-
B.push(
|
|
11269
|
+
B.push(le);
|
|
11258
11270
|
else {
|
|
11259
11271
|
var yr = [Br, gr];
|
|
11260
11272
|
Wr && (yr = yr.concat(Wr)), ie.push({
|
|
11261
|
-
file:
|
|
11273
|
+
file: le,
|
|
11262
11274
|
errors: yr.filter(function(El) {
|
|
11263
11275
|
return El;
|
|
11264
11276
|
})
|
|
11265
11277
|
});
|
|
11266
11278
|
}
|
|
11267
|
-
}), (!o && B.length > 1 || o && l >= 1 && B.length > l) && (B.forEach(function(
|
|
11279
|
+
}), (!o && B.length > 1 || o && l >= 1 && B.length > l) && (B.forEach(function(le) {
|
|
11268
11280
|
ie.push({
|
|
11269
|
-
file:
|
|
11281
|
+
file: le,
|
|
11270
11282
|
errors: [Hf]
|
|
11271
11283
|
});
|
|
11272
|
-
}), B.splice(0)),
|
|
11284
|
+
}), B.splice(0)), ue({
|
|
11273
11285
|
acceptedFiles: B,
|
|
11274
11286
|
fileRejections: ie,
|
|
11275
11287
|
isDragReject: ie.length > 0,
|
|
11276
11288
|
type: "setFiles"
|
|
11277
11289
|
}), m && m(B, ie, T), ie.length > 0 && h && h(ie, T), B.length > 0 && b && b(B, T);
|
|
11278
|
-
}, [
|
|
11279
|
-
E.preventDefault(), E.persist(), g(E),
|
|
11280
|
-
Xn(E) && !G ||
|
|
11290
|
+
}, [ue, o, u, s, a, l, m, b, h, H]), oe = Pe(function(E) {
|
|
11291
|
+
E.preventDefault(), E.persist(), g(E), Y.current = [], Rn(E) && Promise.resolve(i(E)).then(function(T) {
|
|
11292
|
+
Xn(E) && !G || Q(T, E);
|
|
11281
11293
|
}).catch(function(T) {
|
|
11282
|
-
return
|
|
11283
|
-
}),
|
|
11294
|
+
return re(T);
|
|
11295
|
+
}), ue({
|
|
11284
11296
|
type: "reset"
|
|
11285
11297
|
});
|
|
11286
|
-
}, [i,
|
|
11287
|
-
if (
|
|
11288
|
-
|
|
11298
|
+
}, [i, Q, re, G]), I = Pe(function() {
|
|
11299
|
+
if (N.current) {
|
|
11300
|
+
ue({
|
|
11289
11301
|
type: "openDialog"
|
|
11290
11302
|
}), k();
|
|
11291
11303
|
var E = {
|
|
11292
11304
|
multiple: o,
|
|
11293
|
-
types:
|
|
11305
|
+
types: D
|
|
11294
11306
|
};
|
|
11295
11307
|
window.showOpenFilePicker(E).then(function(T) {
|
|
11296
11308
|
return i(T);
|
|
11297
11309
|
}).then(function(T) {
|
|
11298
|
-
|
|
11310
|
+
Q(T, null), ue({
|
|
11299
11311
|
type: "closeDialog"
|
|
11300
11312
|
});
|
|
11301
11313
|
}).catch(function(T) {
|
|
11302
|
-
em(T) ? (P(T),
|
|
11314
|
+
em(T) ? (P(T), ue({
|
|
11303
11315
|
type: "closeDialog"
|
|
11304
|
-
})) : tm(T) ? (
|
|
11316
|
+
})) : tm(T) ? (N.current = !1, V.current ? (V.current.value = null, V.current.click()) : re(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))) : re(T);
|
|
11305
11317
|
});
|
|
11306
11318
|
return;
|
|
11307
11319
|
}
|
|
11308
|
-
V.current && (
|
|
11320
|
+
V.current && (ue({
|
|
11309
11321
|
type: "openDialog"
|
|
11310
11322
|
}), k(), V.current.value = null, V.current.click());
|
|
11311
|
-
}, [
|
|
11312
|
-
!
|
|
11313
|
-
}, [
|
|
11314
|
-
|
|
11323
|
+
}, [ue, k, P, y, Q, re, D, o]), Le = Pe(function(E) {
|
|
11324
|
+
!z.current || !z.current.isEqualNode(E.target) || (E.key === " " || E.key === "Enter" || E.keyCode === 32 || E.keyCode === 13) && (E.preventDefault(), I());
|
|
11325
|
+
}, [z, I]), dt = Pe(function() {
|
|
11326
|
+
ue({
|
|
11315
11327
|
type: "focus"
|
|
11316
11328
|
});
|
|
11317
11329
|
}, []), At = Pe(function() {
|
|
11318
|
-
|
|
11330
|
+
ue({
|
|
11319
11331
|
type: "blur"
|
|
11320
11332
|
});
|
|
11321
11333
|
}, []), vn = Pe(function() {
|
|
11322
|
-
C || (Yf() ? setTimeout(
|
|
11323
|
-
}, [C,
|
|
11334
|
+
C || (Yf() ? setTimeout(I, 0) : I());
|
|
11335
|
+
}, [C, I]), Ft = function(T) {
|
|
11324
11336
|
return n ? null : T;
|
|
11325
11337
|
}, xn = function(T) {
|
|
11326
11338
|
return w ? null : Ft(T);
|
|
@@ -11328,28 +11340,28 @@ function Sl() {
|
|
|
11328
11340
|
return M ? null : Ft(T);
|
|
11329
11341
|
}, g = function(T) {
|
|
11330
11342
|
G && T.stopPropagation();
|
|
11331
|
-
}, S =
|
|
11343
|
+
}, S = ze(function() {
|
|
11332
11344
|
return function() {
|
|
11333
|
-
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, T = E.refKey, B = T === void 0 ? "ref" : T, ie = E.role,
|
|
11345
|
+
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, T = E.refKey, B = T === void 0 ? "ref" : T, ie = E.role, le = E.onKeyDown, je = E.onFocus, at = E.onBlur, et = E.onClick, Br = E.onDragEnter, Zt = E.onDragOver, $t = E.onDragLeave, Ur = E.onDrop, gr = ei(E, im);
|
|
11334
11346
|
return ke(ke(ra({
|
|
11335
|
-
onKeyDown: xn(mt(
|
|
11347
|
+
onKeyDown: xn(mt(le, Le)),
|
|
11336
11348
|
onFocus: xn(mt(je, dt)),
|
|
11337
11349
|
onBlur: xn(mt(at, At)),
|
|
11338
11350
|
onClick: Ft(mt(et, vn)),
|
|
11339
|
-
onDragEnter: Yt(mt(Br,
|
|
11340
|
-
onDragOver: Yt(mt(Zt,
|
|
11341
|
-
onDragLeave: Yt(mt($t,
|
|
11342
|
-
onDrop: Yt(mt(Ur,
|
|
11351
|
+
onDragEnter: Yt(mt(Br, X)),
|
|
11352
|
+
onDragOver: Yt(mt(Zt, R)),
|
|
11353
|
+
onDragLeave: Yt(mt($t, ee)),
|
|
11354
|
+
onDrop: Yt(mt(Ur, oe)),
|
|
11343
11355
|
role: typeof ie == "string" && ie !== "" ? ie : "presentation"
|
|
11344
|
-
}, B,
|
|
11356
|
+
}, B, z), !n && !w ? {
|
|
11345
11357
|
tabIndex: 0
|
|
11346
11358
|
} : {}), gr);
|
|
11347
11359
|
};
|
|
11348
|
-
}, [
|
|
11360
|
+
}, [z, Le, dt, At, vn, X, R, ee, oe, w, M, n]), A = Pe(function(E) {
|
|
11349
11361
|
E.stopPropagation();
|
|
11350
|
-
}, []), K =
|
|
11362
|
+
}, []), K = ze(function() {
|
|
11351
11363
|
return function() {
|
|
11352
|
-
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, T = E.refKey, B = T === void 0 ? "ref" : T, ie = E.onChange,
|
|
11364
|
+
var E = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, T = E.refKey, B = T === void 0 ? "ref" : T, ie = E.onChange, le = E.onClick, je = ei(E, am), at = ra({
|
|
11353
11365
|
accept: u,
|
|
11354
11366
|
multiple: o,
|
|
11355
11367
|
type: "file",
|
|
@@ -11365,20 +11377,20 @@ function Sl() {
|
|
|
11365
11377
|
width: "1px",
|
|
11366
11378
|
whiteSpace: "nowrap"
|
|
11367
11379
|
},
|
|
11368
|
-
onChange: Ft(mt(ie,
|
|
11369
|
-
onClick: Ft(mt(
|
|
11380
|
+
onChange: Ft(mt(ie, oe)),
|
|
11381
|
+
onClick: Ft(mt(le, A)),
|
|
11370
11382
|
tabIndex: -1
|
|
11371
11383
|
}, B, V);
|
|
11372
11384
|
return ke(ke({}, at), je);
|
|
11373
11385
|
};
|
|
11374
|
-
}, [V, r, o,
|
|
11375
|
-
return ke(ke({},
|
|
11386
|
+
}, [V, r, o, oe, n]);
|
|
11387
|
+
return ke(ke({}, ce), {}, {
|
|
11376
11388
|
isFocused: j && !n,
|
|
11377
11389
|
getRootProps: S,
|
|
11378
11390
|
getInputProps: K,
|
|
11379
|
-
rootRef:
|
|
11391
|
+
rootRef: z,
|
|
11380
11392
|
inputRef: V,
|
|
11381
|
-
open: Ft(
|
|
11393
|
+
open: Ft(I)
|
|
11382
11394
|
});
|
|
11383
11395
|
}
|
|
11384
11396
|
function mm(e, t) {
|
|
@@ -11423,12 +11435,12 @@ const hm = ({
|
|
|
11423
11435
|
file: e,
|
|
11424
11436
|
onRemove: t
|
|
11425
11437
|
}) => {
|
|
11426
|
-
const r = () => e.file.type.startsWith("image/") ? /* @__PURE__ */
|
|
11438
|
+
const r = () => e.file.type.startsWith("image/") ? /* @__PURE__ */ $(dl, {}) : e.file.type.includes("pdf") ? /* @__PURE__ */ $(Zn, {}) : /* @__PURE__ */ $(Zn, {}), n = () => {
|
|
11427
11439
|
switch (e.status) {
|
|
11428
11440
|
case "success":
|
|
11429
|
-
return /* @__PURE__ */
|
|
11441
|
+
return /* @__PURE__ */ $(yf, { color: "success" });
|
|
11430
11442
|
case "uploading":
|
|
11431
|
-
return /* @__PURE__ */
|
|
11443
|
+
return /* @__PURE__ */ $(_r, { size: 16 });
|
|
11432
11444
|
default:
|
|
11433
11445
|
return null;
|
|
11434
11446
|
}
|
|
@@ -11454,20 +11466,20 @@ const hm = ({
|
|
|
11454
11466
|
n()
|
|
11455
11467
|
] }),
|
|
11456
11468
|
/* @__PURE__ */ Oe(Se, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
11457
|
-
/* @__PURE__ */
|
|
11469
|
+
/* @__PURE__ */ $(Me, { variant: "body2", noWrap: !0, children: e.file.name }),
|
|
11458
11470
|
/* @__PURE__ */ Oe(Me, { variant: "caption", color: "textSecondary", children: [
|
|
11459
11471
|
i(e.file.size),
|
|
11460
11472
|
" • ",
|
|
11461
11473
|
e.file.type
|
|
11462
11474
|
] })
|
|
11463
11475
|
] }),
|
|
11464
|
-
/* @__PURE__ */
|
|
11476
|
+
/* @__PURE__ */ $(Vl, { title: "Remove file", children: /* @__PURE__ */ $(
|
|
11465
11477
|
Nl,
|
|
11466
11478
|
{
|
|
11467
11479
|
size: "small",
|
|
11468
11480
|
onClick: () => t(e.id),
|
|
11469
11481
|
color: "error",
|
|
11470
|
-
children: /* @__PURE__ */
|
|
11482
|
+
children: /* @__PURE__ */ $(xf, {})
|
|
11471
11483
|
}
|
|
11472
11484
|
) })
|
|
11473
11485
|
]
|
|
@@ -11486,54 +11498,54 @@ const hm = ({
|
|
|
11486
11498
|
wt(() => {
|
|
11487
11499
|
l(t);
|
|
11488
11500
|
}, [t]);
|
|
11489
|
-
const O = Pe((k) => e.fileTypes.some((
|
|
11490
|
-
if (
|
|
11491
|
-
const V =
|
|
11501
|
+
const O = Pe((k) => e.fileTypes.some((z) => {
|
|
11502
|
+
if (z.includes("*")) {
|
|
11503
|
+
const V = z.split("/")[0];
|
|
11492
11504
|
return k.type.startsWith(V);
|
|
11493
11505
|
}
|
|
11494
|
-
return k.type ===
|
|
11506
|
+
return k.type === z;
|
|
11495
11507
|
}) ? e.maxSize && k.size > e.maxSize ? `File size exceeds maximum limit of ${(e.maxSize / 1048576).toFixed(1)}MB` : null : `File type ${k.type} is not allowed. Allowed types: ${e.fileTypes.join(", ")}`, [e]), F = Pe(async (k) => {
|
|
11496
11508
|
console.log("handleFiles called with:", k.length, "files"), m(!0);
|
|
11497
|
-
const P = [],
|
|
11509
|
+
const P = [], z = [];
|
|
11498
11510
|
try {
|
|
11499
|
-
for (const
|
|
11511
|
+
for (const L of k) {
|
|
11500
11512
|
let se = null;
|
|
11501
11513
|
if (e.multiple && o.some(
|
|
11502
|
-
(
|
|
11514
|
+
(ue) => ue.file.name === L.name && ue.file.size === L.size && ue.file.lastModified === L.lastModified
|
|
11503
11515
|
)) {
|
|
11504
|
-
|
|
11516
|
+
z.push(`${L.name}: File already exists`);
|
|
11505
11517
|
continue;
|
|
11506
11518
|
}
|
|
11507
|
-
if (se = O(
|
|
11519
|
+
if (se = O(L), !se && e.customValidation)
|
|
11508
11520
|
try {
|
|
11509
|
-
const
|
|
11510
|
-
|
|
11511
|
-
} catch (
|
|
11512
|
-
se = `Custom validation failed: ${
|
|
11521
|
+
const ce = e.customValidation(L);
|
|
11522
|
+
ce instanceof Promise ? se = await ce : se = ce;
|
|
11523
|
+
} catch (ce) {
|
|
11524
|
+
se = `Custom validation failed: ${ce instanceof Error ? ce.message : "Unknown error"}`;
|
|
11513
11525
|
}
|
|
11514
11526
|
if (se)
|
|
11515
|
-
|
|
11527
|
+
z.push(`${L.name}: ${se}`);
|
|
11516
11528
|
else {
|
|
11517
|
-
const
|
|
11529
|
+
const ce = {
|
|
11518
11530
|
id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
11519
|
-
file:
|
|
11520
|
-
preview:
|
|
11531
|
+
file: L,
|
|
11532
|
+
preview: L.type.startsWith("image/") ? URL.createObjectURL(L) : void 0,
|
|
11521
11533
|
progress: 0,
|
|
11522
11534
|
status: "pending",
|
|
11523
11535
|
uploadedAt: /* @__PURE__ */ new Date()
|
|
11524
11536
|
};
|
|
11525
|
-
P.push(
|
|
11537
|
+
P.push(ce);
|
|
11526
11538
|
}
|
|
11527
11539
|
}
|
|
11528
11540
|
const V = e.multiple ? [...o, ...P] : P;
|
|
11529
|
-
l(V), r == null || r(V),
|
|
11541
|
+
l(V), r == null || r(V), z.length > 0 ? (x(z), d(z)) : (x([]), d([]));
|
|
11530
11542
|
} catch (V) {
|
|
11531
|
-
const
|
|
11532
|
-
x([
|
|
11543
|
+
const L = `Unexpected error: ${V instanceof Error ? V.message : "Unknown error"}`;
|
|
11544
|
+
x([L]), d([L]);
|
|
11533
11545
|
}
|
|
11534
11546
|
}, [o, e.multiple, O, e.customValidation, r]), C = Pe((k) => {
|
|
11535
11547
|
m(!0);
|
|
11536
|
-
const P = o.filter((
|
|
11548
|
+
const P = o.filter((z) => z.id !== k);
|
|
11537
11549
|
l(P), r == null || r(P), x([]), y.current && (y.current.value = "");
|
|
11538
11550
|
}, [o, r]), w = Pe(() => {
|
|
11539
11551
|
if (e.required && o.length === 0) {
|
|
@@ -11543,19 +11555,19 @@ const hm = ({
|
|
|
11543
11555
|
x([]), h(!0);
|
|
11544
11556
|
const k = o.filter((P) => P.status !== "error");
|
|
11545
11557
|
n == null || n(k);
|
|
11546
|
-
}, [o, n, e.required, e.title]), { getRootProps: M, getInputProps: G, isDragActive:
|
|
11558
|
+
}, [o, n, e.required, e.title]), { getRootProps: M, getInputProps: G, isDragActive: J } = Sl({
|
|
11547
11559
|
onDrop: F,
|
|
11548
11560
|
multiple: e.multiple,
|
|
11549
11561
|
disabled: i,
|
|
11550
11562
|
noClick: !1,
|
|
11551
11563
|
noKeyboard: !1
|
|
11552
|
-
}), H = (k) => k.startsWith("image/") ? /* @__PURE__ */
|
|
11564
|
+
}), H = (k) => k.startsWith("image/") ? /* @__PURE__ */ $(dl, {}) : k.includes("pdf") ? /* @__PURE__ */ $(Zn, {}) : /* @__PURE__ */ $(Zn, {}), u = e.fileTypes.map((k) => k.replace("*", "all")).join(", ");
|
|
11553
11565
|
wt(() => {
|
|
11554
11566
|
if (!f) return;
|
|
11555
11567
|
const k = [], P = [...c, ...k];
|
|
11556
11568
|
P.length > 0 ? d(P) : d([]);
|
|
11557
11569
|
}, [o, e.required, e.title, f, b, c]);
|
|
11558
|
-
const
|
|
11570
|
+
const D = () => {
|
|
11559
11571
|
var k;
|
|
11560
11572
|
switch (((k = e.submitButton) == null ? void 0 : k.position) || "right") {
|
|
11561
11573
|
case "left":
|
|
@@ -11571,9 +11583,9 @@ const hm = ({
|
|
|
11571
11583
|
return /* @__PURE__ */ Oe(Se, { className: a, style: s, children: [
|
|
11572
11584
|
/* @__PURE__ */ Oe(Me, { variant: "h6", gutterBottom: !0, children: [
|
|
11573
11585
|
e.title,
|
|
11574
|
-
e.required && /* @__PURE__ */
|
|
11586
|
+
e.required && /* @__PURE__ */ $("span", { style: { color: "red" }, children: " *" })
|
|
11575
11587
|
] }),
|
|
11576
|
-
e.description && /* @__PURE__ */
|
|
11588
|
+
e.description && /* @__PURE__ */ $(Me, { variant: "body2", color: "textSecondary", gutterBottom: !0, children: e.description }),
|
|
11577
11589
|
/* @__PURE__ */ io(
|
|
11578
11590
|
ao,
|
|
11579
11591
|
{
|
|
@@ -11581,8 +11593,8 @@ const hm = ({
|
|
|
11581
11593
|
key: `dropzone-${o.length}`,
|
|
11582
11594
|
sx: {
|
|
11583
11595
|
border: "2px dashed",
|
|
11584
|
-
borderColor:
|
|
11585
|
-
backgroundColor:
|
|
11596
|
+
borderColor: J ? "primary.main" : "grey.300",
|
|
11597
|
+
backgroundColor: J ? "action.hover" : "background.paper",
|
|
11586
11598
|
p: 3,
|
|
11587
11599
|
textAlign: "center",
|
|
11588
11600
|
cursor: i ? "not-allowed" : "pointer",
|
|
@@ -11593,12 +11605,12 @@ const hm = ({
|
|
|
11593
11605
|
}
|
|
11594
11606
|
}
|
|
11595
11607
|
},
|
|
11596
|
-
/* @__PURE__ */
|
|
11597
|
-
/* @__PURE__ */
|
|
11598
|
-
/* @__PURE__ */
|
|
11608
|
+
/* @__PURE__ */ $("input", { ...G(), ref: y }),
|
|
11609
|
+
/* @__PURE__ */ $(vf, { sx: { fontSize: 48, color: "text.secondary", mb: 2 } }),
|
|
11610
|
+
/* @__PURE__ */ $(Me, { variant: "h6", gutterBottom: !0, children: J ? "Drop files here" : "Drag & drop files here" }),
|
|
11599
11611
|
/* @__PURE__ */ Oe(Me, { variant: "body2", color: "textSecondary", gutterBottom: !0, children: [
|
|
11600
11612
|
"or ",
|
|
11601
|
-
/* @__PURE__ */
|
|
11613
|
+
/* @__PURE__ */ $(
|
|
11602
11614
|
Bt,
|
|
11603
11615
|
{
|
|
11604
11616
|
variant: "text",
|
|
@@ -11612,7 +11624,7 @@ const hm = ({
|
|
|
11612
11624
|
)
|
|
11613
11625
|
] }),
|
|
11614
11626
|
/* @__PURE__ */ Oe(Se, { sx: { mt: 2 }, children: [
|
|
11615
|
-
/* @__PURE__ */
|
|
11627
|
+
/* @__PURE__ */ $(
|
|
11616
11628
|
zn,
|
|
11617
11629
|
{
|
|
11618
11630
|
icon: H(e.fileTypes[0]),
|
|
@@ -11621,7 +11633,7 @@ const hm = ({
|
|
|
11621
11633
|
size: "small"
|
|
11622
11634
|
}
|
|
11623
11635
|
),
|
|
11624
|
-
e.maxSize && /* @__PURE__ */
|
|
11636
|
+
e.maxSize && /* @__PURE__ */ $(
|
|
11625
11637
|
zn,
|
|
11626
11638
|
{
|
|
11627
11639
|
label: `Max size: ${(e.maxSize / (1024 * 1024)).toFixed(1)}MB`,
|
|
@@ -11632,14 +11644,14 @@ const hm = ({
|
|
|
11632
11644
|
)
|
|
11633
11645
|
] })
|
|
11634
11646
|
),
|
|
11635
|
-
p.length > 0 && /* @__PURE__ */
|
|
11647
|
+
p.length > 0 && /* @__PURE__ */ $(Ll, { severity: "error", sx: { mt: 2 }, children: p.map((k, P) => /* @__PURE__ */ $(Me, { variant: "body2", children: k }, P)) }),
|
|
11636
11648
|
o.length > 0 && /* @__PURE__ */ Oe(Se, { sx: { mt: 2 }, children: [
|
|
11637
11649
|
/* @__PURE__ */ Oe(Me, { variant: "subtitle1", gutterBottom: !0, children: [
|
|
11638
11650
|
"Selected Files (",
|
|
11639
11651
|
o.length,
|
|
11640
11652
|
")"
|
|
11641
11653
|
] }),
|
|
11642
|
-
o.map((k) => /* @__PURE__ */
|
|
11654
|
+
o.map((k) => /* @__PURE__ */ $(
|
|
11643
11655
|
hm,
|
|
11644
11656
|
{
|
|
11645
11657
|
file: k,
|
|
@@ -11648,18 +11660,18 @@ const hm = ({
|
|
|
11648
11660
|
k.id
|
|
11649
11661
|
))
|
|
11650
11662
|
] }),
|
|
11651
|
-
e.helperText && /* @__PURE__ */
|
|
11652
|
-
e.submitButton && /* @__PURE__ */
|
|
11663
|
+
e.helperText && /* @__PURE__ */ $(Me, { variant: "caption", color: "textSecondary", sx: { mt: 1, display: "block" }, children: e.helperText }),
|
|
11664
|
+
e.submitButton && /* @__PURE__ */ $(Se, { sx: {
|
|
11653
11665
|
mt: 3,
|
|
11654
11666
|
display: "flex",
|
|
11655
|
-
justifyContent:
|
|
11656
|
-
}, children: /* @__PURE__ */
|
|
11667
|
+
justifyContent: D()
|
|
11668
|
+
}, children: /* @__PURE__ */ $(
|
|
11657
11669
|
Bt,
|
|
11658
11670
|
{
|
|
11659
11671
|
variant: "contained",
|
|
11660
11672
|
onClick: w,
|
|
11661
11673
|
disabled: i || e.submitButton.disabled || o.length === 0,
|
|
11662
|
-
startIcon: e.submitButton.loading ? /* @__PURE__ */
|
|
11674
|
+
startIcon: e.submitButton.loading ? /* @__PURE__ */ $(_r, { size: 16, color: "inherit" }) : void 0,
|
|
11663
11675
|
children: e.submitButton.text
|
|
11664
11676
|
}
|
|
11665
11677
|
) })
|