@inploi/plugin-chatbot 14.13.1 → 14.13.3
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 +4 -4
- package/dist/{chatbot-body-ea673b1c.js → chatbot-body-0eb387f9.js} +571 -556
- package/dist/{chatbot-body-2dd1b047.cjs → chatbot-body-dd27d81b.cjs} +2 -2
- package/dist/components/chat-input/chat-input.multiple-choice.test.d.ts +1 -0
- package/dist/i18n.d.ts +18 -12
- package/dist/{index-8c30932d.js → index-89864783.js} +68 -67
- package/dist/index-93dabc80.cjs +5 -0
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +2 -2
- package/dist/index-4ef46fa9.cjs +0 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var Sn = Object.defineProperty;
|
|
2
2
|
var En = (e, r, t) => r in e ? Sn(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
3
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
|
|
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 u, e as Qe, i as xt, j as ke, _ as ye, n as Oe, q as Le, r as be, L as Ut, F as Un, t as Wr, A as zr, B as Wn, G as zn, J as et, K as ir, M as ae, O as ue, P as Hn, Q as Kn, V as Gn, W as Jn, X as Hr, Y as Zn } from "./index-89864783.js";
|
|
5
5
|
import "@inploi/sdk";
|
|
6
|
-
var Xn = "9.10.
|
|
6
|
+
var Xn = "9.10.1", Kr = `https://sdk.inploi.com/@inploi/flows@${Xn}/cdn/captcha/index.html`, Yn = new URL(Kr).origin, or = 3e4, Qn = 5 * 6e4, es = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", Ft = /* @__PURE__ */ new WeakMap(), ts = (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;
|
|
@@ -12,9 +12,9 @@ var Xn = "9.10.0", Kr = `https://sdk.inploi.com/@inploi/flows@${Xn}/cdn/captcha/
|
|
|
12
12
|
throw Ft.delete(e), t;
|
|
13
13
|
}), Ft.set(e, r)), r;
|
|
14
14
|
}, rs = (e, r = {}) => new Promise((t, n) => {
|
|
15
|
-
let { signal: s, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r,
|
|
15
|
+
let { signal: s, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r, c = !1, f = () => {
|
|
16
16
|
}, v = (_) => {
|
|
17
|
-
|
|
17
|
+
c || (c = !0, clearTimeout(y), s == null || s.removeEventListener("abort", p), f(), _());
|
|
18
18
|
}, b = (_) => v(() => n(new Error(_))), p = () => b("Captcha aborted"), y, C = (_) => {
|
|
19
19
|
clearTimeout(y), y = setTimeout(() => b("Captcha timed out"), _);
|
|
20
20
|
};
|
|
@@ -24,7 +24,7 @@ var Xn = "9.10.0", Kr = `https://sdk.inploi.com/@inploi/flows@${Xn}/cdn/captcha/
|
|
|
24
24
|
let _ = await ts(e);
|
|
25
25
|
if (_ === void 0)
|
|
26
26
|
return v(() => t(void 0));
|
|
27
|
-
if (
|
|
27
|
+
if (c)
|
|
28
28
|
return;
|
|
29
29
|
let k = document.createElement("iframe");
|
|
30
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));
|
|
@@ -80,16 +80,16 @@ var Xn = "9.10.0", Kr = `https://sdk.inploi.com/@inploi/flows@${Xn}/cdn/captcha/
|
|
|
80
80
|
case "integration": {
|
|
81
81
|
if (typeof a.value != "object" || Array.isArray(a.value))
|
|
82
82
|
return !1;
|
|
83
|
-
let o = Dt(a.value, i),
|
|
83
|
+
let o = Dt(a.value, i), c = { ...n, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
|
|
84
84
|
switch (typeof o) {
|
|
85
85
|
case "boolean":
|
|
86
|
-
return lt(
|
|
86
|
+
return lt(c, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
|
|
87
87
|
case "string":
|
|
88
|
-
return lt(
|
|
88
|
+
return lt(c, { submissions: { _temp: { value: o, type: "string" } }, context: r });
|
|
89
89
|
case "number":
|
|
90
|
-
return lt(
|
|
90
|
+
return lt(c, { submissions: { _temp: { value: o, type: "number" } }, context: r });
|
|
91
91
|
case "object":
|
|
92
|
-
return Array.isArray(o) && o.every((f) => typeof f == "string") ? lt(
|
|
92
|
+
return Array.isArray(o) && o.every((f) => typeof f == "string") ? lt(c, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
|
|
93
93
|
}
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
@@ -167,27 +167,27 @@ var Xn = "9.10.0", Kr = `https://sdk.inploi.com/@inploi/flows@${Xn}/cdn/captcha/
|
|
|
167
167
|
return !0;
|
|
168
168
|
}
|
|
169
169
|
}, ns = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, ss = (e, { context: r, submissions: t }) => e.replace(ns, (n, s, i = "") => {
|
|
170
|
-
let [a, ...o] = s.trim().split("."),
|
|
171
|
-
if (!
|
|
170
|
+
let [a, ...o] = s.trim().split("."), c = Br({ key: a, path: o, submissions: t, context: r });
|
|
171
|
+
if (!c)
|
|
172
172
|
return i;
|
|
173
|
-
switch (
|
|
173
|
+
switch (c.type) {
|
|
174
174
|
case "boolean":
|
|
175
|
-
return
|
|
175
|
+
return c.value === !0 ? "true" : "false";
|
|
176
176
|
case "file":
|
|
177
|
-
return
|
|
177
|
+
return c.value.map((f) => `${f.name} (${Ge(f.sizeKb)})`).join(", ");
|
|
178
178
|
case "enum":
|
|
179
|
-
return
|
|
179
|
+
return c.value.join(", ");
|
|
180
180
|
case "address":
|
|
181
|
-
return Object.values(
|
|
181
|
+
return Object.values(c.value).filter((f) => f && f.trim().length > 0).join(", ");
|
|
182
182
|
case "number":
|
|
183
183
|
case "string":
|
|
184
|
-
return
|
|
184
|
+
return c.value ? c.value.toString() : i;
|
|
185
185
|
case "phone":
|
|
186
|
-
return vt(
|
|
186
|
+
return vt(c.value);
|
|
187
187
|
case "integration": {
|
|
188
|
-
if (typeof
|
|
188
|
+
if (typeof c.value != "object" || Array.isArray(c.value))
|
|
189
189
|
break;
|
|
190
|
-
let f = Dt(
|
|
190
|
+
let f = Dt(c.value, o);
|
|
191
191
|
switch (typeof f) {
|
|
192
192
|
case "boolean":
|
|
193
193
|
return f === !0 ? "true" : "false";
|
|
@@ -211,12 +211,12 @@ function as(e) {
|
|
|
211
211
|
function Wt(e, r, t = "") {
|
|
212
212
|
const n = as(e), s = e == null ? void 0 : e.length, i = r !== void 0;
|
|
213
213
|
if (!n || i && s !== r) {
|
|
214
|
-
const a = t && `"${t}" `, o = i ? ` of length ${r}` : "",
|
|
215
|
-
throw new Error(a + "expected Uint8Array" + o + ", got " +
|
|
214
|
+
const a = t && `"${t}" `, o = i ? ` of length ${r}` : "", c = n ? `length=${s}` : `type=${typeof e}`;
|
|
215
|
+
throw new Error(a + "expected Uint8Array" + o + ", got " + c);
|
|
216
216
|
}
|
|
217
217
|
return e;
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function ur(e, r = !0) {
|
|
220
220
|
if (e.destroyed)
|
|
221
221
|
throw new Error("Hash instance has been destroyed");
|
|
222
222
|
if (r && e.finished)
|
|
@@ -242,7 +242,7 @@ const os = /* @__PURE__ */ (() => (
|
|
|
242
242
|
// @ts-ignore
|
|
243
243
|
typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function"
|
|
244
244
|
))(), ls = /* @__PURE__ */ Array.from({ length: 256 }, (e, r) => r.toString(16).padStart(2, "0"));
|
|
245
|
-
function
|
|
245
|
+
function us(e) {
|
|
246
246
|
if (Wt(e), os)
|
|
247
247
|
return e.toHex();
|
|
248
248
|
let r = "";
|
|
@@ -250,7 +250,7 @@ function cs(e) {
|
|
|
250
250
|
r += ls[e[t]];
|
|
251
251
|
return r;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function cs(e, r = {}) {
|
|
254
254
|
const t = (s, i) => e(i).update(s).digest(), n = e(void 0);
|
|
255
255
|
return t.outputLen = n.outputLen, t.blockLen = n.blockLen, t.create = (s) => e(s), Object.assign(t, r), Object.freeze(t);
|
|
256
256
|
}
|
|
@@ -279,14 +279,14 @@ class ps {
|
|
|
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
|
+
ur(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);
|
|
286
286
|
if (o === s) {
|
|
287
|
-
const
|
|
287
|
+
const c = Vt(r);
|
|
288
288
|
for (; s <= i - a; a += s)
|
|
289
|
-
this.process(
|
|
289
|
+
this.process(c, a);
|
|
290
290
|
continue;
|
|
291
291
|
}
|
|
292
292
|
n.set(r.subarray(a, a + o), this.pos), this.pos += o, a += o, this.pos === s && (this.process(t, 0), this.pos = 0);
|
|
@@ -294,17 +294,17 @@ class ps {
|
|
|
294
294
|
return this.length += r.length, this.roundClean(), this;
|
|
295
295
|
}
|
|
296
296
|
digestInto(r) {
|
|
297
|
-
|
|
297
|
+
ur(this), is(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
301
|
for (let b = a; b < s; b++)
|
|
302
302
|
t[b] = 0;
|
|
303
303
|
n.setBigUint64(s - 8, BigInt(this.length * 8), i), this.process(n, 0);
|
|
304
|
-
const o = Vt(r),
|
|
305
|
-
if (
|
|
304
|
+
const o = Vt(r), c = this.outputLen;
|
|
305
|
+
if (c % 4)
|
|
306
306
|
throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
307
|
-
const f =
|
|
307
|
+
const f = c / 4, v = this.get();
|
|
308
308
|
if (f > v.length)
|
|
309
309
|
throw new Error("_sha2: outputLen bigger than state");
|
|
310
310
|
for (let b = 0; b < f; b++)
|
|
@@ -325,7 +325,7 @@ class ps {
|
|
|
325
325
|
return this._cloneInto();
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
const
|
|
328
|
+
const Ie = /* @__PURE__ */ Uint32Array.from([
|
|
329
329
|
1779033703,
|
|
330
330
|
3144134277,
|
|
331
331
|
1013904242,
|
|
@@ -399,35 +399,35 @@ const Ae = /* @__PURE__ */ Uint32Array.from([
|
|
|
399
399
|
2756734187,
|
|
400
400
|
3204031479,
|
|
401
401
|
3329325298
|
|
402
|
-
]),
|
|
402
|
+
]), Fe = /* @__PURE__ */ new Uint32Array(64);
|
|
403
403
|
class ys extends ps {
|
|
404
404
|
constructor(r) {
|
|
405
405
|
super(64, r, 8, !1);
|
|
406
406
|
}
|
|
407
407
|
get() {
|
|
408
|
-
const { A: r, B: t, C: n, D: s, E: i, F: a, G: o, H:
|
|
409
|
-
return [r, t, n, s, i, a, o,
|
|
408
|
+
const { A: r, B: t, C: n, D: s, E: i, F: a, G: o, H: c } = this;
|
|
409
|
+
return [r, t, n, s, i, a, o, c];
|
|
410
410
|
}
|
|
411
411
|
// prettier-ignore
|
|
412
|
-
set(r, t, n, s, i, a, o,
|
|
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 =
|
|
412
|
+
set(r, t, n, s, i, a, o, c) {
|
|
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 = c | 0;
|
|
414
414
|
}
|
|
415
415
|
process(r, t) {
|
|
416
416
|
for (let b = 0; b < 16; b++, t += 4)
|
|
417
|
-
|
|
417
|
+
Fe[b] = r.getUint32(t, !1);
|
|
418
418
|
for (let b = 16; b < 64; b++) {
|
|
419
|
-
const p =
|
|
420
|
-
|
|
419
|
+
const p = Fe[b - 15], y = Fe[b - 2], C = pe(p, 7) ^ pe(p, 18) ^ p >>> 3, _ = pe(y, 17) ^ pe(y, 19) ^ y >>> 10;
|
|
420
|
+
Fe[b] = _ + Fe[b - 7] + C + Fe[b - 16] | 0;
|
|
421
421
|
}
|
|
422
|
-
let { A: n, B: s, C: i, D: a, E: o, F:
|
|
422
|
+
let { A: n, B: s, C: i, D: a, E: o, F: c, G: f, H: v } = this;
|
|
423
423
|
for (let b = 0; b < 64; b++) {
|
|
424
|
-
const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), y = v + p + fs(o,
|
|
425
|
-
v = f, f =
|
|
424
|
+
const p = pe(o, 6) ^ pe(o, 11) ^ pe(o, 25), y = v + p + fs(o, c, f) + ms[b] + Fe[b] | 0, _ = (pe(n, 2) ^ pe(n, 13) ^ pe(n, 22)) + hs(n, s, i) | 0;
|
|
425
|
+
v = f, f = c, c = 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,
|
|
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, c = c + this.F | 0, f = f + this.G | 0, v = v + this.H | 0, this.set(n, s, i, a, o, c, f, v);
|
|
428
428
|
}
|
|
429
429
|
roundClean() {
|
|
430
|
-
Ot(
|
|
430
|
+
Ot(Fe);
|
|
431
431
|
}
|
|
432
432
|
destroy() {
|
|
433
433
|
this.set(0, 0, 0, 0, 0, 0, 0, 0), Ot(this.buffer);
|
|
@@ -438,17 +438,17 @@ class bs extends ys {
|
|
|
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", Ie[0] | 0);
|
|
442
|
+
Y(this, "B", Ie[1] | 0);
|
|
443
|
+
Y(this, "C", Ie[2] | 0);
|
|
444
|
+
Y(this, "D", Ie[3] | 0);
|
|
445
|
+
Y(this, "E", Ie[4] | 0);
|
|
446
|
+
Y(this, "F", Ie[5] | 0);
|
|
447
|
+
Y(this, "G", Ie[6] | 0);
|
|
448
|
+
Y(this, "H", Ie[7] | 0);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
const gs = /* @__PURE__ */
|
|
451
|
+
const gs = /* @__PURE__ */ cs(
|
|
452
452
|
() => new bs(),
|
|
453
453
|
/* @__PURE__ */ ds(1)
|
|
454
454
|
);
|
|
@@ -461,7 +461,7 @@ var Gr = (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;
|
|
464
|
-
}, Bt = (e) => Array.isArray(e) ? e.map(Bt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, Bt(t)])) : typeof e == "function" ? void 0 : e, vs = (e) =>
|
|
464
|
+
}, Bt = (e) => Array.isArray(e) ? e.map(Bt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, Bt(t)])) : typeof e == "function" ? void 0 : e, vs = (e) => us(gs(new TextEncoder().encode(JSON.stringify(Bt(e)))));
|
|
465
465
|
function xs(e, r, t, n) {
|
|
466
466
|
var s;
|
|
467
467
|
if (n != null && n.aborted)
|
|
@@ -470,12 +470,12 @@ function xs(e, r, t, n) {
|
|
|
470
470
|
if (a.includes(i))
|
|
471
471
|
return;
|
|
472
472
|
a.push(i);
|
|
473
|
-
let o = new AbortController(),
|
|
473
|
+
let o = new AbortController(), c = setTimeout(() => o.abort(), 5e3);
|
|
474
474
|
r.fetch("/flow/pre-apply", { method: "POST", signal: o.signal, body: JSON.stringify(t) }).catch(() => {
|
|
475
475
|
let f = a.indexOf(i);
|
|
476
476
|
f !== -1 && a.splice(f, 1);
|
|
477
477
|
}).finally(() => {
|
|
478
|
-
clearTimeout(
|
|
478
|
+
clearTimeout(c);
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
481
|
var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), he = (e, r) => ss(e, Jr(r)), ws = (e, r) => lt(e, Jr(r)), Zr = ({ node: e, nodes: r, stopWhen: t }) => {
|
|
@@ -496,7 +496,7 @@ var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
496
496
|
});
|
|
497
497
|
if (t != null && t.nextId)
|
|
498
498
|
return r.find((n) => n.id === t.nextId);
|
|
499
|
-
}, ks = 3, Cs = ({ flow: e, analytics: r, logger: t, talentBankClient: n, context: s, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery:
|
|
499
|
+
}, ks = 3, Cs = ({ flow: e, analytics: r, logger: t, talentBankClient: n, context: s, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: c, 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
501
|
let M = new AbortController(), O = { submitAccepted: !1 };
|
|
502
502
|
(V = e.data).startedWriteNodeIds ?? (V.startedWriteNodeIds = e.nodes.flatMap((T) => {
|
|
@@ -521,7 +521,7 @@ var Jr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {}
|
|
|
521
521
|
await Ss({ flow: e, analytics: K, logger: t, talentBankClient: n, apiClient: i, context: s, node: T, submissions: I, applicationRecovery: F, setApplicationRecovery: async (L) => {
|
|
522
522
|
if (!B.aborted)
|
|
523
523
|
try {
|
|
524
|
-
await
|
|
524
|
+
await c(L);
|
|
525
525
|
} catch (W) {
|
|
526
526
|
t.error("Failed to persist application recovery", W);
|
|
527
527
|
}
|
|
@@ -618,10 +618,10 @@ async function Es({ next: e, node: r }) {
|
|
|
618
618
|
e(r.nextId);
|
|
619
619
|
}
|
|
620
620
|
async function As({ next: e, node: r, talentBankClient: t, submissions: n, flow: s, logger: i, chat: a }) {
|
|
621
|
-
var
|
|
621
|
+
var c;
|
|
622
622
|
let o = { isDuplicate: !1 };
|
|
623
623
|
if (n && t) {
|
|
624
|
-
let f = r.data.scope === "job" ? (
|
|
624
|
+
let f = r.data.scope === "job" ? (c = s.job) == null ? void 0 : c.id : void 0;
|
|
625
625
|
if (r.data.scope === "company" || f != null)
|
|
626
626
|
try {
|
|
627
627
|
o = await t.checkDuplicate({ email: An({ key: r.data.email, submissions: n }).toString(), jobId: f, scope: r.data.scope });
|
|
@@ -644,11 +644,11 @@ async function Fs({ next: e, node: r, logger: t, submissions: n, context: s }) {
|
|
|
644
644
|
var Vs = 5e3, Ms = (e, r) => r ? `${e}@${r.id_type}:${r.id}` : e, Ls = (e, r = Date.now()) => Math.min(e.until, r + (e.maintenance ? jn : e.throttles ? Ur : Pn)), Ns = (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
|
-
}, Rs = ["ApiError", "NotFoundError", "UnauthorisedError", "SchemaValidationError", "ParsingError"], $t = (e) => e instanceof Error && Rs.includes(e.name) ? e : void 0,
|
|
647
|
+
}, Rs = ["ApiError", "NotFoundError", "UnauthorisedError", "SchemaValidationError", "ParsingError"], $t = (e) => e instanceof Error && Rs.includes(e.name) ? e : void 0, cr = (e) => {
|
|
648
648
|
let r = $t(e);
|
|
649
649
|
return (r == null ? void 0 : r.name) === "ApiError" ? r : void 0;
|
|
650
650
|
};
|
|
651
|
-
async function Ts({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i, submissions: a, analytics: o, flow:
|
|
651
|
+
async function Ts({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i, submissions: a, analytics: o, flow: c, applicationRecovery: f, setApplicationRecovery: v, forceSubmitConfirmation: b, flowType: p, run: y, persistWriteBarrier: C, signal: _, onSubmitNetworkError: k, settledOutcomes: E, t: g }) {
|
|
652
652
|
var ee, T;
|
|
653
653
|
let N = async ({ redirect_url: R, message: B, button_text: I }) => {
|
|
654
654
|
let { anonymous_id: F, session_id: j } = o.getSessionInfo();
|
|
@@ -660,22 +660,22 @@ async function Ts({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i,
|
|
|
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:
|
|
663
|
+
o.log({ event: "FLOW_REDIRECT", properties: { flow_build: c.build, flow_id: c.id, flow_session_id: j, flow_version: c.version, href: L.toString(), job: c.job } });
|
|
664
664
|
} });
|
|
665
665
|
} catch (L) {
|
|
666
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 ((ee =
|
|
670
|
-
let R = (T =
|
|
669
|
+
if ((ee = c.data.startedWriteNodeIds) != null && ee.includes(n.id) && (f == null ? void 0 : f.submitNodeId) !== n.id) {
|
|
670
|
+
let R = (T = c.data.submitRedirects) == null ? void 0 : T[n.id];
|
|
671
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 V = Ms(n.id,
|
|
673
|
+
let V = Ms(n.id, c.job), M = 0, O = y.submitAccepted && n.data.skipConfirmation === !0 && (f == null ? void 0 : f.submitNodeId) !== n.id, K = async (R) => {
|
|
674
674
|
var st, pt, mt, Et, at, l, d, h, w;
|
|
675
|
-
let B = ((st =
|
|
675
|
+
let B = ((st = c.data.submitCooldown) == null ? void 0 : st.key) === V ? c.data.submitCooldown : void 0;
|
|
676
676
|
B && (B.until = Ls(B));
|
|
677
677
|
let I = B == null ? void 0 : B.until;
|
|
678
|
-
(
|
|
678
|
+
(c.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
679
|
let F;
|
|
680
680
|
if (n.data.captcha) {
|
|
681
681
|
let m = e.captcha, x = !0;
|
|
@@ -697,14 +697,14 @@ async function Ts({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i,
|
|
|
697
697
|
let { anonymous_id: j, session_id: L } = o.getSessionInfo();
|
|
698
698
|
if (_.aborted)
|
|
699
699
|
return;
|
|
700
|
-
let W = ((pt =
|
|
701
|
-
if ((f == null ? void 0 : f.submitNodeId) === n.id && await v(void 0), W || (
|
|
700
|
+
let W = ((pt = c.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 || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], n.id]), await C().catch((m) => s.error("Failed to persist application write barrier", m)), _.aborted)
|
|
702
702
|
return;
|
|
703
703
|
let U, te = setTimeout(() => {
|
|
704
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
|
-
}, Vs), 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:
|
|
705
|
+
}, Vs), 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: c.job, flow_build: c.build, ...F !== void 0 && { captcha_token: F }, submissions: Vn(c.nodes, Mn(a || {}, n.data.submitKeys)), pre_apply: Pr(c.nodes, a || {}, c.data.flowSessionId) }) }).catch((m) => {
|
|
706
706
|
X = m;
|
|
707
|
-
let x =
|
|
707
|
+
let x = cr(m);
|
|
708
708
|
return (x == null ? void 0 : x.data) !== void 0 ? x.data : m;
|
|
709
709
|
});
|
|
710
710
|
if (clearTimeout(te), await U, _.aborted)
|
|
@@ -712,28 +712,28 @@ async function Ts({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i,
|
|
|
712
712
|
if (X !== void 0 && !$t(X) && k)
|
|
713
713
|
return await k(X, _), K(!0);
|
|
714
714
|
n.data.key && e.setSubmission(n.data.key, { type: "integration", value: H });
|
|
715
|
-
let rt = (mt =
|
|
716
|
-
|
|
717
|
-
let qe = Ne !== void 0 && Date.now() - Ne < Ln || ((Et =
|
|
718
|
-
|
|
715
|
+
let rt = (mt = cr(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"), Ee = c.data.failedAttemptAt, Ne = Ee == null ? void 0 : Ee[V];
|
|
716
|
+
Ee && Ne !== void 0 && Ne > Date.now() && (Ne = Ee[V] = Date.now());
|
|
717
|
+
let qe = Ne !== void 0 && Date.now() - Ne < Ln || ((Et = c.data.unconfirmedAttemptKeys) == null ? void 0 : Et.includes(V)) === !0, nt = (at = $t(X)) == null ? void 0 : at.status, ve = Nn(H, typeof nt == "number" ? nt : void 0);
|
|
718
|
+
ve && o.log({ event: "FLOW_SUBMIT", properties: { flow_id: c.id, flow_version: c.version, flow_session_id: c.data.flowSessionId, flow_build: c.build, service: ve.service, response: ve.response, captured: (H == null ? void 0 : H.captured) === !0, flow_type: (p == null ? void 0 : p()) ?? "CHATBOT_DRAWER", job: c.job, ...(D == null ? void 0 : D.outcome) === "duplicate" && { outcome: qe ? "duplicate_after_own_attempt" : "duplicate" }, ...ve.outcome && { outcome: ve.outcome } } });
|
|
719
719
|
let Ue = nr(H) || (H == null ? void 0 : H.success) === !0;
|
|
720
|
-
if ((Ue || sr(H)) && (y.submitAccepted = !0), Ue && ((l =
|
|
720
|
+
if ((Ue || sr(H)) && (y.submitAccepted = !0), Ue && ((l = c.data.submitCooldown) == null ? void 0 : l.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await C().catch((m) => s.error("Failed to persist submit cooldown reset", m))), nr(H)) {
|
|
721
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 : (
|
|
722
|
+
return _.aborted ? void 0 : (c.data.submitRedirects = { ...c.data.submitRedirects, [n.id]: $ }, await C().catch((P) => s.error("Failed to persist submit redirect", P)), await N($), r(n.nextId));
|
|
723
723
|
}
|
|
724
724
|
let ht = sr(H);
|
|
725
725
|
if (ht)
|
|
726
726
|
return await e.sendMessage({ type: "system", variant: "success", text: ht.message ?? g("submission_pending") }), r(n.nextId);
|
|
727
727
|
if ((H == null ? void 0 : H.success) === !0)
|
|
728
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 :
|
|
730
|
-
if (!Re && !Pe && !ar(D) && (
|
|
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 : c.nodes.find((m) => m.type === "question-file" && m.data.key === ze);
|
|
730
|
+
if (!Re && !Pe && !ar(D) && (c.data.submitCooldown = Ns(V, B, D)), (D == null ? void 0 : D.outcome) !== "duplicate" && !je && (c.data.failedAttemptAt = { ...c.data.failedAttemptAt, [V]: Date.now() }, (h = c.data.unconfirmedAttemptKeys) != null && h.includes(V) && (c.data.unconfirmedAttemptKeys = c.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 || (c.data.startedWriteNodeIds = (w = c.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
731
|
if (s.error(X ?? D.message), Re && ze !== void 0)
|
|
732
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
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
|
|
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 c.data.submitCooldown, t()) : K(!1);
|
|
735
735
|
if (D.outcome === "closed")
|
|
736
|
-
return await e.sendMessage({ type: "system", variant: "info", semantic: "submission-closed", text: g("submission_closed") }), Pe ? (delete
|
|
736
|
+
return await e.sendMessage({ type: "system", variant: "info", semantic: "submission-closed", text: g("submission_closed") }), Pe ? (delete c.data.submitCooldown, t()) : K(!1);
|
|
737
737
|
let m = Dn(D);
|
|
738
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 <= ks)) : $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
|
}
|
|
@@ -802,7 +802,7 @@ async function Hs({ node: e, chat: r, next: t, submissions: n, context: s, t: i
|
|
|
802
802
|
async function Ks({ chat: e, end: r, node: t }) {
|
|
803
803
|
await e.sendMessage({ type: "system", variant: "info", text: t.data.systemMessage }), r();
|
|
804
804
|
}
|
|
805
|
-
async function Gs({ node: e, flow: r, submissions: t, chat: n, next: s, apiClient: i, analytics: a, signal: o, context:
|
|
805
|
+
async function Gs({ node: e, flow: r, submissions: t, chat: n, next: s, apiClient: i, analytics: a, signal: o, context: c }) {
|
|
806
806
|
let f = Fn(r.nodes, t || {}), { answers: v, ...b } = f;
|
|
807
807
|
if (n.setSubmission(e.data.key, { type: "integration", value: b }), xs(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];
|
|
@@ -814,7 +814,7 @@ async function Gs({ node: e, flow: r, submissions: t, chat: n, next: s, apiClien
|
|
|
814
814
|
}
|
|
815
815
|
await n.sendMessage({ type: "text", author: "bot", text: p.join(`
|
|
816
816
|
|
|
817
|
-
`) }), f.hasHardConcerns && e.data.alternativeLink && await n.sendMessage({ type: "link", href: e.data.alternativeLink.href, text: e.data.alternativeLink.label }), await n.userInput({ type: "submit", key: void 0, config: { label: he(e.data.continueLabel, { submissions: t, context:
|
|
817
|
+
`) }), f.hasHardConcerns && e.data.alternativeLink && await n.sendMessage({ type: "link", href: e.data.alternativeLink.href, text: e.data.alternativeLink.label }), await n.userInput({ type: "submit", key: void 0, config: { label: he(e.data.continueLabel, { submissions: t, context: c }) } });
|
|
818
818
|
}
|
|
819
819
|
return s(e.nextId);
|
|
820
820
|
}
|
|
@@ -868,11 +868,11 @@ const dr = (e, r, t) => {
|
|
|
868
868
|
const {
|
|
869
869
|
t
|
|
870
870
|
} = ne();
|
|
871
|
-
return
|
|
871
|
+
return u("button", {
|
|
872
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
|
-
children:
|
|
875
|
+
children: u("svg", {
|
|
876
876
|
class: "block",
|
|
877
877
|
width: "16",
|
|
878
878
|
height: "16",
|
|
@@ -881,24 +881,24 @@ const dr = (e, r, t) => {
|
|
|
881
881
|
stroke: "currentColor",
|
|
882
882
|
"stroke-linecap": "round",
|
|
883
883
|
"stroke-width": "2",
|
|
884
|
-
children: [
|
|
884
|
+
children: [u("title", {
|
|
885
885
|
children: t("send")
|
|
886
|
-
}),
|
|
886
|
+
}), u("path", {
|
|
887
887
|
d: "M3.5 7.5L8 3L12.5 7.5"
|
|
888
|
-
}),
|
|
888
|
+
}), u("path", {
|
|
889
889
|
d: "M8 4V13"
|
|
890
890
|
})]
|
|
891
891
|
})
|
|
892
892
|
});
|
|
893
893
|
};
|
|
894
|
-
var
|
|
894
|
+
var xe;
|
|
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) ?? (xe == null ? void 0 : xe.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) ?? (xe == null ? void 0 : xe.abortEarly),
|
|
901
|
+
abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (xe == null ? void 0 : xe.abortPipeEarly)
|
|
902
902
|
};
|
|
903
903
|
}
|
|
904
904
|
var Mt;
|
|
@@ -924,7 +924,7 @@ function Xe(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
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),
|
|
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), c = {
|
|
928
928
|
kind: e.kind,
|
|
929
929
|
type: e.type,
|
|
930
930
|
input: i,
|
|
@@ -937,14 +937,14 @@ function re(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", v = (s == null ? void 0 : s.message) ?? e.message ?? /* @__PURE__ */ Ys(e.reference,
|
|
941
|
-
v !== void 0 && (
|
|
940
|
+
}, f = e.kind === "schema", v = (s == null ? void 0 : s.message) ?? e.message ?? /* @__PURE__ */ Ys(e.reference, c.lang) ?? (f ? /* @__PURE__ */ Xs(c.lang) : null) ?? n.message ?? /* @__PURE__ */ Zs(c.lang);
|
|
941
|
+
v !== void 0 && (c.message = typeof v == "function" ? (
|
|
942
942
|
// @ts-expect-error
|
|
943
|
-
v(
|
|
944
|
-
) : v), f && (t.typed = !1), t.issues ? t.issues.push(
|
|
943
|
+
v(c)
|
|
944
|
+
) : v), f && (t.typed = !1), t.issues ? t.issues.push(c) : t.issues = [c];
|
|
945
945
|
}
|
|
946
946
|
// @__NO_SIDE_EFFECTS__
|
|
947
|
-
function
|
|
947
|
+
function ge(e) {
|
|
948
948
|
return {
|
|
949
949
|
version: 1,
|
|
950
950
|
vendor: "valibot",
|
|
@@ -1016,11 +1016,11 @@ function Yr(e) {
|
|
|
1016
1016
|
};
|
|
1017
1017
|
}
|
|
1018
1018
|
// @__NO_SIDE_EFFECTS__
|
|
1019
|
-
function
|
|
1019
|
+
function ut(e, r) {
|
|
1020
1020
|
return {
|
|
1021
1021
|
kind: "validation",
|
|
1022
1022
|
type: "max_length",
|
|
1023
|
-
reference:
|
|
1023
|
+
reference: ut,
|
|
1024
1024
|
async: !1,
|
|
1025
1025
|
expects: `<=${e}`,
|
|
1026
1026
|
requirement: e,
|
|
@@ -1163,7 +1163,7 @@ function nn(e, r) {
|
|
|
1163
1163
|
item: e,
|
|
1164
1164
|
message: r,
|
|
1165
1165
|
get "~standard"() {
|
|
1166
|
-
return /* @__PURE__ */
|
|
1166
|
+
return /* @__PURE__ */ ge(this);
|
|
1167
1167
|
},
|
|
1168
1168
|
"~run"(t, n) {
|
|
1169
1169
|
var i;
|
|
@@ -1171,8 +1171,8 @@ function nn(e, r) {
|
|
|
1171
1171
|
if (Array.isArray(s)) {
|
|
1172
1172
|
t.typed = !0, t.value = [];
|
|
1173
1173
|
for (let a = 0; a < s.length; a++) {
|
|
1174
|
-
const o = s[a],
|
|
1175
|
-
if (
|
|
1174
|
+
const o = s[a], c = this.item["~run"]({ value: o }, n);
|
|
1175
|
+
if (c.issues) {
|
|
1176
1176
|
const f = {
|
|
1177
1177
|
type: "array",
|
|
1178
1178
|
origin: "value",
|
|
@@ -1180,14 +1180,14 @@ function nn(e, r) {
|
|
|
1180
1180
|
key: a,
|
|
1181
1181
|
value: o
|
|
1182
1182
|
};
|
|
1183
|
-
for (const v of
|
|
1183
|
+
for (const v of c.issues)
|
|
1184
1184
|
v.path ? v.path.unshift(f) : v.path = [f], (i = t.issues) == null || i.push(v);
|
|
1185
|
-
if (t.issues || (t.issues =
|
|
1185
|
+
if (t.issues || (t.issues = c.issues), n.abortEarly) {
|
|
1186
1186
|
t.typed = !1;
|
|
1187
1187
|
break;
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|
|
1190
|
-
|
|
1190
|
+
c.typed || (t.typed = !1), t.value.push(c.value);
|
|
1191
1191
|
}
|
|
1192
1192
|
} else
|
|
1193
1193
|
re(this, "type", t, n);
|
|
@@ -1205,7 +1205,7 @@ function sn(e) {
|
|
|
1205
1205
|
async: !1,
|
|
1206
1206
|
message: e,
|
|
1207
1207
|
get "~standard"() {
|
|
1208
|
-
return /* @__PURE__ */
|
|
1208
|
+
return /* @__PURE__ */ ge(this);
|
|
1209
1209
|
},
|
|
1210
1210
|
"~run"(r, t) {
|
|
1211
1211
|
return typeof r.value == "boolean" ? r.typed = !0 : re(this, "type", r, t), r;
|
|
@@ -1222,7 +1222,7 @@ function an(e) {
|
|
|
1222
1222
|
async: !1,
|
|
1223
1223
|
message: e,
|
|
1224
1224
|
get "~standard"() {
|
|
1225
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ ge(this);
|
|
1226
1226
|
},
|
|
1227
1227
|
"~run"(r, t) {
|
|
1228
1228
|
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : re(this, "type", r, t), r;
|
|
@@ -1230,17 +1230,17 @@ function an(e) {
|
|
|
1230
1230
|
};
|
|
1231
1231
|
}
|
|
1232
1232
|
// @__NO_SIDE_EFFECTS__
|
|
1233
|
-
function
|
|
1233
|
+
function Ce(e, r) {
|
|
1234
1234
|
return {
|
|
1235
1235
|
kind: "schema",
|
|
1236
1236
|
type: "object",
|
|
1237
|
-
reference:
|
|
1237
|
+
reference: Ce,
|
|
1238
1238
|
expects: "Object",
|
|
1239
1239
|
async: !1,
|
|
1240
1240
|
entries: e,
|
|
1241
1241
|
message: r,
|
|
1242
1242
|
get "~standard"() {
|
|
1243
|
-
return /* @__PURE__ */
|
|
1243
|
+
return /* @__PURE__ */ ge(this);
|
|
1244
1244
|
},
|
|
1245
1245
|
"~run"(t, n) {
|
|
1246
1246
|
var i;
|
|
@@ -1251,17 +1251,17 @@ function ke(e, r) {
|
|
|
1251
1251
|
const o = this.entries[a];
|
|
1252
1252
|
if (a in s || (o.type === "exact_optional" || o.type === "optional" || o.type === "nullish") && // @ts-expect-error
|
|
1253
1253
|
o.default !== void 0) {
|
|
1254
|
-
const
|
|
1254
|
+
const c = a in s ? (
|
|
1255
1255
|
// @ts-expect-error
|
|
1256
1256
|
s[a]
|
|
1257
|
-
) : /* @__PURE__ */ rn(o), f = o["~run"]({ value:
|
|
1257
|
+
) : /* @__PURE__ */ rn(o), f = o["~run"]({ value: c }, n);
|
|
1258
1258
|
if (f.issues) {
|
|
1259
1259
|
const v = {
|
|
1260
1260
|
type: "object",
|
|
1261
1261
|
origin: "value",
|
|
1262
1262
|
input: s,
|
|
1263
1263
|
key: a,
|
|
1264
|
-
value:
|
|
1264
|
+
value: c
|
|
1265
1265
|
};
|
|
1266
1266
|
for (const b of f.issues)
|
|
1267
1267
|
b.path ? b.path.unshift(v) : b.path = [v], (i = t.issues) == null || i.push(b);
|
|
@@ -1306,7 +1306,7 @@ function Je(e, r) {
|
|
|
1306
1306
|
wrapped: e,
|
|
1307
1307
|
default: r,
|
|
1308
1308
|
get "~standard"() {
|
|
1309
|
-
return /* @__PURE__ */
|
|
1309
|
+
return /* @__PURE__ */ ge(this);
|
|
1310
1310
|
},
|
|
1311
1311
|
"~run"(t, n) {
|
|
1312
1312
|
return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */ rn(this, t, n)), t.value === void 0) ? (t.typed = !0, t) : this.wrapped["~run"](t, n);
|
|
@@ -1324,7 +1324,7 @@ function on(e, r) {
|
|
|
1324
1324
|
options: e,
|
|
1325
1325
|
message: r,
|
|
1326
1326
|
get "~standard"() {
|
|
1327
|
-
return /* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ ge(this);
|
|
1328
1328
|
},
|
|
1329
1329
|
"~run"(t, n) {
|
|
1330
1330
|
return this.options.includes(t.value) ? t.typed = !0 : re(this, "type", t, n), t;
|
|
@@ -1343,22 +1343,22 @@ function ln(e, r, t) {
|
|
|
1343
1343
|
value: r,
|
|
1344
1344
|
message: t,
|
|
1345
1345
|
get "~standard"() {
|
|
1346
|
-
return /* @__PURE__ */
|
|
1346
|
+
return /* @__PURE__ */ ge(this);
|
|
1347
1347
|
},
|
|
1348
1348
|
"~run"(n, s) {
|
|
1349
1349
|
var a, o;
|
|
1350
1350
|
const i = n.value;
|
|
1351
1351
|
if (i && typeof i == "object") {
|
|
1352
1352
|
n.typed = !0, n.value = {};
|
|
1353
|
-
for (const
|
|
1354
|
-
if (/* @__PURE__ */ Qs(i,
|
|
1355
|
-
const f = i[
|
|
1353
|
+
for (const c in i)
|
|
1354
|
+
if (/* @__PURE__ */ Qs(i, c)) {
|
|
1355
|
+
const f = i[c], v = this.key["~run"]({ value: c }, s);
|
|
1356
1356
|
if (v.issues) {
|
|
1357
1357
|
const p = {
|
|
1358
1358
|
type: "object",
|
|
1359
1359
|
origin: "key",
|
|
1360
1360
|
input: i,
|
|
1361
|
-
key:
|
|
1361
|
+
key: c,
|
|
1362
1362
|
value: f
|
|
1363
1363
|
};
|
|
1364
1364
|
for (const y of v.issues)
|
|
@@ -1377,7 +1377,7 @@ function ln(e, r, t) {
|
|
|
1377
1377
|
type: "object",
|
|
1378
1378
|
origin: "value",
|
|
1379
1379
|
input: i,
|
|
1380
|
-
key:
|
|
1380
|
+
key: c,
|
|
1381
1381
|
value: f
|
|
1382
1382
|
};
|
|
1383
1383
|
for (const y of b.issues)
|
|
@@ -1405,7 +1405,7 @@ function le(e) {
|
|
|
1405
1405
|
async: !1,
|
|
1406
1406
|
message: e,
|
|
1407
1407
|
get "~standard"() {
|
|
1408
|
-
return /* @__PURE__ */
|
|
1408
|
+
return /* @__PURE__ */ ge(this);
|
|
1409
1409
|
},
|
|
1410
1410
|
"~run"(r, t) {
|
|
1411
1411
|
return typeof r.value == "string" ? r.typed = !0 : re(this, "type", r, t), r;
|
|
@@ -1427,17 +1427,17 @@ function ia(e, r) {
|
|
|
1427
1427
|
...e,
|
|
1428
1428
|
entries: t,
|
|
1429
1429
|
get "~standard"() {
|
|
1430
|
-
return /* @__PURE__ */
|
|
1430
|
+
return /* @__PURE__ */ ge(this);
|
|
1431
1431
|
}
|
|
1432
1432
|
};
|
|
1433
1433
|
}
|
|
1434
1434
|
// @__NO_SIDE_EFFECTS__
|
|
1435
|
-
function
|
|
1435
|
+
function Me(...e) {
|
|
1436
1436
|
return {
|
|
1437
1437
|
...e[0],
|
|
1438
1438
|
pipe: e,
|
|
1439
1439
|
get "~standard"() {
|
|
1440
|
-
return /* @__PURE__ */
|
|
1440
|
+
return /* @__PURE__ */ ge(this);
|
|
1441
1441
|
},
|
|
1442
1442
|
"~run"(r, t) {
|
|
1443
1443
|
for (const n of e)
|
|
@@ -1477,49 +1477,49 @@ async function la(e, r, t) {
|
|
|
1477
1477
|
}
|
|
1478
1478
|
const tt = ({
|
|
1479
1479
|
error: e
|
|
1480
|
-
}) => !e || !e.message ? null :
|
|
1480
|
+
}) => !e || !e.message ? null : u("div", {
|
|
1481
1481
|
role: "alert",
|
|
1482
1482
|
class: "text-error-11 flex max-w-full items-start gap-1 overflow-hidden rounded-2xl px-2 py-2",
|
|
1483
|
-
children: [
|
|
1483
|
+
children: [u("svg", {
|
|
1484
1484
|
class: "text-error-9 mt-0.5 h-4 w-4 shrink-0",
|
|
1485
1485
|
viewBox: "0 0 16 16",
|
|
1486
1486
|
fill: "none",
|
|
1487
1487
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1488
|
-
children: [
|
|
1488
|
+
children: [u("circle", {
|
|
1489
1489
|
cx: "8",
|
|
1490
1490
|
cy: "8",
|
|
1491
1491
|
r: "6.3",
|
|
1492
1492
|
stroke: "currentColor",
|
|
1493
1493
|
"stroke-width": "1.4"
|
|
1494
|
-
}),
|
|
1494
|
+
}), u("rect", {
|
|
1495
1495
|
x: "7",
|
|
1496
1496
|
y: "4",
|
|
1497
1497
|
width: "2",
|
|
1498
1498
|
height: "5",
|
|
1499
1499
|
fill: "currentColor"
|
|
1500
|
-
}),
|
|
1500
|
+
}), u("rect", {
|
|
1501
1501
|
x: "7",
|
|
1502
1502
|
y: "10",
|
|
1503
1503
|
width: "2",
|
|
1504
1504
|
height: "2",
|
|
1505
1505
|
fill: "currentColor"
|
|
1506
1506
|
})]
|
|
1507
|
-
}),
|
|
1507
|
+
}), u("p", {
|
|
1508
1508
|
class: "break-words pr-1 text-sm",
|
|
1509
1509
|
children: e.message
|
|
1510
1510
|
})]
|
|
1511
|
-
}),
|
|
1511
|
+
}), Se = ({
|
|
1512
1512
|
class: e,
|
|
1513
1513
|
...r
|
|
1514
1514
|
}) => {
|
|
1515
1515
|
const {
|
|
1516
1516
|
t
|
|
1517
1517
|
} = ne();
|
|
1518
|
-
return
|
|
1518
|
+
return u("button", {
|
|
1519
1519
|
type: "button",
|
|
1520
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
|
-
children: [
|
|
1522
|
+
children: [u("svg", {
|
|
1523
1523
|
"aria-hidden": !0,
|
|
1524
1524
|
class: "block",
|
|
1525
1525
|
width: "16",
|
|
@@ -1529,17 +1529,17 @@ const tt = ({
|
|
|
1529
1529
|
stroke: "currentColor",
|
|
1530
1530
|
"stroke-linecap": "round",
|
|
1531
1531
|
"stroke-width": "1.5",
|
|
1532
|
-
children: [
|
|
1532
|
+
children: [u("title", {
|
|
1533
1533
|
children: t("skip")
|
|
1534
|
-
}),
|
|
1534
|
+
}), u("path", {
|
|
1535
1535
|
d: "M3.25 11.25A5 5 0 0 1 12 7"
|
|
1536
|
-
}),
|
|
1536
|
+
}), u("path", {
|
|
1537
1537
|
d: "M13.25 4.5V8.25H9.5"
|
|
1538
1538
|
})]
|
|
1539
1539
|
}), t("skip")]
|
|
1540
1540
|
});
|
|
1541
1541
|
};
|
|
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" },
|
|
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" }, ua = (e) => {
|
|
1543
1543
|
if (e === "")
|
|
1544
1544
|
return { countryCode: "", phoneNumber: "" };
|
|
1545
1545
|
let r = Object.values(Gt).find((n) => e.startsWith(n)) ?? "", t = e.replace(r, "");
|
|
@@ -1555,25 +1555,25 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1555
1555
|
defaultVariants: {
|
|
1556
1556
|
optional: !1
|
|
1557
1557
|
}
|
|
1558
|
-
}),
|
|
1558
|
+
}), ca = "https://api.mapbox.com/search/searchbox/v1/suggest", da = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", fa = (e) => atob(e).split("").reverse().join(""), we = /* @__PURE__ */ Ce({
|
|
1559
1559
|
name: /* @__PURE__ */ le()
|
|
1560
|
-
}), ha = /* @__PURE__ */
|
|
1561
|
-
suggestions: /* @__PURE__ */ nn(/* @__PURE__ */
|
|
1560
|
+
}), ha = /* @__PURE__ */ Ce({
|
|
1561
|
+
suggestions: /* @__PURE__ */ nn(/* @__PURE__ */ Ce({
|
|
1562
1562
|
feature_type: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1563
1563
|
full_address: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1564
1564
|
place_formatted: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1565
1565
|
name: /* @__PURE__ */ Je(/* @__PURE__ */ le()),
|
|
1566
1566
|
mapbox_id: /* @__PURE__ */ le(),
|
|
1567
|
-
context: /* @__PURE__ */ ia(/* @__PURE__ */
|
|
1568
|
-
address:
|
|
1569
|
-
street:
|
|
1570
|
-
neighborhood:
|
|
1571
|
-
locality:
|
|
1572
|
-
district:
|
|
1573
|
-
place:
|
|
1574
|
-
region:
|
|
1575
|
-
postcode:
|
|
1576
|
-
country:
|
|
1567
|
+
context: /* @__PURE__ */ ia(/* @__PURE__ */ Ce({
|
|
1568
|
+
address: we,
|
|
1569
|
+
street: we,
|
|
1570
|
+
neighborhood: we,
|
|
1571
|
+
locality: we,
|
|
1572
|
+
district: we,
|
|
1573
|
+
place: we,
|
|
1574
|
+
region: we,
|
|
1575
|
+
postcode: we,
|
|
1576
|
+
country: we
|
|
1577
1577
|
}))
|
|
1578
1578
|
}))
|
|
1579
1579
|
}), pa = ({
|
|
@@ -1586,17 +1586,17 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1586
1586
|
enabled: !0,
|
|
1587
1587
|
getPredictions: async (s) => {
|
|
1588
1588
|
var b;
|
|
1589
|
-
const i = new URL(
|
|
1589
|
+
const i = new URL(ca);
|
|
1590
1590
|
i.searchParams.set("q", s), i.searchParams.set("session_token", t);
|
|
1591
1591
|
const a = (b = q.current$.peek().flow) == null ? void 0 : b.locationOrigin;
|
|
1592
1592
|
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", fa(da));
|
|
1593
|
-
const
|
|
1594
|
-
if (!
|
|
1595
|
-
return e.error("Failed to get address details",
|
|
1593
|
+
const c = await fetch(i);
|
|
1594
|
+
if (!c.ok)
|
|
1595
|
+
return e.error("Failed to get address details", c), {
|
|
1596
1596
|
ok: !1,
|
|
1597
1597
|
error: r("address_error")
|
|
1598
1598
|
};
|
|
1599
|
-
const f = /* @__PURE__ */ oa(ha, await
|
|
1599
|
+
const f = /* @__PURE__ */ oa(ha, await c.json());
|
|
1600
1600
|
if (f.success === !1)
|
|
1601
1601
|
return e.error("Failed to parse address details", f.issues), {
|
|
1602
1602
|
ok: !1,
|
|
@@ -1633,11 +1633,11 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1633
1633
|
const {
|
|
1634
1634
|
t: r
|
|
1635
1635
|
} = ne();
|
|
1636
|
-
return
|
|
1636
|
+
return u("button", {
|
|
1637
1637
|
type: "button",
|
|
1638
1638
|
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",
|
|
1639
1639
|
...e,
|
|
1640
|
-
children: [
|
|
1640
|
+
children: [u("svg", {
|
|
1641
1641
|
width: "16",
|
|
1642
1642
|
height: "16",
|
|
1643
1643
|
viewBox: "0 0 16 16",
|
|
@@ -1645,10 +1645,10 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1645
1645
|
"stroke-width": "1.5",
|
|
1646
1646
|
fill: "none",
|
|
1647
1647
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1648
|
-
children:
|
|
1648
|
+
children: u("path", {
|
|
1649
1649
|
d: "M10 3L5 8L10 13"
|
|
1650
1650
|
})
|
|
1651
|
-
}),
|
|
1651
|
+
}), u("span", {
|
|
1652
1652
|
children: r("back")
|
|
1653
1653
|
})]
|
|
1654
1654
|
});
|
|
@@ -1659,13 +1659,13 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1659
1659
|
}) => {
|
|
1660
1660
|
const {
|
|
1661
1661
|
t: n
|
|
1662
|
-
} = ne(), [s, i] =
|
|
1662
|
+
} = ne(), [s, i] = ke(), {
|
|
1663
1663
|
enabled: a,
|
|
1664
1664
|
getPredictions: o
|
|
1665
1665
|
} = pa({
|
|
1666
1666
|
logger: t,
|
|
1667
1667
|
t: n
|
|
1668
|
-
}), [
|
|
1668
|
+
}), [c, f] = ke(a ? "query" : "manual"), [v, b] = ke(""), [p, y] = ke(), C = ye(), _ = ye(), k = (g) => {
|
|
1669
1669
|
var V;
|
|
1670
1670
|
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")
|
|
1671
1671
|
return;
|
|
@@ -1702,9 +1702,9 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1702
1702
|
[g]: N
|
|
1703
1703
|
}));
|
|
1704
1704
|
};
|
|
1705
|
-
switch (
|
|
1705
|
+
switch (c) {
|
|
1706
1706
|
case "query":
|
|
1707
|
-
return Oe(a, "Query state should not be enabled"),
|
|
1707
|
+
return Oe(a, "Query state should not be enabled"), u(ya, {
|
|
1708
1708
|
input: e,
|
|
1709
1709
|
onSkip: () => r(null),
|
|
1710
1710
|
onAddressSelect: (g) => {
|
|
@@ -1720,32 +1720,32 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1720
1720
|
query: v
|
|
1721
1721
|
});
|
|
1722
1722
|
case "details":
|
|
1723
|
-
return Oe(s !== void 0),
|
|
1723
|
+
return Oe(s !== void 0), u(hr, {
|
|
1724
1724
|
input: e,
|
|
1725
1725
|
logger: t,
|
|
1726
1726
|
onSubmitSuccess: r,
|
|
1727
1727
|
addressFields: s,
|
|
1728
1728
|
onFieldChange: E,
|
|
1729
|
-
actions:
|
|
1729
|
+
actions: u(fr, {
|
|
1730
1730
|
onClick: () => {
|
|
1731
1731
|
f("query");
|
|
1732
1732
|
}
|
|
1733
1733
|
})
|
|
1734
1734
|
});
|
|
1735
1735
|
case "manual":
|
|
1736
|
-
return
|
|
1736
|
+
return u(hr, {
|
|
1737
1737
|
logger: t,
|
|
1738
1738
|
input: e,
|
|
1739
1739
|
onSubmitSuccess: r,
|
|
1740
1740
|
addressFields: s ?? {},
|
|
1741
1741
|
onFieldChange: E,
|
|
1742
|
-
actions: a ?
|
|
1742
|
+
actions: a ? u(fr, {
|
|
1743
1743
|
onClick: () => {
|
|
1744
1744
|
f("query");
|
|
1745
1745
|
}
|
|
1746
1746
|
}) : e.config.optional ? (
|
|
1747
1747
|
// Without address search this is the only screen, so an optional question needs its own way past.
|
|
1748
|
-
|
|
1748
|
+
u(Se, {
|
|
1749
1749
|
onClick: () => r(null)
|
|
1750
1750
|
})
|
|
1751
1751
|
) : void 0
|
|
@@ -1762,20 +1762,20 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1762
1762
|
const {
|
|
1763
1763
|
t: a
|
|
1764
1764
|
} = ne(), o = ye(null);
|
|
1765
|
-
return
|
|
1765
|
+
return Le(() => {
|
|
1766
1766
|
o.current && (o.current.focus(), o.current.select());
|
|
1767
|
-
}, []),
|
|
1768
|
-
children: [
|
|
1767
|
+
}, []), u(be, {
|
|
1768
|
+
children: [u("form", {
|
|
1769
1769
|
noValidate: !0,
|
|
1770
|
-
onSubmit: (
|
|
1771
|
-
|
|
1772
|
-
const v = new FormData(
|
|
1770
|
+
onSubmit: (c) => {
|
|
1771
|
+
c.preventDefault();
|
|
1772
|
+
const v = new FormData(c.currentTarget).get("address");
|
|
1773
1773
|
typeof v == "string" && i(v);
|
|
1774
1774
|
},
|
|
1775
1775
|
class: "flex gap-2 p-2.5",
|
|
1776
|
-
children: [
|
|
1776
|
+
children: [u("div", {
|
|
1777
1777
|
class: "group relative flex-1",
|
|
1778
|
-
children: [
|
|
1778
|
+
children: [u("input", {
|
|
1779
1779
|
ref: o,
|
|
1780
1780
|
name: "address",
|
|
1781
1781
|
id: "chat-address",
|
|
@@ -1787,63 +1787,63 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1787
1787
|
optional: !!e.config.optional,
|
|
1788
1788
|
className: "w-full rounded-full"
|
|
1789
1789
|
})
|
|
1790
|
-
}),
|
|
1790
|
+
}), u("button", {
|
|
1791
1791
|
type: "submit",
|
|
1792
1792
|
class: "touch-hitbox text-neutral-12 hover:bg-neutral-3 fr absolute bottom-0 right-0 top-0 flex cursor-pointer items-center gap-1 rounded-full px-3 transition-all",
|
|
1793
|
-
children: [
|
|
1793
|
+
children: [u("svg", {
|
|
1794
1794
|
"aria-hidden": "true",
|
|
1795
1795
|
width: "16",
|
|
1796
1796
|
height: "16",
|
|
1797
1797
|
viewBox: "0 0 16 16",
|
|
1798
1798
|
fill: "none",
|
|
1799
1799
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1800
|
-
children:
|
|
1800
|
+
children: u("g", {
|
|
1801
1801
|
id: "inploi",
|
|
1802
1802
|
stroke: "currentColor",
|
|
1803
1803
|
"stroke-linecap": "round",
|
|
1804
1804
|
"stroke-linejoin": "round",
|
|
1805
1805
|
strokeWidth: "1.5",
|
|
1806
|
-
children: [
|
|
1806
|
+
children: [u("circle", {
|
|
1807
1807
|
cx: "7",
|
|
1808
1808
|
cy: "7",
|
|
1809
1809
|
r: "4"
|
|
1810
|
-
}),
|
|
1810
|
+
}), u("path", {
|
|
1811
1811
|
d: "M10 10L13 13"
|
|
1812
1812
|
})]
|
|
1813
1813
|
})
|
|
1814
|
-
}),
|
|
1814
|
+
}), u("span", {
|
|
1815
1815
|
class: "sr-only",
|
|
1816
1816
|
children: a("search")
|
|
1817
1817
|
})]
|
|
1818
1818
|
})]
|
|
1819
|
-
}), e.config.optional &&
|
|
1819
|
+
}), e.config.optional && u(Se, {
|
|
1820
1820
|
class: "relative",
|
|
1821
1821
|
onClick: r
|
|
1822
1822
|
})]
|
|
1823
|
-
}), (t == null ? void 0 : t.status) === "failed" ?
|
|
1823
|
+
}), (t == null ? void 0 : t.status) === "failed" ? u(tt, {
|
|
1824
1824
|
error: {
|
|
1825
1825
|
message: t.error
|
|
1826
1826
|
}
|
|
1827
|
-
}) : null,
|
|
1827
|
+
}) : null, u("p", {
|
|
1828
1828
|
role: "status",
|
|
1829
1829
|
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",
|
|
1830
|
-
children: (t == null ? void 0 : t.status) === "pending" ?
|
|
1831
|
-
children: [
|
|
1830
|
+
children: (t == null ? void 0 : t.status) === "pending" ? u(be, {
|
|
1831
|
+
children: [u(Ut, {
|
|
1832
1832
|
"aria-hidden": "true",
|
|
1833
1833
|
class: "h-4 w-4 shrink-0"
|
|
1834
1834
|
}), a("address_searching")]
|
|
1835
1835
|
}) : (t == null ? void 0 : t.status) === "done" && t.items.length === 0 ? a("address_no_results") : null
|
|
1836
|
-
}),
|
|
1837
|
-
children: [((t == null ? void 0 : t.status) === "done" ? t.items : []).map((
|
|
1838
|
-
children:
|
|
1836
|
+
}), u("ul", {
|
|
1837
|
+
children: [((t == null ? void 0 : t.status) === "done" ? t.items : []).map((c) => u("li", {
|
|
1838
|
+
children: u("button", {
|
|
1839
1839
|
class: "text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",
|
|
1840
1840
|
onClick: () => {
|
|
1841
|
-
n(
|
|
1841
|
+
n(c.id);
|
|
1842
1842
|
},
|
|
1843
|
-
children: [
|
|
1843
|
+
children: [u("span", {
|
|
1844
1844
|
class: "flex-grow",
|
|
1845
|
-
children:
|
|
1846
|
-
}),
|
|
1845
|
+
children: c.label
|
|
1846
|
+
}), u("svg", {
|
|
1847
1847
|
class: "flex-none",
|
|
1848
1848
|
width: "16",
|
|
1849
1849
|
height: "16",
|
|
@@ -1852,18 +1852,18 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1852
1852
|
"stroke-width": "1.5",
|
|
1853
1853
|
fill: "none",
|
|
1854
1854
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1855
|
-
children:
|
|
1855
|
+
children: u("path", {
|
|
1856
1856
|
d: "M6 3L11 8L6 13"
|
|
1857
1857
|
})
|
|
1858
1858
|
})]
|
|
1859
1859
|
})
|
|
1860
|
-
},
|
|
1861
|
-
children:
|
|
1860
|
+
}, c.id)), u("li", {
|
|
1861
|
+
children: u("button", {
|
|
1862
1862
|
class: "text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",
|
|
1863
1863
|
onClick: () => {
|
|
1864
1864
|
n("");
|
|
1865
1865
|
},
|
|
1866
|
-
children:
|
|
1866
|
+
children: u("span", {
|
|
1867
1867
|
class: "flex-grow",
|
|
1868
1868
|
children: a("address_manual")
|
|
1869
1869
|
})
|
|
@@ -1879,20 +1879,20 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1879
1879
|
input: s
|
|
1880
1880
|
}) => {
|
|
1881
1881
|
const i = ye(null);
|
|
1882
|
-
|
|
1882
|
+
Le(() => {
|
|
1883
1883
|
if (i.current) {
|
|
1884
|
-
const
|
|
1885
|
-
|
|
1884
|
+
const c = i.current.querySelector("input");
|
|
1885
|
+
c && (c.focus(), c.select());
|
|
1886
1886
|
}
|
|
1887
1887
|
}, []);
|
|
1888
1888
|
const a = Object.keys(Gt), {
|
|
1889
1889
|
t: o
|
|
1890
1890
|
} = ne();
|
|
1891
|
-
return
|
|
1891
|
+
return u("form", {
|
|
1892
1892
|
class: "flex flex-col px-2 pt-2",
|
|
1893
|
-
onSubmit: (
|
|
1894
|
-
|
|
1895
|
-
const f =
|
|
1893
|
+
onSubmit: (c) => {
|
|
1894
|
+
c.preventDefault();
|
|
1895
|
+
const f = c.currentTarget, v = [...f.querySelectorAll("input")].filter((y) => y.value !== "" && !y.value.trim());
|
|
1896
1896
|
for (const y of v) {
|
|
1897
1897
|
y.value = "";
|
|
1898
1898
|
const C = Rt.find((_) => s.config.keys[_] === y.name);
|
|
@@ -1908,38 +1908,38 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1908
1908
|
value: p
|
|
1909
1909
|
});
|
|
1910
1910
|
},
|
|
1911
|
-
children: [
|
|
1911
|
+
children: [u("div", {
|
|
1912
1912
|
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]",
|
|
1913
1913
|
ref: i,
|
|
1914
|
-
children: Rt.map((
|
|
1915
|
-
const v = `isdk_${
|
|
1916
|
-
return b ?
|
|
1917
|
-
children: [
|
|
1914
|
+
children: Rt.map((c, f) => {
|
|
1915
|
+
const v = `isdk_${c}`, b = s.config.keys[c];
|
|
1916
|
+
return b ? u(be, {
|
|
1917
|
+
children: [u("label", {
|
|
1918
1918
|
for: v,
|
|
1919
1919
|
class: "text-neutral-11 [&:has(+*>input:focus)]:text-neutral-12 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
|
|
1920
|
-
children: o(
|
|
1921
|
-
}),
|
|
1920
|
+
children: o(c)
|
|
1921
|
+
}), u("div", {
|
|
1922
1922
|
class: "flex flex-col items-stretch gap-1.5",
|
|
1923
|
-
children: [
|
|
1923
|
+
children: [c === "country" ? u("div", {
|
|
1924
1924
|
class: "relative",
|
|
1925
|
-
children: [
|
|
1925
|
+
children: [u("select", {
|
|
1926
1926
|
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",
|
|
1927
1927
|
name: b,
|
|
1928
1928
|
id: v,
|
|
1929
|
-
defaultValue: e[
|
|
1930
|
-
onChange: (p) => r(
|
|
1929
|
+
defaultValue: e[c],
|
|
1930
|
+
onChange: (p) => r(c, p.currentTarget.value),
|
|
1931
1931
|
required: !0,
|
|
1932
|
-
children: [e.country && !a.includes(e.country) ?
|
|
1933
|
-
value: e[
|
|
1934
|
-
children: e[
|
|
1935
|
-
}) :
|
|
1932
|
+
children: [e.country && !a.includes(e.country) ? u("option", {
|
|
1933
|
+
value: e[c],
|
|
1934
|
+
children: e[c]
|
|
1935
|
+
}) : u("option", {
|
|
1936
1936
|
value: "",
|
|
1937
1937
|
children: o("select_country")
|
|
1938
|
-
}), a.map((p) =>
|
|
1938
|
+
}), a.map((p) => u("option", {
|
|
1939
1939
|
value: p,
|
|
1940
1940
|
children: p
|
|
1941
1941
|
}, p))]
|
|
1942
|
-
}),
|
|
1942
|
+
}), u("svg", {
|
|
1943
1943
|
class: "text-neutral-12 absolute bottom-2.5 right-2 flex items-center justify-center",
|
|
1944
1944
|
width: "16",
|
|
1945
1945
|
height: "16",
|
|
@@ -1950,29 +1950,29 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1950
1950
|
viewBox: "0 0 16 16",
|
|
1951
1951
|
fill: "none",
|
|
1952
1952
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1953
|
-
children:
|
|
1953
|
+
children: u("path", {
|
|
1954
1954
|
d: "M4 6.5L8 10.5L12 6.5"
|
|
1955
1955
|
})
|
|
1956
1956
|
})]
|
|
1957
|
-
}) :
|
|
1957
|
+
}) : u("input", {
|
|
1958
1958
|
autoFocus: f === 0 ? !0 : void 0,
|
|
1959
1959
|
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",
|
|
1960
1960
|
name: b,
|
|
1961
1961
|
id: v,
|
|
1962
|
-
defaultValue: e[
|
|
1963
|
-
onInput: (p) => r(
|
|
1964
|
-
required:
|
|
1965
|
-
}), f === Rt.length - 1 ?
|
|
1962
|
+
defaultValue: e[c],
|
|
1963
|
+
onInput: (p) => r(c, p.currentTarget.value),
|
|
1964
|
+
required: c === "line2" ? s.config.line2Required === !0 : c !== "line3"
|
|
1965
|
+
}), f === Rt.length - 1 ? u("hr", {
|
|
1966
1966
|
class: "m-0 w-full border-b border-b-transparent"
|
|
1967
|
-
}) :
|
|
1967
|
+
}) : u("hr", {
|
|
1968
1968
|
class: "border-b-neutral-5 m-0 w-full border-b border-solid"
|
|
1969
1969
|
})]
|
|
1970
1970
|
})]
|
|
1971
1971
|
}) : null;
|
|
1972
1972
|
})
|
|
1973
|
-
}),
|
|
1973
|
+
}), u("div", {
|
|
1974
1974
|
class: "bg-neutral-1 sticky bottom-0 flex items-center py-2",
|
|
1975
|
-
children: [n,
|
|
1975
|
+
children: [n, u(Be, {
|
|
1976
1976
|
class: "ml-auto"
|
|
1977
1977
|
})]
|
|
1978
1978
|
})]
|
|
@@ -1983,14 +1983,14 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1983
1983
|
var r;
|
|
1984
1984
|
(r = e.current) == null || r.focus();
|
|
1985
1985
|
}, []), e;
|
|
1986
|
-
},
|
|
1986
|
+
}, un = ["true", "false"], ba = /* @__PURE__ */ on(un), ga = "answer", cn = "flex items-center flex-wrap gap-2 p-2.5", dn = "min-w-0 max-w-full flex-auto", fn = zr(({
|
|
1987
1987
|
label: e,
|
|
1988
1988
|
...r
|
|
1989
|
-
}, t) =>
|
|
1989
|
+
}, t) => u("button", {
|
|
1990
1990
|
class: "bg-lowest ease-expo-out ring-divider text-neutral-12 active:ring-accent-7 active:bg-accent-2 active:text-accent-11 fr block w-full overflow-hidden rounded-2xl px-2 py-2.5 ring-2 transition-all selection:bg-transparent",
|
|
1991
1991
|
...r,
|
|
1992
1992
|
ref: t,
|
|
1993
|
-
children:
|
|
1993
|
+
children: u("p", {
|
|
1994
1994
|
class: "text-center text-base",
|
|
1995
1995
|
children: e
|
|
1996
1996
|
})
|
|
@@ -1999,7 +1999,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1999
1999
|
onSubmitSuccess: r
|
|
2000
2000
|
}) => {
|
|
2001
2001
|
const t = Jt();
|
|
2002
|
-
return
|
|
2002
|
+
return u("form", {
|
|
2003
2003
|
noValidate: !0,
|
|
2004
2004
|
class: "",
|
|
2005
2005
|
onSubmit: (n) => {
|
|
@@ -2010,11 +2010,11 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2010
2010
|
value: i === "true"
|
|
2011
2011
|
});
|
|
2012
2012
|
},
|
|
2013
|
-
children: [
|
|
2014
|
-
class:
|
|
2015
|
-
children:
|
|
2013
|
+
children: [u("ul", {
|
|
2014
|
+
class: cn,
|
|
2015
|
+
children: un.map((n, s) => u("li", {
|
|
2016
2016
|
class: dn,
|
|
2017
|
-
children:
|
|
2017
|
+
children: u(fn, {
|
|
2018
2018
|
ref: s === 0 ? t : null,
|
|
2019
2019
|
type: "submit",
|
|
2020
2020
|
name: ga,
|
|
@@ -2022,9 +2022,9 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2022
2022
|
label: e.config.labels[n]
|
|
2023
2023
|
}, n)
|
|
2024
2024
|
}))
|
|
2025
|
-
}), e.config.optional &&
|
|
2025
|
+
}), e.config.optional && u("div", {
|
|
2026
2026
|
class: "px-2 pb-2",
|
|
2027
|
-
children:
|
|
2027
|
+
children: u(Se, {
|
|
2028
2028
|
class: "relative w-full",
|
|
2029
2029
|
type: "button",
|
|
2030
2030
|
onClick: () => r(null)
|
|
@@ -2042,23 +2042,23 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2042
2042
|
const {
|
|
2043
2043
|
t: n
|
|
2044
2044
|
} = ne(), [s, i] = _t(e.name);
|
|
2045
|
-
return
|
|
2045
|
+
return u("div", {
|
|
2046
2046
|
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),
|
|
2047
2047
|
...t,
|
|
2048
|
-
children: [
|
|
2048
|
+
children: [u("p", {
|
|
2049
2049
|
class: "text-accent-12 flex flex-grow overflow-hidden",
|
|
2050
|
-
children: [
|
|
2050
|
+
children: [u("span", {
|
|
2051
2051
|
class: "sr-only",
|
|
2052
2052
|
children: [n("file_name"), ": "]
|
|
2053
|
-
}),
|
|
2053
|
+
}), u("span", {
|
|
2054
2054
|
class: "block truncate",
|
|
2055
2055
|
children: s
|
|
2056
|
-
}),
|
|
2056
|
+
}), u("span", {
|
|
2057
2057
|
children: i
|
|
2058
2058
|
})]
|
|
2059
|
-
}),
|
|
2059
|
+
}), u("p", {
|
|
2060
2060
|
class: "text-accent-11",
|
|
2061
|
-
children: [
|
|
2061
|
+
children: [u("span", {
|
|
2062
2062
|
class: "sr-only",
|
|
2063
2063
|
children: [n("file_size"), ": "]
|
|
2064
2064
|
}), Ge(e.sizeKb)]
|
|
@@ -2067,7 +2067,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2067
2067
|
}, yr = ({
|
|
2068
2068
|
class: e,
|
|
2069
2069
|
...r
|
|
2070
|
-
}) =>
|
|
2070
|
+
}) => u("li", {
|
|
2071
2071
|
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),
|
|
2072
2072
|
...r
|
|
2073
2073
|
}), _a = (e, r) => {
|
|
@@ -2085,12 +2085,12 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2085
2085
|
analytics: t
|
|
2086
2086
|
}) => {
|
|
2087
2087
|
var k;
|
|
2088
|
-
const n = (k = q.current$.value.flow) == null ? void 0 : k.data.submissions[e.key], [s, i] =
|
|
2088
|
+
const n = (k = q.current$.value.flow) == null ? void 0 : k.data.submissions[e.key], [s, i] = ke(xa(n) && n.value.length ? {
|
|
2089
2089
|
status: "ready",
|
|
2090
2090
|
files: n.value
|
|
2091
2091
|
} : {
|
|
2092
2092
|
status: "empty"
|
|
2093
|
-
}), a = ye(0), o = s.status === "ready" ? s.files : [],
|
|
2093
|
+
}), a = ye(0), o = s.status === "ready" ? s.files : [], c = s.status === "ready" || s.status === "pending" ? s.files : [], f = s.status === "error" ? s.error : void 0, v = c.length - mr, b = pr(c), p = Jt(), {
|
|
2094
2094
|
t: y
|
|
2095
2095
|
} = ne(), C = (E) => {
|
|
2096
2096
|
if (!E.length)
|
|
@@ -2151,7 +2151,7 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2151
2151
|
customProperties: (V = (N = q.current$.peek().flow) == null ? void 0 : N.analytics) == null ? void 0 : V.customProperties
|
|
2152
2152
|
});
|
|
2153
2153
|
};
|
|
2154
|
-
return
|
|
2154
|
+
return u("form", {
|
|
2155
2155
|
class: "flex flex-col gap-1 p-2.5",
|
|
2156
2156
|
onSubmit: (E) => {
|
|
2157
2157
|
if (E.preventDefault(), s.status === "pending" || s.status === "error")
|
|
@@ -2165,94 +2165,94 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2165
2165
|
value: o
|
|
2166
2166
|
});
|
|
2167
2167
|
},
|
|
2168
|
-
children: [
|
|
2168
|
+
children: [u("div", {
|
|
2169
2169
|
class: "flex items-center gap-2",
|
|
2170
|
-
children: [
|
|
2170
|
+
children: [u("label", {
|
|
2171
2171
|
ref: p,
|
|
2172
2172
|
for: "dropzone-file",
|
|
2173
2173
|
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",
|
|
2174
|
-
children: [
|
|
2174
|
+
children: [c.length > 0 ? u("ul", {
|
|
2175
2175
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2176
|
-
children: [
|
|
2176
|
+
children: [c.slice(0, mr).map((E) => {
|
|
2177
2177
|
const [g, N] = _t(E.name);
|
|
2178
|
-
return
|
|
2178
|
+
return u(yr, {
|
|
2179
2179
|
class: "flex overflow-hidden",
|
|
2180
|
-
children: [
|
|
2180
|
+
children: [u("span", {
|
|
2181
2181
|
class: "block truncate",
|
|
2182
2182
|
children: g
|
|
2183
|
-
}),
|
|
2183
|
+
}), u("span", {
|
|
2184
2184
|
children: N
|
|
2185
2185
|
})]
|
|
2186
2186
|
});
|
|
2187
|
-
}), v > 0 ?
|
|
2187
|
+
}), v > 0 ? u(yr, {
|
|
2188
2188
|
children: y("file_more", {
|
|
2189
2189
|
count: v
|
|
2190
2190
|
})
|
|
2191
2191
|
}) : null]
|
|
2192
|
-
}) :
|
|
2192
|
+
}) : u("div", {
|
|
2193
2193
|
class: "flex flex-col justify-center gap-4 pb-6 pt-5",
|
|
2194
|
-
children: [
|
|
2194
|
+
children: [u("header", {
|
|
2195
2195
|
class: "flex flex-col items-center gap-0",
|
|
2196
|
-
children: [
|
|
2196
|
+
children: [u("svg", {
|
|
2197
2197
|
class: "text-neutral-11 mb-1 h-8 w-8",
|
|
2198
2198
|
"aria-hidden": "true",
|
|
2199
2199
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2200
2200
|
fill: "none",
|
|
2201
2201
|
viewBox: "0 0 20 16",
|
|
2202
|
-
children:
|
|
2202
|
+
children: u("path", {
|
|
2203
2203
|
stroke: "currentColor",
|
|
2204
2204
|
"stroke-linecap": "round",
|
|
2205
2205
|
"stroke-linejoin": "round",
|
|
2206
2206
|
"stroke-width": "1.5",
|
|
2207
2207
|
d: "M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"
|
|
2208
2208
|
})
|
|
2209
|
-
}),
|
|
2209
|
+
}), u("p", {
|
|
2210
2210
|
class: "text-neutral-12 tracking-[-0.01em]",
|
|
2211
2211
|
children: y("upload_file", {
|
|
2212
2212
|
count: e.config.allowMultiple ? 2 : 1
|
|
2213
2213
|
})
|
|
2214
|
-
}), e.config.fileSizeLimitKib ?
|
|
2214
|
+
}), e.config.fileSizeLimitKib ? u("p", {
|
|
2215
2215
|
class: "text-neutral-11 text-xs",
|
|
2216
2216
|
children: ["(", y("file_max_size", {
|
|
2217
2217
|
size: Ge(e.config.fileSizeLimitKib)
|
|
2218
2218
|
}), ")"]
|
|
2219
2219
|
}) : null]
|
|
2220
|
-
}),
|
|
2220
|
+
}), u("aside", {
|
|
2221
2221
|
class: "flex flex-col items-center gap-2",
|
|
2222
|
-
children: [
|
|
2222
|
+
children: [u("p", {
|
|
2223
2223
|
id: "accepted-filetypes",
|
|
2224
2224
|
class: "sr-only",
|
|
2225
2225
|
children: y("file_extensions")
|
|
2226
|
-
}),
|
|
2226
|
+
}), u("ul", {
|
|
2227
2227
|
"aria-describedby": "accepted-filetypes",
|
|
2228
2228
|
class: "flex flex-wrap justify-center gap-2",
|
|
2229
|
-
children: e.config.extensions.map((E) =>
|
|
2229
|
+
children: e.config.extensions.map((E) => u("li", {
|
|
2230
2230
|
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",
|
|
2231
2231
|
children: E.replace(".", "")
|
|
2232
2232
|
}))
|
|
2233
2233
|
})]
|
|
2234
2234
|
})]
|
|
2235
|
-
}),
|
|
2235
|
+
}), u("p", {
|
|
2236
2236
|
role: "status",
|
|
2237
|
-
class: Qe("text-neutral-11 flex items-center gap-1.5 text-xs",
|
|
2238
|
-
children: s.status === "pending" ?
|
|
2239
|
-
children: [
|
|
2237
|
+
class: Qe("text-neutral-11 flex items-center gap-1.5 text-xs", c.length === 0 && "sr-only"),
|
|
2238
|
+
children: s.status === "pending" ? u(be, {
|
|
2239
|
+
children: [u(Ut, {
|
|
2240
2240
|
"aria-hidden": "true",
|
|
2241
2241
|
class: "h-4 w-4"
|
|
2242
2242
|
}), y("file_preparing", {
|
|
2243
|
-
count:
|
|
2243
|
+
count: c.length
|
|
2244
2244
|
})]
|
|
2245
|
-
}) : s.status === "ready" ?
|
|
2245
|
+
}) : s.status === "ready" ? u(be, {
|
|
2246
2246
|
children: [o.length > 1 ? y("file_total_size", {
|
|
2247
2247
|
size: Ge(b)
|
|
2248
|
-
}) : Ge(b),
|
|
2248
|
+
}) : Ge(b), u("span", {
|
|
2249
2249
|
class: "sr-only",
|
|
2250
2250
|
children: [". ", y("file_ready", {
|
|
2251
2251
|
count: o.length
|
|
2252
2252
|
})]
|
|
2253
2253
|
})]
|
|
2254
2254
|
}) : null
|
|
2255
|
-
}),
|
|
2255
|
+
}), u("input", {
|
|
2256
2256
|
id: "dropzone-file",
|
|
2257
2257
|
"aria-label": y("upload_file", {
|
|
2258
2258
|
count: e.config.allowMultiple ? 2 : 1
|
|
@@ -2307,16 +2307,16 @@ const Ye = xt("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2307
2307
|
type: "file",
|
|
2308
2308
|
class: "sr-only"
|
|
2309
2309
|
})]
|
|
2310
|
-
}),
|
|
2310
|
+
}), u("div", {
|
|
2311
2311
|
class: "flex h-full flex-col items-center gap-2",
|
|
2312
|
-
children: [
|
|
2312
|
+
children: [u(Be, {
|
|
2313
2313
|
disabled: o.length === 0
|
|
2314
|
-
}), e.config.optional &&
|
|
2314
|
+
}), e.config.optional && u(Se, {
|
|
2315
2315
|
class: "relative",
|
|
2316
2316
|
onClick: () => r(null)
|
|
2317
2317
|
})]
|
|
2318
2318
|
})]
|
|
2319
|
-
}),
|
|
2319
|
+
}), u(tt, {
|
|
2320
2320
|
error: f
|
|
2321
2321
|
})]
|
|
2322
2322
|
});
|
|
@@ -2351,14 +2351,14 @@ var kt = (e) => /^\w*$/.test(e), G = (e) => e === void 0, Xt = (e) => Array.isAr
|
|
|
2351
2351
|
const s = kt(r) ? [r] : Yt(r), i = s.length, a = i - 1;
|
|
2352
2352
|
for (; ++n < i; ) {
|
|
2353
2353
|
const o = s[n];
|
|
2354
|
-
let
|
|
2354
|
+
let c = t;
|
|
2355
2355
|
if (n !== a) {
|
|
2356
2356
|
const f = e[o];
|
|
2357
|
-
|
|
2357
|
+
c = Z(f) || Array.isArray(f) ? f : isNaN(+s[n + 1]) ? {} : [];
|
|
2358
2358
|
}
|
|
2359
2359
|
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
2360
2360
|
return;
|
|
2361
|
-
e[o] =
|
|
2361
|
+
e[o] = c, e = e[o];
|
|
2362
2362
|
}
|
|
2363
2363
|
};
|
|
2364
2364
|
const gr = {
|
|
@@ -2371,7 +2371,7 @@ const gr = {
|
|
|
2371
2371
|
onSubmit: "onSubmit",
|
|
2372
2372
|
onTouched: "onTouched",
|
|
2373
2373
|
all: "all"
|
|
2374
|
-
},
|
|
2374
|
+
}, _e = {
|
|
2375
2375
|
max: "max",
|
|
2376
2376
|
min: "min",
|
|
2377
2377
|
maxLength: "maxLength",
|
|
@@ -2395,8 +2395,8 @@ var Ma = (e, r, t, n = !0) => {
|
|
|
2395
2395
|
return s;
|
|
2396
2396
|
};
|
|
2397
2397
|
const La = typeof window < "u" ? ae.useLayoutEffect : ae.useEffect;
|
|
2398
|
-
var
|
|
2399
|
-
function
|
|
2398
|
+
var ce = (e) => typeof e == "string", Na = (e, r, t, n, s) => ce(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);
|
|
2399
|
+
function Ve(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
2400
2400
|
if (Pt(e) || Pt(r))
|
|
2401
2401
|
return Object.is(e, r);
|
|
2402
2402
|
if (De(e) && De(r))
|
|
@@ -2413,7 +2413,7 @@ function Fe(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
|
2413
2413
|
return !1;
|
|
2414
2414
|
if (i !== "ref") {
|
|
2415
2415
|
const o = r[i];
|
|
2416
|
-
if (De(a) && De(o) || Z(a) && Z(o) || Array.isArray(a) && Array.isArray(o) ? !
|
|
2416
|
+
if (De(a) && De(o) || Z(a) && Z(o) || Array.isArray(a) && Array.isArray(o) ? !Ve(a, o, t) : !Object.is(a, o))
|
|
2417
2417
|
return !1;
|
|
2418
2418
|
}
|
|
2419
2419
|
}
|
|
@@ -2427,7 +2427,7 @@ var pn = (e, r, t, n, s) => r ? {
|
|
|
2427
2427
|
...t[e] && t[e].types ? t[e].types : {},
|
|
2428
2428
|
[n]: s || !0
|
|
2429
2429
|
}
|
|
2430
|
-
} : {},
|
|
2430
|
+
} : {}, ct = (e) => Array.isArray(e) ? e : [e], vr = () => {
|
|
2431
2431
|
let e = [];
|
|
2432
2432
|
return {
|
|
2433
2433
|
get observers() {
|
|
@@ -2507,7 +2507,7 @@ function Ke(e, r, t) {
|
|
|
2507
2507
|
G(r) || Pt(t[n]) ? t[n] = qt(s, Array.isArray(s) ? [] : {}) : Ke(s, oe(r) ? {} : r[n], t[n]);
|
|
2508
2508
|
else {
|
|
2509
2509
|
const i = r[n];
|
|
2510
|
-
t[n] = !
|
|
2510
|
+
t[n] = !Ve(s, i);
|
|
2511
2511
|
}
|
|
2512
2512
|
}
|
|
2513
2513
|
return t;
|
|
@@ -2528,7 +2528,7 @@ var gn = (e) => {
|
|
|
2528
2528
|
) : xr;
|
|
2529
2529
|
}
|
|
2530
2530
|
return xr;
|
|
2531
|
-
}, vn = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) => G(e) ? e : r ? e === "" ? NaN : e && +e : t &&
|
|
2531
|
+
}, vn = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) => G(e) ? e : r ? e === "" ? NaN : e && +e : t && ce(e) ? new Date(e) : n ? n(e) : e;
|
|
2532
2532
|
const _r = {
|
|
2533
2533
|
isValid: !1,
|
|
2534
2534
|
value: null
|
|
@@ -2611,15 +2611,15 @@ var qa = (e, r, t, n) => {
|
|
|
2611
2611
|
t(e);
|
|
2612
2612
|
const { name: s, ...i } = e;
|
|
2613
2613
|
return ie(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((a) => r[a] === (!n || fe.all));
|
|
2614
|
-
}, Ua = (e, r, t) => !e || !r || e === r ||
|
|
2615
|
-
const n =
|
|
2614
|
+
}, Ua = (e, r, t) => !e || !r || e === r || ct(e).some((n) => n && (t ? n === r : n.startsWith(r) || r.startsWith(n))), Wa = (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, za = (e, r) => !Xt(S(e, r)).length && J(e, r), Ha = (e, r, t) => {
|
|
2615
|
+
const n = ct(S(e, t));
|
|
2616
2616
|
return z(n, "root", r[t]), z(e, t, n), e;
|
|
2617
2617
|
};
|
|
2618
2618
|
function Ir(e, r, t = "validate") {
|
|
2619
|
-
if (
|
|
2619
|
+
if (ce(e) || Array.isArray(e) && e.every(ce) || me(e) && !e)
|
|
2620
2620
|
return {
|
|
2621
2621
|
type: t,
|
|
2622
|
-
message:
|
|
2622
|
+
message: ce(e) ? e : "",
|
|
2623
2623
|
ref: r
|
|
2624
2624
|
};
|
|
2625
2625
|
}
|
|
@@ -2627,12 +2627,12 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2627
2627
|
value: e,
|
|
2628
2628
|
message: ""
|
|
2629
2629
|
}, Fr = async (e, r, t, n, s, i) => {
|
|
2630
|
-
const { ref: a, refs: o, required:
|
|
2630
|
+
const { ref: a, refs: o, required: c, maxLength: f, minLength: v, min: b, max: p, pattern: y, validate: C, name: _, valueAsNumber: k, mount: E } = e._f, g = S(t, _);
|
|
2631
2631
|
if (!E || r.has(_))
|
|
2632
2632
|
return {};
|
|
2633
2633
|
const N = o ? o[0] : a, V = (I) => {
|
|
2634
2634
|
s && N.reportValidity && (N.setCustomValidity(me(I) ? "" : I || ""), N.reportValidity());
|
|
2635
|
-
}, 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 =
|
|
2635
|
+
}, 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 = _e.maxLength, W = _e.minLength) => {
|
|
2636
2636
|
const U = I ? F : j;
|
|
2637
2637
|
M[_] = {
|
|
2638
2638
|
type: I ? L : W,
|
|
@@ -2641,13 +2641,13 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2641
2641
|
...R(I ? L : W, U)
|
|
2642
2642
|
};
|
|
2643
2643
|
};
|
|
2644
|
-
if (i ? !Array.isArray(g) || !g.length :
|
|
2645
|
-
const { value: I, message: F } =
|
|
2644
|
+
if (i ? !Array.isArray(g) || !g.length : c && (!ee && (T || oe(g)) || me(g) && !g || K && !gn(o).isValid || O && !xn(o).isValid)) {
|
|
2645
|
+
const { value: I, message: F } = ce(c) ? { value: !!c, message: c } : He(c);
|
|
2646
2646
|
if (I && (M[_] = {
|
|
2647
|
-
type:
|
|
2647
|
+
type: _e.required,
|
|
2648
2648
|
message: F,
|
|
2649
2649
|
ref: N,
|
|
2650
|
-
...R(
|
|
2650
|
+
...R(_e.required, F)
|
|
2651
2651
|
}, !n))
|
|
2652
2652
|
return V(F), M;
|
|
2653
2653
|
}
|
|
@@ -2659,23 +2659,23 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2659
2659
|
oe(j.value) || (I = W > j.value), oe(L.value) || (F = W < L.value);
|
|
2660
2660
|
} else {
|
|
2661
2661
|
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";
|
|
2662
|
-
|
|
2662
|
+
ce(j.value) && g && (I = te ? U(g) > U(j.value) : X ? g > j.value : W > new Date(j.value)), ce(L.value) && g && (F = te ? U(g) < U(L.value) : X ? g < L.value : W < new Date(L.value));
|
|
2663
2663
|
}
|
|
2664
|
-
if ((I || F) && (B(!!I, j.message, L.message,
|
|
2664
|
+
if ((I || F) && (B(!!I, j.message, L.message, _e.max, _e.min), !n))
|
|
2665
2665
|
return V(M[_].message), M;
|
|
2666
2666
|
}
|
|
2667
|
-
if ((f || v) && !T && (
|
|
2667
|
+
if ((f || v) && !T && (ce(g) || i && Array.isArray(g))) {
|
|
2668
2668
|
const I = He(f), F = He(v), j = !oe(I.value) && g.length > +I.value, L = !oe(F.value) && g.length < +F.value;
|
|
2669
2669
|
if ((j || L) && (B(j, I.message, F.message), !n))
|
|
2670
2670
|
return V(M[_].message), M;
|
|
2671
2671
|
}
|
|
2672
|
-
if (y && !T &&
|
|
2672
|
+
if (y && !T && ce(g)) {
|
|
2673
2673
|
const { value: I, message: F } = He(y);
|
|
2674
2674
|
if (gt(I) && !g.match(I) && (M[_] = {
|
|
2675
|
-
type:
|
|
2675
|
+
type: _e.pattern,
|
|
2676
2676
|
message: F,
|
|
2677
2677
|
ref: a,
|
|
2678
|
-
...R(
|
|
2678
|
+
...R(_e.pattern, F)
|
|
2679
2679
|
}, !n))
|
|
2680
2680
|
return V(F), M;
|
|
2681
2681
|
}
|
|
@@ -2684,7 +2684,7 @@ var He = (e) => Z(e) && !gt(e) ? e : {
|
|
|
2684
2684
|
const I = await C(g, t), F = Ir(I, N);
|
|
2685
2685
|
if (F && (M[_] = {
|
|
2686
2686
|
...F,
|
|
2687
|
-
...R(
|
|
2687
|
+
...R(_e.validate, F.message)
|
|
2688
2688
|
}, !n))
|
|
2689
2689
|
return V(F.message), M;
|
|
2690
2690
|
} else if (Z(C)) {
|
|
@@ -2742,7 +2742,7 @@ function Ga(e = {}) {
|
|
|
2742
2742
|
unMount: /* @__PURE__ */ new Set(),
|
|
2743
2743
|
array: /* @__PURE__ */ new Set(),
|
|
2744
2744
|
watch: /* @__PURE__ */ new Set()
|
|
2745
|
-
},
|
|
2745
|
+
}, c, f = 0;
|
|
2746
2746
|
const v = {
|
|
2747
2747
|
isDirty: !1,
|
|
2748
2748
|
dirtyFields: !1,
|
|
@@ -2822,7 +2822,7 @@ function Ga(e = {}) {
|
|
|
2822
2822
|
if (!r.disabled) {
|
|
2823
2823
|
if (!h || w) {
|
|
2824
2824
|
(b.isDirty || p.isDirty) && (A = t.isDirty, t.isDirty = $.isDirty = I(), x = A !== $.isDirty);
|
|
2825
|
-
const P =
|
|
2825
|
+
const P = Ve(S(s, l), d);
|
|
2826
2826
|
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;
|
|
2827
2827
|
}
|
|
2828
2828
|
if (h) {
|
|
@@ -2834,7 +2834,7 @@ function Ga(e = {}) {
|
|
|
2834
2834
|
return x ? $ : {};
|
|
2835
2835
|
}, K = (l, d, h, w) => {
|
|
2836
2836
|
const m = S(t.errors, l), x = (b.isValid || p.isValid) && me(d) && t.isValid !== d;
|
|
2837
|
-
if (r.delayError && h ? (
|
|
2837
|
+
if (r.delayError && h ? (c = _(() => N(l, h)), c(r.delayError)) : (clearTimeout(f), c = null, h ? z(t.errors, l, h) : J(t.errors, l)), (h ? !Ve(m, h) : m) || !ie(w) || x) {
|
|
2838
2838
|
const A = {
|
|
2839
2839
|
...w,
|
|
2840
2840
|
...x && me(d) ? { isValid: d } : {},
|
|
@@ -2881,8 +2881,8 @@ function Ga(e = {}) {
|
|
|
2881
2881
|
d && (d._f.refs ? d._f.refs.every((h) => !Tt(h)) : !Tt(d._f.ref)) && qe(l);
|
|
2882
2882
|
}
|
|
2883
2883
|
o.unMount = /* @__PURE__ */ new Set();
|
|
2884
|
-
}, I = (l, d) => !r.disabled && (l && d && z(i, l, d), !
|
|
2885
|
-
...a.mount ? i : G(d) ? s :
|
|
2884
|
+
}, I = (l, d) => !r.disabled && (l && d && z(i, l, d), !Ve(rt(), s)), F = (l, d, h) => Na(l, o, {
|
|
2885
|
+
...a.mount ? i : G(d) ? s : ce(l) ? { [l]: d } : d
|
|
2886
2886
|
}, h, d), j = (l) => Xt(S(a.mount ? i : s, l, r.shouldUnregister ? S(s, l, []) : [])), L = (l, d, h = {}) => {
|
|
2887
2887
|
const w = S(n, l);
|
|
2888
2888
|
let m = d;
|
|
@@ -2925,20 +2925,20 @@ function Ga(e = {}) {
|
|
|
2925
2925
|
const d = l.target;
|
|
2926
2926
|
let h = d.name, w = !0;
|
|
2927
2927
|
const m = S(n, h), x = (P) => {
|
|
2928
|
-
w = Number.isNaN(P) || De(P) && isNaN(P.getTime()) ||
|
|
2928
|
+
w = Number.isNaN(P) || De(P) && isNaN(P.getTime()) || Ve(P, S(i, h, P));
|
|
2929
2929
|
}, A = Cr(r.mode), $ = Cr(r.reValidateMode);
|
|
2930
2930
|
if (m) {
|
|
2931
2931
|
let P, se;
|
|
2932
|
-
const Te = d.type ? kr(m._f) : Ea(l),
|
|
2933
|
-
z(i, h, Te),
|
|
2934
|
-
const It = O(h, Te,
|
|
2935
|
-
if (!
|
|
2932
|
+
const Te = d.type ? kr(m._f) : Ea(l), Ae = l.type === gr.BLUR || l.type === gr.FOCUS_OUT, _n = !Pa(m._f) && !r.resolver && !S(t.errors, h) && !m._f.deps || Wa(Ae, S(t.touchedFields, h), t.isSubmitted, $, A), At = Er(h, o, Ae);
|
|
2933
|
+
z(i, h, Te), Ae ? (!d || !d.readOnly) && (m._f.onBlur && m._f.onBlur(l), c && c(0)) : m._f.onChange && m._f.onChange(l);
|
|
2934
|
+
const It = O(h, Te, Ae), kn = !ie(It) || At;
|
|
2935
|
+
if (!Ae && y.state.next({
|
|
2936
2936
|
name: h,
|
|
2937
2937
|
type: l.type,
|
|
2938
2938
|
values: Q(i)
|
|
2939
2939
|
}), _n)
|
|
2940
|
-
return (b.isValid || p.isValid) && (r.mode === "onBlur" ?
|
|
2941
|
-
if (!
|
|
2940
|
+
return (b.isValid || p.isValid) && (r.mode === "onBlur" ? Ae && k() : Ae || k()), kn && y.state.next({ name: h, ...At ? {} : It });
|
|
2941
|
+
if (!Ae && At && y.state.next({ ...t }), r.resolver) {
|
|
2942
2942
|
const { errors: tr } = await ee([h]);
|
|
2943
2943
|
if (E([h]), x(Te), w) {
|
|
2944
2944
|
const Cn = Ar(t.errors, n, h), rr = Ar(tr, n, Cn.name || h);
|
|
@@ -2953,7 +2953,7 @@ function Ga(e = {}) {
|
|
|
2953
2953
|
return l.focus(), 1;
|
|
2954
2954
|
}, H = async (l, d = {}) => {
|
|
2955
2955
|
let h, w;
|
|
2956
|
-
const m =
|
|
2956
|
+
const m = ct(l);
|
|
2957
2957
|
if (r.resolver) {
|
|
2958
2958
|
const x = await T(G(l) ? l : m);
|
|
2959
2959
|
h = ie(x), w = l ? !m.some((A) => S(x, A)) : h;
|
|
@@ -2963,7 +2963,7 @@ function Ga(e = {}) {
|
|
|
2963
2963
|
return await R(A && A._f ? { [x]: A } : A);
|
|
2964
2964
|
}))).every(Boolean), !(!w && !t.isValid) && k()) : w = h = await R(n);
|
|
2965
2965
|
return y.state.next({
|
|
2966
|
-
...!
|
|
2966
|
+
...!ce(l) || (b.isValid || p.isValid) && h !== t.isValid ? {} : { name: l },
|
|
2967
2967
|
...r.resolver || !l ? { isValid: h } : {},
|
|
2968
2968
|
errors: t.errors
|
|
2969
2969
|
}), d.shouldFocus && !w && dt(n, X, l ? m : o.mount), w;
|
|
@@ -2971,7 +2971,7 @@ function Ga(e = {}) {
|
|
|
2971
2971
|
let h = {
|
|
2972
2972
|
...a.mount ? i : s
|
|
2973
2973
|
};
|
|
2974
|
-
return d && (h = mn(d.dirtyFields ? t.dirtyFields : t.touchedFields, h)), G(l) ? h :
|
|
2974
|
+
return d && (h = mn(d.dirtyFields ? t.dirtyFields : t.touchedFields, h)), G(l) ? h : ce(l) ? S(h, l) : l.map((w) => S(h, w));
|
|
2975
2975
|
}, $e = (l, d) => ({
|
|
2976
2976
|
invalid: !!S((d || t).errors, l),
|
|
2977
2977
|
isDirty: !!S((d || t).dirtyFields, l),
|
|
@@ -2979,7 +2979,7 @@ function Ga(e = {}) {
|
|
|
2979
2979
|
isValidating: !!S(t.validatingFields, l),
|
|
2980
2980
|
isTouched: !!S((d || t).touchedFields, l)
|
|
2981
2981
|
}), D = (l) => {
|
|
2982
|
-
const d = l ?
|
|
2982
|
+
const d = l ? ct(l) : void 0;
|
|
2983
2983
|
d == null || d.forEach((h) => J(t.errors, h)), d ? d.forEach((h) => {
|
|
2984
2984
|
y.state.next({
|
|
2985
2985
|
name: h,
|
|
@@ -3001,7 +3001,7 @@ function Ga(e = {}) {
|
|
|
3001
3001
|
}), h && h.shouldFocus && w && w.focus && w.focus();
|
|
3002
3002
|
}, Pe = (l, d) => de(l) ? y.state.subscribe({
|
|
3003
3003
|
next: (h) => "values" in h && l(F(void 0, d), h)
|
|
3004
|
-
}) : F(l, d, !0),
|
|
3004
|
+
}) : F(l, d, !0), Ee = (l) => y.state.subscribe({
|
|
3005
3005
|
next: (d) => {
|
|
3006
3006
|
Ua(l.name, d.name, l.exact) && qa(d, l.formState || b, mt, l.reRenderRoot) && l.callback({
|
|
3007
3007
|
values: { ...i },
|
|
@@ -3013,14 +3013,14 @@ function Ga(e = {}) {
|
|
|
3013
3013
|
}).unsubscribe, Ne = (l) => (a.mount = !0, p = {
|
|
3014
3014
|
...p,
|
|
3015
3015
|
...l.formState
|
|
3016
|
-
},
|
|
3016
|
+
}, Ee({
|
|
3017
3017
|
...l,
|
|
3018
3018
|
formState: {
|
|
3019
3019
|
...v,
|
|
3020
3020
|
...l.formState
|
|
3021
3021
|
}
|
|
3022
3022
|
})), qe = (l, d = {}) => {
|
|
3023
|
-
for (const h of l ?
|
|
3023
|
+
for (const h of l ? ct(l) : o.mount)
|
|
3024
3024
|
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);
|
|
3025
3025
|
y.state.next({
|
|
3026
3026
|
values: Q(i)
|
|
@@ -3033,7 +3033,7 @@ function Ga(e = {}) {
|
|
|
3033
3033
|
const m = o.disabled.has(d) !== !!l;
|
|
3034
3034
|
l ? o.disabled.add(d) : o.disabled.delete(d), m && a.mount && !a.action && k();
|
|
3035
3035
|
}
|
|
3036
|
-
},
|
|
3036
|
+
}, ve = (l, d = {}) => {
|
|
3037
3037
|
let h = S(n, l);
|
|
3038
3038
|
const w = me(d.disabled) || me(r.disabled);
|
|
3039
3039
|
return z(n, l, {
|
|
@@ -3062,7 +3062,7 @@ function Ga(e = {}) {
|
|
|
3062
3062
|
onBlur: te,
|
|
3063
3063
|
ref: (m) => {
|
|
3064
3064
|
if (m) {
|
|
3065
|
-
|
|
3065
|
+
ve(l, d), h = S(n, l);
|
|
3066
3066
|
const x = G(m.value) && m.querySelectorAll && m.querySelectorAll("input,select,textarea")[0] || m, A = Ta(x), $ = h._f.refs || [];
|
|
3067
3067
|
if (A ? $.find((P) => P === x) : x === h._f.ref)
|
|
3068
3068
|
return;
|
|
@@ -3174,7 +3174,7 @@ function Ga(e = {}) {
|
|
|
3174
3174
|
focus: ""
|
|
3175
3175
|
}, 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({
|
|
3176
3176
|
submitCount: d.keepSubmitCount ? t.submitCount : 0,
|
|
3177
|
-
isDirty: m ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !
|
|
3177
|
+
isDirty: m ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Ve(l, s)),
|
|
3178
3178
|
isSubmitted: d.keepIsSubmitted ? t.isSubmitted : !1,
|
|
3179
3179
|
dirtyFields: m ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? Ke(s, i) : t.dirtyFields : d.keepDefaultValues && l ? Ke(s, l) : d.keepDirty ? t.dirtyFields : {},
|
|
3180
3180
|
touchedFields: d.keepTouched ? t.touchedFields : {},
|
|
@@ -3198,12 +3198,12 @@ function Ga(e = {}) {
|
|
|
3198
3198
|
};
|
|
3199
3199
|
}, at = {
|
|
3200
3200
|
control: {
|
|
3201
|
-
register:
|
|
3201
|
+
register: ve,
|
|
3202
3202
|
unregister: qe,
|
|
3203
3203
|
getFieldState: $e,
|
|
3204
3204
|
handleSubmit: We,
|
|
3205
3205
|
setError: je,
|
|
3206
|
-
_subscribe:
|
|
3206
|
+
_subscribe: Ee,
|
|
3207
3207
|
_runSchema: ee,
|
|
3208
3208
|
_updateIsValidating: E,
|
|
3209
3209
|
_focusError: Ue,
|
|
@@ -3260,7 +3260,7 @@ function Ga(e = {}) {
|
|
|
3260
3260
|
},
|
|
3261
3261
|
subscribe: Ne,
|
|
3262
3262
|
trigger: H,
|
|
3263
|
-
register:
|
|
3263
|
+
register: ve,
|
|
3264
3264
|
handleSubmit: We,
|
|
3265
3265
|
watch: Pe,
|
|
3266
3266
|
setValue: U,
|
|
@@ -3337,7 +3337,7 @@ function Ct(e = {}) {
|
|
|
3337
3337
|
}
|
|
3338
3338
|
}, [i, n.isDirty]), ae.useEffect(() => {
|
|
3339
3339
|
var a;
|
|
3340
|
-
e.values && !
|
|
3340
|
+
e.values && !Ve(e.values, t.current) ? (i._reset(e.values, {
|
|
3341
3341
|
keepFieldsRef: !0,
|
|
3342
3342
|
...i._options.resetOptions
|
|
3343
3343
|
}), !((a = i._options.resetOptions) === null || a === void 0) && a.keepIsValid || i._setValid(), t.current = e.values, s((o) => ({ ...o }))) : i._resetDefaultValues();
|
|
@@ -3374,15 +3374,15 @@ var St = function(e, r, t) {
|
|
|
3374
3374
|
var a = !i.shouldUseNativeValidation && i.criteriaMode === "all";
|
|
3375
3375
|
return Promise.resolve(/* @__PURE__ */ la(e, n, Object.assign({}, r, { abortPipeEarly: !a }))).then(function(o) {
|
|
3376
3376
|
if (o.issues) {
|
|
3377
|
-
for (var
|
|
3377
|
+
for (var c = {}; o.issues.length; ) {
|
|
3378
3378
|
var f = o.issues[0], v = /* @__PURE__ */ ta(f);
|
|
3379
|
-
if (v && (
|
|
3380
|
-
var b =
|
|
3381
|
-
|
|
3379
|
+
if (v && (c[v] || (c[v] = { message: f.message, type: f.type }), a)) {
|
|
3380
|
+
var b = c[v].types, p = b && b[f.type];
|
|
3381
|
+
c[v] = pn(v, a, c, f.type, p ? [].concat(p, f.message) : f.message);
|
|
3382
3382
|
}
|
|
3383
3383
|
o.issues.shift();
|
|
3384
3384
|
}
|
|
3385
|
-
return { values: {}, errors: Za(
|
|
3385
|
+
return { values: {}, errors: Za(c, i) };
|
|
3386
3386
|
}
|
|
3387
3387
|
return { values: t.raw ? n : o.output, errors: {} };
|
|
3388
3388
|
});
|
|
@@ -3396,8 +3396,8 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3396
3396
|
min: e.minSelected ?? 0,
|
|
3397
3397
|
max: e.maxSelected ?? e.options.length
|
|
3398
3398
|
};
|
|
3399
|
-
return St(/* @__PURE__ */
|
|
3400
|
-
checked: /* @__PURE__ */
|
|
3399
|
+
return St(/* @__PURE__ */ Ce({
|
|
3400
|
+
checked: /* @__PURE__ */ Me(/* @__PURE__ */ ln(/* @__PURE__ */ le(), /* @__PURE__ */ sn()), /* @__PURE__ */ Kt((n) => Object.entries(n).filter(([s, i]) => i).map(([s, i]) => s)), /* @__PURE__ */ ut(t.max, r("validation_multiple_choice_max", {
|
|
3401
3401
|
count: t.max
|
|
3402
3402
|
})), /* @__PURE__ */ Ze(t.min, r("validation_multiple_choice_min", {
|
|
3403
3403
|
count: t.min
|
|
@@ -3406,13 +3406,13 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3406
3406
|
}, ei = zr(({
|
|
3407
3407
|
option: e,
|
|
3408
3408
|
...r
|
|
3409
|
-
}, t) =>
|
|
3410
|
-
children: [
|
|
3409
|
+
}, t) => u(be, {
|
|
3410
|
+
children: [u("input", {
|
|
3411
3411
|
class: "peer sr-only h-full",
|
|
3412
3412
|
type: "checkbox",
|
|
3413
3413
|
...r,
|
|
3414
3414
|
ref: t
|
|
3415
|
-
}),
|
|
3415
|
+
}), u("label", {
|
|
3416
3416
|
class: "bg-lowest hover:bg-neutral-2 active:outline-neutral-8 ease-expo-out outline-divider text-neutral-11 peer-checked:outline-accent-7 peer-checked:bg-accent-2 peer-checked:text-accent-9 peer-focus-visible:ring-accent-9 peer-focus-visible:ring-offset-accent-7 block cursor-pointer select-none rounded-2xl px-3 py-1.5 outline outline-1 ring-0 ring-transparent transition-all selection:bg-transparent peer-focus-visible:ring-4",
|
|
3417
3417
|
htmlFor: r.id,
|
|
3418
3418
|
children: e.label
|
|
@@ -3422,8 +3422,8 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3422
3422
|
variant: {
|
|
3423
3423
|
// In cases where there is only one option, we want to center it
|
|
3424
3424
|
singleOption: "justify-center",
|
|
3425
|
-
// Two choices
|
|
3426
|
-
booleanLike:
|
|
3425
|
+
// Two choices, one answer
|
|
3426
|
+
booleanLike: cn
|
|
3427
3427
|
}
|
|
3428
3428
|
}
|
|
3429
3429
|
}), ti = ({
|
|
@@ -3431,13 +3431,13 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3431
3431
|
onSubmitSuccess: r
|
|
3432
3432
|
}) => {
|
|
3433
3433
|
var v, b;
|
|
3434
|
-
const t = e.key ? (v = q.current$.value.flow) == null ? void 0 : v.data.submissions[e.key] : void 0, n =
|
|
3434
|
+
const t = e.key ? (v = q.current$.value.flow) == null ? void 0 : v.data.submissions[e.key] : void 0, n = e.config.maxSelected === 1, s = n && e.config.options.length === 2, {
|
|
3435
3435
|
t: i
|
|
3436
3436
|
} = ne(), {
|
|
3437
3437
|
register: a,
|
|
3438
3438
|
handleSubmit: o,
|
|
3439
3439
|
formState: {
|
|
3440
|
-
errors:
|
|
3440
|
+
errors: c
|
|
3441
3441
|
}
|
|
3442
3442
|
} = Ct({
|
|
3443
3443
|
defaultValues: {
|
|
@@ -3445,29 +3445,41 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3445
3445
|
},
|
|
3446
3446
|
resolver: Qa(e.config, i)
|
|
3447
3447
|
}), f = Jt();
|
|
3448
|
-
return s ?
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3448
|
+
return s ? u(be, {
|
|
3449
|
+
children: [u("ul", {
|
|
3450
|
+
style: {
|
|
3451
|
+
maxHeight: 6.5 * Mr + 5 * Lr + 2 * Nr
|
|
3452
|
+
},
|
|
3453
|
+
class: Rr({
|
|
3454
|
+
variant: "booleanLike"
|
|
3455
|
+
}),
|
|
3456
|
+
children: e.config.options.map((p, y) => u("li", {
|
|
3457
|
+
class: dn,
|
|
3458
|
+
children: u(fn, {
|
|
3459
|
+
type: "submit",
|
|
3460
|
+
ref: (C) => {
|
|
3461
|
+
C && y === 0 && (f.current = C);
|
|
3462
|
+
},
|
|
3463
|
+
label: p.label,
|
|
3464
|
+
value: "true",
|
|
3465
|
+
onClick: () => r({
|
|
3466
|
+
type: "enum",
|
|
3467
|
+
value: [p.value]
|
|
3468
|
+
})
|
|
3469
|
+
})
|
|
3470
|
+
}, p.value))
|
|
3471
|
+
}), e.config.minSelected === 0 && u("div", {
|
|
3472
|
+
class: "px-2 pb-2",
|
|
3473
|
+
children: u(Se, {
|
|
3474
|
+
class: "relative w-full",
|
|
3475
|
+
type: "button",
|
|
3464
3476
|
onClick: () => r({
|
|
3465
3477
|
type: "enum",
|
|
3466
|
-
value: [
|
|
3478
|
+
value: []
|
|
3467
3479
|
})
|
|
3468
3480
|
})
|
|
3469
|
-
}
|
|
3470
|
-
}) :
|
|
3481
|
+
})]
|
|
3482
|
+
}) : u("form", {
|
|
3471
3483
|
noValidate: !0,
|
|
3472
3484
|
onSubmit: (p) => o((y) => {
|
|
3473
3485
|
const C = y.checked;
|
|
@@ -3476,9 +3488,9 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3476
3488
|
value: C
|
|
3477
3489
|
});
|
|
3478
3490
|
})(p),
|
|
3479
|
-
children: [
|
|
3491
|
+
children: [u("div", {
|
|
3480
3492
|
class: "flex items-center gap-1",
|
|
3481
|
-
children: [
|
|
3493
|
+
children: [u("ul", {
|
|
3482
3494
|
style: {
|
|
3483
3495
|
maxHeight: 6.5 * Mr + 5 * Lr + 2 * Nr
|
|
3484
3496
|
},
|
|
@@ -3490,9 +3502,9 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3490
3502
|
ref: _,
|
|
3491
3503
|
...k
|
|
3492
3504
|
} = a(C);
|
|
3493
|
-
return
|
|
3505
|
+
return u("li", {
|
|
3494
3506
|
class: "relative",
|
|
3495
|
-
children:
|
|
3507
|
+
children: u(ei, {
|
|
3496
3508
|
option: p,
|
|
3497
3509
|
autoFocus: y === 0,
|
|
3498
3510
|
ref: (E) => {
|
|
@@ -3507,9 +3519,9 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3507
3519
|
})
|
|
3508
3520
|
}, p.value);
|
|
3509
3521
|
})
|
|
3510
|
-
}),
|
|
3522
|
+
}), u("div", {
|
|
3511
3523
|
class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
|
|
3512
|
-
children: [n ? null :
|
|
3524
|
+
children: [n ? null : u(Be, {}), e.config.minSelected === 0 && u(Se, {
|
|
3513
3525
|
class: "relative",
|
|
3514
3526
|
type: "button",
|
|
3515
3527
|
onClick: () => r({
|
|
@@ -3518,17 +3530,17 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3518
3530
|
})
|
|
3519
3531
|
})]
|
|
3520
3532
|
})]
|
|
3521
|
-
}),
|
|
3533
|
+
}), u("div", {
|
|
3522
3534
|
class: "px-1",
|
|
3523
|
-
children:
|
|
3524
|
-
error: (b =
|
|
3535
|
+
children: u(tt, {
|
|
3536
|
+
error: (b = c.checked) == null ? void 0 : b.root
|
|
3525
3537
|
})
|
|
3526
3538
|
})]
|
|
3527
3539
|
});
|
|
3528
3540
|
}, ri = et("number"), ni = (e, r) => {
|
|
3529
3541
|
const t = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, s = e.decimalCases ?? 0;
|
|
3530
|
-
return St(/* @__PURE__ */
|
|
3531
|
-
number: /* @__PURE__ */
|
|
3542
|
+
return St(/* @__PURE__ */ Ce({
|
|
3543
|
+
number: /* @__PURE__ */ Me(/* @__PURE__ */ an(r("validation_number")), /* @__PURE__ */ en(t, r("validation_number_min", {
|
|
3532
3544
|
min: t
|
|
3533
3545
|
})), /* @__PURE__ */ Qr(n, r("validation_number_max", {
|
|
3534
3546
|
max: n
|
|
@@ -3555,15 +3567,15 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3555
3567
|
},
|
|
3556
3568
|
resolver: ni(e.config, s)
|
|
3557
3569
|
}), {
|
|
3558
|
-
ref:
|
|
3570
|
+
ref: c,
|
|
3559
3571
|
...f
|
|
3560
3572
|
} = i("number", {
|
|
3561
3573
|
required: !e.config.optional,
|
|
3562
3574
|
valueAsNumber: !0
|
|
3563
3575
|
}), v = ye();
|
|
3564
|
-
return
|
|
3576
|
+
return Le(() => {
|
|
3565
3577
|
v.current && (v.current.focus(), v.current.select());
|
|
3566
|
-
}, []),
|
|
3578
|
+
}, []), u("form", {
|
|
3567
3579
|
class: "flex flex-col gap-1 p-2.5",
|
|
3568
3580
|
onSubmit: a((p) => {
|
|
3569
3581
|
p.number !== void 0 && r({
|
|
@@ -3571,11 +3583,11 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3571
3583
|
value: p.number
|
|
3572
3584
|
});
|
|
3573
3585
|
}),
|
|
3574
|
-
children: [
|
|
3586
|
+
children: [u("div", {
|
|
3575
3587
|
class: "flex items-center gap-2",
|
|
3576
|
-
children: [
|
|
3588
|
+
children: [u("div", {
|
|
3577
3589
|
class: "relative min-w-0 flex-grow",
|
|
3578
|
-
children: [
|
|
3590
|
+
children: [u("input", {
|
|
3579
3591
|
...f,
|
|
3580
3592
|
id: "chat-input",
|
|
3581
3593
|
autocomplete: "off",
|
|
@@ -3583,7 +3595,7 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3583
3595
|
autoCorrect: "off",
|
|
3584
3596
|
autoFocus: !0,
|
|
3585
3597
|
ref: (p) => {
|
|
3586
|
-
p && (v.current = p),
|
|
3598
|
+
p && (v.current = p), c(p);
|
|
3587
3599
|
},
|
|
3588
3600
|
type: "text",
|
|
3589
3601
|
min: e.config.min,
|
|
@@ -3593,31 +3605,31 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3593
3605
|
className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
|
|
3594
3606
|
}),
|
|
3595
3607
|
placeholder: e.config.placeholder
|
|
3596
|
-
}), e.config.optional &&
|
|
3608
|
+
}), e.config.optional && u(Se, {
|
|
3597
3609
|
class: "absolute bottom-0 right-0.5 top-0",
|
|
3598
3610
|
onClick: () => r(null)
|
|
3599
3611
|
})]
|
|
3600
|
-
}),
|
|
3601
|
-
}),
|
|
3612
|
+
}), u(Be, {})]
|
|
3613
|
+
}), u(tt, {
|
|
3602
3614
|
error: o.number
|
|
3603
3615
|
})]
|
|
3604
3616
|
});
|
|
3605
|
-
}, ai = "44", ii = /^[0-9 ]+$/, oi = et("string"), li = et("phone"),
|
|
3606
|
-
const r = /* @__PURE__ */
|
|
3607
|
-
return St(/* @__PURE__ */
|
|
3617
|
+
}, ai = "44", ii = /^[0-9 ]+$/, oi = et("string"), li = et("phone"), ui = (e) => {
|
|
3618
|
+
const r = /* @__PURE__ */ Me(/* @__PURE__ */ le(e("validation_country_code")), /* @__PURE__ */ Ht(ii, e("validation_country_code"))), t = /* @__PURE__ */ Me(/* @__PURE__ */ le(e("validation_phone")), /* @__PURE__ */ Ze(1, e("validation_phone")), /* @__PURE__ */ Kt((n) => n.replace(/[^0-9]/g, "")));
|
|
3619
|
+
return St(/* @__PURE__ */ Ce({
|
|
3608
3620
|
countryCode: r,
|
|
3609
3621
|
phoneNumber: t
|
|
3610
3622
|
}));
|
|
3611
|
-
},
|
|
3623
|
+
}, ci = ({
|
|
3612
3624
|
input: e,
|
|
3613
3625
|
onSubmitSuccess: r
|
|
3614
3626
|
}) => {
|
|
3615
3627
|
var _;
|
|
3616
3628
|
const t = e.key ? (_ = q.current$.value.flow) == null ? void 0 : _.data.submissions[e.key] : void 0, {
|
|
3617
3629
|
t: n
|
|
3618
|
-
} = ne(), [s, i] =
|
|
3630
|
+
} = ne(), [s, i] = ke(), a = oi(t) ? ua(t.value) : li(t) ? t.value : void 0, {
|
|
3619
3631
|
register: o,
|
|
3620
|
-
handleSubmit:
|
|
3632
|
+
handleSubmit: c,
|
|
3621
3633
|
formState: {
|
|
3622
3634
|
errors: f
|
|
3623
3635
|
},
|
|
@@ -3627,19 +3639,19 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3627
3639
|
countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ?? ai,
|
|
3628
3640
|
phoneNumber: (a == null ? void 0 : a.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
|
|
3629
3641
|
},
|
|
3630
|
-
resolver:
|
|
3642
|
+
resolver: ui(n)
|
|
3631
3643
|
}), {
|
|
3632
3644
|
ref: b,
|
|
3633
3645
|
...p
|
|
3634
3646
|
} = o("phoneNumber", {
|
|
3635
3647
|
required: !e.config.optional
|
|
3636
3648
|
}), y = ye(), C = v("countryCode");
|
|
3637
|
-
return
|
|
3649
|
+
return Le(() => {
|
|
3638
3650
|
y.current && (y.current.focus(), y.current.select());
|
|
3639
|
-
}, []),
|
|
3651
|
+
}, []), u("form", {
|
|
3640
3652
|
noValidate: !0,
|
|
3641
3653
|
class: "flex flex-col gap-1 p-2.5",
|
|
3642
|
-
onSubmit:
|
|
3654
|
+
onSubmit: c((k) => {
|
|
3643
3655
|
const E = k.phoneNumber.replace(/[^0-9]/g, ""), g = k.countryCode.replace(/[^0-9]/g, "");
|
|
3644
3656
|
i(void 0);
|
|
3645
3657
|
const N = e.config.minChars ?? 7, V = E.length + g.length;
|
|
@@ -3663,25 +3675,25 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3663
3675
|
value: C + k.phoneNumber
|
|
3664
3676
|
});
|
|
3665
3677
|
}),
|
|
3666
|
-
children: [
|
|
3678
|
+
children: [u("div", {
|
|
3667
3679
|
class: "flex items-center gap-2",
|
|
3668
|
-
children: [
|
|
3680
|
+
children: [u("div", {
|
|
3669
3681
|
class: "relative flex min-w-0 flex-1 flex-grow gap-2",
|
|
3670
|
-
children: [
|
|
3682
|
+
children: [u("label", {
|
|
3671
3683
|
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",
|
|
3672
3684
|
htmlFor: `isdk_phone_${e.key}`,
|
|
3673
|
-
children: [
|
|
3685
|
+
children: [u("span", {
|
|
3674
3686
|
children: ["+", C]
|
|
3675
|
-
}),
|
|
3687
|
+
}), u("select", {
|
|
3676
3688
|
...o("countryCode", {}),
|
|
3677
3689
|
id: `isdk_phone_${e.key}`,
|
|
3678
3690
|
class: "absolute inset-0 opacity-0",
|
|
3679
|
-
children: Object.entries(Gt).map(([k, E]) =>
|
|
3691
|
+
children: Object.entries(Gt).map(([k, E]) => u("option", {
|
|
3680
3692
|
value: E,
|
|
3681
3693
|
children: [k, " (+", E, ")"]
|
|
3682
3694
|
}, k))
|
|
3683
3695
|
})]
|
|
3684
|
-
}),
|
|
3696
|
+
}), u("input", {
|
|
3685
3697
|
...p,
|
|
3686
3698
|
id: "chat-input",
|
|
3687
3699
|
type: "tel",
|
|
@@ -3698,12 +3710,12 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3698
3710
|
className: "min-w-0 flex-1 rounded-r-full"
|
|
3699
3711
|
}),
|
|
3700
3712
|
placeholder: e.config.placeholder
|
|
3701
|
-
}), e.config.optional &&
|
|
3713
|
+
}), e.config.optional && u(Se, {
|
|
3702
3714
|
class: "absolute bottom-0 right-1 top-0",
|
|
3703
3715
|
onClick: () => r(null)
|
|
3704
3716
|
})]
|
|
3705
|
-
}),
|
|
3706
|
-
}),
|
|
3717
|
+
}), u(Be, {})]
|
|
3718
|
+
}), u(tt, {
|
|
3707
3719
|
error: f.countryCode || f.phoneNumber || {
|
|
3708
3720
|
message: s
|
|
3709
3721
|
}
|
|
@@ -3713,7 +3725,10 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3713
3725
|
time: qr(t, r)
|
|
3714
3726
|
}) : e("submission_cooldown", {
|
|
3715
3727
|
count: n
|
|
3716
|
-
}), di = ({
|
|
3728
|
+
}), di = (e, r) => {
|
|
3729
|
+
const t = e == null ? void 0 : e.trim();
|
|
3730
|
+
return t && t !== "Submit" ? t : r("submit");
|
|
3731
|
+
}, fi = ({
|
|
3717
3732
|
input: e,
|
|
3718
3733
|
onSubmitSuccess: r
|
|
3719
3734
|
}) => {
|
|
@@ -3722,22 +3737,22 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3722
3737
|
locale: n
|
|
3723
3738
|
} = ne(), {
|
|
3724
3739
|
availableAt: s
|
|
3725
|
-
} = e.config, [i, a] =
|
|
3740
|
+
} = e.config, [i, a] = ke(() => yt(s)), [o, c] = ke("");
|
|
3726
3741
|
Wr(() => {
|
|
3727
3742
|
const v = yt(s);
|
|
3728
3743
|
if (a(v), v === 0)
|
|
3729
3744
|
return;
|
|
3730
|
-
|
|
3745
|
+
c(Tr(t, n, s, v));
|
|
3731
3746
|
const b = setInterval(() => {
|
|
3732
3747
|
const p = yt(s);
|
|
3733
|
-
a(p), !(p > 0) && (clearInterval(b),
|
|
3748
|
+
a(p), !(p > 0) && (clearInterval(b), c(t("submission_cooldown_ready")));
|
|
3734
3749
|
}, 250);
|
|
3735
3750
|
return () => clearInterval(b);
|
|
3736
3751
|
}, [s, n, t]);
|
|
3737
3752
|
const f = i > 0;
|
|
3738
|
-
return
|
|
3753
|
+
return u("div", {
|
|
3739
3754
|
class: "flex flex-col items-center gap-2 py-3",
|
|
3740
|
-
children: [
|
|
3755
|
+
children: [u("button", {
|
|
3741
3756
|
class: "bg-accent-9 hover:bg-accent-10 active:bg-submit-bg-active hover:border-accent-10 active:border-submit-bg-active border-accent-9 ring-accent-6 focus-visible:outline-accent-8 ring-offset-neutral-1 aria-disabled:hover:bg-accent-9 aria-disabled:hover:border-accent-9 flex cursor-pointer rounded-full border border-solid px-5 py-3 pr-4 text-white outline-none ring-1 ring-offset-[1.5px] transition-all duration-300 focus-visible:outline-2 active:ring-2 active:ring-offset-2 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:active:ring-1 aria-disabled:active:ring-offset-[1.5px]",
|
|
3742
3757
|
name: e.key,
|
|
3743
3758
|
"aria-disabled": f,
|
|
@@ -3745,12 +3760,12 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3745
3760
|
onClick: () => {
|
|
3746
3761
|
yt(s) > 0 || r(null);
|
|
3747
3762
|
},
|
|
3748
|
-
children:
|
|
3763
|
+
children: u("span", {
|
|
3749
3764
|
class: "flex items-center gap-1.5",
|
|
3750
|
-
children: [
|
|
3765
|
+
children: [u("span", {
|
|
3751
3766
|
class: "inline-flex items-center text-sm font-medium",
|
|
3752
|
-
children: e.config.label
|
|
3753
|
-
}),
|
|
3767
|
+
children: di(e.config.label, t)
|
|
3768
|
+
}), u("svg", {
|
|
3754
3769
|
stroke: "currentColor",
|
|
3755
3770
|
"stroke-width": "1.5",
|
|
3756
3771
|
width: "16",
|
|
@@ -3758,27 +3773,27 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3758
3773
|
viewBox: "0 0 16 16",
|
|
3759
3774
|
fill: "none",
|
|
3760
3775
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3761
|
-
children: [
|
|
3776
|
+
children: [u("path", {
|
|
3762
3777
|
d: "M4 8L8 4L12 8"
|
|
3763
|
-
}),
|
|
3778
|
+
}), u("path", {
|
|
3764
3779
|
d: "M8 4V13"
|
|
3765
3780
|
})]
|
|
3766
3781
|
})]
|
|
3767
3782
|
})
|
|
3768
|
-
}), f &&
|
|
3783
|
+
}), f && u("p", {
|
|
3769
3784
|
id: "submit-cooldown",
|
|
3770
3785
|
"aria-hidden": "true",
|
|
3771
3786
|
class: "text-neutral-11 text-xs",
|
|
3772
3787
|
children: Tr(t, n, s, i)
|
|
3773
|
-
}),
|
|
3788
|
+
}), u("p", {
|
|
3774
3789
|
role: "status",
|
|
3775
3790
|
class: "sr-only",
|
|
3776
3791
|
children: o
|
|
3777
3792
|
})]
|
|
3778
3793
|
});
|
|
3779
|
-
},
|
|
3780
|
-
e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight,
|
|
3781
|
-
},
|
|
3794
|
+
}, hi = 160, Dr = (e) => {
|
|
3795
|
+
e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, hi)}px`;
|
|
3796
|
+
}, pi = {
|
|
3782
3797
|
date: {
|
|
3783
3798
|
type: "date",
|
|
3784
3799
|
inputMode: "text"
|
|
@@ -3797,7 +3812,7 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3797
3812
|
inputMode: "url",
|
|
3798
3813
|
formNoValidate: !0
|
|
3799
3814
|
}
|
|
3800
|
-
},
|
|
3815
|
+
}, mi = et("string"), yi = (e, r) => {
|
|
3801
3816
|
const t = {
|
|
3802
3817
|
maxLength: r("validation_max_chars", {
|
|
3803
3818
|
count: e.maxChars ?? 999
|
|
@@ -3806,15 +3821,15 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3806
3821
|
count: e.minChars ?? 1
|
|
3807
3822
|
})
|
|
3808
3823
|
};
|
|
3809
|
-
return St(/* @__PURE__ */
|
|
3824
|
+
return St(/* @__PURE__ */ Ce({
|
|
3810
3825
|
text: {
|
|
3811
|
-
date: /* @__PURE__ */
|
|
3812
|
-
email: /* @__PURE__ */
|
|
3813
|
-
text: /* @__PURE__ */
|
|
3814
|
-
url: /* @__PURE__ */
|
|
3826
|
+
date: /* @__PURE__ */ Me(/* @__PURE__ */ le(r("validation_date")), /* @__PURE__ */ Ht(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
|
|
3827
|
+
email: /* @__PURE__ */ Me(/* @__PURE__ */ le(r("validation_email")), /* @__PURE__ */ Yr(r("validation_email")), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ut(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3828
|
+
text: /* @__PURE__ */ Me(/* @__PURE__ */ le(), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ut(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3829
|
+
url: /* @__PURE__ */ Me(/* @__PURE__ */ le(r("validation_url")), /* @__PURE__ */ tn(r("validation_url")), /* @__PURE__ */ Ze(e.minChars ?? 1, t.minLength), /* @__PURE__ */ ut(e.maxChars ?? 1 / 0, t.maxLength))
|
|
3815
3830
|
}[e.format]
|
|
3816
3831
|
}));
|
|
3817
|
-
},
|
|
3832
|
+
}, bi = ({
|
|
3818
3833
|
input: e,
|
|
3819
3834
|
onSubmitSuccess: r
|
|
3820
3835
|
}) => {
|
|
@@ -3824,26 +3839,26 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3824
3839
|
} = 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", {
|
|
3825
3840
|
register: a,
|
|
3826
3841
|
handleSubmit: o,
|
|
3827
|
-
watch:
|
|
3842
|
+
watch: c,
|
|
3828
3843
|
formState: {
|
|
3829
3844
|
errors: f
|
|
3830
3845
|
}
|
|
3831
3846
|
} = Ct({
|
|
3832
3847
|
defaultValues: {
|
|
3833
|
-
text:
|
|
3848
|
+
text: mi(n) ? n.value : s ?? ""
|
|
3834
3849
|
},
|
|
3835
|
-
resolver:
|
|
3850
|
+
resolver: yi(e.config, t)
|
|
3836
3851
|
}), {
|
|
3837
3852
|
ref: v,
|
|
3838
3853
|
...b
|
|
3839
3854
|
} = a("text", {
|
|
3840
3855
|
required: !e.config.optional
|
|
3841
3856
|
}), p = ye();
|
|
3842
|
-
|
|
3857
|
+
Le(() => {
|
|
3843
3858
|
p.current && (p.current instanceof HTMLTextAreaElement && Dr(p.current), p.current.focus(), p.current.select());
|
|
3844
3859
|
}, []);
|
|
3845
|
-
const y = e.config.maxChars, C = i && y !== void 0 ?
|
|
3846
|
-
return
|
|
3860
|
+
const y = e.config.maxChars, C = i && y !== void 0 ? c("text").length : void 0;
|
|
3861
|
+
return u("form", {
|
|
3847
3862
|
noValidate: !0,
|
|
3848
3863
|
class: "flex flex-col gap-1 p-2.5",
|
|
3849
3864
|
onSubmit: o((k) => {
|
|
@@ -3852,11 +3867,11 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3852
3867
|
value: k.text
|
|
3853
3868
|
});
|
|
3854
3869
|
}),
|
|
3855
|
-
children: [
|
|
3870
|
+
children: [u("div", {
|
|
3856
3871
|
class: i ? "flex items-end gap-2" : "flex items-center gap-2",
|
|
3857
|
-
children: [
|
|
3872
|
+
children: [u("div", {
|
|
3858
3873
|
class: "relative min-w-0 flex-1",
|
|
3859
|
-
children: [i ?
|
|
3874
|
+
children: [i ? u("textarea", {
|
|
3860
3875
|
id: "chat-input",
|
|
3861
3876
|
...b,
|
|
3862
3877
|
rows: 2,
|
|
@@ -3876,10 +3891,10 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3876
3891
|
optional: !!e.config.optional,
|
|
3877
3892
|
className: "block w-full resize-none overflow-y-auto rounded-2xl"
|
|
3878
3893
|
})
|
|
3879
|
-
}) :
|
|
3894
|
+
}) : u("input", {
|
|
3880
3895
|
id: "chat-input",
|
|
3881
3896
|
...b,
|
|
3882
|
-
...
|
|
3897
|
+
...pi[e.config.format],
|
|
3883
3898
|
autocomplete: "off",
|
|
3884
3899
|
autoCapitalize: "off",
|
|
3885
3900
|
autoCorrect: "off",
|
|
@@ -3892,60 +3907,60 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3892
3907
|
optional: !!e.config.optional,
|
|
3893
3908
|
className: "w-full rounded-full"
|
|
3894
3909
|
})
|
|
3895
|
-
}), e.config.optional &&
|
|
3896
|
-
|
|
3910
|
+
}), e.config.optional && u(
|
|
3911
|
+
Se,
|
|
3897
3912
|
{
|
|
3898
3913
|
class: i ? "absolute bottom-1 right-0.5" : "absolute bottom-0 right-0.5 top-0",
|
|
3899
3914
|
onClick: () => r(null)
|
|
3900
3915
|
}
|
|
3901
3916
|
)]
|
|
3902
|
-
}),
|
|
3903
|
-
}), C !== void 0 && y !== void 0 &&
|
|
3917
|
+
}), u(Be, {})]
|
|
3918
|
+
}), C !== void 0 && y !== void 0 && u("p", {
|
|
3904
3919
|
id: "chat-input-count",
|
|
3905
3920
|
class: "text-neutral-10 px-3 text-right text-xs",
|
|
3906
3921
|
children: [C, "/", y]
|
|
3907
|
-
}),
|
|
3922
|
+
}), u(tt, {
|
|
3908
3923
|
error: f.text
|
|
3909
3924
|
})]
|
|
3910
3925
|
});
|
|
3911
|
-
},
|
|
3912
|
-
text:
|
|
3913
|
-
phone:
|
|
3926
|
+
}, gi = {
|
|
3927
|
+
text: bi,
|
|
3928
|
+
phone: ci,
|
|
3914
3929
|
"multiple-choice": ti,
|
|
3915
3930
|
boolean: va,
|
|
3916
3931
|
file: Sa,
|
|
3917
|
-
submit:
|
|
3932
|
+
submit: fi,
|
|
3918
3933
|
address: ma,
|
|
3919
3934
|
number: si
|
|
3920
|
-
},
|
|
3935
|
+
}, vi = ({
|
|
3921
3936
|
logger: e,
|
|
3922
3937
|
analytics: r
|
|
3923
3938
|
}) => {
|
|
3924
3939
|
var i;
|
|
3925
|
-
const t = (i = q.current$.value.flow) == null ? void 0 : i.data.currentInput, n = ye(null), s = () =>
|
|
3926
|
-
return
|
|
3940
|
+
const t = (i = q.current$.value.flow) == null ? void 0 : i.data.currentInput, n = ye(null), s = () => ue.onInteractionFn$.value();
|
|
3941
|
+
return Le(() => {
|
|
3927
3942
|
var a;
|
|
3928
3943
|
(a = n.current) == null || a.scrollTo({
|
|
3929
3944
|
top: 0
|
|
3930
3945
|
});
|
|
3931
|
-
}, [t]),
|
|
3946
|
+
}, [t]), u("div", {
|
|
3932
3947
|
ref: n,
|
|
3933
3948
|
class: "border-divider max-h-[calc(100%-var(--header-height)-4rem)] w-full shrink-0 scroll-pb-12 overflow-y-auto overscroll-contain border-t",
|
|
3934
|
-
children:
|
|
3949
|
+
children: u("div", {
|
|
3935
3950
|
class: "flex flex-col",
|
|
3936
3951
|
onPointerDownCapture: t ? s : void 0,
|
|
3937
3952
|
onKeyDownCapture: t ? s : void 0,
|
|
3938
3953
|
children: t ? (() => {
|
|
3939
|
-
const a =
|
|
3940
|
-
return
|
|
3954
|
+
const a = gi[t.type];
|
|
3955
|
+
return u(a, {
|
|
3941
3956
|
logger: e,
|
|
3942
3957
|
analytics: r,
|
|
3943
|
-
onSubmitSuccess:
|
|
3958
|
+
onSubmitSuccess: ue.onSubmitSuccessFn$.value,
|
|
3944
3959
|
input: t
|
|
3945
3960
|
});
|
|
3946
|
-
})() :
|
|
3961
|
+
})() : u("div", {
|
|
3947
3962
|
class: "flex items-center gap-2 p-2.5",
|
|
3948
|
-
children: [
|
|
3963
|
+
children: [u("input", {
|
|
3949
3964
|
"aria-hidden": "true",
|
|
3950
3965
|
id: "chat-input",
|
|
3951
3966
|
class: Ye({
|
|
@@ -3953,7 +3968,7 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3953
3968
|
className: "flex-grow rounded-full"
|
|
3954
3969
|
}),
|
|
3955
3970
|
disabled: !0
|
|
3956
|
-
}),
|
|
3971
|
+
}), u(Be, {
|
|
3957
3972
|
disabled: !0,
|
|
3958
3973
|
"aria-hidden": "true",
|
|
3959
3974
|
tabIndex: -1
|
|
@@ -3962,31 +3977,31 @@ const Mr = 27, Lr = 12, Nr = 10, Ya = et("enum"), Qa = (e, r) => {
|
|
|
3962
3977
|
})
|
|
3963
3978
|
});
|
|
3964
3979
|
};
|
|
3965
|
-
function
|
|
3980
|
+
function xi(e) {
|
|
3966
3981
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
3967
3982
|
}
|
|
3968
|
-
var
|
|
3983
|
+
var wi = function(e) {
|
|
3969
3984
|
return e instanceof RegExp;
|
|
3970
|
-
},
|
|
3985
|
+
}, _i = function(r) {
|
|
3971
3986
|
var t = /[\\^$.*+?()[\]{}|]/g, n = RegExp(t.source);
|
|
3972
3987
|
return r && n.test(r) ? r.replace(t, "\\$&") : r;
|
|
3973
3988
|
}, wn = function(e) {
|
|
3974
3989
|
return typeof e == "string";
|
|
3975
|
-
},
|
|
3990
|
+
}, ki = function(e) {
|
|
3976
3991
|
var r = [];
|
|
3977
3992
|
return e.forEach(function(t) {
|
|
3978
3993
|
Array.isArray(t) ? r = r.concat(t) : r.push(t);
|
|
3979
3994
|
}), r;
|
|
3980
3995
|
};
|
|
3981
|
-
function
|
|
3996
|
+
function Ci(e, r, t) {
|
|
3982
3997
|
var n = 0, s = 0;
|
|
3983
3998
|
if (e === "")
|
|
3984
3999
|
return e;
|
|
3985
4000
|
if (!e || !wn(e))
|
|
3986
4001
|
throw new TypeError("First argument to react-string-replace#replaceString must be a string");
|
|
3987
4002
|
var i = r;
|
|
3988
|
-
|
|
3989
|
-
for (var a = e.split(i), o = 1,
|
|
4003
|
+
wi(i) || (i = new RegExp("(" + _i(i) + ")", "gi"));
|
|
4004
|
+
for (var a = e.split(i), o = 1, c = a.length; o < c; o += 2) {
|
|
3990
4005
|
if (a[o] === void 0 || a[o - 1] === void 0) {
|
|
3991
4006
|
console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
|
|
3992
4007
|
continue;
|
|
@@ -3995,33 +4010,33 @@ function ki(e, r, t) {
|
|
|
3995
4010
|
}
|
|
3996
4011
|
return a;
|
|
3997
4012
|
}
|
|
3998
|
-
var
|
|
3999
|
-
return Array.isArray(r) || (r = [r]),
|
|
4000
|
-
return wn(s) ?
|
|
4013
|
+
var Si = function(r, t, n) {
|
|
4014
|
+
return Array.isArray(r) || (r = [r]), ki(r.map(function(s) {
|
|
4015
|
+
return wn(s) ? Ci(s, t, n) : s;
|
|
4001
4016
|
}));
|
|
4002
4017
|
};
|
|
4003
|
-
const ot = /* @__PURE__ */
|
|
4004
|
-
const r = ot(e,
|
|
4005
|
-
const [, f, v] = o.match(
|
|
4006
|
-
return v ?
|
|
4018
|
+
const ot = /* @__PURE__ */ xi(Si), Ei = /(\[[^\]]+\]\([^)]+\))/g, Ai = /\[([^\]]+)\]\(([^)]+)\)/, Ii = /(https?:\/\/[^\s]+)/g, Fi = /_(.*?)_/g, Vi = /\*\*(.*?)\*\*/g, Mi = /(\\n|\n)/g, Or = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Li = (e) => {
|
|
4019
|
+
const r = ot(e, Ei, (o, c) => {
|
|
4020
|
+
const [, f, v] = o.match(Ai) ?? [];
|
|
4021
|
+
return v ? u("a", {
|
|
4007
4022
|
class: Or,
|
|
4008
4023
|
href: v,
|
|
4009
4024
|
children: f ?? v
|
|
4010
|
-
}, v +
|
|
4025
|
+
}, v + c) : u("span", {
|
|
4011
4026
|
children: "INVALID LINK"
|
|
4012
4027
|
});
|
|
4013
|
-
}), t = ot(r,
|
|
4028
|
+
}), t = ot(r, Ii, (o, c) => u("a", {
|
|
4014
4029
|
class: Or,
|
|
4015
4030
|
href: o,
|
|
4016
4031
|
children: o
|
|
4017
|
-
}, o +
|
|
4032
|
+
}, o + c)), n = ot(t, Fi, (o, c) => u("em", {
|
|
4018
4033
|
children: o
|
|
4019
|
-
}, o +
|
|
4034
|
+
}, o + c)), s = ot(n, Vi, (o, c) => u("strong", {
|
|
4020
4035
|
children: o
|
|
4021
|
-
}, o +
|
|
4036
|
+
}, o + c));
|
|
4022
4037
|
let i = 0;
|
|
4023
|
-
return ot(s,
|
|
4024
|
-
},
|
|
4038
|
+
return ot(s, Mi, () => u("br", {}, `br-${i++}`));
|
|
4039
|
+
}, Ni = xt("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative", {
|
|
4025
4040
|
variants: {
|
|
4026
4041
|
side: {
|
|
4027
4042
|
left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
|
|
@@ -4035,40 +4050,40 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4035
4050
|
defaultVariants: {
|
|
4036
4051
|
side: "left"
|
|
4037
4052
|
}
|
|
4038
|
-
}),
|
|
4053
|
+
}), Ri = ({
|
|
4039
4054
|
children: e,
|
|
4040
4055
|
className: r,
|
|
4041
4056
|
animate: t,
|
|
4042
4057
|
side: n,
|
|
4043
4058
|
...s
|
|
4044
|
-
}) =>
|
|
4059
|
+
}) => u("p", {
|
|
4045
4060
|
style: {
|
|
4046
4061
|
transformOrigin: n === "left" ? "0% 50%" : "100% 50%"
|
|
4047
4062
|
},
|
|
4048
|
-
class:
|
|
4063
|
+
class: Ni({
|
|
4049
4064
|
className: r,
|
|
4050
4065
|
side: n,
|
|
4051
4066
|
animate: t
|
|
4052
4067
|
}),
|
|
4053
4068
|
...s,
|
|
4054
4069
|
children: e
|
|
4055
|
-
}),
|
|
4070
|
+
}), Ti = ({
|
|
4056
4071
|
message: e
|
|
4057
|
-
}) =>
|
|
4072
|
+
}) => u("div", {
|
|
4058
4073
|
class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
|
|
4059
|
-
children:
|
|
4074
|
+
children: u("a", {
|
|
4060
4075
|
onClick: e.onClick,
|
|
4061
4076
|
class: "bg-lowest shadow-surface-sm ring-accent-6 hover:ring-accent-8 active:bg-accent-2 active:text-accent-10 text-accent-9 focus-visible:ring-accent-7/50 text-wrap-balance flex items-center gap-1.5 rounded-full py-2 pl-4 pr-2.5 text-center no-underline ring-1 transition-all focus:outline-none focus-visible:ring-4 focus-visible:ring-offset-2",
|
|
4062
4077
|
target: "_blank",
|
|
4063
4078
|
href: e.href,
|
|
4064
|
-
children: [e.text,
|
|
4079
|
+
children: [e.text, u("svg", {
|
|
4065
4080
|
class: "flex-none",
|
|
4066
4081
|
width: "15",
|
|
4067
4082
|
height: "15",
|
|
4068
4083
|
viewBox: "0 0 15 15",
|
|
4069
4084
|
fill: "none",
|
|
4070
4085
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4071
|
-
children:
|
|
4086
|
+
children: u("path", {
|
|
4072
4087
|
d: "M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L10.2929 4L6 4C5.72386 4 5.5 3.77614 5.5 3.5C5.5 3.22386 5.72386 3 6 3L11.5 3C11.6326 3 11.7598 3.05268 11.8536 3.14645C11.9473 3.24022 12 3.36739 12 3.5L12 9.00001C12 9.27615 11.7761 9.50001 11.5 9.50001C11.2239 9.50001 11 9.27615 11 9.00001V4.70711L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z",
|
|
4073
4088
|
fill: "currentColor",
|
|
4074
4089
|
"fill-rule": "evenodd",
|
|
@@ -4076,28 +4091,28 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4076
4091
|
})
|
|
4077
4092
|
})]
|
|
4078
4093
|
})
|
|
4079
|
-
}),
|
|
4094
|
+
}), Di = ({
|
|
4080
4095
|
className: e,
|
|
4081
4096
|
...r
|
|
4082
|
-
}) =>
|
|
4097
|
+
}) => u("div", {
|
|
4083
4098
|
"aria-hidden": !0,
|
|
4084
|
-
children:
|
|
4099
|
+
children: ue.isBotTyping$.value === !0 ? u("div", {
|
|
4085
4100
|
"data-testid": "typing-indicator",
|
|
4086
4101
|
class: Qe("flex gap-1 p-4", e),
|
|
4087
4102
|
...r,
|
|
4088
4103
|
children: Array.from({
|
|
4089
4104
|
length: 3
|
|
4090
|
-
}, (t, n) =>
|
|
4105
|
+
}, (t, n) => u("div", {
|
|
4091
4106
|
class: "bg-accent-9 h-1.5 w-1.5 animate-bounce rounded-full",
|
|
4092
4107
|
style: {
|
|
4093
4108
|
animationDelay: `${-n * 200}ms`
|
|
4094
4109
|
}
|
|
4095
4110
|
}))
|
|
4096
4111
|
}) : void 0
|
|
4097
|
-
}),
|
|
4112
|
+
}), Oi = {
|
|
4098
4113
|
bot: "left",
|
|
4099
4114
|
user: "right"
|
|
4100
|
-
},
|
|
4115
|
+
}, Bi = 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)]", {
|
|
4101
4116
|
variants: {
|
|
4102
4117
|
variant: {
|
|
4103
4118
|
info: "text-neutral-11",
|
|
@@ -4106,24 +4121,24 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4106
4121
|
success: "text-system-success"
|
|
4107
4122
|
}
|
|
4108
4123
|
}
|
|
4109
|
-
}),
|
|
4124
|
+
}), $i = ({
|
|
4110
4125
|
lastSentMessageFooter: e
|
|
4111
4126
|
}) => {
|
|
4112
4127
|
const {
|
|
4113
4128
|
t: r
|
|
4114
4129
|
} = ne(), t = q.current$.value.flow, n = (t == null ? void 0 : t.data.messages) ?? [], s = t ? zt(t) : void 0;
|
|
4115
|
-
return
|
|
4130
|
+
return u("ol", {
|
|
4116
4131
|
"aria-label": r("chat_messages"),
|
|
4117
4132
|
"aria-live": "polite",
|
|
4118
4133
|
class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
|
|
4119
|
-
children: [n.map((i, a) =>
|
|
4120
|
-
children:
|
|
4134
|
+
children: [n.map((i, a) => u(be, {
|
|
4135
|
+
children: u("li", {
|
|
4121
4136
|
class: "flex",
|
|
4122
4137
|
tabIndex: a === n.length - 1 ? -1 : void 0,
|
|
4123
4138
|
children: [s && i.groupId === s && !n.slice(a + 1).some((o) => o.groupId === s) ? e : null, Hn(i).with({
|
|
4124
4139
|
type: "system"
|
|
4125
|
-
}, (o) =>
|
|
4126
|
-
class:
|
|
4140
|
+
}, (o) => u("p", {
|
|
4141
|
+
class: Bi({
|
|
4127
4142
|
variant: o.variant
|
|
4128
4143
|
}),
|
|
4129
4144
|
children: o.text
|
|
@@ -4131,21 +4146,21 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4131
4146
|
type: "text",
|
|
4132
4147
|
author: Kn.union("bot", "user")
|
|
4133
4148
|
}, (o) => {
|
|
4134
|
-
const
|
|
4135
|
-
return
|
|
4136
|
-
children:
|
|
4137
|
-
animate:
|
|
4138
|
-
side:
|
|
4149
|
+
const c = a === n.length - 1, f = o.author === "bot" ? Li(o.text) : o.text;
|
|
4150
|
+
return u(be, {
|
|
4151
|
+
children: u(Ri, {
|
|
4152
|
+
animate: c,
|
|
4153
|
+
side: Oi[o.author],
|
|
4139
4154
|
children: f
|
|
4140
4155
|
}, a)
|
|
4141
4156
|
});
|
|
4142
4157
|
}).with({
|
|
4143
4158
|
type: "link"
|
|
4144
|
-
}, (o) =>
|
|
4159
|
+
}, (o) => u(Ti, {
|
|
4145
4160
|
message: o
|
|
4146
4161
|
})).with({
|
|
4147
4162
|
type: "image"
|
|
4148
|
-
}, (o) =>
|
|
4163
|
+
}, (o) => u("img", {
|
|
4149
4164
|
class: "shadow-surface-md w-full max-w-[min(100%,24rem)] rounded-2xl",
|
|
4150
4165
|
src: o.url,
|
|
4151
4166
|
style: {
|
|
@@ -4153,7 +4168,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4153
4168
|
}
|
|
4154
4169
|
})).with({
|
|
4155
4170
|
type: "file"
|
|
4156
|
-
}, (o) =>
|
|
4171
|
+
}, (o) => u(wa, {
|
|
4157
4172
|
class: o.author === "bot" ? void 0 : "ml-auto",
|
|
4158
4173
|
file: {
|
|
4159
4174
|
name: o.fileName,
|
|
@@ -4162,13 +4177,13 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4162
4177
|
})).with({
|
|
4163
4178
|
type: "loading"
|
|
4164
4179
|
}, (o) => {
|
|
4165
|
-
const
|
|
4166
|
-
return !(o ===
|
|
4180
|
+
const c = n[n.length - 1];
|
|
4181
|
+
return !(o === c) || ue.isBotTyping$.value || t != null && t.data.isFinished ? null : u("div", {
|
|
4167
4182
|
class: "flex flex-grow flex-col items-center justify-center gap-2",
|
|
4168
|
-
children: [
|
|
4183
|
+
children: [u(Ut, {
|
|
4169
4184
|
"aria-hidden": o.text ? "true" : void 0,
|
|
4170
4185
|
class: "text-neutral-6 h-8 w-8"
|
|
4171
|
-
}), o.text ?
|
|
4186
|
+
}), o.text ? u("p", {
|
|
4172
4187
|
role: "status",
|
|
4173
4188
|
class: "text-neutral-11 text-sm",
|
|
4174
4189
|
children: o.text
|
|
@@ -4176,18 +4191,18 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4176
4191
|
});
|
|
4177
4192
|
}).exhaustive()]
|
|
4178
4193
|
})
|
|
4179
|
-
}, a)),
|
|
4180
|
-
class:
|
|
4181
|
-
children:
|
|
4194
|
+
}, a)), u("li", {
|
|
4195
|
+
class: ue.captchaVisible$.value ? "flex" : "hidden",
|
|
4196
|
+
children: u("div", {
|
|
4182
4197
|
"data-captcha-slot": !0,
|
|
4183
4198
|
tabIndex: -1,
|
|
4184
4199
|
role: "group",
|
|
4185
4200
|
"aria-label": r("captcha_check"),
|
|
4186
4201
|
class: "w-full max-w-[min(100%,24rem)] rounded-md"
|
|
4187
4202
|
})
|
|
4188
|
-
}, "captcha"),
|
|
4203
|
+
}, "captcha"), u(Di, {}, "typing")]
|
|
4189
4204
|
});
|
|
4190
|
-
},
|
|
4205
|
+
}, Wi = ({
|
|
4191
4206
|
logger: e,
|
|
4192
4207
|
apiClient: r,
|
|
4193
4208
|
analytics: t,
|
|
@@ -4201,26 +4216,26 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4201
4216
|
chatRef: a,
|
|
4202
4217
|
chatService: o
|
|
4203
4218
|
} = Gn(), {
|
|
4204
|
-
t:
|
|
4205
|
-
} = ne(), [f, v] =
|
|
4206
|
-
return
|
|
4207
|
-
i === "maximised" &&
|
|
4208
|
-
}, [i]),
|
|
4219
|
+
t: c
|
|
4220
|
+
} = ne(), [f, v] = ke();
|
|
4221
|
+
return Le(() => {
|
|
4222
|
+
i === "maximised" && ue.scrollToEnd();
|
|
4223
|
+
}, [i]), Le(() => {
|
|
4209
4224
|
var M;
|
|
4210
4225
|
const {
|
|
4211
4226
|
state: b,
|
|
4212
4227
|
flow: p
|
|
4213
4228
|
} = q.current$.peek();
|
|
4214
4229
|
if (b !== "loaded")
|
|
4215
|
-
throw new Error(
|
|
4230
|
+
throw new Error(c("invalid_state"));
|
|
4216
4231
|
let y = p.data.nodeHistory.at(-1);
|
|
4217
|
-
if (
|
|
4232
|
+
if (ue.scrollToEnd(), q.setInput(void 0), p.data.isFinished)
|
|
4218
4233
|
return;
|
|
4219
4234
|
const C = () => {
|
|
4220
4235
|
const O = q.current$.peek().flow;
|
|
4221
4236
|
!O || O.data.hasInteracted || (q.markAsInteracted(), dr(t, O, "FLOW_INTERACT"));
|
|
4222
4237
|
};
|
|
4223
|
-
|
|
4238
|
+
ue.onInteractionFn$.value = C, y === void 0 ? (y = Gr(s.nodes).id, q.setCurrentNodeId(y), dr(t, p, "FLOW_START")) : q.removeMessagesSentByNodeIds([y, jt]);
|
|
4224
4239
|
const {
|
|
4225
4240
|
interpret: _,
|
|
4226
4241
|
abort: k,
|
|
@@ -4236,7 +4251,7 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4236
4251
|
talentBankClient: n,
|
|
4237
4252
|
flow: s,
|
|
4238
4253
|
chatService: o,
|
|
4239
|
-
t:
|
|
4254
|
+
t: c,
|
|
4240
4255
|
getApplicationRecovery: () => {
|
|
4241
4256
|
var O;
|
|
4242
4257
|
return (O = q.current$.peek().flow) == null ? void 0 : O.data.applicationRecovery;
|
|
@@ -4270,59 +4285,59 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4270
4285
|
}, V = new AbortController();
|
|
4271
4286
|
return p.offerResume ? Js({
|
|
4272
4287
|
chatService: o,
|
|
4273
|
-
t:
|
|
4288
|
+
t: c,
|
|
4274
4289
|
signal: V.signal
|
|
4275
4290
|
}).then((O) => (q.settleResume(p), O ? N() : (q.restart(), Jn.flushStateData()))).catch((O) => {
|
|
4276
4291
|
O instanceof jr || e.error("Resume prompt failed", O);
|
|
4277
4292
|
}) : N(), () => {
|
|
4278
|
-
V.abort(),
|
|
4293
|
+
V.abort(), ue.onInteractionFn$.value === C && (ue.onInteractionFn$.value = () => {
|
|
4279
4294
|
}), k();
|
|
4280
4295
|
};
|
|
4281
|
-
}, [t, r, o, e, s, n,
|
|
4282
|
-
children: [
|
|
4296
|
+
}, [t, r, o, e, s, n, c]), u(be, {
|
|
4297
|
+
children: [u("div", {
|
|
4283
4298
|
class: "relative flex min-h-0 w-full max-w-full flex-grow flex-col",
|
|
4284
|
-
children: [
|
|
4299
|
+
children: [u("div", {
|
|
4285
4300
|
ref: a,
|
|
4286
4301
|
role: "region",
|
|
4287
|
-
"aria-label":
|
|
4302
|
+
"aria-label": c("conversation_history"),
|
|
4288
4303
|
tabIndex: 0,
|
|
4289
4304
|
className: "hide-scrollbars fr flex min-h-0 w-full max-w-full flex-grow flex-col overflow-y-auto ring-inset",
|
|
4290
4305
|
style: {
|
|
4291
4306
|
WebkitOverflowScrolling: "touch"
|
|
4292
4307
|
},
|
|
4293
|
-
children:
|
|
4294
|
-
lastSentMessageFooter: !zt(s) || !f ? null :
|
|
4308
|
+
children: u($i, {
|
|
4309
|
+
lastSentMessageFooter: !zt(s) || !f ? null : u(ji, {
|
|
4295
4310
|
undoFn: f
|
|
4296
4311
|
})
|
|
4297
4312
|
})
|
|
4298
|
-
}),
|
|
4313
|
+
}), ue.isReadingHistory$.value && !s.data.isFinished && !ue.isBotTyping$.value && u("div", {
|
|
4299
4314
|
class: "absolute bottom-2 left-1/2 -translate-x-1/2",
|
|
4300
|
-
children:
|
|
4315
|
+
children: u(Hr, {
|
|
4301
4316
|
class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
|
|
4302
|
-
"aria-label":
|
|
4317
|
+
"aria-label": c("jump_to_current"),
|
|
4303
4318
|
onClick: () => {
|
|
4304
4319
|
var p, y;
|
|
4305
|
-
|
|
4320
|
+
ue.scrollToEnd(), (y = ((p = a.current) == null ? void 0 : p.querySelector('li[tabindex="-1"]')) ?? a.current) == null || y.focus({
|
|
4306
4321
|
preventScroll: !0
|
|
4307
4322
|
});
|
|
4308
4323
|
},
|
|
4309
|
-
children:
|
|
4324
|
+
children: u(Zn, {})
|
|
4310
4325
|
})
|
|
4311
4326
|
})]
|
|
4312
|
-
}),
|
|
4327
|
+
}), u(vi, {
|
|
4313
4328
|
logger: e,
|
|
4314
4329
|
analytics: t
|
|
4315
4330
|
})]
|
|
4316
4331
|
});
|
|
4317
|
-
},
|
|
4332
|
+
}, ji = ({
|
|
4318
4333
|
undoFn: e
|
|
4319
4334
|
}) => {
|
|
4320
4335
|
const {
|
|
4321
4336
|
t: r
|
|
4322
4337
|
} = ne();
|
|
4323
|
-
return
|
|
4338
|
+
return u("div", {
|
|
4324
4339
|
class: "flex flex-1 items-center justify-end px-1",
|
|
4325
|
-
children:
|
|
4340
|
+
children: u(Hr, {
|
|
4326
4341
|
"aria-label": r("undo"),
|
|
4327
4342
|
onClick: async () => {
|
|
4328
4343
|
const {
|
|
@@ -4330,12 +4345,12 @@ const ot = /* @__PURE__ */ vi(Ci), Si = /(\[[^\]]+\]\([^)]+\))/g, Ei = /\[([^\]]
|
|
|
4330
4345
|
} = q.current$.peek();
|
|
4331
4346
|
Oe(t), e(t.data.nodeHistory);
|
|
4332
4347
|
},
|
|
4333
|
-
children:
|
|
4348
|
+
children: u("path", {
|
|
4334
4349
|
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"
|
|
4335
4350
|
})
|
|
4336
4351
|
})
|
|
4337
4352
|
});
|
|
4338
4353
|
};
|
|
4339
4354
|
export {
|
|
4340
|
-
|
|
4355
|
+
Wi as ChatbotBody
|
|
4341
4356
|
};
|