@inploi/plugin-chatbot 14.5.0 → 14.7.0

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