@nxgt/material 2.18.1 → 2.20.0
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/CHANGELOG.md +101 -0
- package/README.md +1 -0
- package/dist/{_Uint8Array-C7apDrb7.js → _Uint8Array-DGVY6NfN.js} +1 -1
- package/dist/{_overRest-CCAbV-eT.js → _overRest-DCKNcrF0.js} +1 -1
- package/dist/{async-slice-Cuekts5f.js → async-slice-DAVXvBm1.js} +3 -3
- package/dist/{blockDiagram-BEXU5L5S-iNiTd2F6.js → blockDiagram-BEXU5L5S-BrCVxVRd.js} +2 -2
- package/dist/{chunk-3FUC2YCW-C3_88DyD.js → chunk-3FUC2YCW-DWaNSANO.js} +2 -2
- package/dist/{chunk-7M6MHVWA-DSA5AJyK.js → chunk-7M6MHVWA-x-N4hnls.js} +1 -1
- package/dist/{chunk-GNY47TPC-AFxr6Xhs.js → chunk-GNY47TPC-Dzk3o85s.js} +4 -4
- package/dist/{chunk-NETBCI7D-DUZYHta0.js → chunk-NETBCI7D-WvAAUJne.js} +1 -1
- package/dist/{chunk-Z7XXMR3K-DDFBvLN4.js → chunk-Z7XXMR3K-DY6U0Uq4.js} +1 -1
- package/dist/{classDiagram-v2-NBCMYWYE-Cx1q9jwX.js → classDiagram-v2-NBCMYWYE-QeFmLU9L.js} +2 -2
- package/dist/components/base-content.css +64 -4
- package/dist/components/base.css +3 -1
- package/dist/{components-CEXxj5QP.js → components-DH5dpaU8.js} +24401 -23964
- package/dist/components.js +6 -6
- package/dist/{dagre-6A5THRUB-B3FAoh2m.js → dagre-6A5THRUB-D-NdHe_L.js} +11 -11
- package/dist/{diagram-22UHCM2B-B1mxqDwI.js → diagram-22UHCM2B-DZ4jejn3.js} +2 -2
- package/dist/{diagram-3UASUU5V-DKbBxWI5.js → diagram-3UASUU5V-DRoFk6qc.js} +1 -1
- package/dist/dnd.js +1 -1
- package/dist/{elk-276RUBZZ-CeiRDj87.js → elk-276RUBZZ-BG0kHR2f.js} +3 -3
- package/dist/{erDiagram-OPXOYQCR-nyCpuYg6.js → erDiagram-OPXOYQCR-B6XRmJuU.js} +2 -2
- package/dist/{field-blur-DNHXOY0J.js → field-blur-B1VUvTws.js} +972 -946
- package/dist/{flowDiagram-KWPJA3E3-CAt7iv16.js → flowDiagram-KWPJA3E3-BghxpN0G.js} +3 -3
- package/dist/{ganttDiagram-FUAMR5RP-g4YEKVC-.js → ganttDiagram-FUAMR5RP-C3aoaoXQ.js} +1 -1
- package/dist/{graphlib-DxjKaXeR.js → graphlib-Dc5Siwxn.js} +6 -6
- package/dist/hooks.js +2 -2
- package/dist/{i18n-provider-Dv9ZSmgO.js → i18n-provider-Cq_VScPv.js} +1 -1
- package/dist/i18n.js +6 -6
- package/dist/{isArrayLikeObject-H8k6W51O.js → isArrayLikeObject-DeHDPOEB.js} +3 -3
- package/dist/{isEmpty-B0Bavg-e.js → isEmpty-Sic-RRp7.js} +3 -3
- package/dist/{journeyDiagram-ZHPQQLJL-v7NsJ_vl.js → journeyDiagram-ZHPQQLJL-DcUX0asi.js} +1 -1
- package/dist/lib/components/ui/collections/data-table/data-table-density.d.ts +15 -0
- package/dist/lib/components/ui/collections/data-table/data-table.d.ts +1 -1
- package/dist/lib/components/ui/collections/data-table/types.d.ts +7 -0
- package/dist/lib/components/ui/fields/index.d.ts +1 -0
- package/dist/lib/components/ui/fields/repeatable-group/index.d.ts +2 -0
- package/dist/lib/components/ui/fields/repeatable-group/partials/repeatable-group-footer.d.ts +14 -0
- package/dist/lib/components/ui/fields/repeatable-group/partials/repeatable-group-row.d.ts +19 -0
- package/dist/lib/components/ui/fields/repeatable-group/partials/repeatable-group-rows.d.ts +21 -0
- package/dist/lib/components/ui/fields/repeatable-group/partials/repeatable-group-status.d.ts +11 -0
- package/dist/lib/components/ui/fields/repeatable-group/repeatable-group-classes.d.ts +33 -0
- package/dist/lib/components/ui/fields/repeatable-group/repeatable-group-form-field.d.ts +28 -0
- package/dist/lib/components/ui/fields/repeatable-group/repeatable-group-names.d.ts +16 -0
- package/dist/lib/components/ui/fields/repeatable-group/repeatable-group.d.ts +12 -0
- package/dist/lib/components/ui/fields/repeatable-group/types.d.ts +45 -0
- package/dist/lib/components/ui/fields/repeatable-group/use-repeatable-group.d.ts +32 -0
- package/dist/lib/components/ui/fields/search-field/search-field.d.ts +7 -1
- package/dist/lib/components/ui/overlays/command/command-item.d.ts +10 -0
- package/dist/lib/components/ui/overlays/command/command.d.ts +5 -2
- package/dist/lib/components/ui/overlays/dialog/dialog-outside.d.ts +4 -2
- package/dist/lib/components/ui/overlays/dialog/dialog-parts.d.ts +7 -0
- package/dist/lib/components/ui/overlays/dialog/dialog.d.ts +2 -5
- package/dist/lib/components/ui/overlays/dialog/in-dialog.d.ts +13 -0
- package/dist/lib/components/ui/overlays/menubar/menubar-items.d.ts +18 -0
- package/dist/lib/components/ui/overlays/menubar/menubar-sub.d.ts +8 -0
- package/dist/lib/components/ui/overlays/menubar/menubar.d.ts +3 -21
- package/dist/lib/components/ui/overlays/sheet/sheet-parts.d.ts +7 -0
- package/dist/lib/components/ui/overlays/sheet/sheet.d.ts +2 -5
- package/dist/lib/components/ui/primitives/typography/typography.d.ts +2 -1
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-chips.d.ts +2 -0
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-popup.d.ts +2 -1
- package/dist/lib/components/ui/selection/checkbox-group/checkbox-group.d.ts +2 -0
- package/dist/lib/components/ui/selection/combobox/combobox-content.d.ts +14 -0
- package/dist/lib/components/ui/selection/combobox/combobox.d.ts +1 -4
- package/dist/lib/components/ui/selection/option-count/option-count.d.ts +18 -0
- package/dist/lib/components/ui/selection/radio-group/radio-group.d.ts +2 -0
- package/dist/lib/components/ui/selection/select-chip-field/next-selection.d.ts +10 -0
- package/dist/lib/components/ui/selection/select-chip-field/select-chip-field.d.ts +8 -1
- package/dist/lib/components/ui/selection/select-chip-field/select-chip-header.d.ts +15 -0
- package/dist/lib/components/ui/selection/select-chip-field/select-chip-option.d.ts +13 -0
- package/dist/lib/i18n/resources/en/en.d.ts +15 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +15 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +15 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +15 -0
- package/dist/lib/i18n/resources/resources.d.ts +30 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +2 -2
- package/dist/main.js +16 -16
- package/dist/map.js +8 -8
- package/dist/material.css +1 -1
- package/dist/{merge-Js8537dg.js → merge-VyOzRzYB.js} +4 -4
- package/dist/{mermaid.core-BHmjz3IJ.js → mermaid.core-DLu6PrQ9.js} +21 -21
- package/dist/{mindmap-definition-NLK3R4M7-xOeGZSSo.js → mindmap-definition-NLK3R4M7-B7Y8Yx12.js} +2 -2
- package/dist/{pieDiagram-5QR66LMP-5nOKLXqH.js → pieDiagram-5QR66LMP-Bv9VMy5P.js} +1 -1
- package/dist/print.js +2 -2
- package/dist/{quadrantDiagram-O4NWA36T-B0RNQlBB.js → quadrantDiagram-O4NWA36T-Dr2CLVD8.js} +1 -1
- package/dist/{requirementDiagram-PLB6GJNP-Cw85zSzP.js → requirementDiagram-PLB6GJNP-XuNWo4K8.js} +2 -2
- package/dist/{sankeyDiagram-IPEJSGJF-APZoNvA9.js → sankeyDiagram-IPEJSGJF-DzXzUNs5.js} +1 -1
- package/dist/{sortable-provider-CUT5Wfdl.js → sortable-provider-XneXCqY1.js} +1 -1
- package/dist/{stateDiagram-v2-GCMORJYK-CfSjJkc3.js → stateDiagram-v2-GCMORJYK-BN2OBfZa.js} +2 -2
- package/dist/{stored-language-BKoohv2_.js → stored-language-DqlfjXt8.js} +26 -0
- package/dist/{swimlanes-2SLR337P-Bv2VKn_d.js → swimlanes-2SLR337P-Ma7iLhhV.js} +3 -3
- package/dist/{swimlanesDiagram-TC7HE7FX-Jk8do14f.js → swimlanesDiagram-TC7HE7FX-DWBnIppx.js} +3 -3
- package/dist/{timeline-definition-EJHVYXUP-Bc40K9sk.js → timeline-definition-EJHVYXUP-BBwvY1Xf.js} +1 -1
- package/dist/{translate-material-CCJg3yfc.js → translate-material-B6HO6ykL.js} +2 -2
- package/dist/{translator-DEde7BKz.js → translator-B_lmafJN.js} +1 -1
- package/dist/{use-heading-spy-XkSExwoT.js → use-heading-spy-D1Ifooi5.js} +2 -2
- package/dist/{use-material-translation-Cndoq_iK.js → use-material-translation-Bp4ECeT4.js} +2 -2
- package/dist/{usecaseDiagram-POWQR4AR-CKd5UWWw.js → usecaseDiagram-POWQR4AR-B1HduAbh.js} +2 -2
- package/dist/{xychartDiagram-PMCCYNJV-CQJbSV7N.js → xychartDiagram-PMCCYNJV-ByjPOY-5.js} +1 -1
- package/docs/components/README.md +1 -1
- package/docs/components/data-table-filter-and-lists.md +3 -1
- package/docs/components/form-fields.md +146 -0
- package/docs/components/overlays-and-menus.md +2 -0
- package/docs/components/primitives.md +3 -1
- package/docs/components/selection-and-choice.md +20 -4
- package/docs/guides/forms.md +84 -0
- package/docs/guides/i18n.md +2 -1
- package/docs/previews/form-fields-repeatablegroup.webp +0 -0
- package/docs/roadmap.md +7 -0
- package/docs/troubleshooting.md +69 -0
- package/lib/components/base-content.css +64 -4
- package/lib/components/base.css +3 -1
- package/package.json +2 -2
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
2
|
import { t } from "./utils-DC8bw9A_.js";
|
|
3
|
-
import { _t as n, a as r, at as i, ct as a, d as o, dt as s, et as c, g as l, h as u, ht as d, i as f, it as p, lt as m, m as h, mt as g, n as _, nt as v, o as y, ot as b, p as x, pt as S, r as C, rt as w, st as T, t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { X as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import * as
|
|
8
|
-
import
|
|
9
|
-
import { getNonce as
|
|
10
|
-
import { inertOthers as
|
|
11
|
-
import { forwardEscape as
|
|
12
|
-
import { describedBy as
|
|
13
|
-
import { layerOf as
|
|
14
|
-
import { focusHandle as
|
|
3
|
+
import { _t as n, a as r, at as i, ct as a, d as o, dt as s, et as c, g as l, h as u, ht as d, i as f, it as p, lt as m, m as h, mt as g, n as _, nt as v, o as y, ot as b, p as x, pt as S, r as C, rt as w, st as T, t as E, tt as ee } from "./icon-button-B1nN3J6B.js";
|
|
4
|
+
import { t as te } from "./use-material-translation-Bp4ECeT4.js";
|
|
5
|
+
import { X as ne } from "lucide-react";
|
|
6
|
+
import { Fragment as re, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
7
|
+
import * as k from "react";
|
|
8
|
+
import A, { Activity as ie, Children as j, Fragment as ae, cloneElement as oe, createContext as se, isValidElement as ce, use as le, useCallback as M, useContext as ue, useEffect as de, useId as fe, useLayoutEffect as pe, useMemo as me, useRef as N, useState as he } from "react";
|
|
9
|
+
import { getNonce as ge } from "@nxgt/material-core/csp-nonce";
|
|
10
|
+
import { inertOthers as _e } from "@nxgt/material-core/inert-others";
|
|
11
|
+
import { forwardEscape as ve } from "@nxgt/material-core/escape-forward";
|
|
12
|
+
import { describedBy as ye } from "@nxgt/material-core/described-by";
|
|
13
|
+
import { layerOf as be, openerOf as xe } from "@nxgt/material-core/field-blur-layers";
|
|
14
|
+
import { focusHandle as Se } from "@nxgt/material-core/focus-control";
|
|
15
15
|
//#region ../../node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
16
|
-
var
|
|
16
|
+
var Ce = Object.defineProperty, P = (e, t) => Ce(e, "name", {
|
|
17
17
|
value: t,
|
|
18
18
|
configurable: !0
|
|
19
|
-
}),
|
|
19
|
+
}), we = "focusScope.autoFocusOnMount", Te = "focusScope.autoFocusOnUnmount", Ee = {
|
|
20
20
|
bubbles: !1,
|
|
21
21
|
cancelable: !0
|
|
22
|
-
},
|
|
23
|
-
let { loop: r = !1, trapped: i = !1, onMountAutoFocus: a, onUnmountAutoFocus: o, ...c } = e, [l, u] =
|
|
22
|
+
}, De = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ P(function(e, t) {
|
|
23
|
+
let { loop: r = !1, trapped: i = !1, onMountAutoFocus: a, onUnmountAutoFocus: o, ...c } = e, [l, u] = k.useState(null), d = w(a), f = w(o), p = k.useRef(null), m = n(t, u), h = k.useRef({
|
|
24
24
|
paused: !1,
|
|
25
25
|
pause() {
|
|
26
26
|
this.paused = !0;
|
|
@@ -29,20 +29,20 @@ var we = Object.defineProperty, N = (e, t) => we(e, "name", {
|
|
|
29
29
|
this.paused = !1;
|
|
30
30
|
}
|
|
31
31
|
}).current;
|
|
32
|
-
|
|
32
|
+
k.useEffect(() => {
|
|
33
33
|
if (i) {
|
|
34
34
|
let e = function(e) {
|
|
35
35
|
if (h.paused || !l) return;
|
|
36
36
|
let t = e.target;
|
|
37
|
-
l.contains(t) ? p.current = t :
|
|
37
|
+
l.contains(t) ? p.current = t : Pe(p.current, { select: !0 });
|
|
38
38
|
}, t = function(e) {
|
|
39
39
|
if (h.paused || !l) return;
|
|
40
40
|
let t = e.relatedTarget;
|
|
41
|
-
t !== null && (l.contains(t) ||
|
|
41
|
+
t !== null && (l.contains(t) || Pe(p.current, { select: !0 }));
|
|
42
42
|
}, n = function(e) {
|
|
43
|
-
if (document.activeElement === document.body) for (let t of e) t.removedNodes.length > 0 &&
|
|
43
|
+
if (document.activeElement === document.body) for (let t of e) t.removedNodes.length > 0 && Pe(l);
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
P(e, "handleFocusIn"), P(t, "handleFocusOut"), P(n, "handleMutations"), document.addEventListener("focusin", e), document.addEventListener("focusout", t);
|
|
46
46
|
let r = new MutationObserver(n);
|
|
47
47
|
return l && r.observe(l, {
|
|
48
48
|
childList: !0,
|
|
@@ -55,18 +55,18 @@ var we = Object.defineProperty, N = (e, t) => we(e, "name", {
|
|
|
55
55
|
i,
|
|
56
56
|
l,
|
|
57
57
|
h.paused
|
|
58
|
-
]),
|
|
58
|
+
]), k.useEffect(() => {
|
|
59
59
|
if (l) {
|
|
60
|
-
|
|
60
|
+
Fe.add(h);
|
|
61
61
|
let e = document.activeElement;
|
|
62
62
|
if (!l.contains(e)) {
|
|
63
|
-
let t = new CustomEvent(
|
|
64
|
-
l.addEventListener(
|
|
63
|
+
let t = new CustomEvent(we, Ee);
|
|
64
|
+
l.addEventListener(we, d), l.dispatchEvent(t), t.defaultPrevented || (Oe(Re(Ae(l)), { select: !0 }), document.activeElement === e && Pe(l));
|
|
65
65
|
}
|
|
66
66
|
return () => {
|
|
67
|
-
l.removeEventListener(
|
|
68
|
-
let t = new CustomEvent(
|
|
69
|
-
l.addEventListener(
|
|
67
|
+
l.removeEventListener(we, d), setTimeout(() => {
|
|
68
|
+
let t = new CustomEvent(Te, Ee);
|
|
69
|
+
l.addEventListener(Te, f), l.dispatchEvent(t), t.defaultPrevented || Pe(e ?? document.body, { select: !0 }), l.removeEventListener(Te, f), Fe.remove(h);
|
|
70
70
|
}, 0);
|
|
71
71
|
};
|
|
72
72
|
}
|
|
@@ -76,50 +76,50 @@ var we = Object.defineProperty, N = (e, t) => we(e, "name", {
|
|
|
76
76
|
f,
|
|
77
77
|
h
|
|
78
78
|
]);
|
|
79
|
-
let g =
|
|
79
|
+
let g = k.useCallback((e) => {
|
|
80
80
|
if (!r && !i || h.paused) return;
|
|
81
81
|
let t = e.key === "Tab" && !e.altKey && !e.ctrlKey && !e.metaKey, n = document.activeElement;
|
|
82
82
|
if (t && n) {
|
|
83
|
-
let t = e.currentTarget, [i, a] =
|
|
84
|
-
i && a ? !e.shiftKey && n === a ? (e.preventDefault(), r &&
|
|
83
|
+
let t = e.currentTarget, [i, a] = ke(t);
|
|
84
|
+
i && a ? !e.shiftKey && n === a ? (e.preventDefault(), r && Pe(i, { select: !0 })) : e.shiftKey && n === i && (e.preventDefault(), r && Pe(a, { select: !0 })) : n === t && e.preventDefault();
|
|
85
85
|
}
|
|
86
86
|
}, [
|
|
87
87
|
r,
|
|
88
88
|
i,
|
|
89
89
|
h.paused
|
|
90
90
|
]);
|
|
91
|
-
return /* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ D(s.div, {
|
|
92
92
|
tabIndex: -1,
|
|
93
93
|
...c,
|
|
94
94
|
ref: m,
|
|
95
95
|
onKeyDown: g
|
|
96
96
|
});
|
|
97
97
|
}, "FocusScope"));
|
|
98
|
-
function
|
|
98
|
+
function Oe(e, { select: t = !1 } = {}) {
|
|
99
99
|
let n = document.activeElement;
|
|
100
|
-
for (let r of e) if (
|
|
100
|
+
for (let r of e) if (Pe(r, { select: t }), document.activeElement !== n) return;
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
function
|
|
104
|
-
let t =
|
|
105
|
-
return [
|
|
102
|
+
P(Oe, "focusFirst");
|
|
103
|
+
function ke(e) {
|
|
104
|
+
let t = Ae(e);
|
|
105
|
+
return [je(t, e), je(t.reverse(), e)];
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
function
|
|
109
|
-
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */
|
|
107
|
+
P(ke, "getTabbableEdges");
|
|
108
|
+
function Ae(e) {
|
|
109
|
+
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */ P((e) => {
|
|
110
110
|
let t = e.tagName === "INPUT" && e.type === "hidden";
|
|
111
111
|
return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
112
112
|
}, "acceptNode") });
|
|
113
113
|
for (; n.nextNode();) t.push(n.currentNode);
|
|
114
114
|
return t;
|
|
115
115
|
}
|
|
116
|
-
|
|
117
|
-
function
|
|
116
|
+
P(Ae, "getTabbableCandidates");
|
|
117
|
+
function je(e, t) {
|
|
118
118
|
let n = typeof t.checkVisibility == "function" && t.checkVisibility({ checkVisibilityCSS: !0 });
|
|
119
|
-
for (let r of e) if (!(n ? !r.checkVisibility({ checkVisibilityCSS: !0 }) :
|
|
119
|
+
for (let r of e) if (!(n ? !r.checkVisibility({ checkVisibilityCSS: !0 }) : Me(r, { upTo: t }))) return r;
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
function
|
|
121
|
+
P(je, "findVisible");
|
|
122
|
+
function Me(e, { upTo: t }) {
|
|
123
123
|
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
124
124
|
for (; e;) {
|
|
125
125
|
if (t !== void 0 && e === t) return !1;
|
|
@@ -128,102 +128,102 @@ function Ne(e, { upTo: t }) {
|
|
|
128
128
|
}
|
|
129
129
|
return !1;
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
function
|
|
131
|
+
P(Me, "isHidden");
|
|
132
|
+
function Ne(e) {
|
|
133
133
|
return e instanceof HTMLInputElement && "select" in e;
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
function
|
|
135
|
+
P(Ne, "isSelectableInput");
|
|
136
|
+
function Pe(e, { select: t = !1 } = {}) {
|
|
137
137
|
if (e && e.focus) {
|
|
138
138
|
let n = document.activeElement;
|
|
139
|
-
e.focus({ preventScroll: !0 }), e !== n &&
|
|
139
|
+
e.focus({ preventScroll: !0 }), e !== n && Ne(e) && t && e.select();
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
var
|
|
144
|
-
function
|
|
142
|
+
P(Pe, "focus");
|
|
143
|
+
var Fe = Ie();
|
|
144
|
+
function Ie() {
|
|
145
145
|
let e = [];
|
|
146
146
|
return {
|
|
147
147
|
add(t) {
|
|
148
148
|
let n = e[0];
|
|
149
|
-
t !== n && n?.pause(), e =
|
|
149
|
+
t !== n && n?.pause(), e = Le(e, t), e.unshift(t);
|
|
150
150
|
},
|
|
151
151
|
remove(t) {
|
|
152
|
-
e =
|
|
152
|
+
e = Le(e, t), e[0]?.resume();
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
|
-
|
|
157
|
-
function
|
|
156
|
+
P(Ie, "createFocusScopesStack");
|
|
157
|
+
function Le(e, t) {
|
|
158
158
|
let n = [...e], r = n.indexOf(t);
|
|
159
159
|
return r !== -1 && n.splice(r, 1), n;
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
function
|
|
161
|
+
P(Le, "arrayRemove");
|
|
162
|
+
function Re(e) {
|
|
163
163
|
return e.filter((e) => e.tagName !== "A");
|
|
164
164
|
}
|
|
165
|
-
|
|
165
|
+
P(Re, "removeLinks");
|
|
166
166
|
//#endregion
|
|
167
167
|
//#region ../../node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
168
|
-
var
|
|
168
|
+
var ze = Object.defineProperty, Be = (e, t) => ze(e, "name", {
|
|
169
169
|
value: t,
|
|
170
170
|
configurable: !0
|
|
171
|
-
}),
|
|
172
|
-
function
|
|
173
|
-
return
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
function
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
start:
|
|
180
|
-
end:
|
|
171
|
+
}), Ve = 0, He = null;
|
|
172
|
+
function Ue(e) {
|
|
173
|
+
return We(), e.children;
|
|
174
|
+
}
|
|
175
|
+
Be(Ue, "FocusGuards");
|
|
176
|
+
function We() {
|
|
177
|
+
k.useEffect(() => {
|
|
178
|
+
He ||= {
|
|
179
|
+
start: Ge(),
|
|
180
|
+
end: Ge()
|
|
181
181
|
};
|
|
182
|
-
let { start: e, end: t } =
|
|
183
|
-
return document.body.firstElementChild !== e && document.body.insertAdjacentElement("afterbegin", e), document.body.lastElementChild !== t && document.body.insertAdjacentElement("beforeend", t),
|
|
184
|
-
|
|
182
|
+
let { start: e, end: t } = He;
|
|
183
|
+
return document.body.firstElementChild !== e && document.body.insertAdjacentElement("afterbegin", e), document.body.lastElementChild !== t && document.body.insertAdjacentElement("beforeend", t), Ve++, () => {
|
|
184
|
+
Ve === 1 && (He?.start.remove(), He?.end.remove(), He = null), Ve = Math.max(0, Ve - 1);
|
|
185
185
|
};
|
|
186
186
|
}, []);
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
function
|
|
188
|
+
Be(We, "useFocusGuards");
|
|
189
|
+
function Ge() {
|
|
190
190
|
let e = document.createElement("span");
|
|
191
191
|
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
Be(Ge, "createFocusGuard");
|
|
194
194
|
//#endregion
|
|
195
195
|
//#region ../../node_modules/tslib/tslib.es6.mjs
|
|
196
|
-
function
|
|
196
|
+
function Ke(e, t) {
|
|
197
197
|
var n = {};
|
|
198
198
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
199
199
|
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++) t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
|
|
200
200
|
return n;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function qe(e, t, n) {
|
|
203
203
|
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
204
204
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
205
205
|
}
|
|
206
|
-
var
|
|
207
|
-
|
|
208
|
-
return
|
|
206
|
+
var F, Je = e((() => {
|
|
207
|
+
F = function() {
|
|
208
|
+
return F = Object.assign || function(e) {
|
|
209
209
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
210
210
|
return e;
|
|
211
|
-
},
|
|
211
|
+
}, F.apply(this, arguments);
|
|
212
212
|
};
|
|
213
213
|
}));
|
|
214
214
|
//#endregion
|
|
215
215
|
//#region ../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js
|
|
216
|
-
|
|
217
|
-
var
|
|
216
|
+
Je();
|
|
217
|
+
var Ye = "right-scroll-bar-position", Xe = "width-before-scroll-bar", Ze = "with-scroll-bars-hidden", Qe = "--removed-body-scroll-bar-size";
|
|
218
218
|
//#endregion
|
|
219
219
|
//#region ../../node_modules/use-callback-ref/dist/es2015/assignRef.js
|
|
220
|
-
function
|
|
220
|
+
function $e(e, t) {
|
|
221
221
|
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
222
222
|
}
|
|
223
223
|
//#endregion
|
|
224
224
|
//#region ../../node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
225
|
-
function
|
|
226
|
-
var n =
|
|
225
|
+
function et(e, t) {
|
|
226
|
+
var n = he(function() {
|
|
227
227
|
return {
|
|
228
228
|
value: e,
|
|
229
229
|
callback: t,
|
|
@@ -242,33 +242,33 @@ function tt(e, t) {
|
|
|
242
242
|
}
|
|
243
243
|
//#endregion
|
|
244
244
|
//#region ../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
245
|
-
var
|
|
246
|
-
function
|
|
247
|
-
var n =
|
|
245
|
+
var tt = typeof window < "u" ? k.useLayoutEffect : k.useEffect, nt = /* @__PURE__ */ new WeakMap();
|
|
246
|
+
function rt(e, t) {
|
|
247
|
+
var n = et(t || null, function(t) {
|
|
248
248
|
return e.forEach(function(e) {
|
|
249
|
-
return
|
|
249
|
+
return $e(e, t);
|
|
250
250
|
});
|
|
251
251
|
});
|
|
252
|
-
return
|
|
253
|
-
var t =
|
|
252
|
+
return tt(function() {
|
|
253
|
+
var t = nt.get(n);
|
|
254
254
|
if (t) {
|
|
255
255
|
var r = new Set(t), i = new Set(e), a = n.current;
|
|
256
256
|
r.forEach(function(e) {
|
|
257
|
-
i.has(e) ||
|
|
257
|
+
i.has(e) || $e(e, null);
|
|
258
258
|
}), i.forEach(function(e) {
|
|
259
|
-
r.has(e) ||
|
|
259
|
+
r.has(e) || $e(e, a);
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
|
-
|
|
262
|
+
nt.set(n, e);
|
|
263
263
|
}, [e]), n;
|
|
264
264
|
}
|
|
265
265
|
//#endregion
|
|
266
266
|
//#region ../../node_modules/use-sidecar/dist/es2015/medium.js
|
|
267
|
-
function
|
|
267
|
+
function it(e) {
|
|
268
268
|
return e;
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
t === void 0 && (t =
|
|
270
|
+
function at(e, t) {
|
|
271
|
+
t === void 0 && (t = it);
|
|
272
272
|
var n = [], r = !1;
|
|
273
273
|
return {
|
|
274
274
|
read: function() {
|
|
@@ -321,40 +321,40 @@ function ot(e, t) {
|
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function ot(e) {
|
|
325
325
|
e === void 0 && (e = {});
|
|
326
|
-
var t =
|
|
327
|
-
return t.options =
|
|
326
|
+
var t = at(null);
|
|
327
|
+
return t.options = F({
|
|
328
328
|
async: !0,
|
|
329
329
|
ssr: !1
|
|
330
330
|
}, e), t;
|
|
331
331
|
}
|
|
332
332
|
//#endregion
|
|
333
333
|
//#region ../../node_modules/use-sidecar/dist/es2015/exports.js
|
|
334
|
-
|
|
335
|
-
var
|
|
336
|
-
var t = e.sideCar, n =
|
|
334
|
+
Je();
|
|
335
|
+
var st = function(e) {
|
|
336
|
+
var t = e.sideCar, n = Ke(e, ["sideCar"]);
|
|
337
337
|
if (!t) throw Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
338
338
|
var r = t.read();
|
|
339
339
|
if (!r) throw Error("Sidecar medium not found");
|
|
340
|
-
return
|
|
340
|
+
return k.createElement(r, F({}, n));
|
|
341
341
|
};
|
|
342
|
-
|
|
343
|
-
function
|
|
344
|
-
return e.useMedium(t),
|
|
342
|
+
st.isSideCarExport = !0;
|
|
343
|
+
function ct(e, t) {
|
|
344
|
+
return e.useMedium(t), st;
|
|
345
345
|
}
|
|
346
346
|
//#endregion
|
|
347
347
|
//#region ../../node_modules/react-remove-scroll/dist/es2015/medium.js
|
|
348
|
-
var
|
|
348
|
+
var lt = ot();
|
|
349
349
|
//#endregion
|
|
350
350
|
//#region ../../node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
351
|
-
|
|
352
|
-
var
|
|
353
|
-
var n =
|
|
354
|
-
onScrollCapture:
|
|
355
|
-
onWheelCapture:
|
|
356
|
-
onTouchMoveCapture:
|
|
357
|
-
}), i = r[0], a = r[1], o = e.forwardProps, s = e.children, c = e.className, l = e.removeScrollBar, u = e.enabled, d = e.shards, f = e.sideCar, p = e.noRelative, m = e.noIsolation, h = e.inert, g = e.allowPinchZoom, _ = e.as, v = _ === void 0 ? "div" : _, y = e.gapMode, b =
|
|
351
|
+
Je();
|
|
352
|
+
var ut = function() {}, dt = k.forwardRef(function(e, t) {
|
|
353
|
+
var n = k.useRef(null), r = k.useState({
|
|
354
|
+
onScrollCapture: ut,
|
|
355
|
+
onWheelCapture: ut,
|
|
356
|
+
onTouchMoveCapture: ut
|
|
357
|
+
}), i = r[0], a = r[1], o = e.forwardProps, s = e.children, c = e.className, l = e.removeScrollBar, u = e.enabled, d = e.shards, f = e.sideCar, p = e.noRelative, m = e.noIsolation, h = e.inert, g = e.allowPinchZoom, _ = e.as, v = _ === void 0 ? "div" : _, y = e.gapMode, b = Ke(e, [
|
|
358
358
|
"forwardProps",
|
|
359
359
|
"children",
|
|
360
360
|
"className",
|
|
@@ -368,9 +368,9 @@ var dt = function() {}, ft = O.forwardRef(function(e, t) {
|
|
|
368
368
|
"allowPinchZoom",
|
|
369
369
|
"as",
|
|
370
370
|
"gapMode"
|
|
371
|
-
]), x = f, S =
|
|
372
|
-
return
|
|
373
|
-
sideCar:
|
|
371
|
+
]), x = f, S = rt([n, t]), C = F(F({}, b), i);
|
|
372
|
+
return k.createElement(k.Fragment, null, u && k.createElement(x, {
|
|
373
|
+
sideCar: lt,
|
|
374
374
|
removeScrollBar: l,
|
|
375
375
|
shards: d,
|
|
376
376
|
noRelative: p,
|
|
@@ -380,90 +380,90 @@ var dt = function() {}, ft = O.forwardRef(function(e, t) {
|
|
|
380
380
|
allowPinchZoom: !!g,
|
|
381
381
|
lockRef: n,
|
|
382
382
|
gapMode: y
|
|
383
|
-
}), o ?
|
|
383
|
+
}), o ? k.cloneElement(k.Children.only(s), F(F({}, C), { ref: S })) : k.createElement(v, F({}, C, {
|
|
384
384
|
className: c,
|
|
385
385
|
ref: S
|
|
386
386
|
}), s));
|
|
387
387
|
});
|
|
388
|
-
|
|
388
|
+
dt.defaultProps = {
|
|
389
389
|
enabled: !0,
|
|
390
390
|
removeScrollBar: !0,
|
|
391
391
|
inert: !1
|
|
392
|
-
},
|
|
393
|
-
fullWidth:
|
|
394
|
-
zeroRight:
|
|
392
|
+
}, dt.classNames = {
|
|
393
|
+
fullWidth: Xe,
|
|
394
|
+
zeroRight: Ye
|
|
395
395
|
};
|
|
396
396
|
//#endregion
|
|
397
397
|
//#region ../../node_modules/react-style-singleton/dist/es2015/singleton.js
|
|
398
|
-
function
|
|
398
|
+
function ft() {
|
|
399
399
|
if (!document) return null;
|
|
400
400
|
var e = document.createElement("style");
|
|
401
401
|
e.type = "text/css";
|
|
402
|
-
var t =
|
|
402
|
+
var t = ge();
|
|
403
403
|
return t && e.setAttribute("nonce", t), e;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function pt(e, t) {
|
|
406
406
|
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function mt(e) {
|
|
409
409
|
(document.head || document.getElementsByTagName("head")[0]).appendChild(e);
|
|
410
410
|
}
|
|
411
|
-
var
|
|
411
|
+
var ht = function() {
|
|
412
412
|
var e = 0, t = null;
|
|
413
413
|
return {
|
|
414
414
|
add: function(n) {
|
|
415
|
-
e == 0 && (t =
|
|
415
|
+
e == 0 && (t = ft()) && (pt(t, n), mt(t)), e++;
|
|
416
416
|
},
|
|
417
417
|
remove: function() {
|
|
418
418
|
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
419
419
|
}
|
|
420
420
|
};
|
|
421
|
-
},
|
|
422
|
-
var e =
|
|
421
|
+
}, gt = function() {
|
|
422
|
+
var e = ht();
|
|
423
423
|
return function(t, n) {
|
|
424
|
-
|
|
424
|
+
k.useEffect(function() {
|
|
425
425
|
return e.add(t), function() {
|
|
426
426
|
e.remove();
|
|
427
427
|
};
|
|
428
428
|
}, [t && n]);
|
|
429
429
|
};
|
|
430
|
-
},
|
|
431
|
-
var e =
|
|
430
|
+
}, _t = function() {
|
|
431
|
+
var e = gt();
|
|
432
432
|
return function(t) {
|
|
433
433
|
var n = t.styles, r = t.dynamic;
|
|
434
434
|
return e(n, r), null;
|
|
435
435
|
};
|
|
436
|
-
},
|
|
436
|
+
}, vt = {
|
|
437
437
|
left: 0,
|
|
438
438
|
top: 0,
|
|
439
439
|
right: 0,
|
|
440
440
|
gap: 0
|
|
441
|
-
},
|
|
441
|
+
}, yt = function(e) {
|
|
442
442
|
return parseInt(e || "", 10) || 0;
|
|
443
|
-
},
|
|
443
|
+
}, bt = function(e) {
|
|
444
444
|
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], i = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
445
445
|
return [
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
446
|
+
yt(n),
|
|
447
|
+
yt(r),
|
|
448
|
+
yt(i)
|
|
449
449
|
];
|
|
450
|
-
},
|
|
451
|
-
if (e === void 0 && (e = "margin"), typeof window > "u") return
|
|
452
|
-
var t =
|
|
450
|
+
}, xt = function(e) {
|
|
451
|
+
if (e === void 0 && (e = "margin"), typeof window > "u") return vt;
|
|
452
|
+
var t = bt(e), n = document.documentElement.clientWidth, r = window.innerWidth;
|
|
453
453
|
return {
|
|
454
454
|
left: t[0],
|
|
455
455
|
top: t[1],
|
|
456
456
|
right: t[2],
|
|
457
457
|
gap: Math.max(0, r - n + t[2] - t[0])
|
|
458
458
|
};
|
|
459
|
-
},
|
|
459
|
+
}, St = _t(), Ct = "data-scroll-locked", wt = function(e, t, n, r) {
|
|
460
460
|
var i = e.left, a = e.top, o = e.right, s = e.gap;
|
|
461
461
|
return n === void 0 && (n = "margin"), `
|
|
462
|
-
.${
|
|
462
|
+
.${Ze} {
|
|
463
463
|
overflow: hidden ${r};
|
|
464
464
|
padding-right: ${s}px ${r};
|
|
465
465
|
}
|
|
466
|
-
body[${
|
|
466
|
+
body[${Ct}] {
|
|
467
467
|
overflow: hidden ${r};
|
|
468
468
|
overscroll-behavior: contain;
|
|
469
469
|
${[
|
|
@@ -480,96 +480,96 @@ var gt = function() {
|
|
|
480
480
|
].filter(Boolean).join("")}
|
|
481
481
|
}
|
|
482
482
|
|
|
483
|
-
.${
|
|
483
|
+
.${Ye} {
|
|
484
484
|
right: ${s}px ${r};
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
-
.${
|
|
487
|
+
.${Xe} {
|
|
488
488
|
margin-right: ${s}px ${r};
|
|
489
489
|
}
|
|
490
490
|
|
|
491
|
-
.${
|
|
491
|
+
.${Ye} .${Ye} {
|
|
492
492
|
right: 0 ${r};
|
|
493
493
|
}
|
|
494
494
|
|
|
495
|
-
.${
|
|
495
|
+
.${Xe} .${Xe} {
|
|
496
496
|
margin-right: 0 ${r};
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
-
body[${
|
|
500
|
-
${
|
|
499
|
+
body[${Ct}] {
|
|
500
|
+
${Qe}: ${s}px;
|
|
501
501
|
}
|
|
502
502
|
`;
|
|
503
|
-
},
|
|
503
|
+
}, Tt = function() {
|
|
504
504
|
var e = parseInt(document.body.getAttribute("data-scroll-locked") || "0", 10);
|
|
505
505
|
return isFinite(e) ? e : 0;
|
|
506
|
-
},
|
|
507
|
-
|
|
508
|
-
return document.body.setAttribute(
|
|
509
|
-
var e =
|
|
510
|
-
e <= 0 ? document.body.removeAttribute(
|
|
506
|
+
}, Et = function() {
|
|
507
|
+
k.useEffect(function() {
|
|
508
|
+
return document.body.setAttribute(Ct, (Tt() + 1).toString()), function() {
|
|
509
|
+
var e = Tt() - 1;
|
|
510
|
+
e <= 0 ? document.body.removeAttribute(Ct) : document.body.setAttribute(Ct, e.toString());
|
|
511
511
|
};
|
|
512
512
|
}, []);
|
|
513
|
-
},
|
|
513
|
+
}, Dt = function(e) {
|
|
514
514
|
var t = e.noRelative, n = e.noImportant, r = e.gapMode, i = r === void 0 ? "margin" : r;
|
|
515
|
-
|
|
516
|
-
var a =
|
|
517
|
-
return
|
|
515
|
+
Et();
|
|
516
|
+
var a = k.useMemo(function() {
|
|
517
|
+
return xt(i);
|
|
518
518
|
}, [i]);
|
|
519
|
-
return
|
|
520
|
-
},
|
|
519
|
+
return k.createElement(St, { styles: wt(a, !t, i, n ? "" : "!important") });
|
|
520
|
+
}, Ot = !1;
|
|
521
521
|
if (typeof window < "u") try {
|
|
522
|
-
var
|
|
523
|
-
return
|
|
522
|
+
var kt = Object.defineProperty({}, "passive", { get: function() {
|
|
523
|
+
return Ot = !0, !0;
|
|
524
524
|
} });
|
|
525
|
-
window.addEventListener("test",
|
|
525
|
+
window.addEventListener("test", kt, kt), window.removeEventListener("test", kt, kt);
|
|
526
526
|
} catch {
|
|
527
|
-
|
|
527
|
+
Ot = !1;
|
|
528
528
|
}
|
|
529
|
-
var
|
|
529
|
+
var At = Ot ? { passive: !1 } : !1, jt = function(e) {
|
|
530
530
|
return e.tagName === "TEXTAREA";
|
|
531
|
-
},
|
|
531
|
+
}, Mt = function(e, t) {
|
|
532
532
|
if (!(e instanceof Element)) return !1;
|
|
533
533
|
var n = window.getComputedStyle(e);
|
|
534
|
-
return n[t] !== "hidden" && !(n.overflowY === n.overflowX && !
|
|
534
|
+
return n[t] !== "hidden" && !(n.overflowY === n.overflowX && !jt(e) && n[t] === "visible");
|
|
535
|
+
}, Nt = function(e) {
|
|
536
|
+
return Mt(e, "overflowY");
|
|
535
537
|
}, Pt = function(e) {
|
|
536
|
-
return
|
|
537
|
-
}, Ft = function(e) {
|
|
538
|
-
return Nt(e, "overflowX");
|
|
539
|
-
}, It = function(e, t) {
|
|
538
|
+
return Mt(e, "overflowX");
|
|
539
|
+
}, Ft = function(e, t) {
|
|
540
540
|
var n = t.ownerDocument, r = t;
|
|
541
541
|
do {
|
|
542
|
-
if (typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host),
|
|
543
|
-
var i =
|
|
542
|
+
if (typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host), Rt(e, r)) {
|
|
543
|
+
var i = zt(e, r);
|
|
544
544
|
if (i[1] > i[2]) return !0;
|
|
545
545
|
}
|
|
546
546
|
r = r.parentNode;
|
|
547
547
|
} while (r && r !== n.body);
|
|
548
548
|
return !1;
|
|
549
|
-
},
|
|
549
|
+
}, It = function(e) {
|
|
550
550
|
return [
|
|
551
551
|
e.scrollTop,
|
|
552
552
|
e.scrollHeight,
|
|
553
553
|
e.clientHeight
|
|
554
554
|
];
|
|
555
|
-
},
|
|
555
|
+
}, Lt = function(e) {
|
|
556
556
|
return [
|
|
557
557
|
e.scrollLeft,
|
|
558
558
|
e.scrollWidth,
|
|
559
559
|
e.clientWidth
|
|
560
560
|
];
|
|
561
|
+
}, Rt = function(e, t) {
|
|
562
|
+
return e === "v" ? Nt(t) : Pt(t);
|
|
561
563
|
}, zt = function(e, t) {
|
|
562
|
-
return e === "v" ?
|
|
564
|
+
return e === "v" ? It(t) : Lt(t);
|
|
563
565
|
}, Bt = function(e, t) {
|
|
564
|
-
return e === "v" ? Lt(t) : Rt(t);
|
|
565
|
-
}, Vt = function(e, t) {
|
|
566
566
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
567
|
-
},
|
|
568
|
-
var a =
|
|
567
|
+
}, Vt = function(e, t, n, r, i) {
|
|
568
|
+
var a = Bt(e, window.getComputedStyle(t).direction), o = a * r, s = n.target, c = t.contains(s), l = !1, u = o > 0, d = 0, f = 0;
|
|
569
569
|
do {
|
|
570
570
|
if (!s) break;
|
|
571
|
-
var p =
|
|
572
|
-
(m || h) &&
|
|
571
|
+
var p = zt(e, s), m = p[0], h = p[1] - p[2] - a * m;
|
|
572
|
+
(m || h) && Rt(e, s) && (d += h, f += m);
|
|
573
573
|
var g = s.parentNode;
|
|
574
574
|
s = g && g.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? g.host : g;
|
|
575
575
|
} while (!c && s !== document.body || c && (t.contains(s) || t === s));
|
|
@@ -577,29 +577,29 @@ var jt = kt ? { passive: !1 } : !1, Mt = function(e) {
|
|
|
577
577
|
};
|
|
578
578
|
//#endregion
|
|
579
579
|
//#region ../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
580
|
-
|
|
581
|
-
var
|
|
580
|
+
Je();
|
|
581
|
+
var Ht = function(e) {
|
|
582
582
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
583
|
-
},
|
|
583
|
+
}, Ut = function(e) {
|
|
584
584
|
return [e.deltaX, e.deltaY];
|
|
585
|
-
},
|
|
585
|
+
}, Wt = function(e) {
|
|
586
586
|
return e && "current" in e ? e.current : e;
|
|
587
|
-
},
|
|
587
|
+
}, Gt = function(e, t) {
|
|
588
588
|
return e[0] === t[0] && e[1] === t[1];
|
|
589
|
-
},
|
|
589
|
+
}, Kt = function(e) {
|
|
590
590
|
return `
|
|
591
591
|
.block-interactivity-${e} {pointer-events: none;}
|
|
592
592
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
593
593
|
`;
|
|
594
|
-
},
|
|
595
|
-
function
|
|
596
|
-
var t =
|
|
597
|
-
|
|
594
|
+
}, qt = 0, Jt = [];
|
|
595
|
+
function Yt(e) {
|
|
596
|
+
var t = k.useRef([]), n = k.useRef([0, 0]), r = k.useRef(), i = k.useState(qt++)[0], a = k.useState(_t)[0], o = k.useRef(e);
|
|
597
|
+
k.useEffect(function() {
|
|
598
598
|
o.current = e;
|
|
599
|
-
}, [e]),
|
|
599
|
+
}, [e]), k.useEffect(function() {
|
|
600
600
|
if (e.inert) {
|
|
601
601
|
document.body.classList.add(`block-interactivity-${i}`);
|
|
602
|
-
var t =
|
|
602
|
+
var t = qe([e.lockRef.current], (e.shards || []).map(Wt), !0).filter(Boolean);
|
|
603
603
|
return t.forEach(function(e) {
|
|
604
604
|
return e.classList.add(`allow-interactivity-${i}`);
|
|
605
605
|
}), function() {
|
|
@@ -613,107 +613,107 @@ function Xt(e) {
|
|
|
613
613
|
e.lockRef.current,
|
|
614
614
|
e.shards
|
|
615
615
|
]);
|
|
616
|
-
var s =
|
|
616
|
+
var s = k.useCallback(function(e, t) {
|
|
617
617
|
if ("touches" in e && e.touches.length === 2 || e.type === "wheel" && e.ctrlKey) return !o.current.allowPinchZoom;
|
|
618
|
-
var i =
|
|
618
|
+
var i = Ht(e), a = n.current, s = "deltaX" in e ? e.deltaX : a[0] - i[0], c = "deltaY" in e ? e.deltaY : a[1] - i[1], l, u = e.target, d = Math.abs(s) > Math.abs(c) ? "h" : "v";
|
|
619
619
|
if ("touches" in e && d === "h" && u.type === "range") return !1;
|
|
620
620
|
var f = window.getSelection(), p = f && f.anchorNode;
|
|
621
621
|
if (p && (p === u || p.contains(u))) return !1;
|
|
622
|
-
var m =
|
|
622
|
+
var m = Ft(d, u);
|
|
623
623
|
if (!m) return !0;
|
|
624
|
-
if (m ? l = d : (l = d === "v" ? "h" : "v", m =
|
|
624
|
+
if (m ? l = d : (l = d === "v" ? "h" : "v", m = Ft(d, u)), !m) return !1;
|
|
625
625
|
if (!r.current && "changedTouches" in e && (s || c) && (r.current = l), !l) return !0;
|
|
626
626
|
var h = r.current || l;
|
|
627
|
-
return
|
|
628
|
-
}, []), c =
|
|
627
|
+
return Vt(h, t, e, h === "h" ? s : c, !0);
|
|
628
|
+
}, []), c = k.useCallback(function(e) {
|
|
629
629
|
var n = e;
|
|
630
|
-
if (!(!
|
|
631
|
-
var r = "deltaY" in n ?
|
|
632
|
-
return e.name === n.type && (e.target === n.target || n.target === e.shadowParent) &&
|
|
630
|
+
if (!(!Jt.length || Jt[Jt.length - 1] !== a)) {
|
|
631
|
+
var r = "deltaY" in n ? Ut(n) : Ht(n), i = t.current.filter(function(e) {
|
|
632
|
+
return e.name === n.type && (e.target === n.target || n.target === e.shadowParent) && Gt(e.delta, r);
|
|
633
633
|
})[0];
|
|
634
634
|
if (i && i.should) {
|
|
635
635
|
n.cancelable && n.preventDefault();
|
|
636
636
|
return;
|
|
637
637
|
}
|
|
638
638
|
if (!i) {
|
|
639
|
-
var c = (o.current.shards || []).map(
|
|
639
|
+
var c = (o.current.shards || []).map(Wt).filter(Boolean).filter(function(e) {
|
|
640
640
|
return e.contains(n.target);
|
|
641
641
|
});
|
|
642
642
|
(c.length > 0 ? s(n, c[0]) : !o.current.noIsolation) && n.cancelable && n.preventDefault();
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
|
-
}, []), l =
|
|
645
|
+
}, []), l = k.useCallback(function(e, n, r, i) {
|
|
646
646
|
var a = {
|
|
647
647
|
name: e,
|
|
648
648
|
delta: n,
|
|
649
649
|
target: r,
|
|
650
650
|
should: i,
|
|
651
|
-
shadowParent:
|
|
651
|
+
shadowParent: Xt(r)
|
|
652
652
|
};
|
|
653
653
|
t.current.push(a), setTimeout(function() {
|
|
654
654
|
t.current = t.current.filter(function(e) {
|
|
655
655
|
return e !== a;
|
|
656
656
|
});
|
|
657
657
|
}, 1);
|
|
658
|
-
}, []), u =
|
|
659
|
-
n.current =
|
|
660
|
-
}, []), d =
|
|
661
|
-
l(t.type, Wt(t), t.target, s(t, e.lockRef.current));
|
|
662
|
-
}, []), f = O.useCallback(function(t) {
|
|
658
|
+
}, []), u = k.useCallback(function(e) {
|
|
659
|
+
n.current = Ht(e), r.current = void 0;
|
|
660
|
+
}, []), d = k.useCallback(function(t) {
|
|
663
661
|
l(t.type, Ut(t), t.target, s(t, e.lockRef.current));
|
|
662
|
+
}, []), f = k.useCallback(function(t) {
|
|
663
|
+
l(t.type, Ht(t), t.target, s(t, e.lockRef.current));
|
|
664
664
|
}, []);
|
|
665
|
-
|
|
666
|
-
return
|
|
665
|
+
k.useEffect(function() {
|
|
666
|
+
return Jt.push(a), e.setCallbacks({
|
|
667
667
|
onScrollCapture: d,
|
|
668
668
|
onWheelCapture: d,
|
|
669
669
|
onTouchMoveCapture: f
|
|
670
|
-
}), document.addEventListener("wheel", c,
|
|
671
|
-
|
|
670
|
+
}), document.addEventListener("wheel", c, At), document.addEventListener("touchmove", c, At), document.addEventListener("touchstart", u, At), function() {
|
|
671
|
+
Jt = Jt.filter(function(e) {
|
|
672
672
|
return e !== a;
|
|
673
|
-
}), document.removeEventListener("wheel", c,
|
|
673
|
+
}), document.removeEventListener("wheel", c, At), document.removeEventListener("touchmove", c, At), document.removeEventListener("touchstart", u, At);
|
|
674
674
|
};
|
|
675
675
|
}, []);
|
|
676
676
|
var p = e.removeScrollBar, m = e.inert;
|
|
677
|
-
return
|
|
677
|
+
return k.createElement(k.Fragment, null, m ? k.createElement(a, { styles: Kt(i) }) : null, p ? k.createElement(Dt, {
|
|
678
678
|
noRelative: e.noRelative,
|
|
679
679
|
gapMode: e.gapMode
|
|
680
680
|
}) : null);
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function Xt(e) {
|
|
683
683
|
for (var t = null; e !== null;) e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
684
684
|
return t;
|
|
685
685
|
}
|
|
686
686
|
//#endregion
|
|
687
687
|
//#region ../../node_modules/react-remove-scroll/dist/es2015/sidecar.js
|
|
688
|
-
var
|
|
688
|
+
var Zt = ct(lt, Yt);
|
|
689
689
|
//#endregion
|
|
690
690
|
//#region ../../node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
691
|
-
|
|
692
|
-
var
|
|
693
|
-
return
|
|
691
|
+
Je();
|
|
692
|
+
var Qt = k.forwardRef(function(e, t) {
|
|
693
|
+
return k.createElement(dt, F({}, e, {
|
|
694
694
|
ref: t,
|
|
695
|
-
sideCar:
|
|
695
|
+
sideCar: Zt
|
|
696
696
|
}));
|
|
697
697
|
});
|
|
698
|
-
|
|
698
|
+
Qt.classNames = dt.classNames;
|
|
699
699
|
//#endregion
|
|
700
700
|
//#region ../../node_modules/aria-hidden/dist/es2015/index.js
|
|
701
|
-
var
|
|
701
|
+
var $t = function(e) {
|
|
702
702
|
return typeof document > "u" ? null : (Array.isArray(e) ? e[0] : e).ownerDocument.body;
|
|
703
|
-
},
|
|
704
|
-
return e && (e.host ||
|
|
705
|
-
},
|
|
703
|
+
}, en = /* @__PURE__ */ new WeakMap(), tn = /* @__PURE__ */ new WeakMap(), nn = {}, rn = 0, an = function(e) {
|
|
704
|
+
return e && (e.host || an(e.parentNode));
|
|
705
|
+
}, on = function(e, t) {
|
|
706
706
|
return t.map(function(t) {
|
|
707
707
|
if (e.contains(t)) return t;
|
|
708
|
-
var n =
|
|
708
|
+
var n = an(t);
|
|
709
709
|
return n && e.contains(n) ? n : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
|
|
710
710
|
}).filter(function(e) {
|
|
711
711
|
return !!e;
|
|
712
712
|
});
|
|
713
|
-
},
|
|
714
|
-
var i =
|
|
715
|
-
|
|
716
|
-
var a =
|
|
713
|
+
}, sn = function(e, t, n, r) {
|
|
714
|
+
var i = on(t, Array.isArray(e) ? e : [e]);
|
|
715
|
+
nn[n] || (nn[n] = /* @__PURE__ */ new WeakMap());
|
|
716
|
+
var a = nn[n], o = [], s = /* @__PURE__ */ new Set(), c = new Set(i), l = function(e) {
|
|
717
717
|
!e || s.has(e) || (s.add(e), l(e.parentNode));
|
|
718
718
|
};
|
|
719
719
|
i.forEach(l);
|
|
@@ -721,36 +721,36 @@ var en = function(e) {
|
|
|
721
721
|
!e || c.has(e) || Array.prototype.forEach.call(e.children, function(e) {
|
|
722
722
|
if (s.has(e)) u(e);
|
|
723
723
|
else try {
|
|
724
|
-
var t = e.getAttribute(r), i = t !== null && t !== "false", c = (
|
|
725
|
-
|
|
724
|
+
var t = e.getAttribute(r), i = t !== null && t !== "false", c = (en.get(e) || 0) + 1, l = (a.get(e) || 0) + 1;
|
|
725
|
+
en.set(e, c), a.set(e, l), o.push(e), c === 1 && i && tn.set(e, !0), l === 1 && e.setAttribute(n, "true"), i || e.setAttribute(r, "true");
|
|
726
726
|
} catch (t) {
|
|
727
727
|
console.error("aria-hidden: cannot operate on ", e, t);
|
|
728
728
|
}
|
|
729
729
|
});
|
|
730
730
|
};
|
|
731
|
-
return u(t), s.clear(),
|
|
731
|
+
return u(t), s.clear(), rn++, function() {
|
|
732
732
|
o.forEach(function(e) {
|
|
733
|
-
var t =
|
|
734
|
-
|
|
735
|
-
}),
|
|
733
|
+
var t = en.get(e) - 1, i = a.get(e) - 1;
|
|
734
|
+
en.set(e, t), a.set(e, i), t || (tn.has(e) || e.removeAttribute(r), tn.delete(e)), i || e.removeAttribute(n);
|
|
735
|
+
}), rn--, rn || (en = /* @__PURE__ */ new WeakMap(), en = /* @__PURE__ */ new WeakMap(), tn = /* @__PURE__ */ new WeakMap(), nn = {});
|
|
736
736
|
};
|
|
737
|
-
},
|
|
737
|
+
}, cn = function(e, t, n) {
|
|
738
738
|
n === void 0 && (n = "data-aria-hidden");
|
|
739
|
-
var r = Array.from(Array.isArray(e) ? e : [e]), i = t ||
|
|
740
|
-
return i ? (r.push.apply(r, Array.from(i.querySelectorAll("[aria-live], script"))),
|
|
739
|
+
var r = Array.from(Array.isArray(e) ? e : [e]), i = t || $t(e);
|
|
740
|
+
return i ? (r.push.apply(r, Array.from(i.querySelectorAll("[aria-live], script"))), sn(r, i, n, "aria-hidden")) : function() {
|
|
741
741
|
return null;
|
|
742
742
|
};
|
|
743
|
-
},
|
|
743
|
+
}, ln = Object.defineProperty, I = (e, t) => ln(e, "name", {
|
|
744
744
|
value: t,
|
|
745
745
|
configurable: !0
|
|
746
|
-
}),
|
|
747
|
-
let { __scopeDialog: t, children: n, open: r, defaultOpen: i, onOpenChange: a, modal: o = !0 } = e, s =
|
|
746
|
+
}), un = "Dialog", [dn, fn] = m(un), [pn, L] = dn(un), mn = /* @__PURE__ */ I((e) => {
|
|
747
|
+
let { __scopeDialog: t, children: n, open: r, defaultOpen: i, onOpenChange: a, modal: o = !0 } = e, s = k.useRef(null), c = k.useRef(null), [l, u] = b({
|
|
748
748
|
prop: r,
|
|
749
749
|
defaultProp: i ?? !1,
|
|
750
750
|
onChange: a,
|
|
751
|
-
caller:
|
|
752
|
-
}), [d, f] =
|
|
753
|
-
return /* @__PURE__ */
|
|
751
|
+
caller: un
|
|
752
|
+
}), [d, f] = k.useState(0), [m, h] = k.useState(0);
|
|
753
|
+
return /* @__PURE__ */ D(pn, {
|
|
754
754
|
scope: t,
|
|
755
755
|
triggerRef: s,
|
|
756
756
|
contentRef: c,
|
|
@@ -763,53 +763,53 @@ var en = function(e) {
|
|
|
763
763
|
setDescriptionCount: h,
|
|
764
764
|
open: l,
|
|
765
765
|
onOpenChange: u,
|
|
766
|
-
onOpenToggle:
|
|
766
|
+
onOpenToggle: k.useCallback(() => u((e) => !e), [u]),
|
|
767
767
|
modal: o,
|
|
768
768
|
children: n
|
|
769
769
|
});
|
|
770
|
-
}, "Dialog"),
|
|
771
|
-
let { __scopeDialog: r, ...i } = e, o =
|
|
772
|
-
return /* @__PURE__ */
|
|
770
|
+
}, "Dialog"), hn = "DialogTrigger", gn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
771
|
+
let { __scopeDialog: r, ...i } = e, o = L(hn, r), c = n(t, o.triggerRef);
|
|
772
|
+
return /* @__PURE__ */ D(s.button, {
|
|
773
773
|
type: "button",
|
|
774
774
|
"aria-haspopup": "dialog",
|
|
775
775
|
"aria-expanded": o.open,
|
|
776
776
|
"aria-controls": o.open ? o.contentId : void 0,
|
|
777
|
-
"data-state":
|
|
777
|
+
"data-state": In(o.open),
|
|
778
778
|
...i,
|
|
779
779
|
ref: c,
|
|
780
780
|
onClick: a(e.onClick, o.onOpenToggle)
|
|
781
781
|
});
|
|
782
|
-
}, "DialogTrigger")),
|
|
783
|
-
let { __scopeDialog: t, forceMount: n, children: r, container: a } = e, o =
|
|
784
|
-
return /* @__PURE__ */
|
|
782
|
+
}, "DialogTrigger")), _n = "DialogPortal", [vn, yn] = dn(_n, { forceMount: void 0 }), bn = /* @__PURE__ */ I((e) => {
|
|
783
|
+
let { __scopeDialog: t, forceMount: n, children: r, container: a } = e, o = L(_n, t);
|
|
784
|
+
return /* @__PURE__ */ D(vn, {
|
|
785
785
|
scope: t,
|
|
786
786
|
forceMount: n,
|
|
787
|
-
children:
|
|
787
|
+
children: k.Children.map(r, (e) => /* @__PURE__ */ D(i, {
|
|
788
788
|
present: n || o.open,
|
|
789
|
-
children: /* @__PURE__ */
|
|
789
|
+
children: /* @__PURE__ */ D(c, {
|
|
790
790
|
asChild: !0,
|
|
791
791
|
container: a,
|
|
792
792
|
children: e
|
|
793
793
|
})
|
|
794
794
|
}))
|
|
795
795
|
});
|
|
796
|
-
}, "DialogPortal"),
|
|
797
|
-
let n =
|
|
798
|
-
return o.modal ? /* @__PURE__ */
|
|
796
|
+
}, "DialogPortal"), xn = "DialogOverlay", Sn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
797
|
+
let n = yn(xn, e.__scopeDialog), { forceMount: r = n.forceMount, ...a } = e, o = L(xn, e.__scopeDialog);
|
|
798
|
+
return o.modal ? /* @__PURE__ */ D(i, {
|
|
799
799
|
present: r || o.open,
|
|
800
|
-
children: /* @__PURE__ */
|
|
800
|
+
children: /* @__PURE__ */ D(wn, {
|
|
801
801
|
...a,
|
|
802
802
|
ref: t
|
|
803
803
|
})
|
|
804
804
|
}) : null;
|
|
805
|
-
}, "DialogOverlay")),
|
|
806
|
-
let { __scopeDialog: r, ...i } = e, a =
|
|
807
|
-
return /* @__PURE__ */
|
|
808
|
-
as:
|
|
805
|
+
}, "DialogOverlay")), Cn = d("DialogOverlay.RemoveScroll"), wn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
806
|
+
let { __scopeDialog: r, ...i } = e, a = L(xn, r), o = n(t, v());
|
|
807
|
+
return /* @__PURE__ */ D(Qt, {
|
|
808
|
+
as: Cn,
|
|
809
809
|
allowPinchZoom: !0,
|
|
810
810
|
shards: [a.contentRef],
|
|
811
|
-
children: /* @__PURE__ */
|
|
812
|
-
"data-state":
|
|
811
|
+
children: /* @__PURE__ */ D(s.div, {
|
|
812
|
+
"data-state": In(a.open),
|
|
813
813
|
...i,
|
|
814
814
|
ref: o,
|
|
815
815
|
style: {
|
|
@@ -818,24 +818,24 @@ var en = function(e) {
|
|
|
818
818
|
}
|
|
819
819
|
})
|
|
820
820
|
});
|
|
821
|
-
}, "DialogOverlayImpl")),
|
|
822
|
-
let n =
|
|
823
|
-
return /* @__PURE__ */
|
|
821
|
+
}, "DialogOverlayImpl")), Tn = "DialogContent", En = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
822
|
+
let n = yn(Tn, e.__scopeDialog), { forceMount: r = n.forceMount, ...a } = e, o = L(Tn, e.__scopeDialog);
|
|
823
|
+
return /* @__PURE__ */ D(i, {
|
|
824
824
|
present: r || o.open,
|
|
825
|
-
children: o.modal ? /* @__PURE__ */
|
|
825
|
+
children: o.modal ? /* @__PURE__ */ D(Dn, {
|
|
826
826
|
...a,
|
|
827
827
|
ref: t
|
|
828
|
-
}) : /* @__PURE__ */
|
|
828
|
+
}) : /* @__PURE__ */ D(On, {
|
|
829
829
|
...a,
|
|
830
830
|
ref: t
|
|
831
831
|
})
|
|
832
832
|
});
|
|
833
|
-
}, "DialogContent")),
|
|
834
|
-
let r =
|
|
835
|
-
return
|
|
833
|
+
}, "DialogContent")), Dn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
834
|
+
let r = L(Tn, e.__scopeDialog), i = k.useRef(null), o = n(t, r.contentRef, i);
|
|
835
|
+
return k.useEffect(() => {
|
|
836
836
|
let e = i.current;
|
|
837
|
-
if (e) return
|
|
838
|
-
}, []), /* @__PURE__ */
|
|
837
|
+
if (e) return cn(e);
|
|
838
|
+
}, []), /* @__PURE__ */ D(kn, {
|
|
839
839
|
...e,
|
|
840
840
|
ref: o,
|
|
841
841
|
trapFocus: r.open,
|
|
@@ -849,9 +849,9 @@ var en = function(e) {
|
|
|
849
849
|
}),
|
|
850
850
|
onFocusOutside: a(e.onFocusOutside, (e) => e.preventDefault())
|
|
851
851
|
});
|
|
852
|
-
}, "DialogContentModal")),
|
|
853
|
-
let n =
|
|
854
|
-
return /* @__PURE__ */
|
|
852
|
+
}, "DialogContentModal")), On = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
853
|
+
let n = L(Tn, e.__scopeDialog), r = k.useRef(!1), i = k.useRef(!1);
|
|
854
|
+
return /* @__PURE__ */ D(kn, {
|
|
855
855
|
...e,
|
|
856
856
|
ref: t,
|
|
857
857
|
trapFocus: !1,
|
|
@@ -865,83 +865,83 @@ var en = function(e) {
|
|
|
865
865
|
n.triggerRef.current?.contains(a) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && i.current && t.preventDefault();
|
|
866
866
|
}
|
|
867
867
|
});
|
|
868
|
-
}, "DialogContentNonModal")),
|
|
869
|
-
let { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, ...o } = e, s =
|
|
870
|
-
return
|
|
868
|
+
}, "DialogContentNonModal")), kn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
869
|
+
let { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, ...o } = e, s = L(Tn, n);
|
|
870
|
+
return We(), /* @__PURE__ */ D(re, { children: /* @__PURE__ */ D(De, {
|
|
871
871
|
asChild: !0,
|
|
872
872
|
loop: !0,
|
|
873
873
|
trapped: r,
|
|
874
874
|
onMountAutoFocus: i,
|
|
875
875
|
onUnmountAutoFocus: a,
|
|
876
|
-
children: /* @__PURE__ */
|
|
876
|
+
children: /* @__PURE__ */ D(ee, {
|
|
877
877
|
role: "dialog",
|
|
878
878
|
id: s.contentId,
|
|
879
879
|
"aria-describedby": s.descriptionPresent ? s.descriptionId : void 0,
|
|
880
880
|
"aria-labelledby": s.titlePresent ? s.titleId : void 0,
|
|
881
|
-
"data-state":
|
|
881
|
+
"data-state": In(s.open),
|
|
882
882
|
...o,
|
|
883
883
|
ref: t,
|
|
884
884
|
deferPointerDownOutside: !0,
|
|
885
885
|
onDismiss: () => s.onOpenChange(!1)
|
|
886
886
|
})
|
|
887
887
|
}) });
|
|
888
|
-
}, "DialogContentImpl")),
|
|
889
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
890
|
-
return T(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */
|
|
888
|
+
}, "DialogContentImpl")), An = "DialogTitle", jn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
889
|
+
let { __scopeDialog: n, ...r } = e, i = L(An, n), { setTitleCount: a } = i;
|
|
890
|
+
return T(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */ D(s.h2, {
|
|
891
891
|
id: i.titleId,
|
|
892
892
|
...r,
|
|
893
893
|
ref: t
|
|
894
894
|
});
|
|
895
|
-
}, "DialogTitle")),
|
|
896
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
897
|
-
return T(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */
|
|
895
|
+
}, "DialogTitle")), Mn = "DialogDescription", Nn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
896
|
+
let { __scopeDialog: n, ...r } = e, i = L(Mn, n), { setDescriptionCount: a } = i;
|
|
897
|
+
return T(() => (a((e) => e + 1), () => a((e) => e - 1)), [a]), /* @__PURE__ */ D(s.p, {
|
|
898
898
|
id: i.descriptionId,
|
|
899
899
|
...r,
|
|
900
900
|
ref: t
|
|
901
901
|
});
|
|
902
|
-
}, "DialogDescription")),
|
|
903
|
-
let { __scopeDialog: n, ...r } = e, i =
|
|
904
|
-
return /* @__PURE__ */
|
|
902
|
+
}, "DialogDescription")), Pn = "DialogClose", Fn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ I(function(e, t) {
|
|
903
|
+
let { __scopeDialog: n, ...r } = e, i = L(Pn, n);
|
|
904
|
+
return /* @__PURE__ */ D(s.button, {
|
|
905
905
|
type: "button",
|
|
906
906
|
...r,
|
|
907
907
|
ref: t,
|
|
908
908
|
onClick: a(e.onClick, () => i.onOpenChange(!1))
|
|
909
909
|
});
|
|
910
910
|
}, "DialogClose"));
|
|
911
|
-
function
|
|
911
|
+
function In(e) {
|
|
912
912
|
return e ? "open" : "closed";
|
|
913
913
|
}
|
|
914
|
-
|
|
914
|
+
I(In, "getState");
|
|
915
915
|
//#endregion
|
|
916
916
|
//#region ../../node_modules/@radix-ui/react-label/dist/index.mjs
|
|
917
|
-
var
|
|
917
|
+
var Ln = Object.defineProperty, Rn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ ((e, t) => Ln(e, "name", {
|
|
918
918
|
value: t,
|
|
919
919
|
configurable: !0
|
|
920
920
|
}))(function(e, t) {
|
|
921
|
-
return /* @__PURE__ */
|
|
921
|
+
return /* @__PURE__ */ D(s.label, {
|
|
922
922
|
...e,
|
|
923
923
|
ref: t,
|
|
924
924
|
onMouseDown: (t) => {
|
|
925
925
|
t.target.closest("button, input, select, textarea") || (e.onMouseDown?.(t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
|
|
926
926
|
}
|
|
927
927
|
});
|
|
928
|
-
}, "Label")),
|
|
928
|
+
}, "Label")), zn = Object.defineProperty, R = (e, t) => zn(e, "name", {
|
|
929
929
|
value: t,
|
|
930
930
|
configurable: !0
|
|
931
|
-
}),
|
|
932
|
-
let { __scopeHoverCard: t, children: n, open: r, defaultOpen: i, onOpenChange: a, openDelay: o = 700, closeDelay: s = 300 } = e, c =
|
|
931
|
+
}), Bn, Vn = "HoverCard", [Hn, Un] = m(Vn, [l]), Wn = l(), [Gn, Kn] = Hn(Vn), qn = /* @__PURE__ */ R((e) => {
|
|
932
|
+
let { __scopeHoverCard: t, children: n, open: r, defaultOpen: i, onOpenChange: a, openDelay: o = 700, closeDelay: s = 300 } = e, c = Wn(t), l = k.useRef(0), d = k.useRef(0), f = k.useRef(!1), p = k.useRef(!1), [m, h] = b({
|
|
933
933
|
prop: r,
|
|
934
934
|
defaultProp: i ?? !1,
|
|
935
935
|
onChange: a,
|
|
936
|
-
caller:
|
|
937
|
-
}), g =
|
|
936
|
+
caller: Vn
|
|
937
|
+
}), g = k.useCallback(() => {
|
|
938
938
|
clearTimeout(d.current), l.current = window.setTimeout(() => h(!0), o);
|
|
939
|
-
}, [o, h]), _ =
|
|
939
|
+
}, [o, h]), _ = k.useCallback(() => {
|
|
940
940
|
clearTimeout(l.current), !f.current && !p.current && (d.current = window.setTimeout(() => h(!1), s));
|
|
941
|
-
}, [s, h]), v =
|
|
942
|
-
return
|
|
941
|
+
}, [s, h]), v = k.useCallback(() => h(!1), [h]);
|
|
942
|
+
return k.useEffect(() => () => {
|
|
943
943
|
clearTimeout(l.current), clearTimeout(d.current);
|
|
944
|
-
}, []), /* @__PURE__ */
|
|
944
|
+
}, []), /* @__PURE__ */ D(Gn, {
|
|
945
945
|
scope: t,
|
|
946
946
|
open: m,
|
|
947
947
|
onOpenChange: h,
|
|
@@ -950,65 +950,65 @@ var Rn = Object.defineProperty, zn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ *
|
|
|
950
950
|
onDismiss: v,
|
|
951
951
|
hasSelectionRef: f,
|
|
952
952
|
isPointerDownOnContentRef: p,
|
|
953
|
-
children: /* @__PURE__ */
|
|
953
|
+
children: /* @__PURE__ */ D(u, {
|
|
954
954
|
...c,
|
|
955
955
|
children: n
|
|
956
956
|
})
|
|
957
957
|
});
|
|
958
|
-
}, "HoverCard"),
|
|
959
|
-
let { __scopeHoverCard: n, ...r } = e, i =
|
|
960
|
-
return /* @__PURE__ */
|
|
958
|
+
}, "HoverCard"), Jn = "HoverCardTrigger", Yn = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
959
|
+
let { __scopeHoverCard: n, ...r } = e, i = Kn(Jn, n);
|
|
960
|
+
return /* @__PURE__ */ D(x, {
|
|
961
961
|
asChild: !0,
|
|
962
|
-
...
|
|
963
|
-
children: /* @__PURE__ */
|
|
962
|
+
...Wn(n),
|
|
963
|
+
children: /* @__PURE__ */ D(s.a, {
|
|
964
964
|
"data-state": i.open ? "open" : "closed",
|
|
965
965
|
...r,
|
|
966
966
|
ref: t,
|
|
967
|
-
onPointerEnter: a(e.onPointerEnter,
|
|
968
|
-
onPointerLeave: a(e.onPointerLeave,
|
|
967
|
+
onPointerEnter: a(e.onPointerEnter, rr(i.onOpen)),
|
|
968
|
+
onPointerLeave: a(e.onPointerLeave, rr(i.onClose)),
|
|
969
969
|
onFocus: a(e.onFocus, i.onOpen),
|
|
970
970
|
onBlur: a(e.onBlur, i.onClose),
|
|
971
971
|
onTouchStart: a(e.onTouchStart, (e) => e.preventDefault())
|
|
972
972
|
})
|
|
973
973
|
});
|
|
974
|
-
}, "HoverCardTrigger")),
|
|
975
|
-
let { __scopeHoverCard: t, forceMount: n, children: r, container: a } = e, o =
|
|
976
|
-
return /* @__PURE__ */
|
|
974
|
+
}, "HoverCardTrigger")), Xn = "HoverCardPortal", [Zn, Qn] = Hn(Xn, { forceMount: void 0 }), $n = /* @__PURE__ */ R((e) => {
|
|
975
|
+
let { __scopeHoverCard: t, forceMount: n, children: r, container: a } = e, o = Kn(Xn, t);
|
|
976
|
+
return /* @__PURE__ */ D(Zn, {
|
|
977
977
|
scope: t,
|
|
978
978
|
forceMount: n,
|
|
979
|
-
children: /* @__PURE__ */
|
|
979
|
+
children: /* @__PURE__ */ D(i, {
|
|
980
980
|
present: n || o.open,
|
|
981
|
-
children: /* @__PURE__ */
|
|
981
|
+
children: /* @__PURE__ */ D(c, {
|
|
982
982
|
asChild: !0,
|
|
983
983
|
container: a,
|
|
984
984
|
children: r
|
|
985
985
|
})
|
|
986
986
|
})
|
|
987
987
|
});
|
|
988
|
-
}, "HoverCardPortal"),
|
|
989
|
-
let n =
|
|
990
|
-
return /* @__PURE__ */
|
|
988
|
+
}, "HoverCardPortal"), er = "HoverCardContent", tr = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
989
|
+
let n = Qn(er, e.__scopeHoverCard), { forceMount: r = n.forceMount, ...o } = e, s = Kn(er, e.__scopeHoverCard);
|
|
990
|
+
return /* @__PURE__ */ D(i, {
|
|
991
991
|
present: r || s.open,
|
|
992
|
-
children: /* @__PURE__ */
|
|
992
|
+
children: /* @__PURE__ */ D(nr, {
|
|
993
993
|
"data-state": s.open ? "open" : "closed",
|
|
994
994
|
...o,
|
|
995
|
-
onPointerEnter: a(e.onPointerEnter,
|
|
996
|
-
onPointerLeave: a(e.onPointerLeave,
|
|
995
|
+
onPointerEnter: a(e.onPointerEnter, rr(s.onOpen)),
|
|
996
|
+
onPointerLeave: a(e.onPointerLeave, rr(s.onClose)),
|
|
997
997
|
ref: t
|
|
998
998
|
})
|
|
999
999
|
});
|
|
1000
|
-
}, "HoverCardContent")),
|
|
1001
|
-
let { __scopeHoverCard: r, onEscapeKeyDown: i, onPointerDownOutside: o, onFocusOutside: s, onInteractOutside: c, ...l } = e, u =
|
|
1002
|
-
return
|
|
1000
|
+
}, "HoverCardContent")), nr = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ R(function(e, t) {
|
|
1001
|
+
let { __scopeHoverCard: r, onEscapeKeyDown: i, onPointerDownOutside: o, onFocusOutside: s, onInteractOutside: c, ...l } = e, u = Kn(er, r), d = Wn(r), f = k.useRef(null), p = n(t, f), [m, g] = k.useState(!1);
|
|
1002
|
+
return k.useEffect(() => {
|
|
1003
1003
|
if (m) {
|
|
1004
1004
|
let e = document.body;
|
|
1005
|
-
return
|
|
1006
|
-
e.style.userSelect =
|
|
1005
|
+
return Bn = e.style.userSelect || e.style.webkitUserSelect, e.style.userSelect = "none", e.style.webkitUserSelect = "none", () => {
|
|
1006
|
+
e.style.userSelect = Bn, e.style.webkitUserSelect = Bn;
|
|
1007
1007
|
};
|
|
1008
1008
|
}
|
|
1009
|
-
}, [m]),
|
|
1009
|
+
}, [m]), k.useEffect(() => {
|
|
1010
1010
|
if (f.current) {
|
|
1011
|
-
let e = /* @__PURE__ */
|
|
1011
|
+
let e = /* @__PURE__ */ R(() => {
|
|
1012
1012
|
g(!1), u.isPointerDownOnContentRef.current = !1, setTimeout(() => {
|
|
1013
1013
|
document.getSelection()?.toString() !== "" && (u.hasSelectionRef.current = !0);
|
|
1014
1014
|
});
|
|
@@ -1017,9 +1017,9 @@ var Rn = Object.defineProperty, zn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ *
|
|
|
1017
1017
|
document.removeEventListener("pointerup", e), u.hasSelectionRef.current = !1, u.isPointerDownOnContentRef.current = !1;
|
|
1018
1018
|
};
|
|
1019
1019
|
}
|
|
1020
|
-
}, [u.isPointerDownOnContentRef, u.hasSelectionRef]),
|
|
1021
|
-
f.current &&
|
|
1022
|
-
}), /* @__PURE__ */
|
|
1020
|
+
}, [u.isPointerDownOnContentRef, u.hasSelectionRef]), k.useEffect(() => {
|
|
1021
|
+
f.current && ir(f.current).forEach((e) => e.setAttribute("tabindex", "-1"));
|
|
1022
|
+
}), /* @__PURE__ */ D(ee, {
|
|
1023
1023
|
asChild: !0,
|
|
1024
1024
|
disableOutsidePointerEvents: !1,
|
|
1025
1025
|
onInteractOutside: c,
|
|
@@ -1029,7 +1029,7 @@ var Rn = Object.defineProperty, zn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ *
|
|
|
1029
1029
|
e.preventDefault();
|
|
1030
1030
|
}),
|
|
1031
1031
|
onDismiss: u.onDismiss,
|
|
1032
|
-
children: /* @__PURE__ */
|
|
1032
|
+
children: /* @__PURE__ */ D(h, {
|
|
1033
1033
|
...d,
|
|
1034
1034
|
...l,
|
|
1035
1035
|
onPointerDown: a(l.onPointerDown, (e) => {
|
|
@@ -1049,17 +1049,17 @@ var Rn = Object.defineProperty, zn = /* @__PURE__ */ O.forwardRef(/* @__PURE__ *
|
|
|
1049
1049
|
})
|
|
1050
1050
|
});
|
|
1051
1051
|
}, "HoverCardContentImpl"));
|
|
1052
|
-
function
|
|
1052
|
+
function rr(e) {
|
|
1053
1053
|
return (t) => t.pointerType === "touch" ? void 0 : e();
|
|
1054
1054
|
}
|
|
1055
|
-
|
|
1056
|
-
function
|
|
1057
|
-
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */
|
|
1055
|
+
R(rr, "excludeTouch");
|
|
1056
|
+
function ir(e) {
|
|
1057
|
+
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: /* @__PURE__ */ R((e) => e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP, "acceptNode") });
|
|
1058
1058
|
for (; n.nextNode();) t.push(n.currentNode);
|
|
1059
1059
|
return t;
|
|
1060
1060
|
}
|
|
1061
|
-
|
|
1062
|
-
var
|
|
1061
|
+
R(ir, "getTabbableNodes");
|
|
1062
|
+
var ar = qn, or = Yn, sr = $n, cr = tr, lr = o("transition-all duration-500", {
|
|
1063
1063
|
variants: {
|
|
1064
1064
|
variant: {
|
|
1065
1065
|
1: "",
|
|
@@ -1245,9 +1245,9 @@ var or = Jn, sr = Xn, cr = er, lr = nr, ur = o("transition-all duration-500", {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
]
|
|
1247
1247
|
});
|
|
1248
|
-
function
|
|
1249
|
-
let { t: a } =
|
|
1250
|
-
return e === "4" ? /* @__PURE__ */
|
|
1248
|
+
function ur({ variant: e = "1", color: n, className: r, ...i }) {
|
|
1249
|
+
let { t: a } = te();
|
|
1250
|
+
return e === "4" ? /* @__PURE__ */ D("svg", {
|
|
1251
1251
|
viewBox: "0 0 800 800",
|
|
1252
1252
|
"data-slot": "spinner",
|
|
1253
1253
|
"data-variant": e,
|
|
@@ -1256,8 +1256,8 @@ function dr({ variant: e = "1", color: n, className: r, ...i }) {
|
|
|
1256
1256
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1257
1257
|
role: "img",
|
|
1258
1258
|
"aria-label": i["aria-label"] ?? a("material.spinner.loading", "Loading..."),
|
|
1259
|
-
children: /* @__PURE__ */
|
|
1260
|
-
className: t("spin2",
|
|
1259
|
+
children: /* @__PURE__ */ D("circle", {
|
|
1260
|
+
className: t("spin2", lr({
|
|
1261
1261
|
variant: e,
|
|
1262
1262
|
color: n
|
|
1263
1263
|
})),
|
|
@@ -1269,11 +1269,11 @@ function dr({ variant: e = "1", color: n, className: r, ...i }) {
|
|
|
1269
1269
|
strokeDasharray: "700 1400",
|
|
1270
1270
|
strokeLinecap: "round"
|
|
1271
1271
|
})
|
|
1272
|
-
}) : /* @__PURE__ */
|
|
1272
|
+
}) : /* @__PURE__ */ D("div", {
|
|
1273
1273
|
"data-slot": "spinner",
|
|
1274
1274
|
"data-variant": e,
|
|
1275
1275
|
"data-color": n,
|
|
1276
|
-
className: t("size-12 border-[2px] rounded-full animate-spin",
|
|
1276
|
+
className: t("size-12 border-[2px] rounded-full animate-spin", lr({
|
|
1277
1277
|
variant: e,
|
|
1278
1278
|
color: n,
|
|
1279
1279
|
className: r
|
|
@@ -1283,7 +1283,7 @@ function dr({ variant: e = "1", color: n, className: r, ...i }) {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
//#endregion
|
|
1285
1285
|
//#region lib/components/ui/actions/button/busy-click-capture.ts
|
|
1286
|
-
function
|
|
1286
|
+
function dr(e, t, n) {
|
|
1287
1287
|
return (r) => {
|
|
1288
1288
|
if (e || t.isLocked()) {
|
|
1289
1289
|
r.preventDefault(), r.stopPropagation();
|
|
@@ -1294,7 +1294,7 @@ function fr(e, t, n) {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
//#endregion
|
|
1296
1296
|
//#region lib/components/ui/actions/button/button.variants.ts
|
|
1297
|
-
var
|
|
1297
|
+
var fr = o("inline-flex center truncate **:truncate gap-2 h-min cursor-pointer whitespace-nowrap rounded-full text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 aria-busy:cursor-progress [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error px-4 py-2 has-[>svg]:px-3", {
|
|
1298
1298
|
variants: {
|
|
1299
1299
|
variant: {
|
|
1300
1300
|
filled: "shadow-xs",
|
|
@@ -1469,108 +1469,114 @@ var pr = o("inline-flex center truncate **:truncate gap-2 h-min cursor-pointer w
|
|
|
1469
1469
|
class: `${f.default} ${C.default} hover:bg-foreground/10 active:bg-muted focus:bg-foreground/15`
|
|
1470
1470
|
}
|
|
1471
1471
|
]
|
|
1472
|
-
}),
|
|
1472
|
+
}), pr = {
|
|
1473
1473
|
xs: "min-h-6",
|
|
1474
1474
|
sm: "min-h-8",
|
|
1475
1475
|
default: "min-h-9",
|
|
1476
1476
|
lg: "min-h-10"
|
|
1477
1477
|
};
|
|
1478
|
-
function
|
|
1479
|
-
return !e || t?.startsWith("icon") ? !1 : `h-auto ${t ?
|
|
1478
|
+
function mr(e, t) {
|
|
1479
|
+
return !e || t?.startsWith("icon") ? !1 : `h-auto ${t ? pr[t] : ""} whitespace-normal **:whitespace-normal text-center`;
|
|
1480
1480
|
}
|
|
1481
1481
|
//#endregion
|
|
1482
1482
|
//#region lib/components/ui/actions/button/has-text-content.ts
|
|
1483
|
-
function
|
|
1484
|
-
return e == null || typeof e == "boolean" ? !1 : typeof e == "string" || typeof e == "number" || typeof e == "bigint" ? String(e).trim() !== "" : Array.isArray(e) ? e.some(
|
|
1483
|
+
function hr(e) {
|
|
1484
|
+
return e == null || typeof e == "boolean" ? !1 : typeof e == "string" || typeof e == "number" || typeof e == "bigint" ? String(e).trim() !== "" : Array.isArray(e) ? e.some(hr) : ce(e) ? !gr(e.props["aria-hidden"]) && hr(e.props.children) : !1;
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function gr(e) {
|
|
1487
1487
|
return !!e && e !== "false";
|
|
1488
1488
|
}
|
|
1489
1489
|
//#endregion
|
|
1490
1490
|
//#region lib/components/ui/actions/button/label-text.tsx
|
|
1491
|
-
function
|
|
1491
|
+
function _r(e) {
|
|
1492
1492
|
let t = [], n = 0, r = [], i = () => {
|
|
1493
1493
|
if (r.length === 0) return;
|
|
1494
1494
|
let e = r.join("");
|
|
1495
|
-
r = [], e.trim() === "" ? t.push(e) : t.push(/* @__PURE__ */
|
|
1495
|
+
r = [], e.trim() === "" ? t.push(e) : t.push(/* @__PURE__ */ D("span", {
|
|
1496
1496
|
"data-slot": "button-label",
|
|
1497
1497
|
children: e
|
|
1498
1498
|
}, `label-${n++}`));
|
|
1499
1499
|
};
|
|
1500
|
-
for (let n of
|
|
1500
|
+
for (let n of j.toArray(e)) {
|
|
1501
1501
|
if (typeof n == "string" || typeof n == "number" || typeof n == "bigint") {
|
|
1502
1502
|
r.push(n);
|
|
1503
1503
|
continue;
|
|
1504
1504
|
}
|
|
1505
|
-
i(), t.push(
|
|
1505
|
+
i(), t.push(vr(n));
|
|
1506
1506
|
}
|
|
1507
1507
|
return i(), t;
|
|
1508
1508
|
}
|
|
1509
|
-
function
|
|
1510
|
-
return
|
|
1509
|
+
function vr(e) {
|
|
1510
|
+
return ce(e) && e.type === ae ? oe(e, void 0, _r(e.props.children)) : e;
|
|
1511
1511
|
}
|
|
1512
1512
|
//#endregion
|
|
1513
1513
|
//#region lib/components/ui/actions/button/use-click-lock.ts
|
|
1514
|
-
var
|
|
1515
|
-
function
|
|
1516
|
-
let n =
|
|
1514
|
+
var yr = 1e3;
|
|
1515
|
+
function br(e, t) {
|
|
1516
|
+
let n = N(!1), r = N(!1), i = N(void 0), [a, o] = he(!1), s = M(() => {
|
|
1517
1517
|
n.current = !1, r.current = !1, clearTimeout(i.current), o(!1);
|
|
1518
|
-
}, []), c =
|
|
1518
|
+
}, []), c = M(() => {
|
|
1519
1519
|
e && (n.current = !0, o(!0), clearTimeout(i.current), i.current = setTimeout(() => {
|
|
1520
1520
|
r.current || s();
|
|
1521
|
-
},
|
|
1521
|
+
}, yr));
|
|
1522
1522
|
}, [e, s]);
|
|
1523
|
-
return
|
|
1523
|
+
return de(() => {
|
|
1524
1524
|
n.current && (t ? r.current = !0 : r.current && s());
|
|
1525
|
-
}, [t, s]),
|
|
1525
|
+
}, [t, s]), de(() => () => clearTimeout(i.current), []), {
|
|
1526
1526
|
locked: a,
|
|
1527
1527
|
lock: c,
|
|
1528
|
-
isLocked:
|
|
1528
|
+
isLocked: M(() => n.current, [])
|
|
1529
1529
|
};
|
|
1530
1530
|
}
|
|
1531
1531
|
//#endregion
|
|
1532
1532
|
//#region lib/components/ui/actions/button/button.tsx
|
|
1533
|
-
function
|
|
1534
|
-
let _ = i ? S : "button", v =
|
|
1535
|
-
return /* @__PURE__ */
|
|
1533
|
+
function xr({ className: e, variant: n = "filled", asChild: i = !1, children: a, color: o, size: s, loading: c = !1, lockOnClick: l, spinnerVariant: u = "2", wrap: d, disabled: f, onClickCapture: p, type: m = "button", ...h }) {
|
|
1534
|
+
let _ = i ? S : "button", v = ue(r) || !!(h["aria-label"] || h["aria-labelledby"]) || hr(a), y = br(l, c), b = c || y.locked, x = dr(b, y, p);
|
|
1535
|
+
return /* @__PURE__ */ D(r, {
|
|
1536
1536
|
value: v,
|
|
1537
|
-
children: /* @__PURE__ */
|
|
1537
|
+
children: /* @__PURE__ */ O(_, {
|
|
1538
1538
|
"data-slot": "button",
|
|
1539
1539
|
"data-variant": n,
|
|
1540
1540
|
"data-color": o,
|
|
1541
|
-
className: t("w-fit max-w-full truncate justify-center line-clamp-1 text-ellipsis duration-500",
|
|
1541
|
+
className: t("w-fit max-w-full truncate justify-center line-clamp-1 text-ellipsis duration-500", fr({
|
|
1542
1542
|
variant: n,
|
|
1543
1543
|
color: o,
|
|
1544
1544
|
size: s
|
|
1545
|
-
}),
|
|
1545
|
+
}), mr(d, s), e),
|
|
1546
1546
|
type: i ? void 0 : m,
|
|
1547
1547
|
disabled: f,
|
|
1548
1548
|
...h,
|
|
1549
1549
|
"aria-disabled": b || h["aria-disabled"],
|
|
1550
1550
|
"aria-busy": b || h["aria-busy"],
|
|
1551
1551
|
onClickCapture: x,
|
|
1552
|
-
children: [b && /* @__PURE__ */
|
|
1552
|
+
children: [b && /* @__PURE__ */ D(ur, {
|
|
1553
1553
|
variant: u,
|
|
1554
1554
|
color: n === "filled" ? "light" : o,
|
|
1555
1555
|
className: t("starting:scale-0 duration-500", u === "4" ? "size-7.5" : "size-4.5")
|
|
1556
|
-
}), /* @__PURE__ */
|
|
1556
|
+
}), /* @__PURE__ */ D(g, { children: i ? a : _r(a) })]
|
|
1557
1557
|
})
|
|
1558
1558
|
});
|
|
1559
1559
|
}
|
|
1560
|
-
function
|
|
1561
|
-
return e ? /* @__PURE__ */
|
|
1560
|
+
function Sr({ tooltip: e, ...t }) {
|
|
1561
|
+
return e ? /* @__PURE__ */ D(y, {
|
|
1562
1562
|
content: e,
|
|
1563
|
-
children: /* @__PURE__ */
|
|
1564
|
-
}) : /* @__PURE__ */
|
|
1563
|
+
children: /* @__PURE__ */ D(xr, { ...t })
|
|
1564
|
+
}) : /* @__PURE__ */ D(xr, { ...t });
|
|
1565
|
+
}
|
|
1566
|
+
//#endregion
|
|
1567
|
+
//#region lib/components/ui/overlays/dialog/in-dialog.ts
|
|
1568
|
+
var Cr = se(!1);
|
|
1569
|
+
function wr() {
|
|
1570
|
+
return ue(Cr);
|
|
1565
1571
|
}
|
|
1566
1572
|
//#endregion
|
|
1567
1573
|
//#region lib/components/ui/overlays/dialog/use-inert-others.ts
|
|
1568
|
-
var
|
|
1569
|
-
function
|
|
1570
|
-
let [r, i] =
|
|
1571
|
-
return
|
|
1574
|
+
var Tr = se(void 0);
|
|
1575
|
+
function Er(e, t) {
|
|
1576
|
+
let [r, i] = he(null), [a, o] = Dr(r), s = N(null);
|
|
1577
|
+
return de(() => {
|
|
1572
1578
|
if (!e || !a || !r || r.getAttribute("data-state") === "closed") return;
|
|
1573
|
-
let t =
|
|
1579
|
+
let t = _e(r);
|
|
1574
1580
|
return s.current = t, () => {
|
|
1575
1581
|
s.current = null, t();
|
|
1576
1582
|
};
|
|
@@ -1578,13 +1584,13 @@ function Tr(e, t) {
|
|
|
1578
1584
|
e,
|
|
1579
1585
|
a,
|
|
1580
1586
|
r
|
|
1581
|
-
]),
|
|
1587
|
+
]), pe(() => {
|
|
1582
1588
|
!a || r?.getAttribute("data-state") !== "closed" || (s.current?.(), o(!1));
|
|
1583
1589
|
}), n(i, t);
|
|
1584
1590
|
}
|
|
1585
|
-
function
|
|
1586
|
-
let [t, n] =
|
|
1587
|
-
return
|
|
1591
|
+
function Dr(e) {
|
|
1592
|
+
let [t, n] = he(!0);
|
|
1593
|
+
return de(() => {
|
|
1588
1594
|
let t = e?.ownerDocument.defaultView?.MutationObserver;
|
|
1589
1595
|
if (!e || !t) return;
|
|
1590
1596
|
let r = () => n(e.getAttribute("data-state") !== "closed");
|
|
@@ -1593,28 +1599,28 @@ function Er(e) {
|
|
|
1593
1599
|
return i.observe(e, { attributeFilter: ["data-state"] }), () => i.disconnect();
|
|
1594
1600
|
}, [e]), [t, n];
|
|
1595
1601
|
}
|
|
1596
|
-
function
|
|
1597
|
-
return
|
|
1602
|
+
function Or(e, t) {
|
|
1603
|
+
return Er(ue(Tr) ?? e, t);
|
|
1598
1604
|
}
|
|
1599
1605
|
//#endregion
|
|
1600
1606
|
//#region ../../node_modules/react-use/esm/misc/util.js
|
|
1601
|
-
var
|
|
1602
|
-
function
|
|
1607
|
+
var kr = function() {};
|
|
1608
|
+
function Ar(e) {
|
|
1603
1609
|
var t = [...arguments].slice(1);
|
|
1604
1610
|
e && e.addEventListener && e.addEventListener.apply(e, t);
|
|
1605
1611
|
}
|
|
1606
|
-
function
|
|
1612
|
+
function jr(e) {
|
|
1607
1613
|
var t = [...arguments].slice(1);
|
|
1608
1614
|
e && e.removeEventListener && e.removeEventListener.apply(e, t);
|
|
1609
1615
|
}
|
|
1610
|
-
var
|
|
1616
|
+
var Mr = typeof window < "u", Nr = Mr ? window : null, Pr = function(e) {
|
|
1611
1617
|
return !!e.addEventListener;
|
|
1612
|
-
},
|
|
1618
|
+
}, Fr = function(e) {
|
|
1613
1619
|
return !!e.on;
|
|
1614
|
-
},
|
|
1615
|
-
n === void 0 && (n =
|
|
1616
|
-
if (t && n) return
|
|
1617
|
-
|
|
1620
|
+
}, Ir = function(e, t, n, r) {
|
|
1621
|
+
n === void 0 && (n = Nr), de(function() {
|
|
1622
|
+
if (t && n) return Pr(n) ? Ar(n, e, t, r) : Fr(n) && n.on(e, t, r), function() {
|
|
1623
|
+
Pr(n) ? jr(n, e, t, r) : Fr(n) && n.off(e, t, r);
|
|
1618
1624
|
};
|
|
1619
1625
|
}, [
|
|
1620
1626
|
e,
|
|
@@ -1622,57 +1628,69 @@ var jr = typeof window < "u", Mr = jr ? window : null, Nr = function(e) {
|
|
|
1622
1628
|
n,
|
|
1623
1629
|
JSON.stringify(r)
|
|
1624
1630
|
]);
|
|
1625
|
-
},
|
|
1626
|
-
var t =
|
|
1631
|
+
}, Lr = function(e) {
|
|
1632
|
+
var t = N(e);
|
|
1627
1633
|
return t.current = e, t;
|
|
1628
|
-
},
|
|
1629
|
-
variants: {
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1634
|
+
}, Rr = o("in-[[data-state=selected]]:text-primary-foreground", {
|
|
1635
|
+
variants: {
|
|
1636
|
+
variant: {
|
|
1637
|
+
normal: "text-sm",
|
|
1638
|
+
"huge-larger": "text-8xl font-semibold",
|
|
1639
|
+
"huge-large": "text-8xl font-semibold",
|
|
1640
|
+
"huge-medium": "text-7xl font-semibold",
|
|
1641
|
+
"huge-small": "text-6xl font-semibold",
|
|
1642
|
+
"headline-larger": "text-5xl font-semibold",
|
|
1643
|
+
"headline-large": "text-4xl font-semibold",
|
|
1644
|
+
"headline-medium": "text-3xl font-semibold",
|
|
1645
|
+
"headline-small": "text-2xl font-semibold",
|
|
1646
|
+
"title-large": "text-xl font-semibold",
|
|
1647
|
+
"title-medium": "text-lg font-semibold",
|
|
1648
|
+
"title-small": "text-base font-semibold",
|
|
1649
|
+
"body-medium": "text-sm",
|
|
1650
|
+
"body-small": "text-xs",
|
|
1651
|
+
caption: "text-[10px] text-muted-foreground"
|
|
1652
|
+
},
|
|
1653
|
+
tone: {
|
|
1654
|
+
default: "",
|
|
1655
|
+
muted: "text-muted-foreground",
|
|
1656
|
+
primary: "text-primary",
|
|
1657
|
+
error: "text-error-text"
|
|
1658
|
+
}
|
|
1659
|
+
},
|
|
1660
|
+
defaultVariants: {
|
|
1661
|
+
variant: "normal",
|
|
1662
|
+
tone: "default"
|
|
1663
|
+
}
|
|
1647
1664
|
});
|
|
1648
|
-
function
|
|
1649
|
-
return /* @__PURE__ */
|
|
1665
|
+
function zr({ className: e, variant: n, tone: r, as: i = "div", asChild: a = !1, ...o }) {
|
|
1666
|
+
return /* @__PURE__ */ D(a ? S : i, {
|
|
1650
1667
|
"data-test": "typography",
|
|
1651
|
-
className: t(
|
|
1668
|
+
className: t(Rr({
|
|
1652
1669
|
variant: n,
|
|
1670
|
+
tone: r,
|
|
1653
1671
|
className: e
|
|
1654
1672
|
})),
|
|
1655
|
-
...
|
|
1673
|
+
...o
|
|
1656
1674
|
});
|
|
1657
1675
|
}
|
|
1658
1676
|
//#endregion
|
|
1659
1677
|
//#region lib/components/ui/forms/field-blur-context.ts
|
|
1660
|
-
var
|
|
1661
|
-
function
|
|
1662
|
-
return
|
|
1678
|
+
var Br = se(null);
|
|
1679
|
+
function Vr(e, t) {
|
|
1680
|
+
return me(() => e ? t ? (n) => {
|
|
1663
1681
|
let r = e(n), i = typeof t == "function" ? t(n) : void 0;
|
|
1664
1682
|
return typeof t != "function" && (t.current = n), () => {
|
|
1665
1683
|
r?.(), typeof i == "function" ? i() : typeof t == "function" ? t(null) : t.current = null;
|
|
1666
1684
|
};
|
|
1667
1685
|
} : e : t, [e, t]);
|
|
1668
1686
|
}
|
|
1669
|
-
function
|
|
1670
|
-
return
|
|
1687
|
+
function Hr(e) {
|
|
1688
|
+
return Vr(le(Br), e);
|
|
1671
1689
|
}
|
|
1672
1690
|
//#endregion
|
|
1673
1691
|
//#region lib/components/ui/primitives/helper-text/helper-text.tsx
|
|
1674
|
-
function
|
|
1675
|
-
return /* @__PURE__ */
|
|
1692
|
+
function Ur({ error: e, className: n, ...r }) {
|
|
1693
|
+
return /* @__PURE__ */ D(zr, {
|
|
1676
1694
|
"data-slot": "helper-text",
|
|
1677
1695
|
variant: "caption",
|
|
1678
1696
|
className: t("flex pl-0.5 truncate text-wrap", { "text-error-text": e }, n),
|
|
@@ -1681,8 +1699,8 @@ function Hr({ error: e, className: n, ...r }) {
|
|
|
1681
1699
|
}
|
|
1682
1700
|
//#endregion
|
|
1683
1701
|
//#region lib/components/ui/primitives/label/label.tsx
|
|
1684
|
-
function
|
|
1685
|
-
return /* @__PURE__ */
|
|
1702
|
+
function Wr() {
|
|
1703
|
+
return /* @__PURE__ */ D("svg", {
|
|
1686
1704
|
"data-slot": "label-required-mark",
|
|
1687
1705
|
"aria-hidden": "true",
|
|
1688
1706
|
focusable: "false",
|
|
@@ -1691,39 +1709,39 @@ function Ur() {
|
|
|
1691
1709
|
stroke: "currentColor",
|
|
1692
1710
|
strokeWidth: "1.75",
|
|
1693
1711
|
strokeLinecap: "round",
|
|
1694
|
-
children: /* @__PURE__ */
|
|
1712
|
+
children: /* @__PURE__ */ D("path", { d: "M5 1v8M1.5 3l7 4M8.5 3l-7 4" })
|
|
1695
1713
|
});
|
|
1696
1714
|
}
|
|
1697
|
-
function
|
|
1698
|
-
return /* @__PURE__ */
|
|
1715
|
+
function Gr({ className: e, withAsterisk: n, ...r }) {
|
|
1716
|
+
return /* @__PURE__ */ D(Rn, {
|
|
1699
1717
|
"data-slot": "label",
|
|
1700
1718
|
className: t("flex items-center pl-0.5 gap-2 text-sm leading-none font-semibold select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", e),
|
|
1701
1719
|
...r,
|
|
1702
|
-
children: n ? /* @__PURE__ */
|
|
1720
|
+
children: n ? /* @__PURE__ */ O("span", {
|
|
1703
1721
|
"data-slot": "label-text",
|
|
1704
1722
|
"data-required": "",
|
|
1705
1723
|
className: "inline-flex",
|
|
1706
|
-
children: [r.children, /* @__PURE__ */
|
|
1724
|
+
children: [r.children, /* @__PURE__ */ D(Wr, {})]
|
|
1707
1725
|
}) : r.children
|
|
1708
1726
|
});
|
|
1709
1727
|
}
|
|
1710
1728
|
//#endregion
|
|
1711
1729
|
//#region lib/components/ui/overlays/dialog/use-escape-forward.ts
|
|
1712
|
-
function
|
|
1713
|
-
let r =
|
|
1730
|
+
function Kr(e, t) {
|
|
1731
|
+
let r = N(null);
|
|
1714
1732
|
return {
|
|
1715
1733
|
ref: n(r, t),
|
|
1716
1734
|
onEscapeKeyDown(t) {
|
|
1717
|
-
e?.(t),
|
|
1735
|
+
e?.(t), ve(r.current, t);
|
|
1718
1736
|
}
|
|
1719
1737
|
};
|
|
1720
1738
|
}
|
|
1721
1739
|
//#endregion
|
|
1722
1740
|
//#region lib/components/ui/overlays/dialog/use-overlay-order.ts
|
|
1723
|
-
function
|
|
1724
|
-
let t =
|
|
1741
|
+
function qr(e) {
|
|
1742
|
+
let t = N(null);
|
|
1725
1743
|
return {
|
|
1726
|
-
overlayRef:
|
|
1744
|
+
overlayRef: M((e) => {
|
|
1727
1745
|
let n = t.current;
|
|
1728
1746
|
!e || !n?.isConnected || n.parentNode === e.parentNode && n.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING && n.before(e);
|
|
1729
1747
|
}, []),
|
|
@@ -1732,20 +1750,20 @@ function Kr(e) {
|
|
|
1732
1750
|
}
|
|
1733
1751
|
//#endregion
|
|
1734
1752
|
//#region lib/components/ui/overlays/dialog/use-modal-content.ts
|
|
1735
|
-
function
|
|
1736
|
-
let i =
|
|
1753
|
+
function Jr({ ref: e, onEscapeKeyDown: t, ...n }, r) {
|
|
1754
|
+
let i = ue(Tr) ?? !0, a = Kr(t, Er(r ?? i, e)), o = qr(a.ref);
|
|
1737
1755
|
return {
|
|
1738
1756
|
ref: o.contentRef,
|
|
1739
1757
|
overlayRef: o.overlayRef,
|
|
1740
1758
|
onEscapeKeyDown: a.onEscapeKeyDown,
|
|
1741
1759
|
outside: {
|
|
1742
|
-
onPointerDownOutside:
|
|
1743
|
-
onFocusOutside:
|
|
1744
|
-
onInteractOutside:
|
|
1760
|
+
onPointerDownOutside: Yr(n.onPointerDownOutside),
|
|
1761
|
+
onFocusOutside: Yr(n.onFocusOutside),
|
|
1762
|
+
onInteractOutside: Yr(n.onInteractOutside)
|
|
1745
1763
|
}
|
|
1746
1764
|
};
|
|
1747
1765
|
}
|
|
1748
|
-
function
|
|
1766
|
+
function Yr(e) {
|
|
1749
1767
|
return (t) => {
|
|
1750
1768
|
e?.(t);
|
|
1751
1769
|
let n = t.target;
|
|
@@ -1754,19 +1772,19 @@ function Jr(e) {
|
|
|
1754
1772
|
}
|
|
1755
1773
|
//#endregion
|
|
1756
1774
|
//#region lib/components/ui/overlays/dialog/use-return-focus.ts
|
|
1757
|
-
var
|
|
1758
|
-
function
|
|
1759
|
-
([...e.querySelectorAll(
|
|
1775
|
+
var Xr = "button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]";
|
|
1776
|
+
function Zr(e) {
|
|
1777
|
+
([...e.querySelectorAll(Xr)].find((e) => e.tabIndex >= 0 && e.getClientRects().length > 0) ?? e).focus({ preventScroll: !0 });
|
|
1760
1778
|
}
|
|
1761
|
-
function
|
|
1762
|
-
let n =
|
|
1779
|
+
function Qr(e, { focusFallback: t = !1 } = {}) {
|
|
1780
|
+
let n = N(null);
|
|
1763
1781
|
return {
|
|
1764
1782
|
onOpenAutoFocus(r) {
|
|
1765
1783
|
let i = document.activeElement;
|
|
1766
1784
|
n.current = i instanceof HTMLElement && i !== document.body ? i : null, e.onOpenAutoFocus?.(r);
|
|
1767
1785
|
let a = r.target;
|
|
1768
1786
|
!t || r.defaultPrevented || !(a instanceof HTMLElement) || queueMicrotask(() => {
|
|
1769
|
-
a.isConnected && !a.contains(document.activeElement) &&
|
|
1787
|
+
a.isConnected && !a.contains(document.activeElement) && Zr(a);
|
|
1770
1788
|
});
|
|
1771
1789
|
},
|
|
1772
1790
|
onCloseAutoFocus(t) {
|
|
@@ -1780,7 +1798,7 @@ function Zr(e, { focusFallback: t = !1 } = {}) {
|
|
|
1780
1798
|
}
|
|
1781
1799
|
//#endregion
|
|
1782
1800
|
//#region lib/components/ui/primitives/input/input-box.ts
|
|
1783
|
-
var
|
|
1801
|
+
var $r = [
|
|
1784
1802
|
"inline-flex gap-2 items-center h-11 max-h-full w-full bg-muted/5 disabled:bg-transparent",
|
|
1785
1803
|
"file:text-muted-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input",
|
|
1786
1804
|
"rounded border px-2 py-1 text-base shadow-xs transition-all outline-none file:inline-flex",
|
|
@@ -1788,27 +1806,27 @@ var Qr = [
|
|
|
1788
1806
|
"disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
1789
1807
|
"focus-visible:border-primary focus-visible:ring-primary/30 focus-visible:ring-[2px]",
|
|
1790
1808
|
"aria-invalid:ring-error/20 dark:aria-invalid:ring-error/40 aria-invalid:border-error"
|
|
1791
|
-
],
|
|
1792
|
-
function
|
|
1793
|
-
return /* @__PURE__ */
|
|
1809
|
+
], ei = [...$r, "not-placeholder-shown:bg-primary/10"];
|
|
1810
|
+
function ti({ className: e, type: n = "text", ...r }) {
|
|
1811
|
+
return /* @__PURE__ */ D("input", {
|
|
1794
1812
|
type: n,
|
|
1795
1813
|
"data-slot": "input",
|
|
1796
|
-
className: t(
|
|
1814
|
+
className: t(ei, e),
|
|
1797
1815
|
"data-pw": r.name ?? "input",
|
|
1798
1816
|
...r
|
|
1799
1817
|
});
|
|
1800
1818
|
}
|
|
1801
1819
|
//#endregion
|
|
1802
1820
|
//#region lib/components/ui/fields/text-field/text-field.tsx
|
|
1803
|
-
function
|
|
1804
|
-
let c =
|
|
1821
|
+
function ni({ error: e, helperText: n, label: r, className: i, leading: a, trailing: o, ...s }) {
|
|
1822
|
+
let c = Hr(), l = fe(), u = fe(), d = ye(s["aria-describedby"], !!n && u), f = /* @__PURE__ */ O("div", {
|
|
1805
1823
|
className: t("relative", {
|
|
1806
1824
|
"*:first:size-8 *:first:absolute *:first:top-[calc(50%-16px)] *:first:left-1.5 [&_input]:pl-10 *:first:bg-muted/80 *:first:text-muted-foreground": !!a,
|
|
1807
1825
|
"*:last:size-8 *:last:absolute *:last:top-[calc(50%-16px)] *:last:right-1.5 [&_input]:pr-.5 *:last:bg-muted/80 *:last:text-muted-foreground": !!o
|
|
1808
1826
|
}),
|
|
1809
1827
|
children: [
|
|
1810
1828
|
a && a,
|
|
1811
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ D(ti, {
|
|
1812
1830
|
"aria-invalid": e,
|
|
1813
1831
|
...s,
|
|
1814
1832
|
id: s.id ?? l,
|
|
@@ -1818,17 +1836,17 @@ function ti({ error: e, helperText: n, label: r, className: i, leading: a, trail
|
|
|
1818
1836
|
o && o
|
|
1819
1837
|
]
|
|
1820
1838
|
});
|
|
1821
|
-
return /* @__PURE__ */
|
|
1839
|
+
return /* @__PURE__ */ O("div", {
|
|
1822
1840
|
ref: c,
|
|
1823
1841
|
"data-slot": "text-field",
|
|
1824
1842
|
className: t("grid w-full gap-1.5", i),
|
|
1825
|
-
children: [/* @__PURE__ */
|
|
1843
|
+
children: [/* @__PURE__ */ D(Gr, {
|
|
1826
1844
|
withAsterisk: s.required,
|
|
1827
1845
|
htmlFor: s.id ?? l,
|
|
1828
1846
|
children: r
|
|
1829
|
-
}), /* @__PURE__ */
|
|
1847
|
+
}), /* @__PURE__ */ O("div", {
|
|
1830
1848
|
className: "flex flex-col gap-0.5",
|
|
1831
|
-
children: [f, n ? /* @__PURE__ */
|
|
1849
|
+
children: [f, n ? /* @__PURE__ */ D(Ur, {
|
|
1832
1850
|
id: u,
|
|
1833
1851
|
error: e,
|
|
1834
1852
|
children: n
|
|
@@ -1838,50 +1856,80 @@ function ti({ error: e, helperText: n, label: r, className: i, leading: a, trail
|
|
|
1838
1856
|
}
|
|
1839
1857
|
//#endregion
|
|
1840
1858
|
//#region lib/components/ui/overlays/dialog/dialog-outside.ts
|
|
1841
|
-
function
|
|
1859
|
+
function ri(e) {
|
|
1842
1860
|
let t = e.target;
|
|
1843
1861
|
t instanceof Element && t.closest("[data-slot=\"combobox-content\"]") && e.preventDefault();
|
|
1844
1862
|
}
|
|
1845
|
-
function
|
|
1863
|
+
function ii(e) {
|
|
1846
1864
|
return (t) => {
|
|
1847
|
-
|
|
1865
|
+
ri(t), e?.(t);
|
|
1848
1866
|
};
|
|
1849
1867
|
}
|
|
1850
|
-
function
|
|
1868
|
+
function ai(e) {
|
|
1851
1869
|
return {
|
|
1852
1870
|
...e,
|
|
1853
|
-
onPointerDownOutside:
|
|
1854
|
-
onFocusOutside:
|
|
1855
|
-
onInteractOutside:
|
|
1871
|
+
onPointerDownOutside: ii(e.onPointerDownOutside),
|
|
1872
|
+
onFocusOutside: ii(e.onFocusOutside),
|
|
1873
|
+
onInteractOutside: ii(e.onInteractOutside)
|
|
1856
1874
|
};
|
|
1857
1875
|
}
|
|
1858
1876
|
//#endregion
|
|
1877
|
+
//#region lib/components/ui/overlays/dialog/dialog-parts.tsx
|
|
1878
|
+
function oi({ className: e, ...n }) {
|
|
1879
|
+
return /* @__PURE__ */ D("div", {
|
|
1880
|
+
"data-slot": "dialog-header",
|
|
1881
|
+
className: t("flex flex-col gap-2 text-center sm:text-left", e),
|
|
1882
|
+
...n
|
|
1883
|
+
});
|
|
1884
|
+
}
|
|
1885
|
+
function si({ className: e, ...n }) {
|
|
1886
|
+
return /* @__PURE__ */ D("div", {
|
|
1887
|
+
"data-slot": "dialog-footer",
|
|
1888
|
+
className: t("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
|
|
1889
|
+
...n
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1892
|
+
function ci({ className: e, ...n }) {
|
|
1893
|
+
return /* @__PURE__ */ D(jn, {
|
|
1894
|
+
"data-slot": "dialog-title",
|
|
1895
|
+
className: t("text-xl leading-none font-semibold", e),
|
|
1896
|
+
...n
|
|
1897
|
+
});
|
|
1898
|
+
}
|
|
1899
|
+
function li({ className: e, ...n }) {
|
|
1900
|
+
return /* @__PURE__ */ D(Nn, {
|
|
1901
|
+
"data-slot": "dialog-description",
|
|
1902
|
+
className: t("text-muted-foreground text-sm", e),
|
|
1903
|
+
...n
|
|
1904
|
+
});
|
|
1905
|
+
}
|
|
1906
|
+
//#endregion
|
|
1859
1907
|
//#region lib/components/ui/overlays/dialog/dialog.tsx
|
|
1860
|
-
function
|
|
1861
|
-
return /* @__PURE__ */
|
|
1908
|
+
function ui({ ...e }) {
|
|
1909
|
+
return /* @__PURE__ */ D(Tr, {
|
|
1862
1910
|
value: e.modal ?? !0,
|
|
1863
|
-
children: /* @__PURE__ */
|
|
1911
|
+
children: /* @__PURE__ */ D(mn, {
|
|
1864
1912
|
"data-slot": "dialog",
|
|
1865
1913
|
...e
|
|
1866
1914
|
})
|
|
1867
1915
|
});
|
|
1868
1916
|
}
|
|
1869
|
-
function
|
|
1870
|
-
return /* @__PURE__ */
|
|
1917
|
+
function di({ asChild: e = !0, ...t }) {
|
|
1918
|
+
return /* @__PURE__ */ D(gn, {
|
|
1871
1919
|
"data-slot": "dialog-trigger",
|
|
1872
1920
|
...t,
|
|
1873
1921
|
asChild: e
|
|
1874
1922
|
});
|
|
1875
1923
|
}
|
|
1876
|
-
function
|
|
1877
|
-
return /* @__PURE__ */
|
|
1924
|
+
function fi({ ...e }) {
|
|
1925
|
+
return /* @__PURE__ */ D(bn, {
|
|
1878
1926
|
"data-slot": "dialog-portal",
|
|
1879
1927
|
...e
|
|
1880
1928
|
});
|
|
1881
1929
|
}
|
|
1882
|
-
function
|
|
1883
|
-
let { t: s } =
|
|
1884
|
-
return /* @__PURE__ */
|
|
1930
|
+
function pi({ className: e, color: n, children: r, type: i = "button", variant: a = "ghost", ...o }) {
|
|
1931
|
+
let { t: s } = te();
|
|
1932
|
+
return /* @__PURE__ */ D(Fn, {
|
|
1885
1933
|
"aria-label": r ? void 0 : s("material.buttons.close", "Close"),
|
|
1886
1934
|
...o,
|
|
1887
1935
|
type: i,
|
|
@@ -1891,134 +1939,112 @@ function ci({ className: e, color: n, children: r, type: i = "button", variant:
|
|
|
1891
1939
|
className: e
|
|
1892
1940
|
})),
|
|
1893
1941
|
"data-slot": "dialog-close",
|
|
1894
|
-
children: r || /* @__PURE__ */
|
|
1942
|
+
children: r || /* @__PURE__ */ D(ne, { className: "size-4" })
|
|
1895
1943
|
});
|
|
1896
1944
|
}
|
|
1897
|
-
function
|
|
1898
|
-
return /* @__PURE__ */
|
|
1945
|
+
function mi({ className: e, ...n }) {
|
|
1946
|
+
return /* @__PURE__ */ D(Sn, {
|
|
1899
1947
|
"data-slot": "dialog-overlay",
|
|
1900
1948
|
className: t("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50", e),
|
|
1901
1949
|
...n
|
|
1902
1950
|
});
|
|
1903
1951
|
}
|
|
1904
|
-
function
|
|
1905
|
-
let d =
|
|
1952
|
+
function hi({ className: e, children: n, onInteractOutside: r, onPointerDownOutside: i, onFocusOutside: a, onOpenAutoFocus: o, onCloseAutoFocus: s, onEscapeKeyDown: c, ref: l, ...u }) {
|
|
1953
|
+
let d = Qr({
|
|
1906
1954
|
onOpenAutoFocus: o,
|
|
1907
1955
|
onCloseAutoFocus: s
|
|
1908
|
-
}), f =
|
|
1956
|
+
}), f = Jr(ai({
|
|
1909
1957
|
ref: l,
|
|
1910
1958
|
onEscapeKeyDown: c,
|
|
1911
1959
|
onInteractOutside: r,
|
|
1912
1960
|
onPointerDownOutside: i,
|
|
1913
1961
|
onFocusOutside: a
|
|
1914
1962
|
}));
|
|
1915
|
-
return /* @__PURE__ */ D(
|
|
1916
|
-
|
|
1917
|
-
children:
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
return /* @__PURE__ */ E("div", {
|
|
1932
|
-
"data-slot": "dialog-header",
|
|
1933
|
-
className: t("flex flex-col gap-2 text-center sm:text-left", e),
|
|
1934
|
-
...n
|
|
1935
|
-
});
|
|
1936
|
-
}
|
|
1937
|
-
function fi({ className: e, ...n }) {
|
|
1938
|
-
return /* @__PURE__ */ E("div", {
|
|
1939
|
-
"data-slot": "dialog-footer",
|
|
1940
|
-
className: t("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
|
|
1941
|
-
...n
|
|
1942
|
-
});
|
|
1943
|
-
}
|
|
1944
|
-
function pi({ className: e, ...n }) {
|
|
1945
|
-
return /* @__PURE__ */ E(Mn, {
|
|
1946
|
-
"data-slot": "dialog-title",
|
|
1947
|
-
className: t("text-xl leading-none font-semibold", e),
|
|
1948
|
-
...n
|
|
1949
|
-
});
|
|
1950
|
-
}
|
|
1951
|
-
function mi({ className: e, ...n }) {
|
|
1952
|
-
return /* @__PURE__ */ E(Pn, {
|
|
1953
|
-
"data-slot": "dialog-description",
|
|
1954
|
-
className: t("text-muted-foreground text-sm", e),
|
|
1955
|
-
...n
|
|
1963
|
+
return /* @__PURE__ */ D(Cr, {
|
|
1964
|
+
value: !0,
|
|
1965
|
+
children: /* @__PURE__ */ O(fi, {
|
|
1966
|
+
"data-slot": "dialog-portal",
|
|
1967
|
+
children: [/* @__PURE__ */ D(mi, { ref: f.overlayRef }), /* @__PURE__ */ D(En, {
|
|
1968
|
+
ref: f.ref,
|
|
1969
|
+
"data-slot": "dialog-content",
|
|
1970
|
+
className: t("bg-background rounded-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg max-h-[calc(100dvh-2rem)] supports-[not(height:100dvh)]:max-h-[calc(100vh-2rem)] overflow-y-auto", e),
|
|
1971
|
+
onOpenAutoFocus: d.onOpenAutoFocus,
|
|
1972
|
+
onCloseAutoFocus: d.onCloseAutoFocus,
|
|
1973
|
+
onEscapeKeyDown: f.onEscapeKeyDown,
|
|
1974
|
+
...u,
|
|
1975
|
+
...f.outside,
|
|
1976
|
+
children: n
|
|
1977
|
+
})]
|
|
1978
|
+
})
|
|
1956
1979
|
});
|
|
1957
1980
|
}
|
|
1958
1981
|
//#endregion
|
|
1959
1982
|
//#region lib/components/ui/actions/icon-button/icon-badge.tsx
|
|
1960
|
-
function
|
|
1983
|
+
function gi({ children: e, className: n, ...r }) {
|
|
1961
1984
|
let i = !!(r["aria-label"] || r["aria-labelledby"]);
|
|
1962
|
-
return /* @__PURE__ */ E
|
|
1985
|
+
return /* @__PURE__ */ D(E, {
|
|
1963
1986
|
"aria-hidden": i ? void 0 : "true",
|
|
1964
1987
|
role: i ? "img" : void 0,
|
|
1965
1988
|
...r,
|
|
1966
1989
|
asChild: !0,
|
|
1967
1990
|
className: t("cursor-default", n),
|
|
1968
|
-
children: /* @__PURE__ */
|
|
1991
|
+
children: /* @__PURE__ */ D("span", { children: e })
|
|
1969
1992
|
});
|
|
1970
1993
|
}
|
|
1971
1994
|
//#endregion
|
|
1972
1995
|
//#region lib/components/ui/primitives/activity/activity.tsx
|
|
1973
|
-
function
|
|
1974
|
-
return /* @__PURE__ */
|
|
1996
|
+
function _i({ visible: e = !1, ...t }) {
|
|
1997
|
+
return /* @__PURE__ */ D(ie, {
|
|
1975
1998
|
...t,
|
|
1976
1999
|
mode: e ? "visible" : "hidden"
|
|
1977
2000
|
});
|
|
1978
2001
|
}
|
|
1979
2002
|
//#endregion
|
|
1980
2003
|
//#region lib/components/ui/overlays/hover-card/hover-card.tsx
|
|
1981
|
-
function
|
|
1982
|
-
return /* @__PURE__ */
|
|
2004
|
+
function vi({ ...e }) {
|
|
2005
|
+
return /* @__PURE__ */ D(ar, {
|
|
1983
2006
|
"data-slot": "hover-card",
|
|
1984
2007
|
...e
|
|
1985
2008
|
});
|
|
1986
2009
|
}
|
|
1987
|
-
function
|
|
1988
|
-
return /* @__PURE__ */
|
|
2010
|
+
function yi({ ...e }) {
|
|
2011
|
+
return /* @__PURE__ */ D(or, {
|
|
1989
2012
|
"data-slot": "hover-card-trigger",
|
|
1990
2013
|
...e
|
|
1991
2014
|
});
|
|
1992
2015
|
}
|
|
1993
|
-
function
|
|
1994
|
-
return /* @__PURE__ */
|
|
1995
|
-
|
|
1996
|
-
children: /* @__PURE__ */
|
|
1997
|
-
"data-slot": "hover-card-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2016
|
+
function bi({ className: e, align: n = "center", sideOffset: r = 4, ...i }) {
|
|
2017
|
+
return /* @__PURE__ */ D(Cr, {
|
|
2018
|
+
value: !1,
|
|
2019
|
+
children: /* @__PURE__ */ D(sr, {
|
|
2020
|
+
"data-slot": "hover-card-portal",
|
|
2021
|
+
children: /* @__PURE__ */ D(cr, {
|
|
2022
|
+
"data-slot": "hover-card-content",
|
|
2023
|
+
align: n,
|
|
2024
|
+
sideOffset: r,
|
|
2025
|
+
className: t("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden", e),
|
|
2026
|
+
...i
|
|
2027
|
+
})
|
|
2002
2028
|
})
|
|
2003
2029
|
});
|
|
2004
2030
|
}
|
|
2005
2031
|
//#endregion
|
|
2006
2032
|
//#region ../../node_modules/react-hook-form/dist/index.esm.mjs
|
|
2007
|
-
var
|
|
2033
|
+
var xi = (e) => e.type === "checkbox", Si = (e) => e.type === "file", Ci = (e) => e instanceof Date, z = (e) => e == null, wi = (e) => typeof e == "object", B = (e) => !z(e) && !Array.isArray(e) && wi(e) && !Ci(e), Ti = (e) => B(e) && e.target ? xi(e.target) ? e.target.checked : Si(e.target) ? e.target.files : e.target.value : e, Ei = (e, t) => t.split(".").some((t, n, r) => !isNaN(Number(t)) && e.has(r.slice(0, n).join("."))), Di = (e) => {
|
|
2008
2034
|
let t = e.constructor && e.constructor.prototype;
|
|
2009
2035
|
return B(t) && t.hasOwnProperty("isPrototypeOf");
|
|
2010
|
-
},
|
|
2036
|
+
}, Oi = typeof window < "u" && window.HTMLElement !== void 0 && typeof document < "u";
|
|
2011
2037
|
function V(e) {
|
|
2012
2038
|
if (e instanceof Date) return new Date(e);
|
|
2013
2039
|
let t = typeof FileList < "u" && e instanceof FileList;
|
|
2014
|
-
if (
|
|
2040
|
+
if (Oi && (e instanceof Blob || t)) return e;
|
|
2015
2041
|
let n = Array.isArray(e);
|
|
2016
|
-
if (!n && !(B(e) &&
|
|
2042
|
+
if (!n && !(B(e) && Di(e))) return e;
|
|
2017
2043
|
let r = n ? [] : Object.create(Object.getPrototypeOf(e));
|
|
2018
2044
|
for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && (r[t] = V(e[t]));
|
|
2019
2045
|
return r;
|
|
2020
2046
|
}
|
|
2021
|
-
var
|
|
2047
|
+
var ki = {
|
|
2022
2048
|
BLUR: "blur",
|
|
2023
2049
|
FOCUS_OUT: "focusout",
|
|
2024
2050
|
CHANGE: "change",
|
|
@@ -2039,44 +2065,44 @@ var Di = {
|
|
|
2039
2065
|
pattern: "pattern",
|
|
2040
2066
|
required: "required",
|
|
2041
2067
|
validate: "validate"
|
|
2042
|
-
},
|
|
2068
|
+
}, Ai = "root", ji = [
|
|
2043
2069
|
"__proto__",
|
|
2044
2070
|
"constructor",
|
|
2045
2071
|
"prototype"
|
|
2046
|
-
],
|
|
2072
|
+
], Mi = /^\w*$/, Ni = (e) => Mi.test(e), W = (e) => e === void 0, Pi = /[.[\]'"]/, Fi = (e) => e.split(Pi).filter(Boolean), G = (e, t, n) => {
|
|
2047
2073
|
if (!t || !B(e)) return n;
|
|
2048
|
-
let r =
|
|
2049
|
-
if (r.some((e) =>
|
|
2074
|
+
let r = Ni(t) ? [t] : Fi(t);
|
|
2075
|
+
if (r.some((e) => ji.includes(e))) return n;
|
|
2050
2076
|
let i = r.reduce((e, t) => z(e) ? void 0 : e[t], e);
|
|
2051
2077
|
return W(i) || i === e ? W(e[t]) ? n : e[t] : i;
|
|
2052
2078
|
}, K = (e) => typeof e == "boolean", q = (e) => typeof e == "function", J = (e, t, n) => {
|
|
2053
|
-
let r = -1, i =
|
|
2079
|
+
let r = -1, i = Ni(t) ? [t] : Fi(t), a = i.length, o = a - 1;
|
|
2054
2080
|
for (; ++r < a;) {
|
|
2055
2081
|
let t = i[r], a = n;
|
|
2056
2082
|
if (r !== o) {
|
|
2057
2083
|
let n = e[t];
|
|
2058
2084
|
a = B(n) || Array.isArray(n) ? n : isNaN(+i[r + 1]) ? {} : [];
|
|
2059
2085
|
}
|
|
2060
|
-
if (
|
|
2086
|
+
if (ji.includes(t)) return;
|
|
2061
2087
|
e[t] = a, e = e[t];
|
|
2062
2088
|
}
|
|
2063
|
-
},
|
|
2064
|
-
|
|
2065
|
-
var
|
|
2089
|
+
}, Ii = A.createContext(null);
|
|
2090
|
+
Ii.displayName = "HookFormControlContext";
|
|
2091
|
+
var Li = () => A.useContext(Ii), Ri = (e, t, n, r = !0) => {
|
|
2066
2092
|
let i = {};
|
|
2067
2093
|
for (let a in e) Object.defineProperty(i, a, { get: () => {
|
|
2068
2094
|
let i = a;
|
|
2069
2095
|
return t._proxyFormState[i] !== H.all && (t._proxyFormState[i] = !r || H.all), n && (n[i] = !0), e[i];
|
|
2070
2096
|
} });
|
|
2071
2097
|
return i;
|
|
2072
|
-
},
|
|
2098
|
+
}, zi = Oi ? A.useLayoutEffect : A.useEffect, Bi = (e) => z(e) || !wi(e), Vi = (e, t) => t.length === 0 && !Array.isArray(e) && !Di(e);
|
|
2073
2099
|
function Y(e, t, n = /* @__PURE__ */ new WeakMap()) {
|
|
2074
2100
|
if (e === t) return !0;
|
|
2075
|
-
if (
|
|
2076
|
-
if (
|
|
2101
|
+
if (Bi(e) || Bi(t)) return Object.is(e, t);
|
|
2102
|
+
if (Ci(e) && Ci(t)) return Object.is(e.getTime(), t.getTime());
|
|
2077
2103
|
let r = Object.keys(e), i = Object.keys(t);
|
|
2078
2104
|
if (r.length !== i.length) return !1;
|
|
2079
|
-
if (
|
|
2105
|
+
if (Vi(e, r) || Vi(t, i)) return Object.is(e, t);
|
|
2080
2106
|
if (!r.length && Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
2081
2107
|
let a = n.get(e);
|
|
2082
2108
|
if (a && a.has(t)) return !0;
|
|
@@ -2090,31 +2116,31 @@ function Y(e, t, n = /* @__PURE__ */ new WeakMap()) {
|
|
|
2090
2116
|
if (!(i in t)) return !1;
|
|
2091
2117
|
if (i !== "ref") {
|
|
2092
2118
|
let e = t[i];
|
|
2093
|
-
if (
|
|
2119
|
+
if (Ci(r) && Ci(e) || (B(r) || Array.isArray(r)) && (B(e) || Array.isArray(e)) ? !Y(r, e, n) : !Object.is(r, e)) return !1;
|
|
2094
2120
|
}
|
|
2095
2121
|
}
|
|
2096
2122
|
return !0;
|
|
2097
2123
|
}
|
|
2098
|
-
function
|
|
2099
|
-
let e =
|
|
2124
|
+
function Hi() {
|
|
2125
|
+
let e = A.useRef(!1), t = A.useRef(void 0);
|
|
2100
2126
|
return {
|
|
2101
|
-
resyncIfNeeded:
|
|
2127
|
+
resyncIfNeeded: A.useCallback((n, r, i) => {
|
|
2102
2128
|
if (n && e.current) {
|
|
2103
2129
|
let e = r();
|
|
2104
2130
|
Y(t.current, e) || i(e);
|
|
2105
2131
|
}
|
|
2106
2132
|
e.current = !0;
|
|
2107
2133
|
}, []),
|
|
2108
|
-
snapshot:
|
|
2134
|
+
snapshot: A.useCallback((e, n) => {
|
|
2109
2135
|
e && (t.current = V(n()));
|
|
2110
2136
|
}, [])
|
|
2111
2137
|
};
|
|
2112
2138
|
}
|
|
2113
|
-
function
|
|
2114
|
-
let t =
|
|
2139
|
+
function Ui(e) {
|
|
2140
|
+
let t = Li(), { control: n = t, disabled: r, name: i, exact: a } = e || {}, [o, s] = A.useState(() => ({
|
|
2115
2141
|
...n._formState,
|
|
2116
2142
|
defaultValues: n._defaultValues
|
|
2117
|
-
})), c =
|
|
2143
|
+
})), c = A.useRef({
|
|
2118
2144
|
isDirty: !1,
|
|
2119
2145
|
isLoading: !1,
|
|
2120
2146
|
dirtyFields: !1,
|
|
@@ -2123,8 +2149,8 @@ function Vi(e) {
|
|
|
2123
2149
|
isValidating: !1,
|
|
2124
2150
|
isValid: !1,
|
|
2125
2151
|
errors: !1
|
|
2126
|
-
}), { resyncIfNeeded: l, snapshot: u } =
|
|
2127
|
-
return
|
|
2152
|
+
}), { resyncIfNeeded: l, snapshot: u } = Hi();
|
|
2153
|
+
return zi(() => {
|
|
2128
2154
|
let e = () => ({
|
|
2129
2155
|
...n._formState,
|
|
2130
2156
|
defaultValues: n._defaultValues
|
|
@@ -2151,27 +2177,27 @@ function Vi(e) {
|
|
|
2151
2177
|
a,
|
|
2152
2178
|
l,
|
|
2153
2179
|
u
|
|
2154
|
-
]),
|
|
2180
|
+
]), A.useEffect(() => {
|
|
2155
2181
|
c.current.isValid && n._setValid(!0);
|
|
2156
|
-
}, [n]),
|
|
2182
|
+
}, [n]), A.useMemo(() => Ri(o, n, c.current, !1), [o, n]);
|
|
2157
2183
|
}
|
|
2158
|
-
var X = (e) => typeof e == "string",
|
|
2159
|
-
function
|
|
2160
|
-
let t =
|
|
2184
|
+
var X = (e) => typeof e == "string", Wi = (e, t, n, r, i) => X(e) ? (r && t.watch.add(e), G(n, e, i)) : Array.isArray(e) ? e.map((e) => (r && t.watch.add(e), G(n, e))) : (r && (t.watchAll = !0), n);
|
|
2185
|
+
function Gi(e) {
|
|
2186
|
+
let t = Li(), { control: n = t, name: r, defaultValue: i, disabled: a, exact: o, compute: s } = e || {}, c = A.useRef(i), l = A.useRef(s), u = A.useRef(void 0), d = A.useRef(n), f = A.useRef(r);
|
|
2161
2187
|
l.current = s;
|
|
2162
|
-
let [p, m] =
|
|
2188
|
+
let [p, m] = A.useState(() => {
|
|
2163
2189
|
let e = n._getWatch(r, c.current);
|
|
2164
2190
|
return l.current ? l.current(e) : e;
|
|
2165
|
-
}), h =
|
|
2166
|
-
let t =
|
|
2191
|
+
}), h = A.useCallback((e) => {
|
|
2192
|
+
let t = Wi(r, n._names, e || n._formValues, !1, c.current);
|
|
2167
2193
|
return l.current ? l.current(t) : t;
|
|
2168
2194
|
}, [
|
|
2169
2195
|
n._formValues,
|
|
2170
2196
|
n._names,
|
|
2171
2197
|
r
|
|
2172
|
-
]), g =
|
|
2198
|
+
]), g = A.useCallback((e) => {
|
|
2173
2199
|
if (!a) {
|
|
2174
|
-
let t =
|
|
2200
|
+
let t = Wi(r, n._names, e || n._formValues, !1, c.current);
|
|
2175
2201
|
if (l.current) {
|
|
2176
2202
|
let e = l.current(t);
|
|
2177
2203
|
Y(e, u.current) || (m(e), u.current = e);
|
|
@@ -2182,10 +2208,10 @@ function Ui(e) {
|
|
|
2182
2208
|
n._names,
|
|
2183
2209
|
a,
|
|
2184
2210
|
r
|
|
2185
|
-
]), { resyncIfNeeded: _, snapshot: v } =
|
|
2211
|
+
]), { resyncIfNeeded: _, snapshot: v } = Hi(), y = A.useRef(g);
|
|
2186
2212
|
y.current = g;
|
|
2187
|
-
let b =
|
|
2188
|
-
b.current = h,
|
|
2213
|
+
let b = A.useRef(h);
|
|
2214
|
+
b.current = h, zi(() => {
|
|
2189
2215
|
d.current !== n || !Y(f.current, r) ? (d.current = n, f.current = r, y.current()) : _(!a, () => b.current(), (e) => {
|
|
2190
2216
|
m(e), u.current = e;
|
|
2191
2217
|
});
|
|
@@ -2207,8 +2233,8 @@ function Ui(e) {
|
|
|
2207
2233
|
a,
|
|
2208
2234
|
_,
|
|
2209
2235
|
v
|
|
2210
|
-
]),
|
|
2211
|
-
let x = d.current !== n, S = f.current, C =
|
|
2236
|
+
]), A.useEffect(() => n._removeUnmounted());
|
|
2237
|
+
let x = d.current !== n, S = f.current, C = A.useMemo(() => {
|
|
2212
2238
|
if (a) return null;
|
|
2213
2239
|
let e = !x && !Y(S, r);
|
|
2214
2240
|
return x || e ? h() : null;
|
|
@@ -2221,27 +2247,27 @@ function Ui(e) {
|
|
|
2221
2247
|
]);
|
|
2222
2248
|
return C === null ? p : C;
|
|
2223
2249
|
}
|
|
2224
|
-
function
|
|
2225
|
-
let t =
|
|
2250
|
+
function Ki(e) {
|
|
2251
|
+
let t = Li(), { name: n, disabled: r, control: i = t, shouldUnregister: a, defaultValue: o, exact: s = !0 } = e, c = Ei(i._names.array, n), l = Gi({
|
|
2226
2252
|
control: i,
|
|
2227
2253
|
name: n,
|
|
2228
|
-
defaultValue:
|
|
2254
|
+
defaultValue: A.useMemo(() => G(i._formValues, n, G(i._defaultValues, n, o)), [
|
|
2229
2255
|
i,
|
|
2230
2256
|
n,
|
|
2231
2257
|
o
|
|
2232
2258
|
]),
|
|
2233
2259
|
exact: s
|
|
2234
|
-
}), u =
|
|
2260
|
+
}), u = Ui({
|
|
2235
2261
|
control: i,
|
|
2236
2262
|
name: n,
|
|
2237
2263
|
exact: s
|
|
2238
|
-
}), d =
|
|
2264
|
+
}), d = A.useRef(e), f = A.useRef(null), p = A.useRef(i.register(n, {
|
|
2239
2265
|
...e.rules,
|
|
2240
2266
|
value: l,
|
|
2241
2267
|
...K(e.disabled) ? { disabled: e.disabled } : {}
|
|
2242
2268
|
}));
|
|
2243
2269
|
d.current = e;
|
|
2244
|
-
let m =
|
|
2270
|
+
let m = A.useMemo(() => Object.defineProperties({}, {
|
|
2245
2271
|
invalid: {
|
|
2246
2272
|
enumerable: !0,
|
|
2247
2273
|
get: () => !!G(u.errors, n)
|
|
@@ -2262,25 +2288,25 @@ function Wi(e) {
|
|
|
2262
2288
|
enumerable: !0,
|
|
2263
2289
|
get: () => G(u.errors, n)
|
|
2264
2290
|
}
|
|
2265
|
-
}), [u, n]), h =
|
|
2266
|
-
let t =
|
|
2291
|
+
}), [u, n]), h = A.useCallback((e) => {
|
|
2292
|
+
let t = Ti(e);
|
|
2267
2293
|
return G(i._fields, n) || (p.current = i.register(n, {
|
|
2268
2294
|
...d.current.rules,
|
|
2269
2295
|
value: t
|
|
2270
2296
|
})), p.current.onChange({
|
|
2271
2297
|
target: {
|
|
2272
|
-
value:
|
|
2298
|
+
value: Ti(e),
|
|
2273
2299
|
name: n
|
|
2274
2300
|
},
|
|
2275
|
-
type:
|
|
2301
|
+
type: ki.CHANGE
|
|
2276
2302
|
});
|
|
2277
|
-
}, [n, i]), g =
|
|
2303
|
+
}, [n, i]), g = A.useCallback(() => p.current.onBlur({
|
|
2278
2304
|
target: {
|
|
2279
2305
|
value: G(i._formValues, n),
|
|
2280
2306
|
name: n
|
|
2281
2307
|
},
|
|
2282
|
-
type:
|
|
2283
|
-
}), [n, i._formValues]), _ =
|
|
2308
|
+
type: ki.BLUR
|
|
2309
|
+
}), [n, i._formValues]), _ = A.useCallback((e) => {
|
|
2284
2310
|
e && (f.current = {
|
|
2285
2311
|
focus: () => q(e.focus) && e.focus(),
|
|
2286
2312
|
select: () => q(e.select) && e.select(),
|
|
@@ -2289,7 +2315,7 @@ function Wi(e) {
|
|
|
2289
2315
|
});
|
|
2290
2316
|
let t = G(i._fields, n);
|
|
2291
2317
|
t && t._f && e && (t._f.ref = f.current);
|
|
2292
|
-
}, [i._fields, n]), v =
|
|
2318
|
+
}, [i._fields, n]), v = A.useMemo(() => ({
|
|
2293
2319
|
name: n,
|
|
2294
2320
|
value: l,
|
|
2295
2321
|
...K(r) || u.disabled ? { disabled: u.disabled || r } : {},
|
|
@@ -2305,7 +2331,7 @@ function Wi(e) {
|
|
|
2305
2331
|
_,
|
|
2306
2332
|
l
|
|
2307
2333
|
]);
|
|
2308
|
-
return
|
|
2334
|
+
return A.useEffect(() => {
|
|
2309
2335
|
let e = i._options.shouldUnregister || a;
|
|
2310
2336
|
p.current = i.register(n, {
|
|
2311
2337
|
...d.current.rules,
|
|
@@ -2331,7 +2357,7 @@ function Wi(e) {
|
|
|
2331
2357
|
i,
|
|
2332
2358
|
c,
|
|
2333
2359
|
a
|
|
2334
|
-
]),
|
|
2360
|
+
]), A.useEffect(() => {
|
|
2335
2361
|
i._setDisabledField({
|
|
2336
2362
|
disabled: r,
|
|
2337
2363
|
name: n
|
|
@@ -2340,7 +2366,7 @@ function Wi(e) {
|
|
|
2340
2366
|
r,
|
|
2341
2367
|
n,
|
|
2342
2368
|
i
|
|
2343
|
-
]),
|
|
2369
|
+
]), A.useMemo(() => ({
|
|
2344
2370
|
field: v,
|
|
2345
2371
|
formState: u,
|
|
2346
2372
|
fieldState: m
|
|
@@ -2350,25 +2376,25 @@ function Wi(e) {
|
|
|
2350
2376
|
m
|
|
2351
2377
|
]);
|
|
2352
2378
|
}
|
|
2353
|
-
var
|
|
2379
|
+
var qi = (e) => e.render(Ki(e)), Ji = () => {
|
|
2354
2380
|
if (typeof crypto < "u" && crypto.randomUUID) return crypto.randomUUID();
|
|
2355
2381
|
let e = typeof performance > "u" ? Date.now() : performance.now() * 1e3;
|
|
2356
2382
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
|
|
2357
2383
|
let n = (Math.random() * 16 + e) % 16 | 0;
|
|
2358
2384
|
return (t == "x" ? n : n & 3 | 8).toString(16);
|
|
2359
2385
|
});
|
|
2360
|
-
},
|
|
2386
|
+
}, Yi = (e, t, n = {}) => n.shouldFocus || W(n.shouldFocus) ? n.focusName || `${e}.${W(n.focusIndex) ? t : n.focusIndex}.` : "", Xi = (e) => ({
|
|
2361
2387
|
isOnSubmit: !e || e === H.onSubmit,
|
|
2362
2388
|
isOnBlur: e === H.onBlur,
|
|
2363
2389
|
isOnChange: e === H.onChange,
|
|
2364
2390
|
isOnAll: e === H.all,
|
|
2365
2391
|
isOnTouch: e === H.onTouched
|
|
2366
|
-
}),
|
|
2392
|
+
}), Zi = (e, t, n) => {
|
|
2367
2393
|
if (n) return !1;
|
|
2368
2394
|
if (t.watchAll || t.watch.has(e)) return !0;
|
|
2369
2395
|
for (let n of t.watch) if (e.startsWith(n) && e.charAt(n.length) === ".") return !0;
|
|
2370
2396
|
return !1;
|
|
2371
|
-
},
|
|
2397
|
+
}, Qi = (e, t, n, r) => {
|
|
2372
2398
|
for (let i of n || Object.keys(e)) {
|
|
2373
2399
|
if (i === "_f") continue;
|
|
2374
2400
|
let a = n ? G(e, i) : e[i];
|
|
@@ -2376,30 +2402,30 @@ var Gi = (e) => e.render(Wi(e)), Ki = () => {
|
|
|
2376
2402
|
let { _f: e } = a;
|
|
2377
2403
|
if (e) {
|
|
2378
2404
|
if (e.refs && e.refs[0] && t(e.refs[0], i) && !r || e.ref && t(e.ref, e.name) && !r) return !0;
|
|
2379
|
-
if (
|
|
2380
|
-
} else if ((B(a) || Array.isArray(a)) &&
|
|
2405
|
+
if (Qi(a, t)) break;
|
|
2406
|
+
} else if ((B(a) || Array.isArray(a)) && Qi(a, t)) break;
|
|
2381
2407
|
}
|
|
2382
2408
|
}
|
|
2383
|
-
},
|
|
2409
|
+
}, $i = (e, t, n) => {
|
|
2384
2410
|
let r = G(e, n), i = Array.isArray(r) ? r : [];
|
|
2385
|
-
return J(i,
|
|
2386
|
-
}, Z = (e) => B(e) && !Object.keys(e).length,
|
|
2387
|
-
if (!
|
|
2411
|
+
return J(i, Ai, t[n]), J(e, n, i), e;
|
|
2412
|
+
}, Z = (e) => B(e) && !Object.keys(e).length, ea = (e) => {
|
|
2413
|
+
if (!Oi) return !1;
|
|
2388
2414
|
let t = e ? e.ownerDocument : 0;
|
|
2389
2415
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
2390
|
-
},
|
|
2416
|
+
}, ta = (e) => e.type === "radio", na = (e) => e instanceof RegExp, ra = (e, t, n, r, i) => t ? {
|
|
2391
2417
|
...n[e],
|
|
2392
2418
|
types: {
|
|
2393
2419
|
...n[e] && n[e].types ? n[e].types : {},
|
|
2394
2420
|
[r]: i || !0
|
|
2395
2421
|
}
|
|
2396
|
-
} : {},
|
|
2422
|
+
} : {}, ia = {
|
|
2397
2423
|
value: !1,
|
|
2398
2424
|
isValid: !1
|
|
2399
|
-
},
|
|
2425
|
+
}, aa = {
|
|
2400
2426
|
value: !0,
|
|
2401
2427
|
isValid: !0
|
|
2402
|
-
},
|
|
2428
|
+
}, oa = (e) => {
|
|
2403
2429
|
if (Array.isArray(e)) {
|
|
2404
2430
|
if (e.length > 1) {
|
|
2405
2431
|
let t = e.filter((e) => e && e.checked && !e.disabled).map((e) => e.value);
|
|
@@ -2408,30 +2434,30 @@ var Gi = (e) => e.render(Wi(e)), Ki = () => {
|
|
|
2408
2434
|
isValid: !!t.length
|
|
2409
2435
|
};
|
|
2410
2436
|
}
|
|
2411
|
-
return e[0].checked && !e[0].disabled ? e[0].attributes && !W(e[0].attributes.value) ? W(e[0].value) || e[0].value === "" ?
|
|
2437
|
+
return e[0].checked && !e[0].disabled ? e[0].attributes && !W(e[0].attributes.value) ? W(e[0].value) || e[0].value === "" ? aa : {
|
|
2412
2438
|
value: e[0].value,
|
|
2413
2439
|
isValid: !0
|
|
2414
|
-
} :
|
|
2440
|
+
} : aa : ia;
|
|
2415
2441
|
}
|
|
2416
|
-
return
|
|
2417
|
-
},
|
|
2442
|
+
return ia;
|
|
2443
|
+
}, sa = {
|
|
2418
2444
|
isValid: !1,
|
|
2419
2445
|
value: null
|
|
2420
|
-
},
|
|
2446
|
+
}, ca = (e) => Array.isArray(e) ? e.reduce((e, t) => t && t.checked && !t.disabled ? {
|
|
2421
2447
|
isValid: !0,
|
|
2422
2448
|
value: t.value
|
|
2423
|
-
} : e,
|
|
2424
|
-
function
|
|
2449
|
+
} : e, sa) : sa;
|
|
2450
|
+
function la(e, t, n = "validate") {
|
|
2425
2451
|
if (X(e) || Array.isArray(e) && e.every(X) || K(e) && !e) return {
|
|
2426
2452
|
type: n,
|
|
2427
2453
|
message: X(e) ? e : "",
|
|
2428
2454
|
ref: t
|
|
2429
2455
|
};
|
|
2430
2456
|
}
|
|
2431
|
-
var
|
|
2457
|
+
var ua = (e) => B(e) && !na(e) ? e : {
|
|
2432
2458
|
value: e,
|
|
2433
2459
|
message: ""
|
|
2434
|
-
},
|
|
2460
|
+
}, da = async (e, t, n, r, i, a) => {
|
|
2435
2461
|
let { ref: o, refs: s, required: c, maxLength: l, minLength: u, min: d, max: f, pattern: p, validate: m, name: h, valueAsNumber: g, mount: _ } = e._f, v = G(n, h);
|
|
2436
2462
|
if (!_ || t.has(h)) return {};
|
|
2437
2463
|
let y = s ? s[0] : o, b = (e) => {
|
|
@@ -2439,66 +2465,66 @@ var ca = (e) => B(e) && !ea(e) ? e : {
|
|
|
2439
2465
|
let t = K(e) ? "" : e || "";
|
|
2440
2466
|
s ? s.forEach((e) => e.setCustomValidity(t)) : y.setCustomValidity(t), y.reportValidity();
|
|
2441
2467
|
}
|
|
2442
|
-
}, x = {}, S =
|
|
2468
|
+
}, x = {}, S = ta(o), C = xi(o), w = S || C, T = (g || Si(o)) && W(o.value) && W(v) || ea(o) && o.value === "" || v === "" || Array.isArray(v) && !v.length, E = ra.bind(null, h, r, x), ee = (e, t, n, r = U.maxLength, i = U.minLength) => {
|
|
2443
2469
|
let a = e ? t : n;
|
|
2444
2470
|
x[h] = {
|
|
2445
2471
|
type: e ? r : i,
|
|
2446
2472
|
message: a,
|
|
2447
2473
|
ref: o,
|
|
2448
|
-
...
|
|
2474
|
+
...E(e ? r : i, a)
|
|
2449
2475
|
};
|
|
2450
2476
|
};
|
|
2451
|
-
if (a ? !Array.isArray(v) || !v.length : c && (!w && (T || z(v)) || K(v) && !v || C && !
|
|
2477
|
+
if (a ? !Array.isArray(v) || !v.length : c && (!w && (T || z(v)) || K(v) && !v || C && !oa(s).isValid || S && !ca(s).isValid)) {
|
|
2452
2478
|
let { value: e, message: t } = X(c) ? {
|
|
2453
2479
|
value: !!c,
|
|
2454
2480
|
message: c
|
|
2455
|
-
} :
|
|
2481
|
+
} : ua(c);
|
|
2456
2482
|
if (e && (x[h] = {
|
|
2457
2483
|
type: U.required,
|
|
2458
2484
|
message: t,
|
|
2459
2485
|
ref: y,
|
|
2460
|
-
...
|
|
2486
|
+
...E(U.required, t)
|
|
2461
2487
|
}, !r)) return b(t), x;
|
|
2462
2488
|
}
|
|
2463
2489
|
if (!T && (!z(d) || !z(f))) {
|
|
2464
|
-
let e, t, n =
|
|
2465
|
-
if (!z(v) && !
|
|
2490
|
+
let e, t, n = ua(f), i = ua(d);
|
|
2491
|
+
if (!z(v) && !Ci(v) && !isNaN(v)) {
|
|
2466
2492
|
let r = o.valueAsNumber || v && +v;
|
|
2467
2493
|
z(n.value) || (e = r > n.value), z(i.value) || (t = r < i.value);
|
|
2468
2494
|
} else {
|
|
2469
2495
|
let r = o.valueAsDate || new Date(v), a = (e) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + e), s = o.type == "time", c = o.type == "week";
|
|
2470
2496
|
X(n.value) && v && (e = s ? a(v) > a(n.value) : c ? v > n.value : r > new Date(n.value)), X(i.value) && v && (t = s ? a(v) < a(i.value) : c ? v < i.value : r < new Date(i.value));
|
|
2471
2497
|
}
|
|
2472
|
-
if ((e || t) && (
|
|
2498
|
+
if ((e || t) && (ee(!!e, n.message, i.message, U.max, U.min), !r)) return b(x[h].message), x;
|
|
2473
2499
|
}
|
|
2474
2500
|
if ((l || u) && !T && (X(v) || a && Array.isArray(v))) {
|
|
2475
|
-
let e =
|
|
2476
|
-
if ((n || i) && (
|
|
2501
|
+
let e = ua(l), t = ua(u), n = !z(e.value) && v.length > +e.value, i = !z(t.value) && v.length < +t.value;
|
|
2502
|
+
if ((n || i) && (ee(n, e.message, t.message), !r)) return b(x[h].message), x;
|
|
2477
2503
|
}
|
|
2478
2504
|
if (p && !T && X(v)) {
|
|
2479
|
-
let { value: e, message: t } =
|
|
2480
|
-
if (
|
|
2505
|
+
let { value: e, message: t } = ua(p);
|
|
2506
|
+
if (na(e) && !v.match(e) && (x[h] = {
|
|
2481
2507
|
type: U.pattern,
|
|
2482
2508
|
message: t,
|
|
2483
2509
|
ref: o,
|
|
2484
|
-
...
|
|
2510
|
+
...E(U.pattern, t)
|
|
2485
2511
|
}, !r)) return b(t), x;
|
|
2486
2512
|
}
|
|
2487
2513
|
if (m) {
|
|
2488
2514
|
if (q(m)) {
|
|
2489
|
-
let e =
|
|
2515
|
+
let e = la(await m(v, n), y);
|
|
2490
2516
|
if (e && (x[h] = {
|
|
2491
2517
|
...e,
|
|
2492
|
-
...
|
|
2518
|
+
...E(U.validate, e.message)
|
|
2493
2519
|
}, !r)) return b(e.message), x;
|
|
2494
2520
|
} else if (B(m)) {
|
|
2495
2521
|
let e = {};
|
|
2496
2522
|
for (let t in m) {
|
|
2497
2523
|
if (!Z(e) && !r) break;
|
|
2498
|
-
let i =
|
|
2524
|
+
let i = la(await m[t](v, n), y, t);
|
|
2499
2525
|
i && (e = {
|
|
2500
2526
|
...i,
|
|
2501
|
-
...
|
|
2527
|
+
...E(t, i.message)
|
|
2502
2528
|
}, b(i.message), r && (x[h] = e));
|
|
2503
2529
|
}
|
|
2504
2530
|
if (!Z(e) && (x[h] = {
|
|
@@ -2508,24 +2534,24 @@ var ca = (e) => B(e) && !ea(e) ? e : {
|
|
|
2508
2534
|
}
|
|
2509
2535
|
}
|
|
2510
2536
|
return b(!0), x;
|
|
2511
|
-
}, Q = (e) => Array.isArray(e) ? e : [e],
|
|
2512
|
-
function
|
|
2537
|
+
}, Q = (e) => Array.isArray(e) ? e : [e], fa = (e, t) => [...e, ...Q(t)], pa = (e) => Array.isArray(e) ? e.map(() => void 0) : void 0;
|
|
2538
|
+
function ma(e, t, n) {
|
|
2513
2539
|
return [
|
|
2514
2540
|
...e.slice(0, t),
|
|
2515
2541
|
...Q(n),
|
|
2516
2542
|
...e.slice(t)
|
|
2517
2543
|
];
|
|
2518
2544
|
}
|
|
2519
|
-
var
|
|
2520
|
-
function
|
|
2545
|
+
var ha = (e, t, n) => Array.isArray(e) ? (W(e[n]) && (e[n] = void 0), e.splice(n, 0, e.splice(t, 1)[0]), e) : [], ga = (e, t) => [...Q(t), ...Q(e)], _a = (e) => Array.isArray(e) ? e.filter(Boolean) : [];
|
|
2546
|
+
function va(e, t) {
|
|
2521
2547
|
let n = 0, r = [...e];
|
|
2522
2548
|
for (let e of t) r.splice(e - n, 1), n++;
|
|
2523
|
-
return
|
|
2549
|
+
return _a(r).length ? r : [];
|
|
2524
2550
|
}
|
|
2525
|
-
var
|
|
2551
|
+
var ya = (e, t) => W(t) ? [] : va(e, Q(t).sort((e, t) => e - t)), ba = (e, t, n) => {
|
|
2526
2552
|
[e[t], e[n]] = [e[n], e[t]];
|
|
2527
2553
|
};
|
|
2528
|
-
function
|
|
2554
|
+
function xa(e, t) {
|
|
2529
2555
|
let n = t.length - 1, r = 0;
|
|
2530
2556
|
for (; r < n;) {
|
|
2531
2557
|
if (z(e)) {
|
|
@@ -2536,31 +2562,31 @@ function ya(e, t) {
|
|
|
2536
2562
|
}
|
|
2537
2563
|
return e;
|
|
2538
2564
|
}
|
|
2539
|
-
function
|
|
2565
|
+
function Sa(e) {
|
|
2540
2566
|
for (let t in e) if (e.hasOwnProperty(t) && !W(e[t])) return !1;
|
|
2541
2567
|
return !0;
|
|
2542
2568
|
}
|
|
2543
2569
|
function $(e, t) {
|
|
2544
2570
|
if (X(t) && Object.prototype.hasOwnProperty.call(e, t)) return delete e[t], e;
|
|
2545
|
-
let n = Array.isArray(t) ? t :
|
|
2546
|
-
if (n.some((e) =>
|
|
2547
|
-
let r = n.length === 1 ? e :
|
|
2548
|
-
return r && delete r[a], i !== 0 && (B(r) && Z(r) || Array.isArray(r) &&
|
|
2549
|
-
}
|
|
2550
|
-
var
|
|
2551
|
-
function
|
|
2552
|
-
let t =
|
|
2553
|
-
a || n._names.array.add(r),
|
|
2571
|
+
let n = Array.isArray(t) ? t : Ni(t) ? [t] : Fi(t);
|
|
2572
|
+
if (n.some((e) => ji.includes(String(e)))) return e;
|
|
2573
|
+
let r = n.length === 1 ? e : xa(e, n), i = n.length - 1, a = n[i];
|
|
2574
|
+
return r && delete r[a], i !== 0 && (B(r) && Z(r) || Array.isArray(r) && Sa(r)) && $(e, n.slice(0, -1)), e;
|
|
2575
|
+
}
|
|
2576
|
+
var Ca = (e, t, n) => (e[t] = n, e);
|
|
2577
|
+
function wa(e) {
|
|
2578
|
+
let t = Li(), { control: n = t, name: r, keyName: i = "id", disabled: a, shouldUnregister: o, rules: s } = e, [c, l] = A.useState(n._getFieldArray(r)), u = A.useRef(n._getFieldArray(r).map(Ji)), d = A.useRef(!1);
|
|
2579
|
+
a || n._names.array.add(r), A.useMemo(() => !a && s && c.length >= 0 && n.register(r, s), [
|
|
2554
2580
|
n,
|
|
2555
2581
|
r,
|
|
2556
2582
|
c.length,
|
|
2557
2583
|
s,
|
|
2558
2584
|
a
|
|
2559
|
-
]),
|
|
2585
|
+
]), zi(() => {
|
|
2560
2586
|
if (!a) return n._subjects.array.subscribe({ next: ({ values: e, name: t }) => {
|
|
2561
2587
|
if (t === r || !t) {
|
|
2562
2588
|
let n = G(e, r);
|
|
2563
|
-
Array.isArray(n) ? (l(n), u.current = n.map(
|
|
2589
|
+
Array.isArray(n) ? (l(n), u.current = n.map(Ji)) : t || (l([]), u.current = []);
|
|
2564
2590
|
}
|
|
2565
2591
|
} }).unsubscribe;
|
|
2566
2592
|
}, [
|
|
@@ -2568,29 +2594,29 @@ function Sa(e) {
|
|
|
2568
2594
|
r,
|
|
2569
2595
|
a
|
|
2570
2596
|
]);
|
|
2571
|
-
let f =
|
|
2597
|
+
let f = A.useCallback((e) => {
|
|
2572
2598
|
d.current = !0, n._setFieldArray(r, e);
|
|
2573
2599
|
}, [n, r]);
|
|
2574
|
-
return
|
|
2600
|
+
return A.useEffect(() => {
|
|
2575
2601
|
if (a) {
|
|
2576
2602
|
n._state.actionArrayLengths.delete(r);
|
|
2577
2603
|
return;
|
|
2578
2604
|
}
|
|
2579
|
-
n._state.action = !1, n._state.actionArrayLengths.delete(r),
|
|
2580
|
-
let e =
|
|
2581
|
-
if (d.current && (!e.isOnSubmit || n._formState.isSubmitted) && !
|
|
2605
|
+
n._state.action = !1, n._state.actionArrayLengths.delete(r), Zi(r, n._names) && n._subjects.state.next({ ...n._formState });
|
|
2606
|
+
let e = Xi(n._options.mode);
|
|
2607
|
+
if (d.current && (!e.isOnSubmit || n._formState.isSubmitted) && !Xi(n._options.reValidateMode).isOnSubmit && !e.isOnBlur) if (n._options.resolver) n._runSchema([r]).then((e) => {
|
|
2582
2608
|
n._updateIsValidating([r]);
|
|
2583
2609
|
let t = G(e.errors, r), i = G(n._formState.errors, r), a = i && (i.type || i.root?.type), o = i && (i.message || i.root?.message);
|
|
2584
|
-
(i ? !t && a || t && (a !== t.type || o !== t.message) : t && t.type) && (t ? B(t) && !Object.keys(t).some((e) => !Number.isNaN(+e)) ?
|
|
2610
|
+
(i ? !t && a || t && (a !== t.type || o !== t.message) : t && t.type) && (t ? B(t) && !Object.keys(t).some((e) => !Number.isNaN(+e)) ? $i(n._formState.errors, { [r]: t }, r) : J(n._formState.errors, r, t) : $(n._formState.errors, r), n._subjects.state.next({ errors: n._formState.errors }));
|
|
2585
2611
|
});
|
|
2586
2612
|
else {
|
|
2587
2613
|
let e = G(n._fields, r);
|
|
2588
|
-
e && e._f && !(
|
|
2614
|
+
e && e._f && !(Xi(n._options.reValidateMode).isOnSubmit && Xi(n._options.mode).isOnSubmit) && da(e, n._names.disabled, n._formValues, n._options.criteriaMode === H.all, n._options.shouldUseNativeValidation, !0).then((e) => !Z(e) && n._subjects.state.next({ errors: $i(n._formState.errors, e, r) }));
|
|
2589
2615
|
}
|
|
2590
2616
|
d.current && n._subjects.state.next({
|
|
2591
2617
|
name: r,
|
|
2592
2618
|
values: V(n._formValues)
|
|
2593
|
-
}), n._names.focus &&
|
|
2619
|
+
}), n._names.focus && Qi(n._fields, (e, t) => {
|
|
2594
2620
|
if (n._names.focus && t.startsWith(n._names.focus) && e.focus) return e.focus(), 1;
|
|
2595
2621
|
}), n._names.focus = "", n._setValid(), d.current = !1;
|
|
2596
2622
|
}, [
|
|
@@ -2598,7 +2624,7 @@ function Sa(e) {
|
|
|
2598
2624
|
r,
|
|
2599
2625
|
n,
|
|
2600
2626
|
a
|
|
2601
|
-
]),
|
|
2627
|
+
]), A.useEffect(() => (a || !G(n._formValues, r) && n._setFieldArray(r), () => {
|
|
2602
2628
|
if (n._state.actionArrayLengths.delete(r), a) return;
|
|
2603
2629
|
let e = !(n._options.shouldUnregister || o);
|
|
2604
2630
|
d.current && e && n._subjects.state.next({
|
|
@@ -2615,10 +2641,10 @@ function Sa(e) {
|
|
|
2615
2641
|
o,
|
|
2616
2642
|
a
|
|
2617
2643
|
]), {
|
|
2618
|
-
swap:
|
|
2644
|
+
swap: A.useCallback((e, t) => {
|
|
2619
2645
|
if (a) return;
|
|
2620
2646
|
let i = n._getFieldArray(r);
|
|
2621
|
-
|
|
2647
|
+
ba(i, e, t), ba(u.current, e, t), f(i), l(i), n._setFieldArray(r, i, ba, {
|
|
2622
2648
|
argA: e,
|
|
2623
2649
|
argB: t
|
|
2624
2650
|
}, !1);
|
|
@@ -2628,10 +2654,10 @@ function Sa(e) {
|
|
|
2628
2654
|
n,
|
|
2629
2655
|
a
|
|
2630
2656
|
]),
|
|
2631
|
-
move:
|
|
2657
|
+
move: A.useCallback((e, t) => {
|
|
2632
2658
|
if (a) return;
|
|
2633
2659
|
let i = n._getFieldArray(r);
|
|
2634
|
-
|
|
2660
|
+
ha(i, e, t), ha(u.current, e, t), f(i), l(i), n._setFieldArray(r, i, ha, {
|
|
2635
2661
|
argA: e,
|
|
2636
2662
|
argB: t
|
|
2637
2663
|
}, !1);
|
|
@@ -2641,42 +2667,42 @@ function Sa(e) {
|
|
|
2641
2667
|
n,
|
|
2642
2668
|
a
|
|
2643
2669
|
]),
|
|
2644
|
-
prepend:
|
|
2670
|
+
prepend: A.useCallback((e, t) => {
|
|
2645
2671
|
if (a) return;
|
|
2646
|
-
let i = Q(V(e)), o =
|
|
2647
|
-
n._names.focus =
|
|
2672
|
+
let i = Q(V(e)), o = ga(n._getFieldArray(r), i);
|
|
2673
|
+
n._names.focus = Yi(r, 0, t), u.current = ga(u.current, i.map(Ji)), f(o), l(o), n._setFieldArray(r, o, ga, { argA: pa(e) });
|
|
2648
2674
|
}, [
|
|
2649
2675
|
f,
|
|
2650
2676
|
r,
|
|
2651
2677
|
n,
|
|
2652
2678
|
a
|
|
2653
2679
|
]),
|
|
2654
|
-
append:
|
|
2680
|
+
append: A.useCallback((e, t) => {
|
|
2655
2681
|
if (a) return;
|
|
2656
|
-
let i = Q(V(e)), o =
|
|
2657
|
-
n._names.focus =
|
|
2682
|
+
let i = Q(V(e)), o = fa(n._getFieldArray(r), i);
|
|
2683
|
+
n._names.focus = Yi(r, o.length - 1, t), u.current = fa(u.current, i.map(Ji)), f(o), l(o), n._setFieldArray(r, o, fa, { argA: pa(e) });
|
|
2658
2684
|
}, [
|
|
2659
2685
|
f,
|
|
2660
2686
|
r,
|
|
2661
2687
|
n,
|
|
2662
2688
|
a
|
|
2663
2689
|
]),
|
|
2664
|
-
remove:
|
|
2690
|
+
remove: A.useCallback((e) => {
|
|
2665
2691
|
if (a) return;
|
|
2666
|
-
let t =
|
|
2667
|
-
u.current =
|
|
2692
|
+
let t = ya(n._getFieldArray(r), e);
|
|
2693
|
+
u.current = ya(u.current, e), f(t), l(t), !Array.isArray(G(n._fields, r)) && J(n._fields, r, void 0), n._setFieldArray(r, t, ya, { argA: e });
|
|
2668
2694
|
}, [
|
|
2669
2695
|
f,
|
|
2670
2696
|
r,
|
|
2671
2697
|
n,
|
|
2672
2698
|
a
|
|
2673
2699
|
]),
|
|
2674
|
-
insert:
|
|
2700
|
+
insert: A.useCallback((e, t, i) => {
|
|
2675
2701
|
if (a) return;
|
|
2676
|
-
let o = Q(V(t)), s =
|
|
2677
|
-
n._names.focus =
|
|
2702
|
+
let o = Q(V(t)), s = ma(n._getFieldArray(r), e, o);
|
|
2703
|
+
n._names.focus = Yi(r, e, i), u.current = ma(u.current, e, o.map(Ji)), f(s), l(s), n._setFieldArray(r, s, ma, {
|
|
2678
2704
|
argA: e,
|
|
2679
|
-
argB:
|
|
2705
|
+
argB: pa(t)
|
|
2680
2706
|
});
|
|
2681
2707
|
}, [
|
|
2682
2708
|
f,
|
|
@@ -2684,10 +2710,10 @@ function Sa(e) {
|
|
|
2684
2710
|
n,
|
|
2685
2711
|
a
|
|
2686
2712
|
]),
|
|
2687
|
-
update:
|
|
2713
|
+
update: A.useCallback((e, t) => {
|
|
2688
2714
|
if (a) return;
|
|
2689
|
-
let i = V(t), o =
|
|
2690
|
-
u.current = [...o].map((t, n) => !t || n === e ?
|
|
2715
|
+
let i = V(t), o = Ca(n._getFieldArray(r), e, i);
|
|
2716
|
+
u.current = [...o].map((t, n) => !t || n === e ? Ji() : u.current[n]), f(o), l([...o]), n._setFieldArray(r, o, Ca, {
|
|
2691
2717
|
argA: e,
|
|
2692
2718
|
argB: i
|
|
2693
2719
|
}, !0, !1);
|
|
@@ -2697,20 +2723,20 @@ function Sa(e) {
|
|
|
2697
2723
|
n,
|
|
2698
2724
|
a
|
|
2699
2725
|
]),
|
|
2700
|
-
replace:
|
|
2726
|
+
replace: A.useCallback((e) => {
|
|
2701
2727
|
if (a) return;
|
|
2702
2728
|
let t = Q(V(e));
|
|
2703
|
-
u.current = t.map(
|
|
2729
|
+
u.current = t.map(Ji), f([...t]), l([...t]), n._setFieldArray(r, [...t], (e) => e, {}, !0, !1);
|
|
2704
2730
|
}, [
|
|
2705
2731
|
f,
|
|
2706
2732
|
r,
|
|
2707
2733
|
n,
|
|
2708
2734
|
a
|
|
2709
2735
|
]),
|
|
2710
|
-
fields:
|
|
2736
|
+
fields: A.useMemo(() => c.map((e, t) => ({
|
|
2711
2737
|
...e,
|
|
2712
2738
|
...K(a) ? { disabled: a } : {},
|
|
2713
|
-
[i]: u.current[t] ||
|
|
2739
|
+
[i]: u.current[t] || Ji()
|
|
2714
2740
|
})), [
|
|
2715
2741
|
c,
|
|
2716
2742
|
i,
|
|
@@ -2718,16 +2744,16 @@ function Sa(e) {
|
|
|
2718
2744
|
])
|
|
2719
2745
|
};
|
|
2720
2746
|
}
|
|
2721
|
-
var
|
|
2747
|
+
var Ta = (e) => {
|
|
2722
2748
|
let t = {};
|
|
2723
|
-
for (let n of Object.keys(e)) if (
|
|
2724
|
-
let r =
|
|
2749
|
+
for (let n of Object.keys(e)) if (wi(e[n]) && e[n] !== null && !Ci(e[n])) {
|
|
2750
|
+
let r = Ta(e[n]);
|
|
2725
2751
|
for (let e of Object.keys(r)) t[`${n}.${e}`] = r[e];
|
|
2726
2752
|
} else t[n] = e[n];
|
|
2727
2753
|
return t;
|
|
2728
|
-
},
|
|
2729
|
-
|
|
2730
|
-
var
|
|
2754
|
+
}, Ea = A.createContext(null);
|
|
2755
|
+
Ea.displayName = "HookFormContext";
|
|
2756
|
+
var Da = () => {
|
|
2731
2757
|
let e = [];
|
|
2732
2758
|
return {
|
|
2733
2759
|
get observers() {
|
|
@@ -2744,65 +2770,65 @@ var Ta = () => {
|
|
|
2744
2770
|
}
|
|
2745
2771
|
};
|
|
2746
2772
|
};
|
|
2747
|
-
function
|
|
2773
|
+
function Oa(e, t) {
|
|
2748
2774
|
let n = {};
|
|
2749
2775
|
for (let r in e) if (e.hasOwnProperty(r)) {
|
|
2750
2776
|
let i = e[r], a = t[r];
|
|
2751
2777
|
if (i && B(i) && a) {
|
|
2752
|
-
let e =
|
|
2778
|
+
let e = Oa(i, a);
|
|
2753
2779
|
B(e) && (n[r] = e);
|
|
2754
2780
|
} else e[r] && (n[r] = a);
|
|
2755
2781
|
}
|
|
2756
2782
|
return n;
|
|
2757
2783
|
}
|
|
2758
|
-
var
|
|
2759
|
-
function
|
|
2784
|
+
var ka = (e) => e.type === "select-multiple", Aa = (e) => ta(e) || xi(e), ja = (e) => ea(e) && e.isConnected;
|
|
2785
|
+
function Ma(e) {
|
|
2760
2786
|
return Array.isArray(e) || B(e);
|
|
2761
2787
|
}
|
|
2762
|
-
function
|
|
2788
|
+
function Na(e, t, n = "", r = []) {
|
|
2763
2789
|
for (let i in e) {
|
|
2764
2790
|
let a = n ? `${n}.${i}` : i, o = e[i];
|
|
2765
|
-
|
|
2791
|
+
Ma(o) && Ma(G(t, a)) ? Na(o, t, a, r) : r.push(a);
|
|
2766
2792
|
}
|
|
2767
2793
|
return r;
|
|
2768
2794
|
}
|
|
2769
|
-
var
|
|
2795
|
+
var Pa = (e) => {
|
|
2770
2796
|
for (let t in e) if (q(e[t])) return !0;
|
|
2771
2797
|
return !1;
|
|
2772
2798
|
};
|
|
2773
|
-
function
|
|
2774
|
-
return Array.isArray(e) || B(e) && !
|
|
2799
|
+
function Fa(e) {
|
|
2800
|
+
return Array.isArray(e) || B(e) && !Pa(e);
|
|
2775
2801
|
}
|
|
2776
|
-
function
|
|
2802
|
+
function Ia(e) {
|
|
2777
2803
|
return !!(e && "_f" in e);
|
|
2778
2804
|
}
|
|
2779
|
-
function
|
|
2805
|
+
function La(e) {
|
|
2780
2806
|
return Array.isArray(e) ? !e.some((e) => !W(e)) : !Object.keys(e).length;
|
|
2781
2807
|
}
|
|
2782
|
-
function
|
|
2808
|
+
function Ra(e, t) {
|
|
2783
2809
|
Array.isArray(e) ? e[t] = void 0 : delete e[t];
|
|
2784
2810
|
}
|
|
2785
|
-
function
|
|
2811
|
+
function za(e, t = {}, n) {
|
|
2786
2812
|
for (let r in e) {
|
|
2787
2813
|
let i = e[r], a = n && n[r];
|
|
2788
|
-
|
|
2814
|
+
Fa(i) && (!Array.isArray(i) || !Ia(a)) ? (t[r] = Array.isArray(i) ? [] : {}, za(i, t[r], a), La(t[r]) && Ra(t, r)) : W(i) || (t[r] = !0);
|
|
2789
2815
|
}
|
|
2790
2816
|
return t;
|
|
2791
2817
|
}
|
|
2792
|
-
function
|
|
2793
|
-
n ||=
|
|
2818
|
+
function Ba(e, t, n, r) {
|
|
2819
|
+
n ||= za(t, {}, r);
|
|
2794
2820
|
for (let i in e) {
|
|
2795
2821
|
let a = e[i], o = r && r[i];
|
|
2796
|
-
|
|
2822
|
+
Fa(a) && (!Array.isArray(a) || !Ia(o)) ? (W(t) || Bi(n[i]) ? n[i] = za(a, Array.isArray(a) ? [] : {}, o) : Ba(a, z(t) ? {} : t[i], n[i], o), La(n[i]) && Ra(n, i)) : Y(a, t[i]) ? Ra(n, i) : n[i] = !0;
|
|
2797
2823
|
}
|
|
2798
2824
|
return n;
|
|
2799
2825
|
}
|
|
2800
|
-
var
|
|
2801
|
-
function
|
|
2826
|
+
var Va = (e, { valueAsNumber: t, valueAsDate: n, setValueAs: r }) => W(e) ? e : t ? e === "" ? NaN : e && +e : n && X(e) ? new Date(e) : r ? r(e) : e;
|
|
2827
|
+
function Ha(e) {
|
|
2802
2828
|
let t = e.ref;
|
|
2803
|
-
return
|
|
2829
|
+
return Si(t) ? t.files : ta(t) ? ca(e.refs).value : ka(t) ? [...t.selectedOptions].map(({ value: e }) => e) : xi(t) ? oa(e.refs).value : Va(t.value, e);
|
|
2804
2830
|
}
|
|
2805
|
-
var
|
|
2831
|
+
var Ua = (e, t, n, r) => {
|
|
2806
2832
|
let i = {};
|
|
2807
2833
|
for (let n of e) {
|
|
2808
2834
|
let e = G(t, n);
|
|
@@ -2814,17 +2840,17 @@ var Va = (e, t, n, r) => {
|
|
|
2814
2840
|
fields: i,
|
|
2815
2841
|
shouldUseNativeValidation: r
|
|
2816
2842
|
};
|
|
2817
|
-
},
|
|
2843
|
+
}, Wa = (e) => W(e) ? e : na(e) ? e.source : B(e) ? na(e.value) ? e.value.source : e.value : e, Ga = "AsyncFunction", Ka = (e) => {
|
|
2818
2844
|
if (!e || !e.validate) return !1;
|
|
2819
|
-
if (q(e.validate)) return e.validate.constructor.name ===
|
|
2845
|
+
if (q(e.validate)) return e.validate.constructor.name === Ga;
|
|
2820
2846
|
if (B(e.validate)) {
|
|
2821
|
-
for (let t in e.validate) if (e.validate[t].constructor.name ===
|
|
2847
|
+
for (let t in e.validate) if (e.validate[t].constructor.name === Ga) return !0;
|
|
2822
2848
|
}
|
|
2823
2849
|
return !1;
|
|
2824
|
-
},
|
|
2825
|
-
function
|
|
2850
|
+
}, qa = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
|
|
2851
|
+
function Ja(e, t, n) {
|
|
2826
2852
|
let r = G(e, n);
|
|
2827
|
-
if (r ||
|
|
2853
|
+
if (r || Ni(n)) return {
|
|
2828
2854
|
error: r,
|
|
2829
2855
|
name: n
|
|
2830
2856
|
};
|
|
@@ -2844,21 +2870,21 @@ function Ka(e, t, n) {
|
|
|
2844
2870
|
}
|
|
2845
2871
|
return { name: n };
|
|
2846
2872
|
}
|
|
2847
|
-
var
|
|
2873
|
+
var Ya = (e, t, n, r) => {
|
|
2848
2874
|
n(e);
|
|
2849
2875
|
let i = Object.keys(e).filter((e) => e !== "name");
|
|
2850
2876
|
return !i.length || r && i.length >= Object.keys(t).length || i.find((e) => t[e] === (!r || H.all));
|
|
2851
|
-
},
|
|
2877
|
+
}, Xa = (e, t, n) => !e || !t || e === t || Q(e).some((e) => e && (n ? e === t || e.startsWith(t + ".") : e.startsWith(t) || t.startsWith(e))), Za = (e, t, n, r, i) => i.isOnAll ? !1 : !n && i.isOnTouch ? !(t || e) : (n ? r.isOnBlur : i.isOnBlur) ? !e : (n ? r.isOnChange : i.isOnChange) ? e : !0, Qa = (e, t) => {
|
|
2852
2878
|
let n = G(e, t);
|
|
2853
|
-
!
|
|
2854
|
-
},
|
|
2879
|
+
!_a(n).length && !n?.root && $(e, t);
|
|
2880
|
+
}, $a = {
|
|
2855
2881
|
mode: H.onSubmit,
|
|
2856
2882
|
reValidateMode: H.onChange,
|
|
2857
2883
|
shouldFocusError: !0
|
|
2858
|
-
},
|
|
2884
|
+
}, eo = "form", to = (e, t) => {
|
|
2859
2885
|
for (let n in e) n in t || delete e[n];
|
|
2860
2886
|
Object.assign(e, t);
|
|
2861
|
-
},
|
|
2887
|
+
}, no = {
|
|
2862
2888
|
submitCount: 0,
|
|
2863
2889
|
isDirty: !1,
|
|
2864
2890
|
isReady: !1,
|
|
@@ -2871,12 +2897,12 @@ var qa = (e, t, n, r) => {
|
|
|
2871
2897
|
dirtyFields: {},
|
|
2872
2898
|
validatingFields: {}
|
|
2873
2899
|
};
|
|
2874
|
-
function
|
|
2900
|
+
function ro(e = {}) {
|
|
2875
2901
|
let t = {
|
|
2876
|
-
|
|
2902
|
+
...$a,
|
|
2877
2903
|
...e
|
|
2878
2904
|
}, n = {
|
|
2879
|
-
...V(
|
|
2905
|
+
...V(no),
|
|
2880
2906
|
isLoading: q(t.defaultValues),
|
|
2881
2907
|
errors: t.errors || {},
|
|
2882
2908
|
disabled: t.disabled || !1
|
|
@@ -2893,7 +2919,7 @@ function to(e = {}) {
|
|
|
2893
2919
|
array: /* @__PURE__ */ new Set(),
|
|
2894
2920
|
watch: /* @__PURE__ */ new Set(),
|
|
2895
2921
|
registerName: /* @__PURE__ */ new Set()
|
|
2896
|
-
}, c = {}, l = {}, u = 0, d =
|
|
2922
|
+
}, c = {}, l = {}, u = 0, d = Xi(t.mode), f = Xi(t.reValidateMode), p = {
|
|
2897
2923
|
isDirty: !1,
|
|
2898
2924
|
dirtyFields: !1,
|
|
2899
2925
|
validatingFields: !1,
|
|
@@ -2902,17 +2928,17 @@ function to(e = {}) {
|
|
|
2902
2928
|
isValid: !1,
|
|
2903
2929
|
errors: !1
|
|
2904
2930
|
}, m = { ...p }, h = { ...m }, g = {
|
|
2905
|
-
array:
|
|
2906
|
-
state:
|
|
2931
|
+
array: Da(),
|
|
2932
|
+
state: Da()
|
|
2907
2933
|
}, _ = 0, v = t.criteriaMode === H.all, y = (e, t) => (n) => {
|
|
2908
2934
|
clearTimeout(l[e]), l[e] = setTimeout(t, n);
|
|
2909
2935
|
}, b = async (e) => {
|
|
2910
2936
|
if (!o.keepIsValid && !t.disabled && (m.isValid || h.isValid || e)) {
|
|
2911
2937
|
let e = ++_, i;
|
|
2912
|
-
t.resolver ? (i = Z((await
|
|
2938
|
+
t.resolver ? (i = Z((await D()).errors), e === _ && x()) : i = await A({
|
|
2913
2939
|
fields: r,
|
|
2914
2940
|
onlyCheckValid: !0,
|
|
2915
|
-
eventType:
|
|
2941
|
+
eventType: ki.VALID
|
|
2916
2942
|
}), e === _ && i !== n.isValid && g.state.next({ isValid: i });
|
|
2917
2943
|
}
|
|
2918
2944
|
}, x = (e, r) => {
|
|
@@ -2923,7 +2949,7 @@ function to(e = {}) {
|
|
|
2923
2949
|
isValidating: !Z(n.validatingFields)
|
|
2924
2950
|
}));
|
|
2925
2951
|
}, S = () => {
|
|
2926
|
-
n.dirtyFields =
|
|
2952
|
+
n.dirtyFields = Ba(i, a, void 0, r);
|
|
2927
2953
|
}, C = (e, i = [], s, c, l = !0, u = !0) => {
|
|
2928
2954
|
if (c && s && !t.disabled) {
|
|
2929
2955
|
if (o.action = !0, !o.actionArrayLengths.has(e)) {
|
|
@@ -2936,7 +2962,7 @@ function to(e = {}) {
|
|
|
2936
2962
|
}
|
|
2937
2963
|
if (u && Array.isArray(G(n.errors, e))) {
|
|
2938
2964
|
let t = G(n.errors, e), r = t.root, i = s(t, c.argA, c.argB) || t;
|
|
2939
|
-
r && (i.root = r), l && J(n.errors, e, i),
|
|
2965
|
+
r && (i.root = r), l && J(n.errors, e, i), Qa(n.errors, e);
|
|
2940
2966
|
}
|
|
2941
2967
|
if ((m.touchedFields || h.touchedFields) && u && Array.isArray(G(n.touchedFields, e))) {
|
|
2942
2968
|
let t = s(G(n.touchedFields, e), c.argA, c.argB);
|
|
@@ -2944,7 +2970,7 @@ function to(e = {}) {
|
|
|
2944
2970
|
}
|
|
2945
2971
|
(m.dirtyFields || h.dirtyFields) && S(), g.state.next({
|
|
2946
2972
|
name: e,
|
|
2947
|
-
isDirty:
|
|
2973
|
+
isDirty: j(e, i),
|
|
2948
2974
|
dirtyFields: n.dirtyFields,
|
|
2949
2975
|
errors: n.errors,
|
|
2950
2976
|
isValid: n.isValid
|
|
@@ -2957,16 +2983,16 @@ function to(e = {}) {
|
|
|
2957
2983
|
errors: n.errors,
|
|
2958
2984
|
isValid: !1
|
|
2959
2985
|
});
|
|
2960
|
-
},
|
|
2961
|
-
let t =
|
|
2986
|
+
}, E = (e) => {
|
|
2987
|
+
let t = Ni(e) ? [e] : Fi(e), n = a, r = i;
|
|
2962
2988
|
for (let e = 0; e < t.length - 1; e++) {
|
|
2963
2989
|
let i = t[e];
|
|
2964
2990
|
if (n = z(n) ? n : n[i], r = z(r) ? r : r[i], n === null && r !== null) return !0;
|
|
2965
2991
|
}
|
|
2966
2992
|
return !1;
|
|
2967
|
-
},
|
|
2993
|
+
}, ee = (e) => {
|
|
2968
2994
|
if (!o.actionArrayLengths.size) return !1;
|
|
2969
|
-
let t =
|
|
2995
|
+
let t = Ni(e) ? [e] : Fi(e), n = a, r = "", i = -1, s = 0;
|
|
2970
2996
|
for (let e = 0; e < t.length; e++) {
|
|
2971
2997
|
if (z(n)) return !1;
|
|
2972
2998
|
let a = t[e];
|
|
@@ -2974,19 +3000,19 @@ function to(e = {}) {
|
|
|
2974
3000
|
o.actionArrayLengths.has(r) && (i = e + 1, s = o.actionArrayLengths.get(r)), n = n[a];
|
|
2975
3001
|
}
|
|
2976
3002
|
return !1;
|
|
2977
|
-
},
|
|
3003
|
+
}, te = (t, c, l, u) => {
|
|
2978
3004
|
let d = G(r, t);
|
|
2979
3005
|
if (d) {
|
|
2980
|
-
if (
|
|
3006
|
+
if (E(t) || ee(t)) return;
|
|
2981
3007
|
let r = W(G(a, t)), f = G(a, t, W(l) ? G(i, t) : l);
|
|
2982
|
-
W(f) || u && u.defaultChecked || c ? J(a, t, c ? f :
|
|
3008
|
+
W(f) || u && u.defaultChecked || c ? J(a, t, c ? f : Ha(d._f)) : se(t, f), o.mount && !o.action && (b(), r && n.isDirty && (m.isDirty || h.isDirty) && (j() || (n.isDirty = !1, g.state.next({ ...n }))), e.shouldUnregister && r && !W(G(a, t)) && Zi(t, s) && (o.watch = !0));
|
|
2983
3009
|
}
|
|
2984
|
-
},
|
|
3010
|
+
}, ne = (e, o, s, c, l) => {
|
|
2985
3011
|
let u = !1, d = !1, f = { name: e };
|
|
2986
3012
|
if (!t.disabled || c === !0) {
|
|
2987
3013
|
if (!s || c) {
|
|
2988
3014
|
let t = Y(G(i, e), o);
|
|
2989
|
-
(m.isDirty || h.isDirty) && (d = n.isDirty, n.isDirty = f.isDirty = !t ||
|
|
3015
|
+
(m.isDirty || h.isDirty) && (d = n.isDirty, n.isDirty = f.isDirty = !t || j(), u = d !== f.isDirty), d = !!G(n.dirtyFields, e), t === n.isDirty ? t ? $(n.dirtyFields, e) : J(n.dirtyFields, e, !0) : to(n.dirtyFields, Ba(i, a, void 0, r)), f.dirtyFields = n.dirtyFields, u ||= (m.dirtyFields || h.dirtyFields) && d !== !t;
|
|
2990
3016
|
}
|
|
2991
3017
|
if (s) {
|
|
2992
3018
|
let t = G(n.touchedFields, e);
|
|
@@ -2995,7 +3021,7 @@ function to(e = {}) {
|
|
|
2995
3021
|
u && l && g.state.next(f);
|
|
2996
3022
|
}
|
|
2997
3023
|
return u ? f : {};
|
|
2998
|
-
},
|
|
3024
|
+
}, re = (e, r, i, a) => {
|
|
2999
3025
|
let o = G(n.errors, e), s = (m.isValid || h.isValid) && K(r) && n.isValid !== r;
|
|
3000
3026
|
if (t.delayError && i ? (c[e] = y(e, () => w(e, i)), c[e](t.delayError)) : (clearTimeout(l[e]), delete c[e], i ? J(n.errors, e, i) : $(n.errors, e), n.errors = { ...n.errors }), (i ? !Y(o, i) : o) || !Z(a) || s) {
|
|
3001
3027
|
let t = {
|
|
@@ -3009,17 +3035,17 @@ function to(e = {}) {
|
|
|
3009
3035
|
...t
|
|
3010
3036
|
}, g.state.next(t);
|
|
3011
3037
|
}
|
|
3012
|
-
},
|
|
3013
|
-
let { errors: t } = await
|
|
3038
|
+
}, D = async (e) => (x(e, !0), await t.resolver(a, t.context, Ua(e || s.mount, r, t.criteriaMode, t.shouldUseNativeValidation))), O = async (e) => {
|
|
3039
|
+
let { errors: t } = await D(e);
|
|
3014
3040
|
if (x(e), e) {
|
|
3015
3041
|
for (let r of e) {
|
|
3016
3042
|
let e = G(t, r);
|
|
3017
|
-
e ? s.array.has(r) && B(e) && !Object.keys(e).some((e) => !Number.isNaN(Number(e))) ?
|
|
3043
|
+
e ? s.array.has(r) && B(e) && !Object.keys(e).some((e) => !Number.isNaN(Number(e))) ? $i(n.errors, { [r]: e }, r) : J(n.errors, r, e) : $(n.errors, r);
|
|
3018
3044
|
}
|
|
3019
3045
|
n.errors = { ...n.errors };
|
|
3020
3046
|
} else n.errors = t;
|
|
3021
3047
|
return t;
|
|
3022
|
-
},
|
|
3048
|
+
}, k = async ({ name: t, eventType: r }) => {
|
|
3023
3049
|
if (e.validate) {
|
|
3024
3050
|
let i = await e.validate({
|
|
3025
3051
|
formValues: a,
|
|
@@ -3029,23 +3055,23 @@ function to(e = {}) {
|
|
|
3029
3055
|
});
|
|
3030
3056
|
if (B(i)) for (let e in i) {
|
|
3031
3057
|
let t = i[e];
|
|
3032
|
-
t &&
|
|
3058
|
+
t && ge(`${eo}.${e}`, {
|
|
3033
3059
|
message: X(t.message) ? t.message : "",
|
|
3034
3060
|
type: t.type || U.validate
|
|
3035
3061
|
});
|
|
3036
3062
|
}
|
|
3037
|
-
else X(i) || !i ?
|
|
3063
|
+
else X(i) || !i ? ge(eo, {
|
|
3038
3064
|
message: i || "",
|
|
3039
3065
|
type: U.validate
|
|
3040
|
-
}) :
|
|
3066
|
+
}) : he(eo);
|
|
3041
3067
|
return i;
|
|
3042
3068
|
}
|
|
3043
3069
|
return !0;
|
|
3044
|
-
},
|
|
3070
|
+
}, A = async ({ fields: r, onlyCheckValid: i, name: o, eventType: c, context: l = {
|
|
3045
3071
|
valid: !0,
|
|
3046
3072
|
runRootValidation: !1
|
|
3047
3073
|
} }) => {
|
|
3048
|
-
if (e.validate && (l.runRootValidation = !0, !await
|
|
3074
|
+
if (e.validate && (l.runRootValidation = !0, !await k({
|
|
3049
3075
|
name: o,
|
|
3050
3076
|
eventType: c
|
|
3051
3077
|
}) && (l.valid = !1, i))) return l.valid;
|
|
@@ -3054,12 +3080,12 @@ function to(e = {}) {
|
|
|
3054
3080
|
if (u) {
|
|
3055
3081
|
let { _f: r, ...d } = u;
|
|
3056
3082
|
if (r) {
|
|
3057
|
-
let o = s.array.has(r.name), c = u._f &&
|
|
3083
|
+
let o = s.array.has(r.name), c = u._f && Ka(u._f), d = m.validatingFields || m.isValidating || h.validatingFields || h.isValidating;
|
|
3058
3084
|
c && d && x([r.name], !0);
|
|
3059
|
-
let f = await
|
|
3060
|
-
if (c && d && x([r.name]), f[r.name] && (l.valid = !1, i) || (!i && (G(f, r.name) ? o ?
|
|
3085
|
+
let f = await da(u, s.disabled, a, v, t.shouldUseNativeValidation && !i, o);
|
|
3086
|
+
if (c && d && x([r.name]), f[r.name] && (l.valid = !1, i) || (!i && (G(f, r.name) ? o ? $i(n.errors, f, r.name) : J(n.errors, r.name, f[r.name]) : $(n.errors, r.name)), e.shouldUseNativeValidation && f[r.name])) break;
|
|
3061
3087
|
}
|
|
3062
|
-
!Z(d) && await
|
|
3088
|
+
!Z(d) && await A({
|
|
3063
3089
|
context: l,
|
|
3064
3090
|
onlyCheckValid: i,
|
|
3065
3091
|
fields: d,
|
|
@@ -3069,25 +3095,25 @@ function to(e = {}) {
|
|
|
3069
3095
|
}
|
|
3070
3096
|
}
|
|
3071
3097
|
return l.valid;
|
|
3072
|
-
},
|
|
3098
|
+
}, ie = () => {
|
|
3073
3099
|
for (let e of s.unMount) {
|
|
3074
3100
|
let t = G(r, e);
|
|
3075
|
-
t && (t._f.refs ? t._f.refs.every((e) => !
|
|
3101
|
+
t && (t._f.refs ? t._f.refs.every((e) => !ja(e)) : !ja(t._f.ref)) && be(e);
|
|
3076
3102
|
}
|
|
3077
3103
|
s.unMount = /* @__PURE__ */ new Set();
|
|
3078
|
-
},
|
|
3104
|
+
}, j = (e, t) => (e && t && J(a, e, t), !Y(o.mount ? a : i, i)), ae = (e, t, n) => Wi(e, s, { ...o.mount ? a : W(t) || X(e) ? i : t }, n, t), oe = (e) => _a(G(o.mount ? a : i, e, t.shouldUnregister ? G(i, e, []) : [])), se = (e, t, n = {}, i = !1, o = !1, s = !1) => {
|
|
3079
3105
|
let c = G(r, e), l = t;
|
|
3080
3106
|
if (c) {
|
|
3081
3107
|
let n = c._f;
|
|
3082
|
-
n && (!n.disabled && J(a, e,
|
|
3108
|
+
n && (!n.disabled && J(a, e, Va(t, n)), l = ea(n.ref) && z(t) ? "" : t, ka(n.ref) ? [...n.ref.options].forEach((e) => e.selected = l.includes(e.value)) : n.refs ? xi(n.ref) ? n.refs.forEach((e) => {
|
|
3083
3109
|
(!e.defaultChecked || !e.disabled) && (Array.isArray(l) ? e.checked = !!l.find((t) => t === e.value) : e.checked = l === e.value || !!l);
|
|
3084
|
-
}) : n.refs.forEach((e) => e.checked = e.value === l) :
|
|
3110
|
+
}) : n.refs.forEach((e) => e.checked = e.value === l) : Si(n.ref) ? n.ref.value = "" : (n.ref.value = l, !n.ref.type && !o && !s && g.state.next({
|
|
3085
3111
|
name: e,
|
|
3086
3112
|
values: i ? a : V(a)
|
|
3087
3113
|
})));
|
|
3088
3114
|
}
|
|
3089
|
-
(n.shouldDirty || n.shouldTouch) &&
|
|
3090
|
-
},
|
|
3115
|
+
(n.shouldDirty || n.shouldTouch) && ne(e, l, n.shouldTouch, n.shouldDirty, !o), n.shouldValidate && pe(e, { delayError: n.delayError });
|
|
3116
|
+
}, ce = (e, t, n, i = !1, o = !1, c = !1) => {
|
|
3091
3117
|
s.array.has(e) && g.array.next({
|
|
3092
3118
|
name: e,
|
|
3093
3119
|
values: i ? a : V(a)
|
|
@@ -3095,9 +3121,9 @@ function to(e = {}) {
|
|
|
3095
3121
|
for (let a in t) {
|
|
3096
3122
|
if (!t.hasOwnProperty(a)) return;
|
|
3097
3123
|
let l = t[a], u = e + "." + a, d = G(r, u);
|
|
3098
|
-
(s.array.has(e) || B(l) || d && !d._f) && !
|
|
3124
|
+
(s.array.has(e) || B(l) || d && !d._f) && !Ci(l) ? ce(u, l, n, i, o, c) : se(u, l, n, i, o, c);
|
|
3099
3125
|
}
|
|
3100
|
-
},
|
|
3126
|
+
}, le = (e, t, i, c, l = !1) => {
|
|
3101
3127
|
let u = G(r, e), d = s.array.has(e), f = c ? t : V(t), p = Y(G(a, e), f);
|
|
3102
3128
|
if (p || J(a, e, f), d) g.array.next({
|
|
3103
3129
|
name: e,
|
|
@@ -3105,29 +3131,29 @@ function to(e = {}) {
|
|
|
3105
3131
|
}), (m.isDirty || m.dirtyFields || h.isDirty || h.dirtyFields) && i.shouldDirty && (S(), l || g.state.next({
|
|
3106
3132
|
name: e,
|
|
3107
3133
|
dirtyFields: n.dirtyFields,
|
|
3108
|
-
isDirty:
|
|
3134
|
+
isDirty: j(e, f)
|
|
3109
3135
|
}));
|
|
3110
3136
|
else {
|
|
3111
3137
|
let t = Array.isArray(f) && !f.length || Z(f), n = !p && !l;
|
|
3112
|
-
!u || u._f || z(f) || t ?
|
|
3138
|
+
!u || u._f || z(f) || t ? se(e, f, i, c, l, n) : ce(e, f, i, c, l, n);
|
|
3113
3139
|
}
|
|
3114
3140
|
if (!p && !l) {
|
|
3115
|
-
let t =
|
|
3141
|
+
let t = Zi(e, s), r = c ? a : V(a);
|
|
3116
3142
|
g.state.next({
|
|
3117
3143
|
...t && n,
|
|
3118
3144
|
name: o.mount || t ? e : void 0,
|
|
3119
3145
|
values: r
|
|
3120
3146
|
});
|
|
3121
3147
|
}
|
|
3122
|
-
},
|
|
3148
|
+
}, M = (e, t, n = {}) => le(e, t, n, !1), ue = (e, t = {}) => {
|
|
3123
3149
|
let r = q(e) ? e(a) : e;
|
|
3124
3150
|
if (!Y(a, r)) {
|
|
3125
3151
|
a = {
|
|
3126
3152
|
...a,
|
|
3127
3153
|
...r
|
|
3128
3154
|
};
|
|
3129
|
-
let e =
|
|
3130
|
-
for (let n of s.mount) n in e &&
|
|
3155
|
+
let e = Ta(r);
|
|
3156
|
+
for (let n of s.mount) n in e && le(n, e[n], t, !0, !0);
|
|
3131
3157
|
g.state.next({
|
|
3132
3158
|
...n,
|
|
3133
3159
|
name: void 0,
|
|
@@ -3135,13 +3161,13 @@ function to(e = {}) {
|
|
|
3135
3161
|
...u ? { values: a } : {}
|
|
3136
3162
|
}), t.shouldValidate && b();
|
|
3137
3163
|
}
|
|
3138
|
-
},
|
|
3164
|
+
}, de = async (i) => {
|
|
3139
3165
|
o.mount = !0;
|
|
3140
3166
|
let l = i.target, p = l.name, _ = !0, y = G(r, p), S = (e) => {
|
|
3141
|
-
_ = Number.isNaN(e) ||
|
|
3167
|
+
_ = Number.isNaN(e) || Ci(e) && isNaN(e.getTime()) || Y(e, G(a, p, e));
|
|
3142
3168
|
};
|
|
3143
3169
|
if (y) {
|
|
3144
|
-
let o, C, w = l.type ?
|
|
3170
|
+
let o, C, w = l.type ? Ha(y._f) : Ti(i), T = i.type === ki.BLUR || i.type === ki.FOCUS_OUT, E = !qa(y._f) && !e.validate && !t.resolver && !G(n.errors, p) && !y._f.deps, ee = E || Za(T, G(n.touchedFields, p), n.isSubmitted, f, d), te = Zi(p, s, T);
|
|
3145
3171
|
if (J(a, p, w), T) {
|
|
3146
3172
|
if (!l || !l.readOnly) {
|
|
3147
3173
|
y._f.onBlur && y._f.onBlur(i);
|
|
@@ -3149,51 +3175,51 @@ function to(e = {}) {
|
|
|
3149
3175
|
e && e(0);
|
|
3150
3176
|
}
|
|
3151
3177
|
} else y._f.onChange && y._f.onChange(i);
|
|
3152
|
-
let
|
|
3178
|
+
let O = ne(p, w, T), ie = !Z(O) || te;
|
|
3153
3179
|
if (!T && g.state.next({
|
|
3154
3180
|
name: p,
|
|
3155
3181
|
type: i.type,
|
|
3156
3182
|
...u ? { values: V(a) } : {}
|
|
3157
|
-
}),
|
|
3183
|
+
}), ee) return (!E || !n.isValid) && (m.isValid || h.isValid) && (t.mode === "onBlur" ? T && b() : T || b()), ie && g.state.next({
|
|
3158
3184
|
name: p,
|
|
3159
|
-
...
|
|
3185
|
+
...te ? {} : O
|
|
3160
3186
|
});
|
|
3161
|
-
if (!t.resolver && e.validate && await
|
|
3187
|
+
if (!t.resolver && e.validate && await k({
|
|
3162
3188
|
name: p,
|
|
3163
3189
|
eventType: i.type
|
|
3164
|
-
}), !T &&
|
|
3165
|
-
let { errors: e } = await
|
|
3190
|
+
}), !T && te && g.state.next({ ...n }), t.resolver) {
|
|
3191
|
+
let { errors: e } = await D([p]);
|
|
3166
3192
|
if (x([p]), S(w), !_) {
|
|
3167
|
-
!Z(
|
|
3193
|
+
!Z(O) && g.state.next(O);
|
|
3168
3194
|
return;
|
|
3169
3195
|
}
|
|
3170
|
-
let t =
|
|
3196
|
+
let t = Ja(n.errors, r, p), i = Ja(e, r, t.name || p);
|
|
3171
3197
|
o = i.error, p = i.name, C = Z(e);
|
|
3172
|
-
} else x([p], !0), o = (await
|
|
3198
|
+
} else x([p], !0), o = (await da(y, s.disabled, a, v, t.shouldUseNativeValidation))[p], x([p]), S(w), _ && (o ? C = !1 : (m.isValid || h.isValid) && (C = await A({
|
|
3173
3199
|
fields: r,
|
|
3174
3200
|
onlyCheckValid: !0,
|
|
3175
3201
|
name: p,
|
|
3176
3202
|
eventType: i.type
|
|
3177
3203
|
})));
|
|
3178
|
-
_ && (y._f.deps && (!Array.isArray(y._f.deps) || y._f.deps.length > 0) &&
|
|
3204
|
+
_ && (y._f.deps && (!Array.isArray(y._f.deps) || y._f.deps.length > 0) && pe(y._f.deps), re(p, C, o, O));
|
|
3179
3205
|
}
|
|
3180
|
-
},
|
|
3206
|
+
}, fe = (e, t) => {
|
|
3181
3207
|
if (G(n.errors, t) && e.focus) return e.focus(), 1;
|
|
3182
|
-
},
|
|
3208
|
+
}, pe = async (e, i = {}) => {
|
|
3183
3209
|
let a, o, u = Q(e);
|
|
3184
3210
|
if (t.resolver) {
|
|
3185
|
-
let t = await
|
|
3211
|
+
let t = await O(W(e) ? e : u);
|
|
3186
3212
|
a = Z(t), o = e ? !u.some((e) => G(t, e)) : a;
|
|
3187
3213
|
} else e ? (o = (await Promise.all(u.map(async (e) => {
|
|
3188
3214
|
let t = G(r, e);
|
|
3189
|
-
return await
|
|
3215
|
+
return await A({
|
|
3190
3216
|
fields: t && t._f ? { [e]: t } : t,
|
|
3191
|
-
eventType:
|
|
3217
|
+
eventType: ki.TRIGGER
|
|
3192
3218
|
});
|
|
3193
|
-
}))).every(Boolean), !(!o && !n.isValid) && b()) : o = a = await
|
|
3219
|
+
}))).every(Boolean), !(!o && !n.isValid) && b()) : o = a = await A({
|
|
3194
3220
|
fields: r,
|
|
3195
3221
|
name: e,
|
|
3196
|
-
eventType:
|
|
3222
|
+
eventType: ki.TRIGGER
|
|
3197
3223
|
});
|
|
3198
3224
|
if (i.delayError && t.delayError && X(e)) {
|
|
3199
3225
|
let r = G(n.errors, e);
|
|
@@ -3203,17 +3229,17 @@ function to(e = {}) {
|
|
|
3203
3229
|
...!X(e) || (m.isValid || h.isValid) && a !== n.isValid ? {} : { name: e },
|
|
3204
3230
|
...t.resolver || !e ? { isValid: a } : {},
|
|
3205
3231
|
errors: n.errors
|
|
3206
|
-
}), i.shouldFocus && !o &&
|
|
3207
|
-
},
|
|
3232
|
+
}), i.shouldFocus && !o && Qi(r, fe, e ? u : s.mount), o;
|
|
3233
|
+
}, me = (e, t) => {
|
|
3208
3234
|
let r = { ...o.mount ? a : i };
|
|
3209
|
-
return t && (r =
|
|
3210
|
-
},
|
|
3235
|
+
return t && (r = Oa(t.dirtyFields ? n.dirtyFields : n.touchedFields, r)), W(e) ? r : X(e) ? G(r, e) : e.map((e) => G(r, e));
|
|
3236
|
+
}, N = (e, t) => ({
|
|
3211
3237
|
invalid: !!G((t || n).errors, e),
|
|
3212
3238
|
isDirty: !!G((t || n).dirtyFields, e),
|
|
3213
3239
|
error: G((t || n).errors, e),
|
|
3214
3240
|
isValidating: !!G(n.validatingFields, e),
|
|
3215
3241
|
isTouched: !!G((t || n).touchedFields, e)
|
|
3216
|
-
}),
|
|
3242
|
+
}), he = (e) => {
|
|
3217
3243
|
let t = e ? Q(e) : void 0;
|
|
3218
3244
|
t?.forEach((e) => $(n.errors, e)), t ? t.forEach((e) => {
|
|
3219
3245
|
g.state.next({
|
|
@@ -3221,7 +3247,7 @@ function to(e = {}) {
|
|
|
3221
3247
|
errors: n.errors
|
|
3222
3248
|
});
|
|
3223
3249
|
}) : (n.errors = {}, g.state.next({ errors: n.errors }));
|
|
3224
|
-
},
|
|
3250
|
+
}, ge = (e, t, i) => {
|
|
3225
3251
|
let a = (G(r, e, { _f: {} })._f || {}).ref, { ref: o, message: s, type: c, ...l } = G(n.errors, e) || {};
|
|
3226
3252
|
J(n.errors, e, {
|
|
3227
3253
|
...l,
|
|
@@ -3232,20 +3258,20 @@ function to(e = {}) {
|
|
|
3232
3258
|
errors: n.errors,
|
|
3233
3259
|
isValid: !1
|
|
3234
3260
|
}), i && i.shouldFocus && a && a.focus && a.focus();
|
|
3235
|
-
},
|
|
3261
|
+
}, _e = (e, t) => {
|
|
3236
3262
|
if (q(e)) {
|
|
3237
3263
|
u++;
|
|
3238
|
-
let { unsubscribe: n } = g.state.subscribe({ next: (n) => "values" in n && e(n.values ||
|
|
3264
|
+
let { unsubscribe: n } = g.state.subscribe({ next: (n) => "values" in n && e(n.values || ae(void 0, t), n) }), r = !1;
|
|
3239
3265
|
return { unsubscribe: () => {
|
|
3240
3266
|
r || (r = !0, u--, n());
|
|
3241
3267
|
} };
|
|
3242
3268
|
}
|
|
3243
|
-
return
|
|
3244
|
-
},
|
|
3269
|
+
return ae(e, t, !0);
|
|
3270
|
+
}, ve = (e) => {
|
|
3245
3271
|
let t = !!e.formState?.values;
|
|
3246
3272
|
t && u++;
|
|
3247
3273
|
let { unsubscribe: r } = g.state.subscribe({ next: (t) => {
|
|
3248
|
-
if (
|
|
3274
|
+
if (Xa(e.name, t.name, e.exact) && Ya(t, e.formState || m, ke, e.reRenderRoot)) {
|
|
3249
3275
|
let r = { ...a };
|
|
3250
3276
|
e.callback({
|
|
3251
3277
|
values: r,
|
|
@@ -3260,27 +3286,27 @@ function to(e = {}) {
|
|
|
3260
3286
|
return () => {
|
|
3261
3287
|
o || (o = !0, u--, r());
|
|
3262
3288
|
};
|
|
3263
|
-
},
|
|
3289
|
+
}, ye = (e) => (o.mount = !0, h = {
|
|
3264
3290
|
...h,
|
|
3265
3291
|
...e.formState
|
|
3266
|
-
},
|
|
3292
|
+
}, ve({
|
|
3267
3293
|
...e,
|
|
3268
3294
|
formState: {
|
|
3269
3295
|
...p,
|
|
3270
3296
|
...e.formState
|
|
3271
3297
|
}
|
|
3272
|
-
})),
|
|
3298
|
+
})), be = (e, o = {}) => {
|
|
3273
3299
|
for (let c of e ? Q(e) : s.mount) s.mount.delete(c), s.array.delete(c), o.keepValue || ($(r, c), $(a, c)), !o.keepError && $(n.errors, c), !o.keepDirty && $(n.dirtyFields, c), !o.keepTouched && $(n.touchedFields, c), !o.keepIsValidating && $(n.validatingFields, c), !t.shouldUnregister && !o.keepDefaultValue && $(i, c);
|
|
3274
3300
|
g.state.next({ values: V(a) }), g.state.next({
|
|
3275
3301
|
...n,
|
|
3276
|
-
...o.keepDirty ? { isDirty:
|
|
3302
|
+
...o.keepDirty ? { isDirty: j() } : {}
|
|
3277
3303
|
}), !o.keepIsValid && b();
|
|
3278
|
-
},
|
|
3304
|
+
}, xe = ({ disabled: e, name: t }) => {
|
|
3279
3305
|
if (K(e) && o.mount || e || s.disabled.has(t)) {
|
|
3280
3306
|
let n = s.disabled.has(t) !== !!e;
|
|
3281
3307
|
e ? s.disabled.add(t) : s.disabled.delete(t), n && o.mount && !o.action && b();
|
|
3282
3308
|
}
|
|
3283
|
-
},
|
|
3309
|
+
}, Se = (e, n = {}) => {
|
|
3284
3310
|
let a = G(r, e), c = K(n.disabled) || K(t.disabled), l = !s.registerName.has(e) && a && a._f && !a._f.mount;
|
|
3285
3311
|
return J(r, e, {
|
|
3286
3312
|
...a || {},
|
|
@@ -3290,66 +3316,66 @@ function to(e = {}) {
|
|
|
3290
3316
|
mount: !0,
|
|
3291
3317
|
...n
|
|
3292
3318
|
}
|
|
3293
|
-
}), s.mount.add(e), a && !l ?
|
|
3319
|
+
}), s.mount.add(e), a && !l ? xe({
|
|
3294
3320
|
disabled: K(n.disabled) ? n.disabled : t.disabled,
|
|
3295
3321
|
name: e
|
|
3296
|
-
}) :
|
|
3322
|
+
}) : te(e, !0, n.value), {
|
|
3297
3323
|
...c ? { disabled: n.disabled || t.disabled } : {},
|
|
3298
3324
|
...t.progressive ? {
|
|
3299
3325
|
required: !!n.required,
|
|
3300
|
-
min:
|
|
3301
|
-
max:
|
|
3302
|
-
minLength:
|
|
3303
|
-
maxLength:
|
|
3304
|
-
pattern:
|
|
3326
|
+
min: Wa(n.min),
|
|
3327
|
+
max: Wa(n.max),
|
|
3328
|
+
minLength: Wa(n.minLength),
|
|
3329
|
+
maxLength: Wa(n.maxLength),
|
|
3330
|
+
pattern: Wa(n.pattern)
|
|
3305
3331
|
} : {},
|
|
3306
3332
|
name: e,
|
|
3307
|
-
onChange:
|
|
3308
|
-
onBlur:
|
|
3333
|
+
onChange: de,
|
|
3334
|
+
onBlur: de,
|
|
3309
3335
|
ref: (c) => {
|
|
3310
3336
|
if (c) {
|
|
3311
|
-
s.registerName.add(e),
|
|
3312
|
-
let t = W(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o =
|
|
3337
|
+
s.registerName.add(e), Se(e, n), s.registerName.delete(e), a = G(r, e);
|
|
3338
|
+
let t = W(c.value) && c.querySelectorAll && c.querySelectorAll("input,select,textarea")[0] || c, o = Aa(t), l = a._f.refs || [];
|
|
3313
3339
|
if (o ? l.find((e) => e === t) : t === a._f.ref) return;
|
|
3314
3340
|
let u = { ...a._f };
|
|
3315
3341
|
o ? (u.refs = [
|
|
3316
|
-
...l.filter(
|
|
3342
|
+
...l.filter(ja),
|
|
3317
3343
|
t,
|
|
3318
3344
|
...Array.isArray(G(i, e)) ? [{}] : []
|
|
3319
3345
|
], u.ref = {
|
|
3320
3346
|
type: t.type,
|
|
3321
3347
|
name: e
|
|
3322
|
-
}) : (u.ref = t, delete u.refs), J(r, e, { _f: u }),
|
|
3323
|
-
} else a = G(r, e, {}), a._f && (a._f.mount = !1), (t.shouldUnregister || n.shouldUnregister) && !(
|
|
3348
|
+
}) : (u.ref = t, delete u.refs), J(r, e, { _f: u }), te(e, !1, void 0, t);
|
|
3349
|
+
} else a = G(r, e, {}), a._f && (a._f.mount = !1), (t.shouldUnregister || n.shouldUnregister) && !(Ei(s.array, e) && o.action) && s.unMount.add(e);
|
|
3324
3350
|
}
|
|
3325
3351
|
};
|
|
3326
|
-
},
|
|
3327
|
-
K(e) && (g.state.next({ disabled: e }),
|
|
3352
|
+
}, Ce = () => t.shouldFocusError && !t.shouldUseNativeValidation && Qi(r, fe, s.mount), P = (e) => {
|
|
3353
|
+
K(e) && (g.state.next({ disabled: e }), Qi(r, (t, n) => {
|
|
3328
3354
|
let i = G(r, n);
|
|
3329
3355
|
i && (t.disabled = i._f.disabled || e, Array.isArray(i._f.refs) && i._f.refs.forEach((t) => {
|
|
3330
3356
|
t.disabled = i._f.disabled || e;
|
|
3331
3357
|
}));
|
|
3332
3358
|
}, 0, !1));
|
|
3333
|
-
},
|
|
3359
|
+
}, we = (e, i) => async (o) => {
|
|
3334
3360
|
let c, l;
|
|
3335
3361
|
o && (o.preventDefault && o.preventDefault(), o.persist && o.persist());
|
|
3336
3362
|
let u = V(a);
|
|
3337
3363
|
if (g.state.next({ isSubmitting: !0 }), t.resolver) {
|
|
3338
|
-
let { errors: e, values: t } = await
|
|
3364
|
+
let { errors: e, values: t } = await D();
|
|
3339
3365
|
x(), n.errors = e, u = V(t);
|
|
3340
|
-
} else await
|
|
3366
|
+
} else await A({
|
|
3341
3367
|
fields: r,
|
|
3342
|
-
eventType:
|
|
3368
|
+
eventType: ki.SUBMIT
|
|
3343
3369
|
});
|
|
3344
3370
|
if (s.disabled.size) for (let e of s.disabled) $(u, e);
|
|
3345
|
-
if ($(n.errors,
|
|
3371
|
+
if ($(n.errors, Ai), Z(n.errors)) {
|
|
3346
3372
|
g.state.next({ errors: {} });
|
|
3347
3373
|
try {
|
|
3348
3374
|
c = await e(u, o);
|
|
3349
3375
|
} catch (e) {
|
|
3350
3376
|
l = e;
|
|
3351
3377
|
}
|
|
3352
|
-
} else i && await i({ ...n.errors }, o),
|
|
3378
|
+
} else i && await i({ ...n.errors }, o), Ce(), setTimeout(Ce);
|
|
3353
3379
|
if (g.state.next({
|
|
3354
3380
|
isSubmitted: !0,
|
|
3355
3381
|
isSubmitting: !1,
|
|
@@ -3358,23 +3384,23 @@ function to(e = {}) {
|
|
|
3358
3384
|
errors: n.errors
|
|
3359
3385
|
}), l) throw l;
|
|
3360
3386
|
return c;
|
|
3361
|
-
},
|
|
3362
|
-
G(r, e) && (W(t.defaultValue) ?
|
|
3363
|
-
},
|
|
3387
|
+
}, Te = (e, t = {}) => {
|
|
3388
|
+
G(r, e) && (W(t.defaultValue) ? M(e, V(G(i, e))) : (M(e, t.defaultValue), J(i, e, V(t.defaultValue))), t.keepTouched || $(n.touchedFields, e), t.keepDirty || ($(n.dirtyFields, e), n.isDirty = t.defaultValue ? j(e, V(G(i, e))) : j()), t.keepError || ($(n.errors, e), m.isValid && b()), g.state.next({ ...n }));
|
|
3389
|
+
}, Ee = (e, c = {}) => {
|
|
3364
3390
|
let l = e ? V(e) : i, u = V(l), d = Z(e), f = u, p = r;
|
|
3365
3391
|
if (c.keepDefaultValues || (i = l), !c.keepValues) {
|
|
3366
3392
|
if (c.keepDirtyValues) {
|
|
3367
|
-
let e = /* @__PURE__ */ new Set([...s.mount, ...
|
|
3393
|
+
let e = /* @__PURE__ */ new Set([...s.mount, ...Na(Ba(i, a, void 0, p), n.dirtyFields)]);
|
|
3368
3394
|
for (let t of Array.from(e)) {
|
|
3369
3395
|
let e = G(n.dirtyFields, t), r = G(a, t), i = G(f, t);
|
|
3370
|
-
e && !W(r) ? J(f, t, r) : !e && !W(i) &&
|
|
3396
|
+
e && !W(r) ? J(f, t, r) : !e && !W(i) && M(t, i);
|
|
3371
3397
|
}
|
|
3372
3398
|
} else {
|
|
3373
|
-
if (
|
|
3399
|
+
if (Oi && W(e)) for (let e of s.mount) {
|
|
3374
3400
|
let t = G(r, e);
|
|
3375
3401
|
if (t && t._f) {
|
|
3376
3402
|
let e = Array.isArray(t._f.refs) ? t._f.refs[0] : t._f.ref;
|
|
3377
|
-
if (
|
|
3403
|
+
if (ea(e)) {
|
|
3378
3404
|
let t = e.closest("form");
|
|
3379
3405
|
if (t) {
|
|
3380
3406
|
t.reset();
|
|
@@ -3383,7 +3409,7 @@ function to(e = {}) {
|
|
|
3383
3409
|
}
|
|
3384
3410
|
}
|
|
3385
3411
|
}
|
|
3386
|
-
if (c.keepFieldsRef) for (let e of s.mount)
|
|
3412
|
+
if (c.keepFieldsRef) for (let e of s.mount) M(e, G(f, e));
|
|
3387
3413
|
else r = {};
|
|
3388
3414
|
}
|
|
3389
3415
|
if (t.shouldUnregister) {
|
|
@@ -3406,19 +3432,19 @@ function to(e = {}) {
|
|
|
3406
3432
|
focus: ""
|
|
3407
3433
|
}, o.mount = !m.isValid || !!c.keepIsValid || !!c.keepDirtyValues || !t.shouldUnregister && !Z(f), o.watch = !!t.shouldUnregister, o.keepIsValid = !!c.keepIsValid, o.action = !1, o.actionArrayLengths.clear(), c.keepErrors || (n.errors = {}), g.state.next({
|
|
3408
3434
|
submitCount: c.keepSubmitCount ? n.submitCount : 0,
|
|
3409
|
-
isDirty: d ? !1 : c.keepDirty ? n.isDirty : c.keepValues ?
|
|
3435
|
+
isDirty: d ? !1 : c.keepDirty ? n.isDirty : c.keepValues ? j() : !!(c.keepDefaultValues && !Y(e, i)),
|
|
3410
3436
|
isSubmitted: c.keepIsSubmitted ? n.isSubmitted : !1,
|
|
3411
|
-
dirtyFields: d ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ?
|
|
3437
|
+
dirtyFields: d ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ? Ba(i, a, void 0, p) : n.dirtyFields : c.keepDefaultValues && e ? Ba(i, e, void 0, p) : c.keepDirty ? n.dirtyFields : {},
|
|
3412
3438
|
touchedFields: c.keepTouched ? n.touchedFields : {},
|
|
3413
3439
|
errors: c.keepErrors ? n.errors : {},
|
|
3414
3440
|
isSubmitSuccessful: c.keepIsSubmitSuccessful ? n.isSubmitSuccessful : !1,
|
|
3415
3441
|
isSubmitting: !1,
|
|
3416
3442
|
defaultValues: i
|
|
3417
3443
|
});
|
|
3418
|
-
},
|
|
3444
|
+
}, De = (e, n) => Ee(q(e) ? e(a) : e, {
|
|
3419
3445
|
...t.resetOptions,
|
|
3420
3446
|
...n
|
|
3421
|
-
}),
|
|
3447
|
+
}), Oe = (e, t = {}) => {
|
|
3422
3448
|
let n = G(r, e), i = n && n._f;
|
|
3423
3449
|
if (i) {
|
|
3424
3450
|
let e = i.refs ? i.refs[0] : i.ref;
|
|
@@ -3426,38 +3452,38 @@ function to(e = {}) {
|
|
|
3426
3452
|
e.focus(), t.shouldSelect && q(e.select) && e.select();
|
|
3427
3453
|
});
|
|
3428
3454
|
}
|
|
3429
|
-
},
|
|
3455
|
+
}, ke = (e) => {
|
|
3430
3456
|
let { name: t, type: r, values: i, ...a } = e;
|
|
3431
3457
|
n = {
|
|
3432
3458
|
...n,
|
|
3433
3459
|
...a
|
|
3434
3460
|
};
|
|
3435
3461
|
};
|
|
3436
|
-
g.state.subscribe({ next:
|
|
3437
|
-
let
|
|
3462
|
+
g.state.subscribe({ next: ke });
|
|
3463
|
+
let Ae = {
|
|
3438
3464
|
control: {
|
|
3439
|
-
register:
|
|
3440
|
-
unregister:
|
|
3441
|
-
getFieldState:
|
|
3442
|
-
handleSubmit:
|
|
3443
|
-
setError:
|
|
3444
|
-
_subscribe:
|
|
3445
|
-
_runSchema:
|
|
3465
|
+
register: Se,
|
|
3466
|
+
unregister: be,
|
|
3467
|
+
getFieldState: N,
|
|
3468
|
+
handleSubmit: we,
|
|
3469
|
+
setError: ge,
|
|
3470
|
+
_subscribe: ve,
|
|
3471
|
+
_runSchema: D,
|
|
3446
3472
|
_updateIsValidating: x,
|
|
3447
|
-
_focusError:
|
|
3448
|
-
_getWatch:
|
|
3449
|
-
_getDirty:
|
|
3473
|
+
_focusError: Ce,
|
|
3474
|
+
_getWatch: ae,
|
|
3475
|
+
_getDirty: j,
|
|
3450
3476
|
_setValid: b,
|
|
3451
3477
|
_setFieldArray: C,
|
|
3452
|
-
_setDisabledField:
|
|
3478
|
+
_setDisabledField: xe,
|
|
3453
3479
|
_setErrors: T,
|
|
3454
|
-
_getFieldArray:
|
|
3455
|
-
_reset:
|
|
3480
|
+
_getFieldArray: oe,
|
|
3481
|
+
_reset: Ee,
|
|
3456
3482
|
_resetDefaultValues: () => q(t.defaultValues) && t.defaultValues().then((e) => {
|
|
3457
|
-
|
|
3483
|
+
De(e, t.resetOptions), g.state.next({ isLoading: !1 });
|
|
3458
3484
|
}),
|
|
3459
|
-
_removeUnmounted:
|
|
3460
|
-
_disableForm:
|
|
3485
|
+
_removeUnmounted: ie,
|
|
3486
|
+
_disableForm: P,
|
|
3461
3487
|
_subjects: g,
|
|
3462
3488
|
_proxyFormState: m,
|
|
3463
3489
|
get _fields() {
|
|
@@ -3491,22 +3517,22 @@ function to(e = {}) {
|
|
|
3491
3517
|
t = {
|
|
3492
3518
|
...t,
|
|
3493
3519
|
...e
|
|
3494
|
-
}, d =
|
|
3520
|
+
}, d = Xi(t.mode), f = Xi(t.reValidateMode);
|
|
3495
3521
|
}
|
|
3496
3522
|
},
|
|
3497
|
-
subscribe:
|
|
3498
|
-
trigger:
|
|
3499
|
-
register:
|
|
3500
|
-
handleSubmit:
|
|
3501
|
-
watch:
|
|
3502
|
-
setValue:
|
|
3503
|
-
setValues:
|
|
3504
|
-
getValues:
|
|
3505
|
-
reset:
|
|
3506
|
-
resetField:
|
|
3523
|
+
subscribe: ye,
|
|
3524
|
+
trigger: pe,
|
|
3525
|
+
register: Se,
|
|
3526
|
+
handleSubmit: we,
|
|
3527
|
+
watch: _e,
|
|
3528
|
+
setValue: M,
|
|
3529
|
+
setValues: ue,
|
|
3530
|
+
getValues: me,
|
|
3531
|
+
reset: De,
|
|
3532
|
+
resetField: Te,
|
|
3507
3533
|
resetDefaultValues: (e, t = {}) => {
|
|
3508
3534
|
if (i = V(e), !t.keepDirty) {
|
|
3509
|
-
let e =
|
|
3535
|
+
let e = Ba(i, a, void 0, r);
|
|
3510
3536
|
n.dirtyFields = e, n.isDirty = !Z(e);
|
|
3511
3537
|
}
|
|
3512
3538
|
t.keepIsValid || b(), g.state.next({
|
|
@@ -3514,20 +3540,20 @@ function to(e = {}) {
|
|
|
3514
3540
|
defaultValues: i
|
|
3515
3541
|
});
|
|
3516
3542
|
},
|
|
3517
|
-
clearErrors:
|
|
3518
|
-
unregister:
|
|
3519
|
-
setError:
|
|
3520
|
-
setFocus:
|
|
3521
|
-
getFieldState:
|
|
3543
|
+
clearErrors: he,
|
|
3544
|
+
unregister: be,
|
|
3545
|
+
setError: ge,
|
|
3546
|
+
setFocus: Oe,
|
|
3547
|
+
getFieldState: N
|
|
3522
3548
|
};
|
|
3523
3549
|
return {
|
|
3524
|
-
...
|
|
3525
|
-
formControl:
|
|
3550
|
+
...Ae,
|
|
3551
|
+
formControl: Ae
|
|
3526
3552
|
};
|
|
3527
3553
|
}
|
|
3528
|
-
function
|
|
3529
|
-
let t =
|
|
3530
|
-
...V(
|
|
3554
|
+
function io(e = {}) {
|
|
3555
|
+
let t = A.useRef(void 0), n = A.useRef(void 0), r = A.useRef(e.formControl), [i, a] = A.useState(() => ({
|
|
3556
|
+
...V(no),
|
|
3531
3557
|
isLoading: q(e.defaultValues),
|
|
3532
3558
|
errors: e.errors || {},
|
|
3533
3559
|
disabled: e.disabled || !1,
|
|
@@ -3538,7 +3564,7 @@ function no(e = {}) {
|
|
|
3538
3564
|
formState: i
|
|
3539
3565
|
}, e.defaultValues && !q(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
3540
3566
|
else {
|
|
3541
|
-
let { formControl: n, ...r } =
|
|
3567
|
+
let { formControl: n, ...r } = ro(e);
|
|
3542
3568
|
t.current = {
|
|
3543
3569
|
...r,
|
|
3544
3570
|
formState: i
|
|
@@ -3546,8 +3572,8 @@ function no(e = {}) {
|
|
|
3546
3572
|
}
|
|
3547
3573
|
let o = t.current.control;
|
|
3548
3574
|
o._options = e;
|
|
3549
|
-
let { resyncIfNeeded: s, snapshot: c } =
|
|
3550
|
-
return
|
|
3575
|
+
let { resyncIfNeeded: s, snapshot: c } = Hi();
|
|
3576
|
+
return zi(() => {
|
|
3551
3577
|
let e = () => ({
|
|
3552
3578
|
...o._formState,
|
|
3553
3579
|
defaultValues: o._defaultValues
|
|
@@ -3571,81 +3597,81 @@ function no(e = {}) {
|
|
|
3571
3597
|
o,
|
|
3572
3598
|
s,
|
|
3573
3599
|
c
|
|
3574
|
-
]),
|
|
3600
|
+
]), A.useEffect(() => o._disableForm(e.disabled), [o, e.disabled]), A.useEffect(() => {
|
|
3575
3601
|
e.mode && (o._options.mode = e.mode), e.reValidateMode && (o._options.reValidateMode = e.reValidateMode);
|
|
3576
3602
|
}, [
|
|
3577
3603
|
o,
|
|
3578
3604
|
e.mode,
|
|
3579
3605
|
e.reValidateMode
|
|
3580
|
-
]),
|
|
3606
|
+
]), A.useEffect(() => {
|
|
3581
3607
|
e.errors && (o._setErrors(e.errors), o._focusError());
|
|
3582
|
-
}, [o, e.errors]),
|
|
3608
|
+
}, [o, e.errors]), A.useEffect(() => {
|
|
3583
3609
|
e.shouldUnregister && o._subjects.state.next({ values: o._getWatch() });
|
|
3584
|
-
}, [o, e.shouldUnregister]),
|
|
3610
|
+
}, [o, e.shouldUnregister]), A.useEffect(() => {
|
|
3585
3611
|
if (o._proxyFormState.isDirty) {
|
|
3586
3612
|
let e = o._getDirty();
|
|
3587
3613
|
e !== i.isDirty && o._subjects.state.next({ isDirty: e });
|
|
3588
3614
|
}
|
|
3589
|
-
}, [o, i.isDirty]),
|
|
3615
|
+
}, [o, i.isDirty]), A.useEffect(() => {
|
|
3590
3616
|
e.values && !Y(e.values, n.current) ? (o._reset(e.values, {
|
|
3591
3617
|
keepFieldsRef: !0,
|
|
3592
3618
|
...o._options.resetOptions
|
|
3593
3619
|
}), o._options.resetOptions?.keepIsValid || o._setValid(), n.current = e.values, a((e) => ({ ...e }))) : o._resetDefaultValues();
|
|
3594
|
-
}, [o, e.values]),
|
|
3620
|
+
}, [o, e.values]), A.useEffect(() => {
|
|
3595
3621
|
o._state.mount || (o._setValid(), o._state.mount = !0), o._state.watch && (o._state.watch = !1, o._subjects.state.next({ ...o._formState })), o._removeUnmounted();
|
|
3596
|
-
}), t.current.formState =
|
|
3622
|
+
}), t.current.formState = A.useMemo(() => Ri(i, o), [o, i]), t.current;
|
|
3597
3623
|
}
|
|
3598
3624
|
//#endregion
|
|
3599
3625
|
//#region lib/components/ui/forms/use-field-blur.ts
|
|
3600
|
-
var
|
|
3626
|
+
var ao = typeof document > "u" ? null : document, oo = {
|
|
3601
3627
|
capture: !0,
|
|
3602
3628
|
passive: !0
|
|
3603
3629
|
};
|
|
3604
|
-
function
|
|
3630
|
+
function so(e, t) {
|
|
3605
3631
|
for (let t of e.roots) t.isConnected || e.roots.delete(t);
|
|
3606
3632
|
let n = [...e.roots];
|
|
3607
3633
|
if (!n.length) return !1;
|
|
3608
|
-
if (n.some((e) => e.contains(t))) return e.inside || (e.before = new Set(t.ownerDocument?.body.childNodes ?? []), e.home = new Set(n.map(
|
|
3634
|
+
if (n.some((e) => e.contains(t))) return e.inside || (e.before = new Set(t.ownerDocument?.body.childNodes ?? []), e.home = new Set(n.map(be)), e.opened = /* @__PURE__ */ new Set()), e.inside = !0, !1;
|
|
3609
3635
|
if (!e.inside) return !1;
|
|
3610
|
-
let r =
|
|
3636
|
+
let r = be(t);
|
|
3611
3637
|
if (e.home.has(r)) return !0;
|
|
3612
3638
|
if (!r || e.opened.has(r)) return !1;
|
|
3613
|
-
let i =
|
|
3639
|
+
let i = xe(n, e, r);
|
|
3614
3640
|
return i === "theirs" || !i && e.before.has(r) ? !0 : (e.opened.add(r), !1);
|
|
3615
3641
|
}
|
|
3616
|
-
function
|
|
3617
|
-
let n =
|
|
3642
|
+
function co(e, t) {
|
|
3643
|
+
let n = Lr(t), r = Lr(e), i = N({
|
|
3618
3644
|
roots: /* @__PURE__ */ new Set(),
|
|
3619
3645
|
inside: !1,
|
|
3620
3646
|
before: /* @__PURE__ */ new Set(),
|
|
3621
3647
|
home: /* @__PURE__ */ new Set(),
|
|
3622
3648
|
opened: /* @__PURE__ */ new Set()
|
|
3623
|
-
}).current, a =
|
|
3624
|
-
if (e) return i.roots.add(e), n.current?.(
|
|
3649
|
+
}).current, a = M((e) => {
|
|
3650
|
+
if (e) return i.roots.add(e), n.current?.(Se(i.roots)), () => {
|
|
3625
3651
|
i.roots.delete(e);
|
|
3626
3652
|
};
|
|
3627
|
-
}, [i, n]), o =
|
|
3653
|
+
}, [i, n]), o = M(() => {
|
|
3628
3654
|
i.inside = !1, r.current();
|
|
3629
|
-
}, [i, r]), s =
|
|
3655
|
+
}, [i, r]), s = M((e) => {
|
|
3630
3656
|
let t = e.target;
|
|
3631
|
-
t instanceof Node && (clearTimeout(i.settle),
|
|
3632
|
-
}, [i, o]), c =
|
|
3657
|
+
t instanceof Node && (clearTimeout(i.settle), so(i, t) && o());
|
|
3658
|
+
}, [i, o]), c = M((e) => {
|
|
3633
3659
|
!i.inside || e.relatedTarget || (clearTimeout(i.settle), i.settle = setTimeout(() => {
|
|
3634
3660
|
i.settle = setTimeout(() => {
|
|
3635
|
-
let e =
|
|
3636
|
-
i.inside && (!e || e ===
|
|
3661
|
+
let e = ao?.activeElement;
|
|
3662
|
+
i.inside && (!e || e === ao?.body) && o();
|
|
3637
3663
|
});
|
|
3638
3664
|
}));
|
|
3639
3665
|
}, [i, o]);
|
|
3640
|
-
return
|
|
3666
|
+
return Ir("focusin", s, ao, oo), Ir("focusout", c, ao, oo), de(() => () => clearTimeout(i.settle), [i]), a;
|
|
3641
3667
|
}
|
|
3642
3668
|
//#endregion
|
|
3643
3669
|
//#region lib/components/ui/forms/field-blur.tsx
|
|
3644
|
-
function
|
|
3645
|
-
return /* @__PURE__ */
|
|
3646
|
-
value:
|
|
3670
|
+
function lo({ onBlur: e, focusRef: t, children: n }) {
|
|
3671
|
+
return /* @__PURE__ */ D(Br, {
|
|
3672
|
+
value: co(e, t),
|
|
3647
3673
|
children: n
|
|
3648
3674
|
});
|
|
3649
3675
|
}
|
|
3650
3676
|
//#endregion
|
|
3651
|
-
export {
|
|
3677
|
+
export { fr as $, ei as A, Lr as B, li as C, ai as D, ci as E, Ur as F, Ar as G, Mr as H, Hr as I, Or as J, Tr as K, Vr as L, Qr as M, Jr as N, ni as O, Gr as P, hr as Q, zr as R, di as S, oi as T, kr as U, Ir as V, jr as W, wr as X, Cr as Y, Sr as Z, ui as _, G as a, Sn as at, mi as b, wa as c, gn as ct, Gi as d, Qt as dt, ur as et, vi as f, We as ft, gi as g, _i as h, ra as i, Nn as it, $r as j, ti as k, io as l, fn as lt, yi as m, co as n, Fn as nt, J as o, bn as ot, bi as p, De as pt, Er as q, qi as r, En as rt, Ki as s, jn as st, lo as t, mn as tt, Ui as u, cn as ut, pi as v, si as w, fi as x, hi as y, Rr as z };
|