@inploi/plugin-chatbot 14.11.0 → 14.13.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/cdn/index.js +5 -5
- package/dist/chatbot-body-3e43f3a7.cjs +5 -0
- package/dist/{chatbot-body-c6ca2f5f.js → chatbot-body-dc3edab9.js} +1041 -1041
- package/dist/chatbot.d.ts +6 -0
- package/dist/chatbot.idb.d.ts +19 -0
- package/dist/i18n.d.ts +18 -12
- package/dist/{index-6bcc6d93.js → index-5b3244e1.js} +620 -592
- package/dist/index-ba15cfce.cjs +5 -0
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/dist/widget-version.d.ts +7 -0
- package/package.json +6 -6
- package/dist/chatbot-body-c2181816.cjs +0 -5
- package/dist/index-3dad99a5.cjs +0 -5
- package/dist/interpolation.test.d.ts +0 -1
- /package/dist/{conditions.test.d.ts → widget-version.test.d.ts} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var Sn = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var Y = (e, r, t) => (
|
|
4
|
-
import { u as
|
|
2
|
+
var En = (e, r, t) => r in e ? Sn(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
|
+
var Y = (e, r, t) => (En(e, typeof r != "symbol" ? r + "" : r, t), t);
|
|
4
|
+
import { u as Br, p as vt, D as Dt, l as Ge, f as $r, T as jr, a as An, E as In, N as Fn, I as Pr, C as Vn, s as Mn, g as Ln, S as Nn, U as nr, $ as sr, R as Rn, w as ar, m as Tn, y as Dn, b as qr, k as On, x as Bn, h as $n, z as jn, Z as Ur, H as Pn, v as qn, c as q, d as ne, o as c, e as Qe, i as xt, j as _e, _ as ye, n as Oe, q as Me, r as Ce, L as Ut, F as Un, t as Wr, A as zr, B as Wn, G as et, J as ir, K as ae, M as ce, O as zn, P as Hn, Q as Kn, V as Gn, W as Hr, X as Jn } from "./index-5b3244e1.js";
|
|
5
5
|
import "@inploi/sdk";
|
|
6
|
-
var Zn = "9.9.
|
|
6
|
+
var Zn = "9.9.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/index.html`, Xn = new URL(Kr).origin, or = 3e4, Yn = 5 * 6e4, Qn = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", Ft = /* @__PURE__ */ new WeakMap(), es = (e) => {
|
|
7
7
|
let r = Ft.get(e);
|
|
8
8
|
return r || (r = e.fetch("/flow/captcha").then((t) => {
|
|
9
9
|
let n = t == null ? void 0 : t.site_key;
|
|
@@ -13,58 +13,58 @@ var Zn = "9.9.0", Wr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
13
13
|
}), Ft.set(e, r)), r;
|
|
14
14
|
}, ts = (e, r = {}) => new Promise((t, n) => {
|
|
15
15
|
let { signal: s, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r, u = !1, f = () => {
|
|
16
|
-
},
|
|
17
|
-
u || (u = !0, clearTimeout(
|
|
18
|
-
},
|
|
19
|
-
clearTimeout(
|
|
16
|
+
}, v = (_) => {
|
|
17
|
+
u || (u = !0, clearTimeout(y), s == null || s.removeEventListener("abort", p), f(), _());
|
|
18
|
+
}, b = (_) => v(() => n(new Error(_))), p = () => b("Captcha aborted"), y, C = (_) => {
|
|
19
|
+
clearTimeout(y), y = setTimeout(() => b("Captcha timed out"), _);
|
|
20
20
|
};
|
|
21
|
-
if (
|
|
21
|
+
if (C(or), s == null ? void 0 : s.aborted)
|
|
22
22
|
return p();
|
|
23
23
|
s == null || s.addEventListener("abort", p), (async () => {
|
|
24
|
-
let
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
24
|
+
let _ = await es(e);
|
|
25
|
+
if (_ === void 0)
|
|
26
|
+
return v(() => t(void 0));
|
|
27
27
|
if (u)
|
|
28
28
|
return;
|
|
29
29
|
let k = document.createElement("iframe");
|
|
30
|
-
k.src = `${
|
|
31
|
-
let
|
|
32
|
-
if (!k.contentWindow ||
|
|
30
|
+
k.src = `${Kr}?${new URLSearchParams({ sitekey: _, origin: window.location.origin, ...a && { theme: a } }).toString()}`, k.title = "Cloudflare security check", k.style.cssText = `display:block;border:0;width:${i ? "100%" : "300px"};height:0;color-scheme:normal`, i ? i.appendChild(k) : (k.style.cssText += ";position:fixed;bottom:16px;right:16px;z-index:2147483647", document.body.appendChild(k));
|
|
31
|
+
let E = !1, g = (N) => {
|
|
32
|
+
if (!k.contentWindow || N.source !== k.contentWindow || N.origin !== Xn || !Qn(N.data))
|
|
33
33
|
return;
|
|
34
|
-
let
|
|
35
|
-
switch (
|
|
34
|
+
let V = N.data;
|
|
35
|
+
switch (V.type) {
|
|
36
36
|
case "token":
|
|
37
|
-
return
|
|
37
|
+
return v(() => t(V.token));
|
|
38
38
|
case "resize":
|
|
39
|
-
k.style.height = `${Math.max(0, Math.ceil(
|
|
39
|
+
k.style.height = `${Math.max(0, Math.ceil(V.height))}px`;
|
|
40
40
|
return;
|
|
41
41
|
case "before-interactive":
|
|
42
|
-
return
|
|
42
|
+
return E = !0, C(Yn), o == null ? void 0 : o();
|
|
43
43
|
case "after-interactive":
|
|
44
|
-
return
|
|
44
|
+
return E = !1, C(or);
|
|
45
45
|
case "error":
|
|
46
|
-
!
|
|
46
|
+
!E && !V.interactive && b("Captcha failed");
|
|
47
47
|
return;
|
|
48
48
|
case "expired":
|
|
49
|
-
return
|
|
49
|
+
return b("Captcha expired");
|
|
50
50
|
case "timeout":
|
|
51
|
-
return
|
|
51
|
+
return b("Captcha timed out");
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
window.addEventListener("message",
|
|
55
|
-
window.removeEventListener("message",
|
|
54
|
+
window.addEventListener("message", g), f = () => {
|
|
55
|
+
window.removeEventListener("message", g), k.remove();
|
|
56
56
|
};
|
|
57
|
-
})().catch((
|
|
58
|
-
}),
|
|
57
|
+
})().catch((_) => v(() => n(_)));
|
|
58
|
+
}), lr = ({ condition: e, context: r, submissions: t, ifBlock: n }) => {
|
|
59
59
|
let [s, ...i] = e.compareKey.split(".");
|
|
60
60
|
if (!s)
|
|
61
61
|
return !1;
|
|
62
|
-
let a =
|
|
62
|
+
let a = Br({ context: r, key: s, path: i, submissions: t });
|
|
63
63
|
if (!a)
|
|
64
64
|
return !1;
|
|
65
65
|
switch (a.type) {
|
|
66
66
|
case "address": {
|
|
67
|
-
let o =
|
|
67
|
+
let o = Dt(a.value, i);
|
|
68
68
|
switch (e.compare) {
|
|
69
69
|
case "equals":
|
|
70
70
|
return o === e.compareValue;
|
|
@@ -80,7 +80,7 @@ var Zn = "9.9.0", Wr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
80
80
|
case "integration": {
|
|
81
81
|
if (typeof a.value != "object" || Array.isArray(a.value))
|
|
82
82
|
return !1;
|
|
83
|
-
let o =
|
|
83
|
+
let o = Dt(a.value, i), u = { ...n, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
|
|
84
84
|
switch (typeof o) {
|
|
85
85
|
case "boolean":
|
|
86
86
|
return lt(u, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
|
|
@@ -157,24 +157,24 @@ var Zn = "9.9.0", Wr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
157
157
|
let n = "combinator" in e.data ? e.data.conditions : [e.data];
|
|
158
158
|
if (("combinator" in e.data ? e.data.combinator : "and") === "or") {
|
|
159
159
|
for (let s of n)
|
|
160
|
-
if (
|
|
160
|
+
if (lr({ condition: s, context: r, submissions: t, ifBlock: e }))
|
|
161
161
|
return !0;
|
|
162
162
|
return !1;
|
|
163
163
|
} else {
|
|
164
164
|
for (let s of n)
|
|
165
|
-
if (!
|
|
165
|
+
if (!lr({ condition: s, context: r, submissions: t, ifBlock: e }))
|
|
166
166
|
return !1;
|
|
167
167
|
return !0;
|
|
168
168
|
}
|
|
169
169
|
}, rs = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, ns = (e, { context: r, submissions: t }) => e.replace(rs, (n, s, i = "") => {
|
|
170
|
-
let [a, ...o] = s.trim().split("."), u =
|
|
170
|
+
let [a, ...o] = s.trim().split("."), u = Br({ key: a, path: o, submissions: t, context: r });
|
|
171
171
|
if (!u)
|
|
172
172
|
return i;
|
|
173
173
|
switch (u.type) {
|
|
174
174
|
case "boolean":
|
|
175
175
|
return u.value === !0 ? "true" : "false";
|
|
176
176
|
case "file":
|
|
177
|
-
return u.value.map((f) => `${f.name} (${
|
|
177
|
+
return u.value.map((f) => `${f.name} (${Ge(f.sizeKb)})`).join(", ");
|
|
178
178
|
case "enum":
|
|
179
179
|
return u.value.join(", ");
|
|
180
180
|
case "address":
|
|
@@ -187,7 +187,7 @@ var Zn = "9.9.0", Wr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
187
187
|
case "integration": {
|
|
188
188
|
if (typeof u.value != "object" || Array.isArray(u.value))
|
|
189
189
|
break;
|
|
190
|
-
let f =
|
|
190
|
+
let f = Dt(u.value, o);
|
|
191
191
|
switch (typeof f) {
|
|
192
192
|
case "boolean":
|
|
193
193
|
return f === !0 ? "true" : "false";
|
|
@@ -196,7 +196,7 @@ var Zn = "9.9.0", Wr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
196
196
|
case "number":
|
|
197
197
|
return f.toString();
|
|
198
198
|
case "object":
|
|
199
|
-
if (Array.isArray(f) && f.every((
|
|
199
|
+
if (Array.isArray(f) && f.every((v) => typeof v == "string"))
|
|
200
200
|
return f.join(", ");
|
|
201
201
|
}
|
|
202
202
|
break;
|
|
@@ -208,7 +208,7 @@ var Zn = "9.9.0", Wr = `https://sdk.inploi.com/@inploi/flows@${Zn}/cdn/captcha/i
|
|
|
208
208
|
function ss(e) {
|
|
209
209
|
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function Wt(e, r, t = "") {
|
|
212
212
|
const n = ss(e), s = e == null ? void 0 : e.length, i = r !== void 0;
|
|
213
213
|
if (!n || i && s !== r) {
|
|
214
214
|
const a = t && `"${t}" `, o = i ? ` of length ${r}` : "", u = n ? `length=${s}` : `type=${typeof e}`;
|
|
@@ -216,14 +216,14 @@ function Ut(e, r, t = "") {
|
|
|
216
216
|
}
|
|
217
217
|
return e;
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function cr(e, r = !0) {
|
|
220
220
|
if (e.destroyed)
|
|
221
221
|
throw new Error("Hash instance has been destroyed");
|
|
222
222
|
if (r && e.finished)
|
|
223
223
|
throw new Error("Hash#digest() has already been called");
|
|
224
224
|
}
|
|
225
225
|
function as(e, r) {
|
|
226
|
-
|
|
226
|
+
Wt(e, void 0, "digestInto() output");
|
|
227
227
|
const t = r.outputLen;
|
|
228
228
|
if (e.length < t)
|
|
229
229
|
throw new Error('"digestInto() output" expected to be of length >=' + t);
|
|
@@ -243,7 +243,7 @@ const is = /* @__PURE__ */ (() => (
|
|
|
243
243
|
typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function"
|
|
244
244
|
))(), os = /* @__PURE__ */ Array.from({ length: 256 }, (e, r) => r.toString(16).padStart(2, "0"));
|
|
245
245
|
function ls(e) {
|
|
246
|
-
if (
|
|
246
|
+
if (Wt(e), is)
|
|
247
247
|
return e.toHex();
|
|
248
248
|
let r = "";
|
|
249
249
|
for (let t = 0; t < e.length; t++)
|
|
@@ -279,7 +279,7 @@ class hs {
|
|
|
279
279
|
this.blockLen = r, this.outputLen = t, this.padOffset = n, this.isLE = s, this.buffer = new Uint8Array(r), this.view = Vt(this.buffer);
|
|
280
280
|
}
|
|
281
281
|
update(r) {
|
|
282
|
-
|
|
282
|
+
cr(this), Wt(r);
|
|
283
283
|
const { view: t, buffer: n, blockLen: s } = this, i = r.length;
|
|
284
284
|
for (let a = 0; a < i; ) {
|
|
285
285
|
const o = Math.min(s - this.pos, i - a);
|
|
@@ -294,21 +294,21 @@ class hs {
|
|
|
294
294
|
return this.length += r.length, this.roundClean(), this;
|
|
295
295
|
}
|
|
296
296
|
digestInto(r) {
|
|
297
|
-
|
|
297
|
+
cr(this), as(r, this), this.finished = !0;
|
|
298
298
|
const { buffer: t, view: n, blockLen: s, isLE: i } = this;
|
|
299
299
|
let { pos: a } = this;
|
|
300
300
|
t[a++] = 128, Ot(this.buffer.subarray(a)), this.padOffset > s - a && (this.process(n, 0), a = 0);
|
|
301
|
-
for (let
|
|
302
|
-
t[
|
|
301
|
+
for (let b = a; b < s; b++)
|
|
302
|
+
t[b] = 0;
|
|
303
303
|
n.setBigUint64(s - 8, BigInt(this.length * 8), i), this.process(n, 0);
|
|
304
304
|
const o = Vt(r), u = this.outputLen;
|
|
305
305
|
if (u % 4)
|
|
306
306
|
throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
307
|
-
const f = u / 4,
|
|
308
|
-
if (f >
|
|
307
|
+
const f = u / 4, v = this.get();
|
|
308
|
+
if (f > v.length)
|
|
309
309
|
throw new Error("_sha2: outputLen bigger than state");
|
|
310
|
-
for (let
|
|
311
|
-
o.setUint32(4 *
|
|
310
|
+
for (let b = 0; b < f; b++)
|
|
311
|
+
o.setUint32(4 * b, v[b], i);
|
|
312
312
|
}
|
|
313
313
|
digest() {
|
|
314
314
|
const { buffer: r, outputLen: t } = this;
|
|
@@ -325,7 +325,7 @@ class hs {
|
|
|
325
325
|
return this._cloneInto();
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
const
|
|
328
|
+
const Ae = /* @__PURE__ */ Uint32Array.from([
|
|
329
329
|
1779033703,
|
|
330
330
|
3144134277,
|
|
331
331
|
1013904242,
|
|
@@ -399,7 +399,7 @@ const Ie = /* @__PURE__ */ Uint32Array.from([
|
|
|
399
399
|
2756734187,
|
|
400
400
|
3204031479,
|
|
401
401
|
3329325298
|
|
402
|
-
]),
|
|
402
|
+
]), Ie = /* @__PURE__ */ new Uint32Array(64);
|
|
403
403
|
class ms extends hs {
|
|
404
404
|
constructor(r) {
|
|
405
405
|
super(64, r, 8, !1);
|
|
@@ -413,21 +413,21 @@ class ms extends hs {
|
|
|
413
413
|
this.A = r | 0, this.B = t | 0, this.C = n | 0, this.D = s | 0, this.E = i | 0, this.F = a | 0, this.G = o | 0, this.H = u | 0;
|
|
414
414
|
}
|
|
415
415
|
process(r, t) {
|
|
416
|
-
for (let
|
|
417
|
-
|
|
418
|
-
for (let
|
|
419
|
-
const p =
|
|
420
|
-
|
|
416
|
+
for (let b = 0; b < 16; b++, t += 4)
|
|
417
|
+
Ie[b] = r.getUint32(t, !1);
|
|
418
|
+
for (let b = 16; b < 64; b++) {
|
|
419
|
+
const p = Ie[b - 15], y = Ie[b - 2], C = pe(p, 7) ^ pe(p, 18) ^ p >>> 3, _ = pe(y, 17) ^ pe(y, 19) ^ y >>> 10;
|
|
420
|
+
Ie[b] = _ + Ie[b - 7] + C + Ie[b - 16] | 0;
|
|
421
421
|
}
|
|
422
|
-
let { A: n, B: s, C: i, D: a, E: o, F: u, G: f, H:
|
|
423
|
-
for (let
|
|
424
|
-
const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25),
|
|
425
|
-
|
|
422
|
+
let { A: n, B: s, C: i, D: a, E: o, F: u, G: f, H: v } = this;
|
|
423
|
+
for (let b = 0; b < 64; b++) {
|
|
424
|
+
const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), y = v + p + ds(o, u, f) + ps[b] + Ie[b] | 0, _ = (pe(n, 2) ^ pe(n, 13) ^ pe(n, 22)) + fs(n, s, i) | 0;
|
|
425
|
+
v = f, f = u, u = o, o = a + y | 0, a = i, i = s, s = n, n = y + _ | 0;
|
|
426
426
|
}
|
|
427
|
-
n = n + this.A | 0, s = s + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, u = u + this.F | 0, f = f + this.G | 0,
|
|
427
|
+
n = n + this.A | 0, s = s + this.B | 0, i = i + this.C | 0, a = a + this.D | 0, o = o + this.E | 0, u = u + this.F | 0, f = f + this.G | 0, v = v + this.H | 0, this.set(n, s, i, a, o, u, f, v);
|
|
428
428
|
}
|
|
429
429
|
roundClean() {
|
|
430
|
-
Ot(
|
|
430
|
+
Ot(Ie);
|
|
431
431
|
}
|
|
432
432
|
destroy() {
|
|
433
433
|
this.set(0, 0, 0, 0, 0, 0, 0, 0), Ot(this.buffer);
|
|
@@ -438,26 +438,26 @@ class ys extends ms {
|
|
|
438
438
|
super(32);
|
|
439
439
|
// We cannot use array here since array allows indexing by variable
|
|
440
440
|
// which means optimizer/compiler cannot use registers.
|
|
441
|
-
Y(this, "A",
|
|
442
|
-
Y(this, "B",
|
|
443
|
-
Y(this, "C",
|
|
444
|
-
Y(this, "D",
|
|
445
|
-
Y(this, "E",
|
|
446
|
-
Y(this, "F",
|
|
447
|
-
Y(this, "G",
|
|
448
|
-
Y(this, "H",
|
|
441
|
+
Y(this, "A", Ae[0] | 0);
|
|
442
|
+
Y(this, "B", Ae[1] | 0);
|
|
443
|
+
Y(this, "C", Ae[2] | 0);
|
|
444
|
+
Y(this, "D", Ae[3] | 0);
|
|
445
|
+
Y(this, "E", Ae[4] | 0);
|
|
446
|
+
Y(this, "F", Ae[5] | 0);
|
|
447
|
+
Y(this, "G", Ae[6] | 0);
|
|
448
|
+
Y(this, "H", Ae[7] | 0);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
const bs = /* @__PURE__ */ cs(
|
|
452
452
|
() => new ys(),
|
|
453
453
|
/* @__PURE__ */ us(1)
|
|
454
454
|
);
|
|
455
|
-
var
|
|
455
|
+
var Gr = (e) => {
|
|
456
456
|
let r = e.find((t) => t.isHead);
|
|
457
457
|
if (!r)
|
|
458
458
|
throw new Error("No head node found");
|
|
459
459
|
return r;
|
|
460
|
-
},
|
|
460
|
+
}, zt = (e) => {
|
|
461
461
|
var r, t;
|
|
462
462
|
if (!(e.data.isFinished || (r = e.data.startedWriteNodeIds) != null && r.length))
|
|
463
463
|
return (t = [...e.data.messages].reverse().find((n) => n.groupId && e.nodes.some((s) => s.id === n.groupId && s.type.startsWith("question-")) && (n.type === "system" || "author" in n && n.author === "user"))) == null ? void 0 : t.groupId;
|
|
@@ -478,12 +478,12 @@ function vs(e, r, t, n) {
|
|
|
478
478
|
clearTimeout(u);
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
|
-
var
|
|
481
|
+
var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) => ns(e, Jr(r)), xs = (e, r) => lt(e, Jr(r)), Zr = ({ node: e, nodes: r, stopWhen: t }) => {
|
|
482
482
|
if ((t == null ? void 0 : t(e)) === !0)
|
|
483
483
|
return e;
|
|
484
484
|
let n = e.nextId ? r.find((s) => s.id === e.nextId) : void 0;
|
|
485
485
|
if (n)
|
|
486
|
-
return
|
|
486
|
+
return Zr({ node: n, nodes: r, stopWhen: t });
|
|
487
487
|
}, ws = ({ childNode: e, nodes: r }) => {
|
|
488
488
|
let t = r.filter((n) => n.type === "if-block").find((n) => {
|
|
489
489
|
if (!n.branchId)
|
|
@@ -491,80 +491,80 @@ var Gr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
491
491
|
let s = r.find((a) => a.id === n.branchId);
|
|
492
492
|
if (!s)
|
|
493
493
|
return !1;
|
|
494
|
-
let i =
|
|
494
|
+
let i = Zr({ node: s, nodes: r, stopWhen: (a) => a.id === e.id });
|
|
495
495
|
return !(!i || i.id !== e.id);
|
|
496
496
|
});
|
|
497
497
|
if (t != null && t.nextId)
|
|
498
498
|
return r.find((n) => n.id === t.nextId);
|
|
499
|
-
}, _s = 3, ks = ({ flow: e, analytics: r, logger: t, talentBankClient: n, context: s, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: u, chatService: f, persistWriteBarrier:
|
|
499
|
+
}, _s = 3, ks = ({ flow: e, analytics: r, logger: t, talentBankClient: n, context: s, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: u, chatService: f, persistWriteBarrier: v, onSubmitNetworkError: b, closedRoleBehaviour: p, settledOutcomes: y = p, dateEchoLocale: C, onFlowEnd: _, onInterpret: k, forceSubmitConfirmation: E, flowType: g, t: N }) => {
|
|
500
500
|
var V;
|
|
501
|
-
let
|
|
501
|
+
let M = new AbortController(), O = { submitAccepted: !1 };
|
|
502
502
|
(V = e.data).startedWriteNodeIds ?? (V.startedWriteNodeIds = e.nodes.flatMap((T) => {
|
|
503
|
-
var
|
|
503
|
+
var B, I;
|
|
504
504
|
if (T.type !== "integration-application-submit" || !e.data.nodeHistory.includes(T.id))
|
|
505
505
|
return [];
|
|
506
|
-
let
|
|
507
|
-
return (
|
|
506
|
+
let R = T.data.key ? (B = a()) == null ? void 0 : B[T.data.key] : void 0;
|
|
507
|
+
return (R == null ? void 0 : R.type) === "integration" && ((I = $r(R.value)) == null ? void 0 : I.verdict) === "not_submitted" ? [] : [T.id];
|
|
508
508
|
}));
|
|
509
|
-
let
|
|
510
|
-
let
|
|
511
|
-
if (
|
|
509
|
+
let K = { ...r.service, log: (T) => r.service.log({ ...T, customProperties: { ...T.customProperties, ...r.customProperties } }) }, ee = async (T, R) => {
|
|
510
|
+
let B = M.signal;
|
|
511
|
+
if (B.aborted)
|
|
512
512
|
return;
|
|
513
|
-
let
|
|
514
|
-
var
|
|
515
|
-
return
|
|
513
|
+
let I = a(), F = o(), j = (F == null ? void 0 : F.submitNodeId) === T.id ? e.nodes.find((L) => {
|
|
514
|
+
var W;
|
|
515
|
+
return L.id === F.fileQuestionNodeId && L.type === "question-file" && ((W = I == null ? void 0 : I[L.data.key]) == null ? void 0 : W.type) !== "file";
|
|
516
516
|
}) : void 0;
|
|
517
|
-
if (
|
|
518
|
-
return
|
|
519
|
-
|
|
517
|
+
if (j)
|
|
518
|
+
return ee(j, R);
|
|
519
|
+
k == null || k(T, R);
|
|
520
520
|
try {
|
|
521
|
-
await Cs({ flow: e, analytics:
|
|
522
|
-
if (!
|
|
521
|
+
await Cs({ flow: e, analytics: K, logger: t, talentBankClient: n, apiClient: i, context: s, node: T, submissions: I, applicationRecovery: F, setApplicationRecovery: async (L) => {
|
|
522
|
+
if (!B.aborted)
|
|
523
523
|
try {
|
|
524
|
-
await u(
|
|
525
|
-
} catch (
|
|
526
|
-
t.error("Failed to persist application recovery",
|
|
524
|
+
await u(L);
|
|
525
|
+
} catch (W) {
|
|
526
|
+
t.error("Failed to persist application recovery", W);
|
|
527
527
|
}
|
|
528
|
-
}, forceSubmitConfirmation:
|
|
529
|
-
|
|
530
|
-
}, captcha: f.captcha }, next: (
|
|
531
|
-
if (
|
|
528
|
+
}, forceSubmitConfirmation: E || (F == null ? void 0 : F.submitNodeId) === T.id, run: O, persistWriteBarrier: v, onSubmitNetworkError: b, settledOutcomes: y, dateEchoLocale: C, flowType: g, signal: B, t: N, chat: { sendMessage: async (L) => f.send({ groupId: T.id, message: L, signal: B }), userInput: async (L) => f.input({ input: L, signal: B }), setSubmission: (L, W) => {
|
|
529
|
+
B.aborted || f.setSubmission(L, W);
|
|
530
|
+
}, captcha: f.captcha }, next: (L) => {
|
|
531
|
+
if (B.aborted)
|
|
532
532
|
return;
|
|
533
|
-
let
|
|
534
|
-
return
|
|
533
|
+
let W = (F == null ? void 0 : F.fileQuestionNodeId) === T.id ? F.submitNodeId : L, U = W ? e.nodes.find((te) => te.id === W) : ws({ childNode: T, nodes: e.nodes });
|
|
534
|
+
return U ? ee(U, T) : _ == null ? void 0 : _(T);
|
|
535
535
|
}, end: () => {
|
|
536
|
-
|
|
536
|
+
B.aborted || (_ == null || _(T));
|
|
537
537
|
} });
|
|
538
|
-
} catch (
|
|
539
|
-
if (
|
|
538
|
+
} catch (L) {
|
|
539
|
+
if (L instanceof jr)
|
|
540
540
|
return;
|
|
541
|
-
throw
|
|
541
|
+
throw L;
|
|
542
542
|
}
|
|
543
543
|
};
|
|
544
544
|
return { interpret: async (T) => {
|
|
545
|
-
let
|
|
546
|
-
return
|
|
545
|
+
let R = e.nodes.find((B) => B.id === T) ?? Gr(e.nodes);
|
|
546
|
+
return ee(R);
|
|
547
547
|
}, undo: (T) => {
|
|
548
|
-
var
|
|
549
|
-
if (delete e.data.reviewReplay, ((
|
|
548
|
+
var W;
|
|
549
|
+
if (delete e.data.reviewReplay, ((W = e.data.startedWriteNodeIds) == null ? void 0 : W.length) || e.data.isFinished)
|
|
550
550
|
return { removed: 0 };
|
|
551
|
-
let
|
|
552
|
-
if (
|
|
551
|
+
let R = zt(e), B = R ? T.lastIndexOf(R) : -1, I = e.nodes.find((U) => U.id === R);
|
|
552
|
+
if (B === -1 || !I)
|
|
553
553
|
return { removed: 0 };
|
|
554
|
-
let
|
|
555
|
-
|
|
556
|
-
let
|
|
557
|
-
e.data.messages = e.data.messages.filter((
|
|
558
|
-
let
|
|
559
|
-
for (let
|
|
560
|
-
let
|
|
561
|
-
if (!(!
|
|
562
|
-
for (let
|
|
563
|
-
typeof
|
|
554
|
+
let F = e.nodes.find((U) => U.id === T[T.length - 1]);
|
|
555
|
+
M.abort();
|
|
556
|
+
let j = T.splice(B);
|
|
557
|
+
e.data.messages = e.data.messages.filter((U) => !U.groupId || !j.includes(U.groupId)), e.data.currentInput = null;
|
|
558
|
+
let L = a();
|
|
559
|
+
for (let U of j.slice(1)) {
|
|
560
|
+
let te = e.nodes.find((X) => X.id === U);
|
|
561
|
+
if (!(!te || !L || te.id === R) && ("key" in te.data && te.data.key && delete L[te.data.key], "keys" in te.data))
|
|
562
|
+
for (let X of Object.values(te.data.keys))
|
|
563
|
+
typeof X == "string" && delete L[X];
|
|
564
564
|
}
|
|
565
|
-
return
|
|
565
|
+
return M = new AbortController(), ee(I, F), { removed: j.length };
|
|
566
566
|
}, abort: () => {
|
|
567
|
-
|
|
567
|
+
M.abort();
|
|
568
568
|
} };
|
|
569
569
|
};
|
|
570
570
|
async function Cs(e) {
|
|
@@ -591,23 +591,23 @@ async function Cs(e) {
|
|
|
591
591
|
case "question-file":
|
|
592
592
|
return zs({ ...e, node: r });
|
|
593
593
|
case "question-address":
|
|
594
|
-
return Hs({ ...e, node: r });
|
|
595
|
-
case "end-flow":
|
|
596
594
|
return Ws({ ...e, node: r });
|
|
595
|
+
case "end-flow":
|
|
596
|
+
return Hs({ ...e, node: r });
|
|
597
597
|
case "if-block":
|
|
598
|
-
return
|
|
598
|
+
return Ds({ ...e, node: r });
|
|
599
599
|
case "jump":
|
|
600
|
-
return
|
|
600
|
+
return As({ ...e, node: r });
|
|
601
601
|
case "link":
|
|
602
602
|
return Ts({ ...e, node: r });
|
|
603
603
|
case "integration-application-submit":
|
|
604
|
-
return
|
|
604
|
+
return Rs({ ...e, node: r });
|
|
605
605
|
case "add-submission":
|
|
606
|
-
return
|
|
606
|
+
return Is({ ...e, node: r });
|
|
607
607
|
case "integration-workflow-get":
|
|
608
608
|
throw Error("Workflow should be unreachable");
|
|
609
609
|
case "check-duplicate":
|
|
610
|
-
return
|
|
610
|
+
return Es({ ...e, node: r });
|
|
611
611
|
case "feedback":
|
|
612
612
|
return Ss({ ...e, node: r });
|
|
613
613
|
default:
|
|
@@ -617,134 +617,134 @@ async function Cs(e) {
|
|
|
617
617
|
async function Ss({ next: e, node: r }) {
|
|
618
618
|
e(r.nextId);
|
|
619
619
|
}
|
|
620
|
-
async function
|
|
620
|
+
async function Es({ next: e, node: r, talentBankClient: t, submissions: n, flow: s, logger: i, chat: a }) {
|
|
621
621
|
var u;
|
|
622
622
|
let o = { isDuplicate: !1 };
|
|
623
623
|
if (n && t) {
|
|
624
624
|
let f = r.data.scope === "job" ? (u = s.job) == null ? void 0 : u.id : void 0;
|
|
625
625
|
if (r.data.scope === "company" || f != null)
|
|
626
626
|
try {
|
|
627
|
-
o = await t.checkDuplicate({ email:
|
|
628
|
-
} catch (
|
|
629
|
-
i.error("[check-duplicate]",
|
|
627
|
+
o = await t.checkDuplicate({ email: An({ key: r.data.email, submissions: n }).toString(), jobId: f, scope: r.data.scope });
|
|
628
|
+
} catch (v) {
|
|
629
|
+
i.error("[check-duplicate]", v);
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
a.setSubmission(r.data.key, { type: "integration", value: o }), e(r.nextId);
|
|
633
633
|
}
|
|
634
|
-
async function
|
|
634
|
+
async function As({ next: e, node: r }) {
|
|
635
635
|
e(r.data.targetId);
|
|
636
636
|
}
|
|
637
|
-
async function
|
|
637
|
+
async function Is({ next: e, node: r, logger: t, submissions: n, context: s }) {
|
|
638
638
|
if (!n) {
|
|
639
639
|
t.error("Submissions not found");
|
|
640
640
|
return;
|
|
641
641
|
}
|
|
642
642
|
n[r.data.key] = { type: "string", value: he(r.data.value, { submissions: n, context: s }) }, e(r.nextId);
|
|
643
643
|
}
|
|
644
|
-
var Fs = 5e3, Vs = (e, r) => r ? `${e}@${r.id_type}:${r.id}` : e, Ms = (e, r = Date.now()) => Math.min(e.until, r + (e.maintenance ? jn : e.throttles ?
|
|
644
|
+
var Fs = 5e3, Vs = (e, r) => r ? `${e}@${r.id_type}:${r.id}` : e, Ms = (e, r = Date.now()) => Math.min(e.until, r + (e.maintenance ? jn : e.throttles ? Ur : Pn)), Ls = (e, r, t) => {
|
|
645
645
|
let { waitMs: n, throttles: s, maintenance: i } = qn(r == null ? void 0 : r.throttles, t);
|
|
646
646
|
return { key: e, until: Date.now() + n, ...s !== void 0 && { throttles: s }, ...i && { maintenance: i } };
|
|
647
|
-
},
|
|
648
|
-
let r =
|
|
647
|
+
}, Ns = ["ApiError", "NotFoundError", "UnauthorisedError", "SchemaValidationError", "ParsingError"], $t = (e) => e instanceof Error && Ns.includes(e.name) ? e : void 0, ur = (e) => {
|
|
648
|
+
let r = $t(e);
|
|
649
649
|
return (r == null ? void 0 : r.name) === "ApiError" ? r : void 0;
|
|
650
650
|
};
|
|
651
|
-
async function
|
|
652
|
-
var
|
|
653
|
-
let
|
|
654
|
-
let { anonymous_id:
|
|
655
|
-
await e.sendMessage({ type: "text", author: "bot", text:
|
|
651
|
+
async function Rs({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i, submissions: a, analytics: o, flow: u, applicationRecovery: f, setApplicationRecovery: v, forceSubmitConfirmation: b, flowType: p, run: y, persistWriteBarrier: C, signal: _, onSubmitNetworkError: k, settledOutcomes: E, t: g }) {
|
|
652
|
+
var ee, T;
|
|
653
|
+
let N = async ({ redirect_url: R, message: B, button_text: I }) => {
|
|
654
|
+
let { anonymous_id: F, session_id: j } = o.getSessionInfo();
|
|
655
|
+
await e.sendMessage({ type: "text", author: "bot", text: B ?? g("submission_redirect_message") });
|
|
656
656
|
try {
|
|
657
|
-
let
|
|
658
|
-
|
|
659
|
-
if (!
|
|
657
|
+
let L = new URL(R);
|
|
658
|
+
F && !L.searchParams.has("anonymous_id") && L.searchParams.set("anonymous_id", F), await e.sendMessage({ type: "link", href: L.toString(), text: I ?? g("complete_submission"), onClick: () => {
|
|
659
|
+
if (!j) {
|
|
660
660
|
s.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
661
661
|
return;
|
|
662
662
|
}
|
|
663
|
-
o.log({ event: "FLOW_REDIRECT", properties: { flow_build: u.build, flow_id: u.id, flow_session_id:
|
|
663
|
+
o.log({ event: "FLOW_REDIRECT", properties: { flow_build: u.build, flow_id: u.id, flow_session_id: j, flow_version: u.version, href: L.toString(), job: u.job } });
|
|
664
664
|
} });
|
|
665
|
-
} catch (
|
|
666
|
-
s.error(`Invalid redirect URL: ${
|
|
665
|
+
} catch (L) {
|
|
666
|
+
s.error(`Invalid redirect URL: ${R}`, L), e.sendMessage({ type: "system", variant: "error", text: g("redirect_url_error") });
|
|
667
667
|
}
|
|
668
668
|
};
|
|
669
|
-
if ((
|
|
670
|
-
let
|
|
671
|
-
return
|
|
669
|
+
if ((ee = u.data.startedWriteNodeIds) != null && ee.includes(n.id) && (f == null ? void 0 : f.submitNodeId) !== n.id) {
|
|
670
|
+
let R = (T = u.data.submitRedirects) == null ? void 0 : T[n.id];
|
|
671
|
+
return R ? (await N(R), r(n.nextId)) : (await e.sendMessage({ type: "system", variant: "warning", text: g("submission_unknown") }), t());
|
|
672
672
|
}
|
|
673
|
-
let
|
|
674
|
-
var
|
|
675
|
-
let
|
|
676
|
-
|
|
677
|
-
let I =
|
|
678
|
-
(u.data.reviewRequiresSend === !0 && !O ||
|
|
679
|
-
let
|
|
673
|
+
let V = Vs(n.id, u.job), M = 0, O = y.submitAccepted && n.data.skipConfirmation === !0 && (f == null ? void 0 : f.submitNodeId) !== n.id, K = async (R) => {
|
|
674
|
+
var st, pt, mt, Et, at, l, d, h, w;
|
|
675
|
+
let B = ((st = u.data.submitCooldown) == null ? void 0 : st.key) === V ? u.data.submitCooldown : void 0;
|
|
676
|
+
B && (B.until = Ms(B));
|
|
677
|
+
let I = B == null ? void 0 : B.until;
|
|
678
|
+
(u.data.reviewRequiresSend === !0 && !O || R !== !0 || I !== void 0 && I > Date.now()) && await e.userInput({ type: "submit", key: void 0, config: { label: n.data.submitLabel, ...I !== void 0 && { availableAt: I } } }), O = !1;
|
|
679
|
+
let F;
|
|
680
680
|
if (n.data.captcha) {
|
|
681
|
-
let
|
|
681
|
+
let m = e.captcha, x = !0;
|
|
682
682
|
try {
|
|
683
|
-
|
|
684
|
-
e.sendMessage({ type: "text", author: "bot", text:
|
|
683
|
+
F = await ts(i, { signal: _, container: (m == null ? void 0 : m.container()) ?? null, theme: m == null ? void 0 : m.theme, onInteractive: () => {
|
|
684
|
+
e.sendMessage({ type: "text", author: "bot", text: g("captcha_check") }).catch(() => {
|
|
685
685
|
}).then(() => {
|
|
686
|
-
|
|
686
|
+
x && (m == null || m.reveal(!0));
|
|
687
687
|
});
|
|
688
688
|
} });
|
|
689
|
-
} catch (
|
|
690
|
-
if (s.error("Captcha check failed",
|
|
689
|
+
} catch (A) {
|
|
690
|
+
if (s.error("Captcha check failed", A), _.aborted)
|
|
691
691
|
return;
|
|
692
692
|
} finally {
|
|
693
|
-
|
|
693
|
+
x = !1, m == null || m.reveal(!1);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
await e.sendMessage({ type: "loading", text:
|
|
697
|
-
let { anonymous_id:
|
|
698
|
-
if (
|
|
696
|
+
await e.sendMessage({ type: "loading", text: g("submitting") });
|
|
697
|
+
let { anonymous_id: j, session_id: L } = o.getSessionInfo();
|
|
698
|
+
if (_.aborted)
|
|
699
699
|
return;
|
|
700
|
-
let W = ((
|
|
701
|
-
if ((f == null ? void 0 : f.submitNodeId) === n.id && await
|
|
700
|
+
let W = ((pt = u.data.startedWriteNodeIds) == null ? void 0 : pt.includes(n.id)) === !0;
|
|
701
|
+
if ((f == null ? void 0 : f.submitNodeId) === n.id && await v(void 0), W || (u.data.startedWriteNodeIds = [...u.data.startedWriteNodeIds ?? [], n.id]), await C().catch((m) => s.error("Failed to persist application write barrier", m)), _.aborted)
|
|
702
702
|
return;
|
|
703
|
-
let
|
|
704
|
-
|
|
705
|
-
}, Fs),
|
|
706
|
-
|
|
707
|
-
let
|
|
708
|
-
return (
|
|
703
|
+
let U, te = setTimeout(() => {
|
|
704
|
+
U = e.sendMessage({ type: "loading", semantic: "submission-still-working", text: g("submission_still_working") }).catch((m) => s.error("Failed to send submission progress message", m));
|
|
705
|
+
}, Fs), X, H = await i.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: n.data.integrationId, anonymous_id: j, session_id: L, job: u.job, flow_build: u.build, ...F !== void 0 && { captcha_token: F }, submissions: Vn(u.nodes, Mn(a || {}, n.data.submitKeys)), pre_apply: Pr(u.nodes, a || {}, u.data.flowSessionId) }) }).catch((m) => {
|
|
706
|
+
X = m;
|
|
707
|
+
let x = ur(m);
|
|
708
|
+
return (x == null ? void 0 : x.data) !== void 0 ? x.data : m;
|
|
709
709
|
});
|
|
710
|
-
if (clearTimeout(
|
|
710
|
+
if (clearTimeout(te), await U, _.aborted)
|
|
711
711
|
return;
|
|
712
|
-
if (
|
|
713
|
-
return await k(
|
|
714
|
-
n.data.key && e.setSubmission(n.data.key, { type: "integration", value:
|
|
715
|
-
let
|
|
716
|
-
|
|
717
|
-
let
|
|
718
|
-
|
|
719
|
-
let
|
|
720
|
-
if ((
|
|
721
|
-
let { redirect_url:
|
|
722
|
-
return
|
|
712
|
+
if (X !== void 0 && !$t(X) && k)
|
|
713
|
+
return await k(X, _), K(!0);
|
|
714
|
+
n.data.key && e.setSubmission(n.data.key, { type: "integration", value: H });
|
|
715
|
+
let rt = (mt = ur(X)) == null ? void 0 : mt.status, $e = typeof rt == "number" ? rt : void 0, D = $r(H, $e), je = D === void 0 && $e === 429, Pe = E === "terminal" && ((D == null ? void 0 : D.outcome) === "closed" || (D == null ? void 0 : D.outcome) === "duplicate"), Se = u.data.failedAttemptAt, Ne = Se == null ? void 0 : Se[V];
|
|
716
|
+
Se && Ne !== void 0 && Ne > Date.now() && (Ne = Se[V] = Date.now());
|
|
717
|
+
let qe = Ne !== void 0 && Date.now() - Ne < Ln || ((Et = u.data.unconfirmedAttemptKeys) == null ? void 0 : Et.includes(V)) === !0, nt = (at = $t(X)) == null ? void 0 : at.status, ge = Nn(H, typeof nt == "number" ? nt : void 0);
|
|
718
|
+
ge && o.log({ event: "FLOW_SUBMIT", properties: { flow_id: u.id, flow_version: u.version, flow_session_id: u.data.flowSessionId, flow_build: u.build, service: ge.service, response: ge.response, captured: (H == null ? void 0 : H.captured) === !0, flow_type: (p == null ? void 0 : p()) ?? "CHATBOT_DRAWER", job: u.job, ...(D == null ? void 0 : D.outcome) === "duplicate" && { outcome: qe ? "duplicate_after_own_attempt" : "duplicate" }, ...ge.outcome && { outcome: ge.outcome } } });
|
|
719
|
+
let Ue = nr(H) || (H == null ? void 0 : H.success) === !0;
|
|
720
|
+
if ((Ue || sr(H)) && (y.submitAccepted = !0), Ue && ((l = u.data.submitCooldown) == null ? void 0 : l.throttles) !== void 0 && (delete u.data.submitCooldown.throttles, await C().catch((m) => s.error("Failed to persist submit cooldown reset", m))), nr(H)) {
|
|
721
|
+
let { redirect_url: m, message: x, button_text: A } = H.integration_response.data, $ = { redirect_url: m, message: x, button_text: A };
|
|
722
|
+
return _.aborted ? void 0 : (u.data.submitRedirects = { ...u.data.submitRedirects, [n.id]: $ }, await C().catch((P) => s.error("Failed to persist submit redirect", P)), await N($), r(n.nextId));
|
|
723
723
|
}
|
|
724
|
-
let
|
|
725
|
-
if (
|
|
726
|
-
return await e.sendMessage({ type: "system", variant: "success", text:
|
|
727
|
-
if ((
|
|
728
|
-
return n.data.skipConfirmation !== !0 && await e.sendMessage({ type: "system", variant: "success", text:
|
|
729
|
-
let
|
|
730
|
-
if (!
|
|
731
|
-
if (s.error(
|
|
732
|
-
return e.setSubmission(
|
|
733
|
-
if (
|
|
734
|
-
return await e.sendMessage({ type: "system", variant: "info", text:
|
|
735
|
-
if (
|
|
736
|
-
return await e.sendMessage({ type: "system", variant: "info", text:
|
|
737
|
-
let
|
|
738
|
-
return
|
|
724
|
+
let ht = sr(H);
|
|
725
|
+
if (ht)
|
|
726
|
+
return await e.sendMessage({ type: "system", variant: "success", text: ht.message ?? g("submission_pending") }), r(n.nextId);
|
|
727
|
+
if ((H == null ? void 0 : H.success) === !0)
|
|
728
|
+
return n.data.skipConfirmation !== !0 && await e.sendMessage({ type: "system", variant: "success", text: g("submission_completed") }), r(n.nextId);
|
|
729
|
+
let We = Rn(D), ze = We !== void 0 && ((d = a == null ? void 0 : a[We]) == null ? void 0 : d.type) === "file" ? We : void 0, Re = ze === void 0 ? void 0 : u.nodes.find((m) => m.type === "question-file" && m.data.key === ze);
|
|
730
|
+
if (!Re && !Pe && !ar(D) && (u.data.submitCooldown = Ls(V, B, D)), (D == null ? void 0 : D.outcome) !== "duplicate" && !je && (u.data.failedAttemptAt = { ...u.data.failedAttemptAt, [V]: Date.now() }, (h = u.data.unconfirmedAttemptKeys) != null && h.includes(V) && (u.data.unconfirmedAttemptKeys = u.data.unconfirmedAttemptKeys.filter((m) => m !== V))), (D == null ? void 0 : D.verdict) === "not_submitted" || (D == null ? void 0 : D.outcome) === "duplicate" || (D == null ? void 0 : D.outcome) === "closed" || je || Tn(H, $e) ? (W || (u.data.startedWriteNodeIds = (w = u.data.startedWriteNodeIds) == null ? void 0 : w.filter((m) => m !== n.id)), (f == null ? void 0 : f.submitNodeId) === n.id && await v(f), await C().catch((m) => s.error("Failed to persist application write barrier release", m))) : await C().catch((m) => s.error("Failed to persist submit cooldown", m)), D) {
|
|
731
|
+
if (s.error(X ?? D.message), Re && ze !== void 0)
|
|
732
|
+
return e.setSubmission(ze, null), await v({ fileQuestionNodeId: Re.id, submitNodeId: n.id }), await e.sendMessage({ type: "system", variant: "error", text: g("submission_unreadable_document") }), r(Re.id);
|
|
733
|
+
if (D.outcome === "duplicate")
|
|
734
|
+
return await e.sendMessage({ type: "system", variant: Pe ? "success" : "info", semantic: "submission-duplicate", text: g(qe ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), Pe ? (delete u.data.submitCooldown, t()) : K(!1);
|
|
735
|
+
if (D.outcome === "closed")
|
|
736
|
+
return await e.sendMessage({ type: "system", variant: "info", semantic: "submission-closed", text: g("submission_closed") }), Pe ? (delete u.data.submitCooldown, t()) : K(!1);
|
|
737
|
+
let m = Dn(D);
|
|
738
|
+
return m ? (await e.sendMessage({ type: "system", variant: "warning", text: m.until === void 0 ? g("submission_provider_maintenance_later") : g("submission_provider_maintenance", { time: qr(m.until, void 0) }) }), K(!1)) : D.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: g(On(D) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), K(!1)) : ar(D) ? Bn(H) ? (await e.sendMessage({ type: "text", author: "bot", text: D.message }), K(!1)) : (M === 0 && await e.sendMessage({ type: "system", variant: "warning", text: g("captcha_failed") }), M++, K(M <= _s)) : $n(D) ? (await e.sendMessage({ type: "system", variant: "error", text: g("submission_retryable") }), K(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: g("submission_failed") }), t());
|
|
739
739
|
}
|
|
740
|
-
return s.error(
|
|
740
|
+
return s.error(X ?? H), je ? (await e.sendMessage({ type: "system", variant: "error", text: g("submission_retryable") }), K(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: g("submission_failed") }), t());
|
|
741
741
|
};
|
|
742
|
-
await
|
|
742
|
+
await K(b === !0 && !O ? !1 : n.data.skipConfirmation);
|
|
743
743
|
}
|
|
744
744
|
async function Ts({ chat: e, next: r, node: t, submissions: n, context: s }) {
|
|
745
745
|
await e.sendMessage({ type: "link", href: he(t.data.href, { submissions: n, context: s }), text: he(t.data.cta, { submissions: n, context: s }) }), r(t.nextId);
|
|
746
746
|
}
|
|
747
|
-
async function
|
|
747
|
+
async function Ds({ submissions: e, next: r, node: t, context: n }) {
|
|
748
748
|
r(xs(t, { submissions: e, context: n }) ? t.branchId : t.nextId);
|
|
749
749
|
}
|
|
750
750
|
async function Os({ chat: e, next: r, node: t, submissions: n, context: s }) {
|
|
@@ -756,7 +756,7 @@ async function Bs({ chat: e, next: r, node: t }) {
|
|
|
756
756
|
async function $s({ chat: e, next: r, node: t, submissions: n, context: s, t: i, dateEchoLocale: a }) {
|
|
757
757
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
758
758
|
let o = t.data.format === "phone" ? await e.userInput({ key: t.data.key, type: "phone", config: { optional: t.data.optional, placeholder: t.data.placeholder, minChars: t.data.minChars, maxChars: t.data.maxChars, submissionFormat: "text", defaultValue: {} } }) : await e.userInput({ key: t.data.key, type: "text", config: { optional: t.data.optional, placeholder: t.data.placeholder, format: t.data.format, maxChars: t.data.maxChars, minChars: t.data.minChars, multiline: t.data.format === "text" && t.data.multiline === !0 } });
|
|
759
|
-
o === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: o.type === "phone" ? vt(o.value) : t.data.format === "date" && a !== void 0 ?
|
|
759
|
+
o === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: o.type === "phone" ? vt(o.value) : t.data.format === "date" && a !== void 0 ? In(o.value, a) : o.value }), r(t.nextId);
|
|
760
760
|
}
|
|
761
761
|
async function js({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
|
|
762
762
|
await e.sendMessage({ author: "bot", type: "text", text: he(t.data.question, { submissions: n, context: s }) });
|
|
@@ -778,7 +778,7 @@ async function Us({ chat: e, next: r, node: t, submissions: n, context: s, t: i
|
|
|
778
778
|
let a = await e.userInput({ key: t.data.key, type: "boolean", config: { optional: t.data.optional, labels: { true: t.data.trueLabel, false: t.data.falseLabel } } });
|
|
779
779
|
a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value === !0 ? t.data.trueLabel : t.data.falseLabel }), r(t.nextId);
|
|
780
780
|
}
|
|
781
|
-
async function
|
|
781
|
+
async function Ws({ chat: e, next: r, node: t, t: n }) {
|
|
782
782
|
await e.sendMessage({ author: "bot", type: "text", text: t.data.question });
|
|
783
783
|
let s = await e.userInput({ type: "address", key: t.data.key, config: { optional: t.data.optional, keys: t.data.keys, line2Required: t.data.line2Required, placeholder: t.data.placeholder } });
|
|
784
784
|
if (s === null)
|
|
@@ -799,17 +799,17 @@ async function zs({ node: e, chat: r, next: t, submissions: n, context: s, t: i
|
|
|
799
799
|
await r.sendMessage({ author: "user", type: "file", fileName: o.name, fileSizeKb: o.sizeKb });
|
|
800
800
|
return t(e.nextId);
|
|
801
801
|
}
|
|
802
|
-
async function
|
|
802
|
+
async function Hs({ chat: e, end: r, node: t }) {
|
|
803
803
|
await e.sendMessage({ type: "system", variant: "info", text: t.data.systemMessage }), r();
|
|
804
804
|
}
|
|
805
805
|
async function Ks({ node: e, flow: r, submissions: t, chat: n, next: s, apiClient: i, analytics: a, signal: o, context: u }) {
|
|
806
|
-
let f = Fn(r.nodes, t || {}), { answers:
|
|
807
|
-
if (n.setSubmission(e.data.key, { type: "integration", value:
|
|
806
|
+
let f = Fn(r.nodes, t || {}), { answers: v, ...b } = f;
|
|
807
|
+
if (n.setSubmission(e.data.key, { type: "integration", value: b }), vs(r, i, { ...a.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply: Pr(r.nodes, t || {}, r.data.flowSessionId) }, o), f.status !== "skipped") {
|
|
808
808
|
let p = [f.status === "unavailable" ? "We could not prepare your pre-apply summary. You can still continue to your application." : f.hasHardConcerns ? e.data.messages.hard : f.hasAdvisoryConcerns ? e.data.messages.advisory : e.data.messages.matched];
|
|
809
|
-
for (let
|
|
810
|
-
let
|
|
811
|
-
|
|
812
|
-
` +
|
|
809
|
+
for (let y of ["hard", "advisory"]) {
|
|
810
|
+
let C = v.filter((_) => !_.matched && _.severity === y);
|
|
811
|
+
C.length && p.push((y === "hard" ? "Role requirements" : "Other things to consider") + `
|
|
812
|
+
` + C.map((_) => `• ${_.message}`).join(`
|
|
813
813
|
`));
|
|
814
814
|
}
|
|
815
815
|
await n.sendMessage({ type: "text", author: "bot", text: p.join(`
|
|
@@ -818,7 +818,7 @@ async function Ks({ node: e, flow: r, submissions: t, chat: n, next: s, apiClien
|
|
|
818
818
|
}
|
|
819
819
|
return s(e.nextId);
|
|
820
820
|
}
|
|
821
|
-
const
|
|
821
|
+
const dr = (e, r, t) => {
|
|
822
822
|
var n;
|
|
823
823
|
return e.log({
|
|
824
824
|
event: t,
|
|
@@ -832,7 +832,7 @@ const ur = (e, r, t) => {
|
|
|
832
832
|
},
|
|
833
833
|
customProperties: (n = r.analytics) == null ? void 0 : n.customProperties
|
|
834
834
|
});
|
|
835
|
-
},
|
|
835
|
+
}, jt = "resume-prompt", Gs = async ({
|
|
836
836
|
chatService: e,
|
|
837
837
|
t: r,
|
|
838
838
|
signal: t
|
|
@@ -843,7 +843,7 @@ const ur = (e, r, t) => {
|
|
|
843
843
|
author: "bot",
|
|
844
844
|
text: r("resume_prompt")
|
|
845
845
|
},
|
|
846
|
-
groupId:
|
|
846
|
+
groupId: jt,
|
|
847
847
|
signal: t
|
|
848
848
|
});
|
|
849
849
|
const n = await e.input({
|
|
@@ -860,16 +860,16 @@ const ur = (e, r, t) => {
|
|
|
860
860
|
},
|
|
861
861
|
signal: t
|
|
862
862
|
});
|
|
863
|
-
return
|
|
864
|
-
},
|
|
863
|
+
return q.removeMessagesSentByNodeIds([jt]), (n == null ? void 0 : n.value) !== !1;
|
|
864
|
+
}, Be = ({
|
|
865
865
|
class: e,
|
|
866
866
|
...r
|
|
867
867
|
}) => {
|
|
868
868
|
const {
|
|
869
869
|
t
|
|
870
|
-
} =
|
|
870
|
+
} = ne();
|
|
871
871
|
return c("button", {
|
|
872
|
-
class:
|
|
872
|
+
class: Qe("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50", e),
|
|
873
873
|
type: "submit",
|
|
874
874
|
...r,
|
|
875
875
|
children: c("svg", {
|
|
@@ -891,14 +891,14 @@ const ur = (e, r, t) => {
|
|
|
891
891
|
})
|
|
892
892
|
});
|
|
893
893
|
};
|
|
894
|
-
var
|
|
894
|
+
var ve;
|
|
895
895
|
// @__NO_SIDE_EFFECTS__
|
|
896
896
|
function wt(e) {
|
|
897
897
|
return {
|
|
898
|
-
lang: (e == null ? void 0 : e.lang) ?? (
|
|
898
|
+
lang: (e == null ? void 0 : e.lang) ?? (ve == null ? void 0 : ve.lang),
|
|
899
899
|
message: e == null ? void 0 : e.message,
|
|
900
|
-
abortEarly: (e == null ? void 0 : e.abortEarly) ?? (
|
|
901
|
-
abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (
|
|
900
|
+
abortEarly: (e == null ? void 0 : e.abortEarly) ?? (ve == null ? void 0 : ve.abortEarly),
|
|
901
|
+
abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (ve == null ? void 0 : ve.abortPipeEarly)
|
|
902
902
|
};
|
|
903
903
|
}
|
|
904
904
|
var Mt;
|
|
@@ -911,20 +911,20 @@ var Lt;
|
|
|
911
911
|
function Zs(e) {
|
|
912
912
|
return Lt == null ? void 0 : Lt.get(e);
|
|
913
913
|
}
|
|
914
|
-
var
|
|
914
|
+
var Nt;
|
|
915
915
|
// @__NO_SIDE_EFFECTS__
|
|
916
916
|
function Xs(e, r) {
|
|
917
917
|
var t;
|
|
918
|
-
return (t =
|
|
918
|
+
return (t = Nt == null ? void 0 : Nt.get(e)) == null ? void 0 : t.get(r);
|
|
919
919
|
}
|
|
920
920
|
// @__NO_SIDE_EFFECTS__
|
|
921
|
-
function
|
|
921
|
+
function Xe(e) {
|
|
922
922
|
var t, n;
|
|
923
923
|
const r = typeof e;
|
|
924
924
|
return r === "string" ? `"${e}"` : r === "number" || r === "bigint" || r === "boolean" ? `${e}` : r === "object" || r === "function" ? (e && ((n = (t = Object.getPrototypeOf(e)) == null ? void 0 : t.constructor) == null ? void 0 : n.name)) ?? "null" : r;
|
|
925
925
|
}
|
|
926
|
-
function
|
|
927
|
-
const i = s && "input" in s ? s.input : t.value, a = (s == null ? void 0 : s.expected) ?? e.expects ?? null, o = (s == null ? void 0 : s.received) ?? /* @__PURE__ */
|
|
926
|
+
function re(e, r, t, n, s) {
|
|
927
|
+
const i = s && "input" in s ? s.input : t.value, a = (s == null ? void 0 : s.expected) ?? e.expects ?? null, o = (s == null ? void 0 : s.received) ?? /* @__PURE__ */ Xe(i), u = {
|
|
928
928
|
kind: e.kind,
|
|
929
929
|
type: e.type,
|
|
930
930
|
input: i,
|
|
@@ -937,11 +937,11 @@ function ee(e, r, t, n, s) {
|
|
|
937
937
|
lang: n.lang,
|
|
938
938
|
abortEarly: n.abortEarly,
|
|
939
939
|
abortPipeEarly: n.abortPipeEarly
|
|
940
|
-
}, f = e.kind === "schema",
|
|
941
|
-
|
|
940
|
+
}, f = e.kind === "schema", v = (s == null ? void 0 : s.message) ?? e.message ?? /* @__PURE__ */ Xs(e.reference, u.lang) ?? (f ? /* @__PURE__ */ Zs(u.lang) : null) ?? n.message ?? /* @__PURE__ */ Js(u.lang);
|
|
941
|
+
v !== void 0 && (u.message = typeof v == "function" ? (
|
|
942
942
|
// @ts-expect-error
|
|
943
|
-
|
|
944
|
-
) :
|
|
943
|
+
v(u)
|
|
944
|
+
) : v), f && (t.typed = !1), t.issues ? t.issues.push(u) : t.issues = [u];
|
|
945
945
|
}
|
|
946
946
|
// @__NO_SIDE_EFFECTS__
|
|
947
947
|
function be(e) {
|
|
@@ -996,7 +996,7 @@ function Xr(e, r) {
|
|
|
996
996
|
requirement: e,
|
|
997
997
|
message: r,
|
|
998
998
|
"~run"(t, n) {
|
|
999
|
-
return t.typed && !this.requirement(t.value) &&
|
|
999
|
+
return t.typed && !this.requirement(t.value) && re(this, "input", t, n), t;
|
|
1000
1000
|
}
|
|
1001
1001
|
};
|
|
1002
1002
|
}
|
|
@@ -1011,7 +1011,7 @@ function Yr(e) {
|
|
|
1011
1011
|
requirement: ra,
|
|
1012
1012
|
message: e,
|
|
1013
1013
|
"~run"(r, t) {
|
|
1014
|
-
return r.typed && !this.requirement.test(r.value) &&
|
|
1014
|
+
return r.typed && !this.requirement.test(r.value) && re(this, "email", r, t), r;
|
|
1015
1015
|
}
|
|
1016
1016
|
};
|
|
1017
1017
|
}
|
|
@@ -1026,7 +1026,7 @@ function ct(e, r) {
|
|
|
1026
1026
|
requirement: e,
|
|
1027
1027
|
message: r,
|
|
1028
1028
|
"~run"(t, n) {
|
|
1029
|
-
return t.typed && t.value.length > this.requirement &&
|
|
1029
|
+
return t.typed && t.value.length > this.requirement && re(this, "length", t, n, {
|
|
1030
1030
|
received: `${t.value.length}`
|
|
1031
1031
|
}), t;
|
|
1032
1032
|
}
|
|
@@ -1039,28 +1039,28 @@ function Qr(e, r) {
|
|
|
1039
1039
|
type: "max_value",
|
|
1040
1040
|
reference: Qr,
|
|
1041
1041
|
async: !1,
|
|
1042
|
-
expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */
|
|
1042
|
+
expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Xe(e)}`,
|
|
1043
1043
|
requirement: e,
|
|
1044
1044
|
message: r,
|
|
1045
1045
|
"~run"(t, n) {
|
|
1046
|
-
return t.typed && !(t.value <= this.requirement) &&
|
|
1047
|
-
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */
|
|
1046
|
+
return t.typed && !(t.value <= this.requirement) && re(this, "value", t, n, {
|
|
1047
|
+
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Xe(t.value)
|
|
1048
1048
|
}), t;
|
|
1049
1049
|
}
|
|
1050
1050
|
};
|
|
1051
1051
|
}
|
|
1052
1052
|
// @__NO_SIDE_EFFECTS__
|
|
1053
|
-
function
|
|
1053
|
+
function Ze(e, r) {
|
|
1054
1054
|
return {
|
|
1055
1055
|
kind: "validation",
|
|
1056
1056
|
type: "min_length",
|
|
1057
|
-
reference:
|
|
1057
|
+
reference: Ze,
|
|
1058
1058
|
async: !1,
|
|
1059
1059
|
expects: `>=${e}`,
|
|
1060
1060
|
requirement: e,
|
|
1061
1061
|
message: r,
|
|
1062
1062
|
"~run"(t, n) {
|
|
1063
|
-
return t.typed && t.value.length < this.requirement &&
|
|
1063
|
+
return t.typed && t.value.length < this.requirement && re(this, "length", t, n, {
|
|
1064
1064
|
received: `${t.value.length}`
|
|
1065
1065
|
}), t;
|
|
1066
1066
|
}
|
|
@@ -1073,37 +1073,37 @@ function en(e, r) {
|
|
|
1073
1073
|
type: "min_value",
|
|
1074
1074
|
reference: en,
|
|
1075
1075
|
async: !1,
|
|
1076
|
-
expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */
|
|
1076
|
+
expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Xe(e)}`,
|
|
1077
1077
|
requirement: e,
|
|
1078
1078
|
message: r,
|
|
1079
1079
|
"~run"(t, n) {
|
|
1080
|
-
return t.typed && !(t.value >= this.requirement) &&
|
|
1081
|
-
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */
|
|
1080
|
+
return t.typed && !(t.value >= this.requirement) && re(this, "value", t, n, {
|
|
1081
|
+
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Xe(t.value)
|
|
1082
1082
|
}), t;
|
|
1083
1083
|
}
|
|
1084
1084
|
};
|
|
1085
1085
|
}
|
|
1086
1086
|
// @__NO_SIDE_EFFECTS__
|
|
1087
|
-
function
|
|
1087
|
+
function Ht(e, r) {
|
|
1088
1088
|
return {
|
|
1089
1089
|
kind: "validation",
|
|
1090
1090
|
type: "regex",
|
|
1091
|
-
reference:
|
|
1091
|
+
reference: Ht,
|
|
1092
1092
|
async: !1,
|
|
1093
1093
|
expects: `${e}`,
|
|
1094
1094
|
requirement: e,
|
|
1095
1095
|
message: r,
|
|
1096
1096
|
"~run"(t, n) {
|
|
1097
|
-
return t.typed && !this.requirement.test(t.value) &&
|
|
1097
|
+
return t.typed && !this.requirement.test(t.value) && re(this, "format", t, n), t;
|
|
1098
1098
|
}
|
|
1099
1099
|
};
|
|
1100
1100
|
}
|
|
1101
1101
|
// @__NO_SIDE_EFFECTS__
|
|
1102
|
-
function
|
|
1102
|
+
function Kt(e) {
|
|
1103
1103
|
return {
|
|
1104
1104
|
kind: "transformation",
|
|
1105
1105
|
type: "transform",
|
|
1106
|
-
reference:
|
|
1106
|
+
reference: Kt,
|
|
1107
1107
|
async: !1,
|
|
1108
1108
|
operation: e,
|
|
1109
1109
|
"~run"(r) {
|
|
@@ -1128,7 +1128,7 @@ function tn(e) {
|
|
|
1128
1128
|
},
|
|
1129
1129
|
message: e,
|
|
1130
1130
|
"~run"(r, t) {
|
|
1131
|
-
return r.typed && !this.requirement(r.value) &&
|
|
1131
|
+
return r.typed && !this.requirement(r.value) && re(this, "URL", r, t), r;
|
|
1132
1132
|
}
|
|
1133
1133
|
};
|
|
1134
1134
|
}
|
|
@@ -1180,8 +1180,8 @@ function nn(e, r) {
|
|
|
1180
1180
|
key: a,
|
|
1181
1181
|
value: o
|
|
1182
1182
|
};
|
|
1183
|
-
for (const
|
|
1184
|
-
|
|
1183
|
+
for (const v of u.issues)
|
|
1184
|
+
v.path ? v.path.unshift(f) : v.path = [f], (i = t.issues) == null || i.push(v);
|
|
1185
1185
|
if (t.issues || (t.issues = u.issues), n.abortEarly) {
|
|
1186
1186
|
t.typed = !1;
|
|
1187
1187
|
break;
|
|
@@ -1190,7 +1190,7 @@ function nn(e, r) {
|
|
|
1190
1190
|
u.typed || (t.typed = !1), t.value.push(u.value);
|
|
1191
1191
|
}
|
|
1192
1192
|
} else
|
|
1193
|
-
|
|
1193
|
+
re(this, "type", t, n);
|
|
1194
1194
|
return t;
|
|
1195
1195
|
}
|
|
1196
1196
|
};
|
|
@@ -1208,7 +1208,7 @@ function sn(e) {
|
|
|
1208
1208
|
return /* @__PURE__ */ be(this);
|
|
1209
1209
|
},
|
|
1210
1210
|
"~run"(r, t) {
|
|
1211
|
-
return typeof r.value == "boolean" ? r.typed = !0 :
|
|
1211
|
+
return typeof r.value == "boolean" ? r.typed = !0 : re(this, "type", r, t), r;
|
|
1212
1212
|
}
|
|
1213
1213
|
};
|
|
1214
1214
|
}
|
|
@@ -1225,16 +1225,16 @@ function an(e) {
|
|
|
1225
1225
|
return /* @__PURE__ */ be(this);
|
|
1226
1226
|
},
|
|
1227
1227
|
"~run"(r, t) {
|
|
1228
|
-
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 :
|
|
1228
|
+
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : re(this, "type", r, t), r;
|
|
1229
1229
|
}
|
|
1230
1230
|
};
|
|
1231
1231
|
}
|
|
1232
1232
|
// @__NO_SIDE_EFFECTS__
|
|
1233
|
-
function
|
|
1233
|
+
function ke(e, r) {
|
|
1234
1234
|
return {
|
|
1235
1235
|
kind: "schema",
|
|
1236
1236
|
type: "object",
|
|
1237
|
-
reference:
|
|
1237
|
+
reference: ke,
|
|
1238
1238
|
expects: "Object",
|
|
1239
1239
|
async: !1,
|
|
1240
1240
|
entries: e,
|
|
@@ -1256,15 +1256,15 @@ function _e(e, r) {
|
|
|
1256
1256
|
s[a]
|
|
1257
1257
|
) : /* @__PURE__ */ rn(o), f = o["~run"]({ value: u }, n);
|
|
1258
1258
|
if (f.issues) {
|
|
1259
|
-
const
|
|
1259
|
+
const v = {
|
|
1260
1260
|
type: "object",
|
|
1261
1261
|
origin: "value",
|
|
1262
1262
|
input: s,
|
|
1263
1263
|
key: a,
|
|
1264
1264
|
value: u
|
|
1265
1265
|
};
|
|
1266
|
-
for (const
|
|
1267
|
-
|
|
1266
|
+
for (const b of f.issues)
|
|
1267
|
+
b.path ? b.path.unshift(v) : b.path = [v], (i = t.issues) == null || i.push(b);
|
|
1268
1268
|
if (t.issues || (t.issues = f.issues), n.abortEarly) {
|
|
1269
1269
|
t.typed = !1;
|
|
1270
1270
|
break;
|
|
@@ -1273,7 +1273,7 @@ function _e(e, r) {
|
|
|
1273
1273
|
f.typed || (t.typed = !1), t.value[a] = f.value;
|
|
1274
1274
|
} else if (o.fallback !== void 0)
|
|
1275
1275
|
t.value[a] = /* @__PURE__ */ na(o);
|
|
1276
|
-
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (
|
|
1276
|
+
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (re(this, "key", t, n, {
|
|
1277
1277
|
input: void 0,
|
|
1278
1278
|
expected: `"${a}"`,
|
|
1279
1279
|
path: [
|
|
@@ -1290,17 +1290,17 @@ function _e(e, r) {
|
|
|
1290
1290
|
break;
|
|
1291
1291
|
}
|
|
1292
1292
|
} else
|
|
1293
|
-
|
|
1293
|
+
re(this, "type", t, n);
|
|
1294
1294
|
return t;
|
|
1295
1295
|
}
|
|
1296
1296
|
};
|
|
1297
1297
|
}
|
|
1298
1298
|
// @__NO_SIDE_EFFECTS__
|
|
1299
|
-
function
|
|
1299
|
+
function Je(e, r) {
|
|
1300
1300
|
return {
|
|
1301
1301
|
kind: "schema",
|
|
1302
1302
|
type: "optional",
|
|
1303
|
-
reference:
|
|
1303
|
+
reference: Je,
|
|
1304
1304
|
expects: `(${e.expects} | undefined)`,
|
|
1305
1305
|
async: !1,
|
|
1306
1306
|
wrapped: e,
|
|
@@ -1319,7 +1319,7 @@ function on(e, r) {
|
|
|
1319
1319
|
kind: "schema",
|
|
1320
1320
|
type: "picklist",
|
|
1321
1321
|
reference: on,
|
|
1322
|
-
expects: /* @__PURE__ */ Qs(e.map(
|
|
1322
|
+
expects: /* @__PURE__ */ Qs(e.map(Xe), "|"),
|
|
1323
1323
|
async: !1,
|
|
1324
1324
|
options: e,
|
|
1325
1325
|
message: r,
|
|
@@ -1327,7 +1327,7 @@ function on(e, r) {
|
|
|
1327
1327
|
return /* @__PURE__ */ be(this);
|
|
1328
1328
|
},
|
|
1329
1329
|
"~run"(t, n) {
|
|
1330
|
-
return this.options.includes(t.value) ? t.typed = !0 :
|
|
1330
|
+
return this.options.includes(t.value) ? t.typed = !0 : re(this, "type", t, n), t;
|
|
1331
1331
|
}
|
|
1332
1332
|
};
|
|
1333
1333
|
}
|
|
@@ -1352,8 +1352,8 @@ function ln(e, r, t) {
|
|
|
1352
1352
|
n.typed = !0, n.value = {};
|
|
1353
1353
|
for (const u in i)
|
|
1354
1354
|
if (/* @__PURE__ */ Ys(i, u)) {
|
|
1355
|
-
const f = i[u],
|
|
1356
|
-
if (
|
|
1355
|
+
const f = i[u], v = this.key["~run"]({ value: u }, s);
|
|
1356
|
+
if (v.issues) {
|
|
1357
1357
|
const p = {
|
|
1358
1358
|
type: "object",
|
|
1359
1359
|
origin: "key",
|
|
@@ -1361,18 +1361,18 @@ function ln(e, r, t) {
|
|
|
1361
1361
|
key: u,
|
|
1362
1362
|
value: f
|
|
1363
1363
|
};
|
|
1364
|
-
for (const
|
|
1365
|
-
|
|
1366
|
-
if (n.issues || (n.issues =
|
|
1364
|
+
for (const y of v.issues)
|
|
1365
|
+
y.path = [p], (a = n.issues) == null || a.push(y);
|
|
1366
|
+
if (n.issues || (n.issues = v.issues), s.abortEarly) {
|
|
1367
1367
|
n.typed = !1;
|
|
1368
1368
|
break;
|
|
1369
1369
|
}
|
|
1370
1370
|
}
|
|
1371
|
-
const
|
|
1371
|
+
const b = this.value["~run"](
|
|
1372
1372
|
{ value: f },
|
|
1373
1373
|
s
|
|
1374
1374
|
);
|
|
1375
|
-
if (
|
|
1375
|
+
if (b.issues) {
|
|
1376
1376
|
const p = {
|
|
1377
1377
|
type: "object",
|
|
1378
1378
|
origin: "value",
|
|
@@ -1380,27 +1380,27 @@ function ln(e, r, t) {
|
|
|
1380
1380
|
key: u,
|
|
1381
1381
|
value: f
|
|
1382
1382
|
};
|
|
1383
|
-
for (const
|
|
1384
|
-
|
|
1385
|
-
if (n.issues || (n.issues =
|
|
1383
|
+
for (const y of b.issues)
|
|
1384
|
+
y.path ? y.path.unshift(p) : y.path = [p], (o = n.issues) == null || o.push(y);
|
|
1385
|
+
if (n.issues || (n.issues = b.issues), s.abortEarly) {
|
|
1386
1386
|
n.typed = !1;
|
|
1387
1387
|
break;
|
|
1388
1388
|
}
|
|
1389
1389
|
}
|
|
1390
|
-
(!
|
|
1390
|
+
(!v.typed || !b.typed) && (n.typed = !1), v.typed && (n.value[v.value] = b.value);
|
|
1391
1391
|
}
|
|
1392
1392
|
} else
|
|
1393
|
-
|
|
1393
|
+
re(this, "type", n, s);
|
|
1394
1394
|
return n;
|
|
1395
1395
|
}
|
|
1396
1396
|
};
|
|
1397
1397
|
}
|
|
1398
1398
|
// @__NO_SIDE_EFFECTS__
|
|
1399
|
-
function
|
|
1399
|
+
function le(e) {
|
|
1400
1400
|
return {
|
|
1401
1401
|
kind: "schema",
|
|
1402
1402
|
type: "string",
|
|
1403
|
-
reference:
|
|
1403
|
+
reference: le,
|
|
1404
1404
|
expects: "string",
|
|
1405
1405
|
async: !1,
|
|
1406
1406
|
message: e,
|
|
@@ -1408,7 +1408,7 @@ function ie(e) {
|
|
|
1408
1408
|
return /* @__PURE__ */ be(this);
|
|
1409
1409
|
},
|
|
1410
1410
|
"~run"(r, t) {
|
|
1411
|
-
return typeof r.value == "string" ? r.typed = !0 :
|
|
1411
|
+
return typeof r.value == "string" ? r.typed = !0 : re(this, "type", r, t), r;
|
|
1412
1412
|
}
|
|
1413
1413
|
};
|
|
1414
1414
|
}
|
|
@@ -1422,7 +1422,7 @@ function sa(e, r, t) {
|
|
|
1422
1422
|
function aa(e, r) {
|
|
1423
1423
|
const t = {};
|
|
1424
1424
|
for (const n in e.entries)
|
|
1425
|
-
t[n] = !r || r.includes(n) ? /* @__PURE__ */
|
|
1425
|
+
t[n] = !r || r.includes(n) ? /* @__PURE__ */ Je(e.entries[n]) : e.entries[n];
|
|
1426
1426
|
return {
|
|
1427
1427
|
...e,
|
|
1428
1428
|
entries: t,
|
|
@@ -1475,7 +1475,7 @@ async function oa(e, r, t) {
|
|
|
1475
1475
|
issues: n.issues
|
|
1476
1476
|
};
|
|
1477
1477
|
}
|
|
1478
|
-
const
|
|
1478
|
+
const tt = ({
|
|
1479
1479
|
error: e
|
|
1480
1480
|
}) => !e || !e.message ? null : c("div", {
|
|
1481
1481
|
role: "alert",
|
|
@@ -1514,10 +1514,10 @@ const Xe = ({
|
|
|
1514
1514
|
}) => {
|
|
1515
1515
|
const {
|
|
1516
1516
|
t
|
|
1517
|
-
} =
|
|
1517
|
+
} = ne();
|
|
1518
1518
|
return c("button", {
|
|
1519
1519
|
type: "button",
|
|
1520
|
-
class:
|
|
1520
|
+
class: Qe("fr touch-hitbox text-neutral-11 bg-neutral-1 ring-divider hover:ring-divider active:ring-interactive-bg-hover hover:text-neutral-12 active:text-neutral-12 hover:bg-divider active:bg-interactive-bg-hover flex flex-shrink-0 items-center justify-center gap-1 self-center rounded-full py-1 pl-2 pr-2.5 text-sm ring-1 transition-all", e),
|
|
1521
1521
|
...r,
|
|
1522
1522
|
children: [c("svg", {
|
|
1523
1523
|
"aria-hidden": !0,
|
|
@@ -1539,8 +1539,8 @@ const Xe = ({
|
|
|
1539
1539
|
}), t("skip")]
|
|
1540
1540
|
});
|
|
1541
1541
|
};
|
|
1542
|
-
var
|
|
1543
|
-
const
|
|
1542
|
+
var Gt = { Afghanistan: "93", Albania: "355", Algeria: "213", "American Samoa": "1 684", Andorra: "376", Angola: "244", Anguilla: "1 264", Antarctica: "672", "Antigua and Barbuda": "1 268", Argentina: "54", Armenia: "374", Aruba: "297", Australia: "61", Austria: "43", Azerbaijan: "994", Bahrain: "973", Bangladesh: "880", Barbados: "1 246", Belarus: "375", Belgium: "32", Belize: "501", Benin: "229", Bermuda: "1 441", Bhutan: "975", Bolivia: "591", "Bosnia and Herzegovina": "387", Botswana: "267", "Bouvet Island": "47", Brazil: "55", "British Indian Ocean Territory": "246", "British Virgin Islands": "1 284", Brunei: "673", Bulgaria: "359", "Burkina Faso": "226", Burundi: "257", "Cabo Verde": "238", Cambodia: "855", Cameroon: "237", Canada: "1", "Caribbean Netherlands": "599", "Cayman Islands": "1 345", "Central African Republic": "236", Chad: "235", Chile: "56", China: "86", "Christmas Island": "61", "Cocos (Keeling) Islands": "61", Colombia: "57", Comoros: "269", "Cook Islands": "682", "Costa Rica": "506", Croatia: "385", Cuba: "53", Curaçao: "599", Cyprus: "357", Czechia: "420", "Côte d'Ivoire": "225", "Democratic Republic of the Congo": "243", Denmark: "45", Djibouti: "253", "Dominican Republic": "1 809", Ecuador: "593", Egypt: "20", "El Salvador": "503", "Equatorial Guinea": "240", Eritrea: "291", Estonia: "372", Eswatini: "268", Ethiopia: "251", "Falkland Islands (Islas Malvinas)": "500", "Faroe Islands": "298", Fiji: "679", Finland: "358", France: "33", "French Guiana": "594", "French Polynesia": "689", "French Southern and Antarctic Lands": "262", Gabon: "241", Georgia: "995", Germany: "49", Ghana: "233", Gibraltar: "350", Greece: "30", Greenland: "299", Grenada: "1 473", Guadeloupe: "590", Guam: "1 671", Guatemala: "502", Guernsey: "44", Guinea: "224", "Guinea-Bissau": "245", Guyana: "592", Haiti: "509", Honduras: "504", "Hong Kong": "852", Hungary: "36", Iceland: "354", India: "91", Indonesia: "62", Iran: "98", Iraq: "964", Ireland: "353", "Isle of Man": "44", Israel: "972", Italy: "39", Jamaica: "1 876", Japan: "81", Jersey: "44", Jordan: "962", Kazakhstan: "7", Kenya: "254", Kiribati: "686", Kosovo: "383", Kuwait: "965", Kyrgyzstan: "996", Laos: "856", Latvia: "371", Lebanon: "961", Lesotho: "266", Liberia: "231", Libya: "218", Liechtenstein: "423", Lithuania: "370", Luxembourg: "352", Macao: "853", Madagascar: "261", Malawi: "265", Malaysia: "60", Maldives: "960", Mali: "223", Malta: "356", "Marshall Islands": "692", Martinique: "596", Mauritania: "222", Mauritius: "230", Mayotte: "262", Mexico: "52", Micronesia: "691", Moldova: "373", Monaco: "377", Mongolia: "976", Montenegro: "382", Montserrat: "1 664", Morocco: "212", Mozambique: "258", "Myanmar (Burma)": "95", Namibia: "264", Nauru: "674", Nepal: "977", Netherlands: "31", "New Caledonia": "687", "New Zealand": "64", Nicaragua: "505", Niger: "227", Nigeria: "234", Niue: "683", "Norfolk Island": "672", "North Korea": "850", "North Macedonia": "389", "Northern Mariana Islands": "1 670", Norway: "47", Oman: "968", Pakistan: "92", Palau: "680", Palestine: "970", Panama: "507", "Papua New Guinea": "675", Paraguay: "595", Peru: "51", Philippines: "63", "Pitcairn Islands": "64", Poland: "48", Portugal: "351", "Puerto Rico": "1 787", Qatar: "974", Romania: "40", Russia: "7", Rwanda: "250", Réunion: "262", "Saint Barthélemy": "590", "Saint Helena, Ascension and Tristan da Cunha": "290", "Saint Kitts and Nevis": "1 869", "Saint Lucia": "1 758", "Saint Martin": "590", "Saint Pierre and Miquelon": "508", "Saint Vincent and the Grenadines": "1 784", Samoa: "685", "San Marino": "378", "Saudi Arabia": "966", Senegal: "221", Serbia: "381", Seychelles: "248", "Sierra Leone": "232", Singapore: "65", "Sint Maarten": "1 721", Slovakia: "421", Slovenia: "386", "Solomon Islands": "677", Somalia: "252", "South Africa": "27", "South Georgia and the South Sandwich Islands": "500", "South Korea": "82", "South Sudan": "211", Spain: "34", "Sri Lanka": "94", Sudan: "249", Suriname: "597", "Svalbard and Jan Mayen": "47", Sweden: "46", Switzerland: "41", Syria: "963", "São Tomé and Príncipe": "239", Taiwan: "886", Tajikistan: "992", Tanzania: "255", Thailand: "66", "The Bahamas": "1 242", "The Gambia": "220", "Timor-Leste": "670", Togo: "228", Tokelau: "690", Tonga: "676", "Trinidad and Tobago": "1 868", Tunisia: "216", Turkmenistan: "993", "Turks and Caicos Islands": "1 649", Tuvalu: "688", Türkiye: "90", "U.S. Virgin Islands": "1 340", Uganda: "256", Ukraine: "380", "United Arab Emirates": "971", "United Kingdom": "44", "United States": "1", "United States Minor Outlying Islands": "1", Uruguay: "598", Uzbekistan: "998", Vanuatu: "678", "Vatican City": "379", Venezuela: "58", Vietnam: "84", "Wallis and Futuna": "681", "Western Sahara": "212", Yemen: "967", Zambia: "260", Zimbabwe: "263", "Åland Islands": "358" };
|
|
1543
|
+
const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all", {
|
|
1544
1544
|
variants: {
|
|
1545
1545
|
optional: {
|
|
1546
1546
|
true: "pr-16 pl-3",
|
|
@@ -1550,25 +1550,25 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1550
1550
|
defaultVariants: {
|
|
1551
1551
|
optional: !1
|
|
1552
1552
|
}
|
|
1553
|
-
}), la = "https://api.mapbox.com/search/searchbox/v1/suggest", ca = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", ua = (e) => atob(e).split("").reverse().join(""),
|
|
1554
|
-
name: /* @__PURE__ */
|
|
1555
|
-
}), da = /* @__PURE__ */
|
|
1556
|
-
suggestions: /* @__PURE__ */ nn(/* @__PURE__ */
|
|
1557
|
-
feature_type: /* @__PURE__ */
|
|
1558
|
-
full_address: /* @__PURE__ */
|
|
1559
|
-
place_formatted: /* @__PURE__ */
|
|
1560
|
-
name: /* @__PURE__ */
|
|
1561
|
-
mapbox_id: /* @__PURE__ */
|
|
1562
|
-
context: /* @__PURE__ */ aa(/* @__PURE__ */
|
|
1563
|
-
address:
|
|
1564
|
-
street:
|
|
1565
|
-
neighborhood:
|
|
1566
|
-
locality:
|
|
1567
|
-
district:
|
|
1568
|
-
place:
|
|
1569
|
-
region:
|
|
1570
|
-
postcode:
|
|
1571
|
-
country:
|
|
1553
|
+
}), la = "https://api.mapbox.com/search/searchbox/v1/suggest", ca = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", ua = (e) => atob(e).split("").reverse().join(""), xe = /* @__PURE__ */ ke({
|
|
1554
|
+
name: /* @__PURE__ */ le()
|
|
1555
|
+
}), da = /* @__PURE__ */ ke({
|
|
1556
|
+
suggestions: /* @__PURE__ */ nn(/* @__PURE__ */ ke({
|
|
1557
|
+
feature_type: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1558
|
+
full_address: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1559
|
+
place_formatted: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1560
|
+
name: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1561
|
+
mapbox_id: /* @__PURE__ */ le(),
|
|
1562
|
+
context: /* @__PURE__ */ aa(/* @__PURE__ */ ke({
|
|
1563
|
+
address: xe,
|
|
1564
|
+
street: xe,
|
|
1565
|
+
neighborhood: xe,
|
|
1566
|
+
locality: xe,
|
|
1567
|
+
district: xe,
|
|
1568
|
+
place: xe,
|
|
1569
|
+
region: xe,
|
|
1570
|
+
postcode: xe,
|
|
1571
|
+
country: xe
|
|
1572
1572
|
}))
|
|
1573
1573
|
}))
|
|
1574
1574
|
}), fa = ({
|
|
@@ -1576,14 +1576,14 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1576
1576
|
t: r
|
|
1577
1577
|
}) => Un(() => {
|
|
1578
1578
|
var n;
|
|
1579
|
-
const t = (n =
|
|
1579
|
+
const t = (n = q.current$.peek().flow) == null ? void 0 : n.data.flowSessionId;
|
|
1580
1580
|
return t ? {
|
|
1581
1581
|
enabled: !0,
|
|
1582
1582
|
getPredictions: async (s) => {
|
|
1583
|
-
var
|
|
1583
|
+
var b;
|
|
1584
1584
|
const i = new URL(la);
|
|
1585
1585
|
i.searchParams.set("q", s), i.searchParams.set("session_token", t);
|
|
1586
|
-
const a = (
|
|
1586
|
+
const a = (b = q.current$.peek().flow) == null ? void 0 : b.locationOrigin;
|
|
1587
1587
|
a && a.lat !== void 0 && a.lng !== void 0 && a.lat >= -90 && a.lat <= 90 && a.lng >= -180 && a.lng <= 180 && i.searchParams.set("proximity", `${a.lng},${a.lat}`), i.searchParams.set("access_token", ua(ca));
|
|
1588
1588
|
const u = await fetch(i);
|
|
1589
1589
|
if (!u.ok)
|
|
@@ -1598,24 +1598,24 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1598
1598
|
error: r("address_error")
|
|
1599
1599
|
};
|
|
1600
1600
|
const {
|
|
1601
|
-
suggestions:
|
|
1601
|
+
suggestions: v
|
|
1602
1602
|
} = f.output;
|
|
1603
1603
|
return {
|
|
1604
1604
|
ok: !0,
|
|
1605
|
-
data:
|
|
1606
|
-
var
|
|
1605
|
+
data: v.map((p) => {
|
|
1606
|
+
var y, C, _, k, E, g, N, V, M;
|
|
1607
1607
|
return {
|
|
1608
1608
|
// A postcode result has no full address and is named by the postcode itself (PROD-7311).
|
|
1609
1609
|
label: p.full_address ?? ([p.name, p.place_formatted].filter(Boolean).join(", ") || p.mapbox_id),
|
|
1610
1610
|
id: p.mapbox_id,
|
|
1611
1611
|
address: {
|
|
1612
|
-
line1: ((
|
|
1612
|
+
line1: ((y = p.context.address) == null ? void 0 : y.name) ?? ((C = p.context.street) == null ? void 0 : C.name),
|
|
1613
1613
|
line2: void 0,
|
|
1614
|
-
line3: ((
|
|
1615
|
-
city: ((
|
|
1616
|
-
state: (
|
|
1617
|
-
postcode: ((
|
|
1618
|
-
country: (
|
|
1614
|
+
line3: ((_ = p.context.neighborhood) == null ? void 0 : _.name) ?? ((k = p.context.locality) == null ? void 0 : k.name),
|
|
1615
|
+
city: ((E = p.context.place) == null ? void 0 : E.name) ?? ((g = p.context.district) == null ? void 0 : g.name),
|
|
1616
|
+
state: (N = p.context.region) == null ? void 0 : N.name,
|
|
1617
|
+
postcode: ((V = p.context.postcode) == null ? void 0 : V.name) ?? (p.feature_type === "postcode" ? p.name : void 0),
|
|
1618
|
+
country: (M = p.context.country) == null ? void 0 : M.name
|
|
1619
1619
|
}
|
|
1620
1620
|
};
|
|
1621
1621
|
})
|
|
@@ -1624,10 +1624,10 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1624
1624
|
} : {
|
|
1625
1625
|
enabled: !1
|
|
1626
1626
|
};
|
|
1627
|
-
}, [e, r]),
|
|
1627
|
+
}, [e, r]), fr = (e) => {
|
|
1628
1628
|
const {
|
|
1629
1629
|
t: r
|
|
1630
|
-
} =
|
|
1630
|
+
} = ne();
|
|
1631
1631
|
return c("button", {
|
|
1632
1632
|
type: "button",
|
|
1633
1633
|
class: "touch-hitbox text-neutral-11 hover:bg-neutral-4 hover:text-neutral-12 hover:border-neutral-5 relative flex items-center gap-1 rounded-[18px] border border-solid border-transparent px-3 py-1 pl-1.5 text-sm transition-colors",
|
|
@@ -1654,87 +1654,87 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1654
1654
|
}) => {
|
|
1655
1655
|
const {
|
|
1656
1656
|
t: n
|
|
1657
|
-
} =
|
|
1657
|
+
} = ne(), [s, i] = _e(), {
|
|
1658
1658
|
enabled: a,
|
|
1659
1659
|
getPredictions: o
|
|
1660
1660
|
} = fa({
|
|
1661
1661
|
logger: t,
|
|
1662
1662
|
t: n
|
|
1663
|
-
}), [u, f] =
|
|
1664
|
-
var
|
|
1665
|
-
if (
|
|
1663
|
+
}), [u, f] = _e(a ? "query" : "manual"), [v, b] = _e(""), [p, y] = _e(), C = ye(), _ = ye(), k = (g) => {
|
|
1664
|
+
var V;
|
|
1665
|
+
if (Oe(a, "Query state should not be enabled"), g = g.trim(), g === ((V = C.current) == null ? void 0 : V.query) || g === (p == null ? void 0 : p.query) && p.status === "done")
|
|
1666
1666
|
return;
|
|
1667
|
-
if (
|
|
1668
|
-
|
|
1667
|
+
if (b(g), g === "") {
|
|
1668
|
+
C.current = void 0, y(void 0);
|
|
1669
1669
|
return;
|
|
1670
1670
|
}
|
|
1671
|
-
const
|
|
1672
|
-
query:
|
|
1671
|
+
const N = C.current = {
|
|
1672
|
+
query: g
|
|
1673
1673
|
};
|
|
1674
|
-
|
|
1675
|
-
query:
|
|
1674
|
+
y({
|
|
1675
|
+
query: g,
|
|
1676
1676
|
status: "pending"
|
|
1677
|
-
}), o(
|
|
1678
|
-
|
|
1679
|
-
query:
|
|
1677
|
+
}), o(g).then((M) => {
|
|
1678
|
+
C.current === N && (C.current = void 0, y(M.ok ? {
|
|
1679
|
+
query: g,
|
|
1680
1680
|
status: "done",
|
|
1681
|
-
items:
|
|
1681
|
+
items: M.data
|
|
1682
1682
|
} : {
|
|
1683
|
-
query:
|
|
1683
|
+
query: g,
|
|
1684
1684
|
status: "failed",
|
|
1685
|
-
error:
|
|
1685
|
+
error: M.error
|
|
1686
1686
|
}));
|
|
1687
|
-
}, (
|
|
1688
|
-
|
|
1689
|
-
query:
|
|
1687
|
+
}, (M) => {
|
|
1688
|
+
C.current === N && (C.current = void 0, t.error("Failed to get address details", M), y({
|
|
1689
|
+
query: g,
|
|
1690
1690
|
status: "failed",
|
|
1691
1691
|
error: n("address_error")
|
|
1692
1692
|
}));
|
|
1693
1693
|
});
|
|
1694
|
-
},
|
|
1695
|
-
i((
|
|
1696
|
-
...
|
|
1697
|
-
[
|
|
1694
|
+
}, E = (g, N) => {
|
|
1695
|
+
i((V) => ({
|
|
1696
|
+
...V,
|
|
1697
|
+
[g]: N
|
|
1698
1698
|
}));
|
|
1699
1699
|
};
|
|
1700
1700
|
switch (u) {
|
|
1701
1701
|
case "query":
|
|
1702
|
-
return
|
|
1702
|
+
return Oe(a, "Query state should not be enabled"), c(pa, {
|
|
1703
1703
|
input: e,
|
|
1704
1704
|
onSkip: () => r(null),
|
|
1705
|
-
onAddressSelect: (
|
|
1706
|
-
if (
|
|
1707
|
-
|
|
1705
|
+
onAddressSelect: (g) => {
|
|
1706
|
+
if (g === "") {
|
|
1707
|
+
C.current && (C.current = void 0, y(void 0)), f("manual");
|
|
1708
1708
|
return;
|
|
1709
1709
|
}
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1710
|
+
const N = (p == null ? void 0 : p.status) === "done" ? p.items.find((V) => V.id === g) : void 0;
|
|
1711
|
+
N && (_.current !== g && i(N.address), _.current = g, f("details"));
|
|
1712
1712
|
},
|
|
1713
1713
|
onAddressSearch: k,
|
|
1714
1714
|
lookup: p,
|
|
1715
|
-
query:
|
|
1715
|
+
query: v
|
|
1716
1716
|
});
|
|
1717
1717
|
case "details":
|
|
1718
|
-
return
|
|
1718
|
+
return Oe(s !== void 0), c(hr, {
|
|
1719
1719
|
input: e,
|
|
1720
1720
|
logger: t,
|
|
1721
1721
|
onSubmitSuccess: r,
|
|
1722
1722
|
addressFields: s,
|
|
1723
|
-
onFieldChange:
|
|
1724
|
-
actions: c(
|
|
1723
|
+
onFieldChange: E,
|
|
1724
|
+
actions: c(fr, {
|
|
1725
1725
|
onClick: () => {
|
|
1726
1726
|
f("query");
|
|
1727
1727
|
}
|
|
1728
1728
|
})
|
|
1729
1729
|
});
|
|
1730
1730
|
case "manual":
|
|
1731
|
-
return c(
|
|
1731
|
+
return c(hr, {
|
|
1732
1732
|
logger: t,
|
|
1733
1733
|
input: e,
|
|
1734
1734
|
onSubmitSuccess: r,
|
|
1735
1735
|
addressFields: s ?? {},
|
|
1736
|
-
onFieldChange:
|
|
1737
|
-
actions: a ? c(
|
|
1736
|
+
onFieldChange: E,
|
|
1737
|
+
actions: a ? c(fr, {
|
|
1738
1738
|
onClick: () => {
|
|
1739
1739
|
f("query");
|
|
1740
1740
|
}
|
|
@@ -1756,16 +1756,16 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1756
1756
|
}) => {
|
|
1757
1757
|
const {
|
|
1758
1758
|
t: a
|
|
1759
|
-
} =
|
|
1759
|
+
} = ne(), o = ye(null);
|
|
1760
1760
|
return Me(() => {
|
|
1761
1761
|
o.current && (o.current.focus(), o.current.select());
|
|
1762
|
-
}, []), c(
|
|
1762
|
+
}, []), c(Ce, {
|
|
1763
1763
|
children: [c("form", {
|
|
1764
1764
|
noValidate: !0,
|
|
1765
1765
|
onSubmit: (u) => {
|
|
1766
1766
|
u.preventDefault();
|
|
1767
|
-
const
|
|
1768
|
-
typeof
|
|
1767
|
+
const v = new FormData(u.currentTarget).get("address");
|
|
1768
|
+
typeof v == "string" && i(v);
|
|
1769
1769
|
},
|
|
1770
1770
|
class: "flex gap-2 p-2.5",
|
|
1771
1771
|
children: [c("div", {
|
|
@@ -1778,7 +1778,7 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1778
1778
|
autoFocus: !0,
|
|
1779
1779
|
placeholder: e.config.placeholder || a("address_search"),
|
|
1780
1780
|
defaultValue: s,
|
|
1781
|
-
class:
|
|
1781
|
+
class: Ye({
|
|
1782
1782
|
optional: !!e.config.optional,
|
|
1783
1783
|
className: "w-full rounded-full"
|
|
1784
1784
|
})
|
|
@@ -1815,15 +1815,15 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1815
1815
|
class: "relative",
|
|
1816
1816
|
onClick: r
|
|
1817
1817
|
})]
|
|
1818
|
-
}), (t == null ? void 0 : t.status) === "failed" ? c(
|
|
1818
|
+
}), (t == null ? void 0 : t.status) === "failed" ? c(tt, {
|
|
1819
1819
|
error: {
|
|
1820
1820
|
message: t.error
|
|
1821
1821
|
}
|
|
1822
1822
|
}) : null, c("p", {
|
|
1823
1823
|
role: "status",
|
|
1824
1824
|
class: (t == null ? void 0 : t.status) === "pending" || (t == null ? void 0 : t.status) === "done" && t.items.length === 0 ? "text-neutral-11 flex items-center gap-2 px-4 py-2 text-sm" : "sr-only",
|
|
1825
|
-
children: (t == null ? void 0 : t.status) === "pending" ? c(
|
|
1826
|
-
children: [c(
|
|
1825
|
+
children: (t == null ? void 0 : t.status) === "pending" ? c(Ce, {
|
|
1826
|
+
children: [c(Ut, {
|
|
1827
1827
|
"aria-hidden": "true",
|
|
1828
1828
|
class: "h-4 w-4 shrink-0"
|
|
1829
1829
|
}), a("address_searching")]
|
|
@@ -1866,7 +1866,7 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1866
1866
|
}, "")]
|
|
1867
1867
|
})]
|
|
1868
1868
|
});
|
|
1869
|
-
},
|
|
1869
|
+
}, Rt = ["line1", "line2", "line3", "city", "state", "postcode", "country"], hr = ({
|
|
1870
1870
|
addressFields: e,
|
|
1871
1871
|
onFieldChange: r,
|
|
1872
1872
|
onSubmitSuccess: t,
|
|
@@ -1880,24 +1880,24 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1880
1880
|
u && (u.focus(), u.select());
|
|
1881
1881
|
}
|
|
1882
1882
|
}, []);
|
|
1883
|
-
const a = Object.keys(
|
|
1883
|
+
const a = Object.keys(Gt), {
|
|
1884
1884
|
t: o
|
|
1885
|
-
} =
|
|
1885
|
+
} = ne();
|
|
1886
1886
|
return c("form", {
|
|
1887
1887
|
class: "flex flex-col px-2 pt-2",
|
|
1888
1888
|
onSubmit: (u) => {
|
|
1889
1889
|
u.preventDefault();
|
|
1890
|
-
const f = u.currentTarget,
|
|
1891
|
-
for (const
|
|
1892
|
-
|
|
1893
|
-
const
|
|
1894
|
-
|
|
1890
|
+
const f = u.currentTarget, v = [...f.querySelectorAll("input")].filter((y) => y.value !== "" && !y.value.trim());
|
|
1891
|
+
for (const y of v) {
|
|
1892
|
+
y.value = "";
|
|
1893
|
+
const C = Rt.find((_) => s.config.keys[_] === y.name);
|
|
1894
|
+
C && r(C, "");
|
|
1895
1895
|
}
|
|
1896
|
-
if (
|
|
1896
|
+
if (v.length > 0 && !f.checkValidity()) {
|
|
1897
1897
|
f.reportValidity();
|
|
1898
1898
|
return;
|
|
1899
1899
|
}
|
|
1900
|
-
const
|
|
1900
|
+
const b = new FormData(f), p = Object.fromEntries(b.entries());
|
|
1901
1901
|
t({
|
|
1902
1902
|
type: "address",
|
|
1903
1903
|
value: p
|
|
@@ -1906,11 +1906,11 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1906
1906
|
children: [c("div", {
|
|
1907
1907
|
class: "bg-neutral-3 border-neutral-5 grid items-center gap-1.5 rounded-2xl border pb-2 pl-4 pr-3 pt-3 [grid-template-columns:min-content_1fr]",
|
|
1908
1908
|
ref: i,
|
|
1909
|
-
children:
|
|
1910
|
-
const
|
|
1911
|
-
return
|
|
1909
|
+
children: Rt.map((u, f) => {
|
|
1910
|
+
const v = `isdk_${u}`, b = s.config.keys[u];
|
|
1911
|
+
return b ? c(Ce, {
|
|
1912
1912
|
children: [c("label", {
|
|
1913
|
-
for:
|
|
1913
|
+
for: v,
|
|
1914
1914
|
class: "text-neutral-11 [&:has(+*>input:focus)]:text-neutral-12 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
|
|
1915
1915
|
children: o(u)
|
|
1916
1916
|
}), c("div", {
|
|
@@ -1919,8 +1919,8 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1919
1919
|
class: "relative",
|
|
1920
1920
|
children: [c("select", {
|
|
1921
1921
|
class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 w-full flex-1 appearance-none rounded-lg border-solid bg-transparent bg-none px-3 py-1.5 text-base transition-colors focus:outline-none",
|
|
1922
|
-
name:
|
|
1923
|
-
id:
|
|
1922
|
+
name: b,
|
|
1923
|
+
id: v,
|
|
1924
1924
|
defaultValue: e[u],
|
|
1925
1925
|
onChange: (p) => r(u, p.currentTarget.value),
|
|
1926
1926
|
required: !0,
|
|
@@ -1952,12 +1952,12 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1952
1952
|
}) : c("input", {
|
|
1953
1953
|
autoFocus: f === 0 ? !0 : void 0,
|
|
1954
1954
|
class: "text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors autofill:shadow-[inset_0_0_0_1000px_hsl(210_16.7%_97.6%)] focus:outline-none",
|
|
1955
|
-
name:
|
|
1956
|
-
id:
|
|
1955
|
+
name: b,
|
|
1956
|
+
id: v,
|
|
1957
1957
|
defaultValue: e[u],
|
|
1958
1958
|
onInput: (p) => r(u, p.currentTarget.value),
|
|
1959
1959
|
required: u === "line2" ? s.config.line2Required === !0 : u !== "line3"
|
|
1960
|
-
}), f ===
|
|
1960
|
+
}), f === Rt.length - 1 ? c("hr", {
|
|
1961
1961
|
class: "m-0 w-full border-b border-b-transparent"
|
|
1962
1962
|
}) : c("hr", {
|
|
1963
1963
|
class: "border-b-neutral-5 m-0 w-full border-b border-solid"
|
|
@@ -1967,18 +1967,18 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1967
1967
|
})
|
|
1968
1968
|
}), c("div", {
|
|
1969
1969
|
class: "bg-neutral-1 sticky bottom-0 flex items-center py-2",
|
|
1970
|
-
children: [n, c(
|
|
1970
|
+
children: [n, c(Be, {
|
|
1971
1971
|
class: "ml-auto"
|
|
1972
1972
|
})]
|
|
1973
1973
|
})]
|
|
1974
1974
|
});
|
|
1975
|
-
},
|
|
1975
|
+
}, Jt = () => {
|
|
1976
1976
|
const e = ye(null);
|
|
1977
|
-
return
|
|
1977
|
+
return Wr(() => {
|
|
1978
1978
|
var r;
|
|
1979
1979
|
(r = e.current) == null || r.focus();
|
|
1980
1980
|
}, []), e;
|
|
1981
|
-
}, cn = ["true", "false"], ma = /* @__PURE__ */ on(cn), ya = "answer", un = "flex items-center flex-wrap gap-2 p-2.5", dn = "min-w-0 max-w-full flex-auto", fn =
|
|
1981
|
+
}, cn = ["true", "false"], ma = /* @__PURE__ */ on(cn), ya = "answer", un = "flex items-center flex-wrap gap-2 p-2.5", dn = "min-w-0 max-w-full flex-auto", fn = zr(({
|
|
1982
1982
|
label: e,
|
|
1983
1983
|
...r
|
|
1984
1984
|
}, t) => c("button", {
|
|
@@ -1993,13 +1993,13 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1993
1993
|
input: e,
|
|
1994
1994
|
onSubmitSuccess: r
|
|
1995
1995
|
}) => {
|
|
1996
|
-
const t =
|
|
1996
|
+
const t = Jt();
|
|
1997
1997
|
return c("form", {
|
|
1998
1998
|
noValidate: !0,
|
|
1999
1999
|
class: "",
|
|
2000
2000
|
onSubmit: (n) => {
|
|
2001
2001
|
n.preventDefault();
|
|
2002
|
-
const s =
|
|
2002
|
+
const s = Wn(n).value, i = sa(ma, s);
|
|
2003
2003
|
r({
|
|
2004
2004
|
type: "boolean",
|
|
2005
2005
|
value: i === "true"
|
|
@@ -2033,7 +2033,7 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2033
2033
|
return t(new Error("Invalid file"));
|
|
2034
2034
|
r(n.result);
|
|
2035
2035
|
}, n.onerror = t, n.readAsDataURL(e);
|
|
2036
|
-
}),
|
|
2036
|
+
}), pr = (e) => e.reduce((r, t) => r + t.sizeKb, 0), va = et("file"), mr = 3, _t = (e) => {
|
|
2037
2037
|
const r = e.lastIndexOf(".");
|
|
2038
2038
|
return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
|
|
2039
2039
|
}, xa = ({
|
|
@@ -2043,9 +2043,9 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2043
2043
|
}) => {
|
|
2044
2044
|
const {
|
|
2045
2045
|
t: n
|
|
2046
|
-
} =
|
|
2046
|
+
} = ne(), [s, i] = _t(e.name);
|
|
2047
2047
|
return c("div", {
|
|
2048
|
-
class:
|
|
2048
|
+
class: Qe("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", r),
|
|
2049
2049
|
...t,
|
|
2050
2050
|
children: [c("p", {
|
|
2051
2051
|
class: "text-accent-12 flex flex-grow overflow-hidden",
|
|
@@ -2063,19 +2063,19 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2063
2063
|
children: [c("span", {
|
|
2064
2064
|
class: "sr-only",
|
|
2065
2065
|
children: [n("file_size"), ": "]
|
|
2066
|
-
}),
|
|
2066
|
+
}), Ge(e.sizeKb)]
|
|
2067
2067
|
})]
|
|
2068
2068
|
});
|
|
2069
|
-
},
|
|
2069
|
+
}, yr = ({
|
|
2070
2070
|
class: e,
|
|
2071
2071
|
...r
|
|
2072
2072
|
}) => c("li", {
|
|
2073
|
-
class:
|
|
2073
|
+
class: Qe("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
|
|
2074
2074
|
...r
|
|
2075
2075
|
}), wa = (e, r) => {
|
|
2076
2076
|
const [t, n] = _t(e);
|
|
2077
2077
|
return `${t.slice(0, r)}${n}`;
|
|
2078
|
-
},
|
|
2078
|
+
}, br = (e) => ({
|
|
2079
2079
|
name: wa(e.name, 42),
|
|
2080
2080
|
sizeKb: e.size / 1e3
|
|
2081
2081
|
}), _a = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], ka = (e, r, t) => {
|
|
@@ -2087,81 +2087,81 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2087
2087
|
analytics: t
|
|
2088
2088
|
}) => {
|
|
2089
2089
|
var k;
|
|
2090
|
-
const n = (k =
|
|
2090
|
+
const n = (k = q.current$.value.flow) == null ? void 0 : k.data.submissions[e.key], [s, i] = _e(va(n) && n.value.length ? {
|
|
2091
2091
|
status: "ready",
|
|
2092
2092
|
files: n.value
|
|
2093
2093
|
} : {
|
|
2094
2094
|
status: "empty"
|
|
2095
|
-
}), a = ye(0), o = s.status === "ready" ? s.files : [], u = s.status === "ready" || s.status === "pending" ? s.files : [], f = s.status === "error" ? s.error : void 0,
|
|
2096
|
-
t:
|
|
2097
|
-
} =
|
|
2098
|
-
if (!
|
|
2095
|
+
}), a = ye(0), o = s.status === "ready" ? s.files : [], u = s.status === "ready" || s.status === "pending" ? s.files : [], f = s.status === "error" ? s.error : void 0, v = u.length - mr, b = pr(u), p = Jt(), {
|
|
2096
|
+
t: y
|
|
2097
|
+
} = ne(), C = (E) => {
|
|
2098
|
+
if (!E.length)
|
|
2099
2099
|
return {
|
|
2100
2100
|
reason: "required",
|
|
2101
2101
|
error: {
|
|
2102
2102
|
type: "required",
|
|
2103
|
-
message:
|
|
2103
|
+
message: y("validation_file")
|
|
2104
2104
|
}
|
|
2105
2105
|
};
|
|
2106
|
-
if (!
|
|
2106
|
+
if (!ir(E, e.config.extensions))
|
|
2107
2107
|
return {
|
|
2108
2108
|
reason: "type",
|
|
2109
|
-
file:
|
|
2109
|
+
file: E.find((g) => !ir([g], e.config.extensions)),
|
|
2110
2110
|
error: {
|
|
2111
2111
|
type: "validate",
|
|
2112
|
-
message:
|
|
2112
|
+
message: y("validation_file_ext", {
|
|
2113
2113
|
ext: e.config.extensions.join(", ")
|
|
2114
2114
|
})
|
|
2115
2115
|
}
|
|
2116
2116
|
};
|
|
2117
|
-
if (
|
|
2117
|
+
if (E.some((g) => g.sizeKb === 0))
|
|
2118
2118
|
return {
|
|
2119
2119
|
reason: "empty",
|
|
2120
|
-
file:
|
|
2120
|
+
file: E.find((g) => g.sizeKb === 0),
|
|
2121
2121
|
error: {
|
|
2122
2122
|
type: "validate",
|
|
2123
|
-
message:
|
|
2123
|
+
message: y("validation_file_empty")
|
|
2124
2124
|
}
|
|
2125
2125
|
};
|
|
2126
|
-
if (e.config.fileSizeLimitKib &&
|
|
2126
|
+
if (e.config.fileSizeLimitKib && pr(E) > e.config.fileSizeLimitKib)
|
|
2127
2127
|
return {
|
|
2128
2128
|
reason: "size",
|
|
2129
2129
|
error: {
|
|
2130
2130
|
type: "max",
|
|
2131
|
-
message:
|
|
2132
|
-
size:
|
|
2131
|
+
message: y("validation_file_size", {
|
|
2132
|
+
size: Ge(e.config.fileSizeLimitKib)
|
|
2133
2133
|
})
|
|
2134
2134
|
}
|
|
2135
2135
|
};
|
|
2136
|
-
if (!e.config.allowMultiple &&
|
|
2136
|
+
if (!e.config.allowMultiple && E.length > 1)
|
|
2137
2137
|
return {
|
|
2138
2138
|
reason: "count",
|
|
2139
2139
|
error: {
|
|
2140
2140
|
type: "invalid",
|
|
2141
|
-
message:
|
|
2141
|
+
message: y("validation_file_max", {
|
|
2142
2142
|
count: 1
|
|
2143
2143
|
})
|
|
2144
2144
|
}
|
|
2145
2145
|
};
|
|
2146
|
-
},
|
|
2147
|
-
var
|
|
2146
|
+
}, _ = (E, g) => {
|
|
2147
|
+
var N, V;
|
|
2148
2148
|
return t.log({
|
|
2149
2149
|
event: "INTERACTION",
|
|
2150
2150
|
properties: {
|
|
2151
|
-
tag: ka(
|
|
2151
|
+
tag: ka(E, g, e.config.extensions)
|
|
2152
2152
|
},
|
|
2153
|
-
customProperties: (
|
|
2153
|
+
customProperties: (V = (N = q.current$.peek().flow) == null ? void 0 : N.analytics) == null ? void 0 : V.customProperties
|
|
2154
2154
|
});
|
|
2155
2155
|
};
|
|
2156
2156
|
return c("form", {
|
|
2157
2157
|
class: "flex flex-col gap-1 p-2.5",
|
|
2158
|
-
onSubmit: (
|
|
2159
|
-
if (
|
|
2158
|
+
onSubmit: (E) => {
|
|
2159
|
+
if (E.preventDefault(), s.status === "pending" || s.status === "error")
|
|
2160
2160
|
return;
|
|
2161
|
-
const
|
|
2162
|
-
|
|
2161
|
+
const g = C(o);
|
|
2162
|
+
g ? i({
|
|
2163
2163
|
status: "error",
|
|
2164
|
-
error:
|
|
2164
|
+
error: g.error
|
|
2165
2165
|
}) : r({
|
|
2166
2166
|
type: "file",
|
|
2167
2167
|
value: o
|
|
@@ -2175,20 +2175,20 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2175
2175
|
class: "border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",
|
|
2176
2176
|
children: [u.length > 0 ? c("ul", {
|
|
2177
2177
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2178
|
-
children: [u.slice(0,
|
|
2179
|
-
const [
|
|
2180
|
-
return c(
|
|
2178
|
+
children: [u.slice(0, mr).map((E) => {
|
|
2179
|
+
const [g, N] = _t(E.name);
|
|
2180
|
+
return c(yr, {
|
|
2181
2181
|
class: "flex overflow-hidden",
|
|
2182
2182
|
children: [c("span", {
|
|
2183
2183
|
class: "block truncate",
|
|
2184
|
-
children:
|
|
2184
|
+
children: g
|
|
2185
2185
|
}), c("span", {
|
|
2186
|
-
children:
|
|
2186
|
+
children: N
|
|
2187
2187
|
})]
|
|
2188
2188
|
});
|
|
2189
|
-
}),
|
|
2190
|
-
children:
|
|
2191
|
-
count:
|
|
2189
|
+
}), v > 0 ? c(yr, {
|
|
2190
|
+
children: y("file_more", {
|
|
2191
|
+
count: v
|
|
2192
2192
|
})
|
|
2193
2193
|
}) : null]
|
|
2194
2194
|
}) : c("div", {
|
|
@@ -2210,13 +2210,13 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2210
2210
|
})
|
|
2211
2211
|
}), c("p", {
|
|
2212
2212
|
class: "text-neutral-12 tracking-[-0.01em]",
|
|
2213
|
-
children:
|
|
2213
|
+
children: y("upload_file", {
|
|
2214
2214
|
count: e.config.allowMultiple ? 2 : 1
|
|
2215
2215
|
})
|
|
2216
2216
|
}), e.config.fileSizeLimitKib ? c("p", {
|
|
2217
2217
|
class: "text-neutral-11 text-xs",
|
|
2218
|
-
children: ["(",
|
|
2219
|
-
size:
|
|
2218
|
+
children: ["(", y("file_max_size", {
|
|
2219
|
+
size: Ge(e.config.fileSizeLimitKib)
|
|
2220
2220
|
}), ")"]
|
|
2221
2221
|
}) : null]
|
|
2222
2222
|
}), c("aside", {
|
|
@@ -2224,82 +2224,82 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2224
2224
|
children: [c("p", {
|
|
2225
2225
|
id: "accepted-filetypes",
|
|
2226
2226
|
class: "sr-only",
|
|
2227
|
-
children:
|
|
2227
|
+
children: y("file_extensions")
|
|
2228
2228
|
}), c("ul", {
|
|
2229
2229
|
"aria-describedby": "accepted-filetypes",
|
|
2230
2230
|
class: "flex flex-wrap justify-center gap-2",
|
|
2231
|
-
children: e.config.extensions.map((
|
|
2231
|
+
children: e.config.extensions.map((E) => c("li", {
|
|
2232
2232
|
class: "ring-lowest outline-neutral-6 text-neutral-11 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",
|
|
2233
|
-
children:
|
|
2233
|
+
children: E.replace(".", "")
|
|
2234
2234
|
}))
|
|
2235
2235
|
})]
|
|
2236
2236
|
})]
|
|
2237
2237
|
}), c("p", {
|
|
2238
2238
|
role: "status",
|
|
2239
|
-
class:
|
|
2240
|
-
children: s.status === "pending" ? c(
|
|
2241
|
-
children: [c(
|
|
2239
|
+
class: Qe("text-neutral-11 flex items-center gap-1.5 text-xs", u.length === 0 && "sr-only"),
|
|
2240
|
+
children: s.status === "pending" ? c(Ce, {
|
|
2241
|
+
children: [c(Ut, {
|
|
2242
2242
|
"aria-hidden": "true",
|
|
2243
2243
|
class: "h-4 w-4"
|
|
2244
|
-
}),
|
|
2244
|
+
}), y("file_preparing", {
|
|
2245
2245
|
count: u.length
|
|
2246
2246
|
})]
|
|
2247
|
-
}) : s.status === "ready" ? c(
|
|
2248
|
-
children: [o.length > 1 ?
|
|
2249
|
-
size:
|
|
2250
|
-
}) :
|
|
2247
|
+
}) : s.status === "ready" ? c(Ce, {
|
|
2248
|
+
children: [o.length > 1 ? y("file_total_size", {
|
|
2249
|
+
size: Ge(b)
|
|
2250
|
+
}) : Ge(b), c("span", {
|
|
2251
2251
|
class: "sr-only",
|
|
2252
|
-
children: [". ",
|
|
2252
|
+
children: [". ", y("file_ready", {
|
|
2253
2253
|
count: o.length
|
|
2254
2254
|
})]
|
|
2255
2255
|
})]
|
|
2256
2256
|
}) : null
|
|
2257
2257
|
}), c("input", {
|
|
2258
2258
|
id: "dropzone-file",
|
|
2259
|
-
"aria-label":
|
|
2259
|
+
"aria-label": y("upload_file", {
|
|
2260
2260
|
count: e.config.allowMultiple ? 2 : 1
|
|
2261
2261
|
}),
|
|
2262
|
-
onInput: async (
|
|
2263
|
-
|
|
2264
|
-
const
|
|
2265
|
-
|
|
2266
|
-
const [
|
|
2267
|
-
if (!
|
|
2262
|
+
onInput: async (E) => {
|
|
2263
|
+
Oe(E.target instanceof HTMLInputElement);
|
|
2264
|
+
const g = E.target.files ? Array.from(E.target.files) : [];
|
|
2265
|
+
E.target.value = "";
|
|
2266
|
+
const [N] = g;
|
|
2267
|
+
if (!N)
|
|
2268
2268
|
return;
|
|
2269
|
-
const
|
|
2270
|
-
if (
|
|
2271
|
-
return
|
|
2269
|
+
const V = ++a.current, M = s.status === "ready", O = g.map(br), K = C(O);
|
|
2270
|
+
if (K)
|
|
2271
|
+
return _(K.reason, K.file ?? N), i({
|
|
2272
2272
|
status: "error",
|
|
2273
|
-
error:
|
|
2273
|
+
error: K.error
|
|
2274
2274
|
});
|
|
2275
2275
|
i({
|
|
2276
2276
|
status: "pending",
|
|
2277
2277
|
files: O
|
|
2278
2278
|
});
|
|
2279
|
-
let
|
|
2279
|
+
let ee;
|
|
2280
2280
|
try {
|
|
2281
|
-
const
|
|
2281
|
+
const T = await Promise.all(g.map(async (R) => {
|
|
2282
2282
|
try {
|
|
2283
2283
|
return {
|
|
2284
|
-
...
|
|
2285
|
-
data: await ga(
|
|
2284
|
+
...br(R),
|
|
2285
|
+
data: await ga(R)
|
|
2286
2286
|
};
|
|
2287
|
-
} catch (
|
|
2288
|
-
throw
|
|
2287
|
+
} catch (B) {
|
|
2288
|
+
throw ee ?? (ee = R), B;
|
|
2289
2289
|
}
|
|
2290
2290
|
}));
|
|
2291
|
-
a.current ===
|
|
2291
|
+
a.current === V && i({
|
|
2292
2292
|
status: "ready",
|
|
2293
|
-
files:
|
|
2293
|
+
files: T
|
|
2294
2294
|
});
|
|
2295
2295
|
} catch {
|
|
2296
|
-
if (a.current !==
|
|
2296
|
+
if (a.current !== V)
|
|
2297
2297
|
return;
|
|
2298
|
-
|
|
2298
|
+
_("unreadable", ee ?? N), i({
|
|
2299
2299
|
status: "error",
|
|
2300
2300
|
error: {
|
|
2301
2301
|
type: "invalid",
|
|
2302
|
-
message:
|
|
2302
|
+
message: y(M ? "file_read_error_replacement" : "file_read_error")
|
|
2303
2303
|
}
|
|
2304
2304
|
});
|
|
2305
2305
|
}
|
|
@@ -2311,59 +2311,59 @@ const Ge = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2311
2311
|
})]
|
|
2312
2312
|
}), c("div", {
|
|
2313
2313
|
class: "flex h-full flex-col items-center gap-2",
|
|
2314
|
-
children: [c(
|
|
2314
|
+
children: [c(Be, {
|
|
2315
2315
|
disabled: o.length === 0
|
|
2316
2316
|
}), e.config.optional && c(Le, {
|
|
2317
2317
|
class: "relative",
|
|
2318
2318
|
onClick: () => r(null)
|
|
2319
2319
|
})]
|
|
2320
2320
|
})]
|
|
2321
|
-
}), c(
|
|
2321
|
+
}), c(tt, {
|
|
2322
2322
|
error: f
|
|
2323
2323
|
})]
|
|
2324
2324
|
});
|
|
2325
2325
|
};
|
|
2326
|
-
var ft = (e) => e.type === "checkbox",
|
|
2326
|
+
var ft = (e) => e.type === "checkbox", De = (e) => e instanceof Date, oe = (e) => e == null;
|
|
2327
2327
|
const hn = (e) => typeof e == "object";
|
|
2328
|
-
var
|
|
2328
|
+
var Z = (e) => !oe(e) && !Array.isArray(e) && hn(e) && !De(e), Sa = (e) => Z(e) && e.target ? ft(e.target) ? e.target.checked : e.target.value : e, Ea = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Aa = (e, r) => e.has(Ea(r)), Ia = (e) => {
|
|
2329
2329
|
const r = e.constructor && e.constructor.prototype;
|
|
2330
|
-
return
|
|
2331
|
-
},
|
|
2330
|
+
return Z(r) && r.hasOwnProperty("isPrototypeOf");
|
|
2331
|
+
}, Zt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
2332
2332
|
function Q(e) {
|
|
2333
2333
|
if (e instanceof Date)
|
|
2334
2334
|
return new Date(e);
|
|
2335
2335
|
const r = typeof FileList < "u" && e instanceof FileList;
|
|
2336
|
-
if (
|
|
2336
|
+
if (Zt && (e instanceof Blob || r))
|
|
2337
2337
|
return e;
|
|
2338
2338
|
const t = Array.isArray(e);
|
|
2339
|
-
if (!t && !(
|
|
2339
|
+
if (!t && !(Z(e) && Ia(e)))
|
|
2340
2340
|
return e;
|
|
2341
2341
|
const n = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
2342
2342
|
for (const s in e)
|
|
2343
2343
|
Object.prototype.hasOwnProperty.call(e, s) && (n[s] = Q(e[s]));
|
|
2344
2344
|
return n;
|
|
2345
2345
|
}
|
|
2346
|
-
var kt = (e) => /^\w*$/.test(e),
|
|
2347
|
-
if (!r || !
|
|
2346
|
+
var kt = (e) => /^\w*$/.test(e), G = (e) => e === void 0, Xt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Yt = (e) => Xt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
|
|
2347
|
+
if (!r || !Z(e))
|
|
2348
2348
|
return t;
|
|
2349
|
-
const n = (kt(r) ? [r] :
|
|
2350
|
-
return
|
|
2351
|
-
}, me = (e) => typeof e == "boolean", de = (e) => typeof e == "function",
|
|
2349
|
+
const n = (kt(r) ? [r] : Yt(r)).reduce((s, i) => oe(s) ? s : s[i], e);
|
|
2350
|
+
return G(n) || n === e ? G(e[r]) ? t : e[r] : n;
|
|
2351
|
+
}, me = (e) => typeof e == "boolean", de = (e) => typeof e == "function", z = (e, r, t) => {
|
|
2352
2352
|
let n = -1;
|
|
2353
|
-
const s = kt(r) ? [r] :
|
|
2353
|
+
const s = kt(r) ? [r] : Yt(r), i = s.length, a = i - 1;
|
|
2354
2354
|
for (; ++n < i; ) {
|
|
2355
2355
|
const o = s[n];
|
|
2356
2356
|
let u = t;
|
|
2357
2357
|
if (n !== a) {
|
|
2358
2358
|
const f = e[o];
|
|
2359
|
-
u =
|
|
2359
|
+
u = Z(f) || Array.isArray(f) ? f : isNaN(+s[n + 1]) ? {} : [];
|
|
2360
2360
|
}
|
|
2361
2361
|
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
2362
2362
|
return;
|
|
2363
2363
|
e[o] = u, e = e[o];
|
|
2364
2364
|
}
|
|
2365
2365
|
};
|
|
2366
|
-
const
|
|
2366
|
+
const gr = {
|
|
2367
2367
|
BLUR: "blur",
|
|
2368
2368
|
FOCUS_OUT: "focusout",
|
|
2369
2369
|
CHANGE: "change"
|
|
@@ -2373,7 +2373,7 @@ const br = {
|
|
|
2373
2373
|
onSubmit: "onSubmit",
|
|
2374
2374
|
onTouched: "onTouched",
|
|
2375
2375
|
all: "all"
|
|
2376
|
-
},
|
|
2376
|
+
}, we = {
|
|
2377
2377
|
max: "max",
|
|
2378
2378
|
min: "min",
|
|
2379
2379
|
maxLength: "maxLength",
|
|
@@ -2381,7 +2381,7 @@ const br = {
|
|
|
2381
2381
|
pattern: "pattern",
|
|
2382
2382
|
required: "required",
|
|
2383
2383
|
validate: "validate"
|
|
2384
|
-
}, Fa =
|
|
2384
|
+
}, Fa = ae.createContext(null);
|
|
2385
2385
|
Fa.displayName = "HookFormControlContext";
|
|
2386
2386
|
var Va = (e, r, t, n = !0) => {
|
|
2387
2387
|
const s = {
|
|
@@ -2396,12 +2396,12 @@ var Va = (e, r, t, n = !0) => {
|
|
|
2396
2396
|
});
|
|
2397
2397
|
return s;
|
|
2398
2398
|
};
|
|
2399
|
-
const Ma = typeof window < "u" ?
|
|
2400
|
-
var
|
|
2399
|
+
const Ma = typeof window < "u" ? ae.useLayoutEffect : ae.useEffect;
|
|
2400
|
+
var ue = (e) => typeof e == "string", La = (e, r, t, n, s) => ue(e) ? (n && r.watch.add(e), S(t, e, s)) : Array.isArray(e) ? e.map((i) => (n && r.watch.add(i), S(t, i))) : (n && (r.watchAll = !0), t), Pt = (e) => oe(e) || !hn(e);
|
|
2401
2401
|
function Fe(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
2402
|
-
if (
|
|
2402
|
+
if (Pt(e) || Pt(r))
|
|
2403
2403
|
return Object.is(e, r);
|
|
2404
|
-
if (
|
|
2404
|
+
if (De(e) && De(r))
|
|
2405
2405
|
return Object.is(e.getTime(), r.getTime());
|
|
2406
2406
|
const n = Object.keys(e), s = Object.keys(r);
|
|
2407
2407
|
if (n.length !== s.length)
|
|
@@ -2415,21 +2415,21 @@ function Fe(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
|
2415
2415
|
return !1;
|
|
2416
2416
|
if (i !== "ref") {
|
|
2417
2417
|
const o = r[i];
|
|
2418
|
-
if (
|
|
2418
|
+
if (De(a) && De(o) || Z(a) && Z(o) || Array.isArray(a) && Array.isArray(o) ? !Fe(a, o, t) : !Object.is(a, o))
|
|
2419
2419
|
return !1;
|
|
2420
2420
|
}
|
|
2421
2421
|
}
|
|
2422
2422
|
return !0;
|
|
2423
2423
|
}
|
|
2424
|
-
const
|
|
2425
|
-
|
|
2424
|
+
const Na = ae.createContext(null);
|
|
2425
|
+
Na.displayName = "HookFormContext";
|
|
2426
2426
|
var pn = (e, r, t, n, s) => r ? {
|
|
2427
2427
|
...t[e],
|
|
2428
2428
|
types: {
|
|
2429
2429
|
...t[e] && t[e].types ? t[e].types : {},
|
|
2430
2430
|
[n]: s || !0
|
|
2431
2431
|
}
|
|
2432
|
-
} : {}, ut = (e) => Array.isArray(e) ? e : [e],
|
|
2432
|
+
} : {}, ut = (e) => Array.isArray(e) ? e : [e], vr = () => {
|
|
2433
2433
|
let e = [];
|
|
2434
2434
|
return {
|
|
2435
2435
|
get observers() {
|
|
@@ -2454,36 +2454,36 @@ function mn(e, r) {
|
|
|
2454
2454
|
for (const n in e)
|
|
2455
2455
|
if (e.hasOwnProperty(n)) {
|
|
2456
2456
|
const s = e[n], i = r[n];
|
|
2457
|
-
if (s &&
|
|
2457
|
+
if (s && Z(s) && i) {
|
|
2458
2458
|
const a = mn(s, i);
|
|
2459
|
-
|
|
2459
|
+
Z(a) && (t[n] = a);
|
|
2460
2460
|
} else
|
|
2461
2461
|
e[n] && (t[n] = i);
|
|
2462
2462
|
}
|
|
2463
2463
|
return t;
|
|
2464
2464
|
}
|
|
2465
|
-
var
|
|
2466
|
-
if (!
|
|
2465
|
+
var ie = (e) => Z(e) && !Object.keys(e).length, Qt = (e) => e.type === "file", bt = (e) => {
|
|
2466
|
+
if (!Zt)
|
|
2467
2467
|
return !1;
|
|
2468
2468
|
const r = e ? e.ownerDocument : 0;
|
|
2469
2469
|
return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
|
|
2470
|
-
}, yn = (e) => e.type === "select-multiple",
|
|
2470
|
+
}, yn = (e) => e.type === "select-multiple", er = (e) => e.type === "radio", Ra = (e) => er(e) || ft(e), Tt = (e) => bt(e) && e.isConnected;
|
|
2471
2471
|
function Ta(e, r) {
|
|
2472
2472
|
const t = r.slice(0, -1).length;
|
|
2473
2473
|
let n = 0;
|
|
2474
2474
|
for (; n < t; )
|
|
2475
|
-
e =
|
|
2475
|
+
e = G(e) ? n++ : e[r[n++]];
|
|
2476
2476
|
return e;
|
|
2477
2477
|
}
|
|
2478
|
-
function
|
|
2478
|
+
function Da(e) {
|
|
2479
2479
|
for (const r in e)
|
|
2480
|
-
if (e.hasOwnProperty(r) && !
|
|
2480
|
+
if (e.hasOwnProperty(r) && !G(e[r]))
|
|
2481
2481
|
return !1;
|
|
2482
2482
|
return !0;
|
|
2483
2483
|
}
|
|
2484
|
-
function
|
|
2485
|
-
const t = Array.isArray(r) ? r : kt(r) ? [r] :
|
|
2486
|
-
return n && delete n[i], s !== 0 && (
|
|
2484
|
+
function J(e, r) {
|
|
2485
|
+
const t = Array.isArray(r) ? r : kt(r) ? [r] : Yt(r), n = t.length === 1 ? e : Ta(e, t), s = t.length - 1, i = t[s];
|
|
2486
|
+
return n && delete n[i], s !== 0 && (Z(n) && ie(n) || Array.isArray(n) && Da(n)) && J(e, t.slice(0, -1)), e;
|
|
2487
2487
|
}
|
|
2488
2488
|
var Oa = (e) => {
|
|
2489
2489
|
for (const r in e)
|
|
@@ -2492,21 +2492,21 @@ var Oa = (e) => {
|
|
|
2492
2492
|
return !1;
|
|
2493
2493
|
};
|
|
2494
2494
|
function bn(e) {
|
|
2495
|
-
return Array.isArray(e) ||
|
|
2495
|
+
return Array.isArray(e) || Z(e) && !Oa(e);
|
|
2496
2496
|
}
|
|
2497
|
-
function
|
|
2497
|
+
function qt(e, r = {}) {
|
|
2498
2498
|
for (const t in e) {
|
|
2499
2499
|
const n = e[t];
|
|
2500
|
-
bn(n) ? (r[t] = Array.isArray(n) ? [] : {},
|
|
2500
|
+
bn(n) ? (r[t] = Array.isArray(n) ? [] : {}, qt(n, r[t])) : G(n) || (r[t] = !0);
|
|
2501
2501
|
}
|
|
2502
2502
|
return r;
|
|
2503
2503
|
}
|
|
2504
|
-
function
|
|
2505
|
-
t || (t =
|
|
2504
|
+
function Ke(e, r, t) {
|
|
2505
|
+
t || (t = qt(r));
|
|
2506
2506
|
for (const n in e) {
|
|
2507
2507
|
const s = e[n];
|
|
2508
2508
|
if (bn(s))
|
|
2509
|
-
|
|
2509
|
+
G(r) || Pt(t[n]) ? t[n] = qt(s, Array.isArray(s) ? [] : {}) : Ke(s, oe(r) ? {} : r[n], t[n]);
|
|
2510
2510
|
else {
|
|
2511
2511
|
const i = r[n];
|
|
2512
2512
|
t[n] = !Fe(s, i);
|
|
@@ -2514,10 +2514,10 @@ function Ue(e, r, t) {
|
|
|
2514
2514
|
}
|
|
2515
2515
|
return t;
|
|
2516
2516
|
}
|
|
2517
|
-
const
|
|
2517
|
+
const xr = {
|
|
2518
2518
|
value: !1,
|
|
2519
2519
|
isValid: !1
|
|
2520
|
-
},
|
|
2520
|
+
}, wr = { value: !0, isValid: !0 };
|
|
2521
2521
|
var gn = (e) => {
|
|
2522
2522
|
if (Array.isArray(e)) {
|
|
2523
2523
|
if (e.length > 1) {
|
|
@@ -2526,28 +2526,28 @@ var gn = (e) => {
|
|
|
2526
2526
|
}
|
|
2527
2527
|
return e[0].checked && !e[0].disabled ? (
|
|
2528
2528
|
// @ts-expect-error expected to work in the browser
|
|
2529
|
-
e[0].attributes && !
|
|
2530
|
-
) :
|
|
2529
|
+
e[0].attributes && !G(e[0].attributes.value) ? G(e[0].value) || e[0].value === "" ? wr : { value: e[0].value, isValid: !0 } : wr
|
|
2530
|
+
) : xr;
|
|
2531
2531
|
}
|
|
2532
|
-
return
|
|
2533
|
-
}, vn = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) =>
|
|
2534
|
-
const
|
|
2532
|
+
return xr;
|
|
2533
|
+
}, vn = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) => G(e) ? e : r ? e === "" ? NaN : e && +e : t && ue(e) ? new Date(e) : n ? n(e) : e;
|
|
2534
|
+
const _r = {
|
|
2535
2535
|
isValid: !1,
|
|
2536
2536
|
value: null
|
|
2537
2537
|
};
|
|
2538
2538
|
var xn = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disabled ? {
|
|
2539
2539
|
isValid: !0,
|
|
2540
2540
|
value: t.value
|
|
2541
|
-
} : r,
|
|
2542
|
-
function
|
|
2541
|
+
} : r, _r) : _r;
|
|
2542
|
+
function kr(e) {
|
|
2543
2543
|
const r = e.ref;
|
|
2544
|
-
return
|
|
2544
|
+
return Qt(r) ? r.files : er(r) ? xn(e.refs).value : yn(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ft(r) ? gn(e.refs).value : vn(G(r.value) ? e.ref.value : r.value, e);
|
|
2545
2545
|
}
|
|
2546
2546
|
var Ba = (e, r, t, n) => {
|
|
2547
2547
|
const s = {};
|
|
2548
2548
|
for (const i of e) {
|
|
2549
2549
|
const a = S(r, i);
|
|
2550
|
-
a &&
|
|
2550
|
+
a && z(s, i, a._f);
|
|
2551
2551
|
}
|
|
2552
2552
|
return {
|
|
2553
2553
|
criteriaMode: t,
|
|
@@ -2555,15 +2555,15 @@ var Ba = (e, r, t, n) => {
|
|
|
2555
2555
|
fields: s,
|
|
2556
2556
|
shouldUseNativeValidation: n
|
|
2557
2557
|
};
|
|
2558
|
-
}, gt = (e) => e instanceof RegExp, it = (e) =>
|
|
2558
|
+
}, gt = (e) => e instanceof RegExp, it = (e) => G(e) ? e : gt(e) ? e.source : Z(e) ? gt(e.value) ? e.value.source : e.value : e, Cr = (e) => ({
|
|
2559
2559
|
isOnSubmit: !e || e === fe.onSubmit,
|
|
2560
2560
|
isOnBlur: e === fe.onBlur,
|
|
2561
2561
|
isOnChange: e === fe.onChange,
|
|
2562
2562
|
isOnAll: e === fe.all,
|
|
2563
2563
|
isOnTouch: e === fe.onTouched
|
|
2564
2564
|
});
|
|
2565
|
-
const
|
|
2566
|
-
var $a = (e) => !!e && !!e.validate && !!(de(e.validate) && e.validate.constructor.name ===
|
|
2565
|
+
const Sr = "AsyncFunction";
|
|
2566
|
+
var $a = (e) => !!e && !!e.validate && !!(de(e.validate) && e.validate.constructor.name === Sr || Z(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === Sr)), ja = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Er = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
|
|
2567
2567
|
const dt = (e, r, t, n) => {
|
|
2568
2568
|
for (const s of t || Object.keys(e)) {
|
|
2569
2569
|
const i = S(e, s);
|
|
@@ -2576,7 +2576,7 @@ const dt = (e, r, t, n) => {
|
|
|
2576
2576
|
return !0;
|
|
2577
2577
|
if (dt(o, r))
|
|
2578
2578
|
break;
|
|
2579
|
-
} else if (
|
|
2579
|
+
} else if (Z(o) && dt(o, r))
|
|
2580
2580
|
break;
|
|
2581
2581
|
}
|
|
2582
2582
|
}
|
|
@@ -2612,111 +2612,111 @@ function Ar(e, r, t) {
|
|
|
2612
2612
|
var Pa = (e, r, t, n) => {
|
|
2613
2613
|
t(e);
|
|
2614
2614
|
const { name: s, ...i } = e;
|
|
2615
|
-
return
|
|
2616
|
-
}, qa = (e, r, t) => !e || !r || e === r || ut(e).some((n) => n && (t ? n === r : n.startsWith(r) || r.startsWith(n))), Ua = (e, r, t, n, s) => s.isOnAll ? !1 : !t && s.isOnTouch ? !(r || e) : (t ? n.isOnBlur : s.isOnBlur) ? !e : (t ? n.isOnChange : s.isOnChange) ? e : !0,
|
|
2615
|
+
return ie(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((a) => r[a] === (!n || fe.all));
|
|
2616
|
+
}, qa = (e, r, t) => !e || !r || e === r || ut(e).some((n) => n && (t ? n === r : n.startsWith(r) || r.startsWith(n))), Ua = (e, r, t, n, s) => s.isOnAll ? !1 : !t && s.isOnTouch ? !(r || e) : (t ? n.isOnBlur : s.isOnBlur) ? !e : (t ? n.isOnChange : s.isOnChange) ? e : !0, Wa = (e, r) => !Xt(S(e, r)).length && J(e, r), za = (e, r, t) => {
|
|
2617
2617
|
const n = ut(S(e, t));
|
|
2618
|
-
return
|
|
2618
|
+
return z(n, "root", r[t]), z(e, t, n), e;
|
|
2619
2619
|
};
|
|
2620
2620
|
function Ir(e, r, t = "validate") {
|
|
2621
|
-
if (
|
|
2621
|
+
if (ue(e) || Array.isArray(e) && e.every(ue) || me(e) && !e)
|
|
2622
2622
|
return {
|
|
2623
2623
|
type: t,
|
|
2624
|
-
message:
|
|
2624
|
+
message: ue(e) ? e : "",
|
|
2625
2625
|
ref: r
|
|
2626
2626
|
};
|
|
2627
2627
|
}
|
|
2628
|
-
var
|
|
2628
|
+
var He = (e) => Z(e) && !gt(e) ? e : {
|
|
2629
2629
|
value: e,
|
|
2630
2630
|
message: ""
|
|
2631
|
-
},
|
|
2632
|
-
const { ref: a, refs: o, required: u, maxLength: f, minLength:
|
|
2633
|
-
if (!
|
|
2631
|
+
}, Fr = async (e, r, t, n, s, i) => {
|
|
2632
|
+
const { ref: a, refs: o, required: u, maxLength: f, minLength: v, min: b, max: p, pattern: y, validate: C, name: _, valueAsNumber: k, mount: E } = e._f, g = S(t, _);
|
|
2633
|
+
if (!E || r.has(_))
|
|
2634
2634
|
return {};
|
|
2635
|
-
const
|
|
2636
|
-
s &&
|
|
2637
|
-
},
|
|
2638
|
-
const
|
|
2639
|
-
|
|
2640
|
-
type: I ?
|
|
2641
|
-
message:
|
|
2635
|
+
const N = o ? o[0] : a, V = (I) => {
|
|
2636
|
+
s && N.reportValidity && (N.setCustomValidity(me(I) ? "" : I || ""), N.reportValidity());
|
|
2637
|
+
}, M = {}, O = er(a), K = ft(a), ee = O || K, T = (k || Qt(a)) && G(a.value) && G(g) || bt(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, R = pn.bind(null, _, n, M), B = (I, F, j, L = we.maxLength, W = we.minLength) => {
|
|
2638
|
+
const U = I ? F : j;
|
|
2639
|
+
M[_] = {
|
|
2640
|
+
type: I ? L : W,
|
|
2641
|
+
message: U,
|
|
2642
2642
|
ref: a,
|
|
2643
|
-
...
|
|
2643
|
+
...R(I ? L : W, U)
|
|
2644
2644
|
};
|
|
2645
2645
|
};
|
|
2646
|
-
if (i ? !Array.isArray(
|
|
2647
|
-
const { value: I, message:
|
|
2648
|
-
if (I && (
|
|
2649
|
-
type:
|
|
2650
|
-
message:
|
|
2651
|
-
ref:
|
|
2652
|
-
...
|
|
2646
|
+
if (i ? !Array.isArray(g) || !g.length : u && (!ee && (T || oe(g)) || me(g) && !g || K && !gn(o).isValid || O && !xn(o).isValid)) {
|
|
2647
|
+
const { value: I, message: F } = ue(u) ? { value: !!u, message: u } : He(u);
|
|
2648
|
+
if (I && (M[_] = {
|
|
2649
|
+
type: we.required,
|
|
2650
|
+
message: F,
|
|
2651
|
+
ref: N,
|
|
2652
|
+
...R(we.required, F)
|
|
2653
2653
|
}, !n))
|
|
2654
|
-
return F
|
|
2654
|
+
return V(F), M;
|
|
2655
2655
|
}
|
|
2656
|
-
if (!
|
|
2657
|
-
let I,
|
|
2658
|
-
const
|
|
2659
|
-
if (!
|
|
2660
|
-
const W = a.valueAsNumber ||
|
|
2661
|
-
|
|
2656
|
+
if (!T && (!oe(b) || !oe(p))) {
|
|
2657
|
+
let I, F;
|
|
2658
|
+
const j = He(p), L = He(b);
|
|
2659
|
+
if (!oe(g) && !isNaN(g)) {
|
|
2660
|
+
const W = a.valueAsNumber || g && +g;
|
|
2661
|
+
oe(j.value) || (I = W > j.value), oe(L.value) || (F = W < L.value);
|
|
2662
2662
|
} else {
|
|
2663
|
-
const W = a.valueAsDate || new Date(
|
|
2664
|
-
|
|
2663
|
+
const W = a.valueAsDate || new Date(g), U = (H) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + H), te = a.type == "time", X = a.type == "week";
|
|
2664
|
+
ue(j.value) && g && (I = te ? U(g) > U(j.value) : X ? g > j.value : W > new Date(j.value)), ue(L.value) && g && (F = te ? U(g) < U(L.value) : X ? g < L.value : W < new Date(L.value));
|
|
2665
2665
|
}
|
|
2666
|
-
if ((I ||
|
|
2667
|
-
return
|
|
2666
|
+
if ((I || F) && (B(!!I, j.message, L.message, we.max, we.min), !n))
|
|
2667
|
+
return V(M[_].message), M;
|
|
2668
2668
|
}
|
|
2669
|
-
if ((f ||
|
|
2670
|
-
const I =
|
|
2671
|
-
if ((
|
|
2672
|
-
return
|
|
2669
|
+
if ((f || v) && !T && (ue(g) || i && Array.isArray(g))) {
|
|
2670
|
+
const I = He(f), F = He(v), j = !oe(I.value) && g.length > +I.value, L = !oe(F.value) && g.length < +F.value;
|
|
2671
|
+
if ((j || L) && (B(j, I.message, F.message), !n))
|
|
2672
|
+
return V(M[_].message), M;
|
|
2673
2673
|
}
|
|
2674
|
-
if (
|
|
2675
|
-
const { value: I, message:
|
|
2676
|
-
if (gt(I) && !
|
|
2677
|
-
type:
|
|
2678
|
-
message:
|
|
2674
|
+
if (y && !T && ue(g)) {
|
|
2675
|
+
const { value: I, message: F } = He(y);
|
|
2676
|
+
if (gt(I) && !g.match(I) && (M[_] = {
|
|
2677
|
+
type: we.pattern,
|
|
2678
|
+
message: F,
|
|
2679
2679
|
ref: a,
|
|
2680
|
-
...
|
|
2680
|
+
...R(we.pattern, F)
|
|
2681
2681
|
}, !n))
|
|
2682
|
-
return F
|
|
2682
|
+
return V(F), M;
|
|
2683
2683
|
}
|
|
2684
|
-
if (
|
|
2685
|
-
if (de(
|
|
2686
|
-
const I = await
|
|
2687
|
-
if (
|
|
2688
|
-
...
|
|
2689
|
-
...
|
|
2684
|
+
if (C) {
|
|
2685
|
+
if (de(C)) {
|
|
2686
|
+
const I = await C(g, t), F = Ir(I, N);
|
|
2687
|
+
if (F && (M[_] = {
|
|
2688
|
+
...F,
|
|
2689
|
+
...R(we.validate, F.message)
|
|
2690
2690
|
}, !n))
|
|
2691
|
-
return F
|
|
2692
|
-
} else if (
|
|
2691
|
+
return V(F.message), M;
|
|
2692
|
+
} else if (Z(C)) {
|
|
2693
2693
|
let I = {};
|
|
2694
|
-
for (const
|
|
2695
|
-
if (!
|
|
2694
|
+
for (const F in C) {
|
|
2695
|
+
if (!ie(I) && !n)
|
|
2696
2696
|
break;
|
|
2697
|
-
const
|
|
2698
|
-
|
|
2699
|
-
...
|
|
2700
|
-
...
|
|
2701
|
-
},
|
|
2697
|
+
const j = Ir(await C[F](g, t), N, F);
|
|
2698
|
+
j && (I = {
|
|
2699
|
+
...j,
|
|
2700
|
+
...R(F, j.message)
|
|
2701
|
+
}, V(j.message), n && (M[_] = I));
|
|
2702
2702
|
}
|
|
2703
|
-
if (!
|
|
2704
|
-
ref:
|
|
2703
|
+
if (!ie(I) && (M[_] = {
|
|
2704
|
+
ref: N,
|
|
2705
2705
|
...I
|
|
2706
2706
|
}, !n))
|
|
2707
|
-
return
|
|
2707
|
+
return M;
|
|
2708
2708
|
}
|
|
2709
2709
|
}
|
|
2710
|
-
return
|
|
2710
|
+
return V(!0), M;
|
|
2711
2711
|
};
|
|
2712
|
-
const
|
|
2712
|
+
const Ha = {
|
|
2713
2713
|
mode: fe.onSubmit,
|
|
2714
2714
|
reValidateMode: fe.onChange,
|
|
2715
2715
|
shouldFocusError: !0
|
|
2716
2716
|
};
|
|
2717
2717
|
function Ka(e = {}) {
|
|
2718
2718
|
let r = {
|
|
2719
|
-
...
|
|
2719
|
+
...Ha,
|
|
2720
2720
|
...e
|
|
2721
2721
|
}, t = {
|
|
2722
2722
|
submitCount: 0,
|
|
@@ -2733,7 +2733,7 @@ function Ka(e = {}) {
|
|
|
2733
2733
|
validatingFields: {},
|
|
2734
2734
|
errors: r.errors || {},
|
|
2735
2735
|
disabled: r.disabled || !1
|
|
2736
|
-
}, n = {}, s =
|
|
2736
|
+
}, n = {}, s = Z(r.defaultValues) || Z(r.values) ? Q(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : Q(s), a = {
|
|
2737
2737
|
action: !1,
|
|
2738
2738
|
mount: !1,
|
|
2739
2739
|
watch: !1,
|
|
@@ -2745,7 +2745,7 @@ function Ka(e = {}) {
|
|
|
2745
2745
|
array: /* @__PURE__ */ new Set(),
|
|
2746
2746
|
watch: /* @__PURE__ */ new Set()
|
|
2747
2747
|
}, u, f = 0;
|
|
2748
|
-
const
|
|
2748
|
+
const v = {
|
|
2749
2749
|
isDirty: !1,
|
|
2750
2750
|
dirtyFields: !1,
|
|
2751
2751
|
validatingFields: !1,
|
|
@@ -2753,46 +2753,46 @@ function Ka(e = {}) {
|
|
|
2753
2753
|
isValidating: !1,
|
|
2754
2754
|
isValid: !1,
|
|
2755
2755
|
errors: !1
|
|
2756
|
-
},
|
|
2757
|
-
...
|
|
2756
|
+
}, b = {
|
|
2757
|
+
...v
|
|
2758
2758
|
};
|
|
2759
2759
|
let p = {
|
|
2760
|
-
...
|
|
2760
|
+
...b
|
|
2761
2761
|
};
|
|
2762
|
-
const
|
|
2763
|
-
array:
|
|
2764
|
-
state:
|
|
2765
|
-
},
|
|
2762
|
+
const y = {
|
|
2763
|
+
array: vr(),
|
|
2764
|
+
state: vr()
|
|
2765
|
+
}, C = r.criteriaMode === fe.all, _ = (l) => (d) => {
|
|
2766
2766
|
clearTimeout(f), f = setTimeout(l, d);
|
|
2767
2767
|
}, k = async (l) => {
|
|
2768
|
-
if (!a.keepIsValid && !r.disabled && (
|
|
2768
|
+
if (!a.keepIsValid && !r.disabled && (b.isValid || p.isValid || l)) {
|
|
2769
2769
|
let d;
|
|
2770
|
-
r.resolver ? (d =
|
|
2770
|
+
r.resolver ? (d = ie((await ee()).errors), E()) : d = await R(n, !0), d !== t.isValid && y.state.next({
|
|
2771
2771
|
isValid: d
|
|
2772
2772
|
});
|
|
2773
2773
|
}
|
|
2774
|
-
},
|
|
2775
|
-
!r.disabled && (
|
|
2776
|
-
h && (d ?
|
|
2777
|
-
}),
|
|
2774
|
+
}, E = (l, d) => {
|
|
2775
|
+
!r.disabled && (b.isValidating || b.validatingFields || p.isValidating || p.validatingFields) && ((l || Array.from(o.mount)).forEach((h) => {
|
|
2776
|
+
h && (d ? z(t.validatingFields, h, d) : J(t.validatingFields, h));
|
|
2777
|
+
}), y.state.next({
|
|
2778
2778
|
validatingFields: t.validatingFields,
|
|
2779
|
-
isValidating: !
|
|
2779
|
+
isValidating: !ie(t.validatingFields)
|
|
2780
2780
|
}));
|
|
2781
|
-
},
|
|
2781
|
+
}, g = (l, d = [], h, w, m = !0, x = !0) => {
|
|
2782
2782
|
if (w && h && !r.disabled) {
|
|
2783
|
-
if (a.action = !0,
|
|
2784
|
-
const
|
|
2785
|
-
|
|
2783
|
+
if (a.action = !0, x && Array.isArray(S(n, l))) {
|
|
2784
|
+
const A = h(S(n, l), w.argA, w.argB);
|
|
2785
|
+
m && z(n, l, A);
|
|
2786
2786
|
}
|
|
2787
|
-
if (
|
|
2788
|
-
const
|
|
2789
|
-
|
|
2787
|
+
if (x && Array.isArray(S(t.errors, l))) {
|
|
2788
|
+
const A = h(S(t.errors, l), w.argA, w.argB);
|
|
2789
|
+
m && z(t.errors, l, A), Wa(t.errors, l);
|
|
2790
2790
|
}
|
|
2791
|
-
if ((
|
|
2792
|
-
const
|
|
2793
|
-
|
|
2791
|
+
if ((b.touchedFields || p.touchedFields) && x && Array.isArray(S(t.touchedFields, l))) {
|
|
2792
|
+
const A = h(S(t.touchedFields, l), w.argA, w.argB);
|
|
2793
|
+
m && z(t.touchedFields, l, A);
|
|
2794
2794
|
}
|
|
2795
|
-
(
|
|
2795
|
+
(b.dirtyFields || p.dirtyFields) && (t.dirtyFields = Ke(s, i)), y.state.next({
|
|
2796
2796
|
name: l,
|
|
2797
2797
|
isDirty: I(l, d),
|
|
2798
2798
|
dirtyFields: t.dirtyFields,
|
|
@@ -2800,245 +2800,245 @@ function Ka(e = {}) {
|
|
|
2800
2800
|
isValid: t.isValid
|
|
2801
2801
|
});
|
|
2802
2802
|
} else
|
|
2803
|
-
|
|
2804
|
-
},
|
|
2805
|
-
|
|
2803
|
+
z(i, l, d);
|
|
2804
|
+
}, N = (l, d) => {
|
|
2805
|
+
z(t.errors, l, d), y.state.next({
|
|
2806
2806
|
errors: t.errors
|
|
2807
2807
|
});
|
|
2808
|
-
},
|
|
2809
|
-
t.errors = l,
|
|
2808
|
+
}, V = (l) => {
|
|
2809
|
+
t.errors = l, y.state.next({
|
|
2810
2810
|
errors: t.errors,
|
|
2811
2811
|
isValid: !1
|
|
2812
2812
|
});
|
|
2813
|
-
},
|
|
2814
|
-
const
|
|
2815
|
-
if (
|
|
2816
|
-
const
|
|
2817
|
-
|
|
2813
|
+
}, M = (l, d, h, w) => {
|
|
2814
|
+
const m = S(n, l);
|
|
2815
|
+
if (m) {
|
|
2816
|
+
const x = S(i, l, G(h) ? S(s, l) : h);
|
|
2817
|
+
G(x) || w && w.defaultChecked || d ? z(i, l, d ? x : kr(m._f)) : L(l, x), a.mount && !a.action && k();
|
|
2818
2818
|
}
|
|
2819
|
-
}, O = (l, d, h, w,
|
|
2820
|
-
let
|
|
2819
|
+
}, O = (l, d, h, w, m) => {
|
|
2820
|
+
let x = !1, A = !1;
|
|
2821
2821
|
const $ = {
|
|
2822
2822
|
name: l
|
|
2823
2823
|
};
|
|
2824
2824
|
if (!r.disabled) {
|
|
2825
2825
|
if (!h || w) {
|
|
2826
|
-
(
|
|
2827
|
-
const
|
|
2828
|
-
|
|
2826
|
+
(b.isDirty || p.isDirty) && (A = t.isDirty, t.isDirty = $.isDirty = I(), x = A !== $.isDirty);
|
|
2827
|
+
const P = Fe(S(s, l), d);
|
|
2828
|
+
A = !!S(t.dirtyFields, l), P ? J(t.dirtyFields, l) : z(t.dirtyFields, l, !0), $.dirtyFields = t.dirtyFields, x = x || (b.dirtyFields || p.dirtyFields) && A !== !P;
|
|
2829
2829
|
}
|
|
2830
2830
|
if (h) {
|
|
2831
|
-
const
|
|
2832
|
-
|
|
2831
|
+
const P = S(t.touchedFields, l);
|
|
2832
|
+
P || (z(t.touchedFields, l, h), $.touchedFields = t.touchedFields, x = x || (b.touchedFields || p.touchedFields) && P !== h);
|
|
2833
2833
|
}
|
|
2834
|
-
|
|
2834
|
+
x && m && y.state.next($);
|
|
2835
2835
|
}
|
|
2836
|
-
return
|
|
2837
|
-
},
|
|
2838
|
-
const
|
|
2839
|
-
if (r.delayError && h ? (u =
|
|
2840
|
-
const
|
|
2836
|
+
return x ? $ : {};
|
|
2837
|
+
}, K = (l, d, h, w) => {
|
|
2838
|
+
const m = S(t.errors, l), x = (b.isValid || p.isValid) && me(d) && t.isValid !== d;
|
|
2839
|
+
if (r.delayError && h ? (u = _(() => N(l, h)), u(r.delayError)) : (clearTimeout(f), u = null, h ? z(t.errors, l, h) : J(t.errors, l)), (h ? !Fe(m, h) : m) || !ie(w) || x) {
|
|
2840
|
+
const A = {
|
|
2841
2841
|
...w,
|
|
2842
|
-
...
|
|
2842
|
+
...x && me(d) ? { isValid: d } : {},
|
|
2843
2843
|
errors: t.errors,
|
|
2844
2844
|
name: l
|
|
2845
2845
|
};
|
|
2846
2846
|
t = {
|
|
2847
2847
|
...t,
|
|
2848
|
-
...
|
|
2849
|
-
},
|
|
2848
|
+
...A
|
|
2849
|
+
}, y.state.next(A);
|
|
2850
2850
|
}
|
|
2851
|
-
},
|
|
2852
|
-
const { errors: d } = await
|
|
2853
|
-
if (
|
|
2851
|
+
}, ee = async (l) => (E(l, !0), await r.resolver(i, r.context, Ba(l || o.mount, n, r.criteriaMode, r.shouldUseNativeValidation))), T = async (l) => {
|
|
2852
|
+
const { errors: d } = await ee(l);
|
|
2853
|
+
if (E(l), l)
|
|
2854
2854
|
for (const h of l) {
|
|
2855
2855
|
const w = S(d, h);
|
|
2856
|
-
w ?
|
|
2856
|
+
w ? z(t.errors, h, w) : J(t.errors, h);
|
|
2857
2857
|
}
|
|
2858
2858
|
else
|
|
2859
2859
|
t.errors = d;
|
|
2860
2860
|
return d;
|
|
2861
|
-
},
|
|
2861
|
+
}, R = async (l, d, h = {
|
|
2862
2862
|
valid: !0
|
|
2863
2863
|
}) => {
|
|
2864
2864
|
for (const w in l) {
|
|
2865
|
-
const
|
|
2866
|
-
if (
|
|
2867
|
-
const { _f:
|
|
2868
|
-
if (
|
|
2869
|
-
const $ = o.array.has(
|
|
2870
|
-
|
|
2871
|
-
const
|
|
2872
|
-
if (
|
|
2865
|
+
const m = l[w];
|
|
2866
|
+
if (m) {
|
|
2867
|
+
const { _f: x, ...A } = m;
|
|
2868
|
+
if (x) {
|
|
2869
|
+
const $ = o.array.has(x.name), P = m._f && $a(m._f);
|
|
2870
|
+
P && b.validatingFields && E([x.name], !0);
|
|
2871
|
+
const se = await Fr(m, o.disabled, i, C, r.shouldUseNativeValidation && !d, $);
|
|
2872
|
+
if (P && b.validatingFields && E([x.name]), se[x.name] && (h.valid = !1, d || e.shouldUseNativeValidation))
|
|
2873
2873
|
break;
|
|
2874
|
-
!d && (S(
|
|
2874
|
+
!d && (S(se, x.name) ? $ ? za(t.errors, se, x.name) : z(t.errors, x.name, se[x.name]) : J(t.errors, x.name));
|
|
2875
2875
|
}
|
|
2876
|
-
!
|
|
2876
|
+
!ie(A) && await R(A, d, h);
|
|
2877
2877
|
}
|
|
2878
2878
|
}
|
|
2879
2879
|
return h.valid;
|
|
2880
|
-
},
|
|
2880
|
+
}, B = () => {
|
|
2881
2881
|
for (const l of o.unMount) {
|
|
2882
2882
|
const d = S(n, l);
|
|
2883
|
-
d && (d._f.refs ? d._f.refs.every((h) => !Tt(h)) : !Tt(d._f.ref)) &&
|
|
2883
|
+
d && (d._f.refs ? d._f.refs.every((h) => !Tt(h)) : !Tt(d._f.ref)) && qe(l);
|
|
2884
2884
|
}
|
|
2885
2885
|
o.unMount = /* @__PURE__ */ new Set();
|
|
2886
|
-
}, I = (l, d) => !r.disabled && (l && d &&
|
|
2887
|
-
...a.mount ? i :
|
|
2888
|
-
}, h, d),
|
|
2886
|
+
}, I = (l, d) => !r.disabled && (l && d && z(i, l, d), !Fe(rt(), s)), F = (l, d, h) => La(l, o, {
|
|
2887
|
+
...a.mount ? i : G(d) ? s : ue(l) ? { [l]: d } : d
|
|
2888
|
+
}, h, d), j = (l) => Xt(S(a.mount ? i : s, l, r.shouldUnregister ? S(s, l, []) : [])), L = (l, d, h = {}) => {
|
|
2889
2889
|
const w = S(n, l);
|
|
2890
|
-
let
|
|
2890
|
+
let m = d;
|
|
2891
2891
|
if (w) {
|
|
2892
|
-
const
|
|
2893
|
-
|
|
2894
|
-
(!
|
|
2895
|
-
}) :
|
|
2892
|
+
const x = w._f;
|
|
2893
|
+
x && (!x.disabled && z(i, l, vn(d, x)), m = bt(x.ref) && oe(d) ? "" : d, yn(x.ref) ? [...x.ref.options].forEach((A) => A.selected = m.includes(A.value)) : x.refs ? ft(x.ref) ? x.refs.forEach((A) => {
|
|
2894
|
+
(!A.defaultChecked || !A.disabled) && (Array.isArray(m) ? A.checked = !!m.find(($) => $ === A.value) : A.checked = m === A.value || !!m);
|
|
2895
|
+
}) : x.refs.forEach((A) => A.checked = A.value === m) : Qt(x.ref) ? x.ref.value = "" : (x.ref.value = m, x.ref.type || y.state.next({
|
|
2896
2896
|
name: l,
|
|
2897
2897
|
values: Q(i)
|
|
2898
2898
|
})));
|
|
2899
2899
|
}
|
|
2900
|
-
(h.shouldDirty || h.shouldTouch) && O(l,
|
|
2900
|
+
(h.shouldDirty || h.shouldTouch) && O(l, m, h.shouldTouch, h.shouldDirty, !0), h.shouldValidate && H(l);
|
|
2901
2901
|
}, W = (l, d, h) => {
|
|
2902
2902
|
for (const w in d) {
|
|
2903
2903
|
if (!d.hasOwnProperty(w))
|
|
2904
2904
|
return;
|
|
2905
|
-
const
|
|
2906
|
-
(o.array.has(l) ||
|
|
2905
|
+
const m = d[w], x = l + "." + w, A = S(n, x);
|
|
2906
|
+
(o.array.has(l) || Z(m) || A && !A._f) && !De(m) ? W(x, m, h) : L(x, m, h);
|
|
2907
2907
|
}
|
|
2908
|
-
},
|
|
2909
|
-
const w = S(n, l),
|
|
2910
|
-
|
|
2908
|
+
}, U = (l, d, h = {}) => {
|
|
2909
|
+
const w = S(n, l), m = o.array.has(l), x = Q(d);
|
|
2910
|
+
z(i, l, x), m ? (y.array.next({
|
|
2911
2911
|
name: l,
|
|
2912
2912
|
values: Q(i)
|
|
2913
|
-
}), (
|
|
2913
|
+
}), (b.isDirty || b.dirtyFields || p.isDirty || p.dirtyFields) && h.shouldDirty && y.state.next({
|
|
2914
2914
|
name: l,
|
|
2915
|
-
dirtyFields:
|
|
2916
|
-
isDirty: I(l,
|
|
2917
|
-
})) : w && !w._f && !
|
|
2915
|
+
dirtyFields: Ke(s, i),
|
|
2916
|
+
isDirty: I(l, x)
|
|
2917
|
+
})) : w && !w._f && !oe(x) ? W(l, x, h) : L(l, x, h), Er(l, o) ? y.state.next({
|
|
2918
2918
|
...t,
|
|
2919
2919
|
name: l,
|
|
2920
2920
|
values: Q(i)
|
|
2921
|
-
}) :
|
|
2921
|
+
}) : y.state.next({
|
|
2922
2922
|
name: a.mount ? l : void 0,
|
|
2923
2923
|
values: Q(i)
|
|
2924
2924
|
});
|
|
2925
|
-
},
|
|
2925
|
+
}, te = async (l) => {
|
|
2926
2926
|
a.mount = !0;
|
|
2927
2927
|
const d = l.target;
|
|
2928
2928
|
let h = d.name, w = !0;
|
|
2929
|
-
const
|
|
2930
|
-
w = Number.isNaN(
|
|
2931
|
-
},
|
|
2932
|
-
if (
|
|
2933
|
-
let
|
|
2934
|
-
const
|
|
2935
|
-
|
|
2936
|
-
const
|
|
2937
|
-
if (!
|
|
2929
|
+
const m = S(n, h), x = (P) => {
|
|
2930
|
+
w = Number.isNaN(P) || De(P) && isNaN(P.getTime()) || Fe(P, S(i, h, P));
|
|
2931
|
+
}, A = Cr(r.mode), $ = Cr(r.reValidateMode);
|
|
2932
|
+
if (m) {
|
|
2933
|
+
let P, se;
|
|
2934
|
+
const Te = d.type ? kr(m._f) : Sa(l), Ee = l.type === gr.BLUR || l.type === gr.FOCUS_OUT, _n = !ja(m._f) && !r.resolver && !S(t.errors, h) && !m._f.deps || Ua(Ee, S(t.touchedFields, h), t.isSubmitted, $, A), At = Er(h, o, Ee);
|
|
2935
|
+
z(i, h, Te), Ee ? (!d || !d.readOnly) && (m._f.onBlur && m._f.onBlur(l), u && u(0)) : m._f.onChange && m._f.onChange(l);
|
|
2936
|
+
const It = O(h, Te, Ee), kn = !ie(It) || At;
|
|
2937
|
+
if (!Ee && y.state.next({
|
|
2938
2938
|
name: h,
|
|
2939
2939
|
type: l.type,
|
|
2940
2940
|
values: Q(i)
|
|
2941
2941
|
}), _n)
|
|
2942
|
-
return (
|
|
2943
|
-
if (!
|
|
2944
|
-
const { errors:
|
|
2945
|
-
if (
|
|
2946
|
-
const Cn = Ar(t.errors, n, h),
|
|
2947
|
-
|
|
2942
|
+
return (b.isValid || p.isValid) && (r.mode === "onBlur" ? Ee && k() : Ee || k()), kn && y.state.next({ name: h, ...At ? {} : It });
|
|
2943
|
+
if (!Ee && At && y.state.next({ ...t }), r.resolver) {
|
|
2944
|
+
const { errors: tr } = await ee([h]);
|
|
2945
|
+
if (E([h]), x(Te), w) {
|
|
2946
|
+
const Cn = Ar(t.errors, n, h), rr = Ar(tr, n, Cn.name || h);
|
|
2947
|
+
P = rr.error, h = rr.name, se = ie(tr);
|
|
2948
2948
|
}
|
|
2949
2949
|
} else
|
|
2950
|
-
|
|
2951
|
-
w && (
|
|
2950
|
+
E([h], !0), P = (await Fr(m, o.disabled, i, C, r.shouldUseNativeValidation))[h], E([h]), x(Te), w && (P ? se = !1 : (b.isValid || p.isValid) && (se = await R(n, !0)));
|
|
2951
|
+
w && (m._f.deps && (!Array.isArray(m._f.deps) || m._f.deps.length > 0) && H(m._f.deps), K(h, se, P, It));
|
|
2952
2952
|
}
|
|
2953
|
-
},
|
|
2953
|
+
}, X = (l, d) => {
|
|
2954
2954
|
if (S(t.errors, d) && l.focus)
|
|
2955
2955
|
return l.focus(), 1;
|
|
2956
|
-
},
|
|
2956
|
+
}, H = async (l, d = {}) => {
|
|
2957
2957
|
let h, w;
|
|
2958
|
-
const
|
|
2958
|
+
const m = ut(l);
|
|
2959
2959
|
if (r.resolver) {
|
|
2960
|
-
const
|
|
2961
|
-
h =
|
|
2960
|
+
const x = await T(G(l) ? l : m);
|
|
2961
|
+
h = ie(x), w = l ? !m.some((A) => S(x, A)) : h;
|
|
2962
2962
|
} else
|
|
2963
|
-
l ? (w = (await Promise.all(
|
|
2964
|
-
const
|
|
2965
|
-
return await
|
|
2966
|
-
}))).every(Boolean), !(!w && !t.isValid) && k()) : w = h = await
|
|
2967
|
-
return
|
|
2968
|
-
...!
|
|
2963
|
+
l ? (w = (await Promise.all(m.map(async (x) => {
|
|
2964
|
+
const A = S(n, x);
|
|
2965
|
+
return await R(A && A._f ? { [x]: A } : A);
|
|
2966
|
+
}))).every(Boolean), !(!w && !t.isValid) && k()) : w = h = await R(n);
|
|
2967
|
+
return y.state.next({
|
|
2968
|
+
...!ue(l) || (b.isValid || p.isValid) && h !== t.isValid ? {} : { name: l },
|
|
2969
2969
|
...r.resolver || !l ? { isValid: h } : {},
|
|
2970
2970
|
errors: t.errors
|
|
2971
|
-
}), d.shouldFocus && !w && dt(n,
|
|
2972
|
-
},
|
|
2971
|
+
}), d.shouldFocus && !w && dt(n, X, l ? m : o.mount), w;
|
|
2972
|
+
}, rt = (l, d) => {
|
|
2973
2973
|
let h = {
|
|
2974
2974
|
...a.mount ? i : s
|
|
2975
2975
|
};
|
|
2976
|
-
return d && (h = mn(d.dirtyFields ? t.dirtyFields : t.touchedFields, h)),
|
|
2977
|
-
},
|
|
2976
|
+
return d && (h = mn(d.dirtyFields ? t.dirtyFields : t.touchedFields, h)), G(l) ? h : ue(l) ? S(h, l) : l.map((w) => S(h, w));
|
|
2977
|
+
}, $e = (l, d) => ({
|
|
2978
2978
|
invalid: !!S((d || t).errors, l),
|
|
2979
2979
|
isDirty: !!S((d || t).dirtyFields, l),
|
|
2980
2980
|
error: S((d || t).errors, l),
|
|
2981
2981
|
isValidating: !!S(t.validatingFields, l),
|
|
2982
2982
|
isTouched: !!S((d || t).touchedFields, l)
|
|
2983
|
-
}),
|
|
2983
|
+
}), D = (l) => {
|
|
2984
2984
|
const d = l ? ut(l) : void 0;
|
|
2985
|
-
d == null || d.forEach((h) =>
|
|
2986
|
-
|
|
2985
|
+
d == null || d.forEach((h) => J(t.errors, h)), d ? d.forEach((h) => {
|
|
2986
|
+
y.state.next({
|
|
2987
2987
|
name: h,
|
|
2988
2988
|
errors: t.errors
|
|
2989
2989
|
});
|
|
2990
|
-
}) :
|
|
2990
|
+
}) : y.state.next({
|
|
2991
2991
|
errors: {}
|
|
2992
2992
|
});
|
|
2993
|
-
},
|
|
2994
|
-
const w = (S(n, l, { _f: {} })._f || {}).ref,
|
|
2995
|
-
|
|
2996
|
-
...
|
|
2993
|
+
}, je = (l, d, h) => {
|
|
2994
|
+
const w = (S(n, l, { _f: {} })._f || {}).ref, m = S(t.errors, l) || {}, { ref: x, message: A, type: $, ...P } = m;
|
|
2995
|
+
z(t.errors, l, {
|
|
2996
|
+
...P,
|
|
2997
2997
|
...d,
|
|
2998
2998
|
ref: w
|
|
2999
|
-
}),
|
|
2999
|
+
}), y.state.next({
|
|
3000
3000
|
name: l,
|
|
3001
3001
|
errors: t.errors,
|
|
3002
3002
|
isValid: !1
|
|
3003
3003
|
}), h && h.shouldFocus && w && w.focus && w.focus();
|
|
3004
|
-
},
|
|
3005
|
-
next: (h) => "values" in h && l(
|
|
3006
|
-
}) :
|
|
3004
|
+
}, Pe = (l, d) => de(l) ? y.state.subscribe({
|
|
3005
|
+
next: (h) => "values" in h && l(F(void 0, d), h)
|
|
3006
|
+
}) : F(l, d, !0), Se = (l) => y.state.subscribe({
|
|
3007
3007
|
next: (d) => {
|
|
3008
|
-
qa(l.name, d.name, l.exact) && Pa(d, l.formState ||
|
|
3008
|
+
qa(l.name, d.name, l.exact) && Pa(d, l.formState || b, mt, l.reRenderRoot) && l.callback({
|
|
3009
3009
|
values: { ...i },
|
|
3010
3010
|
...t,
|
|
3011
3011
|
...d,
|
|
3012
3012
|
defaultValues: s
|
|
3013
3013
|
});
|
|
3014
3014
|
}
|
|
3015
|
-
}).unsubscribe,
|
|
3015
|
+
}).unsubscribe, Ne = (l) => (a.mount = !0, p = {
|
|
3016
3016
|
...p,
|
|
3017
3017
|
...l.formState
|
|
3018
|
-
},
|
|
3018
|
+
}, Se({
|
|
3019
3019
|
...l,
|
|
3020
3020
|
formState: {
|
|
3021
|
-
...
|
|
3021
|
+
...v,
|
|
3022
3022
|
...l.formState
|
|
3023
3023
|
}
|
|
3024
|
-
})),
|
|
3024
|
+
})), qe = (l, d = {}) => {
|
|
3025
3025
|
for (const h of l ? ut(l) : o.mount)
|
|
3026
|
-
o.mount.delete(h), o.array.delete(h), d.keepValue || (
|
|
3027
|
-
|
|
3026
|
+
o.mount.delete(h), o.array.delete(h), d.keepValue || (J(n, h), J(i, h)), !d.keepError && J(t.errors, h), !d.keepDirty && J(t.dirtyFields, h), !d.keepTouched && J(t.touchedFields, h), !d.keepIsValidating && J(t.validatingFields, h), !r.shouldUnregister && !d.keepDefaultValue && J(s, h);
|
|
3027
|
+
y.state.next({
|
|
3028
3028
|
values: Q(i)
|
|
3029
|
-
}),
|
|
3029
|
+
}), y.state.next({
|
|
3030
3030
|
...t,
|
|
3031
3031
|
...d.keepDirty ? { isDirty: I() } : {}
|
|
3032
3032
|
}), !d.keepIsValid && k();
|
|
3033
|
-
},
|
|
3033
|
+
}, nt = ({ disabled: l, name: d }) => {
|
|
3034
3034
|
if (me(l) && a.mount || l || o.disabled.has(d)) {
|
|
3035
|
-
const
|
|
3036
|
-
l ? o.disabled.add(d) : o.disabled.delete(d),
|
|
3035
|
+
const m = o.disabled.has(d) !== !!l;
|
|
3036
|
+
l ? o.disabled.add(d) : o.disabled.delete(d), m && a.mount && !a.action && k();
|
|
3037
3037
|
}
|
|
3038
|
-
},
|
|
3038
|
+
}, ge = (l, d = {}) => {
|
|
3039
3039
|
let h = S(n, l);
|
|
3040
3040
|
const w = me(d.disabled) || me(r.disabled);
|
|
3041
|
-
return
|
|
3041
|
+
return z(n, l, {
|
|
3042
3042
|
...h || {},
|
|
3043
3043
|
_f: {
|
|
3044
3044
|
...h && h._f ? h._f : { ref: { name: l } },
|
|
@@ -3046,10 +3046,10 @@ function Ka(e = {}) {
|
|
|
3046
3046
|
mount: !0,
|
|
3047
3047
|
...d
|
|
3048
3048
|
}
|
|
3049
|
-
}), o.mount.add(l), h ?
|
|
3049
|
+
}), o.mount.add(l), h ? nt({
|
|
3050
3050
|
disabled: me(d.disabled) ? d.disabled : r.disabled,
|
|
3051
3051
|
name: l
|
|
3052
|
-
}) :
|
|
3052
|
+
}) : M(l, !0, d.value), {
|
|
3053
3053
|
...w ? { disabled: d.disabled || r.disabled } : {},
|
|
3054
3054
|
...r.progressive ? {
|
|
3055
3055
|
required: !!d.required,
|
|
@@ -3060,110 +3060,110 @@ function Ka(e = {}) {
|
|
|
3060
3060
|
pattern: it(d.pattern)
|
|
3061
3061
|
} : {},
|
|
3062
3062
|
name: l,
|
|
3063
|
-
onChange:
|
|
3064
|
-
onBlur:
|
|
3065
|
-
ref: (
|
|
3066
|
-
if (
|
|
3067
|
-
|
|
3068
|
-
const
|
|
3069
|
-
if (
|
|
3063
|
+
onChange: te,
|
|
3064
|
+
onBlur: te,
|
|
3065
|
+
ref: (m) => {
|
|
3066
|
+
if (m) {
|
|
3067
|
+
ge(l, d), h = S(n, l);
|
|
3068
|
+
const x = G(m.value) && m.querySelectorAll && m.querySelectorAll("input,select,textarea")[0] || m, A = Ra(x), $ = h._f.refs || [];
|
|
3069
|
+
if (A ? $.find((P) => P === x) : x === h._f.ref)
|
|
3070
3070
|
return;
|
|
3071
|
-
|
|
3071
|
+
z(n, l, {
|
|
3072
3072
|
_f: {
|
|
3073
3073
|
...h._f,
|
|
3074
|
-
...
|
|
3074
|
+
...A ? {
|
|
3075
3075
|
refs: [
|
|
3076
3076
|
...$.filter(Tt),
|
|
3077
|
-
|
|
3077
|
+
x,
|
|
3078
3078
|
...Array.isArray(S(s, l)) ? [{}] : []
|
|
3079
3079
|
],
|
|
3080
|
-
ref: { type:
|
|
3081
|
-
} : { ref:
|
|
3080
|
+
ref: { type: x.type, name: l }
|
|
3081
|
+
} : { ref: x }
|
|
3082
3082
|
}
|
|
3083
|
-
}),
|
|
3083
|
+
}), M(l, !1, void 0, x);
|
|
3084
3084
|
} else
|
|
3085
|
-
h = S(n, l, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(
|
|
3085
|
+
h = S(n, l, {}), h._f && (h._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Aa(o.array, l) && a.action) && o.unMount.add(l);
|
|
3086
3086
|
}
|
|
3087
3087
|
};
|
|
3088
|
-
},
|
|
3089
|
-
me(l) && (
|
|
3088
|
+
}, Ue = () => r.shouldFocusError && dt(n, X, o.mount), ht = (l) => {
|
|
3089
|
+
me(l) && (y.state.next({ disabled: l }), dt(n, (d, h) => {
|
|
3090
3090
|
const w = S(n, h);
|
|
3091
|
-
w && (d.disabled = w._f.disabled || l, Array.isArray(w._f.refs) && w._f.refs.forEach((
|
|
3092
|
-
|
|
3091
|
+
w && (d.disabled = w._f.disabled || l, Array.isArray(w._f.refs) && w._f.refs.forEach((m) => {
|
|
3092
|
+
m.disabled = w._f.disabled || l;
|
|
3093
3093
|
}));
|
|
3094
3094
|
}, 0, !1));
|
|
3095
|
-
},
|
|
3095
|
+
}, We = (l, d) => async (h) => {
|
|
3096
3096
|
let w;
|
|
3097
3097
|
h && (h.preventDefault && h.preventDefault(), h.persist && h.persist());
|
|
3098
|
-
let
|
|
3099
|
-
if (
|
|
3098
|
+
let m = Q(i);
|
|
3099
|
+
if (y.state.next({
|
|
3100
3100
|
isSubmitting: !0
|
|
3101
3101
|
}), r.resolver) {
|
|
3102
|
-
const { errors:
|
|
3103
|
-
|
|
3102
|
+
const { errors: x, values: A } = await ee();
|
|
3103
|
+
E(), t.errors = x, m = Q(A);
|
|
3104
3104
|
} else
|
|
3105
|
-
await
|
|
3105
|
+
await R(n);
|
|
3106
3106
|
if (o.disabled.size)
|
|
3107
|
-
for (const
|
|
3108
|
-
|
|
3109
|
-
if (
|
|
3110
|
-
|
|
3107
|
+
for (const x of o.disabled)
|
|
3108
|
+
J(m, x);
|
|
3109
|
+
if (J(t.errors, "root"), ie(t.errors)) {
|
|
3110
|
+
y.state.next({
|
|
3111
3111
|
errors: {}
|
|
3112
3112
|
});
|
|
3113
3113
|
try {
|
|
3114
|
-
await l(
|
|
3115
|
-
} catch (
|
|
3116
|
-
w =
|
|
3114
|
+
await l(m, h);
|
|
3115
|
+
} catch (x) {
|
|
3116
|
+
w = x;
|
|
3117
3117
|
}
|
|
3118
3118
|
} else
|
|
3119
|
-
d && await d({ ...t.errors }, h),
|
|
3120
|
-
if (
|
|
3119
|
+
d && await d({ ...t.errors }, h), Ue(), setTimeout(Ue);
|
|
3120
|
+
if (y.state.next({
|
|
3121
3121
|
isSubmitted: !0,
|
|
3122
3122
|
isSubmitting: !1,
|
|
3123
|
-
isSubmitSuccessful:
|
|
3123
|
+
isSubmitSuccessful: ie(t.errors) && !w,
|
|
3124
3124
|
submitCount: t.submitCount + 1,
|
|
3125
3125
|
errors: t.errors
|
|
3126
3126
|
}), w)
|
|
3127
3127
|
throw w;
|
|
3128
|
-
},
|
|
3129
|
-
S(n, l) && (
|
|
3130
|
-
},
|
|
3131
|
-
const h = l ? Q(l) : s, w = Q(h),
|
|
3128
|
+
}, ze = (l, d = {}) => {
|
|
3129
|
+
S(n, l) && (G(d.defaultValue) ? U(l, Q(S(s, l))) : (U(l, d.defaultValue), z(s, l, Q(d.defaultValue))), d.keepTouched || J(t.touchedFields, l), d.keepDirty || (J(t.dirtyFields, l), t.isDirty = d.defaultValue ? I(l, Q(S(s, l))) : I()), d.keepError || (J(t.errors, l), b.isValid && k()), y.state.next({ ...t }));
|
|
3130
|
+
}, Re = (l, d = {}) => {
|
|
3131
|
+
const h = l ? Q(l) : s, w = Q(h), m = ie(l), x = m ? s : w;
|
|
3132
3132
|
if (d.keepDefaultValues || (s = h), !d.keepValues) {
|
|
3133
3133
|
if (d.keepDirtyValues) {
|
|
3134
|
-
const
|
|
3134
|
+
const A = /* @__PURE__ */ new Set([
|
|
3135
3135
|
...o.mount,
|
|
3136
|
-
...Object.keys(
|
|
3136
|
+
...Object.keys(Ke(s, i))
|
|
3137
3137
|
]);
|
|
3138
|
-
for (const $ of Array.from(
|
|
3139
|
-
const
|
|
3140
|
-
|
|
3138
|
+
for (const $ of Array.from(A)) {
|
|
3139
|
+
const P = S(t.dirtyFields, $), se = S(i, $), Te = S(x, $);
|
|
3140
|
+
P && !G(se) ? z(x, $, se) : !P && !G(Te) && U($, Te);
|
|
3141
3141
|
}
|
|
3142
3142
|
} else {
|
|
3143
|
-
if (
|
|
3144
|
-
for (const
|
|
3145
|
-
const $ = S(n,
|
|
3143
|
+
if (Zt && G(l))
|
|
3144
|
+
for (const A of o.mount) {
|
|
3145
|
+
const $ = S(n, A);
|
|
3146
3146
|
if ($ && $._f) {
|
|
3147
|
-
const
|
|
3148
|
-
if (bt(
|
|
3149
|
-
const
|
|
3150
|
-
if (
|
|
3151
|
-
|
|
3147
|
+
const P = Array.isArray($._f.refs) ? $._f.refs[0] : $._f.ref;
|
|
3148
|
+
if (bt(P)) {
|
|
3149
|
+
const se = P.closest("form");
|
|
3150
|
+
if (se) {
|
|
3151
|
+
se.reset();
|
|
3152
3152
|
break;
|
|
3153
3153
|
}
|
|
3154
3154
|
}
|
|
3155
3155
|
}
|
|
3156
3156
|
}
|
|
3157
3157
|
if (d.keepFieldsRef)
|
|
3158
|
-
for (const
|
|
3159
|
-
|
|
3158
|
+
for (const A of o.mount)
|
|
3159
|
+
U(A, S(x, A));
|
|
3160
3160
|
else
|
|
3161
3161
|
n = {};
|
|
3162
3162
|
}
|
|
3163
|
-
i = r.shouldUnregister ? d.keepDefaultValues ? Q(s) : {} : Q(
|
|
3164
|
-
values: { ...
|
|
3165
|
-
}),
|
|
3166
|
-
values: { ...
|
|
3163
|
+
i = r.shouldUnregister ? d.keepDefaultValues ? Q(s) : {} : Q(x), y.array.next({
|
|
3164
|
+
values: { ...x }
|
|
3165
|
+
}), y.state.next({
|
|
3166
|
+
values: { ...x }
|
|
3167
3167
|
});
|
|
3168
3168
|
}
|
|
3169
3169
|
o = {
|
|
@@ -3174,23 +3174,23 @@ function Ka(e = {}) {
|
|
|
3174
3174
|
watch: /* @__PURE__ */ new Set(),
|
|
3175
3175
|
watchAll: !1,
|
|
3176
3176
|
focus: ""
|
|
3177
|
-
}, a.mount = !
|
|
3177
|
+
}, a.mount = !b.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !ie(x), a.watch = !!r.shouldUnregister, a.keepIsValid = !!d.keepIsValid, a.action = !1, d.keepErrors || (t.errors = {}), y.state.next({
|
|
3178
3178
|
submitCount: d.keepSubmitCount ? t.submitCount : 0,
|
|
3179
|
-
isDirty:
|
|
3179
|
+
isDirty: m ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Fe(l, s)),
|
|
3180
3180
|
isSubmitted: d.keepIsSubmitted ? t.isSubmitted : !1,
|
|
3181
|
-
dirtyFields:
|
|
3181
|
+
dirtyFields: m ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? Ke(s, i) : t.dirtyFields : d.keepDefaultValues && l ? Ke(s, l) : d.keepDirty ? t.dirtyFields : {},
|
|
3182
3182
|
touchedFields: d.keepTouched ? t.touchedFields : {},
|
|
3183
3183
|
errors: d.keepErrors ? t.errors : {},
|
|
3184
3184
|
isSubmitSuccessful: d.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
|
|
3185
3185
|
isSubmitting: !1,
|
|
3186
3186
|
defaultValues: s
|
|
3187
3187
|
});
|
|
3188
|
-
}, st = (l, d) =>
|
|
3188
|
+
}, st = (l, d) => Re(de(l) ? l(i) : l, { ...r.resetOptions, ...d }), pt = (l, d = {}) => {
|
|
3189
3189
|
const h = S(n, l), w = h && h._f;
|
|
3190
3190
|
if (w) {
|
|
3191
|
-
const
|
|
3192
|
-
|
|
3193
|
-
|
|
3191
|
+
const m = w.refs ? w.refs[0] : w.ref;
|
|
3192
|
+
m.focus && setTimeout(() => {
|
|
3193
|
+
m.focus(), d.shouldSelect && de(m.select) && m.select();
|
|
3194
3194
|
});
|
|
3195
3195
|
}
|
|
3196
3196
|
}, mt = (l) => {
|
|
@@ -3200,32 +3200,32 @@ function Ka(e = {}) {
|
|
|
3200
3200
|
};
|
|
3201
3201
|
}, at = {
|
|
3202
3202
|
control: {
|
|
3203
|
-
register:
|
|
3204
|
-
unregister:
|
|
3205
|
-
getFieldState:
|
|
3206
|
-
handleSubmit:
|
|
3207
|
-
setError:
|
|
3208
|
-
_subscribe:
|
|
3209
|
-
_runSchema:
|
|
3210
|
-
_updateIsValidating:
|
|
3211
|
-
_focusError:
|
|
3212
|
-
_getWatch:
|
|
3203
|
+
register: ge,
|
|
3204
|
+
unregister: qe,
|
|
3205
|
+
getFieldState: $e,
|
|
3206
|
+
handleSubmit: We,
|
|
3207
|
+
setError: je,
|
|
3208
|
+
_subscribe: Se,
|
|
3209
|
+
_runSchema: ee,
|
|
3210
|
+
_updateIsValidating: E,
|
|
3211
|
+
_focusError: Ue,
|
|
3212
|
+
_getWatch: F,
|
|
3213
3213
|
_getDirty: I,
|
|
3214
3214
|
_setValid: k,
|
|
3215
|
-
_setFieldArray:
|
|
3216
|
-
_setDisabledField:
|
|
3217
|
-
_setErrors:
|
|
3218
|
-
_getFieldArray:
|
|
3219
|
-
_reset:
|
|
3215
|
+
_setFieldArray: g,
|
|
3216
|
+
_setDisabledField: nt,
|
|
3217
|
+
_setErrors: V,
|
|
3218
|
+
_getFieldArray: j,
|
|
3219
|
+
_reset: Re,
|
|
3220
3220
|
_resetDefaultValues: () => de(r.defaultValues) && r.defaultValues().then((l) => {
|
|
3221
|
-
st(l, r.resetOptions),
|
|
3221
|
+
st(l, r.resetOptions), y.state.next({
|
|
3222
3222
|
isLoading: !1
|
|
3223
3223
|
});
|
|
3224
3224
|
}),
|
|
3225
|
-
_removeUnmounted:
|
|
3226
|
-
_disableForm:
|
|
3227
|
-
_subjects:
|
|
3228
|
-
_proxyFormState:
|
|
3225
|
+
_removeUnmounted: B,
|
|
3226
|
+
_disableForm: ht,
|
|
3227
|
+
_subjects: y,
|
|
3228
|
+
_proxyFormState: b,
|
|
3229
3229
|
get _fields() {
|
|
3230
3230
|
return n;
|
|
3231
3231
|
},
|
|
@@ -3260,20 +3260,20 @@ function Ka(e = {}) {
|
|
|
3260
3260
|
};
|
|
3261
3261
|
}
|
|
3262
3262
|
},
|
|
3263
|
-
subscribe:
|
|
3264
|
-
trigger:
|
|
3265
|
-
register:
|
|
3266
|
-
handleSubmit:
|
|
3267
|
-
watch:
|
|
3268
|
-
setValue:
|
|
3269
|
-
getValues:
|
|
3263
|
+
subscribe: Ne,
|
|
3264
|
+
trigger: H,
|
|
3265
|
+
register: ge,
|
|
3266
|
+
handleSubmit: We,
|
|
3267
|
+
watch: Pe,
|
|
3268
|
+
setValue: U,
|
|
3269
|
+
getValues: rt,
|
|
3270
3270
|
reset: st,
|
|
3271
|
-
resetField:
|
|
3272
|
-
clearErrors:
|
|
3273
|
-
unregister:
|
|
3274
|
-
setError:
|
|
3271
|
+
resetField: ze,
|
|
3272
|
+
clearErrors: D,
|
|
3273
|
+
unregister: qe,
|
|
3274
|
+
setError: je,
|
|
3275
3275
|
setFocus: pt,
|
|
3276
|
-
getFieldState:
|
|
3276
|
+
getFieldState: $e
|
|
3277
3277
|
};
|
|
3278
3278
|
return {
|
|
3279
3279
|
...at,
|
|
@@ -3281,7 +3281,7 @@ function Ka(e = {}) {
|
|
|
3281
3281
|
};
|
|
3282
3282
|
}
|
|
3283
3283
|
function Ct(e = {}) {
|
|
3284
|
-
const r =
|
|
3284
|
+
const r = ae.useRef(void 0), t = ae.useRef(void 0), [n, s] = ae.useState({
|
|
3285
3285
|
isDirty: !1,
|
|
3286
3286
|
isValidating: !1,
|
|
3287
3287
|
isLoading: de(e.defaultValues),
|
|
@@ -3322,32 +3322,32 @@ function Ct(e = {}) {
|
|
|
3322
3322
|
...o,
|
|
3323
3323
|
isReady: !0
|
|
3324
3324
|
})), i._formState.isReady = !0, a;
|
|
3325
|
-
}, [i]),
|
|
3325
|
+
}, [i]), ae.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), ae.useEffect(() => {
|
|
3326
3326
|
e.mode && (i._options.mode = e.mode), e.reValidateMode && (i._options.reValidateMode = e.reValidateMode);
|
|
3327
|
-
}, [i, e.mode, e.reValidateMode]),
|
|
3327
|
+
}, [i, e.mode, e.reValidateMode]), ae.useEffect(() => {
|
|
3328
3328
|
e.errors && (i._setErrors(e.errors), i._focusError());
|
|
3329
|
-
}, [i, e.errors]),
|
|
3329
|
+
}, [i, e.errors]), ae.useEffect(() => {
|
|
3330
3330
|
e.shouldUnregister && i._subjects.state.next({
|
|
3331
3331
|
values: i._getWatch()
|
|
3332
3332
|
});
|
|
3333
|
-
}, [i, e.shouldUnregister]),
|
|
3333
|
+
}, [i, e.shouldUnregister]), ae.useEffect(() => {
|
|
3334
3334
|
if (i._proxyFormState.isDirty) {
|
|
3335
3335
|
const a = i._getDirty();
|
|
3336
3336
|
a !== n.isDirty && i._subjects.state.next({
|
|
3337
3337
|
isDirty: a
|
|
3338
3338
|
});
|
|
3339
3339
|
}
|
|
3340
|
-
}, [i, n.isDirty]),
|
|
3340
|
+
}, [i, n.isDirty]), ae.useEffect(() => {
|
|
3341
3341
|
var a;
|
|
3342
3342
|
e.values && !Fe(e.values, t.current) ? (i._reset(e.values, {
|
|
3343
3343
|
keepFieldsRef: !0,
|
|
3344
3344
|
...i._options.resetOptions
|
|
3345
3345
|
}), !((a = i._options.resetOptions) === null || a === void 0) && a.keepIsValid || i._setValid(), t.current = e.values, s((o) => ({ ...o }))) : i._resetDefaultValues();
|
|
3346
|
-
}, [i, e.values]),
|
|
3346
|
+
}, [i, e.values]), ae.useEffect(() => {
|
|
3347
3347
|
i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
|
|
3348
|
-
}), r.current.formState =
|
|
3348
|
+
}), r.current.formState = ae.useMemo(() => Va(n, i), [i, n]), r.current;
|
|
3349
3349
|
}
|
|
3350
|
-
const
|
|
3350
|
+
const Vr = (e, r, t) => {
|
|
3351
3351
|
if (e && "reportValidity" in e) {
|
|
3352
3352
|
const n = S(t, r);
|
|
3353
3353
|
e.setCustomValidity(n && n.message || ""), e.reportValidity();
|
|
@@ -3355,7 +3355,7 @@ const Fr = (e, r, t) => {
|
|
|
3355
3355
|
}, Ga = (e, r) => {
|
|
3356
3356
|
for (const t in r.fields) {
|
|
3357
3357
|
const n = r.fields[t];
|
|
3358
|
-
n && n.ref && "reportValidity" in n.ref ?
|
|
3358
|
+
n && n.ref && "reportValidity" in n.ref ? Vr(n.ref, t, e) : n.refs && n.refs.forEach((s) => Vr(s, t, e));
|
|
3359
3359
|
}
|
|
3360
3360
|
}, Ja = (e, r) => {
|
|
3361
3361
|
r.shouldUseNativeValidation && Ga(e, r);
|
|
@@ -3364,9 +3364,9 @@ const Fr = (e, r, t) => {
|
|
|
3364
3364
|
const s = S(r.fields, n), i = Object.assign(e[n] || {}, { ref: s && s.ref });
|
|
3365
3365
|
if (Za(r.names || Object.keys(e), n)) {
|
|
3366
3366
|
const a = Object.assign({}, S(t, n));
|
|
3367
|
-
|
|
3367
|
+
z(a, "root", i), z(t, n, a);
|
|
3368
3368
|
} else
|
|
3369
|
-
|
|
3369
|
+
z(t, n, i);
|
|
3370
3370
|
}
|
|
3371
3371
|
return t;
|
|
3372
3372
|
}, Za = (e, r) => e.some((t) => t.startsWith(r + "."));
|
|
@@ -3377,10 +3377,10 @@ var St = function(e, r, t) {
|
|
|
3377
3377
|
return Promise.resolve(/* @__PURE__ */ oa(e, n, Object.assign({}, r, { abortPipeEarly: !a }))).then(function(o) {
|
|
3378
3378
|
if (o.issues) {
|
|
3379
3379
|
for (var u = {}; o.issues.length; ) {
|
|
3380
|
-
var f = o.issues[0],
|
|
3381
|
-
if (
|
|
3382
|
-
var
|
|
3383
|
-
u[
|
|
3380
|
+
var f = o.issues[0], v = /* @__PURE__ */ ea(f);
|
|
3381
|
+
if (v && (u[v] || (u[v] = { message: f.message, type: f.type }), a)) {
|
|
3382
|
+
var b = u[v].types, p = b && b[f.type];
|
|
3383
|
+
u[v] = pn(v, a, u, f.type, p ? [].concat(p, f.message) : f.message);
|
|
3384
3384
|
}
|
|
3385
3385
|
o.issues.shift();
|
|
3386
3386
|
}
|
|
@@ -3393,22 +3393,22 @@ var St = function(e, r, t) {
|
|
|
3393
3393
|
}
|
|
3394
3394
|
};
|
|
3395
3395
|
};
|
|
3396
|
-
const
|
|
3396
|
+
const Mr = 27, Lr = 12, Nr = 10, Xa = et("enum"), Ya = (e, r) => {
|
|
3397
3397
|
const t = {
|
|
3398
3398
|
min: e.minSelected ?? 0,
|
|
3399
3399
|
max: e.maxSelected ?? e.options.length
|
|
3400
3400
|
};
|
|
3401
|
-
return St(/* @__PURE__ */
|
|
3402
|
-
checked: /* @__PURE__ */ Ve(/* @__PURE__ */ ln(/* @__PURE__ */
|
|
3401
|
+
return St(/* @__PURE__ */ ke({
|
|
3402
|
+
checked: /* @__PURE__ */ Ve(/* @__PURE__ */ ln(/* @__PURE__ */ le(), /* @__PURE__ */ sn()), /* @__PURE__ */ Kt((n) => Object.entries(n).filter(([s, i]) => i).map(([s, i]) => s)), /* @__PURE__ */ ct(t.max, r("validation_multiple_choice_max", {
|
|
3403
3403
|
count: t.max
|
|
3404
|
-
})), /* @__PURE__ */
|
|
3404
|
+
})), /* @__PURE__ */ Ze(t.min, r("validation_multiple_choice_min", {
|
|
3405
3405
|
count: t.min
|
|
3406
3406
|
})))
|
|
3407
3407
|
}));
|
|
3408
|
-
}, Qa =
|
|
3408
|
+
}, Qa = zr(({
|
|
3409
3409
|
option: e,
|
|
3410
3410
|
...r
|
|
3411
|
-
}, t) => c(
|
|
3411
|
+
}, t) => c(Ce, {
|
|
3412
3412
|
children: [c("input", {
|
|
3413
3413
|
class: "peer sr-only h-full",
|
|
3414
3414
|
type: "checkbox",
|
|
@@ -3432,10 +3432,10 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3432
3432
|
input: e,
|
|
3433
3433
|
onSubmitSuccess: r
|
|
3434
3434
|
}) => {
|
|
3435
|
-
var
|
|
3436
|
-
const t = e.key ? (
|
|
3435
|
+
var v, b;
|
|
3436
|
+
const t = e.key ? (v = q.current$.value.flow) == null ? void 0 : v.data.submissions[e.key] : void 0, n = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, s = n && e.config.options.length === 2, {
|
|
3437
3437
|
t: i
|
|
3438
|
-
} =
|
|
3438
|
+
} = ne(), {
|
|
3439
3439
|
register: a,
|
|
3440
3440
|
handleSubmit: o,
|
|
3441
3441
|
formState: {
|
|
@@ -3446,20 +3446,20 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3446
3446
|
checked: n ? {} : Xa(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
|
|
3447
3447
|
},
|
|
3448
3448
|
resolver: Ya(e.config, i)
|
|
3449
|
-
}), f =
|
|
3449
|
+
}), f = Jt();
|
|
3450
3450
|
return s ? c("ul", {
|
|
3451
3451
|
style: {
|
|
3452
|
-
maxHeight: 6.5 *
|
|
3452
|
+
maxHeight: 6.5 * Mr + 5 * Lr + 2 * Nr
|
|
3453
3453
|
},
|
|
3454
3454
|
class: Rr({
|
|
3455
3455
|
variant: "booleanLike"
|
|
3456
3456
|
}),
|
|
3457
|
-
children: e.config.options.map((p,
|
|
3457
|
+
children: e.config.options.map((p, y) => c("li", {
|
|
3458
3458
|
class: dn,
|
|
3459
3459
|
children: c(fn, {
|
|
3460
3460
|
type: "submit",
|
|
3461
|
-
ref: (
|
|
3462
|
-
|
|
3461
|
+
ref: (C) => {
|
|
3462
|
+
C && y === 0 && (f.current = C);
|
|
3463
3463
|
},
|
|
3464
3464
|
label: p.label,
|
|
3465
3465
|
value: "true",
|
|
@@ -3471,36 +3471,36 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3471
3471
|
}, p.value))
|
|
3472
3472
|
}) : c("form", {
|
|
3473
3473
|
noValidate: !0,
|
|
3474
|
-
onSubmit: (p) => o((
|
|
3475
|
-
const
|
|
3474
|
+
onSubmit: (p) => o((y) => {
|
|
3475
|
+
const C = y.checked;
|
|
3476
3476
|
r({
|
|
3477
3477
|
type: "enum",
|
|
3478
|
-
value:
|
|
3478
|
+
value: C
|
|
3479
3479
|
});
|
|
3480
3480
|
})(p),
|
|
3481
3481
|
children: [c("div", {
|
|
3482
3482
|
class: "flex items-center gap-1",
|
|
3483
3483
|
children: [c("ul", {
|
|
3484
3484
|
style: {
|
|
3485
|
-
maxHeight: 6.5 *
|
|
3485
|
+
maxHeight: 6.5 * Mr + 5 * Lr + 2 * Nr
|
|
3486
3486
|
},
|
|
3487
3487
|
class: Rr({
|
|
3488
3488
|
variant: e.config.options.length === 1 ? "singleOption" : void 0
|
|
3489
3489
|
}),
|
|
3490
|
-
children: e.config.options.map((p,
|
|
3491
|
-
const
|
|
3492
|
-
ref:
|
|
3490
|
+
children: e.config.options.map((p, y) => {
|
|
3491
|
+
const C = `checked.${p.value}`, {
|
|
3492
|
+
ref: _,
|
|
3493
3493
|
...k
|
|
3494
|
-
} = a(
|
|
3494
|
+
} = a(C);
|
|
3495
3495
|
return c("li", {
|
|
3496
3496
|
class: "relative",
|
|
3497
3497
|
children: c(Qa, {
|
|
3498
3498
|
option: p,
|
|
3499
|
-
autoFocus:
|
|
3500
|
-
ref: (
|
|
3501
|
-
|
|
3499
|
+
autoFocus: y === 0,
|
|
3500
|
+
ref: (E) => {
|
|
3501
|
+
E && y === 0 && (f.current = E), _(E);
|
|
3502
3502
|
},
|
|
3503
|
-
id:
|
|
3503
|
+
id: C,
|
|
3504
3504
|
...k,
|
|
3505
3505
|
onClick: n ? () => r({
|
|
3506
3506
|
type: "enum",
|
|
@@ -3511,7 +3511,7 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3511
3511
|
})
|
|
3512
3512
|
}), c("div", {
|
|
3513
3513
|
class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
|
|
3514
|
-
children: [n ? null : c(
|
|
3514
|
+
children: [n ? null : c(Be, {}), e.config.minSelected === 0 && c(Le, {
|
|
3515
3515
|
class: "relative",
|
|
3516
3516
|
type: "button",
|
|
3517
3517
|
onClick: () => r({
|
|
@@ -3522,14 +3522,14 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3522
3522
|
})]
|
|
3523
3523
|
}), c("div", {
|
|
3524
3524
|
class: "px-1",
|
|
3525
|
-
children: c(
|
|
3526
|
-
error: (
|
|
3525
|
+
children: c(tt, {
|
|
3526
|
+
error: (b = u.checked) == null ? void 0 : b.root
|
|
3527
3527
|
})
|
|
3528
3528
|
})]
|
|
3529
3529
|
});
|
|
3530
|
-
}, ti =
|
|
3530
|
+
}, ti = et("number"), ri = (e, r) => {
|
|
3531
3531
|
const t = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, s = e.decimalCases ?? 0;
|
|
3532
|
-
return St(/* @__PURE__ */
|
|
3532
|
+
return St(/* @__PURE__ */ ke({
|
|
3533
3533
|
number: /* @__PURE__ */ Ve(/* @__PURE__ */ an(r("validation_number")), /* @__PURE__ */ en(t, r("validation_number_min", {
|
|
3534
3534
|
min: t
|
|
3535
3535
|
})), /* @__PURE__ */ Qr(n, r("validation_number_max", {
|
|
@@ -3542,10 +3542,10 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3542
3542
|
input: e,
|
|
3543
3543
|
onSubmitSuccess: r
|
|
3544
3544
|
}) => {
|
|
3545
|
-
var
|
|
3546
|
-
const t = e.config.defaultValue, n = e.key ? (
|
|
3545
|
+
var b;
|
|
3546
|
+
const t = e.config.defaultValue, n = e.key ? (b = q.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, {
|
|
3547
3547
|
t: s
|
|
3548
|
-
} =
|
|
3548
|
+
} = ne(), {
|
|
3549
3549
|
register: i,
|
|
3550
3550
|
handleSubmit: a,
|
|
3551
3551
|
formState: {
|
|
@@ -3562,9 +3562,9 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3562
3562
|
} = i("number", {
|
|
3563
3563
|
required: !e.config.optional,
|
|
3564
3564
|
valueAsNumber: !0
|
|
3565
|
-
}),
|
|
3565
|
+
}), v = ye();
|
|
3566
3566
|
return Me(() => {
|
|
3567
|
-
|
|
3567
|
+
v.current && (v.current.focus(), v.current.select());
|
|
3568
3568
|
}, []), c("form", {
|
|
3569
3569
|
class: "flex flex-col gap-1 p-2.5",
|
|
3570
3570
|
onSubmit: a((p) => {
|
|
@@ -3585,12 +3585,12 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3585
3585
|
autoCorrect: "off",
|
|
3586
3586
|
autoFocus: !0,
|
|
3587
3587
|
ref: (p) => {
|
|
3588
|
-
p && (
|
|
3588
|
+
p && (v.current = p), u(p);
|
|
3589
3589
|
},
|
|
3590
3590
|
type: "text",
|
|
3591
3591
|
min: e.config.min,
|
|
3592
3592
|
max: e.config.max,
|
|
3593
|
-
class:
|
|
3593
|
+
class: Ye({
|
|
3594
3594
|
optional: e.config.optional,
|
|
3595
3595
|
className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
|
|
3596
3596
|
}),
|
|
@@ -3599,8 +3599,8 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3599
3599
|
class: "absolute bottom-0 right-0.5 top-0",
|
|
3600
3600
|
onClick: () => r(null)
|
|
3601
3601
|
})]
|
|
3602
|
-
}), c(
|
|
3603
|
-
}), c(
|
|
3602
|
+
}), c(Be, {})]
|
|
3603
|
+
}), c(tt, {
|
|
3604
3604
|
error: o.number
|
|
3605
3605
|
})]
|
|
3606
3606
|
});
|
|
@@ -3610,7 +3610,7 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3610
3610
|
countryCode: "",
|
|
3611
3611
|
phoneNumber: ""
|
|
3612
3612
|
};
|
|
3613
|
-
const r = Object.entries(
|
|
3613
|
+
const r = Object.entries(Gt).find((s) => e.startsWith(s[1])), t = r ? r[1] : "", n = e.replace(t, "");
|
|
3614
3614
|
return /^\d+$/.test(n) ? {
|
|
3615
3615
|
countryCode: t,
|
|
3616
3616
|
phoneNumber: n
|
|
@@ -3618,9 +3618,9 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3618
3618
|
countryCode: "",
|
|
3619
3619
|
phoneNumber: ""
|
|
3620
3620
|
};
|
|
3621
|
-
}, ai = "44", ii = /^[0-9 ]+$/, oi =
|
|
3622
|
-
const r = /* @__PURE__ */ Ve(/* @__PURE__ */
|
|
3623
|
-
return St(/* @__PURE__ */
|
|
3621
|
+
}, ai = "44", ii = /^[0-9 ]+$/, oi = et("string"), li = et("phone"), ci = (e) => {
|
|
3622
|
+
const r = /* @__PURE__ */ Ve(/* @__PURE__ */ le(e("validation_country_code")), /* @__PURE__ */ Ht(ii, e("validation_country_code"))), t = /* @__PURE__ */ Ve(/* @__PURE__ */ le(e("validation_phone")), /* @__PURE__ */ Ze(1, e("validation_phone")), /* @__PURE__ */ Kt((n) => n.replace(/[^0-9]/g, "")));
|
|
3623
|
+
return St(/* @__PURE__ */ ke({
|
|
3624
3624
|
countryCode: r,
|
|
3625
3625
|
phoneNumber: t
|
|
3626
3626
|
}));
|
|
@@ -3628,16 +3628,16 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3628
3628
|
input: e,
|
|
3629
3629
|
onSubmitSuccess: r
|
|
3630
3630
|
}) => {
|
|
3631
|
-
var
|
|
3632
|
-
const t = e.key ? (
|
|
3631
|
+
var _;
|
|
3632
|
+
const t = e.key ? (_ = q.current$.value.flow) == null ? void 0 : _.data.submissions[e.key] : void 0, {
|
|
3633
3633
|
t: n
|
|
3634
|
-
} =
|
|
3634
|
+
} = ne(), [s, i] = _e(), a = oi(t) ? si(t.value) : li(t) ? t.value : void 0, {
|
|
3635
3635
|
register: o,
|
|
3636
3636
|
handleSubmit: u,
|
|
3637
3637
|
formState: {
|
|
3638
3638
|
errors: f
|
|
3639
3639
|
},
|
|
3640
|
-
watch:
|
|
3640
|
+
watch: v
|
|
3641
3641
|
} = Ct({
|
|
3642
3642
|
defaultValues: {
|
|
3643
3643
|
countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ?? ai,
|
|
@@ -3645,38 +3645,38 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3645
3645
|
},
|
|
3646
3646
|
resolver: ci(n)
|
|
3647
3647
|
}), {
|
|
3648
|
-
ref:
|
|
3648
|
+
ref: b,
|
|
3649
3649
|
...p
|
|
3650
3650
|
} = o("phoneNumber", {
|
|
3651
3651
|
required: !e.config.optional
|
|
3652
|
-
}),
|
|
3652
|
+
}), y = ye(), C = v("countryCode");
|
|
3653
3653
|
return Me(() => {
|
|
3654
|
-
|
|
3654
|
+
y.current && (y.current.focus(), y.current.select());
|
|
3655
3655
|
}, []), c("form", {
|
|
3656
3656
|
noValidate: !0,
|
|
3657
3657
|
class: "flex flex-col gap-1 p-2.5",
|
|
3658
3658
|
onSubmit: u((k) => {
|
|
3659
|
-
const
|
|
3659
|
+
const E = k.phoneNumber.replace(/[^0-9]/g, ""), g = k.countryCode.replace(/[^0-9]/g, "");
|
|
3660
3660
|
i(void 0);
|
|
3661
|
-
const
|
|
3662
|
-
if (
|
|
3661
|
+
const N = e.config.minChars ?? 7, V = E.length + g.length;
|
|
3662
|
+
if (V < N)
|
|
3663
3663
|
return i(n("validation_phone_min_chars", {
|
|
3664
|
-
count:
|
|
3664
|
+
count: N
|
|
3665
3665
|
}));
|
|
3666
|
-
const
|
|
3667
|
-
if (
|
|
3666
|
+
const M = e.config.maxChars;
|
|
3667
|
+
if (M != null && V > M)
|
|
3668
3668
|
return i(n("validation_max_chars", {
|
|
3669
|
-
count:
|
|
3669
|
+
count: M
|
|
3670
3670
|
}));
|
|
3671
3671
|
e.config.submissionFormat === "phone" ? r({
|
|
3672
3672
|
type: "phone",
|
|
3673
3673
|
value: {
|
|
3674
|
-
countryCode:
|
|
3675
|
-
phoneNumber:
|
|
3674
|
+
countryCode: g,
|
|
3675
|
+
phoneNumber: E
|
|
3676
3676
|
}
|
|
3677
3677
|
}) : r({
|
|
3678
3678
|
type: "string",
|
|
3679
|
-
value:
|
|
3679
|
+
value: C + k.phoneNumber
|
|
3680
3680
|
});
|
|
3681
3681
|
}),
|
|
3682
3682
|
children: [c("div", {
|
|
@@ -3687,14 +3687,14 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3687
3687
|
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",
|
|
3688
3688
|
htmlFor: `isdk_phone_${e.key}`,
|
|
3689
3689
|
children: [c("span", {
|
|
3690
|
-
children: ["+",
|
|
3690
|
+
children: ["+", C]
|
|
3691
3691
|
}), c("select", {
|
|
3692
3692
|
...o("countryCode", {}),
|
|
3693
3693
|
id: `isdk_phone_${e.key}`,
|
|
3694
3694
|
class: "absolute inset-0 opacity-0",
|
|
3695
|
-
children: Object.entries(
|
|
3696
|
-
value:
|
|
3697
|
-
children: [k, " (+",
|
|
3695
|
+
children: Object.entries(Gt).map(([k, E]) => c("option", {
|
|
3696
|
+
value: E,
|
|
3697
|
+
children: [k, " (+", E, ")"]
|
|
3698
3698
|
}, k))
|
|
3699
3699
|
})]
|
|
3700
3700
|
}), c("input", {
|
|
@@ -3707,9 +3707,9 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3707
3707
|
autoCorrect: "off",
|
|
3708
3708
|
autoFocus: !0,
|
|
3709
3709
|
ref: (k) => {
|
|
3710
|
-
k && (
|
|
3710
|
+
k && (y.current = k), b(k);
|
|
3711
3711
|
},
|
|
3712
|
-
class:
|
|
3712
|
+
class: Ye({
|
|
3713
3713
|
optional: e.config.optional,
|
|
3714
3714
|
className: "min-w-0 flex-1 rounded-r-full"
|
|
3715
3715
|
}),
|
|
@@ -3718,15 +3718,15 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3718
3718
|
class: "absolute bottom-0 right-1 top-0",
|
|
3719
3719
|
onClick: () => r(null)
|
|
3720
3720
|
})]
|
|
3721
|
-
}), c(
|
|
3722
|
-
}), c(
|
|
3721
|
+
}), c(Be, {})]
|
|
3722
|
+
}), c(tt, {
|
|
3723
3723
|
error: f.countryCode || f.phoneNumber || {
|
|
3724
3724
|
message: s
|
|
3725
3725
|
}
|
|
3726
3726
|
})]
|
|
3727
3727
|
});
|
|
3728
|
-
}, yt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)),
|
|
3729
|
-
time:
|
|
3728
|
+
}, yt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), Tr = (e, r, t, n) => t !== void 0 && n * 1e3 > Ur ? e("submission_available_at", {
|
|
3729
|
+
time: qr(t, r)
|
|
3730
3730
|
}) : e("submission_cooldown", {
|
|
3731
3731
|
count: n
|
|
3732
3732
|
}), di = ({
|
|
@@ -3736,19 +3736,19 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3736
3736
|
const {
|
|
3737
3737
|
t,
|
|
3738
3738
|
locale: n
|
|
3739
|
-
} =
|
|
3739
|
+
} = ne(), {
|
|
3740
3740
|
availableAt: s
|
|
3741
|
-
} = e.config, [i, a] =
|
|
3742
|
-
|
|
3743
|
-
const
|
|
3744
|
-
if (a(
|
|
3741
|
+
} = e.config, [i, a] = _e(() => yt(s)), [o, u] = _e("");
|
|
3742
|
+
Wr(() => {
|
|
3743
|
+
const v = yt(s);
|
|
3744
|
+
if (a(v), v === 0)
|
|
3745
3745
|
return;
|
|
3746
|
-
u(
|
|
3747
|
-
const
|
|
3746
|
+
u(Tr(t, n, s, v));
|
|
3747
|
+
const b = setInterval(() => {
|
|
3748
3748
|
const p = yt(s);
|
|
3749
|
-
a(p), !(p > 0) && (clearInterval(
|
|
3749
|
+
a(p), !(p > 0) && (clearInterval(b), u(t("submission_cooldown_ready")));
|
|
3750
3750
|
}, 250);
|
|
3751
|
-
return () => clearInterval(
|
|
3751
|
+
return () => clearInterval(b);
|
|
3752
3752
|
}, [s, n, t]);
|
|
3753
3753
|
const f = i > 0;
|
|
3754
3754
|
return c("div", {
|
|
@@ -3785,14 +3785,14 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3785
3785
|
id: "submit-cooldown",
|
|
3786
3786
|
"aria-hidden": "true",
|
|
3787
3787
|
class: "text-neutral-11 text-xs",
|
|
3788
|
-
children:
|
|
3788
|
+
children: Tr(t, n, s, i)
|
|
3789
3789
|
}), c("p", {
|
|
3790
3790
|
role: "status",
|
|
3791
3791
|
class: "sr-only",
|
|
3792
3792
|
children: o
|
|
3793
3793
|
})]
|
|
3794
3794
|
});
|
|
3795
|
-
}, fi = 160,
|
|
3795
|
+
}, fi = 160, Dr = (e) => {
|
|
3796
3796
|
e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, fi)}px`;
|
|
3797
3797
|
}, hi = {
|
|
3798
3798
|
date: {
|
|
@@ -3813,7 +3813,7 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3813
3813
|
inputMode: "url",
|
|
3814
3814
|
formNoValidate: !0
|
|
3815
3815
|
}
|
|
3816
|
-
}, pi =
|
|
3816
|
+
}, pi = et("string"), mi = (e, r) => {
|
|
3817
3817
|
const t = {
|
|
3818
3818
|
maxLength: r("validation_max_chars", {
|
|
3819
3819
|
count: e.maxChars ?? 999
|
|
@@ -3822,22 +3822,22 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3822
3822
|
count: e.minChars ?? 1
|
|
3823
3823
|
})
|
|
3824
3824
|
};
|
|
3825
|
-
return St(/* @__PURE__ */
|
|
3825
|
+
return St(/* @__PURE__ */ ke({
|
|
3826
3826
|
text: {
|
|
3827
|
-
date: /* @__PURE__ */ Ve(/* @__PURE__ */
|
|
3828
|
-
email: /* @__PURE__ */ Ve(/* @__PURE__ */
|
|
3829
|
-
text: /* @__PURE__ */ Ve(/* @__PURE__ */
|
|
3830
|
-
url: /* @__PURE__ */ Ve(/* @__PURE__ */
|
|
3827
|
+
date: /* @__PURE__ */ Ve(/* @__PURE__ */ le(r("validation_date")), /* @__PURE__ */ Ht(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
|
|
3828
|
+
email: /* @__PURE__ */ Ve(/* @__PURE__ */ le(r("validation_email")), /* @__PURE__ */ Yr(r("validation_email")), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3829
|
+
text: /* @__PURE__ */ Ve(/* @__PURE__ */ le(), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3830
|
+
url: /* @__PURE__ */ Ve(/* @__PURE__ */ le(r("validation_url")), /* @__PURE__ */ tn(r("validation_url")), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ct(e.maxChars ?? 1 / 0, t.maxLength))
|
|
3831
3831
|
}[e.format]
|
|
3832
3832
|
}));
|
|
3833
3833
|
}, yi = ({
|
|
3834
3834
|
input: e,
|
|
3835
3835
|
onSubmitSuccess: r
|
|
3836
3836
|
}) => {
|
|
3837
|
-
var
|
|
3837
|
+
var _;
|
|
3838
3838
|
const {
|
|
3839
3839
|
t
|
|
3840
|
-
} =
|
|
3840
|
+
} = ne(), n = e.key ? (_ = q.current$.value.flow) == null ? void 0 : _.data.submissions[e.key] : void 0, s = e.config.defaultValue, i = e.config.multiline === !0 && e.config.format === "text", {
|
|
3841
3841
|
register: a,
|
|
3842
3842
|
handleSubmit: o,
|
|
3843
3843
|
watch: u,
|
|
@@ -3850,15 +3850,15 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3850
3850
|
},
|
|
3851
3851
|
resolver: mi(e.config, t)
|
|
3852
3852
|
}), {
|
|
3853
|
-
ref:
|
|
3854
|
-
...
|
|
3853
|
+
ref: v,
|
|
3854
|
+
...b
|
|
3855
3855
|
} = a("text", {
|
|
3856
3856
|
required: !e.config.optional
|
|
3857
3857
|
}), p = ye();
|
|
3858
3858
|
Me(() => {
|
|
3859
|
-
p.current && (p.current instanceof HTMLTextAreaElement &&
|
|
3859
|
+
p.current && (p.current instanceof HTMLTextAreaElement && Dr(p.current), p.current.focus(), p.current.select());
|
|
3860
3860
|
}, []);
|
|
3861
|
-
const
|
|
3861
|
+
const y = e.config.maxChars, C = i && y !== void 0 ? u("text").length : void 0;
|
|
3862
3862
|
return c("form", {
|
|
3863
3863
|
noValidate: !0,
|
|
3864
3864
|
class: "flex flex-col gap-1 p-2.5",
|
|
@@ -3874,37 +3874,37 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3874
3874
|
class: "relative min-w-0 flex-1",
|
|
3875
3875
|
children: [i ? c("textarea", {
|
|
3876
3876
|
id: "chat-input",
|
|
3877
|
-
...
|
|
3877
|
+
...b,
|
|
3878
3878
|
rows: 2,
|
|
3879
|
-
maxLength:
|
|
3879
|
+
maxLength: y,
|
|
3880
3880
|
autoFocus: !0,
|
|
3881
|
-
"aria-describedby":
|
|
3882
|
-
onInput: (k) =>
|
|
3881
|
+
"aria-describedby": C !== void 0 ? "chat-input-count" : void 0,
|
|
3882
|
+
onInput: (k) => Dr(k.currentTarget),
|
|
3883
3883
|
onKeyDown: (k) => {
|
|
3884
|
-
var
|
|
3885
|
-
k.key === "Enter" && (k.ctrlKey || k.metaKey) && (k.preventDefault(), (
|
|
3884
|
+
var E;
|
|
3885
|
+
k.key === "Enter" && (k.ctrlKey || k.metaKey) && (k.preventDefault(), (E = k.currentTarget.form) == null || E.requestSubmit());
|
|
3886
3886
|
},
|
|
3887
3887
|
ref: (k) => {
|
|
3888
|
-
k && (p.current = k),
|
|
3888
|
+
k && (p.current = k), v(k);
|
|
3889
3889
|
},
|
|
3890
3890
|
placeholder: e.config.placeholder,
|
|
3891
|
-
class:
|
|
3891
|
+
class: Ye({
|
|
3892
3892
|
optional: !!e.config.optional,
|
|
3893
3893
|
className: "block w-full resize-none overflow-y-auto rounded-2xl"
|
|
3894
3894
|
})
|
|
3895
3895
|
}) : c("input", {
|
|
3896
3896
|
id: "chat-input",
|
|
3897
|
-
...
|
|
3897
|
+
...b,
|
|
3898
3898
|
...hi[e.config.format],
|
|
3899
3899
|
autocomplete: "off",
|
|
3900
3900
|
autoCapitalize: "off",
|
|
3901
3901
|
autoCorrect: "off",
|
|
3902
3902
|
autoFocus: !0,
|
|
3903
3903
|
ref: (k) => {
|
|
3904
|
-
k && (p.current = k),
|
|
3904
|
+
k && (p.current = k), v(k);
|
|
3905
3905
|
},
|
|
3906
3906
|
placeholder: e.config.placeholder,
|
|
3907
|
-
class:
|
|
3907
|
+
class: Ye({
|
|
3908
3908
|
optional: !!e.config.optional,
|
|
3909
3909
|
className: "w-full rounded-full"
|
|
3910
3910
|
})
|
|
@@ -3915,12 +3915,12 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3915
3915
|
onClick: () => r(null)
|
|
3916
3916
|
}
|
|
3917
3917
|
)]
|
|
3918
|
-
}), c(
|
|
3919
|
-
}),
|
|
3918
|
+
}), c(Be, {})]
|
|
3919
|
+
}), C !== void 0 && y !== void 0 && c("p", {
|
|
3920
3920
|
id: "chat-input-count",
|
|
3921
3921
|
class: "text-neutral-10 px-3 text-right text-xs",
|
|
3922
|
-
children: [
|
|
3923
|
-
}), c(
|
|
3922
|
+
children: [C, "/", y]
|
|
3923
|
+
}), c(tt, {
|
|
3924
3924
|
error: f.text
|
|
3925
3925
|
})]
|
|
3926
3926
|
});
|
|
@@ -3938,7 +3938,7 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3938
3938
|
analytics: r
|
|
3939
3939
|
}) => {
|
|
3940
3940
|
var i;
|
|
3941
|
-
const t = (i =
|
|
3941
|
+
const t = (i = q.current$.value.flow) == null ? void 0 : i.data.currentInput, n = ye(null), s = () => ce.onInteractionFn$.value();
|
|
3942
3942
|
return Me(() => {
|
|
3943
3943
|
var a;
|
|
3944
3944
|
(a = n.current) == null || a.scrollTo({
|
|
@@ -3956,7 +3956,7 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3956
3956
|
return c(a, {
|
|
3957
3957
|
logger: e,
|
|
3958
3958
|
analytics: r,
|
|
3959
|
-
onSubmitSuccess:
|
|
3959
|
+
onSubmitSuccess: ce.onSubmitSuccessFn$.value,
|
|
3960
3960
|
input: t
|
|
3961
3961
|
});
|
|
3962
3962
|
})() : c("div", {
|
|
@@ -3964,12 +3964,12 @@ const Vr = 27, Mr = 12, Lr = 10, Xa = Ze("enum"), Ya = (e, r) => {
|
|
|
3964
3964
|
children: [c("input", {
|
|
3965
3965
|
"aria-hidden": "true",
|
|
3966
3966
|
id: "chat-input",
|
|
3967
|
-
class:
|
|
3967
|
+
class: Ye({
|
|
3968
3968
|
optional: !1,
|
|
3969
3969
|
className: "flex-grow rounded-full"
|
|
3970
3970
|
}),
|
|
3971
3971
|
disabled: !0
|
|
3972
|
-
}), c(
|
|
3972
|
+
}), c(Be, {
|
|
3973
3973
|
disabled: !0,
|
|
3974
3974
|
"aria-hidden": "true",
|
|
3975
3975
|
tabIndex: -1
|
|
@@ -4016,21 +4016,21 @@ var Ci = function(r, t, n) {
|
|
|
4016
4016
|
return wn(s) ? ki(s, t, n) : s;
|
|
4017
4017
|
}));
|
|
4018
4018
|
};
|
|
4019
|
-
const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g,
|
|
4019
|
+
const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]+)\]\(([^)]+)\)/, Ai = /(https?:\/\/[^\s]+)/g, Ii = /_(.*?)_/g, Fi = /\*\*(.*?)\*\*/g, Vi = /(\\n|\n)/g, Or = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Mi = (e) => {
|
|
4020
4020
|
const r = ot(e, Si, (o, u) => {
|
|
4021
|
-
const [, f,
|
|
4022
|
-
return
|
|
4023
|
-
class:
|
|
4024
|
-
href:
|
|
4025
|
-
children: f ??
|
|
4026
|
-
},
|
|
4021
|
+
const [, f, v] = o.match(Ei) ?? [];
|
|
4022
|
+
return v ? c("a", {
|
|
4023
|
+
class: Or,
|
|
4024
|
+
href: v,
|
|
4025
|
+
children: f ?? v
|
|
4026
|
+
}, v + u) : c("span", {
|
|
4027
4027
|
children: "INVALID LINK"
|
|
4028
4028
|
});
|
|
4029
|
-
}), t = ot(r,
|
|
4030
|
-
class:
|
|
4029
|
+
}), t = ot(r, Ai, (o, u) => c("a", {
|
|
4030
|
+
class: Or,
|
|
4031
4031
|
href: o,
|
|
4032
4032
|
children: o
|
|
4033
|
-
}, o + u)), n = ot(t,
|
|
4033
|
+
}, o + u)), n = ot(t, Ii, (o, u) => c("em", {
|
|
4034
4034
|
children: o
|
|
4035
4035
|
}, o + u)), s = ot(n, Fi, (o, u) => c("strong", {
|
|
4036
4036
|
children: o
|
|
@@ -4051,7 +4051,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4051
4051
|
defaultVariants: {
|
|
4052
4052
|
side: "left"
|
|
4053
4053
|
}
|
|
4054
|
-
}),
|
|
4054
|
+
}), Ni = ({
|
|
4055
4055
|
children: e,
|
|
4056
4056
|
className: r,
|
|
4057
4057
|
animate: t,
|
|
@@ -4068,7 +4068,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4068
4068
|
}),
|
|
4069
4069
|
...s,
|
|
4070
4070
|
children: e
|
|
4071
|
-
}),
|
|
4071
|
+
}), Ri = ({
|
|
4072
4072
|
message: e
|
|
4073
4073
|
}) => c("div", {
|
|
4074
4074
|
class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
|
|
@@ -4097,9 +4097,9 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4097
4097
|
...r
|
|
4098
4098
|
}) => c("div", {
|
|
4099
4099
|
"aria-hidden": !0,
|
|
4100
|
-
children:
|
|
4100
|
+
children: ce.isBotTyping$.value === !0 ? c("div", {
|
|
4101
4101
|
"data-testid": "typing-indicator",
|
|
4102
|
-
class:
|
|
4102
|
+
class: Qe("flex gap-1 p-4", e),
|
|
4103
4103
|
...r,
|
|
4104
4104
|
children: Array.from({
|
|
4105
4105
|
length: 3
|
|
@@ -4110,7 +4110,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4110
4110
|
}
|
|
4111
4111
|
}))
|
|
4112
4112
|
}) : void 0
|
|
4113
|
-
}),
|
|
4113
|
+
}), Di = {
|
|
4114
4114
|
bot: "left",
|
|
4115
4115
|
user: "right"
|
|
4116
4116
|
}, Oi = xt("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]", {
|
|
@@ -4127,12 +4127,12 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4127
4127
|
}) => {
|
|
4128
4128
|
const {
|
|
4129
4129
|
t: r
|
|
4130
|
-
} =
|
|
4130
|
+
} = ne(), t = q.current$.value.flow, n = (t == null ? void 0 : t.data.messages) ?? [], s = t ? zt(t) : void 0;
|
|
4131
4131
|
return c("ol", {
|
|
4132
4132
|
"aria-label": r("chat_messages"),
|
|
4133
4133
|
"aria-live": "polite",
|
|
4134
4134
|
class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
|
|
4135
|
-
children: [n.map((i, a) => c(
|
|
4135
|
+
children: [n.map((i, a) => c(Ce, {
|
|
4136
4136
|
children: c("li", {
|
|
4137
4137
|
class: "flex",
|
|
4138
4138
|
tabIndex: a === n.length - 1 ? -1 : void 0,
|
|
@@ -4145,19 +4145,19 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4145
4145
|
children: o.text
|
|
4146
4146
|
})).with({
|
|
4147
4147
|
type: "text",
|
|
4148
|
-
author:
|
|
4148
|
+
author: Hn.union("bot", "user")
|
|
4149
4149
|
}, (o) => {
|
|
4150
4150
|
const u = a === n.length - 1, f = o.author === "bot" ? Mi(o.text) : o.text;
|
|
4151
|
-
return c(
|
|
4152
|
-
children: c(
|
|
4151
|
+
return c(Ce, {
|
|
4152
|
+
children: c(Ni, {
|
|
4153
4153
|
animate: u,
|
|
4154
|
-
side:
|
|
4154
|
+
side: Di[o.author],
|
|
4155
4155
|
children: f
|
|
4156
4156
|
}, a)
|
|
4157
4157
|
});
|
|
4158
4158
|
}).with({
|
|
4159
4159
|
type: "link"
|
|
4160
|
-
}, (o) => c(
|
|
4160
|
+
}, (o) => c(Ri, {
|
|
4161
4161
|
message: o
|
|
4162
4162
|
})).with({
|
|
4163
4163
|
type: "image"
|
|
@@ -4179,9 +4179,9 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4179
4179
|
type: "loading"
|
|
4180
4180
|
}, (o) => {
|
|
4181
4181
|
const u = n[n.length - 1];
|
|
4182
|
-
return !(o === u) ||
|
|
4182
|
+
return !(o === u) || ce.isBotTyping$.value || t != null && t.data.isFinished ? null : c("div", {
|
|
4183
4183
|
class: "flex flex-grow flex-col items-center justify-center gap-2",
|
|
4184
|
-
children: [c(
|
|
4184
|
+
children: [c(Ut, {
|
|
4185
4185
|
"aria-hidden": o.text ? "true" : void 0,
|
|
4186
4186
|
class: "text-neutral-6 h-8 w-8"
|
|
4187
4187
|
}), o.text ? c("p", {
|
|
@@ -4193,7 +4193,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4193
4193
|
}).exhaustive()]
|
|
4194
4194
|
})
|
|
4195
4195
|
}, a)), c("li", {
|
|
4196
|
-
class:
|
|
4196
|
+
class: ce.captchaVisible$.value ? "flex" : "hidden",
|
|
4197
4197
|
children: c("div", {
|
|
4198
4198
|
"data-captcha-slot": !0,
|
|
4199
4199
|
tabIndex: -1,
|
|
@@ -4211,41 +4211,41 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4211
4211
|
}) => {
|
|
4212
4212
|
const {
|
|
4213
4213
|
flow: s
|
|
4214
|
-
} =
|
|
4215
|
-
|
|
4216
|
-
const i =
|
|
4214
|
+
} = q.current$.value;
|
|
4215
|
+
Oe(s, "Flow is required to exist to show chatbot body");
|
|
4216
|
+
const i = q.viewState$.value, {
|
|
4217
4217
|
chatRef: a,
|
|
4218
4218
|
chatService: o
|
|
4219
4219
|
} = Kn(), {
|
|
4220
4220
|
t: u
|
|
4221
|
-
} =
|
|
4221
|
+
} = ne(), [f, v] = _e();
|
|
4222
4222
|
return Me(() => {
|
|
4223
|
-
i === "maximised" &&
|
|
4223
|
+
i === "maximised" && ce.scrollToEnd();
|
|
4224
4224
|
}, [i]), Me(() => {
|
|
4225
|
-
var
|
|
4225
|
+
var M;
|
|
4226
4226
|
const {
|
|
4227
|
-
state:
|
|
4227
|
+
state: b,
|
|
4228
4228
|
flow: p
|
|
4229
|
-
} =
|
|
4230
|
-
if (
|
|
4229
|
+
} = q.current$.peek();
|
|
4230
|
+
if (b !== "loaded")
|
|
4231
4231
|
throw new Error(u("invalid_state"));
|
|
4232
|
-
let
|
|
4233
|
-
if (
|
|
4232
|
+
let y = p.data.nodeHistory.at(-1);
|
|
4233
|
+
if (ce.scrollToEnd(), q.setInput(void 0), p.data.isFinished)
|
|
4234
4234
|
return;
|
|
4235
|
-
const
|
|
4236
|
-
const O =
|
|
4237
|
-
!O || O.data.hasInteracted || (
|
|
4235
|
+
const C = () => {
|
|
4236
|
+
const O = q.current$.peek().flow;
|
|
4237
|
+
!O || O.data.hasInteracted || (q.markAsInteracted(), dr(t, O, "FLOW_INTERACT"));
|
|
4238
4238
|
};
|
|
4239
|
-
|
|
4239
|
+
ce.onInteractionFn$.value = C, y === void 0 ? (y = Gr(s.nodes).id, q.setCurrentNodeId(y), dr(t, p, "FLOW_START")) : q.removeMessagesSentByNodeIds([y, jt]);
|
|
4240
4240
|
const {
|
|
4241
|
-
interpret:
|
|
4241
|
+
interpret: _,
|
|
4242
4242
|
abort: k,
|
|
4243
|
-
undo:
|
|
4243
|
+
undo: E
|
|
4244
4244
|
} = ks({
|
|
4245
4245
|
context: s.context,
|
|
4246
4246
|
analytics: {
|
|
4247
4247
|
service: t,
|
|
4248
|
-
customProperties: (
|
|
4248
|
+
customProperties: (M = s.analytics) == null ? void 0 : M.customProperties
|
|
4249
4249
|
},
|
|
4250
4250
|
apiClient: r,
|
|
4251
4251
|
logger: e,
|
|
@@ -4255,21 +4255,21 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4255
4255
|
t: u,
|
|
4256
4256
|
getApplicationRecovery: () => {
|
|
4257
4257
|
var O;
|
|
4258
|
-
return (O =
|
|
4258
|
+
return (O = q.current$.peek().flow) == null ? void 0 : O.data.applicationRecovery;
|
|
4259
4259
|
},
|
|
4260
|
-
setApplicationRecovery:
|
|
4261
|
-
persistWriteBarrier: () =>
|
|
4260
|
+
setApplicationRecovery: q.setApplicationRecovery,
|
|
4261
|
+
persistWriteBarrier: () => q.persistWriteBarrier(p),
|
|
4262
4262
|
// We need to get fresh submissions, that’s why we call `peek` here.
|
|
4263
4263
|
getSubmissions: () => {
|
|
4264
4264
|
var O;
|
|
4265
|
-
return (O =
|
|
4265
|
+
return (O = q.current$.peek().flow) == null ? void 0 : O.data.submissions;
|
|
4266
4266
|
},
|
|
4267
|
-
onInterpret: (O) =>
|
|
4267
|
+
onInterpret: (O) => q.setCurrentNodeId(O.id),
|
|
4268
4268
|
onFlowEnd: async () => {
|
|
4269
|
-
var
|
|
4270
|
-
|
|
4271
|
-
const O =
|
|
4272
|
-
|
|
4269
|
+
var K;
|
|
4270
|
+
q.markAsFinished();
|
|
4271
|
+
const O = q.current$.peek().flow;
|
|
4272
|
+
Oe(O), t.log({
|
|
4273
4273
|
event: "FLOW_END",
|
|
4274
4274
|
properties: {
|
|
4275
4275
|
flow_id: s.id,
|
|
@@ -4278,23 +4278,23 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4278
4278
|
flow_build: s.build,
|
|
4279
4279
|
job: s.job
|
|
4280
4280
|
},
|
|
4281
|
-
customProperties: (
|
|
4281
|
+
customProperties: (K = s.analytics) == null ? void 0 : K.customProperties
|
|
4282
4282
|
});
|
|
4283
4283
|
}
|
|
4284
|
-
}),
|
|
4285
|
-
|
|
4286
|
-
},
|
|
4284
|
+
}), g = y, N = () => {
|
|
4285
|
+
v(() => E), _(g);
|
|
4286
|
+
}, V = new AbortController();
|
|
4287
4287
|
return p.offerResume ? Gs({
|
|
4288
4288
|
chatService: o,
|
|
4289
4289
|
t: u,
|
|
4290
|
-
signal:
|
|
4291
|
-
}).then((O) => (
|
|
4292
|
-
O instanceof
|
|
4293
|
-
}) :
|
|
4294
|
-
|
|
4290
|
+
signal: V.signal
|
|
4291
|
+
}).then((O) => (q.settleResume(p), O ? N() : (q.restart(), Gn.flushStateData()))).catch((O) => {
|
|
4292
|
+
O instanceof jr || e.error("Resume prompt failed", O);
|
|
4293
|
+
}) : N(), () => {
|
|
4294
|
+
V.abort(), ce.onInteractionFn$.value === C && (ce.onInteractionFn$.value = () => {
|
|
4295
4295
|
}), k();
|
|
4296
4296
|
};
|
|
4297
|
-
}, [t, r, o, e, s, n, u]), c(
|
|
4297
|
+
}, [t, r, o, e, s, n, u]), c(Ce, {
|
|
4298
4298
|
children: [c("div", {
|
|
4299
4299
|
class: "relative flex min-h-0 w-full max-w-full flex-grow flex-col",
|
|
4300
4300
|
children: [c("div", {
|
|
@@ -4307,18 +4307,18 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4307
4307
|
WebkitOverflowScrolling: "touch"
|
|
4308
4308
|
},
|
|
4309
4309
|
children: c(Bi, {
|
|
4310
|
-
lastSentMessageFooter: !
|
|
4310
|
+
lastSentMessageFooter: !zt(s) || !f ? null : c($i, {
|
|
4311
4311
|
undoFn: f
|
|
4312
4312
|
})
|
|
4313
4313
|
})
|
|
4314
|
-
}),
|
|
4314
|
+
}), ce.isReadingHistory$.value && !s.data.isFinished && !ce.isBotTyping$.value && c("div", {
|
|
4315
4315
|
class: "absolute bottom-2 left-1/2 -translate-x-1/2",
|
|
4316
|
-
children: c(
|
|
4316
|
+
children: c(Hr, {
|
|
4317
4317
|
class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
|
|
4318
4318
|
"aria-label": u("jump_to_current"),
|
|
4319
4319
|
onClick: () => {
|
|
4320
|
-
var p,
|
|
4321
|
-
|
|
4320
|
+
var p, y;
|
|
4321
|
+
ce.scrollToEnd(), (y = ((p = a.current) == null ? void 0 : p.querySelector('li[tabindex="-1"]')) ?? a.current) == null || y.focus({
|
|
4322
4322
|
preventScroll: !0
|
|
4323
4323
|
});
|
|
4324
4324
|
},
|
|
@@ -4335,16 +4335,16 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]
|
|
|
4335
4335
|
}) => {
|
|
4336
4336
|
const {
|
|
4337
4337
|
t: r
|
|
4338
|
-
} =
|
|
4338
|
+
} = ne();
|
|
4339
4339
|
return c("div", {
|
|
4340
4340
|
class: "flex flex-1 items-center justify-end px-1",
|
|
4341
|
-
children: c(
|
|
4341
|
+
children: c(Hr, {
|
|
4342
4342
|
"aria-label": r("undo"),
|
|
4343
4343
|
onClick: async () => {
|
|
4344
4344
|
const {
|
|
4345
4345
|
flow: t
|
|
4346
|
-
} =
|
|
4347
|
-
|
|
4346
|
+
} = q.current$.peek();
|
|
4347
|
+
Oe(t), e(t.data.nodeHistory);
|
|
4348
4348
|
},
|
|
4349
4349
|
children: c("path", {
|
|
4350
4350
|
d: "M3 13h2.67l6.66-6.67a1.9 1.9 0 0 0 0-2.66 1.91 1.91 0 0 0-2.66 0L3 10.33V13Zm4.6-7.25 2.67 2.67"
|