@inploi/plugin-chatbot 14.10.0 → 14.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,46 +1,46 @@
1
- import { i as _r, c as ut, P as Ct, u as $e, l as kr, T as Cr, s as fn, N as hn, M as Sr, z as pn, X as Ir, W as mn, C as yn, o as gn, d as bn, h as vn, U as Wt, $ as xn, x as wn, g as zt, m as _n, f as Ar, w as kn, b as Cn, v as Sn, y as In, a as j, e as Q, j as u, k as qe, n as ct, p as ve, _ as de, q as Ne, r as Ae, t as we, L as Et, F as An, A as Er, B as Fr, D as En, E as Ue, G as Kt, H as te, I as se, J as Fn, K as Vn, O as Mn, Q as Ln, S as Vr, R as Nn } from "./index-5de8da64.js";
2
- import { isApiErrorWithData as Rn, ApiError as Dn } from "@inploi/sdk";
3
- var Tn = "9.7.0", Mr = `https://sdk.inploi.com/@inploi/flows@${Tn}/cdn/captcha/index.html`, On = new URL(Mr).origin, Gt = 3e4, $n = 5 * 6e4, Bn = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", bt = /* @__PURE__ */ new WeakMap(), jn = (e) => {
4
- let r = bt.get(e);
1
+ import { a as Ar, p as ht, D as Ft, c as qe, d as Er, I as Fr, i as hn, S as mn, N as yn, T as Vr, Z as gn, X as Mr, W as bn, C as vn, r as xn, m as wn, k as _n, U as Ht, V as Jt, h as kn, b as Zt, f as Cn, g as Lr, x as Sn, v as In, w as An, y as En, s as K, u as ee, o as u, e as Ke, j as mt, l as ve, _ as he, n as Ne, q as Ae, t as we, L as Rt, F as Fn, z as Nr, A as Rr, B as Vn, E as Ge, G as Xt, H as re, J as ie, M as Mn, K as Ln, O as Nn, P as Rn, Q as Dr, R as Dn } from "./index-b8dab3ec.js";
2
+ import { isApiErrorWithData as Tn, isSdkError as On, ApiError as Bn } from "@inploi/sdk";
3
+ var jn = "9.8.0", Tr = `https://sdk.inploi.com/@inploi/flows@${jn}/cdn/captcha/index.html`, Pn = new URL(Tr).origin, Yt = 3e4, qn = 5 * 6e4, $n = (e) => typeof e == "object" && e !== null && e.source === "inploi-captcha", kt = /* @__PURE__ */ new WeakMap(), Un = (e) => {
4
+ let r = kt.get(e);
5
5
  return r || (r = e.fetch("/flow/captcha").then((t) => {
6
6
  let n = t == null ? void 0 : t.site_key;
7
7
  return typeof n == "string" && n !== "" ? n : void 0;
8
8
  }).catch((t) => {
9
- throw bt.delete(e), t;
10
- }), bt.set(e, r)), r;
11
- }, Pn = (e, r = {}) => new Promise((t, n) => {
12
- let { signal: s, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r, c = !1, p = () => {
13
- }, g = (S) => {
14
- c || (c = !0, clearTimeout(m), s == null || s.removeEventListener("abort", h), p(), S());
15
- }, b = (S) => g(() => n(new Error(S))), h = () => b("Captcha aborted"), m, w = (S) => {
16
- clearTimeout(m), m = setTimeout(() => b("Captcha timed out"), S);
9
+ throw kt.delete(e), t;
10
+ }), kt.set(e, r)), r;
11
+ }, Wn = (e, r = {}) => new Promise((t, n) => {
12
+ let { signal: s, container: i = null, theme: a, onInteractive: o } = r instanceof AbortSignal ? { signal: r } : r, c = !1, f = () => {
13
+ }, g = (I) => {
14
+ c || (c = !0, clearTimeout(m), s == null || s.removeEventListener("abort", h), f(), I());
15
+ }, b = (I) => g(() => n(new Error(I))), h = () => b("Captcha aborted"), m, k = (I) => {
16
+ clearTimeout(m), m = setTimeout(() => b("Captcha timed out"), I);
17
17
  };
18
- if (w(Gt), s == null ? void 0 : s.aborted)
18
+ if (k(Yt), s == null ? void 0 : s.aborted)
19
19
  return h();
20
20
  s == null || s.addEventListener("abort", h), (async () => {
21
- let S = await jn(e);
22
- if (S === void 0)
21
+ let I = await Un(e);
22
+ if (I === void 0)
23
23
  return g(() => t(void 0));
24
24
  if (c)
25
25
  return;
26
26
  let C = document.createElement("iframe");
27
- C.src = `${Mr}?${new URLSearchParams({ sitekey: S, origin: window.location.origin, ...a && { theme: a } }).toString()}`, C.title = "Cloudflare security check", C.style.cssText = `display:block;border:0;width:${i ? "100%" : "300px"};height:0;color-scheme:normal`, i ? i.appendChild(C) : (C.style.cssText += ";position:fixed;bottom:16px;right:16px;z-index:2147483647", document.body.appendChild(C));
28
- let _ = !1, y = (E) => {
29
- if (!C.contentWindow || E.source !== C.contentWindow || E.origin !== On || !Bn(E.data))
27
+ C.src = `${Tr}?${new URLSearchParams({ sitekey: I, origin: window.location.origin, ...a && { theme: a } }).toString()}`, C.title = "Cloudflare security check", C.style.cssText = `display:block;border:0;width:${i ? "100%" : "300px"};height:0;color-scheme:normal`, i ? i.appendChild(C) : (C.style.cssText += ";position:fixed;bottom:16px;right:16px;z-index:2147483647", document.body.appendChild(C));
28
+ let x = !1, y = (F) => {
29
+ if (!C.contentWindow || F.source !== C.contentWindow || F.origin !== Pn || !$n(F.data))
30
30
  return;
31
- let A = E.data;
32
- switch (A.type) {
31
+ let N = F.data;
32
+ switch (N.type) {
33
33
  case "token":
34
- return g(() => t(A.token));
34
+ return g(() => t(N.token));
35
35
  case "resize":
36
- C.style.height = `${Math.max(0, Math.ceil(A.height))}px`;
36
+ C.style.height = `${Math.max(0, Math.ceil(N.height))}px`;
37
37
  return;
38
38
  case "before-interactive":
39
- return _ = !0, w($n), o == null ? void 0 : o();
39
+ return x = !0, k(qn), o == null ? void 0 : o();
40
40
  case "after-interactive":
41
- return _ = !1, w(Gt);
41
+ return x = !1, k(Yt);
42
42
  case "error":
43
- !_ && !A.interactive && b("Captcha failed");
43
+ !x && !N.interactive && b("Captcha failed");
44
44
  return;
45
45
  case "expired":
46
46
  return b("Captcha expired");
@@ -48,20 +48,20 @@ var Tn = "9.7.0", Mr = `https://sdk.inploi.com/@inploi/flows@${Tn}/cdn/captcha/i
48
48
  return b("Captcha timed out");
49
49
  }
50
50
  };
51
- window.addEventListener("message", y), p = () => {
51
+ window.addEventListener("message", y), f = () => {
52
52
  window.removeEventListener("message", y), C.remove();
53
53
  };
54
- })().catch((S) => g(() => n(S)));
55
- }), Ht = ({ condition: e, context: r, submissions: t, ifBlock: n }) => {
54
+ })().catch((I) => g(() => n(I)));
55
+ }), Qt = ({ condition: e, context: r, submissions: t, ifBlock: n }) => {
56
56
  let [s, ...i] = e.compareKey.split(".");
57
57
  if (!s)
58
58
  return !1;
59
- let a = _r({ context: r, key: s, path: i, submissions: t });
59
+ let a = Ar({ context: r, key: s, path: i, submissions: t });
60
60
  if (!a)
61
61
  return !1;
62
62
  switch (a.type) {
63
63
  case "address": {
64
- let o = Ct(a.value, i);
64
+ let o = Ft(a.value, i);
65
65
  switch (e.compare) {
66
66
  case "equals":
67
67
  return o === e.compareValue;
@@ -77,16 +77,16 @@ var Tn = "9.7.0", Mr = `https://sdk.inploi.com/@inploi/flows@${Tn}/cdn/captcha/i
77
77
  case "integration": {
78
78
  if (typeof a.value != "object" || Array.isArray(a.value))
79
79
  return !1;
80
- let o = Ct(a.value, i), c = { ...n, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
80
+ let o = Ft(a.value, i), c = { ...n, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
81
81
  switch (typeof o) {
82
82
  case "boolean":
83
- return Ze(c, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
83
+ return nt(c, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
84
84
  case "string":
85
- return Ze(c, { submissions: { _temp: { value: o, type: "string" } }, context: r });
85
+ return nt(c, { submissions: { _temp: { value: o, type: "string" } }, context: r });
86
86
  case "number":
87
- return Ze(c, { submissions: { _temp: { value: o, type: "number" } }, context: r });
87
+ return nt(c, { submissions: { _temp: { value: o, type: "number" } }, context: r });
88
88
  case "object":
89
- return Array.isArray(o) && o.every((p) => typeof p == "string") ? Ze(c, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
89
+ return Array.isArray(o) && o.every((f) => typeof f == "string") ? nt(c, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
90
90
  }
91
91
  break;
92
92
  }
@@ -102,7 +102,7 @@ var Tn = "9.7.0", Mr = `https://sdk.inploi.com/@inploi/flows@${Tn}/cdn/captcha/i
102
102
  }
103
103
  case "phone":
104
104
  case "string": {
105
- let o = a.type === "phone" ? ut(a.value) : a.value;
105
+ let o = a.type === "phone" ? ht(a.value) : a.value;
106
106
  switch (e.compare) {
107
107
  case "equals":
108
108
  return o === e.compareValue;
@@ -150,395 +150,414 @@ var Tn = "9.7.0", Mr = `https://sdk.inploi.com/@inploi/flows@${Tn}/cdn/captcha/i
150
150
  }
151
151
  break;
152
152
  }
153
- }, Ze = (e, { context: r, submissions: t }) => {
153
+ }, nt = (e, { context: r, submissions: t }) => {
154
154
  let n = "combinator" in e.data ? e.data.conditions : [e.data];
155
155
  if (("combinator" in e.data ? e.data.combinator : "and") === "or") {
156
156
  for (let s of n)
157
- if (Ht({ condition: s, context: r, submissions: t, ifBlock: e }))
157
+ if (Qt({ condition: s, context: r, submissions: t, ifBlock: e }))
158
158
  return !0;
159
159
  return !1;
160
160
  } else {
161
161
  for (let s of n)
162
- if (!Ht({ condition: s, context: r, submissions: t, ifBlock: e }))
162
+ if (!Qt({ condition: s, context: r, submissions: t, ifBlock: e }))
163
163
  return !1;
164
164
  return !0;
165
165
  }
166
- }, qn = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, Un = (e, { context: r, submissions: t }) => e.replace(qn, (n, s, i = "") => {
167
- let [a, ...o] = s.trim().split("."), c = _r({ key: a, path: o, submissions: t, context: r });
166
+ }, zn = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, Kn = (e, { context: r, submissions: t }) => e.replace(zn, (n, s, i = "") => {
167
+ let [a, ...o] = s.trim().split("."), c = Ar({ key: a, path: o, submissions: t, context: r });
168
168
  if (!c)
169
169
  return i;
170
170
  switch (c.type) {
171
171
  case "boolean":
172
172
  return c.value === !0 ? "true" : "false";
173
173
  case "file":
174
- return c.value.map((p) => `${p.name} (${$e(p.sizeKb)})`).join(", ");
174
+ return c.value.map((f) => `${f.name} (${qe(f.sizeKb)})`).join(", ");
175
175
  case "enum":
176
176
  return c.value.join(", ");
177
177
  case "address":
178
- return Object.values(c.value).filter((p) => p && p.trim().length > 0).join(", ");
178
+ return Object.values(c.value).filter((f) => f && f.trim().length > 0).join(", ");
179
179
  case "number":
180
180
  case "string":
181
181
  return c.value ? c.value.toString() : i;
182
182
  case "phone":
183
- return ut(c.value);
183
+ return ht(c.value);
184
184
  case "integration": {
185
185
  if (typeof c.value != "object" || Array.isArray(c.value))
186
186
  break;
187
- let p = Ct(c.value, o);
188
- switch (typeof p) {
187
+ let f = Ft(c.value, o);
188
+ switch (typeof f) {
189
189
  case "boolean":
190
- return p === !0 ? "true" : "false";
190
+ return f === !0 ? "true" : "false";
191
191
  case "string":
192
- return p;
192
+ return f;
193
193
  case "number":
194
- return p.toString();
194
+ return f.toString();
195
195
  case "object":
196
- if (Array.isArray(p) && p.every((g) => typeof g == "string"))
197
- return p.join(", ");
196
+ if (Array.isArray(f) && f.every((g) => typeof g == "string"))
197
+ return f.join(", ");
198
198
  }
199
199
  break;
200
200
  }
201
201
  }
202
202
  return i;
203
- }), Lr = (e) => {
203
+ }), Or = (e) => {
204
204
  let r = e.find((t) => t.isHead);
205
205
  if (!r)
206
206
  throw new Error("No head node found");
207
207
  return r;
208
- }, Ft = (e) => {
208
+ }, Dt = (e) => {
209
209
  var r, t;
210
210
  if (!(e.data.isFinished || (r = e.data.startedWriteNodeIds) != null && r.length))
211
211
  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;
212
- }, Nr = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), fe = (e, r) => Un(e, Nr(r)), Wn = (e, r) => Ze(e, Nr(r)), Rr = ({ node: e, nodes: r, stopWhen: t }) => {
212
+ }, Vt = (e) => Array.isArray(e) ? e.map(Vt) : e !== null && typeof e == "object" ? Object.fromEntries(Object.entries(e).sort(([r], [t]) => r.localeCompare(t)).map(([r, t]) => [r, Vt(t)])) : typeof e == "function" ? void 0 : e;
213
+ async function Gn(e, r, t, n) {
214
+ var s;
215
+ let i = new TextEncoder().encode(JSON.stringify(Vt(t))), a = await crypto.subtle.digest("SHA-256", i);
216
+ if (n != null && n.aborted)
217
+ return;
218
+ let o = Array.from(new Uint8Array(a), (b) => b.toString(16).padStart(2, "0")).join(""), c = (s = e.data).preApplyFingerprints ?? (s.preApplyFingerprints = []);
219
+ if (c.includes(o))
220
+ return;
221
+ c.push(o);
222
+ let f = new AbortController(), g = setTimeout(() => f.abort(), 5e3);
223
+ r.fetch("/flow/pre-apply", { method: "POST", signal: f.signal, body: JSON.stringify(t) }).catch(() => {
224
+ let b = c.indexOf(o);
225
+ b !== -1 && c.splice(b, 1);
226
+ }).finally(() => {
227
+ clearTimeout(g);
228
+ });
229
+ }
230
+ var Br = ({ context: e, submissions: r }) => ({ context: e, submissions: r ?? {} }), fe = (e, r) => Kn(e, Br(r)), Hn = (e, r) => nt(e, Br(r)), jr = ({ node: e, nodes: r, stopWhen: t }) => {
213
231
  if ((t == null ? void 0 : t(e)) === !0)
214
232
  return e;
215
233
  let n = e.nextId ? r.find((s) => s.id === e.nextId) : void 0;
216
234
  if (n)
217
- return Rr({ node: n, nodes: r, stopWhen: t });
218
- }, zn = ({ childNode: e, nodes: r }) => {
235
+ return jr({ node: n, nodes: r, stopWhen: t });
236
+ }, Jn = ({ childNode: e, nodes: r }) => {
219
237
  let t = r.filter((n) => n.type === "if-block").find((n) => {
220
238
  if (!n.branchId)
221
239
  return !1;
222
240
  let s = r.find((a) => a.id === n.branchId);
223
241
  if (!s)
224
242
  return !1;
225
- let i = Rr({ node: s, nodes: r, stopWhen: (a) => a.id === e.id });
243
+ let i = jr({ node: s, nodes: r, stopWhen: (a) => a.id === e.id });
226
244
  return !(!i || i.id !== e.id);
227
245
  });
228
246
  if (t != null && t.nextId)
229
247
  return r.find((n) => n.id === t.nextId);
230
- }, Kn = 3, Gn = ({ flow: e, analytics: r, logger: t, talentBankClient: n, context: s, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: c, chatService: p, persistWriteBarrier: g, onFlowEnd: b, onInterpret: h, t: m }) => {
231
- var w;
232
- let S = new AbortController();
233
- (w = e.data).startedWriteNodeIds ?? (w.startedWriteNodeIds = e.nodes.flatMap((y) => {
234
- var A, V;
235
- if (y.type !== "integration-application-submit" || !e.data.nodeHistory.includes(y.id))
248
+ }, Zn = 3, Xn = ({ flow: e, analytics: r, logger: t, talentBankClient: n, context: s, apiClient: i, getSubmissions: a, getApplicationRecovery: o, setApplicationRecovery: c, chatService: f, persistWriteBarrier: g, onSubmitNetworkError: b, closedRoleBehaviour: h, dateEchoLocale: m, onFlowEnd: k, onInterpret: I, forceSubmitConfirmation: C, t: x }) => {
249
+ var y;
250
+ let F = new AbortController(), N = { submitAccepted: !1 };
251
+ (y = e.data).startedWriteNodeIds ?? (y.startedWriteNodeIds = e.nodes.flatMap((R) => {
252
+ var q, P;
253
+ if (R.type !== "integration-application-submit" || !e.data.nodeHistory.includes(R.id))
236
254
  return [];
237
- let E = y.data.key ? (A = a()) == null ? void 0 : A[y.data.key] : void 0;
238
- return (E == null ? void 0 : E.type) === "integration" && ((V = kr(E.value)) == null ? void 0 : V.verdict) === "not_submitted" ? [] : [y.id];
255
+ let O = R.data.key ? (q = a()) == null ? void 0 : q[R.data.key] : void 0;
256
+ return (O == null ? void 0 : O.type) === "integration" && ((P = Er(O.value)) == null ? void 0 : P.verdict) === "not_submitted" ? [] : [R.id];
239
257
  }));
240
- let C = { ...r.service, log: (y) => r.service.log({ ...y, customProperties: { ...y.customProperties, ...r.customProperties } }) }, _ = async (y, E) => {
241
- let A = S.signal;
242
- if (A.aborted)
258
+ let V = { ...r.service, log: (R) => r.service.log({ ...R, customProperties: { ...R.customProperties, ...r.customProperties } }) }, T = async (R, O) => {
259
+ let q = F.signal;
260
+ if (q.aborted)
243
261
  return;
244
- let V = a(), L = o(), U = (L == null ? void 0 : L.submitNodeId) === y.id ? e.nodes.find((T) => {
245
- var q;
246
- return T.id === L.fileQuestionNodeId && T.type === "question-file" && ((q = V == null ? void 0 : V[T.data.key]) == null ? void 0 : q.type) !== "file";
262
+ let P = a(), H = o(), M = (H == null ? void 0 : H.submitNodeId) === R.id ? e.nodes.find((A) => {
263
+ var B;
264
+ return A.id === H.fileQuestionNodeId && A.type === "question-file" && ((B = P == null ? void 0 : P[A.data.key]) == null ? void 0 : B.type) !== "file";
247
265
  }) : void 0;
248
- if (U)
249
- return _(U, E);
250
- h == null || h(y, E);
266
+ if (M)
267
+ return T(M, O);
268
+ I == null || I(R, O);
251
269
  try {
252
- await Hn({ flow: e, analytics: C, logger: t, talentBankClient: n, apiClient: i, context: s, node: y, submissions: V, applicationRecovery: L, setApplicationRecovery: async (T) => {
253
- if (!A.aborted)
270
+ await Yn({ flow: e, analytics: V, logger: t, talentBankClient: n, apiClient: i, context: s, node: R, submissions: P, applicationRecovery: H, setApplicationRecovery: async (A) => {
271
+ if (!q.aborted)
254
272
  try {
255
- await c(T);
256
- } catch (q) {
257
- t.error("Failed to persist application recovery", q);
273
+ await c(A);
274
+ } catch (B) {
275
+ t.error("Failed to persist application recovery", B);
258
276
  }
259
- }, forceSubmitConfirmation: (L == null ? void 0 : L.submitNodeId) === y.id, persistWriteBarrier: g, signal: A, t: m, chat: { sendMessage: async (T) => p.send({ groupId: y.id, message: T, signal: A }), userInput: async (T) => p.input({ input: T, signal: A }), setSubmission: (T, q) => {
260
- A.aborted || p.setSubmission(T, q);
261
- }, captcha: p.captcha }, next: (T) => {
262
- if (A.aborted)
277
+ }, forceSubmitConfirmation: C || (H == null ? void 0 : H.submitNodeId) === R.id, run: N, persistWriteBarrier: g, onSubmitNetworkError: b, closedRoleBehaviour: h, dateEchoLocale: m, signal: q, t: x, chat: { sendMessage: async (A) => f.send({ groupId: R.id, message: A, signal: q }), userInput: async (A) => f.input({ input: A, signal: q }), setSubmission: (A, B) => {
278
+ q.aborted || f.setSubmission(A, B);
279
+ }, captcha: f.captcha }, next: (A) => {
280
+ if (q.aborted)
263
281
  return;
264
- let q = (L == null ? void 0 : L.fileQuestionNodeId) === y.id ? L.submitNodeId : T, O = q ? e.nodes.find((J) => J.id === q) : zn({ childNode: y, nodes: e.nodes });
265
- return O ? _(O, y) : b == null ? void 0 : b(y);
282
+ let B = (H == null ? void 0 : H.fileQuestionNodeId) === R.id ? H.submitNodeId : A, $ = B ? e.nodes.find((U) => U.id === B) : Jn({ childNode: R, nodes: e.nodes });
283
+ return $ ? T($, R) : k == null ? void 0 : k(R);
266
284
  }, end: () => {
267
- A.aborted || (b == null || b(y));
285
+ q.aborted || (k == null || k(R));
268
286
  } });
269
- } catch (T) {
270
- if (T instanceof Cr)
287
+ } catch (A) {
288
+ if (A instanceof Fr)
271
289
  return;
272
- throw T;
290
+ throw A;
273
291
  }
274
292
  };
275
- return { interpret: async (y) => {
276
- let E = e.nodes.find((A) => A.id === y) ?? Lr(e.nodes);
277
- return _(E);
278
- }, undo: (y) => {
279
- var q;
280
- if ((q = e.data.startedWriteNodeIds) != null && q.length || e.data.isFinished)
293
+ return { interpret: async (R) => {
294
+ let O = e.nodes.find((q) => q.id === R) ?? Or(e.nodes);
295
+ return T(O);
296
+ }, undo: (R) => {
297
+ var B;
298
+ if (delete e.data.reviewReplay, ((B = e.data.startedWriteNodeIds) == null ? void 0 : B.length) || e.data.isFinished)
281
299
  return { removed: 0 };
282
- let E = Ft(e), A = E ? y.lastIndexOf(E) : -1, V = e.nodes.find((O) => O.id === E);
283
- if (A === -1 || !V)
300
+ let O = Dt(e), q = O ? R.lastIndexOf(O) : -1, P = e.nodes.find(($) => $.id === O);
301
+ if (q === -1 || !P)
284
302
  return { removed: 0 };
285
- let L = e.nodes.find((O) => O.id === y[y.length - 1]);
286
- S.abort();
287
- let U = y.splice(A);
288
- e.data.messages = e.data.messages.filter((O) => !O.groupId || !U.includes(O.groupId)), e.data.currentInput = null;
289
- let T = a();
290
- for (let O of U.slice(1)) {
291
- let J = e.nodes.find((N) => N.id === O);
292
- if (!(!J || !T || J.id === E) && ("key" in J.data && J.data.key && delete T[J.data.key], "keys" in J.data))
293
- for (let N of Object.values(J.data.keys))
294
- typeof N == "string" && delete T[N];
295
- }
296
- return S = new AbortController(), _(V, L), { removed: U.length };
303
+ let H = e.nodes.find(($) => $.id === R[R.length - 1]);
304
+ F.abort();
305
+ let M = R.splice(q);
306
+ e.data.messages = e.data.messages.filter(($) => !$.groupId || !M.includes($.groupId)), e.data.currentInput = null;
307
+ let A = a();
308
+ for (let $ of M.slice(1)) {
309
+ let U = e.nodes.find((j) => j.id === $);
310
+ if (!(!U || !A || U.id === O) && ("key" in U.data && U.data.key && delete A[U.data.key], "keys" in U.data))
311
+ for (let j of Object.values(U.data.keys))
312
+ typeof j == "string" && delete A[j];
313
+ }
314
+ return F = new AbortController(), T(P, H), { removed: M.length };
297
315
  }, abort: () => {
298
- S.abort();
316
+ F.abort();
299
317
  } };
300
318
  };
301
- async function Hn(e) {
319
+ async function Yn(e) {
302
320
  let r = e.node;
303
321
  switch (r.type) {
304
322
  case "flow-section":
305
323
  return await e.chat.sendMessage({ type: "system", variant: "info", text: r.data.title }), e.next(r.nextId);
306
324
  case "pre-apply-result":
307
- return ps({ ...e, node: r });
325
+ return bs({ ...e, node: r });
308
326
  case "text":
309
- return ss({ ...e, node: r });
327
+ return ls({ ...e, node: r });
310
328
  case "image":
311
- return as({ ...e, node: r });
329
+ return us({ ...e, node: r });
312
330
  case "question-text":
313
- return is({ ...e, node: r });
331
+ return cs({ ...e, node: r });
314
332
  case "question-enum":
315
- return us({ ...e, node: r });
333
+ return ps({ ...e, node: r });
316
334
  case "question-number":
317
- return os({ ...e, node: r });
335
+ return ds({ ...e, node: r });
318
336
  case "question-phone":
319
- return ls({ ...e, node: r });
337
+ return fs({ ...e, node: r });
320
338
  case "question-boolean":
321
- return cs({ ...e, node: r });
339
+ return hs({ ...e, node: r });
322
340
  case "question-file":
323
- return fs({ ...e, node: r });
341
+ return ys({ ...e, node: r });
324
342
  case "question-address":
325
- return ds({ ...e, node: r });
343
+ return ms({ ...e, node: r });
326
344
  case "end-flow":
327
- return hs({ ...e, node: r });
345
+ return gs({ ...e, node: r });
328
346
  case "if-block":
329
- return ns({ ...e, node: r });
347
+ return os({ ...e, node: r });
330
348
  case "jump":
331
- return Zn({ ...e, node: r });
349
+ return ts({ ...e, node: r });
332
350
  case "link":
333
- return rs({ ...e, node: r });
351
+ return is({ ...e, node: r });
334
352
  case "integration-application-submit":
335
- return ts({ ...e, node: r });
353
+ return as({ ...e, node: r });
336
354
  case "add-submission":
337
- return Yn({ ...e, node: r });
355
+ return rs({ ...e, node: r });
338
356
  case "integration-workflow-get":
339
357
  throw Error("Workflow should be unreachable");
340
358
  case "check-duplicate":
341
- return Xn({ ...e, node: r });
359
+ return es({ ...e, node: r });
342
360
  case "feedback":
343
- return Jn({ ...e, node: r });
361
+ return Qn({ ...e, node: r });
344
362
  default:
345
363
  throw new Error(`Unknown node: ${JSON.stringify(r)}`);
346
364
  }
347
365
  }
348
- async function Jn({ next: e, node: r }) {
366
+ async function Qn({ next: e, node: r }) {
349
367
  e(r.nextId);
350
368
  }
351
- async function Xn({ next: e, node: r, talentBankClient: t, submissions: n, flow: s, logger: i, chat: a }) {
369
+ async function es({ next: e, node: r, talentBankClient: t, submissions: n, flow: s, logger: i, chat: a }) {
352
370
  var c;
353
371
  let o = { isDuplicate: !1 };
354
372
  if (n && t) {
355
- let p = r.data.scope === "job" ? (c = s.job) == null ? void 0 : c.id : void 0;
356
- if (r.data.scope === "company" || p != null)
373
+ let f = r.data.scope === "job" ? (c = s.job) == null ? void 0 : c.id : void 0;
374
+ if (r.data.scope === "company" || f != null)
357
375
  try {
358
- o = await t.checkDuplicate({ email: fn({ key: r.data.email, submissions: n }).toString(), jobId: p, scope: r.data.scope });
376
+ o = await t.checkDuplicate({ email: hn({ key: r.data.email, submissions: n }).toString(), jobId: f, scope: r.data.scope });
359
377
  } catch (g) {
360
378
  i.error("[check-duplicate]", g);
361
379
  }
362
380
  }
363
381
  a.setSubmission(r.data.key, { type: "integration", value: o }), e(r.nextId);
364
382
  }
365
- async function Zn({ next: e, node: r }) {
383
+ async function ts({ next: e, node: r }) {
366
384
  e(r.data.targetId);
367
385
  }
368
- async function Yn({ next: e, node: r, logger: t, submissions: n, context: s }) {
386
+ async function rs({ next: e, node: r, logger: t, submissions: n, context: s }) {
369
387
  if (!n) {
370
388
  t.error("Submissions not found");
371
389
  return;
372
390
  }
373
391
  n[r.data.key] = { type: "string", value: fe(r.data.value, { submissions: n, context: s }) }, e(r.nextId);
374
392
  }
375
- var Qn = 5e3, es = (e, r, t) => {
376
- let { waitMs: n, throttles: s, maintenance: i } = In(r == null ? void 0 : r.throttles, t);
393
+ var ns = 5e3, ss = (e, r, t) => {
394
+ let { waitMs: n, throttles: s, maintenance: i } = En(r == null ? void 0 : r.throttles, t);
377
395
  return { key: e, until: Date.now() + n, ...s !== void 0 && { throttles: s }, ...i && { maintenance: i } };
378
396
  };
379
- async function ts({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i, submissions: a, analytics: o, flow: c, applicationRecovery: p, setApplicationRecovery: g, forceSubmitConfirmation: b, persistWriteBarrier: h, signal: m, t: w }) {
380
- var y;
381
- if ((y = c.data.startedWriteNodeIds) != null && y.includes(n.id) && (p == null ? void 0 : p.submitNodeId) !== n.id)
382
- return await e.sendMessage({ type: "system", variant: "warning", text: w("submission_unknown") }), t();
383
- let S = c.job ? `${n.id}@${c.job.id_type}:${c.job.id}` : n.id, C = 0, _ = async (E) => {
384
- var nt, ze, st, Ke, at, De, Ge;
385
- let A = ((nt = c.data.submitCooldown) == null ? void 0 : nt.key) === S ? c.data.submitCooldown : void 0;
386
- A && (A.until = Math.min(A.until, Date.now() + (A.maintenance ? pn : A.throttles ? Ir : mn)));
387
- let V = A == null ? void 0 : A.until;
388
- (E !== !0 || V !== void 0 && V > Date.now()) && await e.userInput({ type: "submit", key: void 0, config: { label: n.data.submitLabel, ...V !== void 0 && { availableAt: V } } });
389
- let L;
397
+ async function as({ chat: e, next: r, end: t, node: n, logger: s, apiClient: i, submissions: a, analytics: o, flow: c, applicationRecovery: f, setApplicationRecovery: g, forceSubmitConfirmation: b, run: h, persistWriteBarrier: m, signal: k, onSubmitNetworkError: I, closedRoleBehaviour: C, t: x }) {
398
+ var T;
399
+ if ((T = c.data.startedWriteNodeIds) != null && T.includes(n.id) && (f == null ? void 0 : f.submitNodeId) !== n.id)
400
+ return await e.sendMessage({ type: "system", variant: "warning", text: x("submission_unknown") }), t();
401
+ let y = c.job ? `${n.id}@${c.job.id_type}:${c.job.id}` : n.id, F = 0, N = h.submitAccepted && n.data.skipConfirmation === !0 && (f == null ? void 0 : f.submitNodeId) !== n.id, V = async (R) => {
402
+ var Te, Ye, Oe, Be, ut, Qe, ct;
403
+ let O = ((Te = c.data.submitCooldown) == null ? void 0 : Te.key) === y ? c.data.submitCooldown : void 0;
404
+ O && (O.until = Math.min(O.until, Date.now() + (O.maintenance ? gn : O.throttles ? Mr : bn)));
405
+ let q = O == null ? void 0 : O.until;
406
+ (c.data.reviewRequiresSend === !0 && !N || R !== !0 || q !== void 0 && q > Date.now()) && await e.userInput({ type: "submit", key: void 0, config: { label: n.data.submitLabel, ...q !== void 0 && { availableAt: q } } }), N = !1;
407
+ let P;
390
408
  if (n.data.captcha) {
391
- let D = e.captcha, ke = !0;
409
+ let L = e.captcha, Ve = !0;
392
410
  try {
393
- L = await Pn(i, { signal: m, container: (D == null ? void 0 : D.container()) ?? null, theme: D == null ? void 0 : D.theme, onInteractive: () => {
394
- e.sendMessage({ type: "text", author: "bot", text: w("captcha_check") }).catch(() => {
411
+ P = await Wn(i, { signal: k, container: (L == null ? void 0 : L.container()) ?? null, theme: L == null ? void 0 : L.theme, onInteractive: () => {
412
+ e.sendMessage({ type: "text", author: "bot", text: x("captcha_check") }).catch(() => {
395
413
  }).then(() => {
396
- ke && (D == null || D.reveal(!0));
414
+ Ve && (L == null || L.reveal(!0));
397
415
  });
398
416
  } });
399
- } catch (He) {
400
- if (s.error("Captcha check failed", He), m.aborted)
417
+ } catch (et) {
418
+ if (s.error("Captcha check failed", et), k.aborted)
401
419
  return;
402
420
  } finally {
403
- ke = !1, D == null || D.reveal(!1);
421
+ Ve = !1, L == null || L.reveal(!1);
404
422
  }
405
423
  }
406
- await e.sendMessage({ type: "loading", text: w("submitting") });
407
- let { anonymous_id: U, session_id: T } = o.getSessionInfo();
408
- if (m.aborted)
424
+ await e.sendMessage({ type: "loading", text: x("submitting") });
425
+ let { anonymous_id: H, session_id: M } = o.getSessionInfo();
426
+ if (k.aborted)
409
427
  return;
410
- let q = ((ze = c.data.startedWriteNodeIds) == null ? void 0 : ze.includes(n.id)) === !0;
411
- if ((p == null ? void 0 : p.submitNodeId) === n.id && await g(void 0), q || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], n.id]), await h().catch((D) => s.error("Failed to persist application write barrier", D)), m.aborted)
428
+ let A = ((Ye = c.data.startedWriteNodeIds) == null ? void 0 : Ye.includes(n.id)) === !0;
429
+ if ((f == null ? void 0 : f.submitNodeId) === n.id && await g(void 0), A || (c.data.startedWriteNodeIds = [...c.data.startedWriteNodeIds ?? [], n.id]), await m().catch((L) => s.error("Failed to persist application write barrier", L)), k.aborted)
412
430
  return;
413
- let O, J = setTimeout(() => {
414
- O = (async () => {
415
- await e.sendMessage({ type: "text", author: "bot", text: w("submission_still_working") }), await e.sendMessage({ type: "loading", text: w("submitting") });
416
- })().catch((D) => s.error("Failed to send submission progress message", D));
417
- }, Qn), N, R = await i.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: n.data.integrationId, anonymous_id: U, session_id: T, job: c.job, flow_build: c.build, ...L !== void 0 && { captcha_token: L }, submissions: yn(c.nodes, gn(a || {}, n.data.submitKeys)), pre_apply: Sr(c.nodes, a || {}, c.data.flowSessionId) }) }).catch((D) => (N = D, Rn(D) ? D.data : D));
418
- if (clearTimeout(J), await O, m.aborted)
431
+ let B, $ = setTimeout(() => {
432
+ B = (async () => {
433
+ await e.sendMessage({ type: "text", author: "bot", text: x("submission_still_working") }), await e.sendMessage({ type: "loading", text: x("submitting") });
434
+ })().catch((L) => s.error("Failed to send submission progress message", L));
435
+ }, ns), U, j = await i.fetch("/flow/submit", { method: "POST", body: JSON.stringify({ log_submit: !1, integration_id: n.data.integrationId, anonymous_id: H, session_id: M, job: c.job, flow_build: c.build, ...P !== void 0 && { captcha_token: P }, submissions: vn(c.nodes, xn(a || {}, n.data.submitKeys)), pre_apply: Vr(c.nodes, a || {}, c.data.flowSessionId) }) }).catch((L) => (U = L, Tn(L) ? L.data : L));
436
+ if (clearTimeout($), await B, k.aborted)
419
437
  return;
420
- n.data.key && e.setSubmission(n.data.key, { type: "integration", value: R });
421
- let M = kr(R, N instanceof Dn ? N.status : void 0), z = c.data.failedAttemptAt, X = z == null ? void 0 : z[S];
422
- z && X !== void 0 && X > Date.now() && (X = z[S] = Date.now());
423
- let Z = X !== void 0 && Date.now() - X < bn || ((st = c.data.unconfirmedAttemptKeys) == null ? void 0 : st.includes(S)) === !0, oe = vn(R);
424
- if (oe && 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: oe.service, response: oe.response, flow_type: "CHATBOT_DRAWER", job: c.job, ...(M == null ? void 0 : M.outcome) === "duplicate" && { outcome: Z ? "duplicate_after_own_attempt" : "duplicate" }, ...oe.outcome && { outcome: oe.outcome } } }), (Wt(R) || (R == null ? void 0 : R.success) === !0) && ((Ke = c.data.submitCooldown) == null ? void 0 : Ke.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await h().catch((D) => s.error("Failed to persist submit cooldown reset", D))), Wt(R)) {
425
- let { redirect_url: D, message: ke, button_text: He } = R.integration_response.data;
426
- await e.sendMessage({ type: "text", author: "bot", text: ke ?? w("submission_redirect_message") });
438
+ if (U !== void 0 && !On(U) && I)
439
+ return await I(U, k), V(!0);
440
+ n.data.key && e.setSubmission(n.data.key, { type: "integration", value: j });
441
+ let D = Er(j, U instanceof Bn ? U.status : void 0), le = c.data.failedAttemptAt, ue = le == null ? void 0 : le[y];
442
+ le && ue !== void 0 && ue > Date.now() && (ue = le[y] = Date.now());
443
+ let Je = ue !== void 0 && Date.now() - ue < wn || ((Oe = c.data.unconfirmedAttemptKeys) == null ? void 0 : Oe.includes(y)) === !0, _e = _n(j);
444
+ _e && 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: _e.service, response: _e.response, flow_type: "CHATBOT_DRAWER", job: c.job, ...(D == null ? void 0 : D.outcome) === "duplicate" && { outcome: Je ? "duplicate_after_own_attempt" : "duplicate" }, ..._e.outcome && { outcome: _e.outcome } } });
445
+ let lt = Ht(j) || (j == null ? void 0 : j.success) === !0;
446
+ if ((lt || Jt(j)) && (h.submitAccepted = !0), lt && ((Be = c.data.submitCooldown) == null ? void 0 : Be.throttles) !== void 0 && (delete c.data.submitCooldown.throttles, await m().catch((L) => s.error("Failed to persist submit cooldown reset", L))), Ht(j)) {
447
+ let { redirect_url: L, message: Ve, button_text: et } = j.integration_response.data;
448
+ await e.sendMessage({ type: "text", author: "bot", text: Ve ?? x("submission_redirect_message") });
427
449
  try {
428
- let me = new URL(D);
429
- U && !me.searchParams.has("anonymous_id") && me.searchParams.set("anonymous_id", U), await e.sendMessage({ type: "link", href: me.toString(), text: He ?? w("complete_submission"), onClick: () => {
430
- if (!T) {
450
+ let ke = new URL(L);
451
+ H && !ke.searchParams.has("anonymous_id") && ke.searchParams.set("anonymous_id", H), await e.sendMessage({ type: "link", href: ke.toString(), text: et ?? x("complete_submission"), onClick: () => {
452
+ if (!M) {
431
453
  s.error("session_id not set, cannot log FLOW_REDIRECT event");
432
454
  return;
433
455
  }
434
- o.log({ event: "FLOW_REDIRECT", properties: { flow_build: c.build, flow_id: c.id, flow_session_id: T, flow_version: c.version, href: me.toString(), job: c.job } });
456
+ o.log({ event: "FLOW_REDIRECT", properties: { flow_build: c.build, flow_id: c.id, flow_session_id: M, flow_version: c.version, href: ke.toString(), job: c.job } });
435
457
  } });
436
- } catch (me) {
437
- s.error(`Invalid redirect URL: ${D}`, me), e.sendMessage({ type: "system", variant: "error", text: w("redirect_url_error") });
458
+ } catch (ke) {
459
+ s.error(`Invalid redirect URL: ${L}`, ke), e.sendMessage({ type: "system", variant: "error", text: x("redirect_url_error") });
438
460
  }
439
461
  return r(n.nextId);
440
462
  }
441
- let _e = xn(R);
442
- if (_e)
443
- return await e.sendMessage({ type: "system", variant: "success", text: _e.message ?? w("submission_pending") }), r(n.nextId);
444
- if ((R == null ? void 0 : R.success) === !0)
445
- return n.data.skipConfirmation !== !0 && await e.sendMessage({ type: "system", variant: "success", text: w("submission_completed") }), r(n.nextId);
446
- let pe = wn(M), Fe = pe !== void 0 && ((at = a == null ? void 0 : a[pe]) == null ? void 0 : at.type) === "file" ? pe : void 0, Ve = Fe === void 0 ? void 0 : c.nodes.find((D) => D.type === "question-file" && D.data.key === Fe);
447
- if (!Ve && !zt(M) && (c.data.submitCooldown = es(S, A, M)), (M == null ? void 0 : M.outcome) !== "duplicate" && (c.data.failedAttemptAt = { ...c.data.failedAttemptAt, [S]: Date.now() }, (De = c.data.unconfirmedAttemptKeys) != null && De.includes(S) && (c.data.unconfirmedAttemptKeys = c.data.unconfirmedAttemptKeys.filter((D) => D !== S))), (M == null ? void 0 : M.verdict) === "not_submitted" || (M == null ? void 0 : M.outcome) === "duplicate" || (M == null ? void 0 : M.outcome) === "closed" ? (q || (c.data.startedWriteNodeIds = (Ge = c.data.startedWriteNodeIds) == null ? void 0 : Ge.filter((D) => D !== n.id)), (p == null ? void 0 : p.submitNodeId) === n.id && await g(p), await h().catch((D) => s.error("Failed to persist application write barrier release", D))) : await h().catch((D) => s.error("Failed to persist submit cooldown", D)), M) {
448
- if (s.error(N ?? M.message), Ve && Fe !== void 0)
449
- return e.setSubmission(Fe, null), await g({ fileQuestionNodeId: Ve.id, submitNodeId: n.id }), await e.sendMessage({ type: "system", variant: "error", text: w("submission_unreadable_document") }), r(Ve.id);
450
- if (M.outcome === "duplicate")
451
- return await e.sendMessage({ type: "system", variant: "info", text: w(Z ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), _(!1);
452
- if (M.outcome === "closed")
453
- return await e.sendMessage({ type: "system", variant: "info", text: w("submission_closed") }), _(!1);
454
- let D = _n(M);
455
- return D ? (await e.sendMessage({ type: "system", variant: "warning", text: D.until === void 0 ? w("submission_provider_maintenance_later") : w("submission_provider_maintenance", { time: Ar(D.until, void 0) }) }), _(!1)) : M.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: w(kn(M) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), _(!1)) : zt(M) ? Cn(R) ? (await e.sendMessage({ type: "text", author: "bot", text: M.message }), _(!1)) : (C === 0 && await e.sendMessage({ type: "system", variant: "warning", text: w("captcha_failed") }), C++, _(C <= Kn)) : Sn(M) ? (await e.sendMessage({ type: "system", variant: "error", text: w("submission_retryable") }), _(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: w("submission_failed") }), t());
456
- }
457
- return s.error(N ?? R), await e.sendMessage({ type: "system", variant: "error", text: w("submission_failed") }), t();
463
+ let Ze = Jt(j);
464
+ if (Ze)
465
+ return await e.sendMessage({ type: "system", variant: "success", text: Ze.message ?? x("submission_pending") }), r(n.nextId);
466
+ if ((j == null ? void 0 : j.success) === !0)
467
+ return n.data.skipConfirmation !== !0 && await e.sendMessage({ type: "system", variant: "success", text: x("submission_completed") }), r(n.nextId);
468
+ let Xe = kn(D), Fe = Xe !== void 0 && ((ut = a == null ? void 0 : a[Xe]) == null ? void 0 : ut.type) === "file" ? Xe : void 0, De = Fe === void 0 ? void 0 : c.nodes.find((L) => L.type === "question-file" && L.data.key === Fe);
469
+ if (!De && !(C === "terminal" && (D == null ? void 0 : D.outcome) === "closed") && !Zt(D) && (c.data.submitCooldown = ss(y, O, D)), (D == null ? void 0 : D.outcome) !== "duplicate" && (c.data.failedAttemptAt = { ...c.data.failedAttemptAt, [y]: Date.now() }, (Qe = c.data.unconfirmedAttemptKeys) != null && Qe.includes(y) && (c.data.unconfirmedAttemptKeys = c.data.unconfirmedAttemptKeys.filter((L) => L !== y))), (D == null ? void 0 : D.verdict) === "not_submitted" || (D == null ? void 0 : D.outcome) === "duplicate" || (D == null ? void 0 : D.outcome) === "closed" ? (A || (c.data.startedWriteNodeIds = (ct = c.data.startedWriteNodeIds) == null ? void 0 : ct.filter((L) => L !== n.id)), (f == null ? void 0 : f.submitNodeId) === n.id && await g(f), await m().catch((L) => s.error("Failed to persist application write barrier release", L))) : await m().catch((L) => s.error("Failed to persist submit cooldown", L)), D) {
470
+ if (s.error(U ?? D.message), De && Fe !== void 0)
471
+ return e.setSubmission(Fe, null), await g({ fileQuestionNodeId: De.id, submitNodeId: n.id }), await e.sendMessage({ type: "system", variant: "error", text: x("submission_unreadable_document") }), r(De.id);
472
+ if (D.outcome === "duplicate")
473
+ return await e.sendMessage({ type: "system", variant: "info", text: x(Je ? "submission_duplicate_earlier_attempt" : "submission_duplicate") }), V(!1);
474
+ if (D.outcome === "closed")
475
+ return await e.sendMessage({ type: "system", variant: "info", text: x("submission_closed") }), C === "terminal" ? (delete c.data.submitCooldown, t()) : V(!1);
476
+ let L = Cn(D);
477
+ return L ? (await e.sendMessage({ type: "system", variant: "warning", text: L.until === void 0 ? x("submission_provider_maintenance_later") : x("submission_provider_maintenance", { time: Lr(L.until, void 0) }) }), V(!1)) : D.outcome === "unknown" ? (await e.sendMessage({ type: "system", variant: "warning", text: x(Sn(D) ? "submission_unknown_do_not_resubmit" : "submission_unknown") }), V(!1)) : Zt(D) ? In(j) ? (await e.sendMessage({ type: "text", author: "bot", text: D.message }), V(!1)) : (F === 0 && await e.sendMessage({ type: "system", variant: "warning", text: x("captcha_failed") }), F++, V(F <= Zn)) : An(D) ? (await e.sendMessage({ type: "system", variant: "error", text: x("submission_retryable") }), V(!1)) : (await e.sendMessage({ type: "system", variant: "error", text: x("submission_failed") }), t());
478
+ }
479
+ return s.error(U ?? j), await e.sendMessage({ type: "system", variant: "error", text: x("submission_failed") }), t();
458
480
  };
459
- await _(b === !0 ? !1 : n.data.skipConfirmation);
481
+ await V(b === !0 && !N ? !1 : n.data.skipConfirmation);
460
482
  }
461
- async function rs({ chat: e, next: r, node: t, submissions: n, context: s }) {
483
+ async function is({ chat: e, next: r, node: t, submissions: n, context: s }) {
462
484
  await e.sendMessage({ type: "link", href: fe(t.data.href, { submissions: n, context: s }), text: fe(t.data.cta, { submissions: n, context: s }) }), r(t.nextId);
463
485
  }
464
- async function ns({ submissions: e, next: r, node: t, context: n }) {
465
- r(Wn(t, { submissions: e, context: n }) ? t.branchId : t.nextId);
486
+ async function os({ submissions: e, next: r, node: t, context: n }) {
487
+ r(Hn(t, { submissions: e, context: n }) ? t.branchId : t.nextId);
466
488
  }
467
- async function ss({ chat: e, next: r, node: t, submissions: n, context: s }) {
489
+ async function ls({ chat: e, next: r, node: t, submissions: n, context: s }) {
468
490
  await e.sendMessage({ author: "bot", type: "text", text: fe(t.data.text, { submissions: n, context: s }) }), r(t.nextId);
469
491
  }
470
- async function as({ chat: e, next: r, node: t }) {
492
+ async function us({ chat: e, next: r, node: t }) {
471
493
  await e.sendMessage({ author: "bot", type: "image", url: t.data.url, height: t.data.height, width: t.data.width }), r(t.nextId);
472
494
  }
473
- async function is({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
495
+ async function cs({ chat: e, next: r, node: t, submissions: n, context: s, t: i, dateEchoLocale: a }) {
474
496
  await e.sendMessage({ author: "bot", type: "text", text: fe(t.data.question, { submissions: n, context: s }) });
475
- let a = t.data.format === "phone" ? await e.userInput({ key: t.data.key, type: "phone", config: { optional: t.data.optional, placeholder: t.data.placeholder, minChars: t.data.minChars, maxChars: t.data.maxChars, submissionFormat: "text", defaultValue: {} } }) : await e.userInput({ key: t.data.key, type: "text", config: { optional: t.data.optional, placeholder: t.data.placeholder, format: t.data.format, maxChars: t.data.maxChars, minChars: t.data.minChars, multiline: t.data.format === "text" && t.data.multiline === !0 } });
476
- a === null ? await e.sendMessage({ type: "system", variant: "info", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.type === "phone" ? ut(a.value) : a.value }), r(t.nextId);
497
+ let o = t.data.format === "phone" ? await e.userInput({ key: t.data.key, type: "phone", config: { optional: t.data.optional, placeholder: t.data.placeholder, minChars: t.data.minChars, maxChars: t.data.maxChars, submissionFormat: "text", defaultValue: {} } }) : await e.userInput({ key: t.data.key, type: "text", config: { optional: t.data.optional, placeholder: t.data.placeholder, format: t.data.format, maxChars: t.data.maxChars, minChars: t.data.minChars, multiline: t.data.format === "text" && t.data.multiline === !0 } });
498
+ o === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: o.type === "phone" ? ht(o.value) : t.data.format === "date" && a !== void 0 ? mn(o.value, a) : o.value }), r(t.nextId);
477
499
  }
478
- async function os({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
500
+ async function ds({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
479
501
  await e.sendMessage({ author: "bot", type: "text", text: fe(t.data.question, { submissions: n, context: s }) });
480
502
  let a = await e.userInput({ key: t.data.key, type: "number", config: { max: t.data.max, min: t.data.min, optional: t.data.optional, placeholder: t.data.placeholder, decimalCases: t.data.decimalCases } });
481
- a === null ? await e.sendMessage({ type: "system", variant: "info", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value.toString() }), r(t.nextId);
503
+ a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value.toString() }), r(t.nextId);
482
504
  }
483
- async function ls({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
505
+ async function fs({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
484
506
  await e.sendMessage({ author: "bot", type: "text", text: fe(t.data.question, { submissions: n, context: s }) });
485
507
  let a = await e.userInput({ key: t.data.key, type: "phone", config: { minChars: t.data.minChars, defaultValue: { countryCode: t.data.defaultCountryCode }, placeholder: t.data.placeholder, submissionFormat: "phone", optional: t.data.optional } });
486
- a === null ? await e.sendMessage({ type: "system", variant: "info", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.type === "phone" ? ut(a.value) : a.value }), r(t.nextId);
508
+ a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.type === "phone" ? ht(a.value) : a.value }), r(t.nextId);
487
509
  }
488
- async function us({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
510
+ async function ps({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
489
511
  await e.sendMessage({ author: "bot", type: "text", text: fe(t.data.question, { submissions: n, context: s }) });
490
512
  let a = await e.userInput({ key: t.data.key, type: "multiple-choice", config: t.data });
491
- a.value.length === 0 ? await e.sendMessage({ type: "system", variant: "info", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: t.data.options.filter((o) => a.value.includes(o.value)).map((o) => o.label).join(", ") }), r(t.nextId);
513
+ a.value.length === 0 ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: t.data.options.filter((o) => a.value.includes(o.value)).map((o) => o.label).join(", ") }), r(t.nextId);
492
514
  }
493
- async function cs({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
515
+ async function hs({ chat: e, next: r, node: t, submissions: n, context: s, t: i }) {
494
516
  await e.sendMessage({ author: "bot", type: "text", text: fe(t.data.question, { submissions: n, context: s }) });
495
517
  let a = await e.userInput({ key: t.data.key, type: "boolean", config: { optional: t.data.optional, labels: { true: t.data.trueLabel, false: t.data.falseLabel } } });
496
- a === null ? await e.sendMessage({ type: "system", variant: "info", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value === !0 ? t.data.trueLabel : t.data.falseLabel }), r(t.nextId);
518
+ a === null ? await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") }) : await e.sendMessage({ author: "user", type: "text", text: a.value === !0 ? t.data.trueLabel : t.data.falseLabel }), r(t.nextId);
497
519
  }
498
- async function ds({ chat: e, next: r, node: t, t: n }) {
520
+ async function ms({ chat: e, next: r, node: t, t: n }) {
499
521
  await e.sendMessage({ author: "bot", type: "text", text: t.data.question });
500
522
  let s = await e.userInput({ type: "address", key: t.data.key, config: { optional: t.data.optional, keys: t.data.keys, line2Required: t.data.line2Required, placeholder: t.data.placeholder } });
501
523
  if (s === null)
502
- await e.sendMessage({ type: "system", variant: "info", text: n("skipped") });
524
+ await e.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: n("skipped") });
503
525
  else {
504
526
  let i = Object.values(s.value).filter((a) => a && a.trim().length > 0).join(", ");
505
527
  await e.sendMessage({ author: "user", type: "text", text: i });
506
528
  }
507
529
  return r(t.nextId);
508
530
  }
509
- async function fs({ node: e, chat: r, next: t, submissions: n, context: s, t: i }) {
531
+ async function ys({ node: e, chat: r, next: t, submissions: n, context: s, t: i }) {
510
532
  await r.sendMessage({ author: "bot", type: "text", text: fe(e.data.question, { submissions: n, context: s }) });
511
533
  let a = await r.userInput({ key: e.data.key, type: "file", config: { optional: e.data.optional, extensions: e.data.extensions, fileSizeLimitKib: e.data.maxSizeKb ?? 10 * 1024, allowMultiple: e.data.multiple === !0 } });
512
534
  if (a === null)
513
- await r.sendMessage({ type: "system", variant: "info", text: i("skipped") });
535
+ await r.sendMessage({ type: "system", variant: "info", semantic: "question-skipped", text: i("skipped") });
514
536
  else
515
537
  for (let o of a.value)
516
538
  await r.sendMessage({ author: "user", type: "file", fileName: o.name, fileSizeKb: o.sizeKb });
517
539
  return t(e.nextId);
518
540
  }
519
- async function hs({ chat: e, end: r, node: t }) {
541
+ async function gs({ chat: e, end: r, node: t }) {
520
542
  await e.sendMessage({ type: "system", variant: "info", text: t.data.systemMessage }), r();
521
543
  }
522
- async function ps({ node: e, flow: r, submissions: t, chat: n, next: s, apiClient: i, analytics: a }) {
523
- let o = hn(r.nodes, t || {}), { answers: c, ...p } = o;
524
- n.setSubmission(e.data.key, { type: "integration", value: p });
525
- let g = new AbortController(), b = setTimeout(() => g.abort(), 5e3);
526
- if (i.fetch("/flow/pre-apply", { method: "POST", signal: g.signal, body: JSON.stringify({ ...a.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply: Sr(r.nodes, t || {}, r.data.flowSessionId) }) }).catch(() => {
527
- }).finally(() => clearTimeout(b)), o.status !== "skipped") {
528
- let h = [o.status === "unavailable" ? "We could not prepare your pre-apply summary. You can still continue to your application." : o.hasHardConcerns ? e.data.messages.hard : o.hasAdvisoryConcerns ? e.data.messages.advisory : e.data.messages.matched];
544
+ async function bs({ node: e, flow: r, submissions: t, chat: n, next: s, apiClient: i, analytics: a, signal: o, context: c }) {
545
+ let f = yn(r.nodes, t || {}), { answers: g, ...b } = f;
546
+ if (n.setSubmission(e.data.key, { type: "integration", value: b }), await Gn(r, i, { ...a.getSessionInfo(), job: r.job, flow_build: r.build, pre_apply: Vr(r.nodes, t || {}, r.data.flowSessionId) }, o), f.status !== "skipped") {
547
+ let h = [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];
529
548
  for (let m of ["hard", "advisory"]) {
530
- let w = c.filter((S) => !S.matched && S.severity === m);
531
- w.length && h.push((m === "hard" ? "Role requirements" : "Other things to consider") + `
532
- ` + w.map((S) => `• ${S.message}`).join(`
549
+ let k = g.filter((I) => !I.matched && I.severity === m);
550
+ k.length && h.push((m === "hard" ? "Role requirements" : "Other things to consider") + `
551
+ ` + k.map((I) => `• ${I.message}`).join(`
533
552
  `));
534
553
  }
535
554
  await n.sendMessage({ type: "text", author: "bot", text: h.join(`
536
555
 
537
- `) }), o.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: e.data.continueLabel } });
556
+ `) }), 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: fe(e.data.continueLabel, { submissions: t, context: c }) } });
538
557
  }
539
558
  return s(e.nextId);
540
559
  }
541
- const Jt = (e, r, t) => {
560
+ const er = (e, r, t) => {
542
561
  var n;
543
562
  return e.log({
544
563
  event: t,
@@ -552,7 +571,7 @@ const Jt = (e, r, t) => {
552
571
  },
553
572
  customProperties: (n = r.analytics) == null ? void 0 : n.customProperties
554
573
  });
555
- }, St = "resume-prompt", ms = async ({
574
+ }, Mt = "resume-prompt", vs = async ({
556
575
  chatService: e,
557
576
  t: r,
558
577
  signal: t
@@ -563,7 +582,7 @@ const Jt = (e, r, t) => {
563
582
  author: "bot",
564
583
  text: r("resume_prompt")
565
584
  },
566
- groupId: St,
585
+ groupId: Mt,
567
586
  signal: t
568
587
  });
569
588
  const n = await e.input({
@@ -580,16 +599,16 @@ const Jt = (e, r, t) => {
580
599
  },
581
600
  signal: t
582
601
  });
583
- return j.removeMessagesSentByNodeIds([St]), (n == null ? void 0 : n.value) !== !1;
602
+ return K.removeMessagesSentByNodeIds([Mt]), (n == null ? void 0 : n.value) !== !1;
584
603
  }, Re = ({
585
604
  class: e,
586
605
  ...r
587
606
  }) => {
588
607
  const {
589
608
  t
590
- } = Q();
609
+ } = ee();
591
610
  return u("button", {
592
- 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),
611
+ class: Ke("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),
593
612
  type: "submit",
594
613
  ...r,
595
614
  children: u("svg", {
@@ -613,7 +632,7 @@ const Jt = (e, r, t) => {
613
632
  };
614
633
  var ye;
615
634
  // @__NO_SIDE_EFFECTS__
616
- function dt(e) {
635
+ function yt(e) {
617
636
  return {
618
637
  lang: (e == null ? void 0 : e.lang) ?? (ye == null ? void 0 : ye.lang),
619
638
  message: e == null ? void 0 : e.message,
@@ -621,30 +640,30 @@ function dt(e) {
621
640
  abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (ye == null ? void 0 : ye.abortPipeEarly)
622
641
  };
623
642
  }
624
- var vt;
643
+ var Ct;
625
644
  // @__NO_SIDE_EFFECTS__
626
- function ys(e) {
627
- return vt == null ? void 0 : vt.get(e);
645
+ function xs(e) {
646
+ return Ct == null ? void 0 : Ct.get(e);
628
647
  }
629
- var xt;
648
+ var St;
630
649
  // @__NO_SIDE_EFFECTS__
631
- function gs(e) {
632
- return xt == null ? void 0 : xt.get(e);
650
+ function ws(e) {
651
+ return St == null ? void 0 : St.get(e);
633
652
  }
634
- var wt;
653
+ var It;
635
654
  // @__NO_SIDE_EFFECTS__
636
- function bs(e, r) {
655
+ function _s(e, r) {
637
656
  var t;
638
- return (t = wt == null ? void 0 : wt.get(e)) == null ? void 0 : t.get(r);
657
+ return (t = It == null ? void 0 : It.get(e)) == null ? void 0 : t.get(r);
639
658
  }
640
659
  // @__NO_SIDE_EFFECTS__
641
- function je(e) {
660
+ function We(e) {
642
661
  var t, n;
643
662
  const r = typeof e;
644
663
  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;
645
664
  }
646
- function Y(e, r, t, n, s) {
647
- 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__ */ je(i), c = {
665
+ function Q(e, r, t, n, s) {
666
+ 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__ */ We(i), c = {
648
667
  kind: e.kind,
649
668
  type: e.type,
650
669
  input: i,
@@ -657,33 +676,33 @@ function Y(e, r, t, n, s) {
657
676
  lang: n.lang,
658
677
  abortEarly: n.abortEarly,
659
678
  abortPipeEarly: n.abortPipeEarly
660
- }, p = e.kind === "schema", g = (s == null ? void 0 : s.message) ?? e.message ?? /* @__PURE__ */ bs(e.reference, c.lang) ?? (p ? /* @__PURE__ */ gs(c.lang) : null) ?? n.message ?? /* @__PURE__ */ ys(c.lang);
679
+ }, f = e.kind === "schema", g = (s == null ? void 0 : s.message) ?? e.message ?? /* @__PURE__ */ _s(e.reference, c.lang) ?? (f ? /* @__PURE__ */ ws(c.lang) : null) ?? n.message ?? /* @__PURE__ */ xs(c.lang);
661
680
  g !== void 0 && (c.message = typeof g == "function" ? (
662
681
  // @ts-expect-error
663
682
  g(c)
664
- ) : g), p && (t.typed = !1), t.issues ? t.issues.push(c) : t.issues = [c];
683
+ ) : g), f && (t.typed = !1), t.issues ? t.issues.push(c) : t.issues = [c];
665
684
  }
666
685
  // @__NO_SIDE_EFFECTS__
667
- function he(e) {
686
+ function me(e) {
668
687
  return {
669
688
  version: 1,
670
689
  vendor: "valibot",
671
690
  validate(r) {
672
- return e["~run"]({ value: r }, /* @__PURE__ */ dt());
691
+ return e["~run"]({ value: r }, /* @__PURE__ */ yt());
673
692
  }
674
693
  };
675
694
  }
676
695
  // @__NO_SIDE_EFFECTS__
677
- function vs(e, r) {
696
+ function ks(e, r) {
678
697
  return Object.hasOwn(e, r) && r !== "__proto__" && r !== "prototype" && r !== "constructor";
679
698
  }
680
699
  // @__NO_SIDE_EFFECTS__
681
- function xs(e, r) {
700
+ function Cs(e, r) {
682
701
  const t = [...new Set(e)];
683
702
  return t.length > 1 ? `(${t.join(` ${r} `)})` : t[0] ?? "never";
684
703
  }
685
704
  // @__NO_SIDE_EFFECTS__
686
- function ws(e) {
705
+ function Ss(e) {
687
706
  if (e.path) {
688
707
  let r = "";
689
708
  for (const t of e.path)
@@ -695,7 +714,7 @@ function ws(e) {
695
714
  }
696
715
  return null;
697
716
  }
698
- var _s = class extends Error {
717
+ var Is = class extends Error {
699
718
  /**
700
719
  * Creates a Valibot error with useful information.
701
720
  *
@@ -704,126 +723,126 @@ var _s = class extends Error {
704
723
  constructor(e) {
705
724
  super(e[0].message), this.name = "ValiError", this.issues = e;
706
725
  }
707
- }, ks = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
726
+ }, As = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;
708
727
  // @__NO_SIDE_EFFECTS__
709
- function Dr(e, r) {
728
+ function Pr(e, r) {
710
729
  return {
711
730
  kind: "validation",
712
731
  type: "check",
713
- reference: Dr,
732
+ reference: Pr,
714
733
  async: !1,
715
734
  expects: null,
716
735
  requirement: e,
717
736
  message: r,
718
737
  "~run"(t, n) {
719
- return t.typed && !this.requirement(t.value) && Y(this, "input", t, n), t;
738
+ return t.typed && !this.requirement(t.value) && Q(this, "input", t, n), t;
720
739
  }
721
740
  };
722
741
  }
723
742
  // @__NO_SIDE_EFFECTS__
724
- function Tr(e) {
743
+ function qr(e) {
725
744
  return {
726
745
  kind: "validation",
727
746
  type: "email",
728
- reference: Tr,
747
+ reference: qr,
729
748
  expects: null,
730
749
  async: !1,
731
- requirement: ks,
750
+ requirement: As,
732
751
  message: e,
733
752
  "~run"(r, t) {
734
- return r.typed && !this.requirement.test(r.value) && Y(this, "email", r, t), r;
753
+ return r.typed && !this.requirement.test(r.value) && Q(this, "email", r, t), r;
735
754
  }
736
755
  };
737
756
  }
738
757
  // @__NO_SIDE_EFFECTS__
739
- function Ye(e, r) {
758
+ function st(e, r) {
740
759
  return {
741
760
  kind: "validation",
742
761
  type: "max_length",
743
- reference: Ye,
762
+ reference: st,
744
763
  async: !1,
745
764
  expects: `<=${e}`,
746
765
  requirement: e,
747
766
  message: r,
748
767
  "~run"(t, n) {
749
- return t.typed && t.value.length > this.requirement && Y(this, "length", t, n, {
768
+ return t.typed && t.value.length > this.requirement && Q(this, "length", t, n, {
750
769
  received: `${t.value.length}`
751
770
  }), t;
752
771
  }
753
772
  };
754
773
  }
755
774
  // @__NO_SIDE_EFFECTS__
756
- function Or(e, r) {
775
+ function $r(e, r) {
757
776
  return {
758
777
  kind: "validation",
759
778
  type: "max_value",
760
- reference: Or,
779
+ reference: $r,
761
780
  async: !1,
762
- expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ je(e)}`,
781
+ expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ We(e)}`,
763
782
  requirement: e,
764
783
  message: r,
765
784
  "~run"(t, n) {
766
- return t.typed && !(t.value <= this.requirement) && Y(this, "value", t, n, {
767
- received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ je(t.value)
785
+ return t.typed && !(t.value <= this.requirement) && Q(this, "value", t, n, {
786
+ received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ We(t.value)
768
787
  }), t;
769
788
  }
770
789
  };
771
790
  }
772
791
  // @__NO_SIDE_EFFECTS__
773
- function Be(e, r) {
792
+ function Ue(e, r) {
774
793
  return {
775
794
  kind: "validation",
776
795
  type: "min_length",
777
- reference: Be,
796
+ reference: Ue,
778
797
  async: !1,
779
798
  expects: `>=${e}`,
780
799
  requirement: e,
781
800
  message: r,
782
801
  "~run"(t, n) {
783
- return t.typed && t.value.length < this.requirement && Y(this, "length", t, n, {
802
+ return t.typed && t.value.length < this.requirement && Q(this, "length", t, n, {
784
803
  received: `${t.value.length}`
785
804
  }), t;
786
805
  }
787
806
  };
788
807
  }
789
808
  // @__NO_SIDE_EFFECTS__
790
- function $r(e, r) {
809
+ function Ur(e, r) {
791
810
  return {
792
811
  kind: "validation",
793
812
  type: "min_value",
794
- reference: $r,
813
+ reference: Ur,
795
814
  async: !1,
796
- expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ je(e)}`,
815
+ expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ We(e)}`,
797
816
  requirement: e,
798
817
  message: r,
799
818
  "~run"(t, n) {
800
- return t.typed && !(t.value >= this.requirement) && Y(this, "value", t, n, {
801
- received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ je(t.value)
819
+ return t.typed && !(t.value >= this.requirement) && Q(this, "value", t, n, {
820
+ received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ We(t.value)
802
821
  }), t;
803
822
  }
804
823
  };
805
824
  }
806
825
  // @__NO_SIDE_EFFECTS__
807
- function Vt(e, r) {
826
+ function Tt(e, r) {
808
827
  return {
809
828
  kind: "validation",
810
829
  type: "regex",
811
- reference: Vt,
830
+ reference: Tt,
812
831
  async: !1,
813
832
  expects: `${e}`,
814
833
  requirement: e,
815
834
  message: r,
816
835
  "~run"(t, n) {
817
- return t.typed && !this.requirement.test(t.value) && Y(this, "format", t, n), t;
836
+ return t.typed && !this.requirement.test(t.value) && Q(this, "format", t, n), t;
818
837
  }
819
838
  };
820
839
  }
821
840
  // @__NO_SIDE_EFFECTS__
822
- function Mt(e) {
841
+ function Ot(e) {
823
842
  return {
824
843
  kind: "transformation",
825
844
  type: "transform",
826
- reference: Mt,
845
+ reference: Ot,
827
846
  async: !1,
828
847
  operation: e,
829
848
  "~run"(r) {
@@ -832,11 +851,11 @@ function Mt(e) {
832
851
  };
833
852
  }
834
853
  // @__NO_SIDE_EFFECTS__
835
- function Br(e) {
854
+ function Wr(e) {
836
855
  return {
837
856
  kind: "validation",
838
857
  type: "url",
839
- reference: Br,
858
+ reference: Wr,
840
859
  async: !1,
841
860
  expects: null,
842
861
  requirement(r) {
@@ -848,12 +867,12 @@ function Br(e) {
848
867
  },
849
868
  message: e,
850
869
  "~run"(r, t) {
851
- return r.typed && !this.requirement(r.value) && Y(this, "URL", r, t), r;
870
+ return r.typed && !this.requirement(r.value) && Q(this, "URL", r, t), r;
852
871
  }
853
872
  };
854
873
  }
855
874
  // @__NO_SIDE_EFFECTS__
856
- function Cs(e, r, t) {
875
+ function Es(e, r, t) {
857
876
  return typeof e.fallback == "function" ? (
858
877
  // @ts-expect-error
859
878
  e.fallback(r, t)
@@ -863,7 +882,7 @@ function Cs(e, r, t) {
863
882
  );
864
883
  }
865
884
  // @__NO_SIDE_EFFECTS__
866
- function jr(e, r, t) {
885
+ function zr(e, r, t) {
867
886
  return typeof e.default == "function" ? (
868
887
  // @ts-expect-error
869
888
  e.default(r, t)
@@ -873,17 +892,17 @@ function jr(e, r, t) {
873
892
  );
874
893
  }
875
894
  // @__NO_SIDE_EFFECTS__
876
- function Pr(e, r) {
895
+ function Kr(e, r) {
877
896
  return {
878
897
  kind: "schema",
879
898
  type: "array",
880
- reference: Pr,
899
+ reference: Kr,
881
900
  expects: "Array",
882
901
  async: !1,
883
902
  item: e,
884
903
  message: r,
885
904
  get "~standard"() {
886
- return /* @__PURE__ */ he(this);
905
+ return /* @__PURE__ */ me(this);
887
906
  },
888
907
  "~run"(t, n) {
889
908
  var i;
@@ -893,7 +912,7 @@ function Pr(e, r) {
893
912
  for (let a = 0; a < s.length; a++) {
894
913
  const o = s[a], c = this.item["~run"]({ value: o }, n);
895
914
  if (c.issues) {
896
- const p = {
915
+ const f = {
897
916
  type: "array",
898
917
  origin: "value",
899
918
  input: s,
@@ -901,7 +920,7 @@ function Pr(e, r) {
901
920
  value: o
902
921
  };
903
922
  for (const g of c.issues)
904
- g.path ? g.path.unshift(p) : g.path = [p], (i = t.issues) == null || i.push(g);
923
+ g.path ? g.path.unshift(f) : g.path = [f], (i = t.issues) == null || i.push(g);
905
924
  if (t.issues || (t.issues = c.issues), n.abortEarly) {
906
925
  t.typed = !1;
907
926
  break;
@@ -910,42 +929,42 @@ function Pr(e, r) {
910
929
  c.typed || (t.typed = !1), t.value.push(c.value);
911
930
  }
912
931
  } else
913
- Y(this, "type", t, n);
932
+ Q(this, "type", t, n);
914
933
  return t;
915
934
  }
916
935
  };
917
936
  }
918
937
  // @__NO_SIDE_EFFECTS__
919
- function qr(e) {
938
+ function Gr(e) {
920
939
  return {
921
940
  kind: "schema",
922
941
  type: "boolean",
923
- reference: qr,
942
+ reference: Gr,
924
943
  expects: "boolean",
925
944
  async: !1,
926
945
  message: e,
927
946
  get "~standard"() {
928
- return /* @__PURE__ */ he(this);
947
+ return /* @__PURE__ */ me(this);
929
948
  },
930
949
  "~run"(r, t) {
931
- return typeof r.value == "boolean" ? r.typed = !0 : Y(this, "type", r, t), r;
950
+ return typeof r.value == "boolean" ? r.typed = !0 : Q(this, "type", r, t), r;
932
951
  }
933
952
  };
934
953
  }
935
954
  // @__NO_SIDE_EFFECTS__
936
- function Ur(e) {
955
+ function Hr(e) {
937
956
  return {
938
957
  kind: "schema",
939
958
  type: "number",
940
- reference: Ur,
959
+ reference: Hr,
941
960
  expects: "number",
942
961
  async: !1,
943
962
  message: e,
944
963
  get "~standard"() {
945
- return /* @__PURE__ */ he(this);
964
+ return /* @__PURE__ */ me(this);
946
965
  },
947
966
  "~run"(r, t) {
948
- return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : Y(this, "type", r, t), r;
967
+ return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : Q(this, "type", r, t), r;
949
968
  }
950
969
  };
951
970
  }
@@ -960,7 +979,7 @@ function xe(e, r) {
960
979
  entries: e,
961
980
  message: r,
962
981
  get "~standard"() {
963
- return /* @__PURE__ */ he(this);
982
+ return /* @__PURE__ */ me(this);
964
983
  },
965
984
  "~run"(t, n) {
966
985
  var i;
@@ -974,8 +993,8 @@ function xe(e, r) {
974
993
  const c = a in s ? (
975
994
  // @ts-expect-error
976
995
  s[a]
977
- ) : /* @__PURE__ */ jr(o), p = o["~run"]({ value: c }, n);
978
- if (p.issues) {
996
+ ) : /* @__PURE__ */ zr(o), f = o["~run"]({ value: c }, n);
997
+ if (f.issues) {
979
998
  const g = {
980
999
  type: "object",
981
1000
  origin: "value",
@@ -983,17 +1002,17 @@ function xe(e, r) {
983
1002
  key: a,
984
1003
  value: c
985
1004
  };
986
- for (const b of p.issues)
1005
+ for (const b of f.issues)
987
1006
  b.path ? b.path.unshift(g) : b.path = [g], (i = t.issues) == null || i.push(b);
988
- if (t.issues || (t.issues = p.issues), n.abortEarly) {
1007
+ if (t.issues || (t.issues = f.issues), n.abortEarly) {
989
1008
  t.typed = !1;
990
1009
  break;
991
1010
  }
992
1011
  }
993
- p.typed || (t.typed = !1), t.value[a] = p.value;
1012
+ f.typed || (t.typed = !1), t.value[a] = f.value;
994
1013
  } else if (o.fallback !== void 0)
995
- t.value[a] = /* @__PURE__ */ Cs(o);
996
- else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (Y(this, "key", t, n, {
1014
+ t.value[a] = /* @__PURE__ */ Es(o);
1015
+ else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (Q(this, "key", t, n, {
997
1016
  input: void 0,
998
1017
  expected: `"${a}"`,
999
1018
  path: [
@@ -1010,60 +1029,60 @@ function xe(e, r) {
1010
1029
  break;
1011
1030
  }
1012
1031
  } else
1013
- Y(this, "type", t, n);
1032
+ Q(this, "type", t, n);
1014
1033
  return t;
1015
1034
  }
1016
1035
  };
1017
1036
  }
1018
1037
  // @__NO_SIDE_EFFECTS__
1019
- function Qe(e, r) {
1038
+ function $e(e, r) {
1020
1039
  return {
1021
1040
  kind: "schema",
1022
1041
  type: "optional",
1023
- reference: Qe,
1042
+ reference: $e,
1024
1043
  expects: `(${e.expects} | undefined)`,
1025
1044
  async: !1,
1026
1045
  wrapped: e,
1027
1046
  default: r,
1028
1047
  get "~standard"() {
1029
- return /* @__PURE__ */ he(this);
1048
+ return /* @__PURE__ */ me(this);
1030
1049
  },
1031
1050
  "~run"(t, n) {
1032
- return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */ jr(this, t, n)), t.value === void 0) ? (t.typed = !0, t) : this.wrapped["~run"](t, n);
1051
+ return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */ zr(this, t, n)), t.value === void 0) ? (t.typed = !0, t) : this.wrapped["~run"](t, n);
1033
1052
  }
1034
1053
  };
1035
1054
  }
1036
1055
  // @__NO_SIDE_EFFECTS__
1037
- function Wr(e, r) {
1056
+ function Jr(e, r) {
1038
1057
  return {
1039
1058
  kind: "schema",
1040
1059
  type: "picklist",
1041
- reference: Wr,
1042
- expects: /* @__PURE__ */ xs(e.map(je), "|"),
1060
+ reference: Jr,
1061
+ expects: /* @__PURE__ */ Cs(e.map(We), "|"),
1043
1062
  async: !1,
1044
1063
  options: e,
1045
1064
  message: r,
1046
1065
  get "~standard"() {
1047
- return /* @__PURE__ */ he(this);
1066
+ return /* @__PURE__ */ me(this);
1048
1067
  },
1049
1068
  "~run"(t, n) {
1050
- return this.options.includes(t.value) ? t.typed = !0 : Y(this, "type", t, n), t;
1069
+ return this.options.includes(t.value) ? t.typed = !0 : Q(this, "type", t, n), t;
1051
1070
  }
1052
1071
  };
1053
1072
  }
1054
1073
  // @__NO_SIDE_EFFECTS__
1055
- function zr(e, r, t) {
1074
+ function Zr(e, r, t) {
1056
1075
  return {
1057
1076
  kind: "schema",
1058
1077
  type: "record",
1059
- reference: zr,
1078
+ reference: Zr,
1060
1079
  expects: "Object",
1061
1080
  async: !1,
1062
1081
  key: e,
1063
1082
  value: r,
1064
1083
  message: t,
1065
1084
  get "~standard"() {
1066
- return /* @__PURE__ */ he(this);
1085
+ return /* @__PURE__ */ me(this);
1067
1086
  },
1068
1087
  "~run"(n, s) {
1069
1088
  var a, o;
@@ -1071,15 +1090,15 @@ function zr(e, r, t) {
1071
1090
  if (i && typeof i == "object") {
1072
1091
  n.typed = !0, n.value = {};
1073
1092
  for (const c in i)
1074
- if (/* @__PURE__ */ vs(i, c)) {
1075
- const p = i[c], g = this.key["~run"]({ value: c }, s);
1093
+ if (/* @__PURE__ */ ks(i, c)) {
1094
+ const f = i[c], g = this.key["~run"]({ value: c }, s);
1076
1095
  if (g.issues) {
1077
1096
  const h = {
1078
1097
  type: "object",
1079
1098
  origin: "key",
1080
1099
  input: i,
1081
1100
  key: c,
1082
- value: p
1101
+ value: f
1083
1102
  };
1084
1103
  for (const m of g.issues)
1085
1104
  m.path = [h], (a = n.issues) == null || a.push(m);
@@ -1089,7 +1108,7 @@ function zr(e, r, t) {
1089
1108
  }
1090
1109
  }
1091
1110
  const b = this.value["~run"](
1092
- { value: p },
1111
+ { value: f },
1093
1112
  s
1094
1113
  );
1095
1114
  if (b.issues) {
@@ -1098,7 +1117,7 @@ function zr(e, r, t) {
1098
1117
  origin: "value",
1099
1118
  input: i,
1100
1119
  key: c,
1101
- value: p
1120
+ value: f
1102
1121
  };
1103
1122
  for (const m of b.issues)
1104
1123
  m.path ? m.path.unshift(h) : m.path = [h], (o = n.issues) == null || o.push(m);
@@ -1110,44 +1129,44 @@ function zr(e, r, t) {
1110
1129
  (!g.typed || !b.typed) && (n.typed = !1), g.typed && (n.value[g.value] = b.value);
1111
1130
  }
1112
1131
  } else
1113
- Y(this, "type", n, s);
1132
+ Q(this, "type", n, s);
1114
1133
  return n;
1115
1134
  }
1116
1135
  };
1117
1136
  }
1118
1137
  // @__NO_SIDE_EFFECTS__
1119
- function ie(e) {
1138
+ function ae(e) {
1120
1139
  return {
1121
1140
  kind: "schema",
1122
1141
  type: "string",
1123
- reference: ie,
1142
+ reference: ae,
1124
1143
  expects: "string",
1125
1144
  async: !1,
1126
1145
  message: e,
1127
1146
  get "~standard"() {
1128
- return /* @__PURE__ */ he(this);
1147
+ return /* @__PURE__ */ me(this);
1129
1148
  },
1130
1149
  "~run"(r, t) {
1131
- return typeof r.value == "string" ? r.typed = !0 : Y(this, "type", r, t), r;
1150
+ return typeof r.value == "string" ? r.typed = !0 : Q(this, "type", r, t), r;
1132
1151
  }
1133
1152
  };
1134
1153
  }
1135
- function Ss(e, r, t) {
1136
- const n = e["~run"]({ value: r }, /* @__PURE__ */ dt(t));
1154
+ function Fs(e, r, t) {
1155
+ const n = e["~run"]({ value: r }, /* @__PURE__ */ yt(t));
1137
1156
  if (n.issues)
1138
- throw new _s(n.issues);
1157
+ throw new Is(n.issues);
1139
1158
  return n.value;
1140
1159
  }
1141
1160
  // @__NO_SIDE_EFFECTS__
1142
- function Is(e, r) {
1161
+ function Vs(e, r) {
1143
1162
  const t = {};
1144
1163
  for (const n in e.entries)
1145
- t[n] = !r || r.includes(n) ? /* @__PURE__ */ Qe(e.entries[n]) : e.entries[n];
1164
+ t[n] = !r || r.includes(n) ? /* @__PURE__ */ $e(e.entries[n]) : e.entries[n];
1146
1165
  return {
1147
1166
  ...e,
1148
1167
  entries: t,
1149
1168
  get "~standard"() {
1150
- return /* @__PURE__ */ he(this);
1169
+ return /* @__PURE__ */ me(this);
1151
1170
  }
1152
1171
  };
1153
1172
  }
@@ -1157,7 +1176,7 @@ function Ie(...e) {
1157
1176
  ...e[0],
1158
1177
  pipe: e,
1159
1178
  get "~standard"() {
1160
- return /* @__PURE__ */ he(this);
1179
+ return /* @__PURE__ */ me(this);
1161
1180
  },
1162
1181
  "~run"(r, t) {
1163
1182
  for (const n of e)
@@ -1173,8 +1192,8 @@ function Ie(...e) {
1173
1192
  };
1174
1193
  }
1175
1194
  // @__NO_SIDE_EFFECTS__
1176
- function As(e, r, t) {
1177
- const n = e["~run"]({ value: r }, /* @__PURE__ */ dt(t));
1195
+ function Ms(e, r, t) {
1196
+ const n = e["~run"]({ value: r }, /* @__PURE__ */ yt(t));
1178
1197
  return {
1179
1198
  typed: n.typed,
1180
1199
  success: !n.issues,
@@ -1183,10 +1202,10 @@ function As(e, r, t) {
1183
1202
  };
1184
1203
  }
1185
1204
  // @__NO_SIDE_EFFECTS__
1186
- async function Es(e, r, t) {
1205
+ async function Ls(e, r, t) {
1187
1206
  const n = await e["~run"](
1188
1207
  { value: r },
1189
- /* @__PURE__ */ dt(t)
1208
+ /* @__PURE__ */ yt(t)
1190
1209
  );
1191
1210
  return {
1192
1211
  typed: n.typed,
@@ -1195,7 +1214,7 @@ async function Es(e, r, t) {
1195
1214
  issues: n.issues
1196
1215
  };
1197
1216
  }
1198
- const We = ({
1217
+ const He = ({
1199
1218
  error: e
1200
1219
  }) => !e || !e.message ? null : u("div", {
1201
1220
  role: "alert",
@@ -1234,10 +1253,10 @@ const We = ({
1234
1253
  }) => {
1235
1254
  const {
1236
1255
  t
1237
- } = Q();
1256
+ } = ee();
1238
1257
  return u("button", {
1239
1258
  type: "button",
1240
- 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),
1259
+ class: Ke("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),
1241
1260
  ...r,
1242
1261
  children: [u("svg", {
1243
1262
  "aria-hidden": !0,
@@ -1259,8 +1278,8 @@ const We = ({
1259
1278
  }), t("skip")]
1260
1279
  });
1261
1280
  };
1262
- var Lt = { 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" };
1263
- const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all", {
1281
+ var Bt = { 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" };
1282
+ const ze = mt("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all", {
1264
1283
  variants: {
1265
1284
  optional: {
1266
1285
  true: "pr-16 pl-3",
@@ -1270,15 +1289,16 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1270
1289
  defaultVariants: {
1271
1290
  optional: !1
1272
1291
  }
1273
- }), Fs = "https://api.mapbox.com/search/searchbox/v1/suggest", Vs = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", Ms = (e) => atob(e).split("").reverse().join(""), ge = /* @__PURE__ */ xe({
1274
- name: /* @__PURE__ */ ie()
1275
- }), Ls = /* @__PURE__ */ xe({
1276
- suggestions: /* @__PURE__ */ Pr(/* @__PURE__ */ xe({
1277
- full_address: /* @__PURE__ */ Qe(/* @__PURE__ */ ie()),
1278
- place_formatted: /* @__PURE__ */ Qe(/* @__PURE__ */ ie()),
1279
- name: /* @__PURE__ */ Qe(/* @__PURE__ */ ie()),
1280
- mapbox_id: /* @__PURE__ */ ie(),
1281
- context: /* @__PURE__ */ Is(/* @__PURE__ */ xe({
1292
+ }), Ns = "https://api.mapbox.com/search/searchbox/v1/suggest", Rs = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", Ds = (e) => atob(e).split("").reverse().join(""), ge = /* @__PURE__ */ xe({
1293
+ name: /* @__PURE__ */ ae()
1294
+ }), Ts = /* @__PURE__ */ xe({
1295
+ suggestions: /* @__PURE__ */ Kr(/* @__PURE__ */ xe({
1296
+ feature_type: /* @__PURE__ */ $e(/* @__PURE__ */ ae()),
1297
+ full_address: /* @__PURE__ */ $e(/* @__PURE__ */ ae()),
1298
+ place_formatted: /* @__PURE__ */ $e(/* @__PURE__ */ ae()),
1299
+ name: /* @__PURE__ */ $e(/* @__PURE__ */ ae()),
1300
+ mapbox_id: /* @__PURE__ */ ae(),
1301
+ context: /* @__PURE__ */ Vs(/* @__PURE__ */ xe({
1282
1302
  address: ge,
1283
1303
  street: ge,
1284
1304
  neighborhood: ge,
@@ -1290,49 +1310,50 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1290
1310
  country: ge
1291
1311
  }))
1292
1312
  }))
1293
- }), Ns = ({
1313
+ }), Os = ({
1294
1314
  logger: e,
1295
1315
  t: r
1296
- }) => An(() => {
1316
+ }) => Fn(() => {
1297
1317
  var n;
1298
- const t = (n = j.current$.peek().flow) == null ? void 0 : n.data.flowSessionId;
1318
+ const t = (n = K.current$.peek().flow) == null ? void 0 : n.data.flowSessionId;
1299
1319
  return t ? {
1300
1320
  enabled: !0,
1301
1321
  getPredictions: async (s) => {
1302
1322
  var b;
1303
- const i = new URL(Fs);
1323
+ const i = new URL(Ns);
1304
1324
  i.searchParams.set("q", s), i.searchParams.set("session_token", t);
1305
- const a = (b = j.current$.peek().flow) == null ? void 0 : b.locationOrigin;
1306
- 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", Ms(Vs));
1325
+ const a = (b = K.current$.peek().flow) == null ? void 0 : b.locationOrigin;
1326
+ 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", Ds(Rs));
1307
1327
  const c = await fetch(i);
1308
1328
  if (!c.ok)
1309
1329
  return e.error("Failed to get address details", c), {
1310
1330
  ok: !1,
1311
1331
  error: r("address_error")
1312
1332
  };
1313
- const p = /* @__PURE__ */ As(Ls, await c.json());
1314
- if (p.success === !1)
1315
- return e.error("Failed to parse address details", p.issues), {
1333
+ const f = /* @__PURE__ */ Ms(Ts, await c.json());
1334
+ if (f.success === !1)
1335
+ return e.error("Failed to parse address details", f.issues), {
1316
1336
  ok: !1,
1317
1337
  error: r("address_error")
1318
1338
  };
1319
1339
  const {
1320
1340
  suggestions: g
1321
- } = p.output;
1341
+ } = f.output;
1322
1342
  return {
1323
1343
  ok: !0,
1324
1344
  data: g.map((h) => {
1325
- var m, w, S, C, _, y, E, A, V;
1345
+ var m, k, I, C, x, y, F, N, V;
1326
1346
  return {
1327
- label: h.full_address ?? h.place_formatted ?? h.name ?? h.mapbox_id,
1347
+ // A postcode result has no full address and is named by the postcode itself (PROD-7311).
1348
+ label: h.full_address ?? ([h.name, h.place_formatted].filter(Boolean).join(", ") || h.mapbox_id),
1328
1349
  id: h.mapbox_id,
1329
1350
  address: {
1330
- line1: ((m = h.context.address) == null ? void 0 : m.name) ?? ((w = h.context.street) == null ? void 0 : w.name),
1351
+ line1: ((m = h.context.address) == null ? void 0 : m.name) ?? ((k = h.context.street) == null ? void 0 : k.name),
1331
1352
  line2: void 0,
1332
- line3: ((S = h.context.neighborhood) == null ? void 0 : S.name) ?? ((C = h.context.locality) == null ? void 0 : C.name),
1333
- city: ((_ = h.context.place) == null ? void 0 : _.name) ?? ((y = h.context.district) == null ? void 0 : y.name),
1334
- state: (E = h.context.region) == null ? void 0 : E.name,
1335
- postcode: (A = h.context.postcode) == null ? void 0 : A.name,
1353
+ line3: ((I = h.context.neighborhood) == null ? void 0 : I.name) ?? ((C = h.context.locality) == null ? void 0 : C.name),
1354
+ city: ((x = h.context.place) == null ? void 0 : x.name) ?? ((y = h.context.district) == null ? void 0 : y.name),
1355
+ state: (F = h.context.region) == null ? void 0 : F.name,
1356
+ postcode: ((N = h.context.postcode) == null ? void 0 : N.name) ?? (h.feature_type === "postcode" ? h.name : void 0),
1336
1357
  country: (V = h.context.country) == null ? void 0 : V.name
1337
1358
  }
1338
1359
  };
@@ -1342,10 +1363,10 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1342
1363
  } : {
1343
1364
  enabled: !1
1344
1365
  };
1345
- }, [e, r]), Xt = (e) => {
1366
+ }, [e, r]), tr = (e) => {
1346
1367
  const {
1347
1368
  t: r
1348
- } = Q();
1369
+ } = ee();
1349
1370
  return u("button", {
1350
1371
  type: "button",
1351
1372
  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",
@@ -1365,35 +1386,35 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1365
1386
  children: r("back")
1366
1387
  })]
1367
1388
  });
1368
- }, Rs = ({
1389
+ }, Bs = ({
1369
1390
  input: e,
1370
1391
  onSubmitSuccess: r,
1371
1392
  logger: t
1372
1393
  }) => {
1373
1394
  const {
1374
1395
  t: n
1375
- } = Q(), [s, i] = ve(), {
1396
+ } = ee(), [s, i] = ve(), {
1376
1397
  enabled: a,
1377
1398
  getPredictions: o
1378
- } = Ns({
1399
+ } = Os({
1379
1400
  logger: t,
1380
1401
  t: n
1381
- }), [c, p] = ve(a ? "query" : "manual"), [g, b] = ve(""), [h, m] = ve(), w = de(), S = de(), C = (y) => {
1382
- var A;
1383
- if (Ne(a, "Query state should not be enabled"), y = y.trim(), y === ((A = w.current) == null ? void 0 : A.query) || y === (h == null ? void 0 : h.query) && h.status === "done")
1402
+ }), [c, f] = ve(a ? "query" : "manual"), [g, b] = ve(""), [h, m] = ve(), k = he(), I = he(), C = (y) => {
1403
+ var N;
1404
+ if (Ne(a, "Query state should not be enabled"), y = y.trim(), y === ((N = k.current) == null ? void 0 : N.query) || y === (h == null ? void 0 : h.query) && h.status === "done")
1384
1405
  return;
1385
1406
  if (b(y), y === "") {
1386
- w.current = void 0, m(void 0);
1407
+ k.current = void 0, m(void 0);
1387
1408
  return;
1388
1409
  }
1389
- const E = w.current = {
1410
+ const F = k.current = {
1390
1411
  query: y
1391
1412
  };
1392
1413
  m({
1393
1414
  query: y,
1394
1415
  status: "pending"
1395
1416
  }), o(y).then((V) => {
1396
- w.current === E && (w.current = void 0, m(V.ok ? {
1417
+ k.current === F && (k.current = void 0, m(V.ok ? {
1397
1418
  query: y,
1398
1419
  status: "done",
1399
1420
  items: V.data
@@ -1403,58 +1424,58 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1403
1424
  error: V.error
1404
1425
  }));
1405
1426
  }, (V) => {
1406
- w.current === E && (w.current = void 0, t.error("Failed to get address details", V), m({
1427
+ k.current === F && (k.current = void 0, t.error("Failed to get address details", V), m({
1407
1428
  query: y,
1408
1429
  status: "failed",
1409
1430
  error: n("address_error")
1410
1431
  }));
1411
1432
  });
1412
- }, _ = (y, E) => {
1413
- i((A) => ({
1414
- ...A,
1415
- [y]: E
1433
+ }, x = (y, F) => {
1434
+ i((N) => ({
1435
+ ...N,
1436
+ [y]: F
1416
1437
  }));
1417
1438
  };
1418
1439
  switch (c) {
1419
1440
  case "query":
1420
- return Ne(a, "Query state should not be enabled"), u(Ds, {
1441
+ return Ne(a, "Query state should not be enabled"), u(js, {
1421
1442
  input: e,
1422
1443
  onSkip: () => r(null),
1423
1444
  onAddressSelect: (y) => {
1424
1445
  if (y === "") {
1425
- w.current && (w.current = void 0, m(void 0)), p("manual");
1446
+ k.current && (k.current = void 0, m(void 0)), f("manual");
1426
1447
  return;
1427
1448
  }
1428
- const E = (h == null ? void 0 : h.status) === "done" ? h.items.find((A) => A.id === y) : void 0;
1429
- E && (S.current !== y && i(E.address), S.current = y, p("details"));
1449
+ const F = (h == null ? void 0 : h.status) === "done" ? h.items.find((N) => N.id === y) : void 0;
1450
+ F && (I.current !== y && i(F.address), I.current = y, f("details"));
1430
1451
  },
1431
1452
  onAddressSearch: C,
1432
1453
  lookup: h,
1433
1454
  query: g
1434
1455
  });
1435
1456
  case "details":
1436
- return Ne(s !== void 0), u(Zt, {
1457
+ return Ne(s !== void 0), u(rr, {
1437
1458
  input: e,
1438
1459
  logger: t,
1439
1460
  onSubmitSuccess: r,
1440
1461
  addressFields: s,
1441
- onFieldChange: _,
1442
- actions: u(Xt, {
1462
+ onFieldChange: x,
1463
+ actions: u(tr, {
1443
1464
  onClick: () => {
1444
- p("query");
1465
+ f("query");
1445
1466
  }
1446
1467
  })
1447
1468
  });
1448
1469
  case "manual":
1449
- return u(Zt, {
1470
+ return u(rr, {
1450
1471
  logger: t,
1451
1472
  input: e,
1452
1473
  onSubmitSuccess: r,
1453
1474
  addressFields: s ?? {},
1454
- onFieldChange: _,
1455
- actions: a ? u(Xt, {
1475
+ onFieldChange: x,
1476
+ actions: a ? u(tr, {
1456
1477
  onClick: () => {
1457
- p("query");
1478
+ f("query");
1458
1479
  }
1459
1480
  }) : e.config.optional ? (
1460
1481
  // Without address search this is the only screen, so an optional question needs its own way past.
@@ -1464,7 +1485,7 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1464
1485
  ) : void 0
1465
1486
  });
1466
1487
  }
1467
- }, Ds = ({
1488
+ }, js = ({
1468
1489
  input: e,
1469
1490
  onSkip: r,
1470
1491
  lookup: t,
@@ -1474,7 +1495,7 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1474
1495
  }) => {
1475
1496
  const {
1476
1497
  t: a
1477
- } = Q(), o = de(null);
1498
+ } = ee(), o = he(null);
1478
1499
  return Ae(() => {
1479
1500
  o.current && (o.current.focus(), o.current.select());
1480
1501
  }, []), u(we, {
@@ -1496,7 +1517,7 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1496
1517
  autoFocus: !0,
1497
1518
  placeholder: e.config.placeholder || a("address_search"),
1498
1519
  defaultValue: s,
1499
- class: Pe({
1520
+ class: ze({
1500
1521
  optional: !!e.config.optional,
1501
1522
  className: "w-full rounded-full"
1502
1523
  })
@@ -1533,7 +1554,7 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1533
1554
  class: "relative",
1534
1555
  onClick: r
1535
1556
  })]
1536
- }), (t == null ? void 0 : t.status) === "failed" ? u(We, {
1557
+ }), (t == null ? void 0 : t.status) === "failed" ? u(He, {
1537
1558
  error: {
1538
1559
  message: t.error
1539
1560
  }
@@ -1541,7 +1562,7 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1541
1562
  role: "status",
1542
1563
  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",
1543
1564
  children: (t == null ? void 0 : t.status) === "pending" ? u(we, {
1544
- children: [u(Et, {
1565
+ children: [u(Rt, {
1545
1566
  "aria-hidden": "true",
1546
1567
  class: "h-4 w-4 shrink-0"
1547
1568
  }), a("address_searching")]
@@ -1584,37 +1605,37 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1584
1605
  }, "")]
1585
1606
  })]
1586
1607
  });
1587
- }, _t = ["line1", "line2", "line3", "city", "state", "postcode", "country"], Zt = ({
1608
+ }, At = ["line1", "line2", "line3", "city", "state", "postcode", "country"], rr = ({
1588
1609
  addressFields: e,
1589
1610
  onFieldChange: r,
1590
1611
  onSubmitSuccess: t,
1591
1612
  actions: n,
1592
1613
  input: s
1593
1614
  }) => {
1594
- const i = de(null);
1615
+ const i = he(null);
1595
1616
  Ae(() => {
1596
1617
  if (i.current) {
1597
1618
  const c = i.current.querySelector("input");
1598
1619
  c && (c.focus(), c.select());
1599
1620
  }
1600
1621
  }, []);
1601
- const a = Object.keys(Lt), {
1622
+ const a = Object.keys(Bt), {
1602
1623
  t: o
1603
- } = Q();
1624
+ } = ee();
1604
1625
  return u("form", {
1605
1626
  class: "flex flex-col px-2 pt-2",
1606
1627
  onSubmit: (c) => {
1607
- const p = c.currentTarget, g = [...p.querySelectorAll("input")].filter((m) => m.value !== "" && !m.value.trim());
1628
+ const f = c.currentTarget, g = [...f.querySelectorAll("input")].filter((m) => m.value !== "" && !m.value.trim());
1608
1629
  for (const m of g) {
1609
1630
  m.value = "";
1610
- const w = _t.find((S) => s.config.keys[S] === m.name);
1611
- w && r(w, "");
1631
+ const k = At.find((I) => s.config.keys[I] === m.name);
1632
+ k && r(k, "");
1612
1633
  }
1613
- if (g.length > 0 && !p.checkValidity()) {
1614
- c.preventDefault(), p.reportValidity();
1634
+ if (g.length > 0 && !f.checkValidity()) {
1635
+ c.preventDefault(), f.reportValidity();
1615
1636
  return;
1616
1637
  }
1617
- const b = new FormData(p), h = Object.fromEntries(b.entries());
1638
+ const b = new FormData(f), h = Object.fromEntries(b.entries());
1618
1639
  t({
1619
1640
  type: "address",
1620
1641
  value: h
@@ -1623,7 +1644,7 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1623
1644
  children: [u("div", {
1624
1645
  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]",
1625
1646
  ref: i,
1626
- children: _t.map((c, p) => {
1647
+ children: At.map((c, f) => {
1627
1648
  const g = `isdk_${c}`, b = s.config.keys[c];
1628
1649
  return b ? u(we, {
1629
1650
  children: [u("label", {
@@ -1667,14 +1688,14 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1667
1688
  })
1668
1689
  })]
1669
1690
  }) : u("input", {
1670
- autoFocus: p === 0 ? !0 : void 0,
1691
+ autoFocus: f === 0 ? !0 : void 0,
1671
1692
  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",
1672
1693
  name: b,
1673
1694
  id: g,
1674
1695
  defaultValue: e[c],
1675
1696
  onInput: (h) => r(c, h.currentTarget.value),
1676
- required: c !== "line2" || s.config.line2Required === !0
1677
- }), p === _t.length - 1 ? u("hr", {
1697
+ required: c === "line2" ? s.config.line2Required === !0 : c !== "line3"
1698
+ }), f === At.length - 1 ? u("hr", {
1678
1699
  class: "m-0 w-full border-b border-b-transparent"
1679
1700
  }) : u("hr", {
1680
1701
  class: "border-b-neutral-5 m-0 w-full border-b border-solid"
@@ -1689,13 +1710,13 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1689
1710
  })]
1690
1711
  })]
1691
1712
  });
1692
- }, Nt = () => {
1693
- const e = de(null);
1694
- return Er(() => {
1713
+ }, jt = () => {
1714
+ const e = he(null);
1715
+ return Nr(() => {
1695
1716
  var r;
1696
1717
  (r = e.current) == null || r.focus();
1697
1718
  }, []), e;
1698
- }, Kr = ["true", "false"], Ts = /* @__PURE__ */ Wr(Kr), Os = "answer", Gr = "flex items-center flex-wrap gap-2 p-2.5", Hr = "min-w-0 max-w-full flex-auto", Jr = Fr(({
1719
+ }, Xr = ["true", "false"], Ps = /* @__PURE__ */ Jr(Xr), qs = "answer", Yr = "flex items-center flex-wrap gap-2 p-2.5", Qr = "min-w-0 max-w-full flex-auto", en = Rr(({
1699
1720
  label: e,
1700
1721
  ...r
1701
1722
  }, t) => u("button", {
@@ -1710,26 +1731,26 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1710
1731
  input: e,
1711
1732
  onSubmitSuccess: r
1712
1733
  }) => {
1713
- const t = Nt();
1734
+ const t = jt();
1714
1735
  return u("form", {
1715
1736
  noValidate: !0,
1716
1737
  class: "",
1717
1738
  onSubmit: (n) => {
1718
1739
  n.preventDefault();
1719
- const s = En(n).value, i = Ss(Ts, s);
1740
+ const s = Vn(n).value, i = Fs(Ps, s);
1720
1741
  r({
1721
1742
  type: "boolean",
1722
1743
  value: i === "true"
1723
1744
  });
1724
1745
  },
1725
1746
  children: [u("ul", {
1726
- class: Gr,
1727
- children: Kr.map((n, s) => u("li", {
1728
- class: Hr,
1729
- children: u(Jr, {
1747
+ class: Yr,
1748
+ children: Xr.map((n, s) => u("li", {
1749
+ class: Qr,
1750
+ children: u(en, {
1730
1751
  ref: s === 0 ? t : null,
1731
1752
  type: "submit",
1732
- name: Os,
1753
+ name: qs,
1733
1754
  value: n,
1734
1755
  label: e.config.labels[n]
1735
1756
  }, n)
@@ -1743,26 +1764,26 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1743
1764
  })
1744
1765
  })]
1745
1766
  });
1746
- }, Bs = (e) => new Promise((r, t) => {
1767
+ }, Us = (e) => new Promise((r, t) => {
1747
1768
  const n = new FileReader();
1748
1769
  n.onload = () => {
1749
1770
  if (typeof n.result != "string" || !n.result)
1750
1771
  return t(new Error("Invalid file"));
1751
1772
  r(n.result);
1752
1773
  }, n.onerror = t, n.readAsDataURL(e);
1753
- }), Yt = (e) => e.reduce((r, t) => r + t.sizeKb, 0), js = Ue("file"), Qt = 3, ft = (e) => {
1774
+ }), nr = (e) => e.reduce((r, t) => r + t.sizeKb, 0), Ws = Ge("file"), sr = 3, gt = (e) => {
1754
1775
  const r = e.lastIndexOf(".");
1755
1776
  return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
1756
- }, Ps = ({
1777
+ }, zs = ({
1757
1778
  file: e,
1758
1779
  class: r,
1759
1780
  ...t
1760
1781
  }) => {
1761
1782
  const {
1762
1783
  t: n
1763
- } = Q(), [s, i] = ft(e.name);
1784
+ } = ee(), [s, i] = gt(e.name);
1764
1785
  return u("div", {
1765
- 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),
1786
+ class: Ke("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", r),
1766
1787
  ...t,
1767
1788
  children: [u("p", {
1768
1789
  class: "text-accent-12 flex flex-grow overflow-hidden",
@@ -1780,39 +1801,39 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1780
1801
  children: [u("span", {
1781
1802
  class: "sr-only",
1782
1803
  children: [n("file_size"), ": "]
1783
- }), $e(e.sizeKb)]
1804
+ }), qe(e.sizeKb)]
1784
1805
  })]
1785
1806
  });
1786
- }, er = ({
1807
+ }, ar = ({
1787
1808
  class: e,
1788
1809
  ...r
1789
1810
  }) => u("li", {
1790
- 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),
1811
+ class: Ke("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
1791
1812
  ...r
1792
- }), qs = (e, r) => {
1793
- const [t, n] = ft(e);
1813
+ }), Ks = (e, r) => {
1814
+ const [t, n] = gt(e);
1794
1815
  return `${t.slice(0, r)}${n}`;
1795
- }, tr = (e) => ({
1796
- name: qs(e.name, 42),
1816
+ }, ir = (e) => ({
1817
+ name: Ks(e.name, 42),
1797
1818
  sizeKb: e.size / 1e3
1798
- }), Us = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], Ws = (e, r, t) => {
1799
- const n = ft(r.name)[1].toLowerCase(), s = [...t.map((a) => a.toLowerCase()), ...Us], i = n === "" ? "none" : s.includes(n) ? n : "other";
1819
+ }), Gs = [".heic", ".heif", ".jpg", ".jpeg", ".png", ".gif", ".webp", ".txt", ".rtf", ".odt", ".pages", ".zip"], Hs = (e, r, t) => {
1820
+ const n = gt(r.name)[1].toLowerCase(), s = [...t.map((a) => a.toLowerCase()), ...Gs], i = n === "" ? "none" : s.includes(n) ? n : "other";
1800
1821
  return `chatbot-file-refused:${e}:${i}`;
1801
- }, zs = ({
1822
+ }, Js = ({
1802
1823
  input: e,
1803
1824
  onSubmitSuccess: r,
1804
1825
  analytics: t
1805
1826
  }) => {
1806
1827
  var C;
1807
- const n = (C = j.current$.value.flow) == null ? void 0 : C.data.submissions[e.key], [s, i] = ve(js(n) && n.value.length ? {
1828
+ const n = (C = K.current$.value.flow) == null ? void 0 : C.data.submissions[e.key], [s, i] = ve(Ws(n) && n.value.length ? {
1808
1829
  status: "ready",
1809
1830
  files: n.value
1810
1831
  } : {
1811
1832
  status: "empty"
1812
- }), a = de(0), o = s.status === "ready" ? s.files : [], c = s.status === "ready" || s.status === "pending" ? s.files : [], p = s.status === "error" ? s.error : void 0, g = c.length - Qt, b = Yt(c), h = Nt(), {
1833
+ }), a = he(0), o = s.status === "ready" ? s.files : [], c = s.status === "ready" || s.status === "pending" ? s.files : [], f = s.status === "error" ? s.error : void 0, g = c.length - sr, b = nr(c), h = jt(), {
1813
1834
  t: m
1814
- } = Q(), w = (_) => {
1815
- if (!_.length)
1835
+ } = ee(), k = (x) => {
1836
+ if (!x.length)
1816
1837
  return {
1817
1838
  reason: "required",
1818
1839
  error: {
@@ -1820,10 +1841,10 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1820
1841
  message: m("validation_file")
1821
1842
  }
1822
1843
  };
1823
- if (!Kt(_, e.config.extensions))
1844
+ if (!Xt(x, e.config.extensions))
1824
1845
  return {
1825
1846
  reason: "type",
1826
- file: _.find((y) => !Kt([y], e.config.extensions)),
1847
+ file: x.find((y) => !Xt([y], e.config.extensions)),
1827
1848
  error: {
1828
1849
  type: "validate",
1829
1850
  message: m("validation_file_ext", {
@@ -1831,26 +1852,26 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1831
1852
  })
1832
1853
  }
1833
1854
  };
1834
- if (_.some((y) => y.sizeKb === 0))
1855
+ if (x.some((y) => y.sizeKb === 0))
1835
1856
  return {
1836
1857
  reason: "empty",
1837
- file: _.find((y) => y.sizeKb === 0),
1858
+ file: x.find((y) => y.sizeKb === 0),
1838
1859
  error: {
1839
1860
  type: "validate",
1840
1861
  message: m("validation_file_empty")
1841
1862
  }
1842
1863
  };
1843
- if (e.config.fileSizeLimitKib && Yt(_) > e.config.fileSizeLimitKib)
1864
+ if (e.config.fileSizeLimitKib && nr(x) > e.config.fileSizeLimitKib)
1844
1865
  return {
1845
1866
  reason: "size",
1846
1867
  error: {
1847
1868
  type: "max",
1848
1869
  message: m("validation_file_size", {
1849
- size: $e(e.config.fileSizeLimitKib)
1870
+ size: qe(e.config.fileSizeLimitKib)
1850
1871
  })
1851
1872
  }
1852
1873
  };
1853
- if (!e.config.allowMultiple && _.length > 1)
1874
+ if (!e.config.allowMultiple && x.length > 1)
1854
1875
  return {
1855
1876
  reason: "count",
1856
1877
  error: {
@@ -1860,22 +1881,22 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1860
1881
  })
1861
1882
  }
1862
1883
  };
1863
- }, S = (_, y) => {
1864
- var E, A;
1884
+ }, I = (x, y) => {
1885
+ var F, N;
1865
1886
  return t.log({
1866
1887
  event: "INTERACTION",
1867
1888
  properties: {
1868
- tag: Ws(_, y, e.config.extensions)
1889
+ tag: Hs(x, y, e.config.extensions)
1869
1890
  },
1870
- customProperties: (A = (E = j.current$.peek().flow) == null ? void 0 : E.analytics) == null ? void 0 : A.customProperties
1891
+ customProperties: (N = (F = K.current$.peek().flow) == null ? void 0 : F.analytics) == null ? void 0 : N.customProperties
1871
1892
  });
1872
1893
  };
1873
1894
  return u("form", {
1874
1895
  class: "flex flex-col gap-1 p-2.5",
1875
- onSubmit: (_) => {
1876
- if (_.preventDefault(), s.status === "pending" || s.status === "error")
1896
+ onSubmit: (x) => {
1897
+ if (x.preventDefault(), s.status === "pending" || s.status === "error")
1877
1898
  return;
1878
- const y = w(o);
1899
+ const y = k(o);
1879
1900
  y ? i({
1880
1901
  status: "error",
1881
1902
  error: y.error
@@ -1892,18 +1913,18 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1892
1913
  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",
1893
1914
  children: [c.length > 0 ? u("ul", {
1894
1915
  class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
1895
- children: [c.slice(0, Qt).map((_) => {
1896
- const [y, E] = ft(_.name);
1897
- return u(er, {
1916
+ children: [c.slice(0, sr).map((x) => {
1917
+ const [y, F] = gt(x.name);
1918
+ return u(ar, {
1898
1919
  class: "flex overflow-hidden",
1899
1920
  children: [u("span", {
1900
1921
  class: "block truncate",
1901
1922
  children: y
1902
1923
  }), u("span", {
1903
- children: E
1924
+ children: F
1904
1925
  })]
1905
1926
  });
1906
- }), g > 0 ? u(er, {
1927
+ }), g > 0 ? u(ar, {
1907
1928
  children: m("file_more", {
1908
1929
  count: g
1909
1930
  })
@@ -1933,7 +1954,7 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1933
1954
  }), e.config.fileSizeLimitKib ? u("p", {
1934
1955
  class: "text-neutral-11 text-xs",
1935
1956
  children: ["(", m("file_max_size", {
1936
- size: $e(e.config.fileSizeLimitKib)
1957
+ size: qe(e.config.fileSizeLimitKib)
1937
1958
  }), ")"]
1938
1959
  }) : null]
1939
1960
  }), u("aside", {
@@ -1945,17 +1966,17 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1945
1966
  }), u("ul", {
1946
1967
  "aria-describedby": "accepted-filetypes",
1947
1968
  class: "flex flex-wrap justify-center gap-2",
1948
- children: e.config.extensions.map((_) => u("li", {
1969
+ children: e.config.extensions.map((x) => u("li", {
1949
1970
  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",
1950
- children: _.replace(".", "")
1971
+ children: x.replace(".", "")
1951
1972
  }))
1952
1973
  })]
1953
1974
  })]
1954
1975
  }), u("p", {
1955
1976
  role: "status",
1956
- class: qe("text-neutral-11 flex items-center gap-1.5 text-xs", c.length === 0 && "sr-only"),
1977
+ class: Ke("text-neutral-11 flex items-center gap-1.5 text-xs", c.length === 0 && "sr-only"),
1957
1978
  children: s.status === "pending" ? u(we, {
1958
- children: [u(Et, {
1979
+ children: [u(Rt, {
1959
1980
  "aria-hidden": "true",
1960
1981
  class: "h-4 w-4"
1961
1982
  }), m("file_preparing", {
@@ -1963,8 +1984,8 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1963
1984
  })]
1964
1985
  }) : s.status === "ready" ? u(we, {
1965
1986
  children: [o.length > 1 ? m("file_total_size", {
1966
- size: $e(b)
1967
- }) : $e(b), u("span", {
1987
+ size: qe(b)
1988
+ }) : qe(b), u("span", {
1968
1989
  class: "sr-only",
1969
1990
  children: [". ", m("file_ready", {
1970
1991
  count: o.length
@@ -1976,43 +1997,43 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
1976
1997
  "aria-label": m("upload_file", {
1977
1998
  count: e.config.allowMultiple ? 2 : 1
1978
1999
  }),
1979
- onInput: async (_) => {
1980
- Ne(_.target instanceof HTMLInputElement);
1981
- const y = _.target.files ? Array.from(_.target.files) : [];
1982
- _.target.value = "";
1983
- const [E] = y;
1984
- if (!E)
2000
+ onInput: async (x) => {
2001
+ Ne(x.target instanceof HTMLInputElement);
2002
+ const y = x.target.files ? Array.from(x.target.files) : [];
2003
+ x.target.value = "";
2004
+ const [F] = y;
2005
+ if (!F)
1985
2006
  return;
1986
- const A = ++a.current, V = s.status === "ready", L = y.map(tr), U = w(L);
1987
- if (U)
1988
- return S(U.reason, U.file ?? E), i({
2007
+ const N = ++a.current, V = s.status === "ready", T = y.map(ir), R = k(T);
2008
+ if (R)
2009
+ return I(R.reason, R.file ?? F), i({
1989
2010
  status: "error",
1990
- error: U.error
2011
+ error: R.error
1991
2012
  });
1992
2013
  i({
1993
2014
  status: "pending",
1994
- files: L
2015
+ files: T
1995
2016
  });
1996
- let T;
2017
+ let O;
1997
2018
  try {
1998
- const q = await Promise.all(y.map(async (O) => {
2019
+ const q = await Promise.all(y.map(async (P) => {
1999
2020
  try {
2000
2021
  return {
2001
- ...tr(O),
2002
- data: await Bs(O)
2022
+ ...ir(P),
2023
+ data: await Us(P)
2003
2024
  };
2004
- } catch (J) {
2005
- throw T ?? (T = O), J;
2025
+ } catch (H) {
2026
+ throw O ?? (O = P), H;
2006
2027
  }
2007
2028
  }));
2008
- a.current === A && i({
2029
+ a.current === N && i({
2009
2030
  status: "ready",
2010
2031
  files: q
2011
2032
  });
2012
2033
  } catch {
2013
- if (a.current !== A)
2034
+ if (a.current !== N)
2014
2035
  return;
2015
- S("unreadable", T ?? E), i({
2036
+ I("unreadable", O ?? F), i({
2016
2037
  status: "error",
2017
2038
  error: {
2018
2039
  type: "invalid",
@@ -2035,56 +2056,56 @@ const Pe = ct("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
2035
2056
  onClick: () => r(null)
2036
2057
  })]
2037
2058
  })]
2038
- }), u(We, {
2039
- error: p
2059
+ }), u(He, {
2060
+ error: f
2040
2061
  })]
2041
2062
  });
2042
2063
  };
2043
- var rt = (e) => e.type === "checkbox", Le = (e) => e instanceof Date, ne = (e) => e == null;
2044
- const Xr = (e) => typeof e == "object";
2045
- var G = (e) => !ne(e) && !Array.isArray(e) && Xr(e) && !Le(e), Ks = (e) => G(e) && e.target ? rt(e.target) ? e.target.checked : e.target.value : e, Gs = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Hs = (e, r) => e.has(Gs(r)), Js = (e) => {
2064
+ var ot = (e) => e.type === "checkbox", Le = (e) => e instanceof Date, se = (e) => e == null;
2065
+ const tn = (e) => typeof e == "object";
2066
+ var X = (e) => !se(e) && !Array.isArray(e) && tn(e) && !Le(e), Zs = (e) => X(e) && e.target ? ot(e.target) ? e.target.checked : e.target.value : e, Xs = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Ys = (e, r) => e.has(Xs(r)), Qs = (e) => {
2046
2067
  const r = e.constructor && e.constructor.prototype;
2047
- return G(r) && r.hasOwnProperty("isPrototypeOf");
2048
- }, Rt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
2049
- function H(e) {
2068
+ return X(r) && r.hasOwnProperty("isPrototypeOf");
2069
+ }, Pt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
2070
+ function Y(e) {
2050
2071
  if (e instanceof Date)
2051
2072
  return new Date(e);
2052
2073
  const r = typeof FileList < "u" && e instanceof FileList;
2053
- if (Rt && (e instanceof Blob || r))
2074
+ if (Pt && (e instanceof Blob || r))
2054
2075
  return e;
2055
2076
  const t = Array.isArray(e);
2056
- if (!t && !(G(e) && Js(e)))
2077
+ if (!t && !(X(e) && Qs(e)))
2057
2078
  return e;
2058
2079
  const n = t ? [] : Object.create(Object.getPrototypeOf(e));
2059
2080
  for (const s in e)
2060
- Object.prototype.hasOwnProperty.call(e, s) && (n[s] = H(e[s]));
2081
+ Object.prototype.hasOwnProperty.call(e, s) && (n[s] = Y(e[s]));
2061
2082
  return n;
2062
2083
  }
2063
- var ht = (e) => /^\w*$/.test(e), W = (e) => e === void 0, Dt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Tt = (e) => Dt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), I = (e, r, t) => {
2064
- if (!r || !G(e))
2084
+ var bt = (e) => /^\w*$/.test(e), J = (e) => e === void 0, qt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], $t = (e) => qt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), S = (e, r, t) => {
2085
+ if (!r || !X(e))
2065
2086
  return t;
2066
- const n = (ht(r) ? [r] : Tt(r)).reduce((s, i) => ne(s) ? s : s[i], e);
2067
- return W(n) || n === e ? W(e[r]) ? t : e[r] : n;
2068
- }, ce = (e) => typeof e == "boolean", le = (e) => typeof e == "function", P = (e, r, t) => {
2087
+ const n = (bt(r) ? [r] : $t(r)).reduce((s, i) => se(s) ? s : s[i], e);
2088
+ return J(n) || n === e ? J(e[r]) ? t : e[r] : n;
2089
+ }, pe = (e) => typeof e == "boolean", ce = (e) => typeof e == "function", G = (e, r, t) => {
2069
2090
  let n = -1;
2070
- const s = ht(r) ? [r] : Tt(r), i = s.length, a = i - 1;
2091
+ const s = bt(r) ? [r] : $t(r), i = s.length, a = i - 1;
2071
2092
  for (; ++n < i; ) {
2072
2093
  const o = s[n];
2073
2094
  let c = t;
2074
2095
  if (n !== a) {
2075
- const p = e[o];
2076
- c = G(p) || Array.isArray(p) ? p : isNaN(+s[n + 1]) ? {} : [];
2096
+ const f = e[o];
2097
+ c = X(f) || Array.isArray(f) ? f : isNaN(+s[n + 1]) ? {} : [];
2077
2098
  }
2078
2099
  if (o === "__proto__" || o === "constructor" || o === "prototype")
2079
2100
  return;
2080
2101
  e[o] = c, e = e[o];
2081
2102
  }
2082
2103
  };
2083
- const rr = {
2104
+ const or = {
2084
2105
  BLUR: "blur",
2085
2106
  FOCUS_OUT: "focusout",
2086
2107
  CHANGE: "change"
2087
- }, ue = {
2108
+ }, de = {
2088
2109
  onBlur: "onBlur",
2089
2110
  onChange: "onChange",
2090
2111
  onSubmit: "onSubmit",
@@ -2098,9 +2119,9 @@ const rr = {
2098
2119
  pattern: "pattern",
2099
2120
  required: "required",
2100
2121
  validate: "validate"
2101
- }, Xs = te.createContext(null);
2102
- Xs.displayName = "HookFormControlContext";
2103
- var Zs = (e, r, t, n = !0) => {
2122
+ }, ea = re.createContext(null);
2123
+ ea.displayName = "HookFormControlContext";
2124
+ var ta = (e, r, t, n = !0) => {
2104
2125
  const s = {
2105
2126
  defaultValues: r._defaultValues
2106
2127
  };
@@ -2108,15 +2129,15 @@ var Zs = (e, r, t, n = !0) => {
2108
2129
  Object.defineProperty(s, i, {
2109
2130
  get: () => {
2110
2131
  const a = i;
2111
- return r._proxyFormState[a] !== ue.all && (r._proxyFormState[a] = !n || ue.all), t && (t[a] = !0), e[a];
2132
+ return r._proxyFormState[a] !== de.all && (r._proxyFormState[a] = !n || de.all), t && (t[a] = !0), e[a];
2112
2133
  }
2113
2134
  });
2114
2135
  return s;
2115
2136
  };
2116
- const Ys = typeof window < "u" ? te.useLayoutEffect : te.useEffect;
2117
- var ae = (e) => typeof e == "string", Qs = (e, r, t, n, s) => ae(e) ? (n && r.watch.add(e), I(t, e, s)) : Array.isArray(e) ? e.map((i) => (n && r.watch.add(i), I(t, i))) : (n && (r.watchAll = !0), t), It = (e) => ne(e) || !Xr(e);
2137
+ const ra = typeof window < "u" ? re.useLayoutEffect : re.useEffect;
2138
+ var oe = (e) => typeof e == "string", na = (e, r, t, n, s) => oe(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), Lt = (e) => se(e) || !tn(e);
2118
2139
  function Se(e, r, t = /* @__PURE__ */ new WeakSet()) {
2119
- if (It(e) || It(r))
2140
+ if (Lt(e) || Lt(r))
2120
2141
  return Object.is(e, r);
2121
2142
  if (Le(e) && Le(r))
2122
2143
  return Object.is(e.getTime(), r.getTime());
@@ -2132,21 +2153,21 @@ function Se(e, r, t = /* @__PURE__ */ new WeakSet()) {
2132
2153
  return !1;
2133
2154
  if (i !== "ref") {
2134
2155
  const o = r[i];
2135
- if (Le(a) && Le(o) || G(a) && G(o) || Array.isArray(a) && Array.isArray(o) ? !Se(a, o, t) : !Object.is(a, o))
2156
+ if (Le(a) && Le(o) || X(a) && X(o) || Array.isArray(a) && Array.isArray(o) ? !Se(a, o, t) : !Object.is(a, o))
2136
2157
  return !1;
2137
2158
  }
2138
2159
  }
2139
2160
  return !0;
2140
2161
  }
2141
- const ea = te.createContext(null);
2142
- ea.displayName = "HookFormContext";
2143
- var Zr = (e, r, t, n, s) => r ? {
2162
+ const sa = re.createContext(null);
2163
+ sa.displayName = "HookFormContext";
2164
+ var rn = (e, r, t, n, s) => r ? {
2144
2165
  ...t[e],
2145
2166
  types: {
2146
2167
  ...t[e] && t[e].types ? t[e].types : {},
2147
2168
  [n]: s || !0
2148
2169
  }
2149
- } : {}, et = (e) => Array.isArray(e) ? e : [e], nr = () => {
2170
+ } : {}, at = (e) => Array.isArray(e) ? e : [e], lr = () => {
2150
2171
  let e = [];
2151
2172
  return {
2152
2173
  get observers() {
@@ -2166,64 +2187,64 @@ var Zr = (e, r, t, n, s) => r ? {
2166
2187
  }
2167
2188
  };
2168
2189
  };
2169
- function Yr(e, r) {
2190
+ function nn(e, r) {
2170
2191
  const t = {};
2171
2192
  for (const n in e)
2172
2193
  if (e.hasOwnProperty(n)) {
2173
2194
  const s = e[n], i = r[n];
2174
- if (s && G(s) && i) {
2175
- const a = Yr(s, i);
2176
- G(a) && (t[n] = a);
2195
+ if (s && X(s) && i) {
2196
+ const a = nn(s, i);
2197
+ X(a) && (t[n] = a);
2177
2198
  } else
2178
2199
  e[n] && (t[n] = i);
2179
2200
  }
2180
2201
  return t;
2181
2202
  }
2182
- var re = (e) => G(e) && !Object.keys(e).length, Ot = (e) => e.type === "file", ot = (e) => {
2183
- if (!Rt)
2203
+ var ne = (e) => X(e) && !Object.keys(e).length, Ut = (e) => e.type === "file", ft = (e) => {
2204
+ if (!Pt)
2184
2205
  return !1;
2185
2206
  const r = e ? e.ownerDocument : 0;
2186
2207
  return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
2187
- }, Qr = (e) => e.type === "select-multiple", $t = (e) => e.type === "radio", ta = (e) => $t(e) || rt(e), kt = (e) => ot(e) && e.isConnected;
2188
- function ra(e, r) {
2208
+ }, sn = (e) => e.type === "select-multiple", Wt = (e) => e.type === "radio", aa = (e) => Wt(e) || ot(e), Et = (e) => ft(e) && e.isConnected;
2209
+ function ia(e, r) {
2189
2210
  const t = r.slice(0, -1).length;
2190
2211
  let n = 0;
2191
2212
  for (; n < t; )
2192
- e = W(e) ? n++ : e[r[n++]];
2213
+ e = J(e) ? n++ : e[r[n++]];
2193
2214
  return e;
2194
2215
  }
2195
- function na(e) {
2216
+ function oa(e) {
2196
2217
  for (const r in e)
2197
- if (e.hasOwnProperty(r) && !W(e[r]))
2218
+ if (e.hasOwnProperty(r) && !J(e[r]))
2198
2219
  return !1;
2199
2220
  return !0;
2200
2221
  }
2201
- function K(e, r) {
2202
- const t = Array.isArray(r) ? r : ht(r) ? [r] : Tt(r), n = t.length === 1 ? e : ra(e, t), s = t.length - 1, i = t[s];
2203
- return n && delete n[i], s !== 0 && (G(n) && re(n) || Array.isArray(n) && na(n)) && K(e, t.slice(0, -1)), e;
2222
+ function Z(e, r) {
2223
+ const t = Array.isArray(r) ? r : bt(r) ? [r] : $t(r), n = t.length === 1 ? e : ia(e, t), s = t.length - 1, i = t[s];
2224
+ return n && delete n[i], s !== 0 && (X(n) && ne(n) || Array.isArray(n) && oa(n)) && Z(e, t.slice(0, -1)), e;
2204
2225
  }
2205
- var sa = (e) => {
2226
+ var la = (e) => {
2206
2227
  for (const r in e)
2207
- if (le(e[r]))
2228
+ if (ce(e[r]))
2208
2229
  return !0;
2209
2230
  return !1;
2210
2231
  };
2211
- function en(e) {
2212
- return Array.isArray(e) || G(e) && !sa(e);
2232
+ function an(e) {
2233
+ return Array.isArray(e) || X(e) && !la(e);
2213
2234
  }
2214
- function At(e, r = {}) {
2235
+ function Nt(e, r = {}) {
2215
2236
  for (const t in e) {
2216
2237
  const n = e[t];
2217
- en(n) ? (r[t] = Array.isArray(n) ? [] : {}, At(n, r[t])) : W(n) || (r[t] = !0);
2238
+ an(n) ? (r[t] = Array.isArray(n) ? [] : {}, Nt(n, r[t])) : J(n) || (r[t] = !0);
2218
2239
  }
2219
2240
  return r;
2220
2241
  }
2221
- function Oe(e, r, t) {
2222
- t || (t = At(r));
2242
+ function Pe(e, r, t) {
2243
+ t || (t = Nt(r));
2223
2244
  for (const n in e) {
2224
2245
  const s = e[n];
2225
- if (en(s))
2226
- W(r) || It(t[n]) ? t[n] = At(s, Array.isArray(s) ? [] : {}) : Oe(s, ne(r) ? {} : r[n], t[n]);
2246
+ if (an(s))
2247
+ J(r) || Lt(t[n]) ? t[n] = Nt(s, Array.isArray(s) ? [] : {}) : Pe(s, se(r) ? {} : r[n], t[n]);
2227
2248
  else {
2228
2249
  const i = r[n];
2229
2250
  t[n] = !Se(s, i);
@@ -2231,11 +2252,11 @@ function Oe(e, r, t) {
2231
2252
  }
2232
2253
  return t;
2233
2254
  }
2234
- const sr = {
2255
+ const ur = {
2235
2256
  value: !1,
2236
2257
  isValid: !1
2237
- }, ar = { value: !0, isValid: !0 };
2238
- var tn = (e) => {
2258
+ }, cr = { value: !0, isValid: !0 };
2259
+ var on = (e) => {
2239
2260
  if (Array.isArray(e)) {
2240
2261
  if (e.length > 1) {
2241
2262
  const r = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
@@ -2243,28 +2264,28 @@ var tn = (e) => {
2243
2264
  }
2244
2265
  return e[0].checked && !e[0].disabled ? (
2245
2266
  // @ts-expect-error expected to work in the browser
2246
- e[0].attributes && !W(e[0].attributes.value) ? W(e[0].value) || e[0].value === "" ? ar : { value: e[0].value, isValid: !0 } : ar
2247
- ) : sr;
2267
+ e[0].attributes && !J(e[0].attributes.value) ? J(e[0].value) || e[0].value === "" ? cr : { value: e[0].value, isValid: !0 } : cr
2268
+ ) : ur;
2248
2269
  }
2249
- return sr;
2250
- }, rn = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) => W(e) ? e : r ? e === "" ? NaN : e && +e : t && ae(e) ? new Date(e) : n ? n(e) : e;
2251
- const ir = {
2270
+ return ur;
2271
+ }, ln = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: n }) => J(e) ? e : r ? e === "" ? NaN : e && +e : t && oe(e) ? new Date(e) : n ? n(e) : e;
2272
+ const dr = {
2252
2273
  isValid: !1,
2253
2274
  value: null
2254
2275
  };
2255
- var nn = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disabled ? {
2276
+ var un = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disabled ? {
2256
2277
  isValid: !0,
2257
2278
  value: t.value
2258
- } : r, ir) : ir;
2259
- function or(e) {
2279
+ } : r, dr) : dr;
2280
+ function fr(e) {
2260
2281
  const r = e.ref;
2261
- return Ot(r) ? r.files : $t(r) ? nn(e.refs).value : Qr(r) ? [...r.selectedOptions].map(({ value: t }) => t) : rt(r) ? tn(e.refs).value : rn(W(r.value) ? e.ref.value : r.value, e);
2282
+ return Ut(r) ? r.files : Wt(r) ? un(e.refs).value : sn(r) ? [...r.selectedOptions].map(({ value: t }) => t) : ot(r) ? on(e.refs).value : ln(J(r.value) ? e.ref.value : r.value, e);
2262
2283
  }
2263
- var aa = (e, r, t, n) => {
2284
+ var ua = (e, r, t, n) => {
2264
2285
  const s = {};
2265
2286
  for (const i of e) {
2266
- const a = I(r, i);
2267
- a && P(s, i, a._f);
2287
+ const a = S(r, i);
2288
+ a && G(s, i, a._f);
2268
2289
  }
2269
2290
  return {
2270
2291
  criteriaMode: t,
@@ -2272,18 +2293,18 @@ var aa = (e, r, t, n) => {
2272
2293
  fields: s,
2273
2294
  shouldUseNativeValidation: n
2274
2295
  };
2275
- }, lt = (e) => e instanceof RegExp, Je = (e) => W(e) ? e : lt(e) ? e.source : G(e) ? lt(e.value) ? e.value.source : e.value : e, lr = (e) => ({
2276
- isOnSubmit: !e || e === ue.onSubmit,
2277
- isOnBlur: e === ue.onBlur,
2278
- isOnChange: e === ue.onChange,
2279
- isOnAll: e === ue.all,
2280
- isOnTouch: e === ue.onTouched
2296
+ }, pt = (e) => e instanceof RegExp, tt = (e) => J(e) ? e : pt(e) ? e.source : X(e) ? pt(e.value) ? e.value.source : e.value : e, pr = (e) => ({
2297
+ isOnSubmit: !e || e === de.onSubmit,
2298
+ isOnBlur: e === de.onBlur,
2299
+ isOnChange: e === de.onChange,
2300
+ isOnAll: e === de.all,
2301
+ isOnTouch: e === de.onTouched
2281
2302
  });
2282
- const ur = "AsyncFunction";
2283
- var ia = (e) => !!e && !!e.validate && !!(le(e.validate) && e.validate.constructor.name === ur || G(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === ur)), oa = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), cr = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
2284
- const tt = (e, r, t, n) => {
2303
+ const hr = "AsyncFunction";
2304
+ var ca = (e) => !!e && !!e.validate && !!(ce(e.validate) && e.validate.constructor.name === hr || X(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === hr)), da = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), mr = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((n) => e.startsWith(n) && /^\.\w+/.test(e.slice(n.length))));
2305
+ const it = (e, r, t, n) => {
2285
2306
  for (const s of t || Object.keys(e)) {
2286
- const i = I(e, s);
2307
+ const i = S(e, s);
2287
2308
  if (i) {
2288
2309
  const { _f: a, ...o } = i;
2289
2310
  if (a) {
@@ -2291,23 +2312,23 @@ const tt = (e, r, t, n) => {
2291
2312
  return !0;
2292
2313
  if (a.ref && r(a.ref, a.name) && !n)
2293
2314
  return !0;
2294
- if (tt(o, r))
2315
+ if (it(o, r))
2295
2316
  break;
2296
- } else if (G(o) && tt(o, r))
2317
+ } else if (X(o) && it(o, r))
2297
2318
  break;
2298
2319
  }
2299
2320
  }
2300
2321
  };
2301
- function dr(e, r, t) {
2302
- const n = I(e, t);
2303
- if (n || ht(t))
2322
+ function yr(e, r, t) {
2323
+ const n = S(e, t);
2324
+ if (n || bt(t))
2304
2325
  return {
2305
2326
  error: n,
2306
2327
  name: t
2307
2328
  };
2308
2329
  const s = t.split(".");
2309
2330
  for (; s.length; ) {
2310
- const i = s.join("."), a = I(r, i), o = I(e, i);
2331
+ const i = s.join("."), a = S(r, i), o = S(e, i);
2311
2332
  if (a && !Array.isArray(a) && t !== i)
2312
2333
  return { name: t };
2313
2334
  if (o && o.type)
@@ -2326,120 +2347,120 @@ function dr(e, r, t) {
2326
2347
  name: t
2327
2348
  };
2328
2349
  }
2329
- var la = (e, r, t, n) => {
2350
+ var fa = (e, r, t, n) => {
2330
2351
  t(e);
2331
2352
  const { name: s, ...i } = e;
2332
- return re(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((a) => r[a] === (!n || ue.all));
2333
- }, ua = (e, r, t) => !e || !r || e === r || et(e).some((n) => n && (t ? n === r : n.startsWith(r) || r.startsWith(n))), ca = (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, da = (e, r) => !Dt(I(e, r)).length && K(e, r), fa = (e, r, t) => {
2334
- const n = et(I(e, t));
2335
- return P(n, "root", r[t]), P(e, t, n), e;
2353
+ return ne(i) || Object.keys(i).length >= Object.keys(r).length || Object.keys(i).find((a) => r[a] === (!n || de.all));
2354
+ }, pa = (e, r, t) => !e || !r || e === r || at(e).some((n) => n && (t ? n === r : n.startsWith(r) || r.startsWith(n))), ha = (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, ma = (e, r) => !qt(S(e, r)).length && Z(e, r), ya = (e, r, t) => {
2355
+ const n = at(S(e, t));
2356
+ return G(n, "root", r[t]), G(e, t, n), e;
2336
2357
  };
2337
- function fr(e, r, t = "validate") {
2338
- if (ae(e) || Array.isArray(e) && e.every(ae) || ce(e) && !e)
2358
+ function gr(e, r, t = "validate") {
2359
+ if (oe(e) || Array.isArray(e) && e.every(oe) || pe(e) && !e)
2339
2360
  return {
2340
2361
  type: t,
2341
- message: ae(e) ? e : "",
2362
+ message: oe(e) ? e : "",
2342
2363
  ref: r
2343
2364
  };
2344
2365
  }
2345
- var Te = (e) => G(e) && !lt(e) ? e : {
2366
+ var je = (e) => X(e) && !pt(e) ? e : {
2346
2367
  value: e,
2347
2368
  message: ""
2348
- }, hr = async (e, r, t, n, s, i) => {
2349
- const { ref: a, refs: o, required: c, maxLength: p, minLength: g, min: b, max: h, pattern: m, validate: w, name: S, valueAsNumber: C, mount: _ } = e._f, y = I(t, S);
2350
- if (!_ || r.has(S))
2369
+ }, br = async (e, r, t, n, s, i) => {
2370
+ const { ref: a, refs: o, required: c, maxLength: f, minLength: g, min: b, max: h, pattern: m, validate: k, name: I, valueAsNumber: C, mount: x } = e._f, y = S(t, I);
2371
+ if (!x || r.has(I))
2351
2372
  return {};
2352
- const E = o ? o[0] : a, A = (N) => {
2353
- s && E.reportValidity && (E.setCustomValidity(ce(N) ? "" : N || ""), E.reportValidity());
2354
- }, V = {}, L = $t(a), U = rt(a), T = L || U, q = (C || Ot(a)) && W(a.value) && W(y) || ot(a) && a.value === "" || y === "" || Array.isArray(y) && !y.length, O = Zr.bind(null, S, n, V), J = (N, R, M, z = be.maxLength, X = be.minLength) => {
2355
- const Z = N ? R : M;
2356
- V[S] = {
2357
- type: N ? z : X,
2358
- message: Z,
2373
+ const F = o ? o[0] : a, N = (M) => {
2374
+ s && F.reportValidity && (F.setCustomValidity(pe(M) ? "" : M || ""), F.reportValidity());
2375
+ }, V = {}, T = Wt(a), R = ot(a), O = T || R, q = (C || Ut(a)) && J(a.value) && J(y) || ft(a) && a.value === "" || y === "" || Array.isArray(y) && !y.length, P = rn.bind(null, I, n, V), H = (M, A, B, $ = be.maxLength, U = be.minLength) => {
2376
+ const j = M ? A : B;
2377
+ V[I] = {
2378
+ type: M ? $ : U,
2379
+ message: j,
2359
2380
  ref: a,
2360
- ...O(N ? z : X, Z)
2381
+ ...P(M ? $ : U, j)
2361
2382
  };
2362
2383
  };
2363
- if (i ? !Array.isArray(y) || !y.length : c && (!T && (q || ne(y)) || ce(y) && !y || U && !tn(o).isValid || L && !nn(o).isValid)) {
2364
- const { value: N, message: R } = ae(c) ? { value: !!c, message: c } : Te(c);
2365
- if (N && (V[S] = {
2384
+ if (i ? !Array.isArray(y) || !y.length : c && (!O && (q || se(y)) || pe(y) && !y || R && !on(o).isValid || T && !un(o).isValid)) {
2385
+ const { value: M, message: A } = oe(c) ? { value: !!c, message: c } : je(c);
2386
+ if (M && (V[I] = {
2366
2387
  type: be.required,
2367
- message: R,
2368
- ref: E,
2369
- ...O(be.required, R)
2388
+ message: A,
2389
+ ref: F,
2390
+ ...P(be.required, A)
2370
2391
  }, !n))
2371
- return A(R), V;
2392
+ return N(A), V;
2372
2393
  }
2373
- if (!q && (!ne(b) || !ne(h))) {
2374
- let N, R;
2375
- const M = Te(h), z = Te(b);
2376
- if (!ne(y) && !isNaN(y)) {
2377
- const X = a.valueAsNumber || y && +y;
2378
- ne(M.value) || (N = X > M.value), ne(z.value) || (R = X < z.value);
2394
+ if (!q && (!se(b) || !se(h))) {
2395
+ let M, A;
2396
+ const B = je(h), $ = je(b);
2397
+ if (!se(y) && !isNaN(y)) {
2398
+ const U = a.valueAsNumber || y && +y;
2399
+ se(B.value) || (M = U > B.value), se($.value) || (A = U < $.value);
2379
2400
  } else {
2380
- const X = a.valueAsDate || new Date(y), Z = (pe) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + pe), oe = a.type == "time", _e = a.type == "week";
2381
- ae(M.value) && y && (N = oe ? Z(y) > Z(M.value) : _e ? y > M.value : X > new Date(M.value)), ae(z.value) && y && (R = oe ? Z(y) < Z(z.value) : _e ? y < z.value : X < new Date(z.value));
2401
+ const U = a.valueAsDate || new Date(y), j = (ue) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ue), D = a.type == "time", le = a.type == "week";
2402
+ oe(B.value) && y && (M = D ? j(y) > j(B.value) : le ? y > B.value : U > new Date(B.value)), oe($.value) && y && (A = D ? j(y) < j($.value) : le ? y < $.value : U < new Date($.value));
2382
2403
  }
2383
- if ((N || R) && (J(!!N, M.message, z.message, be.max, be.min), !n))
2384
- return A(V[S].message), V;
2404
+ if ((M || A) && (H(!!M, B.message, $.message, be.max, be.min), !n))
2405
+ return N(V[I].message), V;
2385
2406
  }
2386
- if ((p || g) && !q && (ae(y) || i && Array.isArray(y))) {
2387
- const N = Te(p), R = Te(g), M = !ne(N.value) && y.length > +N.value, z = !ne(R.value) && y.length < +R.value;
2388
- if ((M || z) && (J(M, N.message, R.message), !n))
2389
- return A(V[S].message), V;
2407
+ if ((f || g) && !q && (oe(y) || i && Array.isArray(y))) {
2408
+ const M = je(f), A = je(g), B = !se(M.value) && y.length > +M.value, $ = !se(A.value) && y.length < +A.value;
2409
+ if ((B || $) && (H(B, M.message, A.message), !n))
2410
+ return N(V[I].message), V;
2390
2411
  }
2391
- if (m && !q && ae(y)) {
2392
- const { value: N, message: R } = Te(m);
2393
- if (lt(N) && !y.match(N) && (V[S] = {
2412
+ if (m && !q && oe(y)) {
2413
+ const { value: M, message: A } = je(m);
2414
+ if (pt(M) && !y.match(M) && (V[I] = {
2394
2415
  type: be.pattern,
2395
- message: R,
2416
+ message: A,
2396
2417
  ref: a,
2397
- ...O(be.pattern, R)
2418
+ ...P(be.pattern, A)
2398
2419
  }, !n))
2399
- return A(R), V;
2420
+ return N(A), V;
2400
2421
  }
2401
- if (w) {
2402
- if (le(w)) {
2403
- const N = await w(y, t), R = fr(N, E);
2404
- if (R && (V[S] = {
2405
- ...R,
2406
- ...O(be.validate, R.message)
2422
+ if (k) {
2423
+ if (ce(k)) {
2424
+ const M = await k(y, t), A = gr(M, F);
2425
+ if (A && (V[I] = {
2426
+ ...A,
2427
+ ...P(be.validate, A.message)
2407
2428
  }, !n))
2408
- return A(R.message), V;
2409
- } else if (G(w)) {
2410
- let N = {};
2411
- for (const R in w) {
2412
- if (!re(N) && !n)
2429
+ return N(A.message), V;
2430
+ } else if (X(k)) {
2431
+ let M = {};
2432
+ for (const A in k) {
2433
+ if (!ne(M) && !n)
2413
2434
  break;
2414
- const M = fr(await w[R](y, t), E, R);
2415
- M && (N = {
2416
- ...M,
2417
- ...O(R, M.message)
2418
- }, A(M.message), n && (V[S] = N));
2435
+ const B = gr(await k[A](y, t), F, A);
2436
+ B && (M = {
2437
+ ...B,
2438
+ ...P(A, B.message)
2439
+ }, N(B.message), n && (V[I] = M));
2419
2440
  }
2420
- if (!re(N) && (V[S] = {
2421
- ref: E,
2422
- ...N
2441
+ if (!ne(M) && (V[I] = {
2442
+ ref: F,
2443
+ ...M
2423
2444
  }, !n))
2424
2445
  return V;
2425
2446
  }
2426
2447
  }
2427
- return A(!0), V;
2448
+ return N(!0), V;
2428
2449
  };
2429
- const ha = {
2430
- mode: ue.onSubmit,
2431
- reValidateMode: ue.onChange,
2450
+ const ga = {
2451
+ mode: de.onSubmit,
2452
+ reValidateMode: de.onChange,
2432
2453
  shouldFocusError: !0
2433
2454
  };
2434
- function pa(e = {}) {
2455
+ function ba(e = {}) {
2435
2456
  let r = {
2436
- ...ha,
2457
+ ...ga,
2437
2458
  ...e
2438
2459
  }, t = {
2439
2460
  submitCount: 0,
2440
2461
  isDirty: !1,
2441
2462
  isReady: !1,
2442
- isLoading: le(r.defaultValues),
2463
+ isLoading: ce(r.defaultValues),
2443
2464
  isValidating: !1,
2444
2465
  isSubmitted: !1,
2445
2466
  isSubmitting: !1,
@@ -2450,7 +2471,7 @@ function pa(e = {}) {
2450
2471
  validatingFields: {},
2451
2472
  errors: r.errors || {},
2452
2473
  disabled: r.disabled || !1
2453
- }, n = {}, s = G(r.defaultValues) || G(r.values) ? H(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : H(s), a = {
2474
+ }, n = {}, s = X(r.defaultValues) || X(r.values) ? Y(r.defaultValues || r.values) || {} : {}, i = r.shouldUnregister ? {} : Y(s), a = {
2454
2475
  action: !1,
2455
2476
  mount: !1,
2456
2477
  watch: !1,
@@ -2461,7 +2482,7 @@ function pa(e = {}) {
2461
2482
  unMount: /* @__PURE__ */ new Set(),
2462
2483
  array: /* @__PURE__ */ new Set(),
2463
2484
  watch: /* @__PURE__ */ new Set()
2464
- }, c, p = 0;
2485
+ }, c, f = 0;
2465
2486
  const g = {
2466
2487
  isDirty: !1,
2467
2488
  dirtyFields: !1,
@@ -2477,407 +2498,407 @@ function pa(e = {}) {
2477
2498
  ...b
2478
2499
  };
2479
2500
  const m = {
2480
- array: nr(),
2481
- state: nr()
2482
- }, w = r.criteriaMode === ue.all, S = (l) => (d) => {
2483
- clearTimeout(p), p = setTimeout(l, d);
2501
+ array: lr(),
2502
+ state: lr()
2503
+ }, k = r.criteriaMode === de.all, I = (l) => (d) => {
2504
+ clearTimeout(f), f = setTimeout(l, d);
2484
2505
  }, C = async (l) => {
2485
2506
  if (!a.keepIsValid && !r.disabled && (b.isValid || h.isValid || l)) {
2486
2507
  let d;
2487
- r.resolver ? (d = re((await T()).errors), _()) : d = await O(n, !0), d !== t.isValid && m.state.next({
2508
+ r.resolver ? (d = ne((await O()).errors), x()) : d = await P(n, !0), d !== t.isValid && m.state.next({
2488
2509
  isValid: d
2489
2510
  });
2490
2511
  }
2491
- }, _ = (l, d) => {
2492
- !r.disabled && (b.isValidating || b.validatingFields || h.isValidating || h.validatingFields) && ((l || Array.from(o.mount)).forEach((f) => {
2493
- f && (d ? P(t.validatingFields, f, d) : K(t.validatingFields, f));
2512
+ }, x = (l, d) => {
2513
+ !r.disabled && (b.isValidating || b.validatingFields || h.isValidating || h.validatingFields) && ((l || Array.from(o.mount)).forEach((p) => {
2514
+ p && (d ? G(t.validatingFields, p, d) : Z(t.validatingFields, p));
2494
2515
  }), m.state.next({
2495
2516
  validatingFields: t.validatingFields,
2496
- isValidating: !re(t.validatingFields)
2517
+ isValidating: !ne(t.validatingFields)
2497
2518
  }));
2498
- }, y = (l, d = [], f, k, x = !0, v = !0) => {
2499
- if (k && f && !r.disabled) {
2500
- if (a.action = !0, v && Array.isArray(I(n, l))) {
2501
- const F = f(I(n, l), k.argA, k.argB);
2502
- x && P(n, l, F);
2519
+ }, y = (l, d = [], p, _, w = !0, v = !0) => {
2520
+ if (_ && p && !r.disabled) {
2521
+ if (a.action = !0, v && Array.isArray(S(n, l))) {
2522
+ const E = p(S(n, l), _.argA, _.argB);
2523
+ w && G(n, l, E);
2503
2524
  }
2504
- if (v && Array.isArray(I(t.errors, l))) {
2505
- const F = f(I(t.errors, l), k.argA, k.argB);
2506
- x && P(t.errors, l, F), da(t.errors, l);
2525
+ if (v && Array.isArray(S(t.errors, l))) {
2526
+ const E = p(S(t.errors, l), _.argA, _.argB);
2527
+ w && G(t.errors, l, E), ma(t.errors, l);
2507
2528
  }
2508
- if ((b.touchedFields || h.touchedFields) && v && Array.isArray(I(t.touchedFields, l))) {
2509
- const F = f(I(t.touchedFields, l), k.argA, k.argB);
2510
- x && P(t.touchedFields, l, F);
2529
+ if ((b.touchedFields || h.touchedFields) && v && Array.isArray(S(t.touchedFields, l))) {
2530
+ const E = p(S(t.touchedFields, l), _.argA, _.argB);
2531
+ w && G(t.touchedFields, l, E);
2511
2532
  }
2512
- (b.dirtyFields || h.dirtyFields) && (t.dirtyFields = Oe(s, i)), m.state.next({
2533
+ (b.dirtyFields || h.dirtyFields) && (t.dirtyFields = Pe(s, i)), m.state.next({
2513
2534
  name: l,
2514
- isDirty: N(l, d),
2535
+ isDirty: M(l, d),
2515
2536
  dirtyFields: t.dirtyFields,
2516
2537
  errors: t.errors,
2517
2538
  isValid: t.isValid
2518
2539
  });
2519
2540
  } else
2520
- P(i, l, d);
2521
- }, E = (l, d) => {
2522
- P(t.errors, l, d), m.state.next({
2541
+ G(i, l, d);
2542
+ }, F = (l, d) => {
2543
+ G(t.errors, l, d), m.state.next({
2523
2544
  errors: t.errors
2524
2545
  });
2525
- }, A = (l) => {
2546
+ }, N = (l) => {
2526
2547
  t.errors = l, m.state.next({
2527
2548
  errors: t.errors,
2528
2549
  isValid: !1
2529
2550
  });
2530
- }, V = (l, d, f, k) => {
2531
- const x = I(n, l);
2532
- if (x) {
2533
- const v = I(i, l, W(f) ? I(s, l) : f);
2534
- W(v) || k && k.defaultChecked || d ? P(i, l, d ? v : or(x._f)) : z(l, v), a.mount && !a.action && C();
2535
- }
2536
- }, L = (l, d, f, k, x) => {
2537
- let v = !1, F = !1;
2538
- const $ = {
2551
+ }, V = (l, d, p, _) => {
2552
+ const w = S(n, l);
2553
+ if (w) {
2554
+ const v = S(i, l, J(p) ? S(s, l) : p);
2555
+ J(v) || _ && _.defaultChecked || d ? G(i, l, d ? v : fr(w._f)) : $(l, v), a.mount && !a.action && C();
2556
+ }
2557
+ }, T = (l, d, p, _, w) => {
2558
+ let v = !1, E = !1;
2559
+ const W = {
2539
2560
  name: l
2540
2561
  };
2541
2562
  if (!r.disabled) {
2542
- if (!f || k) {
2543
- (b.isDirty || h.isDirty) && (F = t.isDirty, t.isDirty = $.isDirty = N(), v = F !== $.isDirty);
2544
- const B = Se(I(s, l), d);
2545
- F = !!I(t.dirtyFields, l), B ? K(t.dirtyFields, l) : P(t.dirtyFields, l, !0), $.dirtyFields = t.dirtyFields, v = v || (b.dirtyFields || h.dirtyFields) && F !== !B;
2563
+ if (!p || _) {
2564
+ (b.isDirty || h.isDirty) && (E = t.isDirty, t.isDirty = W.isDirty = M(), v = E !== W.isDirty);
2565
+ const z = Se(S(s, l), d);
2566
+ E = !!S(t.dirtyFields, l), z ? Z(t.dirtyFields, l) : G(t.dirtyFields, l, !0), W.dirtyFields = t.dirtyFields, v = v || (b.dirtyFields || h.dirtyFields) && E !== !z;
2546
2567
  }
2547
- if (f) {
2548
- const B = I(t.touchedFields, l);
2549
- B || (P(t.touchedFields, l, f), $.touchedFields = t.touchedFields, v = v || (b.touchedFields || h.touchedFields) && B !== f);
2568
+ if (p) {
2569
+ const z = S(t.touchedFields, l);
2570
+ z || (G(t.touchedFields, l, p), W.touchedFields = t.touchedFields, v = v || (b.touchedFields || h.touchedFields) && z !== p);
2550
2571
  }
2551
- v && x && m.state.next($);
2552
- }
2553
- return v ? $ : {};
2554
- }, U = (l, d, f, k) => {
2555
- const x = I(t.errors, l), v = (b.isValid || h.isValid) && ce(d) && t.isValid !== d;
2556
- if (r.delayError && f ? (c = S(() => E(l, f)), c(r.delayError)) : (clearTimeout(p), c = null, f ? P(t.errors, l, f) : K(t.errors, l)), (f ? !Se(x, f) : x) || !re(k) || v) {
2557
- const F = {
2558
- ...k,
2559
- ...v && ce(d) ? { isValid: d } : {},
2572
+ v && w && m.state.next(W);
2573
+ }
2574
+ return v ? W : {};
2575
+ }, R = (l, d, p, _) => {
2576
+ const w = S(t.errors, l), v = (b.isValid || h.isValid) && pe(d) && t.isValid !== d;
2577
+ if (r.delayError && p ? (c = I(() => F(l, p)), c(r.delayError)) : (clearTimeout(f), c = null, p ? G(t.errors, l, p) : Z(t.errors, l)), (p ? !Se(w, p) : w) || !ne(_) || v) {
2578
+ const E = {
2579
+ ..._,
2580
+ ...v && pe(d) ? { isValid: d } : {},
2560
2581
  errors: t.errors,
2561
2582
  name: l
2562
2583
  };
2563
2584
  t = {
2564
2585
  ...t,
2565
- ...F
2566
- }, m.state.next(F);
2567
- }
2568
- }, T = async (l) => (_(l, !0), await r.resolver(i, r.context, aa(l || o.mount, n, r.criteriaMode, r.shouldUseNativeValidation))), q = async (l) => {
2569
- const { errors: d } = await T(l);
2570
- if (_(l), l)
2571
- for (const f of l) {
2572
- const k = I(d, f);
2573
- k ? P(t.errors, f, k) : K(t.errors, f);
2586
+ ...E
2587
+ }, m.state.next(E);
2588
+ }
2589
+ }, O = async (l) => (x(l, !0), await r.resolver(i, r.context, ua(l || o.mount, n, r.criteriaMode, r.shouldUseNativeValidation))), q = async (l) => {
2590
+ const { errors: d } = await O(l);
2591
+ if (x(l), l)
2592
+ for (const p of l) {
2593
+ const _ = S(d, p);
2594
+ _ ? G(t.errors, p, _) : Z(t.errors, p);
2574
2595
  }
2575
2596
  else
2576
2597
  t.errors = d;
2577
2598
  return d;
2578
- }, O = async (l, d, f = {
2599
+ }, P = async (l, d, p = {
2579
2600
  valid: !0
2580
2601
  }) => {
2581
- for (const k in l) {
2582
- const x = l[k];
2583
- if (x) {
2584
- const { _f: v, ...F } = x;
2602
+ for (const _ in l) {
2603
+ const w = l[_];
2604
+ if (w) {
2605
+ const { _f: v, ...E } = w;
2585
2606
  if (v) {
2586
- const $ = o.array.has(v.name), B = x._f && ia(x._f);
2587
- B && b.validatingFields && _([v.name], !0);
2588
- const ee = await hr(x, o.disabled, i, w, r.shouldUseNativeValidation && !d, $);
2589
- if (B && b.validatingFields && _([v.name]), ee[v.name] && (f.valid = !1, d || e.shouldUseNativeValidation))
2607
+ const W = o.array.has(v.name), z = w._f && ca(w._f);
2608
+ z && b.validatingFields && x([v.name], !0);
2609
+ const te = await br(w, o.disabled, i, k, r.shouldUseNativeValidation && !d, W);
2610
+ if (z && b.validatingFields && x([v.name]), te[v.name] && (p.valid = !1, d || e.shouldUseNativeValidation))
2590
2611
  break;
2591
- !d && (I(ee, v.name) ? $ ? fa(t.errors, ee, v.name) : P(t.errors, v.name, ee[v.name]) : K(t.errors, v.name));
2612
+ !d && (S(te, v.name) ? W ? ya(t.errors, te, v.name) : G(t.errors, v.name, te[v.name]) : Z(t.errors, v.name));
2592
2613
  }
2593
- !re(F) && await O(F, d, f);
2614
+ !ne(E) && await P(E, d, p);
2594
2615
  }
2595
2616
  }
2596
- return f.valid;
2597
- }, J = () => {
2617
+ return p.valid;
2618
+ }, H = () => {
2598
2619
  for (const l of o.unMount) {
2599
- const d = I(n, l);
2600
- d && (d._f.refs ? d._f.refs.every((f) => !kt(f)) : !kt(d._f.ref)) && De(l);
2620
+ const d = S(n, l);
2621
+ d && (d._f.refs ? d._f.refs.every((p) => !Et(p)) : !Et(d._f.ref)) && Te(l);
2601
2622
  }
2602
2623
  o.unMount = /* @__PURE__ */ new Set();
2603
- }, N = (l, d) => !r.disabled && (l && d && P(i, l, d), !Se(Fe(), s)), R = (l, d, f) => Qs(l, o, {
2604
- ...a.mount ? i : W(d) ? s : ae(l) ? { [l]: d } : d
2605
- }, f, d), M = (l) => Dt(I(a.mount ? i : s, l, r.shouldUnregister ? I(s, l, []) : [])), z = (l, d, f = {}) => {
2606
- const k = I(n, l);
2607
- let x = d;
2608
- if (k) {
2609
- const v = k._f;
2610
- v && (!v.disabled && P(i, l, rn(d, v)), x = ot(v.ref) && ne(d) ? "" : d, Qr(v.ref) ? [...v.ref.options].forEach((F) => F.selected = x.includes(F.value)) : v.refs ? rt(v.ref) ? v.refs.forEach((F) => {
2611
- (!F.defaultChecked || !F.disabled) && (Array.isArray(x) ? F.checked = !!x.find(($) => $ === F.value) : F.checked = x === F.value || !!x);
2612
- }) : v.refs.forEach((F) => F.checked = F.value === x) : Ot(v.ref) ? v.ref.value = "" : (v.ref.value = x, v.ref.type || m.state.next({
2624
+ }, M = (l, d) => !r.disabled && (l && d && G(i, l, d), !Se(Je(), s)), A = (l, d, p) => na(l, o, {
2625
+ ...a.mount ? i : J(d) ? s : oe(l) ? { [l]: d } : d
2626
+ }, p, d), B = (l) => qt(S(a.mount ? i : s, l, r.shouldUnregister ? S(s, l, []) : [])), $ = (l, d, p = {}) => {
2627
+ const _ = S(n, l);
2628
+ let w = d;
2629
+ if (_) {
2630
+ const v = _._f;
2631
+ v && (!v.disabled && G(i, l, ln(d, v)), w = ft(v.ref) && se(d) ? "" : d, sn(v.ref) ? [...v.ref.options].forEach((E) => E.selected = w.includes(E.value)) : v.refs ? ot(v.ref) ? v.refs.forEach((E) => {
2632
+ (!E.defaultChecked || !E.disabled) && (Array.isArray(w) ? E.checked = !!w.find((W) => W === E.value) : E.checked = w === E.value || !!w);
2633
+ }) : v.refs.forEach((E) => E.checked = E.value === w) : Ut(v.ref) ? v.ref.value = "" : (v.ref.value = w, v.ref.type || m.state.next({
2613
2634
  name: l,
2614
- values: H(i)
2635
+ values: Y(i)
2615
2636
  })));
2616
2637
  }
2617
- (f.shouldDirty || f.shouldTouch) && L(l, x, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && pe(l);
2618
- }, X = (l, d, f) => {
2619
- for (const k in d) {
2620
- if (!d.hasOwnProperty(k))
2638
+ (p.shouldDirty || p.shouldTouch) && T(l, w, p.shouldTouch, p.shouldDirty, !0), p.shouldValidate && ue(l);
2639
+ }, U = (l, d, p) => {
2640
+ for (const _ in d) {
2641
+ if (!d.hasOwnProperty(_))
2621
2642
  return;
2622
- const x = d[k], v = l + "." + k, F = I(n, v);
2623
- (o.array.has(l) || G(x) || F && !F._f) && !Le(x) ? X(v, x, f) : z(v, x, f);
2643
+ const w = d[_], v = l + "." + _, E = S(n, v);
2644
+ (o.array.has(l) || X(w) || E && !E._f) && !Le(w) ? U(v, w, p) : $(v, w, p);
2624
2645
  }
2625
- }, Z = (l, d, f = {}) => {
2626
- const k = I(n, l), x = o.array.has(l), v = H(d);
2627
- P(i, l, v), x ? (m.array.next({
2646
+ }, j = (l, d, p = {}) => {
2647
+ const _ = S(n, l), w = o.array.has(l), v = Y(d);
2648
+ G(i, l, v), w ? (m.array.next({
2628
2649
  name: l,
2629
- values: H(i)
2630
- }), (b.isDirty || b.dirtyFields || h.isDirty || h.dirtyFields) && f.shouldDirty && m.state.next({
2650
+ values: Y(i)
2651
+ }), (b.isDirty || b.dirtyFields || h.isDirty || h.dirtyFields) && p.shouldDirty && m.state.next({
2631
2652
  name: l,
2632
- dirtyFields: Oe(s, i),
2633
- isDirty: N(l, v)
2634
- })) : k && !k._f && !ne(v) ? X(l, v, f) : z(l, v, f), cr(l, o) ? m.state.next({
2653
+ dirtyFields: Pe(s, i),
2654
+ isDirty: M(l, v)
2655
+ })) : _ && !_._f && !se(v) ? U(l, v, p) : $(l, v, p), mr(l, o) ? m.state.next({
2635
2656
  ...t,
2636
2657
  name: l,
2637
- values: H(i)
2658
+ values: Y(i)
2638
2659
  }) : m.state.next({
2639
2660
  name: a.mount ? l : void 0,
2640
- values: H(i)
2661
+ values: Y(i)
2641
2662
  });
2642
- }, oe = async (l) => {
2663
+ }, D = async (l) => {
2643
2664
  a.mount = !0;
2644
2665
  const d = l.target;
2645
- let f = d.name, k = !0;
2646
- const x = I(n, f), v = (B) => {
2647
- k = Number.isNaN(B) || Le(B) && isNaN(B.getTime()) || Se(B, I(i, f, B));
2648
- }, F = lr(r.mode), $ = lr(r.reValidateMode);
2649
- if (x) {
2650
- let B, ee;
2651
- const Me = d.type ? or(x._f) : Ks(l), Ce = l.type === rr.BLUR || l.type === rr.FOCUS_OUT, un = !oa(x._f) && !r.resolver && !I(t.errors, f) && !x._f.deps || ca(Ce, I(t.touchedFields, f), t.isSubmitted, $, F), yt = cr(f, o, Ce);
2652
- P(i, f, Me), Ce ? (!d || !d.readOnly) && (x._f.onBlur && x._f.onBlur(l), c && c(0)) : x._f.onChange && x._f.onChange(l);
2653
- const gt = L(f, Me, Ce), cn = !re(gt) || yt;
2666
+ let p = d.name, _ = !0;
2667
+ const w = S(n, p), v = (z) => {
2668
+ _ = Number.isNaN(z) || Le(z) && isNaN(z.getTime()) || Se(z, S(i, p, z));
2669
+ }, E = pr(r.mode), W = pr(r.reValidateMode);
2670
+ if (w) {
2671
+ let z, te;
2672
+ const Me = d.type ? fr(w._f) : Zs(l), Ce = l.type === or.BLUR || l.type === or.FOCUS_OUT, dn = !da(w._f) && !r.resolver && !S(t.errors, p) && !w._f.deps || ha(Ce, S(t.touchedFields, p), t.isSubmitted, W, E), wt = mr(p, o, Ce);
2673
+ G(i, p, Me), Ce ? (!d || !d.readOnly) && (w._f.onBlur && w._f.onBlur(l), c && c(0)) : w._f.onChange && w._f.onChange(l);
2674
+ const _t = T(p, Me, Ce), fn = !ne(_t) || wt;
2654
2675
  if (!Ce && m.state.next({
2655
- name: f,
2676
+ name: p,
2656
2677
  type: l.type,
2657
- values: H(i)
2658
- }), un)
2659
- return (b.isValid || h.isValid) && (r.mode === "onBlur" ? Ce && C() : Ce || C()), cn && m.state.next({ name: f, ...yt ? {} : gt });
2660
- if (!Ce && yt && m.state.next({ ...t }), r.resolver) {
2661
- const { errors: qt } = await T([f]);
2662
- if (_([f]), v(Me), k) {
2663
- const dn = dr(t.errors, n, f), Ut = dr(qt, n, dn.name || f);
2664
- B = Ut.error, f = Ut.name, ee = re(qt);
2678
+ values: Y(i)
2679
+ }), dn)
2680
+ return (b.isValid || h.isValid) && (r.mode === "onBlur" ? Ce && C() : Ce || C()), fn && m.state.next({ name: p, ...wt ? {} : _t });
2681
+ if (!Ce && wt && m.state.next({ ...t }), r.resolver) {
2682
+ const { errors: Kt } = await O([p]);
2683
+ if (x([p]), v(Me), _) {
2684
+ const pn = yr(t.errors, n, p), Gt = yr(Kt, n, pn.name || p);
2685
+ z = Gt.error, p = Gt.name, te = ne(Kt);
2665
2686
  }
2666
2687
  } else
2667
- _([f], !0), B = (await hr(x, o.disabled, i, w, r.shouldUseNativeValidation))[f], _([f]), v(Me), k && (B ? ee = !1 : (b.isValid || h.isValid) && (ee = await O(n, !0)));
2668
- k && (x._f.deps && (!Array.isArray(x._f.deps) || x._f.deps.length > 0) && pe(x._f.deps), U(f, ee, B, gt));
2688
+ x([p], !0), z = (await br(w, o.disabled, i, k, r.shouldUseNativeValidation))[p], x([p]), v(Me), _ && (z ? te = !1 : (b.isValid || h.isValid) && (te = await P(n, !0)));
2689
+ _ && (w._f.deps && (!Array.isArray(w._f.deps) || w._f.deps.length > 0) && ue(w._f.deps), R(p, te, z, _t));
2669
2690
  }
2670
- }, _e = (l, d) => {
2671
- if (I(t.errors, d) && l.focus)
2691
+ }, le = (l, d) => {
2692
+ if (S(t.errors, d) && l.focus)
2672
2693
  return l.focus(), 1;
2673
- }, pe = async (l, d = {}) => {
2674
- let f, k;
2675
- const x = et(l);
2694
+ }, ue = async (l, d = {}) => {
2695
+ let p, _;
2696
+ const w = at(l);
2676
2697
  if (r.resolver) {
2677
- const v = await q(W(l) ? l : x);
2678
- f = re(v), k = l ? !x.some((F) => I(v, F)) : f;
2698
+ const v = await q(J(l) ? l : w);
2699
+ p = ne(v), _ = l ? !w.some((E) => S(v, E)) : p;
2679
2700
  } else
2680
- l ? (k = (await Promise.all(x.map(async (v) => {
2681
- const F = I(n, v);
2682
- return await O(F && F._f ? { [v]: F } : F);
2683
- }))).every(Boolean), !(!k && !t.isValid) && C()) : k = f = await O(n);
2701
+ l ? (_ = (await Promise.all(w.map(async (v) => {
2702
+ const E = S(n, v);
2703
+ return await P(E && E._f ? { [v]: E } : E);
2704
+ }))).every(Boolean), !(!_ && !t.isValid) && C()) : _ = p = await P(n);
2684
2705
  return m.state.next({
2685
- ...!ae(l) || (b.isValid || h.isValid) && f !== t.isValid ? {} : { name: l },
2686
- ...r.resolver || !l ? { isValid: f } : {},
2706
+ ...!oe(l) || (b.isValid || h.isValid) && p !== t.isValid ? {} : { name: l },
2707
+ ...r.resolver || !l ? { isValid: p } : {},
2687
2708
  errors: t.errors
2688
- }), d.shouldFocus && !k && tt(n, _e, l ? x : o.mount), k;
2689
- }, Fe = (l, d) => {
2690
- let f = {
2709
+ }), d.shouldFocus && !_ && it(n, le, l ? w : o.mount), _;
2710
+ }, Je = (l, d) => {
2711
+ let p = {
2691
2712
  ...a.mount ? i : s
2692
2713
  };
2693
- return d && (f = Yr(d.dirtyFields ? t.dirtyFields : t.touchedFields, f)), W(l) ? f : ae(l) ? I(f, l) : l.map((k) => I(f, k));
2694
- }, Ve = (l, d) => ({
2695
- invalid: !!I((d || t).errors, l),
2696
- isDirty: !!I((d || t).dirtyFields, l),
2697
- error: I((d || t).errors, l),
2698
- isValidating: !!I(t.validatingFields, l),
2699
- isTouched: !!I((d || t).touchedFields, l)
2700
- }), nt = (l) => {
2701
- const d = l ? et(l) : void 0;
2702
- d == null || d.forEach((f) => K(t.errors, f)), d ? d.forEach((f) => {
2714
+ return d && (p = nn(d.dirtyFields ? t.dirtyFields : t.touchedFields, p)), J(l) ? p : oe(l) ? S(p, l) : l.map((_) => S(p, _));
2715
+ }, _e = (l, d) => ({
2716
+ invalid: !!S((d || t).errors, l),
2717
+ isDirty: !!S((d || t).dirtyFields, l),
2718
+ error: S((d || t).errors, l),
2719
+ isValidating: !!S(t.validatingFields, l),
2720
+ isTouched: !!S((d || t).touchedFields, l)
2721
+ }), lt = (l) => {
2722
+ const d = l ? at(l) : void 0;
2723
+ d == null || d.forEach((p) => Z(t.errors, p)), d ? d.forEach((p) => {
2703
2724
  m.state.next({
2704
- name: f,
2725
+ name: p,
2705
2726
  errors: t.errors
2706
2727
  });
2707
2728
  }) : m.state.next({
2708
2729
  errors: {}
2709
2730
  });
2710
- }, ze = (l, d, f) => {
2711
- const k = (I(n, l, { _f: {} })._f || {}).ref, x = I(t.errors, l) || {}, { ref: v, message: F, type: $, ...B } = x;
2712
- P(t.errors, l, {
2713
- ...B,
2731
+ }, Ze = (l, d, p) => {
2732
+ const _ = (S(n, l, { _f: {} })._f || {}).ref, w = S(t.errors, l) || {}, { ref: v, message: E, type: W, ...z } = w;
2733
+ G(t.errors, l, {
2734
+ ...z,
2714
2735
  ...d,
2715
- ref: k
2736
+ ref: _
2716
2737
  }), m.state.next({
2717
2738
  name: l,
2718
2739
  errors: t.errors,
2719
2740
  isValid: !1
2720
- }), f && f.shouldFocus && k && k.focus && k.focus();
2721
- }, st = (l, d) => le(l) ? m.state.subscribe({
2722
- next: (f) => "values" in f && l(R(void 0, d), f)
2723
- }) : R(l, d, !0), Ke = (l) => m.state.subscribe({
2741
+ }), p && p.shouldFocus && _ && _.focus && _.focus();
2742
+ }, Xe = (l, d) => ce(l) ? m.state.subscribe({
2743
+ next: (p) => "values" in p && l(A(void 0, d), p)
2744
+ }) : A(l, d, !0), Fe = (l) => m.state.subscribe({
2724
2745
  next: (d) => {
2725
- ua(l.name, d.name, l.exact) && la(d, l.formState || b, ln, l.reRenderRoot) && l.callback({
2746
+ pa(l.name, d.name, l.exact) && fa(d, l.formState || b, ke, l.reRenderRoot) && l.callback({
2726
2747
  values: { ...i },
2727
2748
  ...t,
2728
2749
  ...d,
2729
2750
  defaultValues: s
2730
2751
  });
2731
2752
  }
2732
- }).unsubscribe, at = (l) => (a.mount = !0, h = {
2753
+ }).unsubscribe, De = (l) => (a.mount = !0, h = {
2733
2754
  ...h,
2734
2755
  ...l.formState
2735
- }, Ke({
2756
+ }, Fe({
2736
2757
  ...l,
2737
2758
  formState: {
2738
2759
  ...g,
2739
2760
  ...l.formState
2740
2761
  }
2741
- })), De = (l, d = {}) => {
2742
- for (const f of l ? et(l) : o.mount)
2743
- o.mount.delete(f), o.array.delete(f), d.keepValue || (K(n, f), K(i, f)), !d.keepError && K(t.errors, f), !d.keepDirty && K(t.dirtyFields, f), !d.keepTouched && K(t.touchedFields, f), !d.keepIsValidating && K(t.validatingFields, f), !r.shouldUnregister && !d.keepDefaultValue && K(s, f);
2762
+ })), Te = (l, d = {}) => {
2763
+ for (const p of l ? at(l) : o.mount)
2764
+ o.mount.delete(p), o.array.delete(p), d.keepValue || (Z(n, p), Z(i, p)), !d.keepError && Z(t.errors, p), !d.keepDirty && Z(t.dirtyFields, p), !d.keepTouched && Z(t.touchedFields, p), !d.keepIsValidating && Z(t.validatingFields, p), !r.shouldUnregister && !d.keepDefaultValue && Z(s, p);
2744
2765
  m.state.next({
2745
- values: H(i)
2766
+ values: Y(i)
2746
2767
  }), m.state.next({
2747
2768
  ...t,
2748
- ...d.keepDirty ? { isDirty: N() } : {}
2769
+ ...d.keepDirty ? { isDirty: M() } : {}
2749
2770
  }), !d.keepIsValid && C();
2750
- }, Ge = ({ disabled: l, name: d }) => {
2751
- if (ce(l) && a.mount || l || o.disabled.has(d)) {
2752
- const x = o.disabled.has(d) !== !!l;
2753
- l ? o.disabled.add(d) : o.disabled.delete(d), x && a.mount && !a.action && C();
2754
- }
2755
- }, D = (l, d = {}) => {
2756
- let f = I(n, l);
2757
- const k = ce(d.disabled) || ce(r.disabled);
2758
- return P(n, l, {
2759
- ...f || {},
2771
+ }, Ye = ({ disabled: l, name: d }) => {
2772
+ if (pe(l) && a.mount || l || o.disabled.has(d)) {
2773
+ const w = o.disabled.has(d) !== !!l;
2774
+ l ? o.disabled.add(d) : o.disabled.delete(d), w && a.mount && !a.action && C();
2775
+ }
2776
+ }, Oe = (l, d = {}) => {
2777
+ let p = S(n, l);
2778
+ const _ = pe(d.disabled) || pe(r.disabled);
2779
+ return G(n, l, {
2780
+ ...p || {},
2760
2781
  _f: {
2761
- ...f && f._f ? f._f : { ref: { name: l } },
2782
+ ...p && p._f ? p._f : { ref: { name: l } },
2762
2783
  name: l,
2763
2784
  mount: !0,
2764
2785
  ...d
2765
2786
  }
2766
- }), o.mount.add(l), f ? Ge({
2767
- disabled: ce(d.disabled) ? d.disabled : r.disabled,
2787
+ }), o.mount.add(l), p ? Ye({
2788
+ disabled: pe(d.disabled) ? d.disabled : r.disabled,
2768
2789
  name: l
2769
2790
  }) : V(l, !0, d.value), {
2770
- ...k ? { disabled: d.disabled || r.disabled } : {},
2791
+ ..._ ? { disabled: d.disabled || r.disabled } : {},
2771
2792
  ...r.progressive ? {
2772
2793
  required: !!d.required,
2773
- min: Je(d.min),
2774
- max: Je(d.max),
2775
- minLength: Je(d.minLength),
2776
- maxLength: Je(d.maxLength),
2777
- pattern: Je(d.pattern)
2794
+ min: tt(d.min),
2795
+ max: tt(d.max),
2796
+ minLength: tt(d.minLength),
2797
+ maxLength: tt(d.maxLength),
2798
+ pattern: tt(d.pattern)
2778
2799
  } : {},
2779
2800
  name: l,
2780
- onChange: oe,
2781
- onBlur: oe,
2782
- ref: (x) => {
2783
- if (x) {
2784
- D(l, d), f = I(n, l);
2785
- const v = W(x.value) && x.querySelectorAll && x.querySelectorAll("input,select,textarea")[0] || x, F = ta(v), $ = f._f.refs || [];
2786
- if (F ? $.find((B) => B === v) : v === f._f.ref)
2801
+ onChange: D,
2802
+ onBlur: D,
2803
+ ref: (w) => {
2804
+ if (w) {
2805
+ Oe(l, d), p = S(n, l);
2806
+ const v = J(w.value) && w.querySelectorAll && w.querySelectorAll("input,select,textarea")[0] || w, E = aa(v), W = p._f.refs || [];
2807
+ if (E ? W.find((z) => z === v) : v === p._f.ref)
2787
2808
  return;
2788
- P(n, l, {
2809
+ G(n, l, {
2789
2810
  _f: {
2790
- ...f._f,
2791
- ...F ? {
2811
+ ...p._f,
2812
+ ...E ? {
2792
2813
  refs: [
2793
- ...$.filter(kt),
2814
+ ...W.filter(Et),
2794
2815
  v,
2795
- ...Array.isArray(I(s, l)) ? [{}] : []
2816
+ ...Array.isArray(S(s, l)) ? [{}] : []
2796
2817
  ],
2797
2818
  ref: { type: v.type, name: l }
2798
2819
  } : { ref: v }
2799
2820
  }
2800
2821
  }), V(l, !1, void 0, v);
2801
2822
  } else
2802
- f = I(n, l, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Hs(o.array, l) && a.action) && o.unMount.add(l);
2823
+ p = S(n, l, {}), p._f && (p._f.mount = !1), (r.shouldUnregister || d.shouldUnregister) && !(Ys(o.array, l) && a.action) && o.unMount.add(l);
2803
2824
  }
2804
2825
  };
2805
- }, ke = () => r.shouldFocusError && tt(n, _e, o.mount), He = (l) => {
2806
- ce(l) && (m.state.next({ disabled: l }), tt(n, (d, f) => {
2807
- const k = I(n, f);
2808
- k && (d.disabled = k._f.disabled || l, Array.isArray(k._f.refs) && k._f.refs.forEach((x) => {
2809
- x.disabled = k._f.disabled || l;
2826
+ }, Be = () => r.shouldFocusError && it(n, le, o.mount), ut = (l) => {
2827
+ pe(l) && (m.state.next({ disabled: l }), it(n, (d, p) => {
2828
+ const _ = S(n, p);
2829
+ _ && (d.disabled = _._f.disabled || l, Array.isArray(_._f.refs) && _._f.refs.forEach((w) => {
2830
+ w.disabled = _._f.disabled || l;
2810
2831
  }));
2811
2832
  }, 0, !1));
2812
- }, me = (l, d) => async (f) => {
2813
- let k;
2814
- f && (f.preventDefault && f.preventDefault(), f.persist && f.persist());
2815
- let x = H(i);
2833
+ }, Qe = (l, d) => async (p) => {
2834
+ let _;
2835
+ p && (p.preventDefault && p.preventDefault(), p.persist && p.persist());
2836
+ let w = Y(i);
2816
2837
  if (m.state.next({
2817
2838
  isSubmitting: !0
2818
2839
  }), r.resolver) {
2819
- const { errors: v, values: F } = await T();
2820
- _(), t.errors = v, x = H(F);
2840
+ const { errors: v, values: E } = await O();
2841
+ x(), t.errors = v, w = Y(E);
2821
2842
  } else
2822
- await O(n);
2843
+ await P(n);
2823
2844
  if (o.disabled.size)
2824
2845
  for (const v of o.disabled)
2825
- K(x, v);
2826
- if (K(t.errors, "root"), re(t.errors)) {
2846
+ Z(w, v);
2847
+ if (Z(t.errors, "root"), ne(t.errors)) {
2827
2848
  m.state.next({
2828
2849
  errors: {}
2829
2850
  });
2830
2851
  try {
2831
- await l(x, f);
2852
+ await l(w, p);
2832
2853
  } catch (v) {
2833
- k = v;
2854
+ _ = v;
2834
2855
  }
2835
2856
  } else
2836
- d && await d({ ...t.errors }, f), ke(), setTimeout(ke);
2857
+ d && await d({ ...t.errors }, p), Be(), setTimeout(Be);
2837
2858
  if (m.state.next({
2838
2859
  isSubmitted: !0,
2839
2860
  isSubmitting: !1,
2840
- isSubmitSuccessful: re(t.errors) && !k,
2861
+ isSubmitSuccessful: ne(t.errors) && !_,
2841
2862
  submitCount: t.submitCount + 1,
2842
2863
  errors: t.errors
2843
- }), k)
2844
- throw k;
2845
- }, an = (l, d = {}) => {
2846
- I(n, l) && (W(d.defaultValue) ? Z(l, H(I(s, l))) : (Z(l, d.defaultValue), P(s, l, H(d.defaultValue))), d.keepTouched || K(t.touchedFields, l), d.keepDirty || (K(t.dirtyFields, l), t.isDirty = d.defaultValue ? N(l, H(I(s, l))) : N()), d.keepError || (K(t.errors, l), b.isValid && C()), m.state.next({ ...t }));
2847
- }, Bt = (l, d = {}) => {
2848
- const f = l ? H(l) : s, k = H(f), x = re(l), v = x ? s : k;
2849
- if (d.keepDefaultValues || (s = f), !d.keepValues) {
2864
+ }), _)
2865
+ throw _;
2866
+ }, ct = (l, d = {}) => {
2867
+ S(n, l) && (J(d.defaultValue) ? j(l, Y(S(s, l))) : (j(l, d.defaultValue), G(s, l, Y(d.defaultValue))), d.keepTouched || Z(t.touchedFields, l), d.keepDirty || (Z(t.dirtyFields, l), t.isDirty = d.defaultValue ? M(l, Y(S(s, l))) : M()), d.keepError || (Z(t.errors, l), b.isValid && C()), m.state.next({ ...t }));
2868
+ }, L = (l, d = {}) => {
2869
+ const p = l ? Y(l) : s, _ = Y(p), w = ne(l), v = w ? s : _;
2870
+ if (d.keepDefaultValues || (s = p), !d.keepValues) {
2850
2871
  if (d.keepDirtyValues) {
2851
- const F = /* @__PURE__ */ new Set([
2872
+ const E = /* @__PURE__ */ new Set([
2852
2873
  ...o.mount,
2853
- ...Object.keys(Oe(s, i))
2874
+ ...Object.keys(Pe(s, i))
2854
2875
  ]);
2855
- for (const $ of Array.from(F)) {
2856
- const B = I(t.dirtyFields, $), ee = I(i, $), Me = I(v, $);
2857
- B && !W(ee) ? P(v, $, ee) : !B && !W(Me) && Z($, Me);
2876
+ for (const W of Array.from(E)) {
2877
+ const z = S(t.dirtyFields, W), te = S(i, W), Me = S(v, W);
2878
+ z && !J(te) ? G(v, W, te) : !z && !J(Me) && j(W, Me);
2858
2879
  }
2859
2880
  } else {
2860
- if (Rt && W(l))
2861
- for (const F of o.mount) {
2862
- const $ = I(n, F);
2863
- if ($ && $._f) {
2864
- const B = Array.isArray($._f.refs) ? $._f.refs[0] : $._f.ref;
2865
- if (ot(B)) {
2866
- const ee = B.closest("form");
2867
- if (ee) {
2868
- ee.reset();
2881
+ if (Pt && J(l))
2882
+ for (const E of o.mount) {
2883
+ const W = S(n, E);
2884
+ if (W && W._f) {
2885
+ const z = Array.isArray(W._f.refs) ? W._f.refs[0] : W._f.ref;
2886
+ if (ft(z)) {
2887
+ const te = z.closest("form");
2888
+ if (te) {
2889
+ te.reset();
2869
2890
  break;
2870
2891
  }
2871
2892
  }
2872
2893
  }
2873
2894
  }
2874
2895
  if (d.keepFieldsRef)
2875
- for (const F of o.mount)
2876
- Z(F, I(v, F));
2896
+ for (const E of o.mount)
2897
+ j(E, S(v, E));
2877
2898
  else
2878
2899
  n = {};
2879
2900
  }
2880
- i = r.shouldUnregister ? d.keepDefaultValues ? H(s) : {} : H(v), m.array.next({
2901
+ i = r.shouldUnregister ? d.keepDefaultValues ? Y(s) : {} : Y(v), m.array.next({
2881
2902
  values: { ...v }
2882
2903
  }), m.state.next({
2883
2904
  values: { ...v }
@@ -2891,56 +2912,56 @@ function pa(e = {}) {
2891
2912
  watch: /* @__PURE__ */ new Set(),
2892
2913
  watchAll: !1,
2893
2914
  focus: ""
2894
- }, a.mount = !b.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !re(v), a.watch = !!r.shouldUnregister, a.keepIsValid = !!d.keepIsValid, a.action = !1, d.keepErrors || (t.errors = {}), m.state.next({
2915
+ }, a.mount = !b.isValid || !!d.keepIsValid || !!d.keepDirtyValues || !r.shouldUnregister && !ne(v), a.watch = !!r.shouldUnregister, a.keepIsValid = !!d.keepIsValid, a.action = !1, d.keepErrors || (t.errors = {}), m.state.next({
2895
2916
  submitCount: d.keepSubmitCount ? t.submitCount : 0,
2896
- isDirty: x ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Se(l, s)),
2917
+ isDirty: w ? !1 : d.keepDirty ? t.isDirty : !!(d.keepDefaultValues && !Se(l, s)),
2897
2918
  isSubmitted: d.keepIsSubmitted ? t.isSubmitted : !1,
2898
- dirtyFields: x ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? Oe(s, i) : t.dirtyFields : d.keepDefaultValues && l ? Oe(s, l) : d.keepDirty ? t.dirtyFields : {},
2919
+ dirtyFields: w ? {} : d.keepDirtyValues ? d.keepDefaultValues && i ? Pe(s, i) : t.dirtyFields : d.keepDefaultValues && l ? Pe(s, l) : d.keepDirty ? t.dirtyFields : {},
2899
2920
  touchedFields: d.keepTouched ? t.touchedFields : {},
2900
2921
  errors: d.keepErrors ? t.errors : {},
2901
2922
  isSubmitSuccessful: d.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
2902
2923
  isSubmitting: !1,
2903
2924
  defaultValues: s
2904
2925
  });
2905
- }, jt = (l, d) => Bt(le(l) ? l(i) : l, { ...r.resetOptions, ...d }), on = (l, d = {}) => {
2906
- const f = I(n, l), k = f && f._f;
2907
- if (k) {
2908
- const x = k.refs ? k.refs[0] : k.ref;
2909
- x.focus && setTimeout(() => {
2910
- x.focus(), d.shouldSelect && le(x.select) && x.select();
2926
+ }, Ve = (l, d) => L(ce(l) ? l(i) : l, { ...r.resetOptions, ...d }), et = (l, d = {}) => {
2927
+ const p = S(n, l), _ = p && p._f;
2928
+ if (_) {
2929
+ const w = _.refs ? _.refs[0] : _.ref;
2930
+ w.focus && setTimeout(() => {
2931
+ w.focus(), d.shouldSelect && ce(w.select) && w.select();
2911
2932
  });
2912
2933
  }
2913
- }, ln = (l) => {
2934
+ }, ke = (l) => {
2914
2935
  t = {
2915
2936
  ...t,
2916
2937
  ...l
2917
2938
  };
2918
- }, Pt = {
2939
+ }, zt = {
2919
2940
  control: {
2920
- register: D,
2921
- unregister: De,
2922
- getFieldState: Ve,
2923
- handleSubmit: me,
2924
- setError: ze,
2925
- _subscribe: Ke,
2926
- _runSchema: T,
2927
- _updateIsValidating: _,
2928
- _focusError: ke,
2929
- _getWatch: R,
2930
- _getDirty: N,
2941
+ register: Oe,
2942
+ unregister: Te,
2943
+ getFieldState: _e,
2944
+ handleSubmit: Qe,
2945
+ setError: Ze,
2946
+ _subscribe: Fe,
2947
+ _runSchema: O,
2948
+ _updateIsValidating: x,
2949
+ _focusError: Be,
2950
+ _getWatch: A,
2951
+ _getDirty: M,
2931
2952
  _setValid: C,
2932
2953
  _setFieldArray: y,
2933
- _setDisabledField: Ge,
2934
- _setErrors: A,
2935
- _getFieldArray: M,
2936
- _reset: Bt,
2937
- _resetDefaultValues: () => le(r.defaultValues) && r.defaultValues().then((l) => {
2938
- jt(l, r.resetOptions), m.state.next({
2954
+ _setDisabledField: Ye,
2955
+ _setErrors: N,
2956
+ _getFieldArray: B,
2957
+ _reset: L,
2958
+ _resetDefaultValues: () => ce(r.defaultValues) && r.defaultValues().then((l) => {
2959
+ Ve(l, r.resetOptions), m.state.next({
2939
2960
  isLoading: !1
2940
2961
  });
2941
2962
  }),
2942
- _removeUnmounted: J,
2943
- _disableForm: He,
2963
+ _removeUnmounted: H,
2964
+ _disableForm: ut,
2944
2965
  _subjects: m,
2945
2966
  _proxyFormState: b,
2946
2967
  get _fields() {
@@ -2977,31 +2998,31 @@ function pa(e = {}) {
2977
2998
  };
2978
2999
  }
2979
3000
  },
2980
- subscribe: at,
2981
- trigger: pe,
2982
- register: D,
2983
- handleSubmit: me,
2984
- watch: st,
2985
- setValue: Z,
2986
- getValues: Fe,
2987
- reset: jt,
2988
- resetField: an,
2989
- clearErrors: nt,
2990
- unregister: De,
2991
- setError: ze,
2992
- setFocus: on,
2993
- getFieldState: Ve
3001
+ subscribe: De,
3002
+ trigger: ue,
3003
+ register: Oe,
3004
+ handleSubmit: Qe,
3005
+ watch: Xe,
3006
+ setValue: j,
3007
+ getValues: Je,
3008
+ reset: Ve,
3009
+ resetField: ct,
3010
+ clearErrors: lt,
3011
+ unregister: Te,
3012
+ setError: Ze,
3013
+ setFocus: et,
3014
+ getFieldState: _e
2994
3015
  };
2995
3016
  return {
2996
- ...Pt,
2997
- formControl: Pt
3017
+ ...zt,
3018
+ formControl: zt
2998
3019
  };
2999
3020
  }
3000
- function pt(e = {}) {
3001
- const r = te.useRef(void 0), t = te.useRef(void 0), [n, s] = te.useState({
3021
+ function vt(e = {}) {
3022
+ const r = re.useRef(void 0), t = re.useRef(void 0), [n, s] = re.useState({
3002
3023
  isDirty: !1,
3003
3024
  isValidating: !1,
3004
- isLoading: le(e.defaultValues),
3025
+ isLoading: ce(e.defaultValues),
3005
3026
  isSubmitted: !1,
3006
3027
  isSubmitting: !1,
3007
3028
  isSubmitSuccessful: !1,
@@ -3013,23 +3034,23 @@ function pt(e = {}) {
3013
3034
  errors: e.errors || {},
3014
3035
  disabled: e.disabled || !1,
3015
3036
  isReady: !1,
3016
- defaultValues: le(e.defaultValues) ? void 0 : e.defaultValues
3037
+ defaultValues: ce(e.defaultValues) ? void 0 : e.defaultValues
3017
3038
  });
3018
3039
  if (!r.current)
3019
3040
  if (e.formControl)
3020
3041
  r.current = {
3021
3042
  ...e.formControl,
3022
3043
  formState: n
3023
- }, e.defaultValues && !le(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
3044
+ }, e.defaultValues && !ce(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
3024
3045
  else {
3025
- const { formControl: a, ...o } = pa(e);
3046
+ const { formControl: a, ...o } = ba(e);
3026
3047
  r.current = {
3027
3048
  ...o,
3028
3049
  formState: n
3029
3050
  };
3030
3051
  }
3031
3052
  const i = r.current.control;
3032
- return i._options = e, Ys(() => {
3053
+ return i._options = e, ra(() => {
3033
3054
  const a = i._subscribe({
3034
3055
  formState: i._proxyFormState,
3035
3056
  callback: () => s({ ...i._formState }),
@@ -3039,69 +3060,69 @@ function pt(e = {}) {
3039
3060
  ...o,
3040
3061
  isReady: !0
3041
3062
  })), i._formState.isReady = !0, a;
3042
- }, [i]), te.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), te.useEffect(() => {
3063
+ }, [i]), re.useEffect(() => i._disableForm(e.disabled), [i, e.disabled]), re.useEffect(() => {
3043
3064
  e.mode && (i._options.mode = e.mode), e.reValidateMode && (i._options.reValidateMode = e.reValidateMode);
3044
- }, [i, e.mode, e.reValidateMode]), te.useEffect(() => {
3065
+ }, [i, e.mode, e.reValidateMode]), re.useEffect(() => {
3045
3066
  e.errors && (i._setErrors(e.errors), i._focusError());
3046
- }, [i, e.errors]), te.useEffect(() => {
3067
+ }, [i, e.errors]), re.useEffect(() => {
3047
3068
  e.shouldUnregister && i._subjects.state.next({
3048
3069
  values: i._getWatch()
3049
3070
  });
3050
- }, [i, e.shouldUnregister]), te.useEffect(() => {
3071
+ }, [i, e.shouldUnregister]), re.useEffect(() => {
3051
3072
  if (i._proxyFormState.isDirty) {
3052
3073
  const a = i._getDirty();
3053
3074
  a !== n.isDirty && i._subjects.state.next({
3054
3075
  isDirty: a
3055
3076
  });
3056
3077
  }
3057
- }, [i, n.isDirty]), te.useEffect(() => {
3078
+ }, [i, n.isDirty]), re.useEffect(() => {
3058
3079
  var a;
3059
3080
  e.values && !Se(e.values, t.current) ? (i._reset(e.values, {
3060
3081
  keepFieldsRef: !0,
3061
3082
  ...i._options.resetOptions
3062
3083
  }), !((a = i._options.resetOptions) === null || a === void 0) && a.keepIsValid || i._setValid(), t.current = e.values, s((o) => ({ ...o }))) : i._resetDefaultValues();
3063
- }, [i, e.values]), te.useEffect(() => {
3084
+ }, [i, e.values]), re.useEffect(() => {
3064
3085
  i._state.mount || (i._setValid(), i._state.mount = !0), i._state.watch && (i._state.watch = !1, i._subjects.state.next({ ...i._formState })), i._removeUnmounted();
3065
- }), r.current.formState = te.useMemo(() => Zs(n, i), [i, n]), r.current;
3086
+ }), r.current.formState = re.useMemo(() => ta(n, i), [i, n]), r.current;
3066
3087
  }
3067
- const pr = (e, r, t) => {
3088
+ const vr = (e, r, t) => {
3068
3089
  if (e && "reportValidity" in e) {
3069
- const n = I(t, r);
3090
+ const n = S(t, r);
3070
3091
  e.setCustomValidity(n && n.message || ""), e.reportValidity();
3071
3092
  }
3072
- }, ma = (e, r) => {
3093
+ }, va = (e, r) => {
3073
3094
  for (const t in r.fields) {
3074
3095
  const n = r.fields[t];
3075
- n && n.ref && "reportValidity" in n.ref ? pr(n.ref, t, e) : n.refs && n.refs.forEach((s) => pr(s, t, e));
3096
+ n && n.ref && "reportValidity" in n.ref ? vr(n.ref, t, e) : n.refs && n.refs.forEach((s) => vr(s, t, e));
3076
3097
  }
3077
- }, ya = (e, r) => {
3078
- r.shouldUseNativeValidation && ma(e, r);
3098
+ }, xa = (e, r) => {
3099
+ r.shouldUseNativeValidation && va(e, r);
3079
3100
  const t = {};
3080
3101
  for (const n in e) {
3081
- const s = I(r.fields, n), i = Object.assign(e[n] || {}, { ref: s && s.ref });
3082
- if (ga(r.names || Object.keys(e), n)) {
3083
- const a = Object.assign({}, I(t, n));
3084
- P(a, "root", i), P(t, n, a);
3102
+ const s = S(r.fields, n), i = Object.assign(e[n] || {}, { ref: s && s.ref });
3103
+ if (wa(r.names || Object.keys(e), n)) {
3104
+ const a = Object.assign({}, S(t, n));
3105
+ G(a, "root", i), G(t, n, a);
3085
3106
  } else
3086
- P(t, n, i);
3107
+ G(t, n, i);
3087
3108
  }
3088
3109
  return t;
3089
- }, ga = (e, r) => e.some((t) => t.startsWith(r + "."));
3090
- var mt = function(e, r, t) {
3110
+ }, wa = (e, r) => e.some((t) => t.startsWith(r + "."));
3111
+ var xt = function(e, r, t) {
3091
3112
  return t === void 0 && (t = {}), function(n, s, i) {
3092
3113
  try {
3093
3114
  var a = !i.shouldUseNativeValidation && i.criteriaMode === "all";
3094
- return Promise.resolve(/* @__PURE__ */ Es(e, n, Object.assign({}, r, { abortPipeEarly: !a }))).then(function(o) {
3115
+ return Promise.resolve(/* @__PURE__ */ Ls(e, n, Object.assign({}, r, { abortPipeEarly: !a }))).then(function(o) {
3095
3116
  if (o.issues) {
3096
3117
  for (var c = {}; o.issues.length; ) {
3097
- var p = o.issues[0], g = /* @__PURE__ */ ws(p);
3098
- if (g && (c[g] || (c[g] = { message: p.message, type: p.type }), a)) {
3099
- var b = c[g].types, h = b && b[p.type];
3100
- c[g] = Zr(g, a, c, p.type, h ? [].concat(h, p.message) : p.message);
3118
+ var f = o.issues[0], g = /* @__PURE__ */ Ss(f);
3119
+ if (g && (c[g] || (c[g] = { message: f.message, type: f.type }), a)) {
3120
+ var b = c[g].types, h = b && b[f.type];
3121
+ c[g] = rn(g, a, c, f.type, h ? [].concat(h, f.message) : f.message);
3101
3122
  }
3102
3123
  o.issues.shift();
3103
3124
  }
3104
- return { values: {}, errors: ya(c, i) };
3125
+ return { values: {}, errors: xa(c, i) };
3105
3126
  }
3106
3127
  return { values: t.raw ? n : o.output, errors: {} };
3107
3128
  });
@@ -3110,19 +3131,19 @@ var mt = function(e, r, t) {
3110
3131
  }
3111
3132
  };
3112
3133
  };
3113
- const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3134
+ const xr = 27, wr = 12, _r = 10, _a = Ge("enum"), ka = (e, r) => {
3114
3135
  const t = {
3115
3136
  min: e.minSelected ?? 0,
3116
3137
  max: e.maxSelected ?? e.options.length
3117
3138
  };
3118
- return mt(/* @__PURE__ */ xe({
3119
- checked: /* @__PURE__ */ Ie(/* @__PURE__ */ zr(/* @__PURE__ */ ie(), /* @__PURE__ */ qr()), /* @__PURE__ */ Mt((n) => Object.entries(n).filter(([s, i]) => i).map(([s, i]) => s)), /* @__PURE__ */ Ye(t.max, r("validation_multiple_choice_max", {
3139
+ return xt(/* @__PURE__ */ xe({
3140
+ checked: /* @__PURE__ */ Ie(/* @__PURE__ */ Zr(/* @__PURE__ */ ae(), /* @__PURE__ */ Gr()), /* @__PURE__ */ Ot((n) => Object.entries(n).filter(([s, i]) => i).map(([s, i]) => s)), /* @__PURE__ */ st(t.max, r("validation_multiple_choice_max", {
3120
3141
  count: t.max
3121
- })), /* @__PURE__ */ Be(t.min, r("validation_multiple_choice_min", {
3142
+ })), /* @__PURE__ */ Ue(t.min, r("validation_multiple_choice_min", {
3122
3143
  count: t.min
3123
3144
  })))
3124
3145
  }));
3125
- }, xa = Fr(({
3146
+ }, Ca = Rr(({
3126
3147
  option: e,
3127
3148
  ...r
3128
3149
  }, t) => u(we, {
@@ -3136,47 +3157,47 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3136
3157
  htmlFor: r.id,
3137
3158
  children: e.label
3138
3159
  })]
3139
- })), br = ct("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4", {
3160
+ })), kr = mt("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4", {
3140
3161
  variants: {
3141
3162
  variant: {
3142
3163
  // In cases where there is only one option, we want to center it
3143
3164
  singleOption: "justify-center",
3144
3165
  // Two choices with exactly 1 min 1 max
3145
- booleanLike: Gr
3166
+ booleanLike: Yr
3146
3167
  }
3147
3168
  }
3148
- }), wa = ({
3169
+ }), Sa = ({
3149
3170
  input: e,
3150
3171
  onSubmitSuccess: r
3151
3172
  }) => {
3152
3173
  var g, b;
3153
- const t = e.key ? (g = j.current$.value.flow) == null ? void 0 : g.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, {
3174
+ const t = e.key ? (g = K.current$.value.flow) == null ? void 0 : g.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, {
3154
3175
  t: i
3155
- } = Q(), {
3176
+ } = ee(), {
3156
3177
  register: a,
3157
3178
  handleSubmit: o,
3158
3179
  formState: {
3159
3180
  errors: c
3160
3181
  }
3161
- } = pt({
3182
+ } = vt({
3162
3183
  defaultValues: {
3163
- checked: n ? {} : ba(t) ? Object.fromEntries(t.value.map((h) => [h, !0])) : {}
3184
+ checked: n ? {} : _a(t) ? Object.fromEntries(t.value.map((h) => [h, !0])) : {}
3164
3185
  },
3165
- resolver: va(e.config, i)
3166
- }), p = Nt();
3186
+ resolver: ka(e.config, i)
3187
+ }), f = jt();
3167
3188
  return s ? u("ul", {
3168
3189
  style: {
3169
- maxHeight: 6.5 * mr + 5 * yr + 2 * gr
3190
+ maxHeight: 6.5 * xr + 5 * wr + 2 * _r
3170
3191
  },
3171
- class: br({
3192
+ class: kr({
3172
3193
  variant: "booleanLike"
3173
3194
  }),
3174
3195
  children: e.config.options.map((h, m) => u("li", {
3175
- class: Hr,
3176
- children: u(Jr, {
3196
+ class: Qr,
3197
+ children: u(en, {
3177
3198
  type: "submit",
3178
- ref: (w) => {
3179
- w && m === 0 && (p.current = w);
3199
+ ref: (k) => {
3200
+ k && m === 0 && (f.current = k);
3180
3201
  },
3181
3202
  label: h.label,
3182
3203
  value: "true",
@@ -3189,35 +3210,35 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3189
3210
  }) : u("form", {
3190
3211
  noValidate: !0,
3191
3212
  onSubmit: (h) => o((m) => {
3192
- const w = m.checked;
3213
+ const k = m.checked;
3193
3214
  r({
3194
3215
  type: "enum",
3195
- value: w
3216
+ value: k
3196
3217
  });
3197
3218
  })(h),
3198
3219
  children: [u("div", {
3199
3220
  class: "flex items-center gap-1",
3200
3221
  children: [u("ul", {
3201
3222
  style: {
3202
- maxHeight: 6.5 * mr + 5 * yr + 2 * gr
3223
+ maxHeight: 6.5 * xr + 5 * wr + 2 * _r
3203
3224
  },
3204
- class: br({
3225
+ class: kr({
3205
3226
  variant: e.config.options.length === 1 ? "singleOption" : void 0
3206
3227
  }),
3207
3228
  children: e.config.options.map((h, m) => {
3208
- const w = `checked.${h.value}`, {
3209
- ref: S,
3229
+ const k = `checked.${h.value}`, {
3230
+ ref: I,
3210
3231
  ...C
3211
- } = a(w);
3232
+ } = a(k);
3212
3233
  return u("li", {
3213
3234
  class: "relative",
3214
- children: u(xa, {
3235
+ children: u(Ca, {
3215
3236
  option: h,
3216
3237
  autoFocus: m === 0,
3217
- ref: (_) => {
3218
- _ && m === 0 && (p.current = _), S(_);
3238
+ ref: (x) => {
3239
+ x && m === 0 && (f.current = x), I(x);
3219
3240
  },
3220
- id: w,
3241
+ id: k,
3221
3242
  ...C,
3222
3243
  onClick: n ? () => r({
3223
3244
  type: "enum",
@@ -3239,47 +3260,47 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3239
3260
  })]
3240
3261
  }), u("div", {
3241
3262
  class: "px-1",
3242
- children: u(We, {
3263
+ children: u(He, {
3243
3264
  error: (b = c.checked) == null ? void 0 : b.root
3244
3265
  })
3245
3266
  })]
3246
3267
  });
3247
- }, _a = Ue("number"), ka = (e, r) => {
3268
+ }, Ia = Ge("number"), Aa = (e, r) => {
3248
3269
  const t = e.min ?? Number.MIN_SAFE_INTEGER, n = e.max ?? Number.MAX_SAFE_INTEGER, s = e.decimalCases ?? 0;
3249
- return mt(/* @__PURE__ */ xe({
3250
- number: /* @__PURE__ */ Ie(/* @__PURE__ */ Ur(r("validation_number")), /* @__PURE__ */ $r(t, r("validation_number_min", {
3270
+ return xt(/* @__PURE__ */ xe({
3271
+ number: /* @__PURE__ */ Ie(/* @__PURE__ */ Hr(r("validation_number")), /* @__PURE__ */ Ur(t, r("validation_number_min", {
3251
3272
  min: t
3252
- })), /* @__PURE__ */ Or(n, r("validation_number_max", {
3273
+ })), /* @__PURE__ */ $r(n, r("validation_number_max", {
3253
3274
  max: n
3254
- })), /* @__PURE__ */ Dr((i) => i === Number(i.toFixed(s)), r("validation_number_decimal_cases", {
3275
+ })), /* @__PURE__ */ Pr((i) => i === Number(i.toFixed(s)), r("validation_number_decimal_cases", {
3255
3276
  count: s
3256
3277
  })))
3257
3278
  }));
3258
- }, Ca = ({
3279
+ }, Ea = ({
3259
3280
  input: e,
3260
3281
  onSubmitSuccess: r
3261
3282
  }) => {
3262
3283
  var b;
3263
- const t = e.config.defaultValue, n = e.key ? (b = j.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, {
3284
+ const t = e.config.defaultValue, n = e.key ? (b = K.current$.value.flow) == null ? void 0 : b.data.submissions[e.key] : void 0, {
3264
3285
  t: s
3265
- } = Q(), {
3286
+ } = ee(), {
3266
3287
  register: i,
3267
3288
  handleSubmit: a,
3268
3289
  formState: {
3269
3290
  errors: o
3270
3291
  }
3271
- } = pt({
3292
+ } = vt({
3272
3293
  defaultValues: {
3273
- number: _a(n) ? n.value : t ? Number(t) : void 0
3294
+ number: Ia(n) ? n.value : t ? Number(t) : void 0
3274
3295
  },
3275
- resolver: ka(e.config, s)
3296
+ resolver: Aa(e.config, s)
3276
3297
  }), {
3277
3298
  ref: c,
3278
- ...p
3299
+ ...f
3279
3300
  } = i("number", {
3280
3301
  required: !e.config.optional,
3281
3302
  valueAsNumber: !0
3282
- }), g = de();
3303
+ }), g = he();
3283
3304
  return Ae(() => {
3284
3305
  g.current && (g.current.focus(), g.current.select());
3285
3306
  }, []), u("form", {
@@ -3295,7 +3316,7 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3295
3316
  children: [u("div", {
3296
3317
  class: "relative min-w-0 flex-grow",
3297
3318
  children: [u("input", {
3298
- ...p,
3319
+ ...f,
3299
3320
  id: "chat-input",
3300
3321
  autocomplete: "off",
3301
3322
  autoCapitalize: "off",
@@ -3307,7 +3328,7 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3307
3328
  type: "text",
3308
3329
  min: e.config.min,
3309
3330
  max: e.config.max,
3310
- class: Pe({
3331
+ class: ze({
3311
3332
  optional: e.config.optional,
3312
3333
  className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
3313
3334
  }),
@@ -3317,17 +3338,17 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3317
3338
  onClick: () => r(null)
3318
3339
  })]
3319
3340
  }), u(Re, {})]
3320
- }), u(We, {
3341
+ }), u(He, {
3321
3342
  error: o.number
3322
3343
  })]
3323
3344
  });
3324
- }, Sa = (e) => {
3345
+ }, Fa = (e) => {
3325
3346
  if (e === "")
3326
3347
  return {
3327
3348
  countryCode: "",
3328
3349
  phoneNumber: ""
3329
3350
  };
3330
- const r = Object.entries(Lt).find((s) => e.startsWith(s[1])), t = r ? r[1] : "", n = e.replace(t, "");
3351
+ const r = Object.entries(Bt).find((s) => e.startsWith(s[1])), t = r ? r[1] : "", n = e.replace(t, "");
3331
3352
  return /^\d+$/.test(n) ? {
3332
3353
  countryCode: t,
3333
3354
  phoneNumber: n
@@ -3335,53 +3356,53 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3335
3356
  countryCode: "",
3336
3357
  phoneNumber: ""
3337
3358
  };
3338
- }, Ia = "44", Aa = /^[0-9 ]+$/, Ea = Ue("string"), Fa = Ue("phone"), Va = (e) => {
3339
- const r = /* @__PURE__ */ Ie(/* @__PURE__ */ ie(e("validation_country_code")), /* @__PURE__ */ Vt(Aa, e("validation_country_code"))), t = /* @__PURE__ */ Ie(/* @__PURE__ */ ie(e("validation_phone")), /* @__PURE__ */ Be(1, e("validation_phone")), /* @__PURE__ */ Mt((n) => n.replace(/[^0-9]/g, "")));
3340
- return mt(/* @__PURE__ */ xe({
3359
+ }, Va = "44", Ma = /^[0-9 ]+$/, La = Ge("string"), Na = Ge("phone"), Ra = (e) => {
3360
+ const r = /* @__PURE__ */ Ie(/* @__PURE__ */ ae(e("validation_country_code")), /* @__PURE__ */ Tt(Ma, e("validation_country_code"))), t = /* @__PURE__ */ Ie(/* @__PURE__ */ ae(e("validation_phone")), /* @__PURE__ */ Ue(1, e("validation_phone")), /* @__PURE__ */ Ot((n) => n.replace(/[^0-9]/g, "")));
3361
+ return xt(/* @__PURE__ */ xe({
3341
3362
  countryCode: r,
3342
3363
  phoneNumber: t
3343
3364
  }));
3344
- }, Ma = ({
3365
+ }, Da = ({
3345
3366
  input: e,
3346
3367
  onSubmitSuccess: r
3347
3368
  }) => {
3348
- var S;
3349
- const t = e.key ? (S = j.current$.value.flow) == null ? void 0 : S.data.submissions[e.key] : void 0, {
3369
+ var I;
3370
+ const t = e.key ? (I = K.current$.value.flow) == null ? void 0 : I.data.submissions[e.key] : void 0, {
3350
3371
  t: n
3351
- } = Q(), [s, i] = ve(), a = Ea(t) ? Sa(t.value) : Fa(t) ? t.value : void 0, {
3372
+ } = ee(), [s, i] = ve(), a = La(t) ? Fa(t.value) : Na(t) ? t.value : void 0, {
3352
3373
  register: o,
3353
3374
  handleSubmit: c,
3354
3375
  formState: {
3355
- errors: p
3376
+ errors: f
3356
3377
  },
3357
3378
  watch: g
3358
- } = pt({
3379
+ } = vt({
3359
3380
  defaultValues: {
3360
- countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ?? Ia,
3381
+ countryCode: (a == null ? void 0 : a.countryCode) ?? e.config.defaultValue.countryCode ?? Va,
3361
3382
  phoneNumber: (a == null ? void 0 : a.phoneNumber) ?? e.config.defaultValue.phoneNumber ?? ""
3362
3383
  },
3363
- resolver: Va(n)
3384
+ resolver: Ra(n)
3364
3385
  }), {
3365
3386
  ref: b,
3366
3387
  ...h
3367
3388
  } = o("phoneNumber", {
3368
3389
  required: !e.config.optional
3369
- }), m = de(), w = g("countryCode");
3390
+ }), m = he(), k = g("countryCode");
3370
3391
  return Ae(() => {
3371
3392
  m.current && (m.current.focus(), m.current.select());
3372
3393
  }, []), u("form", {
3373
3394
  noValidate: !0,
3374
3395
  class: "flex flex-col gap-1 p-2.5",
3375
3396
  onSubmit: c((C) => {
3376
- const _ = C.phoneNumber.replace(/[^0-9]/g, ""), y = C.countryCode.replace(/[^0-9]/g, "");
3397
+ const x = C.phoneNumber.replace(/[^0-9]/g, ""), y = C.countryCode.replace(/[^0-9]/g, "");
3377
3398
  i(void 0);
3378
- const E = e.config.minChars ?? 7, A = _.length + y.length;
3379
- if (A < E)
3399
+ const F = e.config.minChars ?? 7, N = x.length + y.length;
3400
+ if (N < F)
3380
3401
  return i(n("validation_phone_min_chars", {
3381
- count: E
3402
+ count: F
3382
3403
  }));
3383
3404
  const V = e.config.maxChars;
3384
- if (V != null && A > V)
3405
+ if (V != null && N > V)
3385
3406
  return i(n("validation_max_chars", {
3386
3407
  count: V
3387
3408
  }));
@@ -3389,11 +3410,11 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3389
3410
  type: "phone",
3390
3411
  value: {
3391
3412
  countryCode: y,
3392
- phoneNumber: _
3413
+ phoneNumber: x
3393
3414
  }
3394
3415
  }) : r({
3395
3416
  type: "string",
3396
- value: w + C.phoneNumber
3417
+ value: k + C.phoneNumber
3397
3418
  });
3398
3419
  }),
3399
3420
  children: [u("div", {
@@ -3404,14 +3425,14 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3404
3425
  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",
3405
3426
  htmlFor: `isdk_phone_${e.key}`,
3406
3427
  children: [u("span", {
3407
- children: ["+", w]
3428
+ children: ["+", k]
3408
3429
  }), u("select", {
3409
3430
  ...o("countryCode", {}),
3410
3431
  id: `isdk_phone_${e.key}`,
3411
3432
  class: "absolute inset-0 opacity-0",
3412
- children: Object.entries(Lt).map(([C, _]) => u("option", {
3413
- value: _,
3414
- children: [C, " (+", _, ")"]
3433
+ children: Object.entries(Bt).map(([C, x]) => u("option", {
3434
+ value: x,
3435
+ children: [C, " (+", x, ")"]
3415
3436
  }, C))
3416
3437
  })]
3417
3438
  }), u("input", {
@@ -3426,7 +3447,7 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3426
3447
  ref: (C) => {
3427
3448
  C && (m.current = C), b(C);
3428
3449
  },
3429
- class: Pe({
3450
+ class: ze({
3430
3451
  optional: e.config.optional,
3431
3452
  className: "min-w-0 flex-1 rounded-r-full"
3432
3453
  }),
@@ -3436,47 +3457,47 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3436
3457
  onClick: () => r(null)
3437
3458
  })]
3438
3459
  }), u(Re, {})]
3439
- }), u(We, {
3440
- error: p.countryCode || p.phoneNumber || {
3460
+ }), u(He, {
3461
+ error: f.countryCode || f.phoneNumber || {
3441
3462
  message: s
3442
3463
  }
3443
3464
  })]
3444
3465
  });
3445
- }, it = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), vr = (e, r, t, n) => t !== void 0 && n * 1e3 > Ir ? e("submission_available_at", {
3446
- time: Ar(t, r)
3466
+ }, dt = (e) => e === void 0 ? 0 : Math.max(0, Math.ceil((e - Date.now()) / 1e3)), Cr = (e, r, t, n) => t !== void 0 && n * 1e3 > Mr ? e("submission_available_at", {
3467
+ time: Lr(t, r)
3447
3468
  }) : e("submission_cooldown", {
3448
3469
  count: n
3449
- }), La = ({
3470
+ }), Ta = ({
3450
3471
  input: e,
3451
3472
  onSubmitSuccess: r
3452
3473
  }) => {
3453
3474
  const {
3454
3475
  t,
3455
3476
  locale: n
3456
- } = Q(), {
3477
+ } = ee(), {
3457
3478
  availableAt: s
3458
- } = e.config, [i, a] = ve(() => it(s)), [o, c] = ve("");
3459
- Er(() => {
3460
- const g = it(s);
3479
+ } = e.config, [i, a] = ve(() => dt(s)), [o, c] = ve("");
3480
+ Nr(() => {
3481
+ const g = dt(s);
3461
3482
  if (a(g), g === 0)
3462
3483
  return;
3463
- c(vr(t, n, s, g));
3484
+ c(Cr(t, n, s, g));
3464
3485
  const b = setInterval(() => {
3465
- const h = it(s);
3486
+ const h = dt(s);
3466
3487
  a(h), !(h > 0) && (clearInterval(b), c(t("submission_cooldown_ready")));
3467
3488
  }, 250);
3468
3489
  return () => clearInterval(b);
3469
3490
  }, [s, n, t]);
3470
- const p = i > 0;
3491
+ const f = i > 0;
3471
3492
  return u("div", {
3472
3493
  class: "flex flex-col items-center gap-2 py-3",
3473
3494
  children: [u("button", {
3474
3495
  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]",
3475
3496
  name: e.key,
3476
- "aria-disabled": p,
3477
- "aria-describedby": p ? "submit-cooldown" : void 0,
3497
+ "aria-disabled": f,
3498
+ "aria-describedby": f ? "submit-cooldown" : void 0,
3478
3499
  onClick: () => {
3479
- it(s) > 0 || r(null);
3500
+ dt(s) > 0 || r(null);
3480
3501
  },
3481
3502
  children: u("span", {
3482
3503
  class: "flex items-center gap-1.5",
@@ -3498,20 +3519,20 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3498
3519
  })]
3499
3520
  })]
3500
3521
  })
3501
- }), p && u("p", {
3522
+ }), f && u("p", {
3502
3523
  id: "submit-cooldown",
3503
3524
  "aria-hidden": "true",
3504
3525
  class: "text-neutral-11 text-xs",
3505
- children: vr(t, n, s, i)
3526
+ children: Cr(t, n, s, i)
3506
3527
  }), u("p", {
3507
3528
  role: "status",
3508
3529
  class: "sr-only",
3509
3530
  children: o
3510
3531
  })]
3511
3532
  });
3512
- }, Na = 160, xr = (e) => {
3513
- e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, Na)}px`;
3514
- }, Ra = {
3533
+ }, Oa = 160, Sr = (e) => {
3534
+ e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, Oa)}px`;
3535
+ }, Ba = {
3515
3536
  date: {
3516
3537
  type: "date",
3517
3538
  inputMode: "text"
@@ -3530,7 +3551,7 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3530
3551
  inputMode: "url",
3531
3552
  formNoValidate: !0
3532
3553
  }
3533
- }, Da = Ue("string"), Ta = (e, r) => {
3554
+ }, ja = Ge("string"), Pa = (e, r) => {
3534
3555
  const t = {
3535
3556
  maxLength: r("validation_max_chars", {
3536
3557
  count: e.maxChars ?? 999
@@ -3539,43 +3560,43 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3539
3560
  count: e.minChars ?? 1
3540
3561
  })
3541
3562
  };
3542
- return mt(/* @__PURE__ */ xe({
3563
+ return xt(/* @__PURE__ */ xe({
3543
3564
  text: {
3544
- date: /* @__PURE__ */ Ie(/* @__PURE__ */ ie(r("validation_date")), /* @__PURE__ */ Vt(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
3545
- email: /* @__PURE__ */ Ie(/* @__PURE__ */ ie(r("validation_email")), /* @__PURE__ */ Tr(r("validation_email")), /* @__PURE__ */ Be(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ye(e.maxChars ?? 1 / 0, t.maxLength)),
3546
- text: /* @__PURE__ */ Ie(/* @__PURE__ */ ie(), /* @__PURE__ */ Be(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ye(e.maxChars ?? 1 / 0, t.maxLength)),
3547
- url: /* @__PURE__ */ Ie(/* @__PURE__ */ ie(r("validation_url")), /* @__PURE__ */ Br(r("validation_url")), /* @__PURE__ */ Be(e.minChars ?? 1, t.minLength), /* @__PURE__ */ Ye(e.maxChars ?? 1 / 0, t.maxLength))
3565
+ date: /* @__PURE__ */ Ie(/* @__PURE__ */ ae(r("validation_date")), /* @__PURE__ */ Tt(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
3566
+ email: /* @__PURE__ */ Ie(/* @__PURE__ */ ae(r("validation_email")), /* @__PURE__ */ qr(r("validation_email")), /* @__PURE__ */ Ue(e.minChars ?? 1, t.minLength), /* @__PURE__ */ st(e.maxChars ?? 1 / 0, t.maxLength)),
3567
+ text: /* @__PURE__ */ Ie(/* @__PURE__ */ ae(), /* @__PURE__ */ Ue(e.minChars ?? 1, t.minLength), /* @__PURE__ */ st(e.maxChars ?? 1 / 0, t.maxLength)),
3568
+ url: /* @__PURE__ */ Ie(/* @__PURE__ */ ae(r("validation_url")), /* @__PURE__ */ Wr(r("validation_url")), /* @__PURE__ */ Ue(e.minChars ?? 1, t.minLength), /* @__PURE__ */ st(e.maxChars ?? 1 / 0, t.maxLength))
3548
3569
  }[e.format]
3549
3570
  }));
3550
- }, Oa = ({
3571
+ }, qa = ({
3551
3572
  input: e,
3552
3573
  onSubmitSuccess: r
3553
3574
  }) => {
3554
- var S;
3575
+ var I;
3555
3576
  const {
3556
3577
  t
3557
- } = Q(), n = e.key ? (S = j.current$.value.flow) == null ? void 0 : S.data.submissions[e.key] : void 0, s = e.config.defaultValue, i = e.config.multiline === !0 && e.config.format === "text", {
3578
+ } = ee(), n = e.key ? (I = K.current$.value.flow) == null ? void 0 : I.data.submissions[e.key] : void 0, s = e.config.defaultValue, i = e.config.multiline === !0 && e.config.format === "text", {
3558
3579
  register: a,
3559
3580
  handleSubmit: o,
3560
3581
  watch: c,
3561
3582
  formState: {
3562
- errors: p
3583
+ errors: f
3563
3584
  }
3564
- } = pt({
3585
+ } = vt({
3565
3586
  defaultValues: {
3566
- text: Da(n) ? n.value : s ?? ""
3587
+ text: ja(n) ? n.value : s ?? ""
3567
3588
  },
3568
- resolver: Ta(e.config, t)
3589
+ resolver: Pa(e.config, t)
3569
3590
  }), {
3570
3591
  ref: g,
3571
3592
  ...b
3572
3593
  } = a("text", {
3573
3594
  required: !e.config.optional
3574
- }), h = de();
3595
+ }), h = he();
3575
3596
  Ae(() => {
3576
- h.current && (h.current instanceof HTMLTextAreaElement && xr(h.current), h.current.focus(), h.current.select());
3597
+ h.current && (h.current instanceof HTMLTextAreaElement && Sr(h.current), h.current.focus(), h.current.select());
3577
3598
  }, []);
3578
- const m = e.config.maxChars, w = i && m !== void 0 ? c("text").length : void 0;
3599
+ const m = e.config.maxChars, k = i && m !== void 0 ? c("text").length : void 0;
3579
3600
  return u("form", {
3580
3601
  noValidate: !0,
3581
3602
  class: "flex flex-col gap-1 p-2.5",
@@ -3595,24 +3616,24 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3595
3616
  rows: 2,
3596
3617
  maxLength: m,
3597
3618
  autoFocus: !0,
3598
- "aria-describedby": w !== void 0 ? "chat-input-count" : void 0,
3599
- onInput: (C) => xr(C.currentTarget),
3619
+ "aria-describedby": k !== void 0 ? "chat-input-count" : void 0,
3620
+ onInput: (C) => Sr(C.currentTarget),
3600
3621
  onKeyDown: (C) => {
3601
- var _;
3602
- C.key === "Enter" && (C.ctrlKey || C.metaKey) && (C.preventDefault(), (_ = C.currentTarget.form) == null || _.requestSubmit());
3622
+ var x;
3623
+ C.key === "Enter" && (C.ctrlKey || C.metaKey) && (C.preventDefault(), (x = C.currentTarget.form) == null || x.requestSubmit());
3603
3624
  },
3604
3625
  ref: (C) => {
3605
3626
  C && (h.current = C), g(C);
3606
3627
  },
3607
3628
  placeholder: e.config.placeholder,
3608
- class: Pe({
3629
+ class: ze({
3609
3630
  optional: !!e.config.optional,
3610
3631
  className: "block w-full resize-none overflow-y-auto rounded-2xl"
3611
3632
  })
3612
3633
  }) : u("input", {
3613
3634
  id: "chat-input",
3614
3635
  ...b,
3615
- ...Ra[e.config.format],
3636
+ ...Ba[e.config.format],
3616
3637
  autocomplete: "off",
3617
3638
  autoCapitalize: "off",
3618
3639
  autoCorrect: "off",
@@ -3621,7 +3642,7 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3621
3642
  C && (h.current = C), g(C);
3622
3643
  },
3623
3644
  placeholder: e.config.placeholder,
3624
- class: Pe({
3645
+ class: ze({
3625
3646
  optional: !!e.config.optional,
3626
3647
  className: "w-full rounded-full"
3627
3648
  })
@@ -3633,29 +3654,29 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3633
3654
  }
3634
3655
  )]
3635
3656
  }), u(Re, {})]
3636
- }), w !== void 0 && m !== void 0 && u("p", {
3657
+ }), k !== void 0 && m !== void 0 && u("p", {
3637
3658
  id: "chat-input-count",
3638
3659
  class: "text-neutral-10 px-3 text-right text-xs",
3639
- children: [w, "/", m]
3640
- }), u(We, {
3641
- error: p.text
3660
+ children: [k, "/", m]
3661
+ }), u(He, {
3662
+ error: f.text
3642
3663
  })]
3643
3664
  });
3644
3665
  }, $a = {
3645
- text: Oa,
3646
- phone: Ma,
3647
- "multiple-choice": wa,
3666
+ text: qa,
3667
+ phone: Da,
3668
+ "multiple-choice": Sa,
3648
3669
  boolean: $s,
3649
- file: zs,
3650
- submit: La,
3651
- address: Rs,
3652
- number: Ca
3653
- }, Ba = ({
3670
+ file: Js,
3671
+ submit: Ta,
3672
+ address: Bs,
3673
+ number: Ea
3674
+ }, Ua = ({
3654
3675
  logger: e,
3655
3676
  analytics: r
3656
3677
  }) => {
3657
3678
  var i;
3658
- const t = (i = j.current$.value.flow) == null ? void 0 : i.data.currentInput, n = de(null), s = () => se.onInteractionFn$.value();
3679
+ const t = (i = K.current$.value.flow) == null ? void 0 : i.data.currentInput, n = he(null), s = () => ie.onInteractionFn$.value();
3659
3680
  return Ae(() => {
3660
3681
  var a;
3661
3682
  (a = n.current) == null || a.scrollTo({
@@ -3673,7 +3694,7 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3673
3694
  return u(a, {
3674
3695
  logger: e,
3675
3696
  analytics: r,
3676
- onSubmitSuccess: se.onSubmitSuccessFn$.value,
3697
+ onSubmitSuccess: ie.onSubmitSuccessFn$.value,
3677
3698
  input: t
3678
3699
  });
3679
3700
  })() : u("div", {
@@ -3681,7 +3702,7 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3681
3702
  children: [u("input", {
3682
3703
  "aria-hidden": "true",
3683
3704
  id: "chat-input",
3684
- class: Pe({
3705
+ class: ze({
3685
3706
  optional: !1,
3686
3707
  className: "flex-grow rounded-full"
3687
3708
  }),
@@ -3695,30 +3716,30 @@ const mr = 27, yr = 12, gr = 10, ba = Ue("enum"), va = (e, r) => {
3695
3716
  })
3696
3717
  });
3697
3718
  };
3698
- function ja(e) {
3719
+ function Wa(e) {
3699
3720
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3700
3721
  }
3701
- var Pa = function(e) {
3722
+ var za = function(e) {
3702
3723
  return e instanceof RegExp;
3703
- }, qa = function(r) {
3724
+ }, Ka = function(r) {
3704
3725
  var t = /[\\^$.*+?()[\]{}|]/g, n = RegExp(t.source);
3705
3726
  return r && n.test(r) ? r.replace(t, "\\$&") : r;
3706
- }, sn = function(e) {
3727
+ }, cn = function(e) {
3707
3728
  return typeof e == "string";
3708
- }, Ua = function(e) {
3729
+ }, Ga = function(e) {
3709
3730
  var r = [];
3710
3731
  return e.forEach(function(t) {
3711
3732
  Array.isArray(t) ? r = r.concat(t) : r.push(t);
3712
3733
  }), r;
3713
3734
  };
3714
- function Wa(e, r, t) {
3735
+ function Ha(e, r, t) {
3715
3736
  var n = 0, s = 0;
3716
3737
  if (e === "")
3717
3738
  return e;
3718
- if (!e || !sn(e))
3739
+ if (!e || !cn(e))
3719
3740
  throw new TypeError("First argument to react-string-replace#replaceString must be a string");
3720
3741
  var i = r;
3721
- Pa(i) || (i = new RegExp("(" + qa(i) + ")", "gi"));
3742
+ za(i) || (i = new RegExp("(" + Ka(i) + ")", "gi"));
3722
3743
  for (var a = e.split(i), o = 1, c = a.length; o < c; o += 2) {
3723
3744
  if (a[o] === void 0 || a[o - 1] === void 0) {
3724
3745
  console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");
@@ -3728,32 +3749,32 @@ function Wa(e, r, t) {
3728
3749
  }
3729
3750
  return a;
3730
3751
  }
3731
- var za = function(r, t, n) {
3732
- return Array.isArray(r) || (r = [r]), Ua(r.map(function(s) {
3733
- return sn(s) ? Wa(s, t, n) : s;
3752
+ var Ja = function(r, t, n) {
3753
+ return Array.isArray(r) || (r = [r]), Ga(r.map(function(s) {
3754
+ return cn(s) ? Ha(s, t, n) : s;
3734
3755
  }));
3735
3756
  };
3736
- const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]+)\]\(([^)]+)\)/, Ha = /(https?:\/\/[^\s]+)/g, Ja = /_(.*?)_/g, Xa = /\*\*(.*?)\*\*/g, Za = /\\n|\n/g, wr = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", Ya = (e) => {
3737
- const r = Xe(e, Ka, (a, o) => {
3738
- const [, c, p] = a.match(Ga) ?? [];
3739
- return p ? u("a", {
3740
- class: wr,
3741
- href: p,
3742
- children: c ?? p
3743
- }, p + o) : u("span", {
3757
+ const rt = /* @__PURE__ */ Wa(Ja), Za = /(\[[^\]]+\]\([^)]+\))/g, Xa = /\[([^\]]+)\]\(([^)]+)\)/, Ya = /(https?:\/\/[^\s]+)/g, Qa = /_(.*?)_/g, ei = /\*\*(.*?)\*\*/g, ti = /\\n|\n/g, Ir = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", ri = (e) => {
3758
+ const r = rt(e, Za, (a, o) => {
3759
+ const [, c, f] = a.match(Xa) ?? [];
3760
+ return f ? u("a", {
3761
+ class: Ir,
3762
+ href: f,
3763
+ children: c ?? f
3764
+ }, f + o) : u("span", {
3744
3765
  children: "INVALID LINK"
3745
3766
  });
3746
- }), t = Xe(r, Ha, (a, o) => u("a", {
3747
- class: wr,
3767
+ }), t = rt(r, Ya, (a, o) => u("a", {
3768
+ class: Ir,
3748
3769
  href: a,
3749
3770
  children: a
3750
- }, a + o)), n = Xe(t, Ja, (a, o) => u("em", {
3771
+ }, a + o)), n = rt(t, Qa, (a, o) => u("em", {
3751
3772
  children: a
3752
- }, a + o)), s = Xe(n, Xa, (a, o) => u("strong", {
3773
+ }, a + o)), s = rt(n, ei, (a, o) => u("strong", {
3753
3774
  children: a
3754
3775
  }, a + o));
3755
- return Xe(s, Za, (a, o) => u("br", {}, `br-${o}`));
3756
- }, Qa = ct("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", {
3776
+ return rt(s, ti, (a, o) => u("br", {}, `br-${o}`));
3777
+ }, ni = mt("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", {
3757
3778
  variants: {
3758
3779
  side: {
3759
3780
  left: "bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",
@@ -3767,7 +3788,7 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
3767
3788
  defaultVariants: {
3768
3789
  side: "left"
3769
3790
  }
3770
- }), ei = ({
3791
+ }), si = ({
3771
3792
  children: e,
3772
3793
  className: r,
3773
3794
  animate: t,
@@ -3777,14 +3798,14 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
3777
3798
  style: {
3778
3799
  transformOrigin: n === "left" ? "0% 50%" : "100% 50%"
3779
3800
  },
3780
- class: Qa({
3801
+ class: ni({
3781
3802
  className: r,
3782
3803
  side: n,
3783
3804
  animate: t
3784
3805
  }),
3785
3806
  ...s,
3786
3807
  children: e
3787
- }), ti = ({
3808
+ }), ai = ({
3788
3809
  message: e
3789
3810
  }) => u("div", {
3790
3811
  class: "bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",
@@ -3808,14 +3829,14 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
3808
3829
  })
3809
3830
  })]
3810
3831
  })
3811
- }), ri = ({
3832
+ }), ii = ({
3812
3833
  className: e,
3813
3834
  ...r
3814
3835
  }) => u("div", {
3815
3836
  "aria-hidden": !0,
3816
- children: se.isBotTyping$.value === !0 ? u("div", {
3837
+ children: ie.isBotTyping$.value === !0 ? u("div", {
3817
3838
  "data-testid": "typing-indicator",
3818
- class: qe("flex gap-1 p-4", e),
3839
+ class: Ke("flex gap-1 p-4", e),
3819
3840
  ...r,
3820
3841
  children: Array.from({
3821
3842
  length: 3
@@ -3826,10 +3847,10 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
3826
3847
  }
3827
3848
  }))
3828
3849
  }) : void 0
3829
- }), ni = {
3850
+ }), oi = {
3830
3851
  bot: "left",
3831
3852
  user: "right"
3832
- }, si = ct("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)]", {
3853
+ }, li = mt("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)]", {
3833
3854
  variants: {
3834
3855
  variant: {
3835
3856
  info: "text-neutral-11",
@@ -3838,12 +3859,12 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
3838
3859
  success: "text-system-success"
3839
3860
  }
3840
3861
  }
3841
- }), ai = ({
3862
+ }), ui = ({
3842
3863
  lastSentMessageFooter: e
3843
3864
  }) => {
3844
3865
  const {
3845
3866
  t: r
3846
- } = Q(), t = j.current$.value.flow, n = (t == null ? void 0 : t.data.messages) ?? [], s = t ? Ft(t) : void 0;
3867
+ } = ee(), t = K.current$.value.flow, n = (t == null ? void 0 : t.data.messages) ?? [], s = t ? Dt(t) : void 0;
3847
3868
  return u("ol", {
3848
3869
  "aria-label": r("chat_messages"),
3849
3870
  "aria-live": "polite",
@@ -3852,28 +3873,28 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
3852
3873
  children: u("li", {
3853
3874
  class: "flex",
3854
3875
  tabIndex: a === n.length - 1 ? -1 : void 0,
3855
- children: [s && i.groupId === s && !n.slice(a + 1).some((o) => o.groupId === s) ? e : null, Fn(i).with({
3876
+ children: [s && i.groupId === s && !n.slice(a + 1).some((o) => o.groupId === s) ? e : null, Mn(i).with({
3856
3877
  type: "system"
3857
3878
  }, (o) => u("p", {
3858
- class: si({
3879
+ class: li({
3859
3880
  variant: o.variant
3860
3881
  }),
3861
3882
  children: o.text
3862
3883
  })).with({
3863
3884
  type: "text",
3864
- author: Vn.union("bot", "user")
3885
+ author: Ln.union("bot", "user")
3865
3886
  }, (o) => {
3866
- const c = a === n.length - 1, p = o.author === "bot" ? Ya(o.text) : o.text;
3887
+ const c = a === n.length - 1, f = o.author === "bot" ? ri(o.text) : o.text;
3867
3888
  return u(we, {
3868
- children: u(ei, {
3889
+ children: u(si, {
3869
3890
  animate: c,
3870
- side: ni[o.author],
3871
- children: p
3891
+ side: oi[o.author],
3892
+ children: f
3872
3893
  }, a)
3873
3894
  });
3874
3895
  }).with({
3875
3896
  type: "link"
3876
- }, (o) => u(ti, {
3897
+ }, (o) => u(ai, {
3877
3898
  message: o
3878
3899
  })).with({
3879
3900
  type: "image"
@@ -3885,7 +3906,7 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
3885
3906
  }
3886
3907
  })).with({
3887
3908
  type: "file"
3888
- }, (o) => u(Ps, {
3909
+ }, (o) => u(zs, {
3889
3910
  class: o.author === "bot" ? void 0 : "ml-auto",
3890
3911
  file: {
3891
3912
  name: o.fileName,
@@ -3895,9 +3916,9 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
3895
3916
  type: "loading"
3896
3917
  }, (o) => {
3897
3918
  const c = n[n.length - 1];
3898
- return !(o === c) || se.isBotTyping$.value ? null : u("div", {
3919
+ return !(o === c) || ie.isBotTyping$.value ? null : u("div", {
3899
3920
  class: "flex flex-grow flex-col items-center justify-center gap-2",
3900
- children: [u(Et, {
3921
+ children: [u(Rt, {
3901
3922
  "aria-hidden": o.text ? "true" : void 0,
3902
3923
  class: "text-neutral-6 h-8 w-8"
3903
3924
  }), o.text ? u("p", {
@@ -3909,7 +3930,7 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
3909
3930
  }).exhaustive()]
3910
3931
  })
3911
3932
  }, a)), u("li", {
3912
- class: se.captchaVisible$.value ? "flex" : "hidden",
3933
+ class: ie.captchaVisible$.value ? "flex" : "hidden",
3913
3934
  children: u("div", {
3914
3935
  "data-captcha-slot": !0,
3915
3936
  tabIndex: -1,
@@ -3917,9 +3938,9 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
3917
3938
  "aria-label": r("captcha_check"),
3918
3939
  class: "w-full max-w-[min(100%,24rem)] rounded-md"
3919
3940
  })
3920
- }, "captcha"), u(ri, {}, "typing")]
3941
+ }, "captcha"), u(ii, {}, "typing")]
3921
3942
  });
3922
- }, ci = ({
3943
+ }, hi = ({
3923
3944
  logger: e,
3924
3945
  apiClient: r,
3925
3946
  analytics: t,
@@ -3927,37 +3948,37 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
3927
3948
  }) => {
3928
3949
  const {
3929
3950
  flow: s
3930
- } = j.current$.value;
3951
+ } = K.current$.value;
3931
3952
  Ne(s, "Flow is required to exist to show chatbot body");
3932
- const i = j.viewState$.value, {
3953
+ const i = K.viewState$.value, {
3933
3954
  chatRef: a,
3934
3955
  chatService: o
3935
- } = Mn(), {
3956
+ } = Nn(), {
3936
3957
  t: c
3937
- } = Q(), [p, g] = ve();
3958
+ } = ee(), [f, g] = ve();
3938
3959
  return Ae(() => {
3939
- i === "maximised" && se.scrollToEnd();
3960
+ i === "maximised" && ie.scrollToEnd();
3940
3961
  }, [i]), Ae(() => {
3941
3962
  var V;
3942
3963
  const {
3943
3964
  state: b,
3944
3965
  flow: h
3945
- } = j.current$.peek();
3966
+ } = K.current$.peek();
3946
3967
  if (b !== "loaded")
3947
3968
  throw new Error(c("invalid_state"));
3948
3969
  let m = h.data.nodeHistory.at(-1);
3949
- if (se.scrollToEnd(), j.setInput(void 0), h.data.isFinished)
3970
+ if (ie.scrollToEnd(), K.setInput(void 0), h.data.isFinished)
3950
3971
  return;
3951
- const w = () => {
3952
- const L = j.current$.peek().flow;
3953
- !L || L.data.hasInteracted || (j.markAsInteracted(), Jt(t, L, "FLOW_INTERACT"));
3972
+ const k = () => {
3973
+ const T = K.current$.peek().flow;
3974
+ !T || T.data.hasInteracted || (K.markAsInteracted(), er(t, T, "FLOW_INTERACT"));
3954
3975
  };
3955
- se.onInteractionFn$.value = w, m === void 0 ? (m = Lr(s.nodes).id, j.setCurrentNodeId(m), Jt(t, h, "FLOW_START")) : j.removeMessagesSentByNodeIds([m, St]);
3976
+ ie.onInteractionFn$.value = k, m === void 0 ? (m = Or(s.nodes).id, K.setCurrentNodeId(m), er(t, h, "FLOW_START")) : K.removeMessagesSentByNodeIds([m, Mt]);
3956
3977
  const {
3957
- interpret: S,
3978
+ interpret: I,
3958
3979
  abort: C,
3959
- undo: _
3960
- } = Gn({
3980
+ undo: x
3981
+ } = Xn({
3961
3982
  context: s.context,
3962
3983
  analytics: {
3963
3984
  service: t,
@@ -3970,44 +3991,44 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
3970
3991
  chatService: o,
3971
3992
  t: c,
3972
3993
  getApplicationRecovery: () => {
3973
- var L;
3974
- return (L = j.current$.peek().flow) == null ? void 0 : L.data.applicationRecovery;
3994
+ var T;
3995
+ return (T = K.current$.peek().flow) == null ? void 0 : T.data.applicationRecovery;
3975
3996
  },
3976
- setApplicationRecovery: j.setApplicationRecovery,
3977
- persistWriteBarrier: () => j.persistWriteBarrier(h),
3997
+ setApplicationRecovery: K.setApplicationRecovery,
3998
+ persistWriteBarrier: () => K.persistWriteBarrier(h),
3978
3999
  // We need to get fresh submissions, that’s why we call `peek` here.
3979
4000
  getSubmissions: () => {
3980
- var L;
3981
- return (L = j.current$.peek().flow) == null ? void 0 : L.data.submissions;
4001
+ var T;
4002
+ return (T = K.current$.peek().flow) == null ? void 0 : T.data.submissions;
3982
4003
  },
3983
- onInterpret: (L) => j.setCurrentNodeId(L.id),
4004
+ onInterpret: (T) => K.setCurrentNodeId(T.id),
3984
4005
  onFlowEnd: async () => {
3985
- var U;
3986
- j.markAsFinished();
3987
- const L = j.current$.peek().flow;
3988
- Ne(L), t.log({
4006
+ var R;
4007
+ K.markAsFinished();
4008
+ const T = K.current$.peek().flow;
4009
+ Ne(T), t.log({
3989
4010
  event: "FLOW_END",
3990
4011
  properties: {
3991
4012
  flow_id: s.id,
3992
4013
  flow_version: s.version,
3993
- flow_session_id: L.data.flowSessionId,
4014
+ flow_session_id: T.data.flowSessionId,
3994
4015
  flow_build: s.build,
3995
4016
  job: s.job
3996
4017
  },
3997
- customProperties: (U = s.analytics) == null ? void 0 : U.customProperties
4018
+ customProperties: (R = s.analytics) == null ? void 0 : R.customProperties
3998
4019
  });
3999
4020
  }
4000
- }), y = m, E = () => {
4001
- g(() => _), S(y);
4002
- }, A = new AbortController();
4003
- return h.offerResume ? ms({
4021
+ }), y = m, F = () => {
4022
+ g(() => x), I(y);
4023
+ }, N = new AbortController();
4024
+ return h.offerResume ? vs({
4004
4025
  chatService: o,
4005
4026
  t: c,
4006
- signal: A.signal
4007
- }).then((L) => (j.settleResume(h), L ? E() : (j.restart(), Ln.flushStateData()))).catch((L) => {
4008
- L instanceof Cr || e.error("Resume prompt failed", L);
4009
- }) : E(), () => {
4010
- A.abort(), se.onInteractionFn$.value === w && (se.onInteractionFn$.value = () => {
4027
+ signal: N.signal
4028
+ }).then((T) => (K.settleResume(h), T ? F() : (K.restart(), Rn.flushStateData()))).catch((T) => {
4029
+ T instanceof Fr || e.error("Resume prompt failed", T);
4030
+ }) : F(), () => {
4031
+ N.abort(), ie.onInteractionFn$.value === k && (ie.onInteractionFn$.value = () => {
4011
4032
  }), C();
4012
4033
  };
4013
4034
  }, [t, r, o, e, s, n, c]), u(we, {
@@ -4022,44 +4043,44 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
4022
4043
  style: {
4023
4044
  WebkitOverflowScrolling: "touch"
4024
4045
  },
4025
- children: u(ai, {
4026
- lastSentMessageFooter: !Ft(s) || !p ? null : u(ii, {
4027
- undoFn: p
4046
+ children: u(ui, {
4047
+ lastSentMessageFooter: !Dt(s) || !f ? null : u(ci, {
4048
+ undoFn: f
4028
4049
  })
4029
4050
  })
4030
- }), se.isReadingHistory$.value && !s.data.isFinished && !se.isBotTyping$.value && u("div", {
4051
+ }), ie.isReadingHistory$.value && !s.data.isFinished && !ie.isBotTyping$.value && u("div", {
4031
4052
  class: "absolute bottom-2 left-1/2 -translate-x-1/2",
4032
- children: u(Vr, {
4053
+ children: u(Dr, {
4033
4054
  class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
4034
4055
  "aria-label": c("jump_to_current"),
4035
4056
  onClick: () => {
4036
4057
  var h, m;
4037
- se.scrollToEnd(), (m = ((h = a.current) == null ? void 0 : h.querySelector('li[tabindex="-1"]')) ?? a.current) == null || m.focus({
4058
+ ie.scrollToEnd(), (m = ((h = a.current) == null ? void 0 : h.querySelector('li[tabindex="-1"]')) ?? a.current) == null || m.focus({
4038
4059
  preventScroll: !0
4039
4060
  });
4040
4061
  },
4041
- children: u(Nn, {})
4062
+ children: u(Dn, {})
4042
4063
  })
4043
4064
  })]
4044
- }), u(Ba, {
4065
+ }), u(Ua, {
4045
4066
  logger: e,
4046
4067
  analytics: t
4047
4068
  })]
4048
4069
  });
4049
- }, ii = ({
4070
+ }, ci = ({
4050
4071
  undoFn: e
4051
4072
  }) => {
4052
4073
  const {
4053
4074
  t: r
4054
- } = Q();
4075
+ } = ee();
4055
4076
  return u("div", {
4056
4077
  class: "flex flex-1 items-center justify-end px-1",
4057
- children: u(Vr, {
4078
+ children: u(Dr, {
4058
4079
  "aria-label": r("undo"),
4059
4080
  onClick: async () => {
4060
4081
  const {
4061
4082
  flow: t
4062
- } = j.current$.peek();
4083
+ } = K.current$.peek();
4063
4084
  Ne(t), e(t.data.nodeHistory);
4064
4085
  },
4065
4086
  children: u("path", {
@@ -4069,5 +4090,5 @@ const Xe = /* @__PURE__ */ ja(za), Ka = /(\[[^\]]+\]\([^)]+\))/g, Ga = /\[([^\]]
4069
4090
  });
4070
4091
  };
4071
4092
  export {
4072
- ci as ChatbotBody
4093
+ hi as ChatbotBody
4073
4094
  };