finform-react-builder 1.8.40 → 1.8.41
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 +631 -626
- package/dist/index.js +11 -11
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -4,13 +4,13 @@ var Vo = (e) => {
|
|
|
4
4
|
};
|
|
5
5
|
var mu = (e, t, r) => t in e ? fu(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
6
6
|
var Cn = (e, t, r) => mu(e, typeof t != "symbol" ? t + "" : t, r), Zi = (e, t, r) => t.has(e) || Vo("Cannot " + r);
|
|
7
|
-
var
|
|
7
|
+
var O = (e, t, r) => (Zi(e, t, "read from private field"), r ? r.call(e) : t.get(e)), he = (e, t, r) => t.has(e) ? Vo("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), ie = (e, t, r, n) => (Zi(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r), ve = (e, t, r) => (Zi(e, t, "access private method"), r);
|
|
8
8
|
var Qn = (e, t, r, n) => ({
|
|
9
9
|
set _(i) {
|
|
10
10
|
ie(e, t, i, r);
|
|
11
11
|
},
|
|
12
12
|
get _() {
|
|
13
|
-
return
|
|
13
|
+
return O(e, t, n);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
import { jsx as d, jsxs as ee, Fragment as Di } from "react/jsx-runtime";
|
|
@@ -436,16 +436,16 @@ var Hr = (e) => Ue(e) && !vi(e) ? e : {
|
|
|
436
436
|
return {};
|
|
437
437
|
const P = s ? s[0] : o, T = (z) => {
|
|
438
438
|
i && P.reportValidity && (P.setCustomValidity(vt(z) ? "" : z || ""), P.reportValidity());
|
|
439
|
-
}, C = {}, R = fo(o),
|
|
440
|
-
const
|
|
439
|
+
}, C = {}, R = fo(o), M = qn(o), _ = R || M, D = (w || po(o)) && $e(o.value) && $e(S) || gi(o) && o.value === "" || S === "" || Array.isArray(S) && !S.length, c = Ul.bind(null, h, n, C), $ = (z, F, V, te = Yt.maxLength, se = Yt.minLength) => {
|
|
440
|
+
const re = z ? F : V;
|
|
441
441
|
C[h] = {
|
|
442
442
|
type: z ? te : se,
|
|
443
|
-
message:
|
|
443
|
+
message: re,
|
|
444
444
|
ref: o,
|
|
445
|
-
...c(z ? te : se,
|
|
445
|
+
...c(z ? te : se, re)
|
|
446
446
|
};
|
|
447
447
|
};
|
|
448
|
-
if (a ? !Array.isArray(S) || !S.length : l && (!_ && (D || lt(S)) || vt(S) && !S ||
|
|
448
|
+
if (a ? !Array.isArray(S) || !S.length : l && (!_ && (D || lt(S)) || vt(S) && !S || M && !Ql(s).isValid || R && !Zl(s).isValid)) {
|
|
449
449
|
const { value: z, message: F } = ci(l) ? { value: !!l, message: l } : Hr(l);
|
|
450
450
|
if (z && (C[h] = {
|
|
451
451
|
type: Yt.required,
|
|
@@ -462,8 +462,8 @@ var Hr = (e) => Ue(e) && !vi(e) ? e : {
|
|
|
462
462
|
const se = o.valueAsNumber || S && +S;
|
|
463
463
|
lt(V.value) || (z = se > V.value), lt(te.value) || (F = se < te.value);
|
|
464
464
|
} else {
|
|
465
|
-
const se = o.valueAsDate || new Date(S),
|
|
466
|
-
Kt(V.value) && S && (z = pe ?
|
|
465
|
+
const se = o.valueAsDate || new Date(S), re = (L) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + L), pe = o.type == "time", Y = o.type == "week";
|
|
466
|
+
Kt(V.value) && S && (z = pe ? re(S) > re(V.value) : Y ? S > V.value : se > new Date(V.value)), Kt(te.value) && S && (F = pe ? re(S) < re(te.value) : Y ? S < te.value : se < new Date(te.value));
|
|
467
467
|
}
|
|
468
468
|
if ((z || F) && ($(!!z, V.message, te.message, Yt.max, Yt.min), !n))
|
|
469
469
|
return T(C[h].message), C;
|
|
@@ -567,7 +567,7 @@ function sp(e = {}) {
|
|
|
567
567
|
clearTimeout(p), p = setTimeout(y, g);
|
|
568
568
|
}, h = async (y) => {
|
|
569
569
|
if (!t.disabled && (m.isValid || f.isValid || y)) {
|
|
570
|
-
const g = t.resolver ? st((await
|
|
570
|
+
const g = t.resolver ? st((await M()).errors) : await D(n, !0);
|
|
571
571
|
g !== r.isValid && u.state.next({
|
|
572
572
|
isValid: g
|
|
573
573
|
});
|
|
@@ -579,19 +579,19 @@ function sp(e = {}) {
|
|
|
579
579
|
validatingFields: r.validatingFields,
|
|
580
580
|
isValidating: !st(r.validatingFields)
|
|
581
581
|
}));
|
|
582
|
-
}, b = (y, g = [], x,
|
|
583
|
-
if (
|
|
582
|
+
}, b = (y, g = [], x, j, A = !0, I = !0) => {
|
|
583
|
+
if (j && x && !t.disabled) {
|
|
584
584
|
if (o.action = !0, I && Array.isArray(J(n, y))) {
|
|
585
|
-
const H = x(J(n, y),
|
|
586
|
-
|
|
585
|
+
const H = x(J(n, y), j.argA, j.argB);
|
|
586
|
+
A && be(n, y, H);
|
|
587
587
|
}
|
|
588
588
|
if (I && Array.isArray(J(r.errors, y))) {
|
|
589
|
-
const H = x(J(r.errors, y),
|
|
590
|
-
|
|
589
|
+
const H = x(J(r.errors, y), j.argA, j.argB);
|
|
590
|
+
A && be(r.errors, y, H), ap(r.errors, y);
|
|
591
591
|
}
|
|
592
592
|
if ((m.touchedFields || f.touchedFields) && I && Array.isArray(J(r.touchedFields, y))) {
|
|
593
|
-
const H = x(J(r.touchedFields, y),
|
|
594
|
-
|
|
593
|
+
const H = x(J(r.touchedFields, y), j.argA, j.argB);
|
|
594
|
+
A && be(r.touchedFields, y, H);
|
|
595
595
|
}
|
|
596
596
|
(m.dirtyFields || f.dirtyFields) && (r.dirtyFields = En(i, a)), u.state.next({
|
|
597
597
|
name: y,
|
|
@@ -611,19 +611,19 @@ function sp(e = {}) {
|
|
|
611
611
|
errors: r.errors,
|
|
612
612
|
isValid: !1
|
|
613
613
|
});
|
|
614
|
-
}, T = (y, g, x,
|
|
615
|
-
const
|
|
616
|
-
if (
|
|
614
|
+
}, T = (y, g, x, j) => {
|
|
615
|
+
const A = J(n, y);
|
|
616
|
+
if (A) {
|
|
617
617
|
const I = J(a, y, $e(x) ? J(i, y) : x);
|
|
618
|
-
$e(I) ||
|
|
618
|
+
$e(I) || j && j.defaultChecked || g ? be(a, y, g ? I : Qo(A._f)) : V(y, I), o.mount && h();
|
|
619
619
|
}
|
|
620
|
-
}, C = (y, g, x,
|
|
620
|
+
}, C = (y, g, x, j, A) => {
|
|
621
621
|
let I = !1, H = !1;
|
|
622
622
|
const Z = {
|
|
623
623
|
name: y
|
|
624
624
|
};
|
|
625
625
|
if (!t.disabled) {
|
|
626
|
-
if (!x ||
|
|
626
|
+
if (!x || j) {
|
|
627
627
|
(m.isDirty || f.isDirty) && (H = r.isDirty, r.isDirty = Z.isDirty = $(), I = H !== Z.isDirty);
|
|
628
628
|
const q = sr(J(i, y), g);
|
|
629
629
|
H = !!J(r.dirtyFields, y), q ? Ke(r.dirtyFields, y) : be(r.dirtyFields, y, !0), Z.dirtyFields = r.dirtyFields, I = I || (m.dirtyFields || f.dirtyFields) && H !== !q;
|
|
@@ -632,14 +632,14 @@ function sp(e = {}) {
|
|
|
632
632
|
const q = J(r.touchedFields, y);
|
|
633
633
|
q || (be(r.touchedFields, y, x), Z.touchedFields = r.touchedFields, I = I || (m.touchedFields || f.touchedFields) && q !== x);
|
|
634
634
|
}
|
|
635
|
-
I &&
|
|
635
|
+
I && A && u.state.next(Z);
|
|
636
636
|
}
|
|
637
637
|
return I ? Z : {};
|
|
638
|
-
}, R = (y, g, x,
|
|
639
|
-
const
|
|
640
|
-
if (t.delayError && x ? (l = E(() => S(y, x)), l(t.delayError)) : (clearTimeout(p), l = null, x ? be(r.errors, y, x) : Ke(r.errors, y)), (x ? !sr(
|
|
638
|
+
}, R = (y, g, x, j) => {
|
|
639
|
+
const A = J(r.errors, y), I = (m.isValid || f.isValid) && vt(g) && r.isValid !== g;
|
|
640
|
+
if (t.delayError && x ? (l = E(() => S(y, x)), l(t.delayError)) : (clearTimeout(p), l = null, x ? be(r.errors, y, x) : Ke(r.errors, y)), (x ? !sr(A, x) : A) || !st(j) || I) {
|
|
641
641
|
const H = {
|
|
642
|
-
...
|
|
642
|
+
...j,
|
|
643
643
|
...I && vt(g) ? { isValid: g } : {},
|
|
644
644
|
errors: r.errors,
|
|
645
645
|
name: y
|
|
@@ -649,16 +649,16 @@ function sp(e = {}) {
|
|
|
649
649
|
...H
|
|
650
650
|
}, u.state.next(H);
|
|
651
651
|
}
|
|
652
|
-
},
|
|
652
|
+
}, M = async (y) => {
|
|
653
653
|
w(y, !0);
|
|
654
654
|
const g = await t.resolver(a, t.context, Ju(y || s.mount, n, t.criteriaMode, t.shouldUseNativeValidation));
|
|
655
655
|
return w(y), g;
|
|
656
656
|
}, _ = async (y) => {
|
|
657
|
-
const { errors: g } = await
|
|
657
|
+
const { errors: g } = await M(y);
|
|
658
658
|
if (y)
|
|
659
659
|
for (const x of y) {
|
|
660
|
-
const
|
|
661
|
-
|
|
660
|
+
const j = J(g, x);
|
|
661
|
+
j ? be(r.errors, x, j) : Ke(r.errors, x);
|
|
662
662
|
}
|
|
663
663
|
else
|
|
664
664
|
r.errors = g;
|
|
@@ -666,15 +666,15 @@ function sp(e = {}) {
|
|
|
666
666
|
}, D = async (y, g, x = {
|
|
667
667
|
valid: !0
|
|
668
668
|
}) => {
|
|
669
|
-
for (const
|
|
670
|
-
const
|
|
671
|
-
if (
|
|
672
|
-
const { _f: I, ...H } =
|
|
669
|
+
for (const j in y) {
|
|
670
|
+
const A = y[j];
|
|
671
|
+
if (A) {
|
|
672
|
+
const { _f: I, ...H } = A;
|
|
673
673
|
if (I) {
|
|
674
|
-
const Z = s.array.has(I.name), q =
|
|
675
|
-
q && m.validatingFields && w([
|
|
676
|
-
const ye = await Aa(
|
|
677
|
-
if (q && m.validatingFields && w([
|
|
674
|
+
const Z = s.array.has(I.name), q = A._f && ep(A._f);
|
|
675
|
+
q && m.validatingFields && w([j], !0);
|
|
676
|
+
const ye = await Aa(A, s.disabled, a, v, t.shouldUseNativeValidation && !g, Z);
|
|
677
|
+
if (q && m.validatingFields && w([j]), ye[I.name] && (x.valid = !1, g))
|
|
678
678
|
break;
|
|
679
679
|
!g && (J(ye, I.name) ? Z ? Xl(r.errors, ye, I.name) : be(r.errors, I.name, ye[I.name]) : Ke(r.errors, I.name));
|
|
680
680
|
}
|
|
@@ -691,49 +691,49 @@ function sp(e = {}) {
|
|
|
691
691
|
}, $ = (y, g) => !t.disabled && (y && g && be(a, y, g), !sr(L(), i)), z = (y, g, x) => ql(y, s, {
|
|
692
692
|
...o.mount ? a : $e(g) ? i : Kt(y) ? { [y]: g } : g
|
|
693
693
|
}, x, g), F = (y) => zi(J(o.mount ? a : i, y, t.shouldUnregister ? J(i, y, []) : [])), V = (y, g, x = {}) => {
|
|
694
|
-
const
|
|
695
|
-
let
|
|
696
|
-
if (
|
|
697
|
-
const I =
|
|
698
|
-
I && (!I.disabled && be(a, y, Gl(g, I)),
|
|
699
|
-
(!H.defaultChecked || !H.disabled) && (Array.isArray(
|
|
700
|
-
}) : I.refs.forEach((H) => H.checked = H.value ===
|
|
694
|
+
const j = J(n, y);
|
|
695
|
+
let A = g;
|
|
696
|
+
if (j) {
|
|
697
|
+
const I = j._f;
|
|
698
|
+
I && (!I.disabled && be(a, y, Gl(g, I)), A = gi(I.ref) && lt(g) ? "" : g, Hl(I.ref) ? [...I.ref.options].forEach((H) => H.selected = A.includes(H.value)) : I.refs ? qn(I.ref) ? I.refs.forEach((H) => {
|
|
699
|
+
(!H.defaultChecked || !H.disabled) && (Array.isArray(A) ? H.checked = !!A.find((Z) => Z === H.value) : H.checked = A === H.value || !!A);
|
|
700
|
+
}) : I.refs.forEach((H) => H.checked = H.value === A) : po(I.ref) ? I.ref.value = "" : (I.ref.value = A, I.ref.type || u.state.next({
|
|
701
701
|
name: y,
|
|
702
702
|
values: Ie(a)
|
|
703
703
|
})));
|
|
704
704
|
}
|
|
705
|
-
(x.shouldDirty || x.shouldTouch) && C(y,
|
|
705
|
+
(x.shouldDirty || x.shouldTouch) && C(y, A, x.shouldTouch, x.shouldDirty, !0), x.shouldValidate && Y(y);
|
|
706
706
|
}, te = (y, g, x) => {
|
|
707
|
-
for (const
|
|
708
|
-
if (!g.hasOwnProperty(
|
|
707
|
+
for (const j in g) {
|
|
708
|
+
if (!g.hasOwnProperty(j))
|
|
709
709
|
return;
|
|
710
|
-
const
|
|
711
|
-
(s.array.has(y) || Ue(
|
|
710
|
+
const A = g[j], I = y + "." + j, H = J(n, I);
|
|
711
|
+
(s.array.has(y) || Ue(A) || H && !H._f) && !Or(A) ? te(I, A, x) : V(I, A, x);
|
|
712
712
|
}
|
|
713
713
|
}, se = (y, g, x = {}) => {
|
|
714
|
-
const
|
|
715
|
-
be(a, y, I),
|
|
714
|
+
const j = J(n, y), A = s.array.has(y), I = Ie(g);
|
|
715
|
+
be(a, y, I), A ? (u.array.next({
|
|
716
716
|
name: y,
|
|
717
717
|
values: Ie(a)
|
|
718
718
|
}), (m.isDirty || m.dirtyFields || f.isDirty || f.dirtyFields) && x.shouldDirty && u.state.next({
|
|
719
719
|
name: y,
|
|
720
720
|
dirtyFields: En(i, a),
|
|
721
721
|
isDirty: $(y, I)
|
|
722
|
-
})) :
|
|
722
|
+
})) : j && !j._f && !lt(I) ? te(y, I, x) : V(y, I, x), Ta(y, s) && u.state.next({ ...r }), u.state.next({
|
|
723
723
|
name: o.mount ? y : void 0,
|
|
724
724
|
values: Ie(a)
|
|
725
725
|
});
|
|
726
|
-
},
|
|
726
|
+
}, re = async (y) => {
|
|
727
727
|
o.mount = !0;
|
|
728
728
|
const g = y.target;
|
|
729
|
-
let x = g.name,
|
|
730
|
-
const
|
|
731
|
-
|
|
729
|
+
let x = g.name, j = !0;
|
|
730
|
+
const A = J(n, x), I = (q) => {
|
|
731
|
+
j = Number.isNaN(q) || Or(q) && isNaN(q.getTime()) || sr(q, J(a, x, q));
|
|
732
732
|
}, H = en(t.mode), Z = en(t.reValidateMode);
|
|
733
|
-
if (
|
|
733
|
+
if (A) {
|
|
734
734
|
let q, ye;
|
|
735
|
-
const ke = g.type ? Qo(
|
|
736
|
-
be(a, x, ke), Te ? (
|
|
735
|
+
const ke = g.type ? Qo(A._f) : Vl(y), Te = y.type === hi.BLUR || y.type === hi.FOCUS_OUT, Ve = !tp(A._f) && !t.resolver && !J(r.errors, x) && !A._f.deps || ip(Te, J(r.touchedFields, x), r.isSubmitted, Z, H), We = Ta(x, s, Te);
|
|
736
|
+
be(a, x, ke), Te ? (A._f.onBlur && A._f.onBlur(y), l && l(0)) : A._f.onChange && A._f.onChange(y);
|
|
737
737
|
const nt = C(x, ke, Te), Vt = !st(nt) || We;
|
|
738
738
|
if (!Te && u.state.next({
|
|
739
739
|
name: x,
|
|
@@ -742,33 +742,33 @@ function sp(e = {}) {
|
|
|
742
742
|
}), Ve)
|
|
743
743
|
return (m.isValid || f.isValid) && (t.mode === "onBlur" ? Te && h() : Te || h()), Vt && u.state.next({ name: x, ...We ? {} : nt });
|
|
744
744
|
if (!Te && We && u.state.next({ ...r }), t.resolver) {
|
|
745
|
-
const { errors: it } = await
|
|
746
|
-
if (I(ke),
|
|
745
|
+
const { errors: it } = await M([x]);
|
|
746
|
+
if (I(ke), j) {
|
|
747
747
|
const Ze = Zo(r.errors, n, x), yt = Zo(it, n, Ze.name || x);
|
|
748
748
|
q = yt.error, x = yt.name, ye = st(it);
|
|
749
749
|
}
|
|
750
750
|
} else
|
|
751
|
-
w([x], !0), q = (await Aa(
|
|
752
|
-
|
|
751
|
+
w([x], !0), q = (await Aa(A, s.disabled, a, v, t.shouldUseNativeValidation))[x], w([x]), I(ke), j && (q ? ye = !1 : (m.isValid || f.isValid) && (ye = await D(n, !0)));
|
|
752
|
+
j && (A._f.deps && Y(A._f.deps), R(x, ye, q, nt));
|
|
753
753
|
}
|
|
754
754
|
}, pe = (y, g) => {
|
|
755
755
|
if (J(r.errors, g) && y.focus)
|
|
756
756
|
return y.focus(), 1;
|
|
757
|
-
},
|
|
758
|
-
let x,
|
|
759
|
-
const
|
|
757
|
+
}, Y = async (y, g = {}) => {
|
|
758
|
+
let x, j;
|
|
759
|
+
const A = ht(y);
|
|
760
760
|
if (t.resolver) {
|
|
761
|
-
const I = await _($e(y) ? y :
|
|
762
|
-
x = st(I),
|
|
763
|
-
} else y ? (
|
|
761
|
+
const I = await _($e(y) ? y : A);
|
|
762
|
+
x = st(I), j = y ? !A.some((H) => J(I, H)) : x;
|
|
763
|
+
} else y ? (j = (await Promise.all(A.map(async (I) => {
|
|
764
764
|
const H = J(n, I);
|
|
765
765
|
return await D(H && H._f ? { [I]: H } : H);
|
|
766
|
-
}))).every(Boolean), !(!
|
|
766
|
+
}))).every(Boolean), !(!j && !r.isValid) && h()) : j = x = await D(n);
|
|
767
767
|
return u.state.next({
|
|
768
768
|
...!Kt(y) || (m.isValid || f.isValid) && x !== r.isValid ? {} : { name: y },
|
|
769
769
|
...t.resolver || !y ? { isValid: x } : {},
|
|
770
770
|
errors: r.errors
|
|
771
|
-
}), g.shouldFocus && !
|
|
771
|
+
}), g.shouldFocus && !j && an(n, pe, y ? A : s.mount), j;
|
|
772
772
|
}, L = (y) => {
|
|
773
773
|
const g = {
|
|
774
774
|
...o.mount ? a : i
|
|
@@ -785,16 +785,16 @@ function sp(e = {}) {
|
|
|
785
785
|
errors: y ? r.errors : {}
|
|
786
786
|
});
|
|
787
787
|
}, de = (y, g, x) => {
|
|
788
|
-
const
|
|
788
|
+
const j = (J(n, y, { _f: {} })._f || {}).ref, A = J(r.errors, y) || {}, { ref: I, message: H, type: Z, ...q } = A;
|
|
789
789
|
be(r.errors, y, {
|
|
790
790
|
...q,
|
|
791
791
|
...g,
|
|
792
|
-
ref:
|
|
792
|
+
ref: j
|
|
793
793
|
}), u.state.next({
|
|
794
794
|
name: y,
|
|
795
795
|
errors: r.errors,
|
|
796
796
|
isValid: !1
|
|
797
|
-
}), x && x.shouldFocus &&
|
|
797
|
+
}), x && x.shouldFocus && j && j.focus && j.focus();
|
|
798
798
|
}, ce = (y, g) => Mt(y) ? u.state.subscribe({
|
|
799
799
|
next: (x) => y(z(void 0, g), x)
|
|
800
800
|
}) : z(y, g, !0), ge = (y) => u.state.subscribe({
|
|
@@ -820,11 +820,11 @@ function sp(e = {}) {
|
|
|
820
820
|
...r,
|
|
821
821
|
...g.keepDirty ? { isDirty: $() } : {}
|
|
822
822
|
}), !g.keepIsValid && h();
|
|
823
|
-
},
|
|
823
|
+
}, ne = ({ disabled: y, name: g }) => {
|
|
824
824
|
(vt(y) && o.mount || y || s.disabled.has(g)) && (y ? s.disabled.add(g) : s.disabled.delete(g));
|
|
825
825
|
}, le = (y, g = {}) => {
|
|
826
826
|
let x = J(n, y);
|
|
827
|
-
const
|
|
827
|
+
const j = vt(g.disabled) || vt(t.disabled);
|
|
828
828
|
return be(n, y, {
|
|
829
829
|
...x || {},
|
|
830
830
|
_f: {
|
|
@@ -833,11 +833,11 @@ function sp(e = {}) {
|
|
|
833
833
|
mount: !0,
|
|
834
834
|
...g
|
|
835
835
|
}
|
|
836
|
-
}), s.mount.add(y), x ?
|
|
836
|
+
}), s.mount.add(y), x ? ne({
|
|
837
837
|
disabled: vt(g.disabled) ? g.disabled : t.disabled,
|
|
838
838
|
name: y
|
|
839
839
|
}) : T(y, !0, g.value), {
|
|
840
|
-
...
|
|
840
|
+
...j ? { disabled: g.disabled || t.disabled } : {},
|
|
841
841
|
...t.progressive ? {
|
|
842
842
|
required: !!g.required,
|
|
843
843
|
min: kn(g.min),
|
|
@@ -847,12 +847,12 @@ function sp(e = {}) {
|
|
|
847
847
|
pattern: kn(g.pattern)
|
|
848
848
|
} : {},
|
|
849
849
|
name: y,
|
|
850
|
-
onChange:
|
|
851
|
-
onBlur:
|
|
852
|
-
ref: (
|
|
853
|
-
if (
|
|
850
|
+
onChange: re,
|
|
851
|
+
onBlur: re,
|
|
852
|
+
ref: (A) => {
|
|
853
|
+
if (A) {
|
|
854
854
|
le(y, g), x = J(n, y);
|
|
855
|
-
const I = $e(
|
|
855
|
+
const I = $e(A.value) && A.querySelectorAll && A.querySelectorAll("input,select,textarea")[0] || A, H = Gu(I), Z = x._f.refs || [];
|
|
856
856
|
if (H ? Z.find((q) => q === I) : I === x._f.ref)
|
|
857
857
|
return;
|
|
858
858
|
be(n, y, {
|
|
@@ -874,48 +874,48 @@ function sp(e = {}) {
|
|
|
874
874
|
};
|
|
875
875
|
}, ue = () => t.shouldFocusError && an(n, pe, s.mount), we = (y) => {
|
|
876
876
|
vt(y) && (u.state.next({ disabled: y }), an(n, (g, x) => {
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
|
|
877
|
+
const j = J(n, x);
|
|
878
|
+
j && (g.disabled = j._f.disabled || y, Array.isArray(j._f.refs) && j._f.refs.forEach((A) => {
|
|
879
|
+
A.disabled = j._f.disabled || y;
|
|
880
880
|
}));
|
|
881
881
|
}, 0, !1));
|
|
882
882
|
}, G = (y, g) => async (x) => {
|
|
883
|
-
let
|
|
883
|
+
let j;
|
|
884
884
|
x && (x.preventDefault && x.preventDefault(), x.persist && x.persist());
|
|
885
|
-
let
|
|
885
|
+
let A = Ie(a);
|
|
886
886
|
if (u.state.next({
|
|
887
887
|
isSubmitting: !0
|
|
888
888
|
}), t.resolver) {
|
|
889
|
-
const { errors: I, values: H } = await
|
|
890
|
-
r.errors = I,
|
|
889
|
+
const { errors: I, values: H } = await M();
|
|
890
|
+
r.errors = I, A = H;
|
|
891
891
|
} else
|
|
892
892
|
await D(n);
|
|
893
893
|
if (s.disabled.size)
|
|
894
894
|
for (const I of s.disabled)
|
|
895
|
-
be(
|
|
895
|
+
be(A, I, void 0);
|
|
896
896
|
if (Ke(r.errors, "root"), st(r.errors)) {
|
|
897
897
|
u.state.next({
|
|
898
898
|
errors: {}
|
|
899
899
|
});
|
|
900
900
|
try {
|
|
901
|
-
await y(
|
|
901
|
+
await y(A, x);
|
|
902
902
|
} catch (I) {
|
|
903
|
-
|
|
903
|
+
j = I;
|
|
904
904
|
}
|
|
905
905
|
} else
|
|
906
906
|
g && await g({ ...r.errors }, x), ue(), setTimeout(ue);
|
|
907
907
|
if (u.state.next({
|
|
908
908
|
isSubmitted: !0,
|
|
909
909
|
isSubmitting: !1,
|
|
910
|
-
isSubmitSuccessful: st(r.errors) && !
|
|
910
|
+
isSubmitSuccessful: st(r.errors) && !j,
|
|
911
911
|
submitCount: r.submitCount + 1,
|
|
912
912
|
errors: r.errors
|
|
913
|
-
}),
|
|
914
|
-
throw
|
|
913
|
+
}), j)
|
|
914
|
+
throw j;
|
|
915
915
|
}, ze = (y, g = {}) => {
|
|
916
916
|
J(n, y) && ($e(g.defaultValue) ? se(y, Ie(J(i, y))) : (se(y, g.defaultValue), be(i, y, Ie(g.defaultValue))), g.keepTouched || Ke(r.touchedFields, y), g.keepDirty || (Ke(r.dirtyFields, y), r.isDirty = g.defaultValue ? $(y, Ie(J(i, y))) : $()), g.keepError || (Ke(r.errors, y), m.isValid && h()), u.state.next({ ...r }));
|
|
917
917
|
}, Qe = (y, g = {}) => {
|
|
918
|
-
const x = y ? Ie(y) : i,
|
|
918
|
+
const x = y ? Ie(y) : i, j = Ie(x), A = st(y), I = A ? i : j;
|
|
919
919
|
if (g.keepDefaultValues || (i = x), !g.keepValues) {
|
|
920
920
|
if (g.keepDirtyValues) {
|
|
921
921
|
const H = /* @__PURE__ */ new Set([
|
|
@@ -958,26 +958,26 @@ function sp(e = {}) {
|
|
|
958
958
|
focus: ""
|
|
959
959
|
}, o.mount = !m.isValid || !!g.keepIsValid || !!g.keepDirtyValues, o.watch = !!t.shouldUnregister, u.state.next({
|
|
960
960
|
submitCount: g.keepSubmitCount ? r.submitCount : 0,
|
|
961
|
-
isDirty:
|
|
961
|
+
isDirty: A ? !1 : g.keepDirty ? r.isDirty : !!(g.keepDefaultValues && !sr(y, i)),
|
|
962
962
|
isSubmitted: g.keepIsSubmitted ? r.isSubmitted : !1,
|
|
963
|
-
dirtyFields:
|
|
963
|
+
dirtyFields: A ? {} : g.keepDirtyValues ? g.keepDefaultValues && a ? En(i, a) : r.dirtyFields : g.keepDefaultValues && y ? En(i, y) : g.keepDirty ? r.dirtyFields : {},
|
|
964
964
|
touchedFields: g.keepTouched ? r.touchedFields : {},
|
|
965
965
|
errors: g.keepErrors ? r.errors : {},
|
|
966
966
|
isSubmitSuccessful: g.keepIsSubmitSuccessful ? r.isSubmitSuccessful : !1,
|
|
967
967
|
isSubmitting: !1
|
|
968
968
|
});
|
|
969
969
|
}, Je = (y, g) => Qe(Mt(y) ? y(a) : y, g), Et = (y, g = {}) => {
|
|
970
|
-
const x = J(n, y),
|
|
971
|
-
if (
|
|
972
|
-
const
|
|
973
|
-
|
|
970
|
+
const x = J(n, y), j = x && x._f;
|
|
971
|
+
if (j) {
|
|
972
|
+
const A = j.refs ? j.refs[0] : j.ref;
|
|
973
|
+
A.focus && (A.focus(), g.shouldSelect && Mt(A.select) && A.select());
|
|
974
974
|
}
|
|
975
975
|
}, Ge = (y) => {
|
|
976
976
|
r = {
|
|
977
977
|
...r,
|
|
978
978
|
...y
|
|
979
979
|
};
|
|
980
|
-
},
|
|
980
|
+
}, K = {
|
|
981
981
|
control: {
|
|
982
982
|
register: le,
|
|
983
983
|
unregister: Q,
|
|
@@ -985,13 +985,13 @@ function sp(e = {}) {
|
|
|
985
985
|
handleSubmit: G,
|
|
986
986
|
setError: de,
|
|
987
987
|
_subscribe: ge,
|
|
988
|
-
_runSchema:
|
|
988
|
+
_runSchema: M,
|
|
989
989
|
_focusError: ue,
|
|
990
990
|
_getWatch: z,
|
|
991
991
|
_getDirty: $,
|
|
992
992
|
_setValid: h,
|
|
993
993
|
_setFieldArray: b,
|
|
994
|
-
_setDisabledField:
|
|
994
|
+
_setDisabledField: ne,
|
|
995
995
|
_setErrors: P,
|
|
996
996
|
_getFieldArray: F,
|
|
997
997
|
_reset: Qe,
|
|
@@ -1039,7 +1039,7 @@ function sp(e = {}) {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
},
|
|
1041
1041
|
subscribe: B,
|
|
1042
|
-
trigger:
|
|
1042
|
+
trigger: Y,
|
|
1043
1043
|
register: le,
|
|
1044
1044
|
handleSubmit: G,
|
|
1045
1045
|
watch: ce,
|
|
@@ -1054,8 +1054,8 @@ function sp(e = {}) {
|
|
|
1054
1054
|
getFieldState: X
|
|
1055
1055
|
};
|
|
1056
1056
|
return {
|
|
1057
|
-
...
|
|
1058
|
-
formControl:
|
|
1057
|
+
...K,
|
|
1058
|
+
formControl: K
|
|
1059
1059
|
};
|
|
1060
1060
|
}
|
|
1061
1061
|
var nr = () => {
|
|
@@ -1095,8 +1095,8 @@ var aa = (e, t) => $e(t) ? [] : lp(e, ht(t).sort((r, n) => r - n)), oa = (e, t,
|
|
|
1095
1095
|
function cp(e) {
|
|
1096
1096
|
const t = Vi(), { control: r = t.control, name: n, keyName: i = "id", shouldUnregister: a, rules: o } = e, [s, l] = oe.useState(r._getFieldArray(n)), p = oe.useRef(r._getFieldArray(n).map(nr)), m = oe.useRef(s), f = oe.useRef(n), u = oe.useRef(!1);
|
|
1097
1097
|
f.current = n, m.current = s, r._names.array.add(n), o && r.register(n, o), Ni(() => r._subjects.array.subscribe({
|
|
1098
|
-
next: ({ values: R, name:
|
|
1099
|
-
if (
|
|
1098
|
+
next: ({ values: R, name: M }) => {
|
|
1099
|
+
if (M === f.current || !M) {
|
|
1100
1100
|
const _ = J(R, f.current);
|
|
1101
1101
|
Array.isArray(_) && (l(_), p.current = _.map(nr));
|
|
1102
1102
|
}
|
|
@@ -1104,48 +1104,48 @@ function cp(e) {
|
|
|
1104
1104
|
}).unsubscribe, [r]);
|
|
1105
1105
|
const v = oe.useCallback((R) => {
|
|
1106
1106
|
u.current = !0, r._setFieldArray(n, R);
|
|
1107
|
-
}, [r, n]), E = (R,
|
|
1107
|
+
}, [r, n]), E = (R, M) => {
|
|
1108
1108
|
const _ = ht(Ie(R)), D = ea(r._getFieldArray(n), _);
|
|
1109
|
-
r._names.focus = Ji(n, D.length - 1,
|
|
1109
|
+
r._names.focus = Ji(n, D.length - 1, M), p.current = ea(p.current, _.map(nr)), v(D), l(D), r._setFieldArray(n, D, ea, {
|
|
1110
1110
|
argA: ta(R)
|
|
1111
1111
|
});
|
|
1112
|
-
}, h = (R,
|
|
1112
|
+
}, h = (R, M) => {
|
|
1113
1113
|
const _ = ht(Ie(R)), D = ia(r._getFieldArray(n), _);
|
|
1114
|
-
r._names.focus = Ji(n, 0,
|
|
1114
|
+
r._names.focus = Ji(n, 0, M), p.current = ia(p.current, _.map(nr)), v(D), l(D), r._setFieldArray(n, D, ia, {
|
|
1115
1115
|
argA: ta(R)
|
|
1116
1116
|
});
|
|
1117
1117
|
}, w = (R) => {
|
|
1118
|
-
const
|
|
1119
|
-
p.current = aa(p.current, R), v(
|
|
1118
|
+
const M = aa(r._getFieldArray(n), R);
|
|
1119
|
+
p.current = aa(p.current, R), v(M), l(M), !Array.isArray(J(r._fields, n)) && be(r._fields, n, void 0), r._setFieldArray(n, M, aa, {
|
|
1120
1120
|
argA: R
|
|
1121
1121
|
});
|
|
1122
|
-
}, b = (R,
|
|
1123
|
-
const D = ht(Ie(
|
|
1122
|
+
}, b = (R, M, _) => {
|
|
1123
|
+
const D = ht(Ie(M)), c = ra(r._getFieldArray(n), R, D);
|
|
1124
1124
|
r._names.focus = Ji(n, R, _), p.current = ra(p.current, R, D.map(nr)), v(c), l(c), r._setFieldArray(n, c, ra, {
|
|
1125
1125
|
argA: R,
|
|
1126
|
-
argB: ta(
|
|
1126
|
+
argB: ta(M)
|
|
1127
1127
|
});
|
|
1128
|
-
}, S = (R,
|
|
1128
|
+
}, S = (R, M) => {
|
|
1129
1129
|
const _ = r._getFieldArray(n);
|
|
1130
|
-
oa(_, R,
|
|
1130
|
+
oa(_, R, M), oa(p.current, R, M), v(_), l(_), r._setFieldArray(n, _, oa, {
|
|
1131
1131
|
argA: R,
|
|
1132
|
-
argB:
|
|
1132
|
+
argB: M
|
|
1133
1133
|
}, !1);
|
|
1134
|
-
}, P = (R,
|
|
1134
|
+
}, P = (R, M) => {
|
|
1135
1135
|
const _ = r._getFieldArray(n);
|
|
1136
|
-
na(_, R,
|
|
1136
|
+
na(_, R, M), na(p.current, R, M), v(_), l(_), r._setFieldArray(n, _, na, {
|
|
1137
1137
|
argA: R,
|
|
1138
|
-
argB:
|
|
1138
|
+
argB: M
|
|
1139
1139
|
}, !1);
|
|
1140
|
-
}, T = (R,
|
|
1141
|
-
const _ = Ie(
|
|
1140
|
+
}, T = (R, M) => {
|
|
1141
|
+
const _ = Ie(M), D = Jo(r._getFieldArray(n), R, _);
|
|
1142
1142
|
p.current = [...D].map((c, $) => !c || $ === R ? nr() : p.current[$]), v(D), l([...D]), r._setFieldArray(n, D, Jo, {
|
|
1143
1143
|
argA: R,
|
|
1144
1144
|
argB: _
|
|
1145
1145
|
}, !0, !1);
|
|
1146
1146
|
}, C = (R) => {
|
|
1147
|
-
const
|
|
1148
|
-
p.current =
|
|
1147
|
+
const M = ht(Ie(R));
|
|
1148
|
+
p.current = M.map(nr), v([...M]), l([...M]), r._setFieldArray(n, [...M], (_) => _, {}, !0, !1);
|
|
1149
1149
|
};
|
|
1150
1150
|
return oe.useEffect(() => {
|
|
1151
1151
|
if (r._state.action = !1, Ta(n, r._names) && r._subjects.state.next({
|
|
@@ -1153,27 +1153,27 @@ function cp(e) {
|
|
|
1153
1153
|
}), u.current && (!en(r._options.mode).isOnSubmit || r._formState.isSubmitted) && !en(r._options.reValidateMode).isOnSubmit)
|
|
1154
1154
|
if (r._options.resolver)
|
|
1155
1155
|
r._runSchema([n]).then((R) => {
|
|
1156
|
-
const
|
|
1157
|
-
(_ ? !
|
|
1156
|
+
const M = J(R.errors, n), _ = J(r._formState.errors, n);
|
|
1157
|
+
(_ ? !M && _.type || M && (_.type !== M.type || _.message !== M.message) : M && M.type) && (M ? be(r._formState.errors, n, M) : Ke(r._formState.errors, n), r._subjects.state.next({
|
|
1158
1158
|
errors: r._formState.errors
|
|
1159
1159
|
}));
|
|
1160
1160
|
});
|
|
1161
1161
|
else {
|
|
1162
1162
|
const R = J(r._fields, n);
|
|
1163
|
-
R && R._f && !(en(r._options.reValidateMode).isOnSubmit && en(r._options.mode).isOnSubmit) && Aa(R, r._names.disabled, r._formValues, r._options.criteriaMode === _t.all, r._options.shouldUseNativeValidation, !0).then((
|
|
1164
|
-
errors: Xl(r._formState.errors,
|
|
1163
|
+
R && R._f && !(en(r._options.reValidateMode).isOnSubmit && en(r._options.mode).isOnSubmit) && Aa(R, r._names.disabled, r._formValues, r._options.criteriaMode === _t.all, r._options.shouldUseNativeValidation, !0).then((M) => !st(M) && r._subjects.state.next({
|
|
1164
|
+
errors: Xl(r._formState.errors, M, n)
|
|
1165
1165
|
}));
|
|
1166
1166
|
}
|
|
1167
1167
|
r._subjects.state.next({
|
|
1168
1168
|
name: n,
|
|
1169
1169
|
values: Ie(r._formValues)
|
|
1170
|
-
}), r._names.focus && an(r._fields, (R,
|
|
1171
|
-
if (r._names.focus &&
|
|
1170
|
+
}), r._names.focus && an(r._fields, (R, M) => {
|
|
1171
|
+
if (r._names.focus && M.startsWith(r._names.focus) && R.focus)
|
|
1172
1172
|
return R.focus(), 1;
|
|
1173
1173
|
}), r._names.focus = "", r._setValid(), u.current = !1;
|
|
1174
1174
|
}, [s, n, r]), oe.useEffect(() => (!J(r._formValues, n) && r._setFieldArray(n), () => {
|
|
1175
|
-
const R = (
|
|
1176
|
-
const D = J(r._fields,
|
|
1175
|
+
const R = (M, _) => {
|
|
1176
|
+
const D = J(r._fields, M);
|
|
1177
1177
|
D && D._f && (D._f.mount = _);
|
|
1178
1178
|
};
|
|
1179
1179
|
r._options.shouldUnregister || a ? r.unregister(n) : R(n, !1);
|
|
@@ -1186,9 +1186,9 @@ function cp(e) {
|
|
|
1186
1186
|
insert: oe.useCallback(b, [v, n, r]),
|
|
1187
1187
|
update: oe.useCallback(T, [v, n, r]),
|
|
1188
1188
|
replace: oe.useCallback(C, [v, n, r]),
|
|
1189
|
-
fields: oe.useMemo(() => s.map((R,
|
|
1189
|
+
fields: oe.useMemo(() => s.map((R, M) => ({
|
|
1190
1190
|
...R,
|
|
1191
|
-
[i]: p.current[
|
|
1191
|
+
[i]: p.current[M] || nr()
|
|
1192
1192
|
})), [s, i])
|
|
1193
1193
|
};
|
|
1194
1194
|
}
|
|
@@ -1485,20 +1485,20 @@ var _r, lr, sn, Sl, xp = (Sl = class extends Wn {
|
|
|
1485
1485
|
});
|
|
1486
1486
|
}
|
|
1487
1487
|
onSubscribe() {
|
|
1488
|
-
|
|
1488
|
+
O(this, lr) || this.setEventListener(O(this, sn));
|
|
1489
1489
|
}
|
|
1490
1490
|
onUnsubscribe() {
|
|
1491
1491
|
var t;
|
|
1492
|
-
this.hasListeners() || ((t =
|
|
1492
|
+
this.hasListeners() || ((t = O(this, lr)) == null || t.call(this), ie(this, lr, void 0));
|
|
1493
1493
|
}
|
|
1494
1494
|
setEventListener(t) {
|
|
1495
1495
|
var r;
|
|
1496
|
-
ie(this, sn, t), (r =
|
|
1496
|
+
ie(this, sn, t), (r = O(this, lr)) == null || r.call(this), ie(this, lr, t((n) => {
|
|
1497
1497
|
typeof n == "boolean" ? this.setFocused(n) : this.onFocus();
|
|
1498
1498
|
}));
|
|
1499
1499
|
}
|
|
1500
1500
|
setFocused(t) {
|
|
1501
|
-
|
|
1501
|
+
O(this, _r) !== t && (ie(this, _r, t), this.onFocus());
|
|
1502
1502
|
}
|
|
1503
1503
|
onFocus() {
|
|
1504
1504
|
const t = this.isFocused();
|
|
@@ -1508,7 +1508,7 @@ var _r, lr, sn, Sl, xp = (Sl = class extends Wn {
|
|
|
1508
1508
|
}
|
|
1509
1509
|
isFocused() {
|
|
1510
1510
|
var t;
|
|
1511
|
-
return typeof
|
|
1511
|
+
return typeof O(this, _r) == "boolean" ? O(this, _r) : ((t = globalThis.document) == null ? void 0 : t.visibilityState) !== "hidden";
|
|
1512
1512
|
}
|
|
1513
1513
|
}, _r = new WeakMap(), lr = new WeakMap(), sn = new WeakMap(), Sl), ho = new xp(), ln, cr, cn, Cl, bp = (Cl = class extends Wn {
|
|
1514
1514
|
constructor() {
|
|
@@ -1526,23 +1526,23 @@ var _r, lr, sn, Sl, xp = (Sl = class extends Wn {
|
|
|
1526
1526
|
});
|
|
1527
1527
|
}
|
|
1528
1528
|
onSubscribe() {
|
|
1529
|
-
|
|
1529
|
+
O(this, cr) || this.setEventListener(O(this, cn));
|
|
1530
1530
|
}
|
|
1531
1531
|
onUnsubscribe() {
|
|
1532
1532
|
var t;
|
|
1533
|
-
this.hasListeners() || ((t =
|
|
1533
|
+
this.hasListeners() || ((t = O(this, cr)) == null || t.call(this), ie(this, cr, void 0));
|
|
1534
1534
|
}
|
|
1535
1535
|
setEventListener(t) {
|
|
1536
1536
|
var r;
|
|
1537
|
-
ie(this, cn, t), (r =
|
|
1537
|
+
ie(this, cn, t), (r = O(this, cr)) == null || r.call(this), ie(this, cr, t(this.setOnline.bind(this)));
|
|
1538
1538
|
}
|
|
1539
1539
|
setOnline(t) {
|
|
1540
|
-
|
|
1540
|
+
O(this, ln) !== t && (ie(this, ln, t), this.listeners.forEach((n) => {
|
|
1541
1541
|
n(t);
|
|
1542
1542
|
}));
|
|
1543
1543
|
}
|
|
1544
1544
|
isOnline() {
|
|
1545
|
-
return
|
|
1545
|
+
return O(this, ln);
|
|
1546
1546
|
}
|
|
1547
1547
|
}, ln = new WeakMap(), cr = new WeakMap(), cn = new WeakMap(), Cl), bi = new bp();
|
|
1548
1548
|
function Pa() {
|
|
@@ -1717,7 +1717,7 @@ var Xe = Cp(), Rr, El, ac = (El = class {
|
|
|
1717
1717
|
);
|
|
1718
1718
|
}
|
|
1719
1719
|
clearGcTimeout() {
|
|
1720
|
-
|
|
1720
|
+
O(this, Rr) && (clearTimeout(O(this, Rr)), ie(this, Rr, void 0));
|
|
1721
1721
|
}
|
|
1722
1722
|
}, Rr = new WeakMap(), El), un, $r, kt, Pr, et, zn, Dr, Dt, Jt, kl, Ep = (kl = class extends ac {
|
|
1723
1723
|
constructor(t) {
|
|
@@ -1730,20 +1730,20 @@ var Xe = Cp(), Rr, El, ac = (El = class {
|
|
|
1730
1730
|
he(this, et);
|
|
1731
1731
|
he(this, zn);
|
|
1732
1732
|
he(this, Dr);
|
|
1733
|
-
ie(this, Dr, !1), ie(this, zn, t.defaultOptions), this.setOptions(t.options), this.observers = [], ie(this, Pr, t.client), ie(this, kt,
|
|
1733
|
+
ie(this, Dr, !1), ie(this, zn, t.defaultOptions), this.setOptions(t.options), this.observers = [], ie(this, Pr, t.client), ie(this, kt, O(this, Pr).getQueryCache()), this.queryKey = t.queryKey, this.queryHash = t.queryHash, ie(this, un, kp(this.options)), this.state = t.state ?? O(this, un), this.scheduleGc();
|
|
1734
1734
|
}
|
|
1735
1735
|
get meta() {
|
|
1736
1736
|
return this.options.meta;
|
|
1737
1737
|
}
|
|
1738
1738
|
get promise() {
|
|
1739
1739
|
var t;
|
|
1740
|
-
return (t =
|
|
1740
|
+
return (t = O(this, et)) == null ? void 0 : t.promise;
|
|
1741
1741
|
}
|
|
1742
1742
|
setOptions(t) {
|
|
1743
|
-
this.options = { ...
|
|
1743
|
+
this.options = { ...O(this, zn), ...t }, this.updateGcTime(this.options.gcTime);
|
|
1744
1744
|
}
|
|
1745
1745
|
optionalRemove() {
|
|
1746
|
-
!this.observers.length && this.state.fetchStatus === "idle" &&
|
|
1746
|
+
!this.observers.length && this.state.fetchStatus === "idle" && O(this, kt).remove(this);
|
|
1747
1747
|
}
|
|
1748
1748
|
setData(t, r) {
|
|
1749
1749
|
const n = $a(this.state.data, t, this.options);
|
|
@@ -1759,14 +1759,14 @@ var Xe = Cp(), Rr, El, ac = (El = class {
|
|
|
1759
1759
|
}
|
|
1760
1760
|
cancel(t) {
|
|
1761
1761
|
var n, i;
|
|
1762
|
-
const r = (n =
|
|
1763
|
-
return (i =
|
|
1762
|
+
const r = (n = O(this, et)) == null ? void 0 : n.promise;
|
|
1763
|
+
return (i = O(this, et)) == null || i.cancel(t), r ? r.then(dt).catch(dt) : Promise.resolve();
|
|
1764
1764
|
}
|
|
1765
1765
|
destroy() {
|
|
1766
1766
|
super.destroy(), this.cancel({ silent: !0 });
|
|
1767
1767
|
}
|
|
1768
1768
|
reset() {
|
|
1769
|
-
this.destroy(), this.setState(
|
|
1769
|
+
this.destroy(), this.setState(O(this, un));
|
|
1770
1770
|
}
|
|
1771
1771
|
isActive() {
|
|
1772
1772
|
return this.observers.some(
|
|
@@ -1792,18 +1792,18 @@ var Xe = Cp(), Rr, El, ac = (El = class {
|
|
|
1792
1792
|
onFocus() {
|
|
1793
1793
|
var r;
|
|
1794
1794
|
const t = this.observers.find((n) => n.shouldFetchOnWindowFocus());
|
|
1795
|
-
t == null || t.refetch({ cancelRefetch: !1 }), (r =
|
|
1795
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (r = O(this, et)) == null || r.continue();
|
|
1796
1796
|
}
|
|
1797
1797
|
onOnline() {
|
|
1798
1798
|
var r;
|
|
1799
1799
|
const t = this.observers.find((n) => n.shouldFetchOnReconnect());
|
|
1800
|
-
t == null || t.refetch({ cancelRefetch: !1 }), (r =
|
|
1800
|
+
t == null || t.refetch({ cancelRefetch: !1 }), (r = O(this, et)) == null || r.continue();
|
|
1801
1801
|
}
|
|
1802
1802
|
addObserver(t) {
|
|
1803
|
-
this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(),
|
|
1803
|
+
this.observers.includes(t) || (this.observers.push(t), this.clearGcTimeout(), O(this, kt).notify({ type: "observerAdded", query: this, observer: t }));
|
|
1804
1804
|
}
|
|
1805
1805
|
removeObserver(t) {
|
|
1806
|
-
this.observers.includes(t) && (this.observers = this.observers.filter((r) => r !== t), this.observers.length || (
|
|
1806
|
+
this.observers.includes(t) && (this.observers = this.observers.filter((r) => r !== t), this.observers.length || (O(this, et) && (O(this, Dr) ? O(this, et).cancel({ revert: !0 }) : O(this, et).cancelRetry()), this.scheduleGc()), O(this, kt).notify({ type: "observerRemoved", query: this, observer: t }));
|
|
1807
1807
|
}
|
|
1808
1808
|
getObserversCount() {
|
|
1809
1809
|
return this.observers.length;
|
|
@@ -1816,8 +1816,8 @@ var Xe = Cp(), Rr, El, ac = (El = class {
|
|
|
1816
1816
|
if (this.state.fetchStatus !== "idle") {
|
|
1817
1817
|
if (this.state.data !== void 0 && (r != null && r.cancelRefetch))
|
|
1818
1818
|
this.cancel({ silent: !0 });
|
|
1819
|
-
else if (
|
|
1820
|
-
return
|
|
1819
|
+
else if (O(this, et))
|
|
1820
|
+
return O(this, et).continueRetry(), O(this, et).promise;
|
|
1821
1821
|
}
|
|
1822
1822
|
if (t && this.setOptions(t), !this.options.queryFn) {
|
|
1823
1823
|
const u = this.observers.find((v) => v.options.queryFn);
|
|
@@ -1834,7 +1834,7 @@ var Xe = Cp(), Rr, El, ac = (El = class {
|
|
|
1834
1834
|
}, a = () => {
|
|
1835
1835
|
const u = tc(this.options, r), E = (() => {
|
|
1836
1836
|
const h = {
|
|
1837
|
-
client:
|
|
1837
|
+
client: O(this, Pr),
|
|
1838
1838
|
queryKey: this.queryKey,
|
|
1839
1839
|
meta: this.meta
|
|
1840
1840
|
};
|
|
@@ -1850,7 +1850,7 @@ var Xe = Cp(), Rr, El, ac = (El = class {
|
|
|
1850
1850
|
fetchOptions: r,
|
|
1851
1851
|
options: this.options,
|
|
1852
1852
|
queryKey: this.queryKey,
|
|
1853
|
-
client:
|
|
1853
|
+
client: O(this, Pr),
|
|
1854
1854
|
state: this.state,
|
|
1855
1855
|
fetchFn: a
|
|
1856
1856
|
};
|
|
@@ -1862,11 +1862,11 @@ var Xe = Cp(), Rr, El, ac = (El = class {
|
|
|
1862
1862
|
sa(u) && u.silent || ve(this, Dt, Jt).call(this, {
|
|
1863
1863
|
type: "error",
|
|
1864
1864
|
error: u
|
|
1865
|
-
}), sa(u) || ((E = (v =
|
|
1865
|
+
}), sa(u) || ((E = (v = O(this, kt).config).onError) == null || E.call(
|
|
1866
1866
|
v,
|
|
1867
1867
|
u,
|
|
1868
1868
|
this
|
|
1869
|
-
), (w = (h =
|
|
1869
|
+
), (w = (h = O(this, kt).config).onSettled) == null || w.call(
|
|
1870
1870
|
h,
|
|
1871
1871
|
this.state.data,
|
|
1872
1872
|
u,
|
|
@@ -1891,7 +1891,7 @@ var Xe = Cp(), Rr, El, ac = (El = class {
|
|
|
1891
1891
|
l(b);
|
|
1892
1892
|
return;
|
|
1893
1893
|
}
|
|
1894
|
-
(E = (v =
|
|
1894
|
+
(E = (v = O(this, kt).config).onSuccess) == null || E.call(v, u, this), (w = (h = O(this, kt).config).onSettled) == null || w.call(
|
|
1895
1895
|
h,
|
|
1896
1896
|
u,
|
|
1897
1897
|
this.state.error,
|
|
@@ -1912,7 +1912,7 @@ var Xe = Cp(), Rr, El, ac = (El = class {
|
|
|
1912
1912
|
retryDelay: s.options.retryDelay,
|
|
1913
1913
|
networkMode: s.options.networkMode,
|
|
1914
1914
|
canRun: () => !0
|
|
1915
|
-
})),
|
|
1915
|
+
})), O(this, et).start();
|
|
1916
1916
|
}
|
|
1917
1917
|
}, un = new WeakMap(), $r = new WeakMap(), kt = new WeakMap(), Pr = new WeakMap(), et = new WeakMap(), zn = new WeakMap(), Dr = new WeakMap(), Dt = new WeakSet(), Jt = function(t) {
|
|
1918
1918
|
const r = (n) => {
|
|
@@ -1956,7 +1956,7 @@ var Xe = Cp(), Rr, El, ac = (El = class {
|
|
|
1956
1956
|
};
|
|
1957
1957
|
case "error":
|
|
1958
1958
|
const i = t.error;
|
|
1959
|
-
return sa(i) && i.revert &&
|
|
1959
|
+
return sa(i) && i.revert && O(this, $r) ? { ...O(this, $r), fetchStatus: "idle" } : {
|
|
1960
1960
|
...n,
|
|
1961
1961
|
error: i,
|
|
1962
1962
|
errorUpdateCount: n.errorUpdateCount + 1,
|
|
@@ -1981,7 +1981,7 @@ var Xe = Cp(), Rr, El, ac = (El = class {
|
|
|
1981
1981
|
this.state = r(this.state), Xe.batch(() => {
|
|
1982
1982
|
this.observers.forEach((n) => {
|
|
1983
1983
|
n.onQueryUpdate();
|
|
1984
|
-
}),
|
|
1984
|
+
}), O(this, kt).notify({ query: this, type: "updated", action: t });
|
|
1985
1985
|
});
|
|
1986
1986
|
}, kl);
|
|
1987
1987
|
function oc(e, t) {
|
|
@@ -2031,14 +2031,14 @@ var qt, Tl, Tp = (Tl = class extends Wn {
|
|
|
2031
2031
|
}), this.add(o)), o;
|
|
2032
2032
|
}
|
|
2033
2033
|
add(t) {
|
|
2034
|
-
|
|
2034
|
+
O(this, qt).has(t.queryHash) || (O(this, qt).set(t.queryHash, t), this.notify({
|
|
2035
2035
|
type: "added",
|
|
2036
2036
|
query: t
|
|
2037
2037
|
}));
|
|
2038
2038
|
}
|
|
2039
2039
|
remove(t) {
|
|
2040
|
-
const r =
|
|
2041
|
-
r && (t.destroy(), r === t &&
|
|
2040
|
+
const r = O(this, qt).get(t.queryHash);
|
|
2041
|
+
r && (t.destroy(), r === t && O(this, qt).delete(t.queryHash), this.notify({ type: "removed", query: t }));
|
|
2042
2042
|
}
|
|
2043
2043
|
clear() {
|
|
2044
2044
|
Xe.batch(() => {
|
|
@@ -2048,10 +2048,10 @@ var qt, Tl, Tp = (Tl = class extends Wn {
|
|
|
2048
2048
|
});
|
|
2049
2049
|
}
|
|
2050
2050
|
get(t) {
|
|
2051
|
-
return
|
|
2051
|
+
return O(this, qt).get(t);
|
|
2052
2052
|
}
|
|
2053
2053
|
getAll() {
|
|
2054
|
-
return [...
|
|
2054
|
+
return [...O(this, qt).values()];
|
|
2055
2055
|
}
|
|
2056
2056
|
find(t) {
|
|
2057
2057
|
const r = { exact: !0, ...t };
|
|
@@ -2100,29 +2100,29 @@ var qt, Tl, Tp = (Tl = class extends Wn {
|
|
|
2100
2100
|
return this.options.meta;
|
|
2101
2101
|
}
|
|
2102
2102
|
addObserver(t) {
|
|
2103
|
-
|
|
2103
|
+
O(this, Wt).includes(t) || (O(this, Wt).push(t), this.clearGcTimeout(), O(this, at).notify({
|
|
2104
2104
|
type: "observerAdded",
|
|
2105
2105
|
mutation: this,
|
|
2106
2106
|
observer: t
|
|
2107
2107
|
}));
|
|
2108
2108
|
}
|
|
2109
2109
|
removeObserver(t) {
|
|
2110
|
-
ie(this, Wt,
|
|
2110
|
+
ie(this, Wt, O(this, Wt).filter((r) => r !== t)), this.scheduleGc(), O(this, at).notify({
|
|
2111
2111
|
type: "observerRemoved",
|
|
2112
2112
|
mutation: this,
|
|
2113
2113
|
observer: t
|
|
2114
2114
|
});
|
|
2115
2115
|
}
|
|
2116
2116
|
optionalRemove() {
|
|
2117
|
-
|
|
2117
|
+
O(this, Wt).length || (this.state.status === "pending" ? this.scheduleGc() : O(this, at).remove(this));
|
|
2118
2118
|
}
|
|
2119
2119
|
continue() {
|
|
2120
2120
|
var t;
|
|
2121
|
-
return ((t =
|
|
2121
|
+
return ((t = O(this, Ir)) == null ? void 0 : t.continue()) ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
|
|
2122
2122
|
this.execute(this.state.variables);
|
|
2123
2123
|
}
|
|
2124
2124
|
async execute(t) {
|
|
2125
|
-
var a, o, s, l, p, m, f, u, v, E, h, w, b, S, P, T, C, R,
|
|
2125
|
+
var a, o, s, l, p, m, f, u, v, E, h, w, b, S, P, T, C, R, M, _;
|
|
2126
2126
|
const r = () => {
|
|
2127
2127
|
ve(this, Ut, ar).call(this, { type: "continue" });
|
|
2128
2128
|
};
|
|
@@ -2138,14 +2138,14 @@ var qt, Tl, Tp = (Tl = class extends Wn {
|
|
|
2138
2138
|
retry: this.options.retry ?? 0,
|
|
2139
2139
|
retryDelay: this.options.retryDelay,
|
|
2140
2140
|
networkMode: this.options.networkMode,
|
|
2141
|
-
canRun: () =>
|
|
2141
|
+
canRun: () => O(this, at).canRun(this)
|
|
2142
2142
|
}));
|
|
2143
|
-
const n = this.state.status === "pending", i = !
|
|
2143
|
+
const n = this.state.status === "pending", i = !O(this, Ir).canStart();
|
|
2144
2144
|
try {
|
|
2145
2145
|
if (n)
|
|
2146
2146
|
r();
|
|
2147
2147
|
else {
|
|
2148
|
-
ve(this, Ut, ar).call(this, { type: "pending", variables: t, isPaused: i }), await ((o = (a =
|
|
2148
|
+
ve(this, Ut, ar).call(this, { type: "pending", variables: t, isPaused: i }), await ((o = (a = O(this, at).config).onMutate) == null ? void 0 : o.call(
|
|
2149
2149
|
a,
|
|
2150
2150
|
t,
|
|
2151
2151
|
this
|
|
@@ -2158,14 +2158,14 @@ var qt, Tl, Tp = (Tl = class extends Wn {
|
|
|
2158
2158
|
isPaused: i
|
|
2159
2159
|
});
|
|
2160
2160
|
}
|
|
2161
|
-
const D = await
|
|
2162
|
-
return await ((m = (p =
|
|
2161
|
+
const D = await O(this, Ir).start();
|
|
2162
|
+
return await ((m = (p = O(this, at).config).onSuccess) == null ? void 0 : m.call(
|
|
2163
2163
|
p,
|
|
2164
2164
|
D,
|
|
2165
2165
|
t,
|
|
2166
2166
|
this.state.context,
|
|
2167
2167
|
this
|
|
2168
|
-
)), await ((u = (f = this.options).onSuccess) == null ? void 0 : u.call(f, D, t, this.state.context)), await ((E = (v =
|
|
2168
|
+
)), await ((u = (f = this.options).onSuccess) == null ? void 0 : u.call(f, D, t, this.state.context)), await ((E = (v = O(this, at).config).onSettled) == null ? void 0 : E.call(
|
|
2169
2169
|
v,
|
|
2170
2170
|
D,
|
|
2171
2171
|
null,
|
|
@@ -2175,7 +2175,7 @@ var qt, Tl, Tp = (Tl = class extends Wn {
|
|
|
2175
2175
|
)), await ((w = (h = this.options).onSettled) == null ? void 0 : w.call(h, D, null, t, this.state.context)), ve(this, Ut, ar).call(this, { type: "success", data: D }), D;
|
|
2176
2176
|
} catch (D) {
|
|
2177
2177
|
try {
|
|
2178
|
-
throw await ((S = (b =
|
|
2178
|
+
throw await ((S = (b = O(this, at).config).onError) == null ? void 0 : S.call(
|
|
2179
2179
|
b,
|
|
2180
2180
|
D,
|
|
2181
2181
|
t,
|
|
@@ -2186,15 +2186,15 @@ var qt, Tl, Tp = (Tl = class extends Wn {
|
|
|
2186
2186
|
D,
|
|
2187
2187
|
t,
|
|
2188
2188
|
this.state.context
|
|
2189
|
-
)), await ((R = (C =
|
|
2189
|
+
)), await ((R = (C = O(this, at).config).onSettled) == null ? void 0 : R.call(
|
|
2190
2190
|
C,
|
|
2191
2191
|
void 0,
|
|
2192
2192
|
D,
|
|
2193
2193
|
this.state.variables,
|
|
2194
2194
|
this.state.context,
|
|
2195
2195
|
this
|
|
2196
|
-
)), await ((_ = (
|
|
2197
|
-
|
|
2196
|
+
)), await ((_ = (M = this.options).onSettled) == null ? void 0 : _.call(
|
|
2197
|
+
M,
|
|
2198
2198
|
void 0,
|
|
2199
2199
|
D,
|
|
2200
2200
|
t,
|
|
@@ -2204,7 +2204,7 @@ var qt, Tl, Tp = (Tl = class extends Wn {
|
|
|
2204
2204
|
ve(this, Ut, ar).call(this, { type: "error", error: D });
|
|
2205
2205
|
}
|
|
2206
2206
|
} finally {
|
|
2207
|
-
|
|
2207
|
+
O(this, at).runNext(this);
|
|
2208
2208
|
}
|
|
2209
2209
|
}
|
|
2210
2210
|
}, Wt = new WeakMap(), at = new WeakMap(), Ir = new WeakMap(), Ut = new WeakSet(), ar = function(t) {
|
|
@@ -2262,9 +2262,9 @@ var qt, Tl, Tp = (Tl = class extends Wn {
|
|
|
2262
2262
|
}
|
|
2263
2263
|
};
|
|
2264
2264
|
this.state = r(this.state), Xe.batch(() => {
|
|
2265
|
-
|
|
2265
|
+
O(this, Wt).forEach((n) => {
|
|
2266
2266
|
n.onMutationUpdate(t);
|
|
2267
|
-
}),
|
|
2267
|
+
}), O(this, at).notify({
|
|
2268
2268
|
mutation: this,
|
|
2269
2269
|
type: "updated",
|
|
2270
2270
|
action: t
|
|
@@ -2302,24 +2302,24 @@ var er, It, Vn, Ol, Fp = (Ol = class extends Wn {
|
|
|
2302
2302
|
return this.add(i), i;
|
|
2303
2303
|
}
|
|
2304
2304
|
add(t) {
|
|
2305
|
-
|
|
2305
|
+
O(this, er).add(t);
|
|
2306
2306
|
const r = Gn(t);
|
|
2307
2307
|
if (typeof r == "string") {
|
|
2308
|
-
const n =
|
|
2309
|
-
n ? n.push(t) :
|
|
2308
|
+
const n = O(this, It).get(r);
|
|
2309
|
+
n ? n.push(t) : O(this, It).set(r, [t]);
|
|
2310
2310
|
}
|
|
2311
2311
|
this.notify({ type: "added", mutation: t });
|
|
2312
2312
|
}
|
|
2313
2313
|
remove(t) {
|
|
2314
|
-
if (
|
|
2314
|
+
if (O(this, er).delete(t)) {
|
|
2315
2315
|
const r = Gn(t);
|
|
2316
2316
|
if (typeof r == "string") {
|
|
2317
|
-
const n =
|
|
2317
|
+
const n = O(this, It).get(r);
|
|
2318
2318
|
if (n)
|
|
2319
2319
|
if (n.length > 1) {
|
|
2320
2320
|
const i = n.indexOf(t);
|
|
2321
2321
|
i !== -1 && n.splice(i, 1);
|
|
2322
|
-
} else n[0] === t &&
|
|
2322
|
+
} else n[0] === t && O(this, It).delete(r);
|
|
2323
2323
|
}
|
|
2324
2324
|
}
|
|
2325
2325
|
this.notify({ type: "removed", mutation: t });
|
|
@@ -2327,7 +2327,7 @@ var er, It, Vn, Ol, Fp = (Ol = class extends Wn {
|
|
|
2327
2327
|
canRun(t) {
|
|
2328
2328
|
const r = Gn(t);
|
|
2329
2329
|
if (typeof r == "string") {
|
|
2330
|
-
const n =
|
|
2330
|
+
const n = O(this, It).get(r), i = n == null ? void 0 : n.find(
|
|
2331
2331
|
(a) => a.state.status === "pending"
|
|
2332
2332
|
);
|
|
2333
2333
|
return !i || i === t;
|
|
@@ -2338,20 +2338,20 @@ var er, It, Vn, Ol, Fp = (Ol = class extends Wn {
|
|
|
2338
2338
|
var n;
|
|
2339
2339
|
const r = Gn(t);
|
|
2340
2340
|
if (typeof r == "string") {
|
|
2341
|
-
const i = (n =
|
|
2341
|
+
const i = (n = O(this, It).get(r)) == null ? void 0 : n.find((a) => a !== t && a.state.isPaused);
|
|
2342
2342
|
return (i == null ? void 0 : i.continue()) ?? Promise.resolve();
|
|
2343
2343
|
} else
|
|
2344
2344
|
return Promise.resolve();
|
|
2345
2345
|
}
|
|
2346
2346
|
clear() {
|
|
2347
2347
|
Xe.batch(() => {
|
|
2348
|
-
|
|
2348
|
+
O(this, er).forEach((t) => {
|
|
2349
2349
|
this.notify({ type: "removed", mutation: t });
|
|
2350
|
-
}),
|
|
2350
|
+
}), O(this, er).clear(), O(this, It).clear();
|
|
2351
2351
|
});
|
|
2352
2352
|
}
|
|
2353
2353
|
getAll() {
|
|
2354
|
-
return Array.from(
|
|
2354
|
+
return Array.from(O(this, er));
|
|
2355
2355
|
}
|
|
2356
2356
|
find(t) {
|
|
2357
2357
|
const r = { exact: !0, ...t };
|
|
@@ -2402,7 +2402,7 @@ function os(e) {
|
|
|
2402
2402
|
return Promise.reject();
|
|
2403
2403
|
if (T == null && P.pages.length)
|
|
2404
2404
|
return Promise.resolve(P);
|
|
2405
|
-
const
|
|
2405
|
+
const M = (() => {
|
|
2406
2406
|
const $ = {
|
|
2407
2407
|
client: t.client,
|
|
2408
2408
|
queryKey: t.queryKey,
|
|
@@ -2411,7 +2411,7 @@ function os(e) {
|
|
|
2411
2411
|
meta: t.options.meta
|
|
2412
2412
|
};
|
|
2413
2413
|
return w($), $;
|
|
2414
|
-
})(), _ = await b(
|
|
2414
|
+
})(), _ = await b(M), { maxPages: D } = t.options, c = C ? yp : gp;
|
|
2415
2415
|
return {
|
|
2416
2416
|
pages: c(P.pages, _, D),
|
|
2417
2417
|
pageParams: c(P.pageParams, T, D)
|
|
@@ -2477,21 +2477,21 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2477
2477
|
ie(this, Be, e.queryCache || new Tp()), ie(this, ur, e.mutationCache || new Fp()), ie(this, pr, e.defaultOptions || {}), ie(this, pn, /* @__PURE__ */ new Map()), ie(this, dn, /* @__PURE__ */ new Map()), ie(this, dr, 0);
|
|
2478
2478
|
}
|
|
2479
2479
|
mount() {
|
|
2480
|
-
Qn(this, dr)._++,
|
|
2481
|
-
e && (await this.resumePausedMutations(),
|
|
2480
|
+
Qn(this, dr)._++, O(this, dr) === 1 && (ie(this, fn, ho.subscribe(async (e) => {
|
|
2481
|
+
e && (await this.resumePausedMutations(), O(this, Be).onFocus());
|
|
2482
2482
|
})), ie(this, mn, bi.subscribe(async (e) => {
|
|
2483
|
-
e && (await this.resumePausedMutations(),
|
|
2483
|
+
e && (await this.resumePausedMutations(), O(this, Be).onOnline());
|
|
2484
2484
|
})));
|
|
2485
2485
|
}
|
|
2486
2486
|
unmount() {
|
|
2487
2487
|
var e, t;
|
|
2488
|
-
Qn(this, dr)._--,
|
|
2488
|
+
Qn(this, dr)._--, O(this, dr) === 0 && ((e = O(this, fn)) == null || e.call(this), ie(this, fn, void 0), (t = O(this, mn)) == null || t.call(this), ie(this, mn, void 0));
|
|
2489
2489
|
}
|
|
2490
2490
|
isFetching(e) {
|
|
2491
|
-
return
|
|
2491
|
+
return O(this, Be).findAll({ ...e, fetchStatus: "fetching" }).length;
|
|
2492
2492
|
}
|
|
2493
2493
|
isMutating(e) {
|
|
2494
|
-
return
|
|
2494
|
+
return O(this, ur).findAll({ ...e, status: "pending" }).length;
|
|
2495
2495
|
}
|
|
2496
2496
|
/**
|
|
2497
2497
|
* Imperative (non-reactive) way to retrieve data for a QueryKey.
|
|
@@ -2503,28 +2503,28 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2503
2503
|
getQueryData(e) {
|
|
2504
2504
|
var r;
|
|
2505
2505
|
const t = this.defaultQueryOptions({ queryKey: e });
|
|
2506
|
-
return (r =
|
|
2506
|
+
return (r = O(this, Be).get(t.queryHash)) == null ? void 0 : r.state.data;
|
|
2507
2507
|
}
|
|
2508
2508
|
ensureQueryData(e) {
|
|
2509
|
-
const t = this.defaultQueryOptions(e), r =
|
|
2509
|
+
const t = this.defaultQueryOptions(e), r = O(this, Be).build(this, t), n = r.state.data;
|
|
2510
2510
|
return n === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && r.isStaleByTime(vr(t.staleTime, r)) && this.prefetchQuery(t), Promise.resolve(n));
|
|
2511
2511
|
}
|
|
2512
2512
|
getQueriesData(e) {
|
|
2513
|
-
return
|
|
2513
|
+
return O(this, Be).findAll(e).map(({ queryKey: t, state: r }) => {
|
|
2514
2514
|
const n = r.data;
|
|
2515
2515
|
return [t, n];
|
|
2516
2516
|
});
|
|
2517
2517
|
}
|
|
2518
2518
|
setQueryData(e, t, r) {
|
|
2519
|
-
const n = this.defaultQueryOptions({ queryKey: e }), i =
|
|
2519
|
+
const n = this.defaultQueryOptions({ queryKey: e }), i = O(this, Be).get(
|
|
2520
2520
|
n.queryHash
|
|
2521
2521
|
), a = i == null ? void 0 : i.state.data, o = mp(t, a);
|
|
2522
2522
|
if (o !== void 0)
|
|
2523
|
-
return
|
|
2523
|
+
return O(this, Be).build(this, n).setData(o, { ...r, manual: !0 });
|
|
2524
2524
|
}
|
|
2525
2525
|
setQueriesData(e, t, r) {
|
|
2526
2526
|
return Xe.batch(
|
|
2527
|
-
() =>
|
|
2527
|
+
() => O(this, Be).findAll(e).map(({ queryKey: n }) => [
|
|
2528
2528
|
n,
|
|
2529
2529
|
this.setQueryData(n, t, r)
|
|
2530
2530
|
])
|
|
@@ -2533,12 +2533,12 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2533
2533
|
getQueryState(e) {
|
|
2534
2534
|
var r;
|
|
2535
2535
|
const t = this.defaultQueryOptions({ queryKey: e });
|
|
2536
|
-
return (r =
|
|
2536
|
+
return (r = O(this, Be).get(
|
|
2537
2537
|
t.queryHash
|
|
2538
2538
|
)) == null ? void 0 : r.state;
|
|
2539
2539
|
}
|
|
2540
2540
|
removeQueries(e) {
|
|
2541
|
-
const t =
|
|
2541
|
+
const t = O(this, Be);
|
|
2542
2542
|
Xe.batch(() => {
|
|
2543
2543
|
t.findAll(e).forEach((r) => {
|
|
2544
2544
|
t.remove(r);
|
|
@@ -2546,7 +2546,7 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2546
2546
|
});
|
|
2547
2547
|
}
|
|
2548
2548
|
resetQueries(e, t) {
|
|
2549
|
-
const r =
|
|
2549
|
+
const r = O(this, Be);
|
|
2550
2550
|
return Xe.batch(() => (r.findAll(e).forEach((n) => {
|
|
2551
2551
|
n.reset();
|
|
2552
2552
|
}), this.refetchQueries(
|
|
@@ -2559,12 +2559,12 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2559
2559
|
}
|
|
2560
2560
|
cancelQueries(e, t = {}) {
|
|
2561
2561
|
const r = { revert: !0, ...t }, n = Xe.batch(
|
|
2562
|
-
() =>
|
|
2562
|
+
() => O(this, Be).findAll(e).map((i) => i.cancel(r))
|
|
2563
2563
|
);
|
|
2564
2564
|
return Promise.all(n).then(dt).catch(dt);
|
|
2565
2565
|
}
|
|
2566
2566
|
invalidateQueries(e, t = {}) {
|
|
2567
|
-
return Xe.batch(() => (
|
|
2567
|
+
return Xe.batch(() => (O(this, Be).findAll(e).forEach((r) => {
|
|
2568
2568
|
r.invalidate();
|
|
2569
2569
|
}), (e == null ? void 0 : e.refetchType) === "none" ? Promise.resolve() : this.refetchQueries(
|
|
2570
2570
|
{
|
|
@@ -2579,7 +2579,7 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2579
2579
|
...t,
|
|
2580
2580
|
cancelRefetch: t.cancelRefetch ?? !0
|
|
2581
2581
|
}, n = Xe.batch(
|
|
2582
|
-
() =>
|
|
2582
|
+
() => O(this, Be).findAll(e).filter((i) => !i.isDisabled() && !i.isStatic()).map((i) => {
|
|
2583
2583
|
let a = i.fetch(void 0, r);
|
|
2584
2584
|
return r.throwOnError || (a = a.catch(dt)), i.state.fetchStatus === "paused" ? Promise.resolve() : a;
|
|
2585
2585
|
})
|
|
@@ -2589,7 +2589,7 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2589
2589
|
fetchQuery(e) {
|
|
2590
2590
|
const t = this.defaultQueryOptions(e);
|
|
2591
2591
|
t.retry === void 0 && (t.retry = !1);
|
|
2592
|
-
const r =
|
|
2592
|
+
const r = O(this, Be).build(this, t);
|
|
2593
2593
|
return r.isStaleByTime(
|
|
2594
2594
|
vr(t.staleTime, r)
|
|
2595
2595
|
) ? r.fetch(t) : Promise.resolve(r.state.data);
|
|
@@ -2607,40 +2607,40 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2607
2607
|
return e.behavior = os(e.pages), this.ensureQueryData(e);
|
|
2608
2608
|
}
|
|
2609
2609
|
resumePausedMutations() {
|
|
2610
|
-
return bi.isOnline() ?
|
|
2610
|
+
return bi.isOnline() ? O(this, ur).resumePausedMutations() : Promise.resolve();
|
|
2611
2611
|
}
|
|
2612
2612
|
getQueryCache() {
|
|
2613
|
-
return
|
|
2613
|
+
return O(this, Be);
|
|
2614
2614
|
}
|
|
2615
2615
|
getMutationCache() {
|
|
2616
|
-
return
|
|
2616
|
+
return O(this, ur);
|
|
2617
2617
|
}
|
|
2618
2618
|
getDefaultOptions() {
|
|
2619
|
-
return
|
|
2619
|
+
return O(this, pr);
|
|
2620
2620
|
}
|
|
2621
2621
|
setDefaultOptions(e) {
|
|
2622
2622
|
ie(this, pr, e);
|
|
2623
2623
|
}
|
|
2624
2624
|
setQueryDefaults(e, t) {
|
|
2625
|
-
|
|
2625
|
+
O(this, pn).set(Dn(e), {
|
|
2626
2626
|
queryKey: e,
|
|
2627
2627
|
defaultOptions: t
|
|
2628
2628
|
});
|
|
2629
2629
|
}
|
|
2630
2630
|
getQueryDefaults(e) {
|
|
2631
|
-
const t = [...
|
|
2631
|
+
const t = [...O(this, pn).values()], r = {};
|
|
2632
2632
|
return t.forEach((n) => {
|
|
2633
2633
|
In(e, n.queryKey) && Object.assign(r, n.defaultOptions);
|
|
2634
2634
|
}), r;
|
|
2635
2635
|
}
|
|
2636
2636
|
setMutationDefaults(e, t) {
|
|
2637
|
-
|
|
2637
|
+
O(this, dn).set(Dn(e), {
|
|
2638
2638
|
mutationKey: e,
|
|
2639
2639
|
defaultOptions: t
|
|
2640
2640
|
});
|
|
2641
2641
|
}
|
|
2642
2642
|
getMutationDefaults(e) {
|
|
2643
|
-
const t = [...
|
|
2643
|
+
const t = [...O(this, dn).values()], r = {};
|
|
2644
2644
|
return t.forEach((n) => {
|
|
2645
2645
|
In(e, n.mutationKey) && Object.assign(r, n.defaultOptions);
|
|
2646
2646
|
}), r;
|
|
@@ -2649,7 +2649,7 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2649
2649
|
if (e._defaulted)
|
|
2650
2650
|
return e;
|
|
2651
2651
|
const t = {
|
|
2652
|
-
...
|
|
2652
|
+
...O(this, pr).queries,
|
|
2653
2653
|
...this.getQueryDefaults(e.queryKey),
|
|
2654
2654
|
...e,
|
|
2655
2655
|
_defaulted: !0
|
|
@@ -2661,14 +2661,14 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2661
2661
|
}
|
|
2662
2662
|
defaultMutationOptions(e) {
|
|
2663
2663
|
return e != null && e._defaulted ? e : {
|
|
2664
|
-
...
|
|
2664
|
+
...O(this, pr).mutations,
|
|
2665
2665
|
...(e == null ? void 0 : e.mutationKey) && this.getMutationDefaults(e.mutationKey),
|
|
2666
2666
|
...e,
|
|
2667
2667
|
_defaulted: !0
|
|
2668
2668
|
};
|
|
2669
2669
|
}
|
|
2670
2670
|
clear() {
|
|
2671
|
-
|
|
2671
|
+
O(this, Be).clear(), O(this, ur).clear();
|
|
2672
2672
|
}
|
|
2673
2673
|
}, Be = new WeakMap(), ur = new WeakMap(), pr = new WeakMap(), pn = new WeakMap(), dn = new WeakMap(), dr = new WeakMap(), fn = new WeakMap(), mn = new WeakMap(), Fl), pt, xe, Nn, ot, Mr, hn, fr, mr, Ln, gn, yn, jr, zr, hr, vn, Ee, An, Da, Ia, Ma, ja, za, Va, Na, sc, _l, $p = (_l = class extends Wn {
|
|
2674
2674
|
constructor(t, r) {
|
|
@@ -2691,7 +2691,7 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2691
2691
|
he(this, zr);
|
|
2692
2692
|
he(this, hr);
|
|
2693
2693
|
he(this, vn, /* @__PURE__ */ new Set());
|
|
2694
|
-
this.options = r, ie(this, pt, t), ie(this, mr, null), ie(this, fr, Pa()), this.options.experimental_prefetchInRender ||
|
|
2694
|
+
this.options = r, ie(this, pt, t), ie(this, mr, null), ie(this, fr, Pa()), this.options.experimental_prefetchInRender || O(this, fr).reject(
|
|
2695
2695
|
new Error("experimental_prefetchInRender feature flag is not enabled")
|
|
2696
2696
|
), this.bindMethods(), this.setOptions(r);
|
|
2697
2697
|
}
|
|
@@ -2699,55 +2699,55 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2699
2699
|
this.refetch = this.refetch.bind(this);
|
|
2700
2700
|
}
|
|
2701
2701
|
onSubscribe() {
|
|
2702
|
-
this.listeners.size === 1 && (
|
|
2702
|
+
this.listeners.size === 1 && (O(this, xe).addObserver(this), ls(O(this, xe), this.options) ? ve(this, Ee, An).call(this) : this.updateResult(), ve(this, Ee, ja).call(this));
|
|
2703
2703
|
}
|
|
2704
2704
|
onUnsubscribe() {
|
|
2705
2705
|
this.hasListeners() || this.destroy();
|
|
2706
2706
|
}
|
|
2707
2707
|
shouldFetchOnReconnect() {
|
|
2708
2708
|
return La(
|
|
2709
|
-
|
|
2709
|
+
O(this, xe),
|
|
2710
2710
|
this.options,
|
|
2711
2711
|
this.options.refetchOnReconnect
|
|
2712
2712
|
);
|
|
2713
2713
|
}
|
|
2714
2714
|
shouldFetchOnWindowFocus() {
|
|
2715
2715
|
return La(
|
|
2716
|
-
|
|
2716
|
+
O(this, xe),
|
|
2717
2717
|
this.options,
|
|
2718
2718
|
this.options.refetchOnWindowFocus
|
|
2719
2719
|
);
|
|
2720
2720
|
}
|
|
2721
2721
|
destroy() {
|
|
2722
|
-
this.listeners = /* @__PURE__ */ new Set(), ve(this, Ee, za).call(this), ve(this, Ee, Va).call(this),
|
|
2722
|
+
this.listeners = /* @__PURE__ */ new Set(), ve(this, Ee, za).call(this), ve(this, Ee, Va).call(this), O(this, xe).removeObserver(this);
|
|
2723
2723
|
}
|
|
2724
2724
|
setOptions(t) {
|
|
2725
|
-
const r = this.options, n =
|
|
2726
|
-
if (this.options =
|
|
2725
|
+
const r = this.options, n = O(this, xe);
|
|
2726
|
+
if (this.options = O(this, pt).defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof Tt(this.options.enabled, O(this, xe)) != "boolean")
|
|
2727
2727
|
throw new Error(
|
|
2728
2728
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
2729
2729
|
);
|
|
2730
|
-
ve(this, Ee, Na).call(this),
|
|
2730
|
+
ve(this, Ee, Na).call(this), O(this, xe).setOptions(this.options), r._defaulted && !_a(this.options, r) && O(this, pt).getQueryCache().notify({
|
|
2731
2731
|
type: "observerOptionsUpdated",
|
|
2732
|
-
query:
|
|
2732
|
+
query: O(this, xe),
|
|
2733
2733
|
observer: this
|
|
2734
2734
|
});
|
|
2735
2735
|
const i = this.hasListeners();
|
|
2736
2736
|
i && cs(
|
|
2737
|
-
|
|
2737
|
+
O(this, xe),
|
|
2738
2738
|
n,
|
|
2739
2739
|
this.options,
|
|
2740
2740
|
r
|
|
2741
|
-
) && ve(this, Ee, An).call(this), this.updateResult(), i && (
|
|
2741
|
+
) && ve(this, Ee, An).call(this), this.updateResult(), i && (O(this, xe) !== n || Tt(this.options.enabled, O(this, xe)) !== Tt(r.enabled, O(this, xe)) || vr(this.options.staleTime, O(this, xe)) !== vr(r.staleTime, O(this, xe))) && ve(this, Ee, Da).call(this);
|
|
2742
2742
|
const a = ve(this, Ee, Ia).call(this);
|
|
2743
|
-
i && (
|
|
2743
|
+
i && (O(this, xe) !== n || Tt(this.options.enabled, O(this, xe)) !== Tt(r.enabled, O(this, xe)) || a !== O(this, hr)) && ve(this, Ee, Ma).call(this, a);
|
|
2744
2744
|
}
|
|
2745
2745
|
getOptimisticResult(t) {
|
|
2746
|
-
const r =
|
|
2747
|
-
return Dp(this, n) && (ie(this, ot, n), ie(this, hn, this.options), ie(this, Mr,
|
|
2746
|
+
const r = O(this, pt).getQueryCache().build(O(this, pt), t), n = this.createResult(r, t);
|
|
2747
|
+
return Dp(this, n) && (ie(this, ot, n), ie(this, hn, this.options), ie(this, Mr, O(this, xe).state)), n;
|
|
2748
2748
|
}
|
|
2749
2749
|
getCurrentResult() {
|
|
2750
|
-
return
|
|
2750
|
+
return O(this, ot);
|
|
2751
2751
|
}
|
|
2752
2752
|
trackResult(t, r) {
|
|
2753
2753
|
return new Proxy(t, {
|
|
@@ -2755,10 +2755,10 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2755
2755
|
});
|
|
2756
2756
|
}
|
|
2757
2757
|
trackProp(t) {
|
|
2758
|
-
|
|
2758
|
+
O(this, vn).add(t);
|
|
2759
2759
|
}
|
|
2760
2760
|
getCurrentQuery() {
|
|
2761
|
-
return
|
|
2761
|
+
return O(this, xe);
|
|
2762
2762
|
}
|
|
2763
2763
|
refetch({ ...t } = {}) {
|
|
2764
2764
|
return this.fetch({
|
|
@@ -2766,18 +2766,18 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2766
2766
|
});
|
|
2767
2767
|
}
|
|
2768
2768
|
fetchOptimistic(t) {
|
|
2769
|
-
const r =
|
|
2769
|
+
const r = O(this, pt).defaultQueryOptions(t), n = O(this, pt).getQueryCache().build(O(this, pt), r);
|
|
2770
2770
|
return n.fetch().then(() => this.createResult(n, r));
|
|
2771
2771
|
}
|
|
2772
2772
|
fetch(t) {
|
|
2773
2773
|
return ve(this, Ee, An).call(this, {
|
|
2774
2774
|
...t,
|
|
2775
2775
|
cancelRefetch: t.cancelRefetch ?? !0
|
|
2776
|
-
}).then(() => (this.updateResult(),
|
|
2776
|
+
}).then(() => (this.updateResult(), O(this, ot)));
|
|
2777
2777
|
}
|
|
2778
2778
|
createResult(t, r) {
|
|
2779
2779
|
var D;
|
|
2780
|
-
const n =
|
|
2780
|
+
const n = O(this, xe), i = this.options, a = O(this, ot), o = O(this, Mr), s = O(this, hn), p = t !== n ? t.state : O(this, Nn), { state: m } = t;
|
|
2781
2781
|
let f = { ...m }, u = !1, v;
|
|
2782
2782
|
if (r._optimisticResults) {
|
|
2783
2783
|
const c = this.hasListeners(), $ = !c && ls(t, r), z = c && cs(t, n, r, i);
|
|
@@ -2792,8 +2792,8 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2792
2792
|
if (r.placeholderData !== void 0 && v === void 0 && w === "pending") {
|
|
2793
2793
|
let c;
|
|
2794
2794
|
a != null && a.isPlaceholderData && r.placeholderData === (s == null ? void 0 : s.placeholderData) ? (c = a.data, b = !0) : c = typeof r.placeholderData == "function" ? r.placeholderData(
|
|
2795
|
-
(D =
|
|
2796
|
-
|
|
2795
|
+
(D = O(this, yn)) == null ? void 0 : D.state.data,
|
|
2796
|
+
O(this, yn)
|
|
2797
2797
|
) : r.placeholderData, c !== void 0 && (w = "success", v = $a(
|
|
2798
2798
|
a == null ? void 0 : a.data,
|
|
2799
2799
|
c,
|
|
@@ -2801,15 +2801,15 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2801
2801
|
), u = !0);
|
|
2802
2802
|
}
|
|
2803
2803
|
if (r.select && v !== void 0 && !b)
|
|
2804
|
-
if (a && v === (o == null ? void 0 : o.data) && r.select ===
|
|
2805
|
-
v =
|
|
2804
|
+
if (a && v === (o == null ? void 0 : o.data) && r.select === O(this, Ln))
|
|
2805
|
+
v = O(this, gn);
|
|
2806
2806
|
else
|
|
2807
2807
|
try {
|
|
2808
2808
|
ie(this, Ln, r.select), v = r.select(v), v = $a(a == null ? void 0 : a.data, v, r), ie(this, gn, v), ie(this, mr, null);
|
|
2809
2809
|
} catch (c) {
|
|
2810
2810
|
ie(this, mr, c);
|
|
2811
2811
|
}
|
|
2812
|
-
|
|
2812
|
+
O(this, mr) && (E = O(this, mr), v = O(this, gn), h = Date.now(), w = "error");
|
|
2813
2813
|
const S = f.fetchStatus === "fetching", P = w === "pending", T = w === "error", C = P && S, R = v !== void 0, _ = {
|
|
2814
2814
|
status: w,
|
|
2815
2815
|
fetchStatus: f.fetchStatus,
|
|
@@ -2835,7 +2835,7 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2835
2835
|
isRefetchError: T && R,
|
|
2836
2836
|
isStale: go(t, r),
|
|
2837
2837
|
refetch: this.refetch,
|
|
2838
|
-
promise:
|
|
2838
|
+
promise: O(this, fr),
|
|
2839
2839
|
isEnabled: Tt(r.enabled, t) !== !1
|
|
2840
2840
|
};
|
|
2841
2841
|
if (this.options.experimental_prefetchInRender) {
|
|
@@ -2844,7 +2844,7 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2844
2844
|
}, $ = () => {
|
|
2845
2845
|
const F = ie(this, fr, _.promise = Pa());
|
|
2846
2846
|
c(F);
|
|
2847
|
-
}, z =
|
|
2847
|
+
}, z = O(this, fr);
|
|
2848
2848
|
switch (z.status) {
|
|
2849
2849
|
case "pending":
|
|
2850
2850
|
t.queryHash === n.queryHash && c(z);
|
|
@@ -2860,22 +2860,22 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2860
2860
|
return _;
|
|
2861
2861
|
}
|
|
2862
2862
|
updateResult() {
|
|
2863
|
-
const t =
|
|
2864
|
-
if (ie(this, Mr,
|
|
2863
|
+
const t = O(this, ot), r = this.createResult(O(this, xe), this.options);
|
|
2864
|
+
if (ie(this, Mr, O(this, xe).state), ie(this, hn, this.options), O(this, Mr).data !== void 0 && ie(this, yn, O(this, xe)), _a(r, t))
|
|
2865
2865
|
return;
|
|
2866
2866
|
ie(this, ot, r);
|
|
2867
2867
|
const n = () => {
|
|
2868
2868
|
if (!t)
|
|
2869
2869
|
return !0;
|
|
2870
2870
|
const { notifyOnChangeProps: i } = this.options, a = typeof i == "function" ? i() : i;
|
|
2871
|
-
if (a === "all" || !a && !
|
|
2871
|
+
if (a === "all" || !a && !O(this, vn).size)
|
|
2872
2872
|
return !0;
|
|
2873
2873
|
const o = new Set(
|
|
2874
|
-
a ??
|
|
2874
|
+
a ?? O(this, vn)
|
|
2875
2875
|
);
|
|
2876
|
-
return this.options.throwOnError && o.add("error"), Object.keys(
|
|
2876
|
+
return this.options.throwOnError && o.add("error"), Object.keys(O(this, ot)).some((s) => {
|
|
2877
2877
|
const l = s;
|
|
2878
|
-
return
|
|
2878
|
+
return O(this, ot)[l] !== t[l] && o.has(l);
|
|
2879
2879
|
});
|
|
2880
2880
|
};
|
|
2881
2881
|
ve(this, Ee, sc).call(this, { listeners: n() });
|
|
@@ -2885,7 +2885,7 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2885
2885
|
}
|
|
2886
2886
|
}, pt = new WeakMap(), xe = new WeakMap(), Nn = new WeakMap(), ot = new WeakMap(), Mr = new WeakMap(), hn = new WeakMap(), fr = new WeakMap(), mr = new WeakMap(), Ln = new WeakMap(), gn = new WeakMap(), yn = new WeakMap(), jr = new WeakMap(), zr = new WeakMap(), hr = new WeakMap(), vn = new WeakMap(), Ee = new WeakSet(), An = function(t) {
|
|
2887
2887
|
ve(this, Ee, Na).call(this);
|
|
2888
|
-
let r =
|
|
2888
|
+
let r = O(this, xe).fetch(
|
|
2889
2889
|
this.options,
|
|
2890
2890
|
t
|
|
2891
2891
|
);
|
|
@@ -2894,38 +2894,38 @@ var Be, ur, pr, pn, dn, dr, fn, mn, Fl, Rp = (Fl = class {
|
|
|
2894
2894
|
ve(this, Ee, za).call(this);
|
|
2895
2895
|
const t = vr(
|
|
2896
2896
|
this.options.staleTime,
|
|
2897
|
-
|
|
2897
|
+
O(this, xe)
|
|
2898
2898
|
);
|
|
2899
|
-
if (Nr ||
|
|
2899
|
+
if (Nr || O(this, ot).isStale || !Oa(t))
|
|
2900
2900
|
return;
|
|
2901
|
-
const n = ec(
|
|
2901
|
+
const n = ec(O(this, ot).dataUpdatedAt, t) + 1;
|
|
2902
2902
|
ie(this, jr, setTimeout(() => {
|
|
2903
|
-
|
|
2903
|
+
O(this, ot).isStale || this.updateResult();
|
|
2904
2904
|
}, n));
|
|
2905
2905
|
}, Ia = function() {
|
|
2906
|
-
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(
|
|
2906
|
+
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(O(this, xe)) : this.options.refetchInterval) ?? !1;
|
|
2907
2907
|
}, Ma = function(t) {
|
|
2908
|
-
ve(this, Ee, Va).call(this), ie(this, hr, t), !(Nr || Tt(this.options.enabled,
|
|
2908
|
+
ve(this, Ee, Va).call(this), ie(this, hr, t), !(Nr || Tt(this.options.enabled, O(this, xe)) === !1 || !Oa(O(this, hr)) || O(this, hr) === 0) && ie(this, zr, setInterval(() => {
|
|
2909
2909
|
(this.options.refetchIntervalInBackground || ho.isFocused()) && ve(this, Ee, An).call(this);
|
|
2910
|
-
},
|
|
2910
|
+
}, O(this, hr)));
|
|
2911
2911
|
}, ja = function() {
|
|
2912
2912
|
ve(this, Ee, Da).call(this), ve(this, Ee, Ma).call(this, ve(this, Ee, Ia).call(this));
|
|
2913
2913
|
}, za = function() {
|
|
2914
|
-
|
|
2914
|
+
O(this, jr) && (clearTimeout(O(this, jr)), ie(this, jr, void 0));
|
|
2915
2915
|
}, Va = function() {
|
|
2916
|
-
|
|
2916
|
+
O(this, zr) && (clearInterval(O(this, zr)), ie(this, zr, void 0));
|
|
2917
2917
|
}, Na = function() {
|
|
2918
|
-
const t =
|
|
2919
|
-
if (t ===
|
|
2918
|
+
const t = O(this, pt).getQueryCache().build(O(this, pt), this.options);
|
|
2919
|
+
if (t === O(this, xe))
|
|
2920
2920
|
return;
|
|
2921
|
-
const r =
|
|
2921
|
+
const r = O(this, xe);
|
|
2922
2922
|
ie(this, xe, t), ie(this, Nn, t.state), this.hasListeners() && (r == null || r.removeObserver(this), t.addObserver(this));
|
|
2923
2923
|
}, sc = function(t) {
|
|
2924
2924
|
Xe.batch(() => {
|
|
2925
2925
|
t.listeners && this.listeners.forEach((r) => {
|
|
2926
|
-
r(
|
|
2927
|
-
}),
|
|
2928
|
-
query:
|
|
2926
|
+
r(O(this, ot));
|
|
2927
|
+
}), O(this, pt).getQueryCache().notify({
|
|
2928
|
+
query: O(this, xe),
|
|
2929
2929
|
type: "observerResultsUpdated"
|
|
2930
2930
|
});
|
|
2931
2931
|
});
|
|
@@ -3187,8 +3187,8 @@ function Gp() {
|
|
|
3187
3187
|
}
|
|
3188
3188
|
}
|
|
3189
3189
|
}
|
|
3190
|
-
var C = l, R = p,
|
|
3191
|
-
function
|
|
3190
|
+
var C = l, R = p, M = s, _ = o, D = t, c = m, $ = n, z = E, F = v, V = r, te = a, se = i, re = f, pe = !1;
|
|
3191
|
+
function Y(G) {
|
|
3192
3192
|
return pe || (pe = !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.")), L(G) || T(G) === l;
|
|
3193
3193
|
}
|
|
3194
3194
|
function L(G) {
|
|
@@ -3215,7 +3215,7 @@ function Gp() {
|
|
|
3215
3215
|
function Q(G) {
|
|
3216
3216
|
return T(G) === v;
|
|
3217
3217
|
}
|
|
3218
|
-
function
|
|
3218
|
+
function ne(G) {
|
|
3219
3219
|
return T(G) === r;
|
|
3220
3220
|
}
|
|
3221
3221
|
function le(G) {
|
|
@@ -3227,7 +3227,7 @@ function Gp() {
|
|
|
3227
3227
|
function we(G) {
|
|
3228
3228
|
return T(G) === f;
|
|
3229
3229
|
}
|
|
3230
|
-
Ce.AsyncMode = C, Ce.ConcurrentMode = R, Ce.ContextConsumer =
|
|
3230
|
+
Ce.AsyncMode = C, Ce.ConcurrentMode = R, Ce.ContextConsumer = M, Ce.ContextProvider = _, Ce.Element = D, Ce.ForwardRef = c, Ce.Fragment = $, Ce.Lazy = z, Ce.Memo = F, Ce.Portal = V, Ce.Profiler = te, Ce.StrictMode = se, Ce.Suspense = re, Ce.isAsyncMode = Y, Ce.isConcurrentMode = L, Ce.isContextConsumer = X, Ce.isContextProvider = me, Ce.isElement = de, Ce.isForwardRef = ce, Ce.isFragment = ge, Ce.isLazy = B, Ce.isMemo = Q, Ce.isPortal = ne, Ce.isProfiler = le, Ce.isStrictMode = ue, Ce.isSuspense = we, Ce.isValidElementType = P, Ce.typeOf = T;
|
|
3231
3231
|
}()), Ce;
|
|
3232
3232
|
}
|
|
3233
3233
|
var fs;
|
|
@@ -3385,7 +3385,7 @@ function Jp() {
|
|
|
3385
3385
|
instanceOf: R,
|
|
3386
3386
|
node: c(),
|
|
3387
3387
|
objectOf: _,
|
|
3388
|
-
oneOf:
|
|
3388
|
+
oneOf: M,
|
|
3389
3389
|
oneOfType: D,
|
|
3390
3390
|
shape: z,
|
|
3391
3391
|
exact: F
|
|
@@ -3400,31 +3400,31 @@ function Jp() {
|
|
|
3400
3400
|
function w(L) {
|
|
3401
3401
|
if (process.env.NODE_ENV !== "production")
|
|
3402
3402
|
var X = {}, me = 0;
|
|
3403
|
-
function de(ge, B, Q,
|
|
3404
|
-
if (
|
|
3403
|
+
function de(ge, B, Q, ne, le, ue, we) {
|
|
3404
|
+
if (ne = ne || u, ue = ue || Q, we !== r) {
|
|
3405
3405
|
if (l) {
|
|
3406
3406
|
var G = new Error(
|
|
3407
3407
|
"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"
|
|
3408
3408
|
);
|
|
3409
3409
|
throw G.name = "Invariant Violation", G;
|
|
3410
3410
|
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
3411
|
-
var ze =
|
|
3411
|
+
var ze = ne + ":" + Q;
|
|
3412
3412
|
!X[ze] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
3413
3413
|
me < 3 && (a(
|
|
3414
|
-
"You are manually calling a React.PropTypes validation function for the `" + ue + "` prop on `" +
|
|
3414
|
+
"You are manually calling a React.PropTypes validation function for the `" + ue + "` prop on `" + ne + "`. 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."
|
|
3415
3415
|
), X[ze] = !0, me++);
|
|
3416
3416
|
}
|
|
3417
3417
|
}
|
|
3418
|
-
return B[Q] == null ? ge ? B[Q] === null ? new h("The " + le + " `" + ue + "` is marked as required " + ("in `" +
|
|
3418
|
+
return B[Q] == null ? ge ? B[Q] === null ? new h("The " + le + " `" + ue + "` is marked as required " + ("in `" + ne + "`, but its value is `null`.")) : new h("The " + le + " `" + ue + "` is marked as required in " + ("`" + ne + "`, but its value is `undefined`.")) : null : L(B, Q, ne, le, ue);
|
|
3419
3419
|
}
|
|
3420
3420
|
var ce = de.bind(null, !1);
|
|
3421
3421
|
return ce.isRequired = de.bind(null, !0), ce;
|
|
3422
3422
|
}
|
|
3423
3423
|
function b(L) {
|
|
3424
3424
|
function X(me, de, ce, ge, B, Q) {
|
|
3425
|
-
var
|
|
3425
|
+
var ne = me[de], le = se(ne);
|
|
3426
3426
|
if (le !== L) {
|
|
3427
|
-
var ue = ne
|
|
3427
|
+
var ue = re(ne);
|
|
3428
3428
|
return new h(
|
|
3429
3429
|
"Invalid " + ge + " `" + B + "` of type " + ("`" + ue + "` supplied to `" + ce + "`, expected ") + ("`" + L + "`."),
|
|
3430
3430
|
{ expectedType: L }
|
|
@@ -3443,8 +3443,8 @@ function Jp() {
|
|
|
3443
3443
|
return new h("Property `" + B + "` of component `" + ce + "` has invalid PropType notation inside arrayOf.");
|
|
3444
3444
|
var Q = me[de];
|
|
3445
3445
|
if (!Array.isArray(Q)) {
|
|
3446
|
-
var
|
|
3447
|
-
return new h("Invalid " + ge + " `" + B + "` of type " + ("`" +
|
|
3446
|
+
var ne = se(Q);
|
|
3447
|
+
return new h("Invalid " + ge + " `" + B + "` of type " + ("`" + ne + "` supplied to `" + ce + "`, expected an array."));
|
|
3448
3448
|
}
|
|
3449
3449
|
for (var le = 0; le < Q.length; le++) {
|
|
3450
3450
|
var ue = L(Q, le, ce, ge, B + "[" + le + "]", r);
|
|
@@ -3480,24 +3480,24 @@ function Jp() {
|
|
|
3480
3480
|
function R(L) {
|
|
3481
3481
|
function X(me, de, ce, ge, B) {
|
|
3482
3482
|
if (!(me[de] instanceof L)) {
|
|
3483
|
-
var Q = L.name || u,
|
|
3484
|
-
return new h("Invalid " + ge + " `" + B + "` of type " + ("`" +
|
|
3483
|
+
var Q = L.name || u, ne = Y(me[de]);
|
|
3484
|
+
return new h("Invalid " + ge + " `" + B + "` of type " + ("`" + ne + "` supplied to `" + ce + "`, expected ") + ("instance of `" + Q + "`."));
|
|
3485
3485
|
}
|
|
3486
3486
|
return null;
|
|
3487
3487
|
}
|
|
3488
3488
|
return w(X);
|
|
3489
3489
|
}
|
|
3490
|
-
function
|
|
3490
|
+
function M(L) {
|
|
3491
3491
|
if (!Array.isArray(L))
|
|
3492
3492
|
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? a(
|
|
3493
3493
|
"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])."
|
|
3494
3494
|
) : a("Invalid argument supplied to oneOf, expected an array.")), o;
|
|
3495
3495
|
function X(me, de, ce, ge, B) {
|
|
3496
|
-
for (var Q = me[de],
|
|
3497
|
-
if (E(Q, L[
|
|
3496
|
+
for (var Q = me[de], ne = 0; ne < L.length; ne++)
|
|
3497
|
+
if (E(Q, L[ne]))
|
|
3498
3498
|
return null;
|
|
3499
3499
|
var le = JSON.stringify(L, function(we, G) {
|
|
3500
|
-
var ze =
|
|
3500
|
+
var ze = re(G);
|
|
3501
3501
|
return ze === "symbol" ? String(G) : G;
|
|
3502
3502
|
});
|
|
3503
3503
|
return new h("Invalid " + ge + " `" + B + "` of value `" + String(Q) + "` " + ("supplied to `" + ce + "`, expected one of " + le + "."));
|
|
@@ -3508,9 +3508,9 @@ function Jp() {
|
|
|
3508
3508
|
function X(me, de, ce, ge, B) {
|
|
3509
3509
|
if (typeof L != "function")
|
|
3510
3510
|
return new h("Property `" + B + "` of component `" + ce + "` has invalid PropType notation inside objectOf.");
|
|
3511
|
-
var Q = me[de],
|
|
3512
|
-
if (
|
|
3513
|
-
return new h("Invalid " + ge + " `" + B + "` of type " + ("`" +
|
|
3511
|
+
var Q = me[de], ne = se(Q);
|
|
3512
|
+
if (ne !== "object")
|
|
3513
|
+
return new h("Invalid " + ge + " `" + B + "` of type " + ("`" + ne + "` supplied to `" + ce + "`, expected an object."));
|
|
3514
3514
|
for (var le in Q)
|
|
3515
3515
|
if (n(Q, le)) {
|
|
3516
3516
|
var ue = L(Q, le, ce, ge, B + "." + le, r);
|
|
@@ -3531,15 +3531,15 @@ function Jp() {
|
|
|
3531
3531
|
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + pe(me) + " at index " + X + "."
|
|
3532
3532
|
), o;
|
|
3533
3533
|
}
|
|
3534
|
-
function de(ce, ge, B, Q,
|
|
3534
|
+
function de(ce, ge, B, Q, ne) {
|
|
3535
3535
|
for (var le = [], ue = 0; ue < L.length; ue++) {
|
|
3536
|
-
var we = L[ue], G = we(ce, ge, B, Q,
|
|
3536
|
+
var we = L[ue], G = we(ce, ge, B, Q, ne, r);
|
|
3537
3537
|
if (G == null)
|
|
3538
3538
|
return null;
|
|
3539
3539
|
G.data && n(G.data, "expectedType") && le.push(G.data.expectedType);
|
|
3540
3540
|
}
|
|
3541
3541
|
var ze = le.length > 0 ? ", expected one of type [" + le.join(", ") + "]" : "";
|
|
3542
|
-
return new h("Invalid " + Q + " `" +
|
|
3542
|
+
return new h("Invalid " + Q + " `" + ne + "` supplied to " + ("`" + B + "`" + ze + "."));
|
|
3543
3543
|
}
|
|
3544
3544
|
return w(de);
|
|
3545
3545
|
}
|
|
@@ -3556,13 +3556,13 @@ function Jp() {
|
|
|
3556
3556
|
}
|
|
3557
3557
|
function z(L) {
|
|
3558
3558
|
function X(me, de, ce, ge, B) {
|
|
3559
|
-
var Q = me[de],
|
|
3560
|
-
if (
|
|
3561
|
-
return new h("Invalid " + ge + " `" + B + "` of type `" +
|
|
3559
|
+
var Q = me[de], ne = se(Q);
|
|
3560
|
+
if (ne !== "object")
|
|
3561
|
+
return new h("Invalid " + ge + " `" + B + "` of type `" + ne + "` " + ("supplied to `" + ce + "`, expected `object`."));
|
|
3562
3562
|
for (var le in L) {
|
|
3563
3563
|
var ue = L[le];
|
|
3564
3564
|
if (typeof ue != "function")
|
|
3565
|
-
return $(ce, ge, B, le,
|
|
3565
|
+
return $(ce, ge, B, le, re(ue));
|
|
3566
3566
|
var we = ue(Q, le, ce, ge, B + "." + le, r);
|
|
3567
3567
|
if (we)
|
|
3568
3568
|
return we;
|
|
@@ -3573,14 +3573,14 @@ function Jp() {
|
|
|
3573
3573
|
}
|
|
3574
3574
|
function F(L) {
|
|
3575
3575
|
function X(me, de, ce, ge, B) {
|
|
3576
|
-
var Q = me[de],
|
|
3577
|
-
if (
|
|
3578
|
-
return new h("Invalid " + ge + " `" + B + "` of type `" +
|
|
3576
|
+
var Q = me[de], ne = se(Q);
|
|
3577
|
+
if (ne !== "object")
|
|
3578
|
+
return new h("Invalid " + ge + " `" + B + "` of type `" + ne + "` " + ("supplied to `" + ce + "`, expected `object`."));
|
|
3579
3579
|
var le = t({}, me[de], L);
|
|
3580
3580
|
for (var ue in le) {
|
|
3581
3581
|
var we = L[ue];
|
|
3582
3582
|
if (n(L, ue) && typeof we != "function")
|
|
3583
|
-
return $(ce, ge, B, ue,
|
|
3583
|
+
return $(ce, ge, B, ue, re(we));
|
|
3584
3584
|
if (!we)
|
|
3585
3585
|
return new h(
|
|
3586
3586
|
"Invalid " + ge + " `" + B + "` key `" + ue + "` supplied to `" + ce + "`.\nBad object: " + JSON.stringify(me[de], null, " ") + `
|
|
@@ -3634,7 +3634,7 @@ Valid keys: ` + JSON.stringify(Object.keys(L), null, " ")
|
|
|
3634
3634
|
var X = typeof L;
|
|
3635
3635
|
return Array.isArray(L) ? "array" : L instanceof RegExp ? "object" : te(X, L) ? "symbol" : X;
|
|
3636
3636
|
}
|
|
3637
|
-
function
|
|
3637
|
+
function re(L) {
|
|
3638
3638
|
if (typeof L > "u" || L === null)
|
|
3639
3639
|
return "" + L;
|
|
3640
3640
|
var X = se(L);
|
|
@@ -3647,7 +3647,7 @@ Valid keys: ` + JSON.stringify(Object.keys(L), null, " ")
|
|
|
3647
3647
|
return X;
|
|
3648
3648
|
}
|
|
3649
3649
|
function pe(L) {
|
|
3650
|
-
var X =
|
|
3650
|
+
var X = re(L);
|
|
3651
3651
|
switch (X) {
|
|
3652
3652
|
case "array":
|
|
3653
3653
|
case "object":
|
|
@@ -3660,7 +3660,7 @@ Valid keys: ` + JSON.stringify(Object.keys(L), null, " ")
|
|
|
3660
3660
|
return X;
|
|
3661
3661
|
}
|
|
3662
3662
|
}
|
|
3663
|
-
function
|
|
3663
|
+
function Y(L) {
|
|
3664
3664
|
return !L.constructor || !L.constructor.name ? u : L.constructor.name;
|
|
3665
3665
|
}
|
|
3666
3666
|
return v.checkPropTypes = i, v.resetWarningCache = i.resetWarningCache, v.PropTypes = v, v;
|
|
@@ -5212,8 +5212,8 @@ function Sf(e = {}) {
|
|
|
5212
5212
|
if (C.__emotion_real === C)
|
|
5213
5213
|
return C;
|
|
5214
5214
|
if (typeof C == "function")
|
|
5215
|
-
return function(
|
|
5216
|
-
return ui(
|
|
5215
|
+
return function(M) {
|
|
5216
|
+
return ui(M, C);
|
|
5217
5217
|
};
|
|
5218
5218
|
if (Ht(C)) {
|
|
5219
5219
|
const R = xc(C);
|
|
@@ -5223,10 +5223,10 @@ function Sf(e = {}) {
|
|
|
5223
5223
|
}
|
|
5224
5224
|
return C;
|
|
5225
5225
|
}, T = (...C) => {
|
|
5226
|
-
const R = [],
|
|
5226
|
+
const R = [], M = C.map(P), _ = [];
|
|
5227
5227
|
if (R.push(a), p && v && _.push(function(z) {
|
|
5228
|
-
var se,
|
|
5229
|
-
const V = (
|
|
5228
|
+
var se, re;
|
|
5229
|
+
const V = (re = (se = z.theme.components) == null ? void 0 : se[p]) == null ? void 0 : re.styleOverrides;
|
|
5230
5230
|
if (!V)
|
|
5231
5231
|
return null;
|
|
5232
5232
|
const te = {};
|
|
@@ -5237,12 +5237,12 @@ function Sf(e = {}) {
|
|
|
5237
5237
|
var te, se;
|
|
5238
5238
|
const F = z.theme, V = (se = (te = F == null ? void 0 : F.components) == null ? void 0 : te[p]) == null ? void 0 : se.variants;
|
|
5239
5239
|
return V ? bc(z, V) : null;
|
|
5240
|
-
}), w || _.push(bn), Array.isArray(
|
|
5241
|
-
const $ =
|
|
5240
|
+
}), w || _.push(bn), Array.isArray(M[0])) {
|
|
5241
|
+
const $ = M.shift(), z = new Array(R.length).fill(""), F = new Array(_.length).fill("");
|
|
5242
5242
|
let V;
|
|
5243
5243
|
V = [...z, ...$, ...F], V.raw = [...z, ...$.raw, ...F], R.unshift(V);
|
|
5244
5244
|
}
|
|
5245
|
-
const D = [...R, ...
|
|
5245
|
+
const D = [...R, ...M, ..._], c = S(...D);
|
|
5246
5246
|
return s.muiName && (c.muiName = s.muiName), process.env.NODE_ENV !== "production" && (c.displayName = Cf(p, m, s)), c;
|
|
5247
5247
|
};
|
|
5248
5248
|
return S.withConfig && (T.withConfig = S.withConfig), T;
|
|
@@ -5535,9 +5535,9 @@ function Vf(e, t = {}) {
|
|
|
5535
5535
|
const {
|
|
5536
5536
|
vars: C,
|
|
5537
5537
|
css: R,
|
|
5538
|
-
varsWithDefaults:
|
|
5538
|
+
varsWithDefaults: M
|
|
5539
5539
|
} = ga(T, t);
|
|
5540
|
-
u = wt(u,
|
|
5540
|
+
u = wt(u, M), v[P] = {
|
|
5541
5541
|
css: R,
|
|
5542
5542
|
vars: C
|
|
5543
5543
|
};
|
|
@@ -5553,12 +5553,12 @@ function Vf(e, t = {}) {
|
|
|
5553
5553
|
};
|
|
5554
5554
|
}
|
|
5555
5555
|
function w(P, T) {
|
|
5556
|
-
var R,
|
|
5556
|
+
var R, M;
|
|
5557
5557
|
let C = i;
|
|
5558
5558
|
if (i === "class" && (C = ".%s"), i === "data" && (C = "[data-%s]"), i != null && i.startsWith("data-") && !i.includes("%s") && (C = `[${i}="%s"]`), P) {
|
|
5559
5559
|
if (C === "media")
|
|
5560
5560
|
return e.defaultColorScheme === P ? ":root" : {
|
|
5561
|
-
[`@media (prefers-color-scheme: ${((
|
|
5561
|
+
[`@media (prefers-color-scheme: ${((M = (R = a[P]) == null ? void 0 : R.palette) == null ? void 0 : M.mode) || P})`]: {
|
|
5562
5562
|
":root": T
|
|
5563
5563
|
}
|
|
5564
5564
|
};
|
|
@@ -5594,7 +5594,7 @@ function Vf(e, t = {}) {
|
|
|
5594
5594
|
}), m);
|
|
5595
5595
|
const {
|
|
5596
5596
|
[T]: R,
|
|
5597
|
-
...
|
|
5597
|
+
...M
|
|
5598
5598
|
} = v;
|
|
5599
5599
|
if (R) {
|
|
5600
5600
|
const {
|
|
@@ -5609,7 +5609,7 @@ function Vf(e, t = {}) {
|
|
|
5609
5609
|
...z
|
|
5610
5610
|
}), z);
|
|
5611
5611
|
}
|
|
5612
|
-
return Object.entries(
|
|
5612
|
+
return Object.entries(M).forEach(([c, {
|
|
5613
5613
|
css: $
|
|
5614
5614
|
}]) => {
|
|
5615
5615
|
var V, te;
|
|
@@ -6401,12 +6401,12 @@ function vm(e = {}, ...t) {
|
|
|
6401
6401
|
getSelector: mm(T)
|
|
6402
6402
|
}, {
|
|
6403
6403
|
vars: R,
|
|
6404
|
-
generateThemeVars:
|
|
6404
|
+
generateThemeVars: M,
|
|
6405
6405
|
generateStyleSheets: _
|
|
6406
6406
|
} = Vf(T, C);
|
|
6407
6407
|
return T.vars = R, Object.entries(T.colorSchemes[T.defaultColorScheme]).forEach(([D, c]) => {
|
|
6408
6408
|
T[D] = c;
|
|
6409
|
-
}), T.generateThemeVars =
|
|
6409
|
+
}), T.generateThemeVars = M, T.generateStyleSheets = _, T.generateSpacing = function() {
|
|
6410
6410
|
return gc(p.spacing, xo(this));
|
|
6411
6411
|
}, T.getColorSchemeSelector = Nf(s), T.spacing = T.generateSpacing(), T.shouldSkipGeneratingVar = o, T.unstable_sxConfig = {
|
|
6412
6412
|
...Kn,
|
|
@@ -7716,7 +7716,7 @@ const At = Br("MuiTouchRipple", ["root", "ripple", "rippleVisible", "ripplePulsa
|
|
|
7716
7716
|
const {
|
|
7717
7717
|
pulsate: C,
|
|
7718
7718
|
rippleX: R,
|
|
7719
|
-
rippleY:
|
|
7719
|
+
rippleY: M,
|
|
7720
7720
|
rippleSize: _,
|
|
7721
7721
|
cb: D
|
|
7722
7722
|
} = T;
|
|
@@ -7732,13 +7732,13 @@ const At = Br("MuiTouchRipple", ["root", "ripple", "rippleVisible", "ripplePulsa
|
|
|
7732
7732
|
timeout: Ka,
|
|
7733
7733
|
pulsate: C,
|
|
7734
7734
|
rippleX: R,
|
|
7735
|
-
rippleY:
|
|
7735
|
+
rippleY: M,
|
|
7736
7736
|
rippleSize: _
|
|
7737
7737
|
}, m.current)]), m.current += 1, f.current = D;
|
|
7738
7738
|
}, [a]), b = ae.useCallback((T = {}, C = {}, R = () => {
|
|
7739
7739
|
}) => {
|
|
7740
7740
|
const {
|
|
7741
|
-
pulsate:
|
|
7741
|
+
pulsate: M = !1,
|
|
7742
7742
|
center: _ = i || C.pulsate,
|
|
7743
7743
|
fakeElement: D = !1
|
|
7744
7744
|
// For test purposes
|
|
@@ -7772,7 +7772,7 @@ const At = Br("MuiTouchRipple", ["root", "ripple", "rippleVisible", "ripplePulsa
|
|
|
7772
7772
|
}
|
|
7773
7773
|
T != null && T.touches ? E.current === null && (E.current = () => {
|
|
7774
7774
|
w({
|
|
7775
|
-
pulsate:
|
|
7775
|
+
pulsate: M,
|
|
7776
7776
|
rippleX: z,
|
|
7777
7777
|
rippleY: F,
|
|
7778
7778
|
rippleSize: V,
|
|
@@ -7781,7 +7781,7 @@ const At = Br("MuiTouchRipple", ["root", "ripple", "rippleVisible", "ripplePulsa
|
|
|
7781
7781
|
}, v.start(oh, () => {
|
|
7782
7782
|
E.current && (E.current(), E.current = null);
|
|
7783
7783
|
})) : w({
|
|
7784
|
-
pulsate:
|
|
7784
|
+
pulsate: M,
|
|
7785
7785
|
rippleX: z,
|
|
7786
7786
|
rippleY: F,
|
|
7787
7787
|
rippleSize: V,
|
|
@@ -7909,7 +7909,7 @@ const fh = Br("MuiButtonBase", ["root", "disabled", "focusVisible"]), mh = (e) =
|
|
|
7909
7909
|
onFocusVisible: T,
|
|
7910
7910
|
onKeyDown: C,
|
|
7911
7911
|
onKeyUp: R,
|
|
7912
|
-
onMouseDown:
|
|
7912
|
+
onMouseDown: M,
|
|
7913
7913
|
onMouseLeave: _,
|
|
7914
7914
|
onMouseUp: D,
|
|
7915
7915
|
onTouchEnd: c,
|
|
@@ -7919,20 +7919,20 @@ const fh = Br("MuiButtonBase", ["root", "disabled", "focusVisible"]), mh = (e) =
|
|
|
7919
7919
|
TouchRippleProps: V,
|
|
7920
7920
|
touchRippleRef: te,
|
|
7921
7921
|
type: se,
|
|
7922
|
-
...
|
|
7923
|
-
} = n, pe = ae.useRef(null),
|
|
7922
|
+
...re
|
|
7923
|
+
} = n, pe = ae.useRef(null), Y = Km(), L = Ks(Y.ref, te), [X, me] = ae.useState(!1);
|
|
7924
7924
|
p && X && me(!1), ae.useImperativeHandle(i, () => ({
|
|
7925
7925
|
focusVisible: () => {
|
|
7926
7926
|
me(!0), pe.current.focus();
|
|
7927
7927
|
}
|
|
7928
7928
|
}), []);
|
|
7929
|
-
const de =
|
|
7929
|
+
const de = Y.shouldMount && !m && !p;
|
|
7930
7930
|
ae.useEffect(() => {
|
|
7931
|
-
X && u && !m &&
|
|
7932
|
-
}, [m, u, X,
|
|
7933
|
-
const ce = Gt(
|
|
7931
|
+
X && u && !m && Y.pulsate();
|
|
7932
|
+
}, [m, u, X, Y]);
|
|
7933
|
+
const ce = Gt(Y, "start", M, f), ge = Gt(Y, "stop", b, f), B = Gt(Y, "stop", S, f), Q = Gt(Y, "stop", D, f), ne = Gt(Y, "stop", (x) => {
|
|
7934
7934
|
X && x.preventDefault(), _ && _(x);
|
|
7935
|
-
}, f), le = Gt(
|
|
7935
|
+
}, f), le = Gt(Y, "start", z, f), ue = Gt(Y, "stop", c, f), we = Gt(Y, "stop", $, f), G = Gt(Y, "stop", (x) => {
|
|
7936
7936
|
Ys(x.target) || me(!1), h && h(x);
|
|
7937
7937
|
}, !1), ze = pi((x) => {
|
|
7938
7938
|
pe.current || (pe.current = x.currentTarget), Ys(x.target) && (me(!0), T && T(x)), P && P(x);
|
|
@@ -7940,19 +7940,19 @@ const fh = Br("MuiButtonBase", ["root", "disabled", "focusVisible"]), mh = (e) =
|
|
|
7940
7940
|
const x = pe.current;
|
|
7941
7941
|
return l && l !== "button" && !(x.tagName === "A" && x.href);
|
|
7942
7942
|
}, Je = pi((x) => {
|
|
7943
|
-
u && !x.repeat && X && x.key === " " &&
|
|
7944
|
-
|
|
7943
|
+
u && !x.repeat && X && x.key === " " && Y.stop(x, () => {
|
|
7944
|
+
Y.start(x);
|
|
7945
7945
|
}), x.target === x.currentTarget && Qe() && x.key === " " && x.preventDefault(), C && C(x), x.target === x.currentTarget && Qe() && x.key === "Enter" && !p && (x.preventDefault(), w && w(x));
|
|
7946
7946
|
}), Et = pi((x) => {
|
|
7947
|
-
u && x.key === " " && X && !x.defaultPrevented &&
|
|
7948
|
-
|
|
7947
|
+
u && x.key === " " && X && !x.defaultPrevented && Y.stop(x, () => {
|
|
7948
|
+
Y.pulsate(x);
|
|
7949
7949
|
}), R && R(x), w && x.target === x.currentTarget && Qe() && x.key === " " && !x.defaultPrevented && w(x);
|
|
7950
7950
|
});
|
|
7951
7951
|
let Ge = l;
|
|
7952
|
-
Ge === "button" && (
|
|
7952
|
+
Ge === "button" && (re.href || re.to) && (Ge = E);
|
|
7953
7953
|
const rt = {};
|
|
7954
|
-
Ge === "button" ? (rt.type = se === void 0 ? "button" : se, rt.disabled = p) : (!
|
|
7955
|
-
const
|
|
7954
|
+
Ge === "button" ? (rt.type = se === void 0 ? "button" : se, rt.disabled = p) : (!re.href && !re.to && (rt.role = "button"), p && (rt["aria-disabled"] = p));
|
|
7955
|
+
const K = Ks(r, pe), y = {
|
|
7956
7956
|
...n,
|
|
7957
7957
|
centerRipple: a,
|
|
7958
7958
|
component: l,
|
|
@@ -7974,17 +7974,17 @@ const fh = Br("MuiButtonBase", ["root", "disabled", "focusVisible"]), mh = (e) =
|
|
|
7974
7974
|
onKeyDown: Je,
|
|
7975
7975
|
onKeyUp: Et,
|
|
7976
7976
|
onMouseDown: ce,
|
|
7977
|
-
onMouseLeave:
|
|
7977
|
+
onMouseLeave: ne,
|
|
7978
7978
|
onMouseUp: Q,
|
|
7979
7979
|
onDragLeave: B,
|
|
7980
7980
|
onTouchEnd: ue,
|
|
7981
7981
|
onTouchMove: we,
|
|
7982
7982
|
onTouchStart: le,
|
|
7983
|
-
ref:
|
|
7983
|
+
ref: K,
|
|
7984
7984
|
tabIndex: p ? -1 : F,
|
|
7985
7985
|
type: se,
|
|
7986
7986
|
...rt,
|
|
7987
|
-
...
|
|
7987
|
+
...re,
|
|
7988
7988
|
children: [o, de ? /* @__PURE__ */ d($c, {
|
|
7989
7989
|
ref: L,
|
|
7990
7990
|
center: a,
|
|
@@ -9654,7 +9654,7 @@ function Ih({
|
|
|
9654
9654
|
}
|
|
9655
9655
|
const z = [...e], [F] = z.splice(w, 1);
|
|
9656
9656
|
z.splice(c, 0, F), b(null), P(null), r(z);
|
|
9657
|
-
},
|
|
9657
|
+
}, M = () => {
|
|
9658
9658
|
b(null), P(null);
|
|
9659
9659
|
}, _ = e.length === 0;
|
|
9660
9660
|
return /* @__PURE__ */ ee(
|
|
@@ -9740,7 +9740,7 @@ function Ih({
|
|
|
9740
9740
|
onDragStart: T($),
|
|
9741
9741
|
onDragOver: C($),
|
|
9742
9742
|
onDrop: R($),
|
|
9743
|
-
onDragEnd:
|
|
9743
|
+
onDragEnd: M,
|
|
9744
9744
|
sx: (V) => ({
|
|
9745
9745
|
userSelect: "none",
|
|
9746
9746
|
cursor: i ? "default" : "grab",
|
|
@@ -10335,7 +10335,7 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10335
10335
|
t.forEach(($) => {
|
|
10336
10336
|
$.value !== void 0 && c[$.key] === void 0 && (c[$.key] = typeof $.value == "function" ? $.value(c, E.length) : $.value);
|
|
10337
10337
|
}), h(c);
|
|
10338
|
-
},
|
|
10338
|
+
}, M = oe.useMemo(() => t.reduce((c, $) => {
|
|
10339
10339
|
if ($.width === "auto" || $.width === void 0)
|
|
10340
10340
|
return c + 120;
|
|
10341
10341
|
const z = typeof $.width == "number" ? $.width : typeof $.width == "string" && parseInt($.width) || 160;
|
|
@@ -10518,7 +10518,7 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10518
10518
|
{
|
|
10519
10519
|
stickyHeader: !0,
|
|
10520
10520
|
sx: {
|
|
10521
|
-
minWidth: `${
|
|
10521
|
+
minWidth: `${M || 650}px`
|
|
10522
10522
|
},
|
|
10523
10523
|
children: [
|
|
10524
10524
|
/* @__PURE__ */ d($u, { children: /* @__PURE__ */ ee(Wo, { children: [
|
|
@@ -10568,7 +10568,7 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10568
10568
|
var pe;
|
|
10569
10569
|
const V = `${e}.${c}.${F.key}`, te = F.type === "rowSelect" || F.key === b, se = te ? !1 : z ? !0 : typeof F.disabled == "function" ? F.disabled(D, c) : !!F.disabled;
|
|
10570
10570
|
if (F.type === "index") {
|
|
10571
|
-
const
|
|
10571
|
+
const Y = F.indexFormat ? F.indexFormat(c) : `#${c + 1}`;
|
|
10572
10572
|
return /* @__PURE__ */ d(
|
|
10573
10573
|
Ur,
|
|
10574
10574
|
{
|
|
@@ -10581,13 +10581,13 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10581
10581
|
..._(F),
|
|
10582
10582
|
...F.cellSx
|
|
10583
10583
|
},
|
|
10584
|
-
children:
|
|
10584
|
+
children: Y
|
|
10585
10585
|
},
|
|
10586
10586
|
F.key
|
|
10587
10587
|
);
|
|
10588
10588
|
}
|
|
10589
10589
|
if (F.value !== void 0 && F.editable === !1) {
|
|
10590
|
-
const
|
|
10590
|
+
const Y = typeof F.value == "function" ? F.value(D, c) : F.value;
|
|
10591
10591
|
return /* @__PURE__ */ d(
|
|
10592
10592
|
Ur,
|
|
10593
10593
|
{
|
|
@@ -10599,12 +10599,12 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10599
10599
|
..._(F),
|
|
10600
10600
|
...F.cellSx
|
|
10601
10601
|
},
|
|
10602
|
-
children:
|
|
10602
|
+
children: Y
|
|
10603
10603
|
},
|
|
10604
10604
|
F.key
|
|
10605
10605
|
);
|
|
10606
10606
|
}
|
|
10607
|
-
const
|
|
10607
|
+
const re = F.endorsementText ? typeof F.endorsementText == "function" ? F.endorsementText(D, c) : F.endorsementText : void 0;
|
|
10608
10608
|
return /* @__PURE__ */ d(
|
|
10609
10609
|
Ur,
|
|
10610
10610
|
{
|
|
@@ -10622,14 +10622,14 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10622
10622
|
name: V,
|
|
10623
10623
|
control: a,
|
|
10624
10624
|
defaultValue: !1,
|
|
10625
|
-
render: ({ field:
|
|
10625
|
+
render: ({ field: Y }) => /* @__PURE__ */ d(
|
|
10626
10626
|
xr,
|
|
10627
10627
|
{
|
|
10628
10628
|
label: "",
|
|
10629
|
-
checked: !!
|
|
10629
|
+
checked: !!Y.value,
|
|
10630
10630
|
disabled: !1,
|
|
10631
10631
|
onChange: (L) => {
|
|
10632
|
-
|
|
10632
|
+
Y.onChange(L), C(c, L);
|
|
10633
10633
|
},
|
|
10634
10634
|
sx: F.sx
|
|
10635
10635
|
}
|
|
@@ -10640,13 +10640,13 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10640
10640
|
{
|
|
10641
10641
|
name: V,
|
|
10642
10642
|
control: a,
|
|
10643
|
-
render: ({ field:
|
|
10643
|
+
render: ({ field: Y }) => /* @__PURE__ */ d(
|
|
10644
10644
|
xr,
|
|
10645
10645
|
{
|
|
10646
10646
|
label: "",
|
|
10647
|
-
checked: !!
|
|
10647
|
+
checked: !!Y.value,
|
|
10648
10648
|
disabled: se,
|
|
10649
|
-
onChange:
|
|
10649
|
+
onChange: Y.onChange,
|
|
10650
10650
|
sx: F.sx
|
|
10651
10651
|
}
|
|
10652
10652
|
)
|
|
@@ -10656,10 +10656,10 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10656
10656
|
{
|
|
10657
10657
|
name: V,
|
|
10658
10658
|
control: a,
|
|
10659
|
-
render: ({ field:
|
|
10659
|
+
render: ({ field: Y }) => /* @__PURE__ */ d(
|
|
10660
10660
|
$o,
|
|
10661
10661
|
{
|
|
10662
|
-
...
|
|
10662
|
+
...Y,
|
|
10663
10663
|
fullWidth: !0,
|
|
10664
10664
|
disabled: se,
|
|
10665
10665
|
options: F.options || [],
|
|
@@ -10681,8 +10681,8 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10681
10681
|
name: V,
|
|
10682
10682
|
control: a,
|
|
10683
10683
|
defaultValue: F.value !== void 0 ? typeof F.value == "function" ? F.value(D, c) : F.value : void 0,
|
|
10684
|
-
render: ({ field:
|
|
10685
|
-
if (f && (
|
|
10684
|
+
render: ({ field: Y }) => (oe.useEffect(() => {
|
|
10685
|
+
if (f && (Y.value === void 0 || Y.value === null || Y.value === "") && F.value !== void 0) {
|
|
10686
10686
|
const L = typeof F.value == "function" ? F.value(D, c) : F.value;
|
|
10687
10687
|
f(V, L, {
|
|
10688
10688
|
shouldValidate: !1
|
|
@@ -10690,7 +10690,7 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10690
10690
|
}
|
|
10691
10691
|
}, [
|
|
10692
10692
|
V,
|
|
10693
|
-
|
|
10693
|
+
Y.value,
|
|
10694
10694
|
F.value,
|
|
10695
10695
|
D,
|
|
10696
10696
|
c,
|
|
@@ -10698,7 +10698,7 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10698
10698
|
]), /* @__PURE__ */ d(
|
|
10699
10699
|
Ic,
|
|
10700
10700
|
{
|
|
10701
|
-
...
|
|
10701
|
+
...Y,
|
|
10702
10702
|
fullWidth: !0,
|
|
10703
10703
|
disabled: se,
|
|
10704
10704
|
size: "small",
|
|
@@ -10720,8 +10720,8 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10720
10720
|
name: V,
|
|
10721
10721
|
control: a,
|
|
10722
10722
|
defaultValue: F.value !== void 0 ? typeof F.value == "function" ? F.value(D, c) : F.value : void 0,
|
|
10723
|
-
render: ({ field:
|
|
10724
|
-
if (f && (
|
|
10723
|
+
render: ({ field: Y }) => (oe.useEffect(() => {
|
|
10724
|
+
if (f && (Y.value === void 0 || Y.value === null || Y.value === "") && F.value !== void 0) {
|
|
10725
10725
|
const L = typeof F.value == "function" ? F.value(D, c) : F.value;
|
|
10726
10726
|
f(V, L, {
|
|
10727
10727
|
shouldValidate: !1
|
|
@@ -10729,7 +10729,7 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10729
10729
|
}
|
|
10730
10730
|
}, [
|
|
10731
10731
|
V,
|
|
10732
|
-
|
|
10732
|
+
Y.value,
|
|
10733
10733
|
F.value,
|
|
10734
10734
|
D,
|
|
10735
10735
|
c,
|
|
@@ -10737,7 +10737,7 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10737
10737
|
]), /* @__PURE__ */ d(
|
|
10738
10738
|
Pt,
|
|
10739
10739
|
{
|
|
10740
|
-
...
|
|
10740
|
+
...Y,
|
|
10741
10741
|
fullWidth: !0,
|
|
10742
10742
|
type: F.type === "number" ? "number" : "text",
|
|
10743
10743
|
placeholder: F.placeholder,
|
|
@@ -10751,7 +10751,7 @@ const Mh = Ct(Pl)(() => ({
|
|
|
10751
10751
|
},
|
|
10752
10752
|
helperText: F.helperText,
|
|
10753
10753
|
required: F.required,
|
|
10754
|
-
endorsementText:
|
|
10754
|
+
endorsementText: re,
|
|
10755
10755
|
endorsementBg: F.endorsementBg,
|
|
10756
10756
|
endorsementColor: F.endorsementColor,
|
|
10757
10757
|
endorsementRadius: F.endorsementRadius,
|
|
@@ -11355,8 +11355,8 @@ async function Wh(e, t, r, n) {
|
|
|
11355
11355
|
if (t && !i.startsWith("http") && (v = `${t}${i.startsWith("/") ? i : `/${i}`}`), n) {
|
|
11356
11356
|
const T = /\{([^}]+)\}/g;
|
|
11357
11357
|
v = v.replace(T, (C, R) => {
|
|
11358
|
-
const
|
|
11359
|
-
return
|
|
11358
|
+
const M = n[R];
|
|
11359
|
+
return M != null ? encodeURIComponent(String(M)) : "";
|
|
11360
11360
|
}), v = v.replace(/\?&/g, "?").replace(/&&/g, "&").replace(/\?$/g, "");
|
|
11361
11361
|
}
|
|
11362
11362
|
const E = new URLSearchParams();
|
|
@@ -11365,8 +11365,8 @@ async function Wh(e, t, r, n) {
|
|
|
11365
11365
|
}), E.toString() && (v += `${v.includes("?") ? "&" : "?"}${E.toString()}`);
|
|
11366
11366
|
try {
|
|
11367
11367
|
const T = /^https?:\/\//i.test(v), C = new URL(v, T ? void 0 : "http://local.placeholder"), R = Array.from(C.searchParams.entries());
|
|
11368
|
-
for (const [
|
|
11369
|
-
(_ === "" || _ === "undefined" || _ === "null") && C.searchParams.delete(
|
|
11368
|
+
for (const [M, _] of R)
|
|
11369
|
+
(_ === "" || _ === "undefined" || _ === "null") && C.searchParams.delete(M);
|
|
11370
11370
|
T ? v = C.toString() : v = C.pathname + (C.search ? C.search : ""), v = v.replace(/\?&/g, "?").replace(/&&/g, "&").replace(/\?$/g, "");
|
|
11371
11371
|
} catch {
|
|
11372
11372
|
}
|
|
@@ -11394,8 +11394,8 @@ async function Wh(e, t, r, n) {
|
|
|
11394
11394
|
value: T[o] || T.id || T.value || ""
|
|
11395
11395
|
}, R = Array.isArray(u) ? u : void 0;
|
|
11396
11396
|
if (Array.isArray(R))
|
|
11397
|
-
for (const
|
|
11398
|
-
T[
|
|
11397
|
+
for (const M of R)
|
|
11398
|
+
T[M] !== void 0 && (C[M] = T[M]);
|
|
11399
11399
|
return C;
|
|
11400
11400
|
});
|
|
11401
11401
|
} catch (i) {
|
|
@@ -11475,7 +11475,7 @@ const Nc = ({
|
|
|
11475
11475
|
setValue: o
|
|
11476
11476
|
}) => {
|
|
11477
11477
|
const s = r[e.name], l = !!s, [p, m] = Ft(!1), f = xt(!1), [u, v] = Ft(!1), [E, h] = Ft(!1), [w, b] = Ft(!1), S = xt(null), P = xt(null), T = () => {
|
|
11478
|
-
var
|
|
11478
|
+
var ne;
|
|
11479
11479
|
const B = e.required;
|
|
11480
11480
|
if (typeof B == "function")
|
|
11481
11481
|
try {
|
|
@@ -11484,7 +11484,7 @@ const Nc = ({
|
|
|
11484
11484
|
return !1;
|
|
11485
11485
|
}
|
|
11486
11486
|
if (B !== void 0) return !!B;
|
|
11487
|
-
const Q = (
|
|
11487
|
+
const Q = (ne = e.validation) == null ? void 0 : ne.required;
|
|
11488
11488
|
if (typeof Q == "function")
|
|
11489
11489
|
try {
|
|
11490
11490
|
return !!Q(a || {});
|
|
@@ -11503,7 +11503,7 @@ const Nc = ({
|
|
|
11503
11503
|
return e.value;
|
|
11504
11504
|
}
|
|
11505
11505
|
return e.type === "checkbox" ? !1 : e.type === "select" && e.default ? e.default : e.type === "autocomplete" && e.multiple ? [] : "";
|
|
11506
|
-
},
|
|
11506
|
+
}, M = xt(void 0);
|
|
11507
11507
|
zt(() => {
|
|
11508
11508
|
const B = e.value;
|
|
11509
11509
|
if (typeof B != "function" || !o) return;
|
|
@@ -11513,10 +11513,10 @@ const Nc = ({
|
|
|
11513
11513
|
} catch {
|
|
11514
11514
|
return;
|
|
11515
11515
|
}
|
|
11516
|
-
const
|
|
11517
|
-
if (
|
|
11516
|
+
const ne = a ? a[e.name] : void 0;
|
|
11517
|
+
if (M.current === void 0 && (M.current = Q), ne === void 0 || ne === M.current)
|
|
11518
11518
|
try {
|
|
11519
|
-
o(e.name, Q, { shouldValidate: !0, shouldDirty: !1 }),
|
|
11519
|
+
o(e.name, Q, { shouldValidate: !0, shouldDirty: !1 }), M.current = Q;
|
|
11520
11520
|
} catch {
|
|
11521
11521
|
}
|
|
11522
11522
|
}, [
|
|
@@ -11539,8 +11539,8 @@ const Nc = ({
|
|
|
11539
11539
|
e.passThroughFields
|
|
11540
11540
|
]), D = xt(null), c = _ != null && _.dependsOn ? a == null ? void 0 : a[_.dependsOn] : null, $ = qe(() => {
|
|
11541
11541
|
if (!(_ != null && _.dependsOn)) return !1;
|
|
11542
|
-
const B = c, Q = D.current,
|
|
11543
|
-
return
|
|
11542
|
+
const B = c, Q = D.current, ne = B !== Q;
|
|
11543
|
+
return ne && (D.current = B), ne;
|
|
11544
11544
|
}, [_ == null ? void 0 : _.dependsOn, c]), z = qe(() => {
|
|
11545
11545
|
const B = e.showWhen;
|
|
11546
11546
|
if (typeof B == "function")
|
|
@@ -11550,8 +11550,8 @@ const Nc = ({
|
|
|
11550
11550
|
return !0;
|
|
11551
11551
|
}
|
|
11552
11552
|
if (B && typeof B == "object") {
|
|
11553
|
-
const Q = B.field,
|
|
11554
|
-
if (Q && typeof
|
|
11553
|
+
const Q = B.field, ne = B.equals, le = B.in, ue = Q ? (a || {})[Q] : void 0;
|
|
11554
|
+
if (Q && typeof ne < "u") return ue === ne;
|
|
11555
11555
|
if (Q && Array.isArray(le)) return le.includes(ue);
|
|
11556
11556
|
}
|
|
11557
11557
|
return !0;
|
|
@@ -11565,7 +11565,7 @@ const Nc = ({
|
|
|
11565
11565
|
}
|
|
11566
11566
|
return e.endorsementText;
|
|
11567
11567
|
}, [e, a]), V = Re(() => {
|
|
11568
|
-
const B = e.endAdornment, Q = e.endAdornmentSwitch,
|
|
11568
|
+
const B = e.endAdornment, Q = e.endAdornmentSwitch, ne = e.endAdornmentCheckbox;
|
|
11569
11569
|
if (Q)
|
|
11570
11570
|
return /* @__PURE__ */ d(
|
|
11571
11571
|
De,
|
|
@@ -11587,11 +11587,11 @@ const Nc = ({
|
|
|
11587
11587
|
)
|
|
11588
11588
|
}
|
|
11589
11589
|
);
|
|
11590
|
-
if (
|
|
11590
|
+
if (ne)
|
|
11591
11591
|
return /* @__PURE__ */ d(
|
|
11592
11592
|
De,
|
|
11593
11593
|
{
|
|
11594
|
-
name:
|
|
11594
|
+
name: ne,
|
|
11595
11595
|
control: t,
|
|
11596
11596
|
defaultValue: e.endAdornmentCheckboxDefault ?? !1,
|
|
11597
11597
|
render: ({ field: le }) => /* @__PURE__ */ d(
|
|
@@ -11618,15 +11618,15 @@ const Nc = ({
|
|
|
11618
11618
|
if (!a) return B;
|
|
11619
11619
|
const Q = (_ == null ? void 0 : _.endpoint) || (e == null ? void 0 : e.api_endpoint);
|
|
11620
11620
|
if (Q && typeof Q == "string") {
|
|
11621
|
-
const
|
|
11622
|
-
for (const le of
|
|
11621
|
+
const ne = Q.match(/\{([^}]+)\}/g) || [];
|
|
11622
|
+
for (const le of ne) {
|
|
11623
11623
|
const ue = le.slice(1, -1), we = a[ue];
|
|
11624
11624
|
we !== void 0 && (B[ue] = we);
|
|
11625
11625
|
}
|
|
11626
11626
|
}
|
|
11627
11627
|
if (_ != null && _.dependsOn) {
|
|
11628
|
-
const
|
|
11629
|
-
le !== void 0 && (B[
|
|
11628
|
+
const ne = _.dependsOn, le = a[ne];
|
|
11629
|
+
le !== void 0 && (B[ne] = le);
|
|
11630
11630
|
}
|
|
11631
11631
|
return B;
|
|
11632
11632
|
}, [
|
|
@@ -11635,9 +11635,9 @@ const Nc = ({
|
|
|
11635
11635
|
_ == null ? void 0 : _.dependsOn,
|
|
11636
11636
|
a
|
|
11637
11637
|
]), {
|
|
11638
|
-
data:
|
|
11638
|
+
data: re = [],
|
|
11639
11639
|
isLoading: pe,
|
|
11640
|
-
error:
|
|
11640
|
+
error: Y
|
|
11641
11641
|
} = Uh(
|
|
11642
11642
|
_,
|
|
11643
11643
|
n,
|
|
@@ -11658,8 +11658,8 @@ const Nc = ({
|
|
|
11658
11658
|
}, [e, a]), zt(() => {
|
|
11659
11659
|
Xr(e) && (_ != null && _.dependsOn) && $ && f.current && (f.current = !1, m(!1));
|
|
11660
11660
|
}, [$, _ == null ? void 0 : _.dependsOn]);
|
|
11661
|
-
const me = Re(() => Xr(e) ?
|
|
11662
|
-
var B, Q,
|
|
11661
|
+
const me = Re(() => Xr(e) ? re : e.type === "select" || e.type === "toggle" || e.type === "radio" || e.type === "autocomplete" ? e.options || [] : [], [e, re]), de = () => {
|
|
11662
|
+
var B, Q, ne, le, ue, we;
|
|
11663
11663
|
switch (e.type) {
|
|
11664
11664
|
case "title":
|
|
11665
11665
|
return /* @__PURE__ */ d(
|
|
@@ -11697,8 +11697,8 @@ const Nc = ({
|
|
|
11697
11697
|
}
|
|
11698
11698
|
), Et = (g) => {
|
|
11699
11699
|
if (e.cardWrap) {
|
|
11700
|
-
const
|
|
11701
|
-
return /* @__PURE__ */ d(mt, { sx:
|
|
11700
|
+
const j = { ...{ px: 2, py: 1, boxShadow: "none", border: "1px solid #DDDDDD" }, ...e.cardSx };
|
|
11701
|
+
return /* @__PURE__ */ d(mt, { sx: j, ...e.cardProps, children: g });
|
|
11702
11702
|
}
|
|
11703
11703
|
return g;
|
|
11704
11704
|
};
|
|
@@ -11721,19 +11721,19 @@ const Nc = ({
|
|
|
11721
11721
|
{
|
|
11722
11722
|
name: e.name,
|
|
11723
11723
|
control: t,
|
|
11724
|
-
defaultValue: e.defaultValue ?? (typeof ((Q = (B = e.items) == null ? void 0 : B[0]) == null ? void 0 : Q.value) == "string" || typeof ((le = (
|
|
11724
|
+
defaultValue: e.defaultValue ?? (typeof ((Q = (B = e.items) == null ? void 0 : B[0]) == null ? void 0 : Q.value) == "string" || typeof ((le = (ne = e.items) == null ? void 0 : ne[0]) == null ? void 0 : le.value) == "number" ? (we = (ue = e.items) == null ? void 0 : ue[0]) == null ? void 0 : we.value : 0),
|
|
11725
11725
|
render: ({ field: g }) => {
|
|
11726
|
-
const x = e.items || [],
|
|
11726
|
+
const x = e.items || [], j = x.map((Z, q) => ({
|
|
11727
11727
|
label: Z.label,
|
|
11728
11728
|
value: typeof Z.value == "string" || typeof Z.value == "number" ? Z.value : q,
|
|
11729
11729
|
content: Z.content,
|
|
11730
11730
|
disabled: Z.disabled
|
|
11731
|
-
})),
|
|
11732
|
-
if (typeof
|
|
11733
|
-
const Z = x.findIndex((q, ye) => typeof q.value == "string" || typeof q.value == "number" ? q.value ===
|
|
11731
|
+
})), A = g.value, I = (() => {
|
|
11732
|
+
if (typeof A == "string" || typeof A == "number") {
|
|
11733
|
+
const Z = x.findIndex((q, ye) => typeof q.value == "string" || typeof q.value == "number" ? q.value === A : ye === A);
|
|
11734
11734
|
return Z >= 0 ? Z : 0;
|
|
11735
11735
|
}
|
|
11736
|
-
return Number(
|
|
11736
|
+
return Number(A) || 0;
|
|
11737
11737
|
})(), H = x[I] || {};
|
|
11738
11738
|
return /* @__PURE__ */ ee(W, { children: [
|
|
11739
11739
|
/* @__PURE__ */ d(
|
|
@@ -11741,7 +11741,7 @@ const Nc = ({
|
|
|
11741
11741
|
{
|
|
11742
11742
|
value: g.value,
|
|
11743
11743
|
onChange: g.onChange,
|
|
11744
|
-
items:
|
|
11744
|
+
items: j,
|
|
11745
11745
|
ariaLabel: e.ariaLabel || e.label,
|
|
11746
11746
|
sx: e.sx,
|
|
11747
11747
|
tabSx: e.tabSx
|
|
@@ -11846,17 +11846,17 @@ const Nc = ({
|
|
|
11846
11846
|
control: t,
|
|
11847
11847
|
defaultValue: e.items || [],
|
|
11848
11848
|
render: ({ field: g }) => {
|
|
11849
|
-
const x = e,
|
|
11849
|
+
const x = e, j = g.value || x.items || [], A = typeof x.getId == "function" ? x.getId : typeof x.getId == "string" ? (Z) => Z[x.getId] : (Z) => Z.id ?? Z._id ?? Z.key ?? String(Z), I = typeof x.getText == "function" ? x.getText : typeof x.getText == "string" ? (Z) => Z[x.getText] ?? String(Z) : (Z) => Z.text ?? Z.label ?? Z.name ?? Z.title ?? String(Z), H = (() => {
|
|
11850
11850
|
if (typeof x.chipText == "function")
|
|
11851
11851
|
return x.chipText;
|
|
11852
11852
|
if (typeof x.chipText == "string")
|
|
11853
|
-
return
|
|
11853
|
+
return j.length > 0 && j[0] && x.chipText in j[0] ? (Z, q) => Z[x.chipText] ?? void 0 : x.chipText;
|
|
11854
11854
|
})();
|
|
11855
11855
|
return /* @__PURE__ */ d(
|
|
11856
11856
|
Ih,
|
|
11857
11857
|
{
|
|
11858
|
-
items:
|
|
11859
|
-
getId:
|
|
11858
|
+
items: j,
|
|
11859
|
+
getId: A,
|
|
11860
11860
|
onReorder: (Z) => {
|
|
11861
11861
|
g.onChange(Z);
|
|
11862
11862
|
},
|
|
@@ -11987,8 +11987,8 @@ const Nc = ({
|
|
|
11987
11987
|
disabled: e.disabled || pe,
|
|
11988
11988
|
placeholder: e.labelPosition === "inner" || e.labelPosition === "none" || !e.labelPosition ? e.placeholder || (e.labelPosition === "none" ? C(e.label) : void 0) : e.placeholder,
|
|
11989
11989
|
loading: pe,
|
|
11990
|
-
error: l || !!
|
|
11991
|
-
helperText: (s == null ? void 0 : s.message) || (
|
|
11990
|
+
error: l || !!Y,
|
|
11991
|
+
helperText: (s == null ? void 0 : s.message) || (Y == null ? void 0 : Y.message) || e.helperText,
|
|
11992
11992
|
onOpen: L
|
|
11993
11993
|
}
|
|
11994
11994
|
)
|
|
@@ -12101,7 +12101,7 @@ const Nc = ({
|
|
|
12101
12101
|
}
|
|
12102
12102
|
);
|
|
12103
12103
|
case "autocomplete":
|
|
12104
|
-
const
|
|
12104
|
+
const K = me(), y = !!(e.disabled || pe || _ != null && _.dependsOn && !c);
|
|
12105
12105
|
return /* @__PURE__ */ d(
|
|
12106
12106
|
De,
|
|
12107
12107
|
{
|
|
@@ -12109,27 +12109,27 @@ const Nc = ({
|
|
|
12109
12109
|
control: t,
|
|
12110
12110
|
defaultValue: R(),
|
|
12111
12111
|
render: ({ field: g }) => {
|
|
12112
|
-
const x = g.value,
|
|
12112
|
+
const x = g.value, j = e.multiple === !0, A = (_ == null ? void 0 : _.valueField) || e.value_field || "value", I = (_ == null ? void 0 : _.labelField) || e.label_field || "label", H = (q) => {
|
|
12113
12113
|
if (q != null) {
|
|
12114
12114
|
if (typeof q == "string" || typeof q == "number")
|
|
12115
12115
|
return q;
|
|
12116
12116
|
if (typeof q == "object") {
|
|
12117
|
-
if (q[
|
|
12118
|
-
return q[
|
|
12117
|
+
if (q[A] !== void 0)
|
|
12118
|
+
return q[A];
|
|
12119
12119
|
if (q.value !== void 0)
|
|
12120
12120
|
return q.value;
|
|
12121
12121
|
if (q.id !== void 0) return q.id;
|
|
12122
12122
|
}
|
|
12123
12123
|
}
|
|
12124
12124
|
}, Z = (() => {
|
|
12125
|
-
if (
|
|
12125
|
+
if (j)
|
|
12126
12126
|
return (Array.isArray(x) ? x : []).map((ye) => {
|
|
12127
|
-
const ke =
|
|
12127
|
+
const ke = K.find((Te) => {
|
|
12128
12128
|
const Ve = H(Te);
|
|
12129
12129
|
return Ve !== void 0 && Ve === ye;
|
|
12130
12130
|
});
|
|
12131
12131
|
return ke || {
|
|
12132
|
-
[
|
|
12132
|
+
[A]: ye,
|
|
12133
12133
|
[I]: `Selected: ${ye}`,
|
|
12134
12134
|
value: ye,
|
|
12135
12135
|
label: `Selected: ${ye}`
|
|
@@ -12138,14 +12138,14 @@ const Nc = ({
|
|
|
12138
12138
|
{
|
|
12139
12139
|
if (x == null || x === "")
|
|
12140
12140
|
return null;
|
|
12141
|
-
const q =
|
|
12141
|
+
const q = K.find(
|
|
12142
12142
|
(ye) => {
|
|
12143
12143
|
const ke = H(ye);
|
|
12144
12144
|
return ke !== void 0 && ke === x;
|
|
12145
12145
|
}
|
|
12146
12146
|
);
|
|
12147
12147
|
return q || {
|
|
12148
|
-
[
|
|
12148
|
+
[A]: x,
|
|
12149
12149
|
[I]: `Selected: ${x}`,
|
|
12150
12150
|
value: x,
|
|
12151
12151
|
label: `Selected: ${x}`
|
|
@@ -12156,9 +12156,9 @@ const Nc = ({
|
|
|
12156
12156
|
Rh,
|
|
12157
12157
|
{
|
|
12158
12158
|
id: e.id,
|
|
12159
|
-
options:
|
|
12159
|
+
options: K,
|
|
12160
12160
|
value: Z,
|
|
12161
|
-
multiple:
|
|
12161
|
+
multiple: j,
|
|
12162
12162
|
labelText: e.labelPosition === "top" ? C(e.label) : void 0,
|
|
12163
12163
|
label: e.labelPosition !== "top" ? C(e.label) : void 0,
|
|
12164
12164
|
placeholder: y && (_ != null && _.dependsOn) && !c ? `Please select ${_.dependsOn.replace(
|
|
@@ -12168,16 +12168,16 @@ const Nc = ({
|
|
|
12168
12168
|
labelVariant: e.labelVariant,
|
|
12169
12169
|
disabled: y,
|
|
12170
12170
|
loading: pe,
|
|
12171
|
-
error: l || !!
|
|
12172
|
-
helperText: (s == null ? void 0 : s.message) || (
|
|
12171
|
+
error: l || !!Y,
|
|
12172
|
+
helperText: (s == null ? void 0 : s.message) || (Y == null ? void 0 : Y.message) || e.helperText || "",
|
|
12173
12173
|
onOpen: X,
|
|
12174
12174
|
noOptionsText: y && (_ != null && _.dependsOn) && !c ? `Please select ${_.dependsOn.replace(
|
|
12175
12175
|
/_/g,
|
|
12176
12176
|
" "
|
|
12177
|
-
)} first` : pe ? "Fetching data..." : p && !pe &&
|
|
12177
|
+
)} first` : pe ? "Fetching data..." : p && !pe && K.length === 0 ? "No options available" : "Click to load options",
|
|
12178
12178
|
onChange: (q) => {
|
|
12179
12179
|
const ye = (_ == null ? void 0 : _.valueField) || e.value_field || "value";
|
|
12180
|
-
if (
|
|
12180
|
+
if (j) {
|
|
12181
12181
|
const Te = (Array.isArray(q) ? q : []).map((Ve) => typeof Ve == "object" && (Ve[ye] || Ve.value || Ve.id) || Ve);
|
|
12182
12182
|
g.onChange(Te);
|
|
12183
12183
|
} else {
|
|
@@ -12441,7 +12441,7 @@ const Nc = ({
|
|
|
12441
12441
|
}
|
|
12442
12442
|
);
|
|
12443
12443
|
}
|
|
12444
|
-
const
|
|
12444
|
+
const j = e.imagePlaceholder || {}, A = j.icon || "upload", I = S, H = () => {
|
|
12445
12445
|
var q;
|
|
12446
12446
|
try {
|
|
12447
12447
|
(q = I.current) == null || q.click();
|
|
@@ -12469,7 +12469,7 @@ const Nc = ({
|
|
|
12469
12469
|
p: 2,
|
|
12470
12470
|
textAlign: "center",
|
|
12471
12471
|
color: "primary.main",
|
|
12472
|
-
...
|
|
12472
|
+
...j.sx
|
|
12473
12473
|
},
|
|
12474
12474
|
children: [
|
|
12475
12475
|
/* @__PURE__ */ d(
|
|
@@ -12485,8 +12485,8 @@ const Nc = ({
|
|
|
12485
12485
|
/* @__PURE__ */ d(
|
|
12486
12486
|
di,
|
|
12487
12487
|
{
|
|
12488
|
-
sx: { borderRadius: "8px", ...
|
|
12489
|
-
children:
|
|
12488
|
+
sx: { borderRadius: "8px", ...j.iconSx },
|
|
12489
|
+
children: A === "image" ? /* @__PURE__ */ d(
|
|
12490
12490
|
Oh,
|
|
12491
12491
|
{
|
|
12492
12492
|
sx: { width: 36, height: 36, color: "primary.main" }
|
|
@@ -12506,9 +12506,9 @@ const Nc = ({
|
|
|
12506
12506
|
fontSize: "16px",
|
|
12507
12507
|
fontWeight: 600,
|
|
12508
12508
|
color: "primary.main",
|
|
12509
|
-
...
|
|
12509
|
+
...j.titleSx
|
|
12510
12510
|
},
|
|
12511
|
-
children:
|
|
12511
|
+
children: j.title || "Drag & Drop the image here"
|
|
12512
12512
|
}
|
|
12513
12513
|
),
|
|
12514
12514
|
/* @__PURE__ */ d(
|
|
@@ -12518,20 +12518,20 @@ const Nc = ({
|
|
|
12518
12518
|
fontSize: "12px",
|
|
12519
12519
|
fontWeight: 400,
|
|
12520
12520
|
color: "primary.main",
|
|
12521
|
-
...
|
|
12521
|
+
...j.subtitleSx
|
|
12522
12522
|
},
|
|
12523
|
-
children:
|
|
12523
|
+
children: j.subtitle || ""
|
|
12524
12524
|
}
|
|
12525
12525
|
),
|
|
12526
12526
|
/* @__PURE__ */ d(
|
|
12527
12527
|
Ye,
|
|
12528
12528
|
{
|
|
12529
12529
|
onClick: H,
|
|
12530
|
-
sx: { my: 2, ...
|
|
12530
|
+
sx: { my: 2, ...j.buttonSx },
|
|
12531
12531
|
startIcon: /* @__PURE__ */ d(Ai, {}),
|
|
12532
12532
|
variant: "contained",
|
|
12533
12533
|
disabled: e.disabled,
|
|
12534
|
-
children:
|
|
12534
|
+
children: j.buttonText || "Upload File"
|
|
12535
12535
|
}
|
|
12536
12536
|
),
|
|
12537
12537
|
/* @__PURE__ */ d(
|
|
@@ -12540,9 +12540,9 @@ const Nc = ({
|
|
|
12540
12540
|
sx: {
|
|
12541
12541
|
fontSize: "12px",
|
|
12542
12542
|
fontWeight: 400,
|
|
12543
|
-
...
|
|
12543
|
+
...j.helperTextSx
|
|
12544
12544
|
},
|
|
12545
|
-
children:
|
|
12545
|
+
children: j.helperText || e.helperText || ""
|
|
12546
12546
|
}
|
|
12547
12547
|
)
|
|
12548
12548
|
]
|
|
@@ -12611,7 +12611,7 @@ function Hh() {
|
|
|
12611
12611
|
setter: function(b) {
|
|
12612
12612
|
var S = m(b);
|
|
12613
12613
|
return l.get(b) || l.set(b, function(T, C) {
|
|
12614
|
-
for (var R = 0,
|
|
12614
|
+
for (var R = 0, M = S.length, _ = T; R < M - 1; ) {
|
|
12615
12615
|
var D = S[R];
|
|
12616
12616
|
if (D === "__proto__" || D === "constructor" || D === "prototype")
|
|
12617
12617
|
return T;
|
|
@@ -12623,7 +12623,7 @@ function Hh() {
|
|
|
12623
12623
|
getter: function(b, S) {
|
|
12624
12624
|
var P = m(b);
|
|
12625
12625
|
return p.get(b) || p.set(b, function(C) {
|
|
12626
|
-
for (var R = 0,
|
|
12626
|
+
for (var R = 0, M = P.length; R < M; )
|
|
12627
12627
|
if (C != null || !S) C = C[P[R++]];
|
|
12628
12628
|
else return;
|
|
12629
12629
|
return C;
|
|
@@ -12650,9 +12650,9 @@ function Hh() {
|
|
|
12650
12650
|
return b.match(t) || [""];
|
|
12651
12651
|
}
|
|
12652
12652
|
function u(b, S, P) {
|
|
12653
|
-
var T = b.length, C, R,
|
|
12653
|
+
var T = b.length, C, R, M, _;
|
|
12654
12654
|
for (R = 0; R < T; R++)
|
|
12655
|
-
C = b[R], C && (w(C) && (C = '"' + C + '"'), _ = v(C),
|
|
12655
|
+
C = b[R], C && (w(C) && (C = '"' + C + '"'), _ = v(C), M = !_ && /^\d+$/.test(C), S.call(P, C, _, M, R, b));
|
|
12656
12656
|
}
|
|
12657
12657
|
function v(b) {
|
|
12658
12658
|
return typeof b == "string" && b && ["'", '"'].indexOf(b.charAt(0)) !== -1;
|
|
@@ -13013,7 +13013,7 @@ function Jr(e) {
|
|
|
13013
13013
|
};
|
|
13014
13014
|
const R = ($) => {
|
|
13015
13015
|
ft.isError($) ? T($) : $ ? l(null) : T(P());
|
|
13016
|
-
},
|
|
13016
|
+
}, M = ($) => {
|
|
13017
13017
|
ft.isError($) ? T($) : s($);
|
|
13018
13018
|
};
|
|
13019
13019
|
if (v && jt(r))
|
|
@@ -13024,10 +13024,10 @@ function Jr(e) {
|
|
|
13024
13024
|
if (D = m.call(C, r, C), typeof ((c = D) == null ? void 0 : c.then) == "function") {
|
|
13025
13025
|
if (i.sync)
|
|
13026
13026
|
throw new Error(`Validation test of type: "${C.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);
|
|
13027
|
-
return Promise.resolve(D).then(R,
|
|
13027
|
+
return Promise.resolve(D).then(R, M);
|
|
13028
13028
|
}
|
|
13029
13029
|
} catch ($) {
|
|
13030
|
-
|
|
13030
|
+
M($);
|
|
13031
13031
|
return;
|
|
13032
13032
|
}
|
|
13033
13033
|
R(D);
|
|
@@ -14633,16 +14633,16 @@ const kg = (e) => {
|
|
|
14633
14633
|
var Ge, rt;
|
|
14634
14634
|
const b = [
|
|
14635
14635
|
...new Set(
|
|
14636
|
-
r.map((
|
|
14636
|
+
r.map((K) => K.step).filter((K) => K != null && K > 0)
|
|
14637
14637
|
)
|
|
14638
|
-
].sort((
|
|
14638
|
+
].sort((K, y) => (K || 0) - (y || 0)), S = b.length > 1, P = b.length || 1, [T, C] = Ft(1), R = S ? r.filter((K) => K.step === T) : r, M = Re((K) => {
|
|
14639
14639
|
const y = [];
|
|
14640
|
-
for (const g of
|
|
14640
|
+
for (const g of K)
|
|
14641
14641
|
if (y.push(g), g.type === "tabs" && g.items)
|
|
14642
14642
|
for (const x of g.items || [])
|
|
14643
|
-
Array.isArray(x.fields) && y.push(...
|
|
14643
|
+
Array.isArray(x.fields) && y.push(...M(x.fields));
|
|
14644
14644
|
return y;
|
|
14645
|
-
}, []), _ = qe(() =>
|
|
14645
|
+
}, []), _ = qe(() => M(R), [R, M]), D = qe(
|
|
14646
14646
|
() => kg(_),
|
|
14647
14647
|
[_]
|
|
14648
14648
|
), {
|
|
@@ -14657,67 +14657,67 @@ const kg = (e) => {
|
|
|
14657
14657
|
resolver: fp(D),
|
|
14658
14658
|
mode: "onChange",
|
|
14659
14659
|
defaultValues: s
|
|
14660
|
-
}),
|
|
14660
|
+
}), re = F(), pe = xt({});
|
|
14661
14661
|
zt(() => {
|
|
14662
|
-
const
|
|
14662
|
+
const K = [];
|
|
14663
14663
|
for (const y of r) {
|
|
14664
14664
|
const g = y.depends_on;
|
|
14665
|
-
g && typeof y.name == "string" &&
|
|
14665
|
+
g && typeof y.name == "string" && K.push({ dependentField: y.name, dependencyName: g });
|
|
14666
14666
|
}
|
|
14667
|
-
if (
|
|
14668
|
-
for (const { dependentField: y, dependencyName: g } of
|
|
14669
|
-
const x = pe.current[g],
|
|
14670
|
-
if (x !==
|
|
14667
|
+
if (K.length !== 0)
|
|
14668
|
+
for (const { dependentField: y, dependencyName: g } of K) {
|
|
14669
|
+
const x = pe.current[g], j = re == null ? void 0 : re[g];
|
|
14670
|
+
if (x !== j)
|
|
14671
14671
|
try {
|
|
14672
14672
|
te(y);
|
|
14673
14673
|
} catch {
|
|
14674
14674
|
}
|
|
14675
|
-
pe.current[g] =
|
|
14675
|
+
pe.current[g] = j;
|
|
14676
14676
|
}
|
|
14677
|
-
}, [r,
|
|
14678
|
-
const
|
|
14677
|
+
}, [r, re, te]);
|
|
14678
|
+
const Y = xt(i);
|
|
14679
14679
|
zt(() => {
|
|
14680
|
-
|
|
14680
|
+
Y.current = i;
|
|
14681
14681
|
}, [i]);
|
|
14682
14682
|
const L = qe(() => {
|
|
14683
14683
|
try {
|
|
14684
|
-
return JSON.stringify(
|
|
14684
|
+
return JSON.stringify(re);
|
|
14685
14685
|
} catch {
|
|
14686
14686
|
return String(Date.now());
|
|
14687
14687
|
}
|
|
14688
|
-
}, [
|
|
14688
|
+
}, [re]), X = xt(null);
|
|
14689
14689
|
zt(() => {
|
|
14690
|
-
|
|
14690
|
+
Y.current && X.current !== L && (X.current = L, Y.current(re));
|
|
14691
14691
|
}, [L]);
|
|
14692
14692
|
const me = async () => {
|
|
14693
14693
|
if (!S) return !0;
|
|
14694
|
-
const
|
|
14695
|
-
for (const g of
|
|
14696
|
-
if (typeof g.required == "function" ? !!g.required(
|
|
14697
|
-
const
|
|
14698
|
-
let
|
|
14699
|
-
if (g.type === "checkbox" ?
|
|
14694
|
+
const K = r.filter((g) => g.step === T);
|
|
14695
|
+
for (const g of K)
|
|
14696
|
+
if (typeof g.required == "function" ? !!g.required(re) : !!g.required) {
|
|
14697
|
+
const j = re[g.name];
|
|
14698
|
+
let A = !0;
|
|
14699
|
+
if (g.type === "checkbox" ? A = j === !0 : Array.isArray(j) ? A = j.length > 0 : A = j != null && j !== "", !A)
|
|
14700
14700
|
return !1;
|
|
14701
14701
|
}
|
|
14702
|
-
return await se() ? !0 : Object.keys(z).filter((x) =>
|
|
14703
|
-
const
|
|
14704
|
-
return typeof (
|
|
14702
|
+
return await se() ? !0 : Object.keys(z).filter((x) => K.some((j) => j.name === x)).map((x) => {
|
|
14703
|
+
const j = z[x];
|
|
14704
|
+
return typeof (j == null ? void 0 : j.message) == "string" ? j.message : `${x} is invalid`;
|
|
14705
14705
|
}).length === 0;
|
|
14706
14706
|
}, de = qe(() => {
|
|
14707
14707
|
if (!S) return !0;
|
|
14708
|
-
const
|
|
14709
|
-
for (const g of
|
|
14710
|
-
if (typeof g.required == "function" ? !!g.required(
|
|
14711
|
-
const
|
|
14712
|
-
let
|
|
14713
|
-
if (g.type === "checkbox" ?
|
|
14708
|
+
const K = r.filter((g) => g.step === T);
|
|
14709
|
+
for (const g of K)
|
|
14710
|
+
if (typeof g.required == "function" ? !!g.required(re) : !!g.required) {
|
|
14711
|
+
const j = re[g.name];
|
|
14712
|
+
let A = !0;
|
|
14713
|
+
if (g.type === "checkbox" ? A = j === !0 : Array.isArray(j) ? A = j.length > 0 : A = j != null && j !== "", !A)
|
|
14714
14714
|
return !1;
|
|
14715
14715
|
}
|
|
14716
14716
|
return Object.keys(z).filter(
|
|
14717
|
-
(g) =>
|
|
14717
|
+
(g) => K.some((x) => x.name === g)
|
|
14718
14718
|
).length === 0;
|
|
14719
|
-
}, [S, T, r,
|
|
14720
|
-
const g =
|
|
14719
|
+
}, [S, T, r, re, z]), ce = Re((K, y) => {
|
|
14720
|
+
const g = K.showWhen;
|
|
14721
14721
|
if (g) {
|
|
14722
14722
|
if (typeof g == "function")
|
|
14723
14723
|
try {
|
|
@@ -14726,15 +14726,15 @@ const kg = (e) => {
|
|
|
14726
14726
|
return !0;
|
|
14727
14727
|
}
|
|
14728
14728
|
if (g && typeof g == "object") {
|
|
14729
|
-
const x = g.field,
|
|
14730
|
-
if (x && typeof
|
|
14731
|
-
if (x && Array.isArray(
|
|
14729
|
+
const x = g.field, j = g.equals, A = g.in, I = x ? (y || {})[x] : void 0;
|
|
14730
|
+
if (x && typeof j < "u") return I === j;
|
|
14731
|
+
if (x && Array.isArray(A)) return A.includes(I);
|
|
14732
14732
|
}
|
|
14733
14733
|
}
|
|
14734
14734
|
return !0;
|
|
14735
|
-
}, []), ge = Re((
|
|
14735
|
+
}, []), ge = Re((K) => {
|
|
14736
14736
|
const y = [];
|
|
14737
|
-
for (const g of
|
|
14737
|
+
for (const g of K)
|
|
14738
14738
|
if (y.push(g), g.type === "tabs" && g.items)
|
|
14739
14739
|
for (const x of g.items || [])
|
|
14740
14740
|
Array.isArray(x.fields) && y.push(...ge(x.fields));
|
|
@@ -14742,31 +14742,36 @@ const kg = (e) => {
|
|
|
14742
14742
|
}, []), B = qe(() => {
|
|
14743
14743
|
if (S)
|
|
14744
14744
|
return de;
|
|
14745
|
-
const
|
|
14746
|
-
for (const
|
|
14747
|
-
if (!ce(
|
|
14745
|
+
const K = ge(r);
|
|
14746
|
+
for (const x of K) {
|
|
14747
|
+
if (!ce(x, re))
|
|
14748
14748
|
continue;
|
|
14749
|
-
if (typeof
|
|
14750
|
-
const
|
|
14751
|
-
let
|
|
14752
|
-
if (
|
|
14749
|
+
if (typeof x.required == "function" ? !!x.required(re) : !!x.required) {
|
|
14750
|
+
const A = re[x.name];
|
|
14751
|
+
let I = !0;
|
|
14752
|
+
if (x.type === "checkbox" ? I = A === !0 : I = A != null && A !== "" && !(Array.isArray(A) && A.length === 0), !I)
|
|
14753
14753
|
return !1;
|
|
14754
14754
|
}
|
|
14755
14755
|
}
|
|
14756
|
-
|
|
14757
|
-
|
|
14758
|
-
|
|
14759
|
-
|
|
14756
|
+
const y = new Set(
|
|
14757
|
+
K.filter((x) => ce(x, re)).map((x) => x.name)
|
|
14758
|
+
);
|
|
14759
|
+
return Object.keys(z).filter(
|
|
14760
|
+
(x) => y.has(x)
|
|
14761
|
+
).length === 0;
|
|
14762
|
+
}, [S, de, r, re, z, ge, ce]), Q = async (K) => {
|
|
14763
|
+
K < 1 || K > P || K > T && S && !await me() || C(K);
|
|
14764
|
+
}, ne = async (K) => {
|
|
14760
14765
|
if (S && T < P) {
|
|
14761
14766
|
console.warn("Form submission attempted on non-final step");
|
|
14762
14767
|
return;
|
|
14763
14768
|
}
|
|
14764
|
-
o && o(
|
|
14765
|
-
}, le = async (
|
|
14766
|
-
|
|
14767
|
-
}, ue = (
|
|
14768
|
-
|
|
14769
|
-
}, we = (
|
|
14769
|
+
o && o(K), n(K);
|
|
14770
|
+
}, le = async (K) => {
|
|
14771
|
+
K && (K.preventDefault(), K.stopPropagation()), S && T < P && await me() && Q(T + 1);
|
|
14772
|
+
}, ue = (K) => {
|
|
14773
|
+
K && (K.preventDefault(), K.stopPropagation()), S && T > 1 && Q(T - 1);
|
|
14774
|
+
}, we = (K) => K.col ? K.col : (K.xs || K.sm || K.md || K.lg || K.xl) && (K.xs || K.sm || K.md || K.lg || K.xl) || 12, G = t ? Lu({
|
|
14770
14775
|
palette: {
|
|
14771
14776
|
primary: {
|
|
14772
14777
|
main: t.primaryColor || "#1976d2"
|
|
@@ -14791,37 +14796,37 @@ const kg = (e) => {
|
|
|
14791
14796
|
}
|
|
14792
14797
|
}) : void 0, ze = () => {
|
|
14793
14798
|
if (m && m.buttons && m.buttons.length > 0) {
|
|
14794
|
-
const
|
|
14799
|
+
const K = {
|
|
14795
14800
|
...m,
|
|
14796
14801
|
buttons: m.buttons.map((y) => {
|
|
14797
|
-
const g = (y.text || "").toLowerCase(), x = y.type === "submit" || g.includes("submit") || g.includes("save") || g.includes("finish") || g.includes("complete"),
|
|
14798
|
-
let
|
|
14799
|
-
return S ? (x ||
|
|
14802
|
+
const g = (y.text || "").toLowerCase(), x = y.type === "submit" || g.includes("submit") || g.includes("save") || g.includes("finish") || g.includes("complete"), j = g.includes("next");
|
|
14803
|
+
let A = !1;
|
|
14804
|
+
return S ? (x || j) && (A = !de) : x && (A = !B), { ...y, disabled: y.disabled || A };
|
|
14800
14805
|
})
|
|
14801
14806
|
};
|
|
14802
14807
|
return /* @__PURE__ */ d(W, { sx: { mt: 3 }, children: /* @__PURE__ */ d(
|
|
14803
14808
|
Og,
|
|
14804
14809
|
{
|
|
14805
|
-
config:
|
|
14806
|
-
onSubmit:
|
|
14810
|
+
config: K,
|
|
14811
|
+
onSubmit: ne,
|
|
14807
14812
|
onStepChange: Q,
|
|
14808
14813
|
currentStep: T,
|
|
14809
14814
|
totalSteps: P,
|
|
14810
14815
|
isMultiStep: S,
|
|
14811
|
-
formData:
|
|
14816
|
+
formData: re
|
|
14812
14817
|
}
|
|
14813
14818
|
) });
|
|
14814
14819
|
}
|
|
14815
14820
|
if (p && p.length > 0) {
|
|
14816
|
-
const
|
|
14817
|
-
const g = (y.text || "").toLowerCase(), x = y.type === "submit" || g.includes("submit") || g.includes("save") || g.includes("finish") || g.includes("complete"),
|
|
14818
|
-
let
|
|
14819
|
-
return S ? (x ||
|
|
14821
|
+
const K = p.map((y) => {
|
|
14822
|
+
const g = (y.text || "").toLowerCase(), x = y.type === "submit" || g.includes("submit") || g.includes("save") || g.includes("finish") || g.includes("complete"), j = g.includes("next");
|
|
14823
|
+
let A = !1;
|
|
14824
|
+
return S ? (x || j) && (A = !de) : x && (A = !B), {
|
|
14820
14825
|
...y,
|
|
14821
|
-
disabled: y.disabled ||
|
|
14826
|
+
disabled: y.disabled || A
|
|
14822
14827
|
};
|
|
14823
14828
|
});
|
|
14824
|
-
return /* @__PURE__ */ d(Ag, { buttons:
|
|
14829
|
+
return /* @__PURE__ */ d(Ag, { buttons: K });
|
|
14825
14830
|
}
|
|
14826
14831
|
return l ? /* @__PURE__ */ d(
|
|
14827
14832
|
W,
|
|
@@ -14885,25 +14890,25 @@ const kg = (e) => {
|
|
|
14885
14890
|
}
|
|
14886
14891
|
) : null;
|
|
14887
14892
|
}, Qe = qe(() => {
|
|
14888
|
-
const
|
|
14893
|
+
const K = [];
|
|
14889
14894
|
let y = [];
|
|
14890
14895
|
for (const g of R)
|
|
14891
|
-
g.type === "section" && y.length > 0 ? (
|
|
14892
|
-
return y.length > 0 &&
|
|
14896
|
+
g.type === "section" && y.length > 0 ? (K.push(y), y = [g]) : y.push(g);
|
|
14897
|
+
return y.length > 0 && K.push(y), K;
|
|
14893
14898
|
}, [R]), Je = /* @__PURE__ */ ee(
|
|
14894
14899
|
W,
|
|
14895
14900
|
{
|
|
14896
14901
|
component: "form",
|
|
14897
|
-
onSubmit: (
|
|
14902
|
+
onSubmit: (K) => {
|
|
14898
14903
|
if (S && T < P) {
|
|
14899
|
-
|
|
14904
|
+
K.preventDefault(), K.stopPropagation(), de && le();
|
|
14900
14905
|
return;
|
|
14901
14906
|
}
|
|
14902
|
-
$(
|
|
14907
|
+
$(ne)(K);
|
|
14903
14908
|
},
|
|
14904
14909
|
id: e,
|
|
14905
|
-
onKeyDown: (
|
|
14906
|
-
|
|
14910
|
+
onKeyDown: (K) => {
|
|
14911
|
+
K.key === "Enter" && S && T < P && (K.preventDefault(), de && le());
|
|
14907
14912
|
},
|
|
14908
14913
|
children: [
|
|
14909
14914
|
S && /* @__PURE__ */ d(
|
|
@@ -14916,11 +14921,11 @@ const kg = (e) => {
|
|
|
14916
14921
|
showStepTitles: (w == null ? void 0 : w.showStepTitles) !== !1
|
|
14917
14922
|
}
|
|
14918
14923
|
),
|
|
14919
|
-
Qe.map((
|
|
14920
|
-
const g =
|
|
14921
|
-
if (g && !ce(g,
|
|
14924
|
+
Qe.map((K, y) => {
|
|
14925
|
+
const g = K.find((H) => H.type === "section");
|
|
14926
|
+
if (g && !ce(g, re))
|
|
14922
14927
|
return null;
|
|
14923
|
-
const x = (g == null ? void 0 : g.cardWrap) !== !1,
|
|
14928
|
+
const x = (g == null ? void 0 : g.cardWrap) !== !1, j = {
|
|
14924
14929
|
p: 2,
|
|
14925
14930
|
boxShadow: "0px 1px 4px 0px #00000029",
|
|
14926
14931
|
background: "#FFFFFF",
|
|
@@ -14930,14 +14935,14 @@ const kg = (e) => {
|
|
|
14930
14935
|
gap: 2,
|
|
14931
14936
|
width: "100%",
|
|
14932
14937
|
mb: 2
|
|
14933
|
-
},
|
|
14938
|
+
}, A = {
|
|
14934
14939
|
display: "grid",
|
|
14935
14940
|
gridTemplateColumns: "repeat(12, 1fr)",
|
|
14936
14941
|
gap: 2,
|
|
14937
14942
|
width: "100%",
|
|
14938
14943
|
mb: 2
|
|
14939
|
-
}, I = /* @__PURE__ */ d(Di, { children:
|
|
14940
|
-
if (!ce(H,
|
|
14944
|
+
}, I = /* @__PURE__ */ d(Di, { children: K.map((H) => {
|
|
14945
|
+
if (!ce(H, re))
|
|
14941
14946
|
return null;
|
|
14942
14947
|
const Z = we(H);
|
|
14943
14948
|
return /* @__PURE__ */ d(W, { sx: { gridColumn: `span ${Z}` }, children: /* @__PURE__ */ d(
|
|
@@ -14948,7 +14953,7 @@ const kg = (e) => {
|
|
|
14948
14953
|
errors: z,
|
|
14949
14954
|
baseUrl: E,
|
|
14950
14955
|
apiHeaders: h,
|
|
14951
|
-
formData:
|
|
14956
|
+
formData: re,
|
|
14952
14957
|
setValue: V
|
|
14953
14958
|
}
|
|
14954
14959
|
) }, H.name);
|
|
@@ -14956,12 +14961,12 @@ const kg = (e) => {
|
|
|
14956
14961
|
return x ? /* @__PURE__ */ d(
|
|
14957
14962
|
mt,
|
|
14958
14963
|
{
|
|
14959
|
-
sx: { ...
|
|
14964
|
+
sx: { ...j, ...(g == null ? void 0 : g.cardSx) || {} },
|
|
14960
14965
|
...(g == null ? void 0 : g.cardProps) || {},
|
|
14961
14966
|
children: I
|
|
14962
14967
|
},
|
|
14963
14968
|
`group-${y}`
|
|
14964
|
-
) : /* @__PURE__ */ d(W, { sx:
|
|
14969
|
+
) : /* @__PURE__ */ d(W, { sx: A, children: I }, `group-${y}`);
|
|
14965
14970
|
}),
|
|
14966
14971
|
ze()
|
|
14967
14972
|
]
|
|
@@ -16909,7 +16914,7 @@ var io = {
|
|
|
16909
16914
|
fileRejections: []
|
|
16910
16915
|
};
|
|
16911
16916
|
function du() {
|
|
16912
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = Me(Me({}, pu), e), r = t.accept, n = t.disabled, i = t.getFilesFromEvent, a = t.maxSize, o = t.minSize, s = t.multiple, l = t.maxFiles, p = t.onDragEnter, m = t.onDragLeave, f = t.onDragOver, u = t.onDrop, v = t.onDropAccepted, E = t.onDropRejected, h = t.onFileDialogCancel, w = t.onFileDialogOpen, b = t.useFsAccessApi, S = t.autoFocus, P = t.preventDropOnDocument, T = t.noClick, C = t.noKeyboard, R = t.noDrag,
|
|
16917
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = Me(Me({}, pu), e), r = t.accept, n = t.disabled, i = t.getFilesFromEvent, a = t.maxSize, o = t.minSize, s = t.multiple, l = t.maxFiles, p = t.onDragEnter, m = t.onDragLeave, f = t.onDragOver, u = t.onDrop, v = t.onDropAccepted, E = t.onDropRejected, h = t.onFileDialogCancel, w = t.onFileDialogOpen, b = t.useFsAccessApi, S = t.autoFocus, P = t.preventDropOnDocument, T = t.noClick, C = t.noKeyboard, R = t.noDrag, M = t.noDragEventsBubbling, _ = t.onError, D = t.validator, c = qe(function() {
|
|
16913
16918
|
return uy(r);
|
|
16914
16919
|
}, [r]), $ = qe(function() {
|
|
16915
16920
|
return cy(r);
|
|
@@ -16917,11 +16922,11 @@ function du() {
|
|
|
16917
16922
|
return typeof w == "function" ? w : bl;
|
|
16918
16923
|
}, [w]), F = qe(function() {
|
|
16919
16924
|
return typeof h == "function" ? h : bl;
|
|
16920
|
-
}, [h]), V = xt(null), te = xt(null), se = gu(ky, io),
|
|
16925
|
+
}, [h]), V = xt(null), te = xt(null), se = gu(ky, io), re = Ea(se, 2), pe = re[0], Y = re[1], L = pe.isFocused, X = pe.isFileDialogActive, me = xt(typeof window < "u" && window.isSecureContext && b && ly()), de = function() {
|
|
16921
16926
|
!me.current && X && setTimeout(function() {
|
|
16922
16927
|
if (te.current) {
|
|
16923
16928
|
var I = te.current.files;
|
|
16924
|
-
I.length || (
|
|
16929
|
+
I.length || (Y({
|
|
16925
16930
|
type: "closeDialog"
|
|
16926
16931
|
}), F());
|
|
16927
16932
|
}
|
|
@@ -16943,11 +16948,11 @@ function du() {
|
|
|
16943
16948
|
return !n && S && V.current && V.current.focus(), function() {
|
|
16944
16949
|
};
|
|
16945
16950
|
}, [V, S, n]);
|
|
16946
|
-
var B = Re(function(
|
|
16947
|
-
_ ? _(
|
|
16948
|
-
}, [_]), Q = Re(function(
|
|
16949
|
-
|
|
16950
|
-
if (!($i(
|
|
16951
|
+
var B = Re(function(A) {
|
|
16952
|
+
_ ? _(A) : console.error(A);
|
|
16953
|
+
}, [_]), Q = Re(function(A) {
|
|
16954
|
+
A.preventDefault(), A.persist(), y(A), ce.current = [].concat(yy(ce.current), [A.target]), ai(A) && Promise.resolve(i(A)).then(function(I) {
|
|
16955
|
+
if (!($i(A) && !M)) {
|
|
16951
16956
|
var H = I.length, Z = H > 0 && iy({
|
|
16952
16957
|
files: I,
|
|
16953
16958
|
accept: c,
|
|
@@ -16957,39 +16962,39 @@ function du() {
|
|
|
16957
16962
|
maxFiles: l,
|
|
16958
16963
|
validator: D
|
|
16959
16964
|
}), q = H > 0 && !Z;
|
|
16960
|
-
|
|
16965
|
+
Y({
|
|
16961
16966
|
isDragAccept: Z,
|
|
16962
16967
|
isDragReject: q,
|
|
16963
16968
|
isDragActive: !0,
|
|
16964
16969
|
type: "setDraggedFiles"
|
|
16965
|
-
}), p && p(
|
|
16970
|
+
}), p && p(A);
|
|
16966
16971
|
}
|
|
16967
16972
|
}).catch(function(I) {
|
|
16968
16973
|
return B(I);
|
|
16969
16974
|
});
|
|
16970
|
-
}, [i, p, B,
|
|
16971
|
-
|
|
16972
|
-
var I = ai(
|
|
16973
|
-
if (I &&
|
|
16975
|
+
}, [i, p, B, M, c, o, a, s, l, D]), ne = Re(function(A) {
|
|
16976
|
+
A.preventDefault(), A.persist(), y(A);
|
|
16977
|
+
var I = ai(A);
|
|
16978
|
+
if (I && A.dataTransfer)
|
|
16974
16979
|
try {
|
|
16975
|
-
|
|
16980
|
+
A.dataTransfer.dropEffect = "copy";
|
|
16976
16981
|
} catch {
|
|
16977
16982
|
}
|
|
16978
|
-
return I && f && f(
|
|
16979
|
-
}, [f,
|
|
16980
|
-
|
|
16983
|
+
return I && f && f(A), !1;
|
|
16984
|
+
}, [f, M]), le = Re(function(A) {
|
|
16985
|
+
A.preventDefault(), A.persist(), y(A);
|
|
16981
16986
|
var I = ce.current.filter(function(Z) {
|
|
16982
16987
|
return V.current && V.current.contains(Z);
|
|
16983
|
-
}), H = I.indexOf(
|
|
16984
|
-
H !== -1 && I.splice(H, 1), ce.current = I, !(I.length > 0) && (
|
|
16988
|
+
}), H = I.indexOf(A.target);
|
|
16989
|
+
H !== -1 && I.splice(H, 1), ce.current = I, !(I.length > 0) && (Y({
|
|
16985
16990
|
type: "setDraggedFiles",
|
|
16986
16991
|
isDragActive: !1,
|
|
16987
16992
|
isDragAccept: !1,
|
|
16988
16993
|
isDragReject: !1
|
|
16989
|
-
}), ai(
|
|
16990
|
-
}, [V, m,
|
|
16994
|
+
}), ai(A) && m && m(A));
|
|
16995
|
+
}, [V, m, M]), ue = Re(function(A, I) {
|
|
16991
16996
|
var H = [], Z = [];
|
|
16992
|
-
|
|
16997
|
+
A.forEach(function(q) {
|
|
16993
16998
|
var ye = ou(q, c), ke = Ea(ye, 2), Te = ke[0], Ve = ke[1], We = su(q, o, a), nt = Ea(We, 2), Vt = nt[0], it = nt[1], Ze = D ? D(q) : null;
|
|
16994
16999
|
if (Te && Vt && !Ze)
|
|
16995
17000
|
H.push(q);
|
|
@@ -17007,53 +17012,53 @@ function du() {
|
|
|
17007
17012
|
file: q,
|
|
17008
17013
|
errors: [ny]
|
|
17009
17014
|
});
|
|
17010
|
-
}), H.splice(0)),
|
|
17015
|
+
}), H.splice(0)), Y({
|
|
17011
17016
|
acceptedFiles: H,
|
|
17012
17017
|
fileRejections: Z,
|
|
17013
17018
|
isDragReject: Z.length > 0,
|
|
17014
17019
|
type: "setFiles"
|
|
17015
17020
|
}), u && u(H, Z, I), Z.length > 0 && E && E(Z, I), H.length > 0 && v && v(H, I);
|
|
17016
|
-
}, [
|
|
17017
|
-
|
|
17018
|
-
$i(
|
|
17021
|
+
}, [Y, s, c, o, a, l, u, v, E, D]), we = Re(function(A) {
|
|
17022
|
+
A.preventDefault(), A.persist(), y(A), ce.current = [], ai(A) && Promise.resolve(i(A)).then(function(I) {
|
|
17023
|
+
$i(A) && !M || ue(I, A);
|
|
17019
17024
|
}).catch(function(I) {
|
|
17020
17025
|
return B(I);
|
|
17021
|
-
}),
|
|
17026
|
+
}), Y({
|
|
17022
17027
|
type: "reset"
|
|
17023
17028
|
});
|
|
17024
|
-
}, [i, ue, B,
|
|
17029
|
+
}, [i, ue, B, M]), G = Re(function() {
|
|
17025
17030
|
if (me.current) {
|
|
17026
|
-
|
|
17031
|
+
Y({
|
|
17027
17032
|
type: "openDialog"
|
|
17028
17033
|
}), z();
|
|
17029
|
-
var
|
|
17034
|
+
var A = {
|
|
17030
17035
|
multiple: s,
|
|
17031
17036
|
types: $
|
|
17032
17037
|
};
|
|
17033
|
-
window.showOpenFilePicker(
|
|
17038
|
+
window.showOpenFilePicker(A).then(function(I) {
|
|
17034
17039
|
return i(I);
|
|
17035
17040
|
}).then(function(I) {
|
|
17036
|
-
ue(I, null),
|
|
17041
|
+
ue(I, null), Y({
|
|
17037
17042
|
type: "closeDialog"
|
|
17038
17043
|
});
|
|
17039
17044
|
}).catch(function(I) {
|
|
17040
|
-
py(I) ? (F(I),
|
|
17045
|
+
py(I) ? (F(I), Y({
|
|
17041
17046
|
type: "closeDialog"
|
|
17042
17047
|
})) : dy(I) ? (me.current = !1, te.current ? (te.current.value = null, te.current.click()) : B(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."))) : B(I);
|
|
17043
17048
|
});
|
|
17044
17049
|
return;
|
|
17045
17050
|
}
|
|
17046
|
-
te.current && (
|
|
17051
|
+
te.current && (Y({
|
|
17047
17052
|
type: "openDialog"
|
|
17048
17053
|
}), z(), te.current.value = null, te.current.click());
|
|
17049
|
-
}, [
|
|
17050
|
-
!V.current || !V.current.isEqualNode(
|
|
17054
|
+
}, [Y, z, F, b, ue, B, $, s]), ze = Re(function(A) {
|
|
17055
|
+
!V.current || !V.current.isEqualNode(A.target) || (A.key === " " || A.key === "Enter" || A.keyCode === 32 || A.keyCode === 13) && (A.preventDefault(), G());
|
|
17051
17056
|
}, [V, G]), Qe = Re(function() {
|
|
17052
|
-
|
|
17057
|
+
Y({
|
|
17053
17058
|
type: "focus"
|
|
17054
17059
|
});
|
|
17055
17060
|
}, []), Je = Re(function() {
|
|
17056
|
-
|
|
17061
|
+
Y({
|
|
17057
17062
|
type: "blur"
|
|
17058
17063
|
});
|
|
17059
17064
|
}, []), Et = Re(function() {
|
|
@@ -17062,32 +17067,32 @@ function du() {
|
|
|
17062
17067
|
return n ? null : I;
|
|
17063
17068
|
}, rt = function(I) {
|
|
17064
17069
|
return C ? null : Ge(I);
|
|
17065
|
-
},
|
|
17070
|
+
}, K = function(I) {
|
|
17066
17071
|
return R ? null : Ge(I);
|
|
17067
17072
|
}, y = function(I) {
|
|
17068
|
-
|
|
17073
|
+
M && I.stopPropagation();
|
|
17069
17074
|
}, g = qe(function() {
|
|
17070
17075
|
return function() {
|
|
17071
|
-
var
|
|
17076
|
+
var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, I = A.refKey, H = I === void 0 ? "ref" : I, Z = A.role, q = A.onKeyDown, ye = A.onFocus, ke = A.onBlur, Te = A.onClick, Ve = A.onDragEnter, We = A.onDragOver, nt = A.onDragLeave, Vt = A.onDrop, it = Pi(A, hy);
|
|
17072
17077
|
return Me(Me(no({
|
|
17073
17078
|
onKeyDown: rt(Lt(q, ze)),
|
|
17074
17079
|
onFocus: rt(Lt(ye, Qe)),
|
|
17075
17080
|
onBlur: rt(Lt(ke, Je)),
|
|
17076
17081
|
onClick: Ge(Lt(Te, Et)),
|
|
17077
|
-
onDragEnter:
|
|
17078
|
-
onDragOver:
|
|
17079
|
-
onDragLeave:
|
|
17080
|
-
onDrop:
|
|
17082
|
+
onDragEnter: K(Lt(Ve, Q)),
|
|
17083
|
+
onDragOver: K(Lt(We, ne)),
|
|
17084
|
+
onDragLeave: K(Lt(nt, le)),
|
|
17085
|
+
onDrop: K(Lt(Vt, we)),
|
|
17081
17086
|
role: typeof Z == "string" && Z !== "" ? Z : "presentation"
|
|
17082
17087
|
}, H, V), !n && !C ? {
|
|
17083
17088
|
tabIndex: 0
|
|
17084
17089
|
} : {}), it);
|
|
17085
17090
|
};
|
|
17086
|
-
}, [V, ze, Qe, Je, Et, Q,
|
|
17087
|
-
|
|
17088
|
-
}, []),
|
|
17091
|
+
}, [V, ze, Qe, Je, Et, Q, ne, le, we, C, R, n]), x = Re(function(A) {
|
|
17092
|
+
A.stopPropagation();
|
|
17093
|
+
}, []), j = qe(function() {
|
|
17089
17094
|
return function() {
|
|
17090
|
-
var
|
|
17095
|
+
var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, I = A.refKey, H = I === void 0 ? "ref" : I, Z = A.onChange, q = A.onClick, ye = Pi(A, gy), ke = no({
|
|
17091
17096
|
accept: c,
|
|
17092
17097
|
multiple: s,
|
|
17093
17098
|
type: "file",
|
|
@@ -17113,7 +17118,7 @@ function du() {
|
|
|
17113
17118
|
return Me(Me({}, pe), {}, {
|
|
17114
17119
|
isFocused: L && !n,
|
|
17115
17120
|
getRootProps: g,
|
|
17116
|
-
getInputProps:
|
|
17121
|
+
getInputProps: j,
|
|
17117
17122
|
rootRef: V,
|
|
17118
17123
|
inputRef: te,
|
|
17119
17124
|
open: Ge(G)
|
|
@@ -17238,38 +17243,38 @@ const Ty = gt(/* @__PURE__ */ d("path", {
|
|
|
17238
17243
|
}, [t]);
|
|
17239
17244
|
const R = Re(
|
|
17240
17245
|
(V) => {
|
|
17241
|
-
var se,
|
|
17246
|
+
var se, re;
|
|
17242
17247
|
return ((se = e == null ? void 0 : e.fileTypes) == null ? void 0 : se.some((pe) => {
|
|
17243
17248
|
if (pe.includes("*")) {
|
|
17244
|
-
const
|
|
17245
|
-
return V.type.startsWith(
|
|
17249
|
+
const Y = pe.split("/")[0];
|
|
17250
|
+
return V.type.startsWith(Y);
|
|
17246
17251
|
}
|
|
17247
17252
|
return V.type === pe;
|
|
17248
|
-
})) ? e != null && e.maxSize && V.size > e.maxSize ? `File size exceeds maximum limit of ${(e.maxSize / 1048576).toFixed(1)}MB` : null : `File type ${V.type} is not allowed. Allowed types: ${(
|
|
17253
|
+
})) ? e != null && e.maxSize && V.size > e.maxSize ? `File size exceeds maximum limit of ${(e.maxSize / 1048576).toFixed(1)}MB` : null : `File type ${V.type} is not allowed. Allowed types: ${(re = e == null ? void 0 : e.fileTypes) == null ? void 0 : re.join(", ")}`;
|
|
17249
17254
|
},
|
|
17250
17255
|
[e]
|
|
17251
|
-
),
|
|
17256
|
+
), M = Re(
|
|
17252
17257
|
async (V) => {
|
|
17253
17258
|
console.log("handleFiles called with:", V.length, "files"), w(!0);
|
|
17254
17259
|
const te = [], se = [];
|
|
17255
17260
|
try {
|
|
17256
17261
|
for (const pe of V) {
|
|
17257
|
-
let
|
|
17262
|
+
let Y = null;
|
|
17258
17263
|
if (e != null && e.multiple && f.some(
|
|
17259
17264
|
(X) => X.file.name === pe.name && X.file.size === pe.size && X.file.lastModified === pe.lastModified
|
|
17260
17265
|
)) {
|
|
17261
17266
|
se.push(`${pe.name}: File already exists`);
|
|
17262
17267
|
continue;
|
|
17263
17268
|
}
|
|
17264
|
-
if (
|
|
17269
|
+
if (Y = R(pe), !Y && (e != null && e.customValidation))
|
|
17265
17270
|
try {
|
|
17266
17271
|
const L = e.customValidation(pe);
|
|
17267
|
-
L instanceof Promise ?
|
|
17272
|
+
L instanceof Promise ? Y = await L : Y = L;
|
|
17268
17273
|
} catch (L) {
|
|
17269
|
-
|
|
17274
|
+
Y = `Custom validation failed: ${L instanceof Error ? L.message : "Unknown error"}`;
|
|
17270
17275
|
}
|
|
17271
|
-
if (
|
|
17272
|
-
se.push(`${pe.name}: ${
|
|
17276
|
+
if (Y)
|
|
17277
|
+
se.push(`${pe.name}: ${Y}`);
|
|
17273
17278
|
else {
|
|
17274
17279
|
const L = {
|
|
17275
17280
|
id: `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
|
|
@@ -17282,10 +17287,10 @@ const Ty = gt(/* @__PURE__ */ d("path", {
|
|
|
17282
17287
|
te.push(L);
|
|
17283
17288
|
}
|
|
17284
17289
|
}
|
|
17285
|
-
const
|
|
17286
|
-
u(
|
|
17287
|
-
} catch (
|
|
17288
|
-
const pe = `Unexpected error: ${
|
|
17290
|
+
const re = e != null && e.multiple ? [...f, ...te] : te;
|
|
17291
|
+
u(re), r == null || r(re), se.length > 0 ? (T(se), E(se)) : (T([]), E([]));
|
|
17292
|
+
} catch (re) {
|
|
17293
|
+
const pe = `Unexpected error: ${re instanceof Error ? re.message : "Unknown error"}`;
|
|
17289
17294
|
T([pe]), E([pe]);
|
|
17290
17295
|
}
|
|
17291
17296
|
},
|
|
@@ -17306,7 +17311,7 @@ const Ty = gt(/* @__PURE__ */ d("path", {
|
|
|
17306
17311
|
const V = f.filter((te) => te.status !== "error");
|
|
17307
17312
|
n == null || n(V);
|
|
17308
17313
|
}, [f, n, e == null ? void 0 : e.required, e == null ? void 0 : e.title]), { getRootProps: c, getInputProps: $, isDragActive: z } = du({
|
|
17309
|
-
onDrop:
|
|
17314
|
+
onDrop: M,
|
|
17310
17315
|
multiple: e == null ? void 0 : e.multiple,
|
|
17311
17316
|
disabled: i,
|
|
17312
17317
|
noClick: !1,
|