@inploi/plugin-chatbot 4.1.0 → 4.1.1
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/cdn/index.js +1 -1
- package/dist/{chatbot-body-8b3ebdca.js → chatbot-body-38907c4e.js} +142 -142
- package/dist/{chatbot-body-7fa34af3.cjs → chatbot-body-d941017f.cjs} +1 -1
- package/dist/{index-cdef556d.js → index-41ded41e.js} +1 -1
- package/dist/{index-d8af0361.cjs → index-4fe4e036.cjs} +1 -1
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as Ue, i as Yt, k as Ne, a as er, b as le, A as Me, c as Ir, N as Ke, _ as V, d as tr, h as Y, e as re, p as ue, F as pt, u as G, o as l, f as Te, j as dt, y as pe, s as M, l as Ze, m as he, n as Mr, q as at, r as ee, t as Fr, v as ke, w as Nr, x as rr, z as Lr, B as nr, C as Tr, D as Se, E as Q, G as Dr, V as Rr, H as sr, I as je, J as Le, K as Or, L as Br, M as Pr, O as $r, P as jr, Q as zr, R as qr, S as Ur, T as Kr, U as Gr } from "./index-
|
|
1
|
+
import { g as Ue, i as Yt, k as Ne, a as er, b as le, A as Me, c as Ir, N as Ke, _ as V, d as tr, h as Y, e as re, p as ue, F as pt, u as G, o as l, f as Te, j as dt, y as pe, s as M, l as Ze, m as he, n as Mr, q as at, r as ee, t as Fr, v as ke, w as Nr, x as rr, z as Lr, B as nr, C as Tr, D as Se, E as Q, G as Dr, V as Rr, H as sr, I as je, J as Le, K as Or, L as Br, M as Pr, O as $r, P as jr, Q as zr, R as qr, S as Ur, T as Kr, U as Gr } from "./index-41ded41e.js";
|
|
2
2
|
import "@inploi/sdk";
|
|
3
3
|
const Ft = ({
|
|
4
4
|
condition: e,
|
|
@@ -272,9 +272,9 @@ const Ft = ({
|
|
|
272
272
|
...t.customProperties
|
|
273
273
|
}
|
|
274
274
|
})
|
|
275
|
-
}, h = async (k,
|
|
275
|
+
}, h = async (k, y) => {
|
|
276
276
|
const A = s();
|
|
277
|
-
d == null || d(k,
|
|
277
|
+
d == null || d(k, y);
|
|
278
278
|
try {
|
|
279
279
|
await Zr({
|
|
280
280
|
flow: e,
|
|
@@ -314,21 +314,21 @@ const Ft = ({
|
|
|
314
314
|
};
|
|
315
315
|
return {
|
|
316
316
|
interpret: async (k) => {
|
|
317
|
-
const
|
|
318
|
-
return h(
|
|
317
|
+
const y = e.nodes.find((A) => A.id === k) ?? er(e.nodes);
|
|
318
|
+
return h(y);
|
|
319
319
|
},
|
|
320
320
|
undo: (k) => {
|
|
321
|
-
let
|
|
321
|
+
let y = 1;
|
|
322
322
|
const A = e.nodes.find((E) => E.id === k[k.length - 1]);
|
|
323
323
|
for (let E = k.length - 2; E > 0; E--) {
|
|
324
324
|
const g = k[E], N = e.nodes.find((P) => P.id === g);
|
|
325
|
-
if (!N || (
|
|
325
|
+
if (!N || (y++, N.type.startsWith("question-")))
|
|
326
326
|
break;
|
|
327
327
|
}
|
|
328
328
|
x.abort(), x = new AbortController();
|
|
329
|
-
const S = e.nodes.find((E) => E.id === k[k.length -
|
|
329
|
+
const S = e.nodes.find((E) => E.id === k[k.length - y]);
|
|
330
330
|
return le(S, "Undo failed: new start node not found"), h(S, A), {
|
|
331
|
-
removed:
|
|
331
|
+
removed: y
|
|
332
332
|
};
|
|
333
333
|
},
|
|
334
334
|
abort: () => {
|
|
@@ -535,7 +535,7 @@ async function tn({
|
|
|
535
535
|
job: u.job,
|
|
536
536
|
submissions: Ir(s || {})
|
|
537
537
|
})
|
|
538
|
-
}).catch((
|
|
538
|
+
}).catch((y) => y);
|
|
539
539
|
r.data.key && e.addToSubmissions(r.data.key, {
|
|
540
540
|
type: "integration",
|
|
541
541
|
value: k
|
|
@@ -552,7 +552,7 @@ async function tn({
|
|
|
552
552
|
data: V.any
|
|
553
553
|
}
|
|
554
554
|
}))
|
|
555
|
-
}, (
|
|
555
|
+
}, (y) => {
|
|
556
556
|
i.log({
|
|
557
557
|
event: "FLOW_SUBMIT",
|
|
558
558
|
properties: {
|
|
@@ -560,10 +560,10 @@ async function tn({
|
|
|
560
560
|
flow_version: u.version,
|
|
561
561
|
flow_session_id: u.data.flowSessionId,
|
|
562
562
|
flow_build: u.build,
|
|
563
|
-
service:
|
|
563
|
+
service: y.service ?? "INVALID_SERVICE",
|
|
564
564
|
response: {
|
|
565
|
-
status:
|
|
566
|
-
payload: "data" in
|
|
565
|
+
status: y.status,
|
|
566
|
+
payload: "data" in y ? y.data : y.error.data ?? null
|
|
567
567
|
},
|
|
568
568
|
job: u.job
|
|
569
569
|
}
|
|
@@ -583,19 +583,19 @@ async function tn({
|
|
|
583
583
|
button_text: V.optional(V.union(V.string, V.nullish))
|
|
584
584
|
})
|
|
585
585
|
}
|
|
586
|
-
}), async (
|
|
587
|
-
if (
|
|
586
|
+
}), async (y) => {
|
|
587
|
+
if (y.redirect !== void 0) {
|
|
588
588
|
await e.sendMessage({
|
|
589
589
|
type: "text",
|
|
590
590
|
author: "bot",
|
|
591
|
-
text:
|
|
591
|
+
text: y.redirect.message ?? d("submission_redirect_message")
|
|
592
592
|
});
|
|
593
593
|
try {
|
|
594
|
-
const A = new URL(
|
|
594
|
+
const A = new URL(y.redirect.redirect_url);
|
|
595
595
|
v && !A.searchParams.has("anonymous_id") && A.searchParams.set("anonymous_id", v), await e.sendMessage({
|
|
596
596
|
type: "link",
|
|
597
597
|
href: A.toString(),
|
|
598
|
-
text:
|
|
598
|
+
text: y.redirect.button_text ?? d("complete_submission"),
|
|
599
599
|
onClick: () => {
|
|
600
600
|
if (!h) {
|
|
601
601
|
n.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
@@ -615,7 +615,7 @@ async function tn({
|
|
|
615
615
|
}
|
|
616
616
|
});
|
|
617
617
|
} catch (A) {
|
|
618
|
-
n.error(`Invalid redirect URL: ${
|
|
618
|
+
n.error(`Invalid redirect URL: ${y.redirect.redirect_url}`, A), e.sendMessage({
|
|
619
619
|
type: "system",
|
|
620
620
|
variant: "error",
|
|
621
621
|
text: d("redirect_url_error")
|
|
@@ -642,15 +642,15 @@ async function tn({
|
|
|
642
642
|
message: V.string
|
|
643
643
|
})
|
|
644
644
|
}
|
|
645
|
-
}), async (
|
|
645
|
+
}), async (y) => {
|
|
646
646
|
var A;
|
|
647
|
-
n.error(
|
|
647
|
+
n.error(y.error), await e.sendMessage({
|
|
648
648
|
type: "system",
|
|
649
649
|
variant: "error",
|
|
650
|
-
text: ((A =
|
|
650
|
+
text: ((A = y.error) == null ? void 0 : A.message) || d("submission_failed")
|
|
651
651
|
}), await p(!1);
|
|
652
|
-
}).otherwise(async (
|
|
653
|
-
n.error(
|
|
652
|
+
}).otherwise(async (y) => {
|
|
653
|
+
n.error(y), await e.sendMessage({
|
|
654
654
|
type: "system",
|
|
655
655
|
variant: "error",
|
|
656
656
|
text: d("submission_failed")
|
|
@@ -1083,7 +1083,7 @@ function gn(e) {
|
|
|
1083
1083
|
lastBounds: i
|
|
1084
1084
|
}), p = t ? typeof t == "number" ? t : t.scroll : null, x = t ? typeof t == "number" ? t : t.resize : null, v = re(!1);
|
|
1085
1085
|
ue(() => (v.current = !0, () => void (v.current = !1)));
|
|
1086
|
-
const [h, k,
|
|
1086
|
+
const [h, k, y] = pt(() => {
|
|
1087
1087
|
const g = () => {
|
|
1088
1088
|
if (!d.current.element)
|
|
1089
1089
|
return;
|
|
@@ -1111,10 +1111,10 @@ function gn(e) {
|
|
|
1111
1111
|
return [g, x ? Nt(g, x) : g, p ? Nt(g, p) : g];
|
|
1112
1112
|
}, [u, a, p, x]);
|
|
1113
1113
|
function A() {
|
|
1114
|
-
d.current.scrollContainers && (d.current.scrollContainers.forEach((g) => g.removeEventListener("scroll",
|
|
1114
|
+
d.current.scrollContainers && (d.current.scrollContainers.forEach((g) => g.removeEventListener("scroll", y, !0)), d.current.scrollContainers = null), d.current.resizeObserver && (d.current.resizeObserver.disconnect(), d.current.resizeObserver = null);
|
|
1115
1115
|
}
|
|
1116
1116
|
function S() {
|
|
1117
|
-
d.current.element && (d.current.resizeObserver = new s(
|
|
1117
|
+
d.current.element && (d.current.resizeObserver = new s(y), d.current.resizeObserver.observe(d.current.element), r && d.current.scrollContainers && d.current.scrollContainers.forEach((g) => g.addEventListener("scroll", y, {
|
|
1118
1118
|
capture: !0,
|
|
1119
1119
|
passive: !0
|
|
1120
1120
|
})));
|
|
@@ -1122,17 +1122,17 @@ function gn(e) {
|
|
|
1122
1122
|
const E = (g) => {
|
|
1123
1123
|
!g || g === d.current.element || (A(), d.current.element = g, d.current.scrollContainers = or(g), S());
|
|
1124
1124
|
};
|
|
1125
|
-
return
|
|
1125
|
+
return yn(y, !!r), bn(k), ue(() => {
|
|
1126
1126
|
A(), S();
|
|
1127
|
-
}, [r,
|
|
1127
|
+
}, [r, y, k]), ue(() => A, []), [E, i, h];
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1129
|
+
function bn(e) {
|
|
1130
1130
|
ue(() => {
|
|
1131
1131
|
const t = e;
|
|
1132
1132
|
return window.addEventListener("resize", t), () => void window.removeEventListener("resize", t);
|
|
1133
1133
|
}, [e]);
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1135
|
+
function yn(e, t) {
|
|
1136
1136
|
ue(() => {
|
|
1137
1137
|
if (t) {
|
|
1138
1138
|
const r = e;
|
|
@@ -1154,7 +1154,7 @@ function or(e) {
|
|
|
1154
1154
|
} = window.getComputedStyle(e);
|
|
1155
1155
|
return [r, n, a].some((s) => s === "auto" || s === "scroll") && t.push(e), [...t, ...or(e.parentElement)];
|
|
1156
1156
|
}
|
|
1157
|
-
const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn = (e, t) => vn.every((r) => e[r] === t[r]),
|
|
1157
|
+
const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn = (e, t) => vn.every((r) => e[r] === t[r]), ye = ({
|
|
1158
1158
|
class: e,
|
|
1159
1159
|
...t
|
|
1160
1160
|
}) => {
|
|
@@ -1628,7 +1628,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1628
1628
|
return {
|
|
1629
1629
|
ok: !0,
|
|
1630
1630
|
data: d.map((p) => {
|
|
1631
|
-
var x, v, h, k,
|
|
1631
|
+
var x, v, h, k, y, A, S, E, g;
|
|
1632
1632
|
return {
|
|
1633
1633
|
label: p.full_address ?? p.place_formatted ?? p.name ?? p.mapbox_id,
|
|
1634
1634
|
id: p.mapbox_id,
|
|
@@ -1636,7 +1636,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1636
1636
|
line1: ((x = p.context.address) == null ? void 0 : x.name) ?? ((v = p.context.street) == null ? void 0 : v.name),
|
|
1637
1637
|
line2: void 0,
|
|
1638
1638
|
line3: ((h = p.context.neighborhood) == null ? void 0 : h.name) ?? ((k = p.context.locality) == null ? void 0 : k.name),
|
|
1639
|
-
city: ((
|
|
1639
|
+
city: ((y = p.context.place) == null ? void 0 : y.name) ?? ((A = p.context.district) == null ? void 0 : A.name),
|
|
1640
1640
|
state: (S = p.context.region) == null ? void 0 : S.name,
|
|
1641
1641
|
postcode: (E = p.context.postcode) == null ? void 0 : E.name,
|
|
1642
1642
|
country: (g = p.context.country) == null ? void 0 : g.name
|
|
@@ -1684,7 +1684,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1684
1684
|
} = An({
|
|
1685
1685
|
logger: r,
|
|
1686
1686
|
t: n
|
|
1687
|
-
}), [x, v] = Y(d ? "query" : "manual"), [h, k] = Y(""), [
|
|
1687
|
+
}), [x, v] = Y(d ? "query" : "manual"), [h, k] = Y(""), [y, A] = Y(), S = (E) => {
|
|
1688
1688
|
le(d, "Query state should not be enabled"), E = E.trim(), E !== (h == null ? void 0 : h.trim()) && (k(E), E === "" && u([]), A(void 0), p(E).then((g) => {
|
|
1689
1689
|
if (g.ok === !1) {
|
|
1690
1690
|
u([]), A(g.error);
|
|
@@ -1711,7 +1711,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1711
1711
|
},
|
|
1712
1712
|
suggestions: i,
|
|
1713
1713
|
query: h,
|
|
1714
|
-
error:
|
|
1714
|
+
error: y
|
|
1715
1715
|
});
|
|
1716
1716
|
case "details":
|
|
1717
1717
|
return le(a !== void 0), l(Dt, {
|
|
@@ -1939,7 +1939,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1939
1939
|
children: [l("div", {
|
|
1940
1940
|
class: "flex-grow",
|
|
1941
1941
|
children: r
|
|
1942
|
-
}), l(
|
|
1942
|
+
}), l(ye, {
|
|
1943
1943
|
class: "flex items-center justify-center"
|
|
1944
1944
|
})]
|
|
1945
1945
|
})]
|
|
@@ -2088,12 +2088,12 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
2088
2088
|
children: [l("ul", {
|
|
2089
2089
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2090
2090
|
children: [n.slice(0, Rt).map((h) => {
|
|
2091
|
-
const k = h.name.split(".").pop(),
|
|
2091
|
+
const k = h.name.split(".").pop(), y = h.name.replace(new RegExp(`.${k}$`), "");
|
|
2092
2092
|
return l(Ot, {
|
|
2093
2093
|
class: "flex overflow-hidden",
|
|
2094
2094
|
children: [l("span", {
|
|
2095
2095
|
class: "block truncate",
|
|
2096
|
-
children:
|
|
2096
|
+
children: y
|
|
2097
2097
|
}), l("span", {
|
|
2098
2098
|
children: [".", k]
|
|
2099
2099
|
})]
|
|
@@ -2152,7 +2152,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
2152
2152
|
id: "dropzone-file",
|
|
2153
2153
|
onInput: async (h) => {
|
|
2154
2154
|
le(h.target instanceof HTMLInputElement);
|
|
2155
|
-
const k = h.target.files ? Array.from(h.target.files) : [],
|
|
2155
|
+
const k = h.target.files ? Array.from(h.target.files) : [], y = await Promise.allSettled(k.map(async (S) => {
|
|
2156
2156
|
const E = await Ln(S);
|
|
2157
2157
|
return {
|
|
2158
2158
|
name: Bn(S.name, 42),
|
|
@@ -2160,14 +2160,14 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
2160
2160
|
sizeKb: S.size / 1e3
|
|
2161
2161
|
};
|
|
2162
2162
|
}));
|
|
2163
|
-
if (
|
|
2163
|
+
if (y.some(({
|
|
2164
2164
|
status: S
|
|
2165
2165
|
}) => S === "rejected"))
|
|
2166
2166
|
return i({
|
|
2167
2167
|
type: "invalid",
|
|
2168
2168
|
message: "Invalid file"
|
|
2169
2169
|
});
|
|
2170
|
-
const A =
|
|
2170
|
+
const A = y.map((S) => S.status === "fulfilled" ? S.value : null).filter(Boolean);
|
|
2171
2171
|
a(A);
|
|
2172
2172
|
},
|
|
2173
2173
|
multiple: e.config.allowMultiple,
|
|
@@ -2176,7 +2176,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
2176
2176
|
})]
|
|
2177
2177
|
}), l("div", {
|
|
2178
2178
|
class: "flex h-full flex-col items-center gap-2",
|
|
2179
|
-
children: [l(
|
|
2179
|
+
children: [l(ye, {
|
|
2180
2180
|
disabled: n.length === 0
|
|
2181
2181
|
}), e.config.optional && l(ve, {
|
|
2182
2182
|
onClick: () => t(null)
|
|
@@ -2192,7 +2192,7 @@ const fr = (e) => typeof e == "object";
|
|
|
2192
2192
|
var $ = (e) => !U(e) && !Array.isArray(e) && fr(e) && !_e(e), $n = (e) => $(e) && e.target ? Re(e.target) ? e.target.checked : e.target.value : e, jn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, zn = (e, t) => e.has(jn(t)), qn = (e) => {
|
|
2193
2193
|
const t = e.constructor && e.constructor.prototype;
|
|
2194
2194
|
return $(t) && t.hasOwnProperty("isPrototypeOf");
|
|
2195
|
-
},
|
|
2195
|
+
}, bt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
2196
2196
|
function oe(e) {
|
|
2197
2197
|
let t;
|
|
2198
2198
|
const r = Array.isArray(e);
|
|
@@ -2200,7 +2200,7 @@ function oe(e) {
|
|
|
2200
2200
|
t = new Date(e);
|
|
2201
2201
|
else if (e instanceof Set)
|
|
2202
2202
|
t = new Set(e);
|
|
2203
|
-
else if (!(
|
|
2203
|
+
else if (!(bt && (e instanceof Blob || e instanceof FileList)) && (r || $(e)))
|
|
2204
2204
|
if (t = r ? [] : {}, !r && !qn(e))
|
|
2205
2205
|
t = e;
|
|
2206
2206
|
else
|
|
@@ -2264,10 +2264,10 @@ function Gn(e) {
|
|
|
2264
2264
|
};
|
|
2265
2265
|
}, [e.disabled]);
|
|
2266
2266
|
}
|
|
2267
|
-
var te = (e) => typeof e == "string", Hn = (e, t, r, n, a) => te(e) ? (n && t.watch.add(e), w(r, e, a)) : Array.isArray(e) ? e.map((s) => (n && t.watch.add(s), w(r, s))) : (n && (t.watchAll = !0), r),
|
|
2267
|
+
var te = (e) => typeof e == "string", Hn = (e, t, r, n, a) => te(e) ? (n && t.watch.add(e), w(r, e, a)) : Array.isArray(e) ? e.map((s) => (n && t.watch.add(s), w(r, s))) : (n && (t.watchAll = !0), r), yt = (e) => /^\w*$/.test(e), hr = (e) => Oe(e.replace(/["|']|\]/g, "").split(/\.|\[/));
|
|
2268
2268
|
function L(e, t, r) {
|
|
2269
2269
|
let n = -1;
|
|
2270
|
-
const a =
|
|
2270
|
+
const a = yt(t) ? [t] : hr(t), s = a.length, i = s - 1;
|
|
2271
2271
|
for (; ++n < s; ) {
|
|
2272
2272
|
const u = a[n];
|
|
2273
2273
|
let d = r;
|
|
@@ -2311,7 +2311,7 @@ var Wn = (e, t, r) => {
|
|
|
2311
2311
|
const n = Oe(w(e, r));
|
|
2312
2312
|
return L(n, "root", t[r]), L(e, r, n), e;
|
|
2313
2313
|
}, vt = (e) => e.type === "file", fe = (e) => typeof e == "function", Ge = (e) => {
|
|
2314
|
-
if (!
|
|
2314
|
+
if (!bt)
|
|
2315
2315
|
return !1;
|
|
2316
2316
|
const t = e ? e.ownerDocument : 0;
|
|
2317
2317
|
return e instanceof (t && t.defaultView ? t.defaultView.HTMLElement : HTMLElement);
|
|
@@ -2353,14 +2353,14 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2353
2353
|
value: e,
|
|
2354
2354
|
message: ""
|
|
2355
2355
|
}, Kt = async (e, t, r, n, a) => {
|
|
2356
|
-
const { ref: s, refs: i, required: u, maxLength: d, minLength: p, min: x, max: v, pattern: h, validate: k, name:
|
|
2356
|
+
const { ref: s, refs: i, required: u, maxLength: d, minLength: p, min: x, max: v, pattern: h, validate: k, name: y, valueAsNumber: A, mount: S, disabled: E } = e._f, g = w(t, y);
|
|
2357
2357
|
if (!S || E)
|
|
2358
2358
|
return {};
|
|
2359
2359
|
const N = i ? i[0] : s, P = (F) => {
|
|
2360
2360
|
n && N.reportValidity && (N.setCustomValidity(de(F) ? "" : F || ""), N.reportValidity());
|
|
2361
|
-
}, D = {}, me = xt(s), ce = Re(s), Ee = me || ce, H = (A || vt(s)) && O(s.value) && O(g) || Ge(s) && s.value === "" || g === "" || Array.isArray(g) && !g.length, se = pr.bind(null,
|
|
2361
|
+
}, D = {}, me = xt(s), ce = Re(s), Ee = me || ce, H = (A || vt(s)) && O(s.value) && O(g) || Ge(s) && s.value === "" || g === "" || Array.isArray(g) && !g.length, se = pr.bind(null, y, r, D), q = (F, I, R, K = ie.maxLength, W = ie.minLength) => {
|
|
2362
2362
|
const X = F ? I : R;
|
|
2363
|
-
D[
|
|
2363
|
+
D[y] = {
|
|
2364
2364
|
type: F ? K : W,
|
|
2365
2365
|
message: X,
|
|
2366
2366
|
ref: s,
|
|
@@ -2369,7 +2369,7 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2369
2369
|
};
|
|
2370
2370
|
if (a ? !Array.isArray(g) || !g.length : u && (!Ee && (H || U(g)) || de(g) && !g || ce && !mr(i).isValid || me && !gr(i).isValid)) {
|
|
2371
2371
|
const { value: F, message: I } = qe(u) ? { value: !!u, message: u } : we(u);
|
|
2372
|
-
if (F && (D[
|
|
2372
|
+
if (F && (D[y] = {
|
|
2373
2373
|
type: ie.required,
|
|
2374
2374
|
message: I,
|
|
2375
2375
|
ref: N,
|
|
@@ -2388,16 +2388,16 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2388
2388
|
te(R.value) && g && (F = ge ? X(g) > X(R.value) : Ae ? g > R.value : W > new Date(R.value)), te(K.value) && g && (I = ge ? X(g) < X(K.value) : Ae ? g < K.value : W < new Date(K.value));
|
|
2389
2389
|
}
|
|
2390
2390
|
if ((F || I) && (q(!!F, R.message, K.message, ie.max, ie.min), !r))
|
|
2391
|
-
return P(D[
|
|
2391
|
+
return P(D[y].message), D;
|
|
2392
2392
|
}
|
|
2393
2393
|
if ((d || p) && !H && (te(g) || a && Array.isArray(g))) {
|
|
2394
2394
|
const F = we(d), I = we(p), R = !U(F.value) && g.length > +F.value, K = !U(I.value) && g.length < +I.value;
|
|
2395
2395
|
if ((R || K) && (q(R, F.message, I.message), !r))
|
|
2396
|
-
return P(D[
|
|
2396
|
+
return P(D[y].message), D;
|
|
2397
2397
|
}
|
|
2398
2398
|
if (h && !H && te(g)) {
|
|
2399
2399
|
const { value: F, message: I } = we(h);
|
|
2400
|
-
if (He(F) && !g.match(F) && (D[
|
|
2400
|
+
if (He(F) && !g.match(F) && (D[y] = {
|
|
2401
2401
|
type: ie.pattern,
|
|
2402
2402
|
message: I,
|
|
2403
2403
|
ref: s,
|
|
@@ -2408,7 +2408,7 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2408
2408
|
if (k) {
|
|
2409
2409
|
if (fe(k)) {
|
|
2410
2410
|
const F = await k(g, t), I = Ut(F, N);
|
|
2411
|
-
if (I && (D[
|
|
2411
|
+
if (I && (D[y] = {
|
|
2412
2412
|
...I,
|
|
2413
2413
|
...se(ie.validate, I.message)
|
|
2414
2414
|
}, !r))
|
|
@@ -2422,9 +2422,9 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2422
2422
|
R && (F = {
|
|
2423
2423
|
...R,
|
|
2424
2424
|
...se(I, R.message)
|
|
2425
|
-
}, P(R.message), r && (D[
|
|
2425
|
+
}, P(R.message), r && (D[y] = F));
|
|
2426
2426
|
}
|
|
2427
|
-
if (!J(F) && (D[
|
|
2427
|
+
if (!J(F) && (D[y] = {
|
|
2428
2428
|
ref: N,
|
|
2429
2429
|
...F
|
|
2430
2430
|
}, !r))
|
|
@@ -2447,7 +2447,7 @@ function Zn(e) {
|
|
|
2447
2447
|
return !0;
|
|
2448
2448
|
}
|
|
2449
2449
|
function j(e, t) {
|
|
2450
|
-
const r = Array.isArray(t) ? t :
|
|
2450
|
+
const r = Array.isArray(t) ? t : yt(t) ? [t] : hr(t), n = r.length === 1 ? e : Jn(e, r), a = r.length - 1, s = r[a];
|
|
2451
2451
|
return n && delete n[s], a !== 0 && ($(n) && J(n) || Array.isArray(n) && Zn(n)) && j(e, r.slice(0, -1)), e;
|
|
2452
2452
|
}
|
|
2453
2453
|
function ot() {
|
|
@@ -2471,7 +2471,7 @@ function ot() {
|
|
|
2471
2471
|
};
|
|
2472
2472
|
}
|
|
2473
2473
|
var We = (e) => U(e) || !fr(e);
|
|
2474
|
-
function
|
|
2474
|
+
function be(e, t) {
|
|
2475
2475
|
if (We(e) || We(t))
|
|
2476
2476
|
return e === t;
|
|
2477
2477
|
if (_e(e) && _e(t))
|
|
@@ -2485,13 +2485,13 @@ function ye(e, t) {
|
|
|
2485
2485
|
return !1;
|
|
2486
2486
|
if (a !== "ref") {
|
|
2487
2487
|
const i = t[a];
|
|
2488
|
-
if (_e(s) && _e(i) || $(s) && $(i) || Array.isArray(s) && Array.isArray(i) ? !
|
|
2488
|
+
if (_e(s) && _e(i) || $(s) && $(i) || Array.isArray(s) && Array.isArray(i) ? !be(s, i) : s !== i)
|
|
2489
2489
|
return !1;
|
|
2490
2490
|
}
|
|
2491
2491
|
}
|
|
2492
2492
|
return !0;
|
|
2493
2493
|
}
|
|
2494
|
-
var
|
|
2494
|
+
var br = (e) => e.type === "select-multiple", Xn = (e) => xt(e) || Re(e), lt = (e) => Ge(e) && e.isConnected, yr = (e) => {
|
|
2495
2495
|
for (const t in e)
|
|
2496
2496
|
if (fe(e[t]))
|
|
2497
2497
|
return !0;
|
|
@@ -2501,21 +2501,21 @@ function Je(e, t = {}) {
|
|
|
2501
2501
|
const r = Array.isArray(e);
|
|
2502
2502
|
if ($(e) || r)
|
|
2503
2503
|
for (const n in e)
|
|
2504
|
-
Array.isArray(e[n]) || $(e[n]) && !
|
|
2504
|
+
Array.isArray(e[n]) || $(e[n]) && !yr(e[n]) ? (t[n] = Array.isArray(e[n]) ? [] : {}, Je(e[n], t[n])) : U(e[n]) || (t[n] = !0);
|
|
2505
2505
|
return t;
|
|
2506
2506
|
}
|
|
2507
2507
|
function vr(e, t, r) {
|
|
2508
2508
|
const n = Array.isArray(e);
|
|
2509
2509
|
if ($(e) || n)
|
|
2510
2510
|
for (const a in e)
|
|
2511
|
-
Array.isArray(e[a]) || $(e[a]) && !
|
|
2511
|
+
Array.isArray(e[a]) || $(e[a]) && !yr(e[a]) ? O(t) || We(r[a]) ? r[a] = Array.isArray(e[a]) ? Je(e[a], []) : { ...Je(e[a]) } : vr(e[a], U(t) ? {} : t[a], r[a]) : r[a] = !be(e[a], t[a]);
|
|
2512
2512
|
return r;
|
|
2513
2513
|
}
|
|
2514
2514
|
var ut = (e, t) => vr(e, t, Je(t)), xr = (e, { valueAsNumber: t, valueAsDate: r, setValueAs: n }) => O(e) ? e : t ? e === "" ? NaN : e && +e : r && te(e) ? new Date(e) : n ? n(e) : e;
|
|
2515
2515
|
function ct(e) {
|
|
2516
2516
|
const t = e.ref;
|
|
2517
2517
|
if (!(e.refs ? e.refs.every((r) => r.disabled) : t.disabled))
|
|
2518
|
-
return vt(t) ? t.files : xt(t) ? gr(e.refs).value :
|
|
2518
|
+
return vt(t) ? t.files : xt(t) ? gr(e.refs).value : br(t) ? [...t.selectedOptions].map(({ value: r }) => r) : Re(t) ? mr(e.refs).value : xr(O(t.value) ? e.ref.value : t.value, e);
|
|
2519
2519
|
}
|
|
2520
2520
|
var Qn = (e, t, r, n) => {
|
|
2521
2521
|
const a = {};
|
|
@@ -2532,7 +2532,7 @@ var Qn = (e, t, r, n) => {
|
|
|
2532
2532
|
}, Ie = (e) => O(e) ? e : He(e) ? e.source : $(e) ? He(e.value) ? e.value.source : e.value : e, Yn = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate);
|
|
2533
2533
|
function Gt(e, t, r) {
|
|
2534
2534
|
const n = w(e, r);
|
|
2535
|
-
if (n ||
|
|
2535
|
+
if (n || yt(r))
|
|
2536
2536
|
return {
|
|
2537
2537
|
error: n,
|
|
2538
2538
|
name: r
|
|
@@ -2597,7 +2597,7 @@ function ns(e = {}, t) {
|
|
|
2597
2597
|
values: ot(),
|
|
2598
2598
|
array: ot(),
|
|
2599
2599
|
state: ot()
|
|
2600
|
-
}, k = e.resetOptions && e.resetOptions.keepDirtyValues,
|
|
2600
|
+
}, k = e.resetOptions && e.resetOptions.keepDirtyValues, y = Pt(r.mode), A = Pt(r.reValidateMode), S = r.criteriaMode === Z.all, E = (o) => (c) => {
|
|
2601
2601
|
clearTimeout(x), x = setTimeout(o, c);
|
|
2602
2602
|
}, g = async (o) => {
|
|
2603
2603
|
if (v.isValid || o) {
|
|
@@ -2608,19 +2608,19 @@ function ns(e = {}, t) {
|
|
|
2608
2608
|
}
|
|
2609
2609
|
}, N = (o) => v.isValidating && h.state.next({
|
|
2610
2610
|
isValidating: o
|
|
2611
|
-
}), P = (o, c = [], f, _,
|
|
2611
|
+
}), P = (o, c = [], f, _, b = !0, m = !0) => {
|
|
2612
2612
|
if (_ && f) {
|
|
2613
2613
|
if (u.action = !0, m && Array.isArray(w(a, o))) {
|
|
2614
2614
|
const C = f(w(a, o), _.argA, _.argB);
|
|
2615
|
-
|
|
2615
|
+
b && L(a, o, C);
|
|
2616
2616
|
}
|
|
2617
2617
|
if (m && Array.isArray(w(n.errors, o))) {
|
|
2618
2618
|
const C = f(w(n.errors, o), _.argA, _.argB);
|
|
2619
|
-
|
|
2619
|
+
b && L(n.errors, o, C), ts(n.errors, o);
|
|
2620
2620
|
}
|
|
2621
2621
|
if (v.touchedFields && m && Array.isArray(w(n.touchedFields, o))) {
|
|
2622
2622
|
const C = f(w(n.touchedFields, o), _.argA, _.argB);
|
|
2623
|
-
|
|
2623
|
+
b && L(n.touchedFields, o, C);
|
|
2624
2624
|
}
|
|
2625
2625
|
v.dirtyFields && (n.dirtyFields = ut(s, i)), h.state.next({
|
|
2626
2626
|
name: o,
|
|
@@ -2636,29 +2636,29 @@ function ns(e = {}, t) {
|
|
|
2636
2636
|
errors: n.errors
|
|
2637
2637
|
});
|
|
2638
2638
|
}, me = (o, c, f, _) => {
|
|
2639
|
-
const
|
|
2640
|
-
if (
|
|
2639
|
+
const b = w(a, o);
|
|
2640
|
+
if (b) {
|
|
2641
2641
|
const m = w(i, o, O(f) ? w(s, o) : f);
|
|
2642
|
-
O(m) || _ && _.defaultChecked || c ? L(i, o, c ? m : ct(
|
|
2642
|
+
O(m) || _ && _.defaultChecked || c ? L(i, o, c ? m : ct(b._f)) : W(o, m), u.mount && g();
|
|
2643
2643
|
}
|
|
2644
|
-
}, ce = (o, c, f, _,
|
|
2644
|
+
}, ce = (o, c, f, _, b) => {
|
|
2645
2645
|
let m = !1, C = !1;
|
|
2646
2646
|
const T = {
|
|
2647
2647
|
name: o
|
|
2648
2648
|
};
|
|
2649
2649
|
if (!f || _) {
|
|
2650
2650
|
v.isDirty && (C = n.isDirty, n.isDirty = T.isDirty = I(), m = C !== T.isDirty);
|
|
2651
|
-
const B =
|
|
2651
|
+
const B = be(w(s, o), c);
|
|
2652
2652
|
C = w(n.dirtyFields, o), B ? j(n.dirtyFields, o) : L(n.dirtyFields, o, !0), T.dirtyFields = n.dirtyFields, m = m || v.dirtyFields && C !== !B;
|
|
2653
2653
|
}
|
|
2654
2654
|
if (f) {
|
|
2655
2655
|
const B = w(n.touchedFields, o);
|
|
2656
2656
|
B || (L(n.touchedFields, o, f), T.touchedFields = n.touchedFields, m = m || v.touchedFields && B !== f);
|
|
2657
2657
|
}
|
|
2658
|
-
return m &&
|
|
2658
|
+
return m && b && h.state.next(T), m ? T : {};
|
|
2659
2659
|
}, Ee = (o, c, f, _) => {
|
|
2660
|
-
const
|
|
2661
|
-
if (e.delayError && f ? (p = E(() => D(o, f)), p(e.delayError)) : (clearTimeout(x), p = null, f ? L(n.errors, o, f) : j(n.errors, o)), (f ? !
|
|
2660
|
+
const b = w(n.errors, o), m = v.isValid && de(c) && n.isValid !== c;
|
|
2661
|
+
if (e.delayError && f ? (p = E(() => D(o, f)), p(e.delayError)) : (clearTimeout(x), p = null, f ? L(n.errors, o, f) : j(n.errors, o)), (f ? !be(b, f) : b) || !J(_) || m) {
|
|
2662
2662
|
const C = {
|
|
2663
2663
|
..._,
|
|
2664
2664
|
...m && de(c) ? { isValid: c } : {},
|
|
@@ -2685,11 +2685,11 @@ function ns(e = {}, t) {
|
|
|
2685
2685
|
valid: !0
|
|
2686
2686
|
}) => {
|
|
2687
2687
|
for (const _ in o) {
|
|
2688
|
-
const
|
|
2689
|
-
if (
|
|
2690
|
-
const { _f: m, ...C } =
|
|
2688
|
+
const b = o[_];
|
|
2689
|
+
if (b) {
|
|
2690
|
+
const { _f: m, ...C } = b;
|
|
2691
2691
|
if (m) {
|
|
2692
|
-
const T = d.array.has(m.name), B = await Kt(
|
|
2692
|
+
const T = d.array.has(m.name), B = await Kt(b, i, S, r.shouldUseNativeValidation && !c, T);
|
|
2693
2693
|
if (B[m.name] && (f.valid = !1, c))
|
|
2694
2694
|
break;
|
|
2695
2695
|
!c && (w(B, m.name) ? T ? Wn(n.errors, B, m.name) : L(n.errors, m.name, B[m.name]) : j(n.errors, m.name));
|
|
@@ -2704,27 +2704,27 @@ function ns(e = {}, t) {
|
|
|
2704
2704
|
c && (c._f.refs ? c._f.refs.every((f) => !lt(f)) : !lt(c._f.ref)) && tt(o);
|
|
2705
2705
|
}
|
|
2706
2706
|
d.unMount = /* @__PURE__ */ new Set();
|
|
2707
|
-
}, I = (o, c) => (o && c && L(i, o, c), !
|
|
2707
|
+
}, I = (o, c) => (o && c && L(i, o, c), !be(wt(), s)), R = (o, c, f) => Hn(o, d, {
|
|
2708
2708
|
...u.mount ? i : O(c) ? s : te(o) ? { [o]: c } : c
|
|
2709
2709
|
}, f, c), K = (o) => Oe(w(u.mount ? i : s, o, e.shouldUnregister ? w(s, o, []) : [])), W = (o, c, f = {}) => {
|
|
2710
2710
|
const _ = w(a, o);
|
|
2711
|
-
let
|
|
2711
|
+
let b = c;
|
|
2712
2712
|
if (_) {
|
|
2713
2713
|
const m = _._f;
|
|
2714
|
-
m && (!m.disabled && L(i, o, xr(c, m)),
|
|
2714
|
+
m && (!m.disabled && L(i, o, xr(c, m)), b = Ge(m.ref) && U(c) ? "" : c, br(m.ref) ? [...m.ref.options].forEach((C) => C.selected = b.includes(C.value)) : m.refs ? Re(m.ref) ? m.refs.length > 1 ? m.refs.forEach((C) => (!C.defaultChecked || !C.disabled) && (C.checked = Array.isArray(b) ? !!b.find((T) => T === C.value) : b === C.value)) : m.refs[0] && (m.refs[0].checked = !!b) : m.refs.forEach((C) => C.checked = C.value === b) : vt(m.ref) ? m.ref.value = "" : (m.ref.value = b, m.ref.type || h.values.next({
|
|
2715
2715
|
name: o,
|
|
2716
2716
|
values: { ...i }
|
|
2717
2717
|
})));
|
|
2718
2718
|
}
|
|
2719
|
-
(f.shouldDirty || f.shouldTouch) && ce(o,
|
|
2719
|
+
(f.shouldDirty || f.shouldTouch) && ce(o, b, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && et(o);
|
|
2720
2720
|
}, X = (o, c, f) => {
|
|
2721
2721
|
for (const _ in c) {
|
|
2722
|
-
const
|
|
2723
|
-
(d.array.has(o) || !We(
|
|
2722
|
+
const b = c[_], m = `${o}.${_}`, C = w(a, m);
|
|
2723
|
+
(d.array.has(o) || !We(b) || C && !C._f) && !_e(b) ? X(m, b, f) : W(m, b, f);
|
|
2724
2724
|
}
|
|
2725
2725
|
}, ge = (o, c, f = {}) => {
|
|
2726
|
-
const _ = w(a, o),
|
|
2727
|
-
L(i, o, m),
|
|
2726
|
+
const _ = w(a, o), b = d.array.has(o), m = oe(c);
|
|
2727
|
+
L(i, o, m), b ? (h.array.next({
|
|
2728
2728
|
name: o,
|
|
2729
2729
|
values: { ...i }
|
|
2730
2730
|
}), (v.isDirty || v.dirtyFields) && f.shouldDirty && h.state.next({
|
|
@@ -2738,13 +2738,13 @@ function ns(e = {}, t) {
|
|
|
2738
2738
|
}, Ae = async (o) => {
|
|
2739
2739
|
const c = o.target;
|
|
2740
2740
|
let f = c.name, _ = !0;
|
|
2741
|
-
const
|
|
2741
|
+
const b = w(a, f), m = () => c.type ? ct(b._f) : $n(o), C = (T) => {
|
|
2742
2742
|
_ = Number.isNaN(T) || T === w(i, f, T);
|
|
2743
2743
|
};
|
|
2744
|
-
if (
|
|
2744
|
+
if (b) {
|
|
2745
2745
|
let T, B;
|
|
2746
|
-
const Pe = m(), xe = o.type === Bt.BLUR || o.type === Bt.FOCUS_OUT, Er = !Yn(
|
|
2747
|
-
L(i, f, Pe), xe ? (
|
|
2746
|
+
const Pe = m(), xe = o.type === Bt.BLUR || o.type === Bt.FOCUS_OUT, Er = !Yn(b._f) && !r.resolver && !w(n.errors, f) && !b._f.deps || es(xe, w(n.touchedFields, f), n.isSubmitted, A, y), nt = $t(f, d, xe);
|
|
2747
|
+
L(i, f, Pe), xe ? (b._f.onBlur && b._f.onBlur(o), p && p(0)) : b._f.onChange && b._f.onChange(o);
|
|
2748
2748
|
const st = ce(f, Pe, xe, !1), Ar = !J(st) || nt;
|
|
2749
2749
|
if (!xe && h.values.next({
|
|
2750
2750
|
name: f,
|
|
@@ -2759,20 +2759,20 @@ function ns(e = {}, t) {
|
|
|
2759
2759
|
T = Mt.error, f = Mt.name, B = J(It);
|
|
2760
2760
|
}
|
|
2761
2761
|
} else
|
|
2762
|
-
T = (await Kt(
|
|
2763
|
-
_ && (
|
|
2762
|
+
T = (await Kt(b, i, S, r.shouldUseNativeValidation))[f], C(Pe), _ && (T ? B = !1 : v.isValid && (B = await q(a, !0)));
|
|
2763
|
+
_ && (b._f.deps && et(b._f.deps), Ee(f, B, T, st));
|
|
2764
2764
|
}
|
|
2765
2765
|
}, Be = (o, c) => {
|
|
2766
2766
|
if (w(n.errors, c) && o.focus)
|
|
2767
2767
|
return o.focus(), 1;
|
|
2768
2768
|
}, et = async (o, c = {}) => {
|
|
2769
2769
|
let f, _;
|
|
2770
|
-
const
|
|
2770
|
+
const b = it(o);
|
|
2771
2771
|
if (N(!0), r.resolver) {
|
|
2772
|
-
const m = await se(O(o) ? o :
|
|
2773
|
-
f = J(m), _ = o ? !
|
|
2772
|
+
const m = await se(O(o) ? o : b);
|
|
2773
|
+
f = J(m), _ = o ? !b.some((C) => w(m, C)) : f;
|
|
2774
2774
|
} else
|
|
2775
|
-
o ? (_ = (await Promise.all(
|
|
2775
|
+
o ? (_ = (await Promise.all(b.map(async (m) => {
|
|
2776
2776
|
const C = w(a, m);
|
|
2777
2777
|
return await q(C && C._f ? { [m]: C } : C);
|
|
2778
2778
|
}))).every(Boolean), !(!_ && !n.isValid) && g()) : _ = f = await q(a);
|
|
@@ -2781,7 +2781,7 @@ function ns(e = {}, t) {
|
|
|
2781
2781
|
...r.resolver || !o ? { isValid: f } : {},
|
|
2782
2782
|
errors: n.errors,
|
|
2783
2783
|
isValidating: !1
|
|
2784
|
-
}), c.shouldFocus && !_ && ze(a, Be, o ?
|
|
2784
|
+
}), c.shouldFocus && !_ && ze(a, Be, o ? b : d.mount), _;
|
|
2785
2785
|
}, wt = (o) => {
|
|
2786
2786
|
const c = {
|
|
2787
2787
|
...s,
|
|
@@ -2818,9 +2818,9 @@ function ns(e = {}, t) {
|
|
|
2818
2818
|
...n,
|
|
2819
2819
|
...c.keepDirty ? { isDirty: I() } : {}
|
|
2820
2820
|
}), !c.keepIsValid && g();
|
|
2821
|
-
}, St = ({ disabled: o, name: c, field: f, fields: _, value:
|
|
2821
|
+
}, St = ({ disabled: o, name: c, field: f, fields: _, value: b }) => {
|
|
2822
2822
|
if (de(o)) {
|
|
2823
|
-
const m = o ? void 0 : O(
|
|
2823
|
+
const m = o ? void 0 : O(b) ? ct(f ? f._f : w(_, c)._f) : b;
|
|
2824
2824
|
L(i, c, m), ce(c, m, !1, !1, !0);
|
|
2825
2825
|
}
|
|
2826
2826
|
}, rt = (o, c = {}) => {
|
|
@@ -2851,10 +2851,10 @@ function ns(e = {}, t) {
|
|
|
2851
2851
|
name: o,
|
|
2852
2852
|
onChange: Ae,
|
|
2853
2853
|
onBlur: Ae,
|
|
2854
|
-
ref: (
|
|
2855
|
-
if (
|
|
2854
|
+
ref: (b) => {
|
|
2855
|
+
if (b) {
|
|
2856
2856
|
rt(o, c), f = w(a, o);
|
|
2857
|
-
const m = O(
|
|
2857
|
+
const m = O(b.value) && b.querySelectorAll && b.querySelectorAll("input,select,textarea")[0] || b, C = Xn(m), T = f._f.refs || [];
|
|
2858
2858
|
if (C ? T.find((B) => B === m) : m === f._f.ref)
|
|
2859
2859
|
return;
|
|
2860
2860
|
L(a, o, {
|
|
@@ -2884,8 +2884,8 @@ function ns(e = {}, t) {
|
|
|
2884
2884
|
if (h.state.next({
|
|
2885
2885
|
isSubmitting: !0
|
|
2886
2886
|
}), r.resolver) {
|
|
2887
|
-
const { errors:
|
|
2888
|
-
n.errors =
|
|
2887
|
+
const { errors: b, values: m } = await H();
|
|
2888
|
+
n.errors = b, _ = m;
|
|
2889
2889
|
} else
|
|
2890
2890
|
await q(a);
|
|
2891
2891
|
j(n.errors, "root"), J(n.errors) ? (h.state.next({
|
|
@@ -2900,13 +2900,13 @@ function ns(e = {}, t) {
|
|
|
2900
2900
|
}, Cr = (o, c = {}) => {
|
|
2901
2901
|
w(a, o) && (O(c.defaultValue) ? ge(o, w(s, o)) : (ge(o, c.defaultValue), L(s, o, c.defaultValue)), c.keepTouched || j(n.touchedFields, o), c.keepDirty || (j(n.dirtyFields, o), n.isDirty = c.defaultValue ? I(o, w(s, o)) : I()), c.keepError || (j(n.errors, o), v.isValid && g()), h.state.next({ ...n }));
|
|
2902
2902
|
}, At = (o, c = {}) => {
|
|
2903
|
-
const f = o ? oe(o) : s, _ = oe(f),
|
|
2903
|
+
const f = o ? oe(o) : s, _ = oe(f), b = o && !J(o) ? _ : s;
|
|
2904
2904
|
if (c.keepDefaultValues || (s = f), !c.keepValues) {
|
|
2905
2905
|
if (c.keepDirtyValues || k)
|
|
2906
2906
|
for (const m of d.mount)
|
|
2907
|
-
w(n.dirtyFields, m) ? L(
|
|
2907
|
+
w(n.dirtyFields, m) ? L(b, m, w(i, m)) : ge(m, w(b, m));
|
|
2908
2908
|
else {
|
|
2909
|
-
if (
|
|
2909
|
+
if (bt && O(o))
|
|
2910
2910
|
for (const m of d.mount) {
|
|
2911
2911
|
const C = w(a, m);
|
|
2912
2912
|
if (C && C._f) {
|
|
@@ -2922,10 +2922,10 @@ function ns(e = {}, t) {
|
|
|
2922
2922
|
}
|
|
2923
2923
|
a = {};
|
|
2924
2924
|
}
|
|
2925
|
-
i = e.shouldUnregister ? c.keepDefaultValues ? oe(s) : {} : oe(
|
|
2926
|
-
values: { ...
|
|
2925
|
+
i = e.shouldUnregister ? c.keepDefaultValues ? oe(s) : {} : oe(b), h.array.next({
|
|
2926
|
+
values: { ...b }
|
|
2927
2927
|
}), h.values.next({
|
|
2928
|
-
values: { ...
|
|
2928
|
+
values: { ...b }
|
|
2929
2929
|
});
|
|
2930
2930
|
}
|
|
2931
2931
|
d = {
|
|
@@ -2937,7 +2937,7 @@ function ns(e = {}, t) {
|
|
|
2937
2937
|
focus: ""
|
|
2938
2938
|
}, !u.mount && t(), u.mount = !v.isValid || !!c.keepIsValid, u.watch = !!e.shouldUnregister, h.state.next({
|
|
2939
2939
|
submitCount: c.keepSubmitCount ? n.submitCount : 0,
|
|
2940
|
-
isDirty: c.keepDirty ? n.isDirty : !!(c.keepDefaultValues && !
|
|
2940
|
+
isDirty: c.keepDirty ? n.isDirty : !!(c.keepDefaultValues && !be(o, s)),
|
|
2941
2941
|
isSubmitted: c.keepIsSubmitted ? n.isSubmitted : !1,
|
|
2942
2942
|
dirtyFields: c.keepDirtyValues ? n.dirtyFields : c.keepDefaultValues && o ? ut(s, o) : {},
|
|
2943
2943
|
touchedFields: c.keepTouched ? n.touchedFields : {},
|
|
@@ -3027,8 +3027,8 @@ function ns(e = {}, t) {
|
|
|
3027
3027
|
setFocus: (o, c = {}) => {
|
|
3028
3028
|
const f = w(a, o), _ = f && f._f;
|
|
3029
3029
|
if (_) {
|
|
3030
|
-
const
|
|
3031
|
-
|
|
3030
|
+
const b = _.refs ? _.refs[0] : _.ref;
|
|
3031
|
+
b.focus && (b.focus(), c.shouldSelect && b.select());
|
|
3032
3032
|
}
|
|
3033
3033
|
},
|
|
3034
3034
|
getFieldState: _t
|
|
@@ -3068,7 +3068,7 @@ function Qe(e = {}) {
|
|
|
3068
3068
|
});
|
|
3069
3069
|
}
|
|
3070
3070
|
}, [s, n.isDirty]), Q.useEffect(() => {
|
|
3071
|
-
e.values && !
|
|
3071
|
+
e.values && !be(e.values, r.current) ? (s._reset(e.values, s._options.resetOptions), r.current = e.values) : s._resetDefaultValues();
|
|
3072
3072
|
}, [e.values, s]), Q.useEffect(() => {
|
|
3073
3073
|
s._state.mount || (s._updateValid(), s._state.mount = !0), s._state.watch && (s._state.watch = !1, s._subjects.state.next({ ...s._formState })), s._removeUnmounted();
|
|
3074
3074
|
}), t.current.formState = Un(n, s), t.current;
|
|
@@ -3211,8 +3211,8 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3211
3211
|
class: "flex-1",
|
|
3212
3212
|
children: l(cr, {
|
|
3213
3213
|
type: "submit",
|
|
3214
|
-
ref: (
|
|
3215
|
-
|
|
3214
|
+
ref: (y) => {
|
|
3215
|
+
y && k === 0 && (p.current = y);
|
|
3216
3216
|
},
|
|
3217
3217
|
label: h.label,
|
|
3218
3218
|
value: "true",
|
|
@@ -3225,10 +3225,10 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3225
3225
|
}) : l("form", {
|
|
3226
3226
|
noValidate: !0,
|
|
3227
3227
|
onSubmit: (h) => u((k) => {
|
|
3228
|
-
const
|
|
3228
|
+
const y = k.checked;
|
|
3229
3229
|
t({
|
|
3230
3230
|
type: "enum",
|
|
3231
|
-
value:
|
|
3231
|
+
value: y
|
|
3232
3232
|
});
|
|
3233
3233
|
})(h),
|
|
3234
3234
|
children: [l("div", {
|
|
@@ -3241,10 +3241,10 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3241
3241
|
variant: e.config.options.length === 1 ? "singleOption" : void 0
|
|
3242
3242
|
}),
|
|
3243
3243
|
children: e.config.options.map((h, k) => {
|
|
3244
|
-
const
|
|
3244
|
+
const y = `checked.${h.value}`, {
|
|
3245
3245
|
ref: A,
|
|
3246
3246
|
...S
|
|
3247
|
-
} = i(
|
|
3247
|
+
} = i(y);
|
|
3248
3248
|
return l("li", {
|
|
3249
3249
|
class: "relative",
|
|
3250
3250
|
children: l(ds, {
|
|
@@ -3253,7 +3253,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3253
3253
|
ref: (E) => {
|
|
3254
3254
|
E && k === 0 && (p.current = E), A(E);
|
|
3255
3255
|
},
|
|
3256
|
-
id:
|
|
3256
|
+
id: y,
|
|
3257
3257
|
...S,
|
|
3258
3258
|
onClick: n ? () => t({
|
|
3259
3259
|
type: "enum",
|
|
@@ -3264,7 +3264,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3264
3264
|
})
|
|
3265
3265
|
}), l("div", {
|
|
3266
3266
|
class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
|
|
3267
|
-
children: [n ? null : l(
|
|
3267
|
+
children: [n ? null : l(ye, {}), e.config.minSelected === 0 && l(ve, {
|
|
3268
3268
|
type: "button",
|
|
3269
3269
|
onClick: () => t({
|
|
3270
3270
|
type: "enum",
|
|
@@ -3351,7 +3351,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3351
3351
|
class: "absolute right-0 top-0",
|
|
3352
3352
|
onClick: () => t(null)
|
|
3353
3353
|
})]
|
|
3354
|
-
}), l(
|
|
3354
|
+
}), l(ye, {})]
|
|
3355
3355
|
}), l(Ce, {
|
|
3356
3356
|
error: u.number
|
|
3357
3357
|
})]
|
|
@@ -3370,8 +3370,8 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3370
3370
|
countryCode: "",
|
|
3371
3371
|
phoneNumber: ""
|
|
3372
3372
|
};
|
|
3373
|
-
},
|
|
3374
|
-
const t = ee(e("validation_country_code"), [qr(
|
|
3373
|
+
}, bs = "44", ys = /^[0-9 ]+$/, vs = Se("string"), xs = Se("phone"), ws = (e) => {
|
|
3374
|
+
const t = ee(e("validation_country_code"), [qr(ys, e("validation_country_code"))]), r = sr(ee(e("validation_phone"), [Le(1, e("validation_phone"))]), (n) => n.replace(/[^0-9]/g, ""), []);
|
|
3375
3375
|
return Ye(he({
|
|
3376
3376
|
countryCode: t,
|
|
3377
3377
|
phoneNumber: r
|
|
@@ -3392,7 +3392,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3392
3392
|
watch: x
|
|
3393
3393
|
} = Qe({
|
|
3394
3394
|
defaultValues: {
|
|
3395
|
-
countryCode: (i == null ? void 0 : i.countryCode) ?? e.config.defaultValue.countryCode ??
|
|
3395
|
+
countryCode: (i == null ? void 0 : i.countryCode) ?? e.config.defaultValue.countryCode ?? bs,
|
|
3396
3396
|
phoneNumber: (i == null ? void 0 : i.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
|
|
3397
3397
|
},
|
|
3398
3398
|
resolver: ws(n)
|
|
@@ -3401,7 +3401,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3401
3401
|
...h
|
|
3402
3402
|
} = u("phoneNumber", {
|
|
3403
3403
|
required: !e.config.optional
|
|
3404
|
-
}), k = re(),
|
|
3404
|
+
}), k = re(), y = x("countryCode");
|
|
3405
3405
|
return pe(() => {
|
|
3406
3406
|
k.current && (k.current.focus(), k.current.select());
|
|
3407
3407
|
}, []), l("form", {
|
|
@@ -3423,7 +3423,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3423
3423
|
}
|
|
3424
3424
|
}) : t({
|
|
3425
3425
|
type: "string",
|
|
3426
|
-
value:
|
|
3426
|
+
value: y + S.phoneNumber
|
|
3427
3427
|
});
|
|
3428
3428
|
}),
|
|
3429
3429
|
children: [l("div", {
|
|
@@ -3434,7 +3434,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3434
3434
|
class: "text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",
|
|
3435
3435
|
htmlFor: `isdk_phone_${e.key}`,
|
|
3436
3436
|
children: [l("span", {
|
|
3437
|
-
children: ["+",
|
|
3437
|
+
children: ["+", y]
|
|
3438
3438
|
}), l("select", {
|
|
3439
3439
|
...u("countryCode", {}),
|
|
3440
3440
|
id: `isdk_phone_${e.key}`,
|
|
@@ -3458,14 +3458,14 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3458
3458
|
},
|
|
3459
3459
|
class: De({
|
|
3460
3460
|
optional: e.config.optional,
|
|
3461
|
-
className: "flex-1 rounded-r-full"
|
|
3461
|
+
className: "min-w-0 flex-1 rounded-r-full"
|
|
3462
3462
|
}),
|
|
3463
3463
|
placeholder: e.config.placeholder
|
|
3464
3464
|
}), e.config.optional && l(ve, {
|
|
3465
|
-
class: "absolute right-0 top-0",
|
|
3465
|
+
class: "absolute bottom-0 right-0 top-0",
|
|
3466
3466
|
onClick: () => t(null)
|
|
3467
3467
|
})]
|
|
3468
|
-
}), l(
|
|
3468
|
+
}), l(ye, {})]
|
|
3469
3469
|
}), l(Ce, {
|
|
3470
3470
|
error: p.countryCode || p.phoneNumber || {
|
|
3471
3471
|
message: a
|
|
@@ -3594,7 +3594,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3594
3594
|
class: "absolute right-0 top-0",
|
|
3595
3595
|
onClick: () => t(null)
|
|
3596
3596
|
})]
|
|
3597
|
-
}), l(
|
|
3597
|
+
}), l(ye, {})]
|
|
3598
3598
|
}), l(Ce, {
|
|
3599
3599
|
error: u.text
|
|
3600
3600
|
})]
|
|
@@ -3645,7 +3645,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3645
3645
|
className: "flex-grow rounded-full"
|
|
3646
3646
|
}),
|
|
3647
3647
|
disabled: !0
|
|
3648
|
-
}), l(
|
|
3648
|
+
}), l(ye, {
|
|
3649
3649
|
disabled: !0,
|
|
3650
3650
|
"aria-hidden": "true",
|
|
3651
3651
|
tabIndex: -1
|
|
@@ -3901,7 +3901,7 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3901
3901
|
})) : M.removeMessagesSentByNodeIds([h]);
|
|
3902
3902
|
const {
|
|
3903
3903
|
interpret: k,
|
|
3904
|
-
abort:
|
|
3904
|
+
abort: y,
|
|
3905
3905
|
undo: A
|
|
3906
3906
|
} = Jr({
|
|
3907
3907
|
context: n.context,
|
|
@@ -3954,7 +3954,7 @@ const $e = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3954
3954
|
});
|
|
3955
3955
|
}
|
|
3956
3956
|
});
|
|
3957
|
-
return p(() => A), k(h),
|
|
3957
|
+
return p(() => A), k(h), y;
|
|
3958
3958
|
}, [r, t, i, e, n, u]), l(ke, {
|
|
3959
3959
|
children: [l("div", {
|
|
3960
3960
|
ref: s,
|