@inploi/plugin-chatbot 4.1.3 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.js +2 -2
- package/dist/chatbot-body-51ed15c6.cjs +1 -0
- package/dist/{chatbot-body-87199b8f.js → chatbot-body-c294edef.js} +187 -201
- package/dist/{index-6f98abfb.cjs → index-9944cf27.cjs} +1 -1
- package/dist/{index-c974e995.js → index-e35a0d9d.js} +1 -1
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +1 -1
- package/dist/chatbot-body-0b71f113.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as Ue, i as Yt, k as Le, a as er, b as le, A as Fe, c as Ir, N as Ke, _ as
|
|
1
|
+
import { g as Ue, i as Yt, k as Le, a as er, b as le, A as Fe, c as Ir, N as Ke, _ as T, d as tr, h as Y, e as re, p as ue, F as pt, u as G, o as l, f as De, j as dt, y as pe, s as I, l as Ze, m as he, n as Mr, q as at, r as ee, t as Fr, v as ke, w as Nr, x as rr, z as Lr, B as nr, C as Tr, D as Se, E as Q, G as Dr, V as Rr, H as sr, I as je, J as Te, K as Or, L as Br, M as Pr, O as $r, P as jr, Q as zr, R as qr, S as Ur, T as Kr, U as Gr } from "./index-e35a0d9d.js";
|
|
2
2
|
import "@inploi/sdk";
|
|
3
3
|
const Ft = ({
|
|
4
4
|
condition: e,
|
|
@@ -321,8 +321,8 @@ const Ft = ({
|
|
|
321
321
|
let y = 1;
|
|
322
322
|
const A = e.nodes.find((E) => E.id === k[k.length - 1]);
|
|
323
323
|
for (let E = k.length - 2; E > 0; E--) {
|
|
324
|
-
const g = k[E],
|
|
325
|
-
if (!
|
|
324
|
+
const g = k[E], F = e.nodes.find((P) => P.id === g);
|
|
325
|
+
if (!F || (y++, F.type.startsWith("question-")))
|
|
326
326
|
break;
|
|
327
327
|
}
|
|
328
328
|
x.abort(), x = new AbortController();
|
|
@@ -540,16 +540,16 @@ async function tn({
|
|
|
540
540
|
type: "integration",
|
|
541
541
|
value: k
|
|
542
542
|
}), Ke(k).with({
|
|
543
|
-
integration_response:
|
|
544
|
-
service:
|
|
545
|
-
status:
|
|
546
|
-
data:
|
|
543
|
+
integration_response: T.select(T.union({
|
|
544
|
+
service: T.optional(T.string),
|
|
545
|
+
status: T.number,
|
|
546
|
+
data: T.any
|
|
547
547
|
}, {
|
|
548
|
-
service:
|
|
549
|
-
status:
|
|
548
|
+
service: T.optional(T.string),
|
|
549
|
+
status: T.number,
|
|
550
550
|
error: {
|
|
551
|
-
message:
|
|
552
|
-
data:
|
|
551
|
+
message: T.string,
|
|
552
|
+
data: T.any
|
|
553
553
|
}
|
|
554
554
|
}))
|
|
555
555
|
}, (y) => {
|
|
@@ -569,60 +569,52 @@ async function tn({
|
|
|
569
569
|
}
|
|
570
570
|
});
|
|
571
571
|
}).otherwise(() => {
|
|
572
|
-
}), await Ke(k).with(
|
|
573
|
-
ats_data: V.select("redirect", {
|
|
574
|
-
redirect_url: V.string,
|
|
575
|
-
message: V.optional(V.union(V.string, V.nullish)),
|
|
576
|
-
button_text: V.optional(V.union(V.string, V.nullish))
|
|
577
|
-
})
|
|
578
|
-
}, {
|
|
572
|
+
}), await Ke(k).with({
|
|
579
573
|
integration_response: {
|
|
580
|
-
data:
|
|
581
|
-
redirect_url:
|
|
582
|
-
message:
|
|
583
|
-
button_text:
|
|
574
|
+
data: T.select("redirect", {
|
|
575
|
+
redirect_url: T.string,
|
|
576
|
+
message: T.optional(T.union(T.string, T.nullish)),
|
|
577
|
+
button_text: T.optional(T.union(T.string, T.nullish))
|
|
584
578
|
})
|
|
585
579
|
}
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
return;
|
|
603
|
-
}
|
|
604
|
-
i.log({
|
|
605
|
-
event: "FLOW_REDIRECT",
|
|
606
|
-
properties: {
|
|
607
|
-
flow_build: u.build,
|
|
608
|
-
flow_id: u.id,
|
|
609
|
-
flow_session_id: p,
|
|
610
|
-
flow_version: u.version,
|
|
611
|
-
href: A.toString(),
|
|
612
|
-
job: u.job
|
|
613
|
-
}
|
|
614
|
-
});
|
|
580
|
+
}, async (y) => {
|
|
581
|
+
await e.sendMessage({
|
|
582
|
+
type: "text",
|
|
583
|
+
author: "bot",
|
|
584
|
+
text: y.redirect.message ?? d("submission_redirect_message")
|
|
585
|
+
});
|
|
586
|
+
try {
|
|
587
|
+
const A = new URL(y.redirect.redirect_url);
|
|
588
|
+
v && !A.searchParams.has("anonymous_id") && A.searchParams.set("anonymous_id", v), await e.sendMessage({
|
|
589
|
+
type: "link",
|
|
590
|
+
href: A.toString(),
|
|
591
|
+
text: y.redirect.button_text ?? d("complete_submission"),
|
|
592
|
+
onClick: () => {
|
|
593
|
+
if (!p) {
|
|
594
|
+
n.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
595
|
+
return;
|
|
615
596
|
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
597
|
+
i.log({
|
|
598
|
+
event: "FLOW_REDIRECT",
|
|
599
|
+
properties: {
|
|
600
|
+
flow_build: u.build,
|
|
601
|
+
flow_id: u.id,
|
|
602
|
+
flow_session_id: p,
|
|
603
|
+
flow_version: u.version,
|
|
604
|
+
href: A.toString(),
|
|
605
|
+
job: u.job
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
} catch (A) {
|
|
611
|
+
n.error(`Invalid redirect URL: ${y.redirect.redirect_url}`, A), e.sendMessage({
|
|
612
|
+
type: "system",
|
|
613
|
+
variant: "error",
|
|
614
|
+
text: d("redirect_url_error")
|
|
615
|
+
});
|
|
625
616
|
}
|
|
617
|
+
t(r.nextId);
|
|
626
618
|
}).with({
|
|
627
619
|
success: !0
|
|
628
620
|
}, async () => {
|
|
@@ -631,23 +623,17 @@ async function tn({
|
|
|
631
623
|
variant: "success",
|
|
632
624
|
text: d("submission_completed")
|
|
633
625
|
}), t(r.nextId);
|
|
634
|
-
}).with(
|
|
635
|
-
success: !1,
|
|
636
|
-
ats_data: V.select("error", {
|
|
637
|
-
message: V.string
|
|
638
|
-
})
|
|
639
|
-
}, {
|
|
626
|
+
}).with({
|
|
640
627
|
integration_response: {
|
|
641
|
-
error:
|
|
642
|
-
message:
|
|
628
|
+
error: T.select("error", {
|
|
629
|
+
message: T.string
|
|
643
630
|
})
|
|
644
631
|
}
|
|
645
|
-
}
|
|
646
|
-
var A;
|
|
632
|
+
}, async (y) => {
|
|
647
633
|
n.error(y.error), await e.sendMessage({
|
|
648
634
|
type: "system",
|
|
649
635
|
variant: "error",
|
|
650
|
-
text:
|
|
636
|
+
text: y.error.message || d("submission_failed")
|
|
651
637
|
}), await h(!1);
|
|
652
638
|
}).otherwise(async (y) => {
|
|
653
639
|
n.error(y), await e.sendMessage({
|
|
@@ -1088,7 +1074,7 @@ function gn(e) {
|
|
|
1088
1074
|
if (!d.current.element)
|
|
1089
1075
|
return;
|
|
1090
1076
|
const {
|
|
1091
|
-
left:
|
|
1077
|
+
left: F,
|
|
1092
1078
|
top: P,
|
|
1093
1079
|
width: D,
|
|
1094
1080
|
height: me,
|
|
@@ -1097,7 +1083,7 @@ function gn(e) {
|
|
|
1097
1083
|
x: H,
|
|
1098
1084
|
y: se
|
|
1099
1085
|
} = d.current.element.getBoundingClientRect(), q = {
|
|
1100
|
-
left:
|
|
1086
|
+
left: F,
|
|
1101
1087
|
top: P,
|
|
1102
1088
|
width: D,
|
|
1103
1089
|
height: me,
|
|
@@ -1216,7 +1202,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1216
1202
|
};
|
|
1217
1203
|
}, [e]);
|
|
1218
1204
|
const t = pt(() => ({
|
|
1219
|
-
addToSubmissions: (n, s) =>
|
|
1205
|
+
addToSubmissions: (n, s) => I.setSubmission(n, s),
|
|
1220
1206
|
send: async ({
|
|
1221
1207
|
message: n,
|
|
1222
1208
|
signal: s,
|
|
@@ -1236,7 +1222,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1236
1222
|
}).otherwise(async () => {
|
|
1237
1223
|
}), s != null && s.aborted)
|
|
1238
1224
|
throw new Fe();
|
|
1239
|
-
|
|
1225
|
+
I.addMessage(n, a);
|
|
1240
1226
|
},
|
|
1241
1227
|
input: ({
|
|
1242
1228
|
input: n,
|
|
@@ -1244,11 +1230,11 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1244
1230
|
}) => {
|
|
1245
1231
|
if (s != null && s.aborted)
|
|
1246
1232
|
throw new Fe();
|
|
1247
|
-
return
|
|
1233
|
+
return I.setInput(n), new Promise((a) => {
|
|
1248
1234
|
const i = (u) => {
|
|
1249
1235
|
if (s != null && s.aborted)
|
|
1250
1236
|
throw new Fe();
|
|
1251
|
-
|
|
1237
|
+
I.setInput(void 0), n.key && I.setSubmission(n.key, u), a(u);
|
|
1252
1238
|
};
|
|
1253
1239
|
z.onSubmitSuccessFn$.value = i;
|
|
1254
1240
|
});
|
|
@@ -1604,7 +1590,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1604
1590
|
t
|
|
1605
1591
|
}) => pt(() => {
|
|
1606
1592
|
var n;
|
|
1607
|
-
const r = (n =
|
|
1593
|
+
const r = (n = I.current$.peek().flow) == null ? void 0 : n.data.flowSessionId;
|
|
1608
1594
|
return r ? {
|
|
1609
1595
|
enabled: !0,
|
|
1610
1596
|
getPredictions: async (s) => {
|
|
@@ -1703,7 +1689,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
1703
1689
|
a(void 0), v("manual");
|
|
1704
1690
|
return;
|
|
1705
1691
|
}
|
|
1706
|
-
const g = i.find((
|
|
1692
|
+
const g = i.find((F) => F.id === E);
|
|
1707
1693
|
g && (a(g.address), v("details"));
|
|
1708
1694
|
},
|
|
1709
1695
|
onAddressSearch: (E) => {
|
|
@@ -2050,7 +2036,7 @@ const vn = ["x", "y", "top", "bottom", "left", "right", "width", "height"], xn =
|
|
|
2050
2036
|
onSubmitSuccess: t
|
|
2051
2037
|
}) => {
|
|
2052
2038
|
var v;
|
|
2053
|
-
const r = (v =
|
|
2039
|
+
const r = (v = I.current$.value.flow) == null ? void 0 : v.data.submissions[e.key], [n, s] = Y(Dn(r) ? r.value : []), [a, i] = Y(), u = n.length - Rt, d = Tn(n), h = gt(), {
|
|
2054
2040
|
t: x
|
|
2055
2041
|
} = G();
|
|
2056
2042
|
return l("form", {
|
|
@@ -2265,7 +2251,7 @@ function Gn(e) {
|
|
|
2265
2251
|
}, [e.disabled]);
|
|
2266
2252
|
}
|
|
2267
2253
|
var te = (e) => typeof e == "string", Hn = (e, t, r, n, s) => te(e) ? (n && t.watch.add(e), w(r, e, s)) : Array.isArray(e) ? e.map((a) => (n && t.watch.add(a), w(r, a))) : (n && (t.watchAll = !0), r), yt = (e) => /^\w*$/.test(e), hr = (e) => Be(e.replace(/["|']|\]/g, "").split(/\.|\[/));
|
|
2268
|
-
function
|
|
2254
|
+
function N(e, t, r) {
|
|
2269
2255
|
let n = -1;
|
|
2270
2256
|
const s = yt(t) ? [t] : hr(t), a = s.length, i = a - 1;
|
|
2271
2257
|
for (; ++n < a; ) {
|
|
@@ -2309,7 +2295,7 @@ const ze = (e, t, r, n) => {
|
|
|
2309
2295
|
};
|
|
2310
2296
|
var Wn = (e, t, r) => {
|
|
2311
2297
|
const n = Be(w(e, r));
|
|
2312
|
-
return
|
|
2298
|
+
return N(n, "root", t[r]), N(e, r, n), e;
|
|
2313
2299
|
}, vt = (e) => e.type === "file", fe = (e) => typeof e == "function", Ge = (e) => {
|
|
2314
2300
|
if (!bt)
|
|
2315
2301
|
return !1;
|
|
@@ -2356,77 +2342,77 @@ var we = (e) => $(e) && !He(e) ? e : {
|
|
|
2356
2342
|
const { ref: a, refs: i, required: u, maxLength: d, minLength: h, min: x, max: v, pattern: p, validate: k, name: y, valueAsNumber: A, mount: S, disabled: E } = e._f, g = w(t, y);
|
|
2357
2343
|
if (!S || E)
|
|
2358
2344
|
return {};
|
|
2359
|
-
const
|
|
2360
|
-
n &&
|
|
2361
|
-
}, D = {}, me = xt(a), ce = Oe(a), Ee = me || ce, H = (A || vt(a)) && O(a.value) && O(g) || Ge(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, se = pr.bind(null, y, r, D), q = (
|
|
2362
|
-
const X =
|
|
2345
|
+
const F = i ? i[0] : a, P = (M) => {
|
|
2346
|
+
n && F.reportValidity && (F.setCustomValidity(de(M) ? "" : M || ""), F.reportValidity());
|
|
2347
|
+
}, D = {}, me = xt(a), ce = Oe(a), Ee = me || ce, H = (A || vt(a)) && O(a.value) && O(g) || Ge(a) && a.value === "" || g === "" || Array.isArray(g) && !g.length, se = pr.bind(null, y, r, D), q = (M, V, R, K = ie.maxLength, W = ie.minLength) => {
|
|
2348
|
+
const X = M ? V : R;
|
|
2363
2349
|
D[y] = {
|
|
2364
|
-
type:
|
|
2350
|
+
type: M ? K : W,
|
|
2365
2351
|
message: X,
|
|
2366
2352
|
ref: a,
|
|
2367
|
-
...se(
|
|
2353
|
+
...se(M ? K : W, X)
|
|
2368
2354
|
};
|
|
2369
2355
|
};
|
|
2370
2356
|
if (s ? !Array.isArray(g) || !g.length : u && (!Ee && (H || U(g)) || de(g) && !g || ce && !mr(i).isValid || me && !gr(i).isValid)) {
|
|
2371
|
-
const { value:
|
|
2372
|
-
if (
|
|
2357
|
+
const { value: M, message: V } = qe(u) ? { value: !!u, message: u } : we(u);
|
|
2358
|
+
if (M && (D[y] = {
|
|
2373
2359
|
type: ie.required,
|
|
2374
|
-
message:
|
|
2375
|
-
ref:
|
|
2376
|
-
...se(ie.required,
|
|
2360
|
+
message: V,
|
|
2361
|
+
ref: F,
|
|
2362
|
+
...se(ie.required, V)
|
|
2377
2363
|
}, !r))
|
|
2378
|
-
return P(
|
|
2364
|
+
return P(V), D;
|
|
2379
2365
|
}
|
|
2380
2366
|
if (!H && (!U(x) || !U(v))) {
|
|
2381
|
-
let
|
|
2367
|
+
let M, V;
|
|
2382
2368
|
const R = we(v), K = we(x);
|
|
2383
2369
|
if (!U(g) && !isNaN(g)) {
|
|
2384
2370
|
const W = a.valueAsNumber || g && +g;
|
|
2385
|
-
U(R.value) || (
|
|
2371
|
+
U(R.value) || (M = W > R.value), U(K.value) || (V = W < K.value);
|
|
2386
2372
|
} else {
|
|
2387
2373
|
const W = a.valueAsDate || new Date(g), X = (Pe) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + Pe), ge = a.type == "time", Ae = a.type == "week";
|
|
2388
|
-
te(R.value) && g && (
|
|
2374
|
+
te(R.value) && g && (M = ge ? X(g) > X(R.value) : Ae ? g > R.value : W > new Date(R.value)), te(K.value) && g && (V = ge ? X(g) < X(K.value) : Ae ? g < K.value : W < new Date(K.value));
|
|
2389
2375
|
}
|
|
2390
|
-
if ((
|
|
2376
|
+
if ((M || V) && (q(!!M, R.message, K.message, ie.max, ie.min), !r))
|
|
2391
2377
|
return P(D[y].message), D;
|
|
2392
2378
|
}
|
|
2393
2379
|
if ((d || h) && !H && (te(g) || s && Array.isArray(g))) {
|
|
2394
|
-
const
|
|
2395
|
-
if ((R || K) && (q(R,
|
|
2380
|
+
const M = we(d), V = we(h), R = !U(M.value) && g.length > +M.value, K = !U(V.value) && g.length < +V.value;
|
|
2381
|
+
if ((R || K) && (q(R, M.message, V.message), !r))
|
|
2396
2382
|
return P(D[y].message), D;
|
|
2397
2383
|
}
|
|
2398
2384
|
if (p && !H && te(g)) {
|
|
2399
|
-
const { value:
|
|
2400
|
-
if (He(
|
|
2385
|
+
const { value: M, message: V } = we(p);
|
|
2386
|
+
if (He(M) && !g.match(M) && (D[y] = {
|
|
2401
2387
|
type: ie.pattern,
|
|
2402
|
-
message:
|
|
2388
|
+
message: V,
|
|
2403
2389
|
ref: a,
|
|
2404
|
-
...se(ie.pattern,
|
|
2390
|
+
...se(ie.pattern, V)
|
|
2405
2391
|
}, !r))
|
|
2406
|
-
return P(
|
|
2392
|
+
return P(V), D;
|
|
2407
2393
|
}
|
|
2408
2394
|
if (k) {
|
|
2409
2395
|
if (fe(k)) {
|
|
2410
|
-
const
|
|
2411
|
-
if (
|
|
2412
|
-
...
|
|
2413
|
-
...se(ie.validate,
|
|
2396
|
+
const M = await k(g, t), V = Ut(M, F);
|
|
2397
|
+
if (V && (D[y] = {
|
|
2398
|
+
...V,
|
|
2399
|
+
...se(ie.validate, V.message)
|
|
2414
2400
|
}, !r))
|
|
2415
|
-
return P(
|
|
2401
|
+
return P(V.message), D;
|
|
2416
2402
|
} else if ($(k)) {
|
|
2417
|
-
let
|
|
2418
|
-
for (const
|
|
2419
|
-
if (!J(
|
|
2403
|
+
let M = {};
|
|
2404
|
+
for (const V in k) {
|
|
2405
|
+
if (!J(M) && !r)
|
|
2420
2406
|
break;
|
|
2421
|
-
const R = Ut(await k[
|
|
2422
|
-
R && (
|
|
2407
|
+
const R = Ut(await k[V](g, t), F, V);
|
|
2408
|
+
R && (M = {
|
|
2423
2409
|
...R,
|
|
2424
|
-
...se(
|
|
2425
|
-
}, P(R.message), r && (D[y] =
|
|
2410
|
+
...se(V, R.message)
|
|
2411
|
+
}, P(R.message), r && (D[y] = M));
|
|
2426
2412
|
}
|
|
2427
|
-
if (!J(
|
|
2428
|
-
ref:
|
|
2429
|
-
...
|
|
2413
|
+
if (!J(M) && (D[y] = {
|
|
2414
|
+
ref: F,
|
|
2415
|
+
...M
|
|
2430
2416
|
}, !r))
|
|
2431
2417
|
return D;
|
|
2432
2418
|
}
|
|
@@ -2521,7 +2507,7 @@ var Qn = (e, t, r, n) => {
|
|
|
2521
2507
|
const s = {};
|
|
2522
2508
|
for (const a of e) {
|
|
2523
2509
|
const i = w(t, a);
|
|
2524
|
-
i &&
|
|
2510
|
+
i && N(s, a, i._f);
|
|
2525
2511
|
}
|
|
2526
2512
|
return {
|
|
2527
2513
|
criteriaMode: r,
|
|
@@ -2606,59 +2592,59 @@ function ns(e = {}, t) {
|
|
|
2606
2592
|
isValid: c
|
|
2607
2593
|
});
|
|
2608
2594
|
}
|
|
2609
|
-
},
|
|
2595
|
+
}, F = (o) => v.isValidating && p.state.next({
|
|
2610
2596
|
isValidating: o
|
|
2611
2597
|
}), P = (o, c = [], f, _, b = !0, m = !0) => {
|
|
2612
2598
|
if (_ && f) {
|
|
2613
2599
|
if (u.action = !0, m && Array.isArray(w(s, o))) {
|
|
2614
2600
|
const C = f(w(s, o), _.argA, _.argB);
|
|
2615
|
-
b &&
|
|
2601
|
+
b && N(s, o, C);
|
|
2616
2602
|
}
|
|
2617
2603
|
if (m && Array.isArray(w(n.errors, o))) {
|
|
2618
2604
|
const C = f(w(n.errors, o), _.argA, _.argB);
|
|
2619
|
-
b &&
|
|
2605
|
+
b && N(n.errors, o, C), ts(n.errors, o);
|
|
2620
2606
|
}
|
|
2621
2607
|
if (v.touchedFields && m && Array.isArray(w(n.touchedFields, o))) {
|
|
2622
2608
|
const C = f(w(n.touchedFields, o), _.argA, _.argB);
|
|
2623
|
-
b &&
|
|
2609
|
+
b && N(n.touchedFields, o, C);
|
|
2624
2610
|
}
|
|
2625
2611
|
v.dirtyFields && (n.dirtyFields = ut(a, i)), p.state.next({
|
|
2626
2612
|
name: o,
|
|
2627
|
-
isDirty:
|
|
2613
|
+
isDirty: V(o, c),
|
|
2628
2614
|
dirtyFields: n.dirtyFields,
|
|
2629
2615
|
errors: n.errors,
|
|
2630
2616
|
isValid: n.isValid
|
|
2631
2617
|
});
|
|
2632
2618
|
} else
|
|
2633
|
-
|
|
2619
|
+
N(i, o, c);
|
|
2634
2620
|
}, D = (o, c) => {
|
|
2635
|
-
|
|
2621
|
+
N(n.errors, o, c), p.state.next({
|
|
2636
2622
|
errors: n.errors
|
|
2637
2623
|
});
|
|
2638
2624
|
}, me = (o, c, f, _) => {
|
|
2639
2625
|
const b = w(s, o);
|
|
2640
2626
|
if (b) {
|
|
2641
2627
|
const m = w(i, o, O(f) ? w(a, o) : f);
|
|
2642
|
-
O(m) || _ && _.defaultChecked || c ?
|
|
2628
|
+
O(m) || _ && _.defaultChecked || c ? N(i, o, c ? m : ct(b._f)) : W(o, m), u.mount && g();
|
|
2643
2629
|
}
|
|
2644
2630
|
}, ce = (o, c, f, _, b) => {
|
|
2645
2631
|
let m = !1, C = !1;
|
|
2646
|
-
const
|
|
2632
|
+
const L = {
|
|
2647
2633
|
name: o
|
|
2648
2634
|
};
|
|
2649
2635
|
if (!f || _) {
|
|
2650
|
-
v.isDirty && (C = n.isDirty, n.isDirty =
|
|
2636
|
+
v.isDirty && (C = n.isDirty, n.isDirty = L.isDirty = V(), m = C !== L.isDirty);
|
|
2651
2637
|
const B = be(w(a, o), c);
|
|
2652
|
-
C = w(n.dirtyFields, o), B ? j(n.dirtyFields, o) :
|
|
2638
|
+
C = w(n.dirtyFields, o), B ? j(n.dirtyFields, o) : N(n.dirtyFields, o, !0), L.dirtyFields = n.dirtyFields, m = m || v.dirtyFields && C !== !B;
|
|
2653
2639
|
}
|
|
2654
2640
|
if (f) {
|
|
2655
2641
|
const B = w(n.touchedFields, o);
|
|
2656
|
-
B || (
|
|
2642
|
+
B || (N(n.touchedFields, o, f), L.touchedFields = n.touchedFields, m = m || v.touchedFields && B !== f);
|
|
2657
2643
|
}
|
|
2658
|
-
return m && b && p.state.next(
|
|
2644
|
+
return m && b && p.state.next(L), m ? L : {};
|
|
2659
2645
|
}, Ee = (o, c, f, _) => {
|
|
2660
2646
|
const b = w(n.errors, o), m = v.isValid && de(c) && n.isValid !== c;
|
|
2661
|
-
if (e.delayError && f ? (h = E(() => D(o, f)), h(e.delayError)) : (clearTimeout(x), h = null, f ?
|
|
2647
|
+
if (e.delayError && f ? (h = E(() => D(o, f)), h(e.delayError)) : (clearTimeout(x), h = null, f ? N(n.errors, o, f) : j(n.errors, o)), (f ? !be(b, f) : b) || !J(_) || m) {
|
|
2662
2648
|
const C = {
|
|
2663
2649
|
..._,
|
|
2664
2650
|
...m && de(c) ? { isValid: c } : {},
|
|
@@ -2670,13 +2656,13 @@ function ns(e = {}, t) {
|
|
|
2670
2656
|
...C
|
|
2671
2657
|
}, p.state.next(C);
|
|
2672
2658
|
}
|
|
2673
|
-
|
|
2659
|
+
F(!1);
|
|
2674
2660
|
}, H = async (o) => r.resolver(i, r.context, Qn(o || d.mount, s, r.criteriaMode, r.shouldUseNativeValidation)), se = async (o) => {
|
|
2675
2661
|
const { errors: c } = await H(o);
|
|
2676
2662
|
if (o)
|
|
2677
2663
|
for (const f of o) {
|
|
2678
2664
|
const _ = w(c, f);
|
|
2679
|
-
_ ?
|
|
2665
|
+
_ ? N(n.errors, f, _) : j(n.errors, f);
|
|
2680
2666
|
}
|
|
2681
2667
|
else
|
|
2682
2668
|
n.errors = c;
|
|
@@ -2689,29 +2675,29 @@ function ns(e = {}, t) {
|
|
|
2689
2675
|
if (b) {
|
|
2690
2676
|
const { _f: m, ...C } = b;
|
|
2691
2677
|
if (m) {
|
|
2692
|
-
const
|
|
2678
|
+
const L = d.array.has(m.name), B = await Kt(b, i, S, r.shouldUseNativeValidation && !c, L);
|
|
2693
2679
|
if (B[m.name] && (f.valid = !1, c))
|
|
2694
2680
|
break;
|
|
2695
|
-
!c && (w(B, m.name) ?
|
|
2681
|
+
!c && (w(B, m.name) ? L ? Wn(n.errors, B, m.name) : N(n.errors, m.name, B[m.name]) : j(n.errors, m.name));
|
|
2696
2682
|
}
|
|
2697
2683
|
C && await q(C, c, f);
|
|
2698
2684
|
}
|
|
2699
2685
|
}
|
|
2700
2686
|
return f.valid;
|
|
2701
|
-
},
|
|
2687
|
+
}, M = () => {
|
|
2702
2688
|
for (const o of d.unMount) {
|
|
2703
2689
|
const c = w(s, o);
|
|
2704
2690
|
c && (c._f.refs ? c._f.refs.every((f) => !lt(f)) : !lt(c._f.ref)) && tt(o);
|
|
2705
2691
|
}
|
|
2706
2692
|
d.unMount = /* @__PURE__ */ new Set();
|
|
2707
|
-
},
|
|
2693
|
+
}, V = (o, c) => (o && c && N(i, o, c), !be(wt(), a)), R = (o, c, f) => Hn(o, d, {
|
|
2708
2694
|
...u.mount ? i : O(c) ? a : te(o) ? { [o]: c } : c
|
|
2709
2695
|
}, f, c), K = (o) => Be(w(u.mount ? i : a, o, e.shouldUnregister ? w(a, o, []) : [])), W = (o, c, f = {}) => {
|
|
2710
2696
|
const _ = w(s, o);
|
|
2711
2697
|
let b = c;
|
|
2712
2698
|
if (_) {
|
|
2713
2699
|
const m = _._f;
|
|
2714
|
-
m && (!m.disabled &&
|
|
2700
|
+
m && (!m.disabled && N(i, o, xr(c, m)), b = Ge(m.ref) && U(c) ? "" : c, br(m.ref) ? [...m.ref.options].forEach((C) => C.selected = b.includes(C.value)) : m.refs ? Oe(m.ref) ? m.refs.length > 1 ? m.refs.forEach((C) => (!C.defaultChecked || !C.disabled) && (C.checked = Array.isArray(b) ? !!b.find((L) => L === C.value) : b === C.value)) : m.refs[0] && (m.refs[0].checked = !!b) : m.refs.forEach((C) => C.checked = C.value === b) : vt(m.ref) ? m.ref.value = "" : (m.ref.value = b, m.ref.type || p.values.next({
|
|
2715
2701
|
name: o,
|
|
2716
2702
|
values: { ...i }
|
|
2717
2703
|
})));
|
|
@@ -2724,13 +2710,13 @@ function ns(e = {}, t) {
|
|
|
2724
2710
|
}
|
|
2725
2711
|
}, ge = (o, c, f = {}) => {
|
|
2726
2712
|
const _ = w(s, o), b = d.array.has(o), m = oe(c);
|
|
2727
|
-
|
|
2713
|
+
N(i, o, m), b ? (p.array.next({
|
|
2728
2714
|
name: o,
|
|
2729
2715
|
values: { ...i }
|
|
2730
2716
|
}), (v.isDirty || v.dirtyFields) && f.shouldDirty && p.state.next({
|
|
2731
2717
|
name: o,
|
|
2732
2718
|
dirtyFields: ut(a, i),
|
|
2733
|
-
isDirty:
|
|
2719
|
+
isDirty: V(o, m)
|
|
2734
2720
|
})) : _ && !_._f && !U(m) ? X(o, m, f) : W(o, m, f), $t(o, d) && p.state.next({ ...n }), p.values.next({
|
|
2735
2721
|
name: o,
|
|
2736
2722
|
values: { ...i }
|
|
@@ -2738,13 +2724,13 @@ function ns(e = {}, t) {
|
|
|
2738
2724
|
}, Ae = async (o) => {
|
|
2739
2725
|
const c = o.target;
|
|
2740
2726
|
let f = c.name, _ = !0;
|
|
2741
|
-
const b = w(s, f), m = () => c.type ? ct(b._f) : $n(o), C = (
|
|
2742
|
-
_ = Number.isNaN(
|
|
2727
|
+
const b = w(s, f), m = () => c.type ? ct(b._f) : $n(o), C = (L) => {
|
|
2728
|
+
_ = Number.isNaN(L) || L === w(i, f, L);
|
|
2743
2729
|
};
|
|
2744
2730
|
if (b) {
|
|
2745
|
-
let
|
|
2731
|
+
let L, B;
|
|
2746
2732
|
const $e = m(), xe = o.type === Bt.BLUR || o.type === Bt.FOCUS_OUT, Er = !Yn(b._f) && !r.resolver && !w(n.errors, f) && !b._f.deps || es(xe, w(n.touchedFields, f), n.isSubmitted, A, y), nt = $t(f, d, xe);
|
|
2747
|
-
|
|
2733
|
+
N(i, f, $e), xe ? (b._f.onBlur && b._f.onBlur(o), h && h(0)) : b._f.onChange && b._f.onChange(o);
|
|
2748
2734
|
const st = ce(f, $e, xe, !1), Ar = !J(st) || nt;
|
|
2749
2735
|
if (!xe && p.values.next({
|
|
2750
2736
|
name: f,
|
|
@@ -2752,15 +2738,15 @@ function ns(e = {}, t) {
|
|
|
2752
2738
|
values: { ...i }
|
|
2753
2739
|
}), Er)
|
|
2754
2740
|
return v.isValid && g(), Ar && p.state.next({ name: f, ...nt ? {} : st });
|
|
2755
|
-
if (!xe && nt && p.state.next({ ...n }),
|
|
2741
|
+
if (!xe && nt && p.state.next({ ...n }), F(!0), r.resolver) {
|
|
2756
2742
|
const { errors: It } = await H([f]);
|
|
2757
2743
|
if (C($e), _) {
|
|
2758
2744
|
const Vr = Gt(n.errors, s, f), Mt = Gt(It, s, Vr.name || f);
|
|
2759
|
-
|
|
2745
|
+
L = Mt.error, f = Mt.name, B = J(It);
|
|
2760
2746
|
}
|
|
2761
2747
|
} else
|
|
2762
|
-
|
|
2763
|
-
_ && (b._f.deps && et(b._f.deps), Ee(f, B,
|
|
2748
|
+
L = (await Kt(b, i, S, r.shouldUseNativeValidation))[f], C($e), _ && (L ? B = !1 : v.isValid && (B = await q(s, !0)));
|
|
2749
|
+
_ && (b._f.deps && et(b._f.deps), Ee(f, B, L, st));
|
|
2764
2750
|
}
|
|
2765
2751
|
}, Pe = (o, c) => {
|
|
2766
2752
|
if (w(n.errors, c) && o.focus)
|
|
@@ -2768,7 +2754,7 @@ function ns(e = {}, t) {
|
|
|
2768
2754
|
}, et = async (o, c = {}) => {
|
|
2769
2755
|
let f, _;
|
|
2770
2756
|
const b = it(o);
|
|
2771
|
-
if (
|
|
2757
|
+
if (F(!0), r.resolver) {
|
|
2772
2758
|
const m = await se(O(o) ? o : b);
|
|
2773
2759
|
f = J(m), _ = o ? !b.some((C) => w(m, C)) : f;
|
|
2774
2760
|
} else
|
|
@@ -2799,7 +2785,7 @@ function ns(e = {}, t) {
|
|
|
2799
2785
|
});
|
|
2800
2786
|
}, kt = (o, c, f) => {
|
|
2801
2787
|
const _ = (w(s, o, { _f: {} })._f || {}).ref;
|
|
2802
|
-
|
|
2788
|
+
N(n.errors, o, {
|
|
2803
2789
|
...c,
|
|
2804
2790
|
ref: _
|
|
2805
2791
|
}), p.state.next({
|
|
@@ -2816,17 +2802,17 @@ function ns(e = {}, t) {
|
|
|
2816
2802
|
values: { ...i }
|
|
2817
2803
|
}), p.state.next({
|
|
2818
2804
|
...n,
|
|
2819
|
-
...c.keepDirty ? { isDirty:
|
|
2805
|
+
...c.keepDirty ? { isDirty: V() } : {}
|
|
2820
2806
|
}), !c.keepIsValid && g();
|
|
2821
2807
|
}, St = ({ disabled: o, name: c, field: f, fields: _, value: b }) => {
|
|
2822
2808
|
if (de(o)) {
|
|
2823
2809
|
const m = o ? void 0 : O(b) ? ct(f ? f._f : w(_, c)._f) : b;
|
|
2824
|
-
|
|
2810
|
+
N(i, c, m), ce(c, m, !1, !1, !0);
|
|
2825
2811
|
}
|
|
2826
2812
|
}, rt = (o, c = {}) => {
|
|
2827
2813
|
let f = w(s, o);
|
|
2828
2814
|
const _ = de(c.disabled);
|
|
2829
|
-
return
|
|
2815
|
+
return N(s, o, {
|
|
2830
2816
|
...f || {},
|
|
2831
2817
|
_f: {
|
|
2832
2818
|
...f && f._f ? f._f : { ref: { name: o } },
|
|
@@ -2854,15 +2840,15 @@ function ns(e = {}, t) {
|
|
|
2854
2840
|
ref: (b) => {
|
|
2855
2841
|
if (b) {
|
|
2856
2842
|
rt(o, c), f = w(s, o);
|
|
2857
|
-
const m = O(b.value) && b.querySelectorAll && b.querySelectorAll("input,select,textarea")[0] || b, C = Xn(m),
|
|
2858
|
-
if (C ?
|
|
2843
|
+
const m = O(b.value) && b.querySelectorAll && b.querySelectorAll("input,select,textarea")[0] || b, C = Xn(m), L = f._f.refs || [];
|
|
2844
|
+
if (C ? L.find((B) => B === m) : m === f._f.ref)
|
|
2859
2845
|
return;
|
|
2860
|
-
|
|
2846
|
+
N(s, o, {
|
|
2861
2847
|
_f: {
|
|
2862
2848
|
...f._f,
|
|
2863
2849
|
...C ? {
|
|
2864
2850
|
refs: [
|
|
2865
|
-
...
|
|
2851
|
+
...L.filter(lt),
|
|
2866
2852
|
m,
|
|
2867
2853
|
...Array.isArray(w(a, o)) ? [{}] : []
|
|
2868
2854
|
],
|
|
@@ -2898,21 +2884,21 @@ function ns(e = {}, t) {
|
|
|
2898
2884
|
errors: n.errors
|
|
2899
2885
|
});
|
|
2900
2886
|
}, Cr = (o, c = {}) => {
|
|
2901
|
-
w(s, o) && (O(c.defaultValue) ? ge(o, w(a, o)) : (ge(o, c.defaultValue),
|
|
2887
|
+
w(s, o) && (O(c.defaultValue) ? ge(o, w(a, o)) : (ge(o, c.defaultValue), N(a, o, c.defaultValue)), c.keepTouched || j(n.touchedFields, o), c.keepDirty || (j(n.dirtyFields, o), n.isDirty = c.defaultValue ? V(o, w(a, o)) : V()), c.keepError || (j(n.errors, o), v.isValid && g()), p.state.next({ ...n }));
|
|
2902
2888
|
}, At = (o, c = {}) => {
|
|
2903
2889
|
const f = o ? oe(o) : a, _ = oe(f), b = o && !J(o) ? _ : a;
|
|
2904
2890
|
if (c.keepDefaultValues || (a = f), !c.keepValues) {
|
|
2905
2891
|
if (c.keepDirtyValues || k)
|
|
2906
2892
|
for (const m of d.mount)
|
|
2907
|
-
w(n.dirtyFields, m) ?
|
|
2893
|
+
w(n.dirtyFields, m) ? N(b, m, w(i, m)) : ge(m, w(b, m));
|
|
2908
2894
|
else {
|
|
2909
2895
|
if (bt && O(o))
|
|
2910
2896
|
for (const m of d.mount) {
|
|
2911
2897
|
const C = w(s, m);
|
|
2912
2898
|
if (C && C._f) {
|
|
2913
|
-
const
|
|
2914
|
-
if (Ge(
|
|
2915
|
-
const B =
|
|
2899
|
+
const L = Array.isArray(C._f.refs) ? C._f.refs[0] : C._f.ref;
|
|
2900
|
+
if (Ge(L)) {
|
|
2901
|
+
const B = L.closest("form");
|
|
2916
2902
|
if (B) {
|
|
2917
2903
|
B.reset();
|
|
2918
2904
|
break;
|
|
@@ -2955,9 +2941,9 @@ function ns(e = {}, t) {
|
|
|
2955
2941
|
setError: kt,
|
|
2956
2942
|
_executeSchema: H,
|
|
2957
2943
|
_getWatch: R,
|
|
2958
|
-
_getDirty:
|
|
2944
|
+
_getDirty: V,
|
|
2959
2945
|
_updateValid: g,
|
|
2960
|
-
_removeUnmounted:
|
|
2946
|
+
_removeUnmounted: M,
|
|
2961
2947
|
_updateFieldArray: P,
|
|
2962
2948
|
_updateDisabledField: St,
|
|
2963
2949
|
_getFieldArray: K,
|
|
@@ -3094,9 +3080,9 @@ var Ht = function(e, t, r) {
|
|
|
3094
3080
|
var s = w(t.fields, n), a = Object.assign(e[n] || {}, { ref: s && s.ref });
|
|
3095
3081
|
if (os(t.names || Object.keys(e), n)) {
|
|
3096
3082
|
var i = Object.assign({}, is(w(r, n)));
|
|
3097
|
-
|
|
3083
|
+
N(i, "root", a), N(r, n, i);
|
|
3098
3084
|
} else
|
|
3099
|
-
|
|
3085
|
+
N(r, n, a);
|
|
3100
3086
|
}
|
|
3101
3087
|
return r;
|
|
3102
3088
|
}, is = function(e) {
|
|
@@ -3186,7 +3172,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3186
3172
|
onSubmitSuccess: t
|
|
3187
3173
|
}) => {
|
|
3188
3174
|
var x, v;
|
|
3189
|
-
const r = e.key ? (x =
|
|
3175
|
+
const r = e.key ? (x = I.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, n = (e.config.minSelected === 1 || e.config.minSelected === void 0) && e.config.maxSelected === 1, s = n && e.config.options.length === 2, {
|
|
3190
3176
|
t: a
|
|
3191
3177
|
} = G(), {
|
|
3192
3178
|
register: i,
|
|
@@ -3295,7 +3281,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3295
3281
|
onSubmitSuccess: t
|
|
3296
3282
|
}) => {
|
|
3297
3283
|
var v;
|
|
3298
|
-
const r = e.config.defaultValue, n = e.key ? (v =
|
|
3284
|
+
const r = e.config.defaultValue, n = e.key ? (v = I.current$.value.flow) == null ? void 0 : v.data.submissions[e.key] : void 0, {
|
|
3299
3285
|
t: s
|
|
3300
3286
|
} = G(), {
|
|
3301
3287
|
register: a,
|
|
@@ -3381,7 +3367,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3381
3367
|
onSubmitSuccess: t
|
|
3382
3368
|
}) => {
|
|
3383
3369
|
var A;
|
|
3384
|
-
const r = e.key ? (A =
|
|
3370
|
+
const r = e.key ? (A = I.current$.value.flow) == null ? void 0 : A.data.submissions[e.key] : void 0, {
|
|
3385
3371
|
t: n
|
|
3386
3372
|
} = G(), [s, a] = Y(), i = vs(r) ? gs(r.value) : xs(r) ? r.value : void 0, {
|
|
3387
3373
|
register: u,
|
|
@@ -3410,10 +3396,10 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3410
3396
|
onSubmit: d((S) => {
|
|
3411
3397
|
const E = S.phoneNumber.replace(/[^0-9]/g, ""), g = S.countryCode.replace(/[^0-9]/g, "");
|
|
3412
3398
|
a(void 0);
|
|
3413
|
-
const
|
|
3414
|
-
if (E.length + g.length <
|
|
3399
|
+
const F = e.config.minChars ?? 7;
|
|
3400
|
+
if (E.length + g.length < F)
|
|
3415
3401
|
return a(n("validation_phone_min_chars", {
|
|
3416
|
-
count:
|
|
3402
|
+
count: F
|
|
3417
3403
|
}));
|
|
3418
3404
|
e.config.submissionFormat === "phone" ? t({
|
|
3419
3405
|
type: "phone",
|
|
@@ -3542,7 +3528,7 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3542
3528
|
var v;
|
|
3543
3529
|
const {
|
|
3544
3530
|
t: r
|
|
3545
|
-
} = G(), n = e.key ? (v =
|
|
3531
|
+
} = G(), n = e.key ? (v = I.current$.value.flow) == null ? void 0 : v.data.submissions[e.key] : void 0, s = e.config.defaultValue, {
|
|
3546
3532
|
register: a,
|
|
3547
3533
|
handleSubmit: i,
|
|
3548
3534
|
formState: {
|
|
@@ -3612,8 +3598,8 @@ const Wt = 27, Jt = 12, Zt = 10, us = Se("enum"), cs = (e, t) => {
|
|
|
3612
3598
|
logger: e
|
|
3613
3599
|
}) => {
|
|
3614
3600
|
var a;
|
|
3615
|
-
const t = (a =
|
|
3616
|
-
return
|
|
3601
|
+
const t = (a = I.current$.value.flow) == null ? void 0 : a.data.currentInput, [r, n] = gn(), s = re(null);
|
|
3602
|
+
return I.inputHeight$.value = n.height, ue(() => {
|
|
3617
3603
|
const i = s.current;
|
|
3618
3604
|
if (i)
|
|
3619
3605
|
return i.addEventListener("transitionstart", z.scrollToEnd.smooth), i.addEventListener("transitioncancel", z.scrollToEnd.smooth), i.addEventListener("transitionend", z.scrollToEnd.smooth), () => {
|
|
@@ -3800,7 +3786,7 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3800
3786
|
lastSentMessageFooter: e
|
|
3801
3787
|
}) => {
|
|
3802
3788
|
var r;
|
|
3803
|
-
const t = ((r =
|
|
3789
|
+
const t = ((r = I.current$.value.flow) == null ? void 0 : r.data.messages) ?? [];
|
|
3804
3790
|
return ue(() => {
|
|
3805
3791
|
z.scrollToEnd.smooth();
|
|
3806
3792
|
}, [t.length]), l("ol", {
|
|
@@ -3818,7 +3804,7 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3818
3804
|
children: a.text
|
|
3819
3805
|
})).with({
|
|
3820
3806
|
type: "text",
|
|
3821
|
-
author:
|
|
3807
|
+
author: T.union("bot", "user")
|
|
3822
3808
|
}, (a) => {
|
|
3823
3809
|
const i = a.author === "user" && !t.slice(s + 1).some((h) => h.type === "text" && h.author === "user"), u = s === t.length - 1, d = a.author === "bot" ? js(a.text) : a.text;
|
|
3824
3810
|
return l(qs, {
|
|
@@ -3867,9 +3853,9 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3867
3853
|
}) => {
|
|
3868
3854
|
const {
|
|
3869
3855
|
flow: n
|
|
3870
|
-
} =
|
|
3856
|
+
} = I.current$.value;
|
|
3871
3857
|
le(n, "Flow is required to exist to show chatbot body");
|
|
3872
|
-
const s =
|
|
3858
|
+
const s = I.viewState$.value, {
|
|
3873
3859
|
chatRef: a,
|
|
3874
3860
|
chatService: i
|
|
3875
3861
|
} = _n(), {
|
|
@@ -3882,13 +3868,13 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3882
3868
|
const {
|
|
3883
3869
|
state: x,
|
|
3884
3870
|
flow: v
|
|
3885
|
-
} =
|
|
3871
|
+
} = I.current$.peek();
|
|
3886
3872
|
if (x !== "loaded")
|
|
3887
3873
|
throw new Error(u("invalid_state"));
|
|
3888
3874
|
let p = v.data.nodeHistory.at(-1);
|
|
3889
|
-
if (z.scrollToEnd.instant(),
|
|
3875
|
+
if (z.scrollToEnd.instant(), I.setInput(void 0), v.data.isFinished)
|
|
3890
3876
|
return;
|
|
3891
|
-
p === void 0 ? (p = er(n.nodes).id,
|
|
3877
|
+
p === void 0 ? (p = er(n.nodes).id, I.setCurrentNodeId(p), r.log({
|
|
3892
3878
|
event: "FLOW_START",
|
|
3893
3879
|
properties: {
|
|
3894
3880
|
flow_id: n.id,
|
|
@@ -3898,7 +3884,7 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3898
3884
|
job: n.job
|
|
3899
3885
|
},
|
|
3900
3886
|
customProperties: (S = n.analytics) == null ? void 0 : S.customProperties
|
|
3901
|
-
})) :
|
|
3887
|
+
})) : I.removeMessagesSentByNodeIds([p]);
|
|
3902
3888
|
const {
|
|
3903
3889
|
interpret: k,
|
|
3904
3890
|
abort: y,
|
|
@@ -3917,17 +3903,17 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3917
3903
|
// We need to get fresh submissions, that’s why we call `peek` here.
|
|
3918
3904
|
getSubmissions: () => {
|
|
3919
3905
|
var g;
|
|
3920
|
-
return (g =
|
|
3906
|
+
return (g = I.current$.peek().flow) == null ? void 0 : g.data.submissions;
|
|
3921
3907
|
},
|
|
3922
|
-
onInterpret: (g,
|
|
3908
|
+
onInterpret: (g, F) => {
|
|
3923
3909
|
var D;
|
|
3924
|
-
const P =
|
|
3925
|
-
le(P),
|
|
3910
|
+
const P = I.current$.peek().flow;
|
|
3911
|
+
le(P), F && (P.data.sequence = P.data.sequence + 1, r.log({
|
|
3926
3912
|
event: "FLOW_NODE",
|
|
3927
3913
|
properties: {
|
|
3928
3914
|
flow_id: n.id,
|
|
3929
3915
|
flow_version: n.version,
|
|
3930
|
-
from_node_id:
|
|
3916
|
+
from_node_id: F.id,
|
|
3931
3917
|
flow_build: n.build,
|
|
3932
3918
|
to_node_id: g.id,
|
|
3933
3919
|
sequence: P.data.sequence,
|
|
@@ -3935,12 +3921,12 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3935
3921
|
job: n.job
|
|
3936
3922
|
},
|
|
3937
3923
|
customProperties: (D = n.analytics) == null ? void 0 : D.customProperties
|
|
3938
|
-
})),
|
|
3924
|
+
})), I.setCurrentNodeId(g.id);
|
|
3939
3925
|
},
|
|
3940
3926
|
onFlowEnd: async () => {
|
|
3941
|
-
var
|
|
3942
|
-
|
|
3943
|
-
const g =
|
|
3927
|
+
var F;
|
|
3928
|
+
I.markAsFinished();
|
|
3929
|
+
const g = I.current$.peek().flow;
|
|
3944
3930
|
le(g), r.log({
|
|
3945
3931
|
event: "FLOW_END",
|
|
3946
3932
|
properties: {
|
|
@@ -3950,7 +3936,7 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3950
3936
|
flow_build: n.build,
|
|
3951
3937
|
job: n.job
|
|
3952
3938
|
},
|
|
3953
|
-
customProperties: (
|
|
3939
|
+
customProperties: (F = n.analytics) == null ? void 0 : F.customProperties
|
|
3954
3940
|
});
|
|
3955
3941
|
}
|
|
3956
3942
|
});
|
|
@@ -3961,7 +3947,7 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3961
3947
|
className: "hide-scrollbars relative flex w-full max-w-full flex-grow flex-col overflow-y-scroll",
|
|
3962
3948
|
style: {
|
|
3963
3949
|
WebkitOverflowScrolling: "touch",
|
|
3964
|
-
paddingBottom:
|
|
3950
|
+
paddingBottom: I.inputHeight$.value
|
|
3965
3951
|
},
|
|
3966
3952
|
children: l(Ws, {
|
|
3967
3953
|
lastSentMessageFooter: n.data.isFinished || !d ? null : l(Zs, {
|
|
@@ -3985,13 +3971,13 @@ const Me = /* @__PURE__ */ tr(Ts), Ds = /(\[[^\]]+\]\([^)]+\))/g, Rs = /\[([^\]]
|
|
|
3985
3971
|
onClick: async () => {
|
|
3986
3972
|
const {
|
|
3987
3973
|
flow: r
|
|
3988
|
-
} =
|
|
3974
|
+
} = I.current$.peek();
|
|
3989
3975
|
le(r);
|
|
3990
3976
|
const {
|
|
3991
3977
|
removed: n
|
|
3992
3978
|
} = e(r.data.nodeHistory), s = r.data.nodeHistory.splice(-n);
|
|
3993
|
-
s.length !== 0 && (
|
|
3994
|
-
...
|
|
3979
|
+
s.length !== 0 && (I.removeMessagesSentByNodeIds(s), I.setInput(void 0), s.pop(), s.map((a) => r.nodes.find((i) => i.id === a)).filter(Boolean).flatMap(Js).forEach((a) => delete r.data.submissions[a]), I.current$.value = {
|
|
3980
|
+
...I.current$.value
|
|
3995
3981
|
});
|
|
3996
3982
|
},
|
|
3997
3983
|
children: t("undo")
|