@inploi/plugin-chatbot 14.0.1 → 14.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.js +5 -5
- package/dist/{chatbot-body-77c91e40.js → chatbot-body-2d2c07ed.js} +846 -849
- package/dist/chatbot-body-e3769bf3.cjs +5 -0
- package/dist/chatbot.idb.d.ts +1 -0
- package/dist/chatbot.state.d.ts +8 -1
- package/dist/i18n.d.ts +18 -6
- package/dist/index-267eafbe.cjs +5 -0
- package/dist/{index-21fc767e.js → index-ec4bd865.js} +618 -608
- package/dist/interpreter.d.ts +2 -0
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +3 -3
- package/dist/chatbot-body-a078e4eb.cjs +0 -5
- package/dist/index-bc9b2b2e.cjs +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { K as ur, H as Je, j as ct, G as je, W as cr, g as dr, a as pt, A as Xr, B as Yr, F as Qr, E as fr, b as es, U as ts, X as rs, J as ss, u as ne, o as u, c as Te, d as Ze, h as Se, _ as fe, i as Fe, y as ke, k as ve, L as ht, e as ns, s as $, p as is, f as pr, l as as, m as De, z as os, C as Y, n as ae, M as ls, q as us, r as cs, S as hr, t as ds } from "./index-ec4bd865.js";
|
|
2
|
+
import { isApiErrorWithData as fs, ApiError as ps } from "@inploi/sdk";
|
|
3
3
|
const Ot = (e, r, t) => {
|
|
4
4
|
var s;
|
|
5
5
|
return e.log({
|
|
@@ -43,13 +43,13 @@ var Rt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
43
43
|
let o = ct(n.value, a), d = { ...s, data: { compareKey: "_temp", compare: e.compare, compareValue: e.compareValue } };
|
|
44
44
|
switch (typeof o) {
|
|
45
45
|
case "boolean":
|
|
46
|
-
return
|
|
46
|
+
return Pe(d, { submissions: { _temp: { value: o, type: "boolean" } }, context: r });
|
|
47
47
|
case "string":
|
|
48
|
-
return
|
|
48
|
+
return Pe(d, { submissions: { _temp: { value: o, type: "string" } }, context: r });
|
|
49
49
|
case "number":
|
|
50
|
-
return
|
|
50
|
+
return Pe(d, { submissions: { _temp: { value: o, type: "number" } }, context: r });
|
|
51
51
|
case "object":
|
|
52
|
-
return Array.isArray(o) && o.every((
|
|
52
|
+
return Array.isArray(o) && o.every((h) => typeof h == "string") ? Pe(d, { submissions: { _temp: { value: o, type: "enum" } }, context: r }) : !1;
|
|
53
53
|
}
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
@@ -113,7 +113,7 @@ var Rt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
113
113
|
}
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
|
-
},
|
|
116
|
+
}, Pe = (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
119
|
for (let i of s)
|
|
@@ -126,7 +126,7 @@ var Rt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
126
126
|
return !1;
|
|
127
127
|
return !0;
|
|
128
128
|
}
|
|
129
|
-
},
|
|
129
|
+
}, hs = /{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g, ys = (e, { context: r, submissions: t }) => e.replace(hs, (s, i, a = "") => {
|
|
130
130
|
let [n, ...o] = i.trim().split("."), d = ur({ key: n, path: o, submissions: t, context: r });
|
|
131
131
|
if (!d)
|
|
132
132
|
return a;
|
|
@@ -134,11 +134,11 @@ var Rt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
134
134
|
case "boolean":
|
|
135
135
|
return d.value === !0 ? "true" : "false";
|
|
136
136
|
case "file":
|
|
137
|
-
return d.value.map((
|
|
137
|
+
return d.value.map((h) => `${h.name} (${je(h.sizeKb)})`).join(", ");
|
|
138
138
|
case "enum":
|
|
139
139
|
return d.value.join(", ");
|
|
140
140
|
case "address":
|
|
141
|
-
return Object.values(d.value).filter((
|
|
141
|
+
return Object.values(d.value).filter((h) => h && h.trim().length > 0).join(", ");
|
|
142
142
|
case "number":
|
|
143
143
|
case "string":
|
|
144
144
|
return d.value ? d.value.toString() : a;
|
|
@@ -147,30 +147,30 @@ var Rt = ({ condition: e, context: r, submissions: t, ifBlock: s }) => {
|
|
|
147
147
|
case "integration": {
|
|
148
148
|
if (typeof d.value != "object" || Array.isArray(d.value))
|
|
149
149
|
break;
|
|
150
|
-
let
|
|
151
|
-
switch (typeof
|
|
150
|
+
let h = ct(d.value, o);
|
|
151
|
+
switch (typeof h) {
|
|
152
152
|
case "boolean":
|
|
153
|
-
return
|
|
153
|
+
return h === !0 ? "true" : "false";
|
|
154
154
|
case "string":
|
|
155
|
-
return
|
|
155
|
+
return h;
|
|
156
156
|
case "number":
|
|
157
|
-
return
|
|
157
|
+
return h.toString();
|
|
158
158
|
case "object":
|
|
159
|
-
if (Array.isArray(
|
|
160
|
-
return
|
|
159
|
+
if (Array.isArray(h) && h.every((v) => typeof v == "string"))
|
|
160
|
+
return h.join(", ");
|
|
161
161
|
}
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
return a;
|
|
166
166
|
});
|
|
167
|
-
const
|
|
167
|
+
const yr = ({
|
|
168
168
|
context: e,
|
|
169
169
|
submissions: r
|
|
170
170
|
}) => ({
|
|
171
171
|
context: e,
|
|
172
172
|
submissions: r ?? {}
|
|
173
|
-
}),
|
|
173
|
+
}), pe = (e, r) => ys(e, yr(r)), ms = (e, r) => Pe(e, yr(r)), mr = ({
|
|
174
174
|
node: e,
|
|
175
175
|
nodes: r,
|
|
176
176
|
stopWhen: t
|
|
@@ -179,12 +179,12 @@ const pr = ({
|
|
|
179
179
|
return e;
|
|
180
180
|
const s = e.nextId ? r.find((i) => i.id === e.nextId) : void 0;
|
|
181
181
|
if (s)
|
|
182
|
-
return
|
|
182
|
+
return mr({
|
|
183
183
|
node: s,
|
|
184
184
|
nodes: r,
|
|
185
185
|
stopWhen: t
|
|
186
186
|
});
|
|
187
|
-
},
|
|
187
|
+
}, gs = ({
|
|
188
188
|
childNode: e,
|
|
189
189
|
nodes: r
|
|
190
190
|
}) => {
|
|
@@ -194,7 +194,7 @@ const pr = ({
|
|
|
194
194
|
const a = r.find((o) => o.id === i.branchId);
|
|
195
195
|
if (!a)
|
|
196
196
|
return !1;
|
|
197
|
-
const n =
|
|
197
|
+
const n = mr({
|
|
198
198
|
node: a,
|
|
199
199
|
nodes: r,
|
|
200
200
|
stopWhen: (o) => o.id === e.id
|
|
@@ -203,7 +203,7 @@ const pr = ({
|
|
|
203
203
|
});
|
|
204
204
|
if (s != null && s.nextId)
|
|
205
205
|
return r.find((i) => i.id === s.nextId);
|
|
206
|
-
},
|
|
206
|
+
}, bs = ({
|
|
207
207
|
flow: e,
|
|
208
208
|
analytics: r,
|
|
209
209
|
logger: t,
|
|
@@ -213,22 +213,22 @@ const pr = ({
|
|
|
213
213
|
getSubmissions: n,
|
|
214
214
|
getApplicationRecovery: o,
|
|
215
215
|
setApplicationRecovery: d,
|
|
216
|
-
chatService:
|
|
216
|
+
chatService: h,
|
|
217
217
|
persistWriteBarrier: v,
|
|
218
218
|
onFlowEnd: x,
|
|
219
|
-
onInterpret:
|
|
219
|
+
onInterpret: p,
|
|
220
220
|
t: m
|
|
221
221
|
}) => {
|
|
222
222
|
var N;
|
|
223
223
|
let k = new AbortController();
|
|
224
224
|
(N = e.data).startedWriteNodeIds ?? (N.startedWriteNodeIds = e.nodes.flatMap((y) => {
|
|
225
|
-
var
|
|
225
|
+
var A, B;
|
|
226
226
|
if (y.type !== "integration-application-submit" || !e.data.nodeHistory.includes(y.id))
|
|
227
227
|
return [];
|
|
228
|
-
const C = y.data.key ? (
|
|
229
|
-
return (C == null ? void 0 : C.type) === "integration" && ((
|
|
228
|
+
const C = y.data.key ? (A = n()) == null ? void 0 : A[y.data.key] : void 0;
|
|
229
|
+
return (C == null ? void 0 : C.type) === "integration" && ((B = cr(C.value)) == null ? void 0 : B.verdict) === "not_submitted" ? [] : [y.id];
|
|
230
230
|
}));
|
|
231
|
-
const
|
|
231
|
+
const I = {
|
|
232
232
|
...r.service,
|
|
233
233
|
log: (y) => r.service.log({
|
|
234
234
|
...y,
|
|
@@ -237,101 +237,101 @@ const pr = ({
|
|
|
237
237
|
...r.customProperties
|
|
238
238
|
}
|
|
239
239
|
})
|
|
240
|
-
},
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
240
|
+
}, V = async (y, C) => {
|
|
241
|
+
const E = k.signal;
|
|
242
|
+
if (E.aborted)
|
|
243
243
|
return;
|
|
244
|
-
const
|
|
245
|
-
var
|
|
246
|
-
return
|
|
244
|
+
const A = n(), B = o(), J = (B == null ? void 0 : B.submitNodeId) === y.id ? e.nodes.find((L) => {
|
|
245
|
+
var F;
|
|
246
|
+
return L.id === B.fileQuestionNodeId && L.type === "question-file" && ((F = A == null ? void 0 : A[L.data.key]) == null ? void 0 : F.type) !== "file";
|
|
247
247
|
}) : void 0;
|
|
248
248
|
if (J)
|
|
249
|
-
return
|
|
250
|
-
|
|
249
|
+
return V(J, C);
|
|
250
|
+
p == null || p(y, C);
|
|
251
251
|
try {
|
|
252
|
-
await
|
|
252
|
+
await vs({
|
|
253
253
|
flow: e,
|
|
254
|
-
analytics:
|
|
254
|
+
analytics: I,
|
|
255
255
|
logger: t,
|
|
256
256
|
talentBankClient: s,
|
|
257
257
|
apiClient: a,
|
|
258
258
|
context: i,
|
|
259
259
|
node: y,
|
|
260
|
-
submissions:
|
|
261
|
-
applicationRecovery:
|
|
262
|
-
setApplicationRecovery: async (
|
|
263
|
-
if (!
|
|
260
|
+
submissions: A,
|
|
261
|
+
applicationRecovery: B,
|
|
262
|
+
setApplicationRecovery: async (L) => {
|
|
263
|
+
if (!E.aborted)
|
|
264
264
|
try {
|
|
265
|
-
await d(
|
|
266
|
-
} catch (
|
|
267
|
-
t.error("Failed to persist application recovery",
|
|
265
|
+
await d(L);
|
|
266
|
+
} catch (F) {
|
|
267
|
+
t.error("Failed to persist application recovery", F);
|
|
268
268
|
}
|
|
269
269
|
},
|
|
270
|
-
forceSubmitConfirmation: (
|
|
270
|
+
forceSubmitConfirmation: (B == null ? void 0 : B.submitNodeId) === y.id,
|
|
271
271
|
persistWriteBarrier: v,
|
|
272
|
-
signal:
|
|
272
|
+
signal: E,
|
|
273
273
|
t: m,
|
|
274
274
|
chat: {
|
|
275
|
-
sendMessage: async (
|
|
275
|
+
sendMessage: async (L) => h.send({
|
|
276
276
|
groupId: y.id,
|
|
277
|
-
message:
|
|
278
|
-
signal:
|
|
277
|
+
message: L,
|
|
278
|
+
signal: E
|
|
279
279
|
}),
|
|
280
|
-
userInput: async (
|
|
281
|
-
input:
|
|
282
|
-
signal:
|
|
280
|
+
userInput: async (L) => h.input({
|
|
281
|
+
input: L,
|
|
282
|
+
signal: E
|
|
283
283
|
}),
|
|
284
|
-
setSubmission: (
|
|
285
|
-
|
|
284
|
+
setSubmission: (L, F) => {
|
|
285
|
+
E.aborted || h.setSubmission(L, F);
|
|
286
286
|
}
|
|
287
287
|
},
|
|
288
|
-
next: (
|
|
289
|
-
if (
|
|
288
|
+
next: (L) => {
|
|
289
|
+
if (E.aborted)
|
|
290
290
|
return;
|
|
291
|
-
const
|
|
291
|
+
const F = (B == null ? void 0 : B.fileQuestionNodeId) === y.id ? B.submitNodeId : L, P = F ? e.nodes.find((H) => H.id === F) : gs({
|
|
292
292
|
childNode: y,
|
|
293
293
|
nodes: e.nodes
|
|
294
294
|
});
|
|
295
|
-
return
|
|
295
|
+
return P ? V(P, y) : x == null ? void 0 : x(y);
|
|
296
296
|
},
|
|
297
297
|
end: () => {
|
|
298
|
-
|
|
298
|
+
E.aborted || x == null || x(y);
|
|
299
299
|
}
|
|
300
300
|
});
|
|
301
|
-
} catch (
|
|
302
|
-
if (
|
|
301
|
+
} catch (L) {
|
|
302
|
+
if (L instanceof Xr)
|
|
303
303
|
return;
|
|
304
|
-
throw
|
|
304
|
+
throw L;
|
|
305
305
|
}
|
|
306
306
|
};
|
|
307
307
|
return {
|
|
308
308
|
interpret: async (y) => {
|
|
309
|
-
const C = e.nodes.find((
|
|
310
|
-
return
|
|
309
|
+
const C = e.nodes.find((E) => E.id === y) ?? dr(e.nodes);
|
|
310
|
+
return V(C);
|
|
311
311
|
},
|
|
312
312
|
undo: (y) => {
|
|
313
|
-
var
|
|
314
|
-
if ((
|
|
313
|
+
var F;
|
|
314
|
+
if ((F = e.data.startedWriteNodeIds) != null && F.length || e.data.isFinished)
|
|
315
315
|
return {
|
|
316
316
|
removed: 0
|
|
317
317
|
};
|
|
318
|
-
const C =
|
|
319
|
-
if (
|
|
318
|
+
const C = pt(e), E = C ? y.lastIndexOf(C) : -1, A = e.nodes.find((P) => P.id === C);
|
|
319
|
+
if (E === -1 || !A)
|
|
320
320
|
return {
|
|
321
321
|
removed: 0
|
|
322
322
|
};
|
|
323
|
-
const
|
|
323
|
+
const B = e.nodes.find((P) => P.id === y[y.length - 1]);
|
|
324
324
|
k.abort();
|
|
325
|
-
const J = y.splice(
|
|
326
|
-
e.data.messages = e.data.messages.filter((
|
|
327
|
-
const
|
|
328
|
-
for (const
|
|
329
|
-
const
|
|
330
|
-
if (!(!
|
|
331
|
-
for (const
|
|
332
|
-
typeof
|
|
325
|
+
const J = y.splice(E);
|
|
326
|
+
e.data.messages = e.data.messages.filter((P) => !P.groupId || !J.includes(P.groupId)), e.data.currentInput = null;
|
|
327
|
+
const L = n();
|
|
328
|
+
for (const P of J.slice(1)) {
|
|
329
|
+
const H = e.nodes.find((M) => M.id === P);
|
|
330
|
+
if (!(!H || !L || H.id === C) && ("key" in H.data && H.data.key && delete L[H.data.key], "keys" in H.data))
|
|
331
|
+
for (const M of Object.values(H.data.keys))
|
|
332
|
+
typeof M == "string" && delete L[M];
|
|
333
333
|
}
|
|
334
|
-
return k = new AbortController(),
|
|
334
|
+
return k = new AbortController(), V(A, B), {
|
|
335
335
|
removed: J.length
|
|
336
336
|
};
|
|
337
337
|
},
|
|
@@ -340,7 +340,7 @@ const pr = ({
|
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
342
|
};
|
|
343
|
-
async function
|
|
343
|
+
async function vs(e) {
|
|
344
344
|
const r = e.node;
|
|
345
345
|
switch (r.type) {
|
|
346
346
|
case "flow-section":
|
|
@@ -355,7 +355,7 @@ async function xs(e) {
|
|
|
355
355
|
node: r
|
|
356
356
|
});
|
|
357
357
|
case "text":
|
|
358
|
-
return
|
|
358
|
+
return Vs({
|
|
359
359
|
...e,
|
|
360
360
|
node: r
|
|
361
361
|
});
|
|
@@ -385,7 +385,7 @@ async function xs(e) {
|
|
|
385
385
|
node: r
|
|
386
386
|
});
|
|
387
387
|
case "question-boolean":
|
|
388
|
-
return
|
|
388
|
+
return Ts({
|
|
389
389
|
...e,
|
|
390
390
|
node: r
|
|
391
391
|
});
|
|
@@ -395,7 +395,7 @@ async function xs(e) {
|
|
|
395
395
|
node: r
|
|
396
396
|
});
|
|
397
397
|
case "question-address":
|
|
398
|
-
return
|
|
398
|
+
return Ds({
|
|
399
399
|
...e,
|
|
400
400
|
node: r
|
|
401
401
|
});
|
|
@@ -405,12 +405,12 @@ async function xs(e) {
|
|
|
405
405
|
node: r
|
|
406
406
|
});
|
|
407
407
|
case "if-block":
|
|
408
|
-
return
|
|
408
|
+
return Fs({
|
|
409
409
|
...e,
|
|
410
410
|
node: r
|
|
411
411
|
});
|
|
412
412
|
case "jump":
|
|
413
|
-
return
|
|
413
|
+
return _s({
|
|
414
414
|
...e,
|
|
415
415
|
node: r
|
|
416
416
|
});
|
|
@@ -425,19 +425,19 @@ async function xs(e) {
|
|
|
425
425
|
node: r
|
|
426
426
|
});
|
|
427
427
|
case "add-submission":
|
|
428
|
-
return
|
|
428
|
+
return ks({
|
|
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
|
|
435
|
+
return ws({
|
|
436
436
|
...e,
|
|
437
437
|
node: r
|
|
438
438
|
});
|
|
439
439
|
case "feedback":
|
|
440
|
-
return
|
|
440
|
+
return xs({
|
|
441
441
|
...e,
|
|
442
442
|
node: r
|
|
443
443
|
});
|
|
@@ -445,13 +445,13 @@ async function xs(e) {
|
|
|
445
445
|
throw new Error(`Unknown node: ${JSON.stringify(r)}`);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
async function
|
|
448
|
+
async function xs({
|
|
449
449
|
next: e,
|
|
450
450
|
node: r
|
|
451
451
|
}) {
|
|
452
452
|
e(r.nextId);
|
|
453
453
|
}
|
|
454
|
-
async function
|
|
454
|
+
async function ws({
|
|
455
455
|
next: e,
|
|
456
456
|
node: r,
|
|
457
457
|
talentBankClient: t,
|
|
@@ -465,15 +465,15 @@ async function _s({
|
|
|
465
465
|
isDuplicate: !1
|
|
466
466
|
};
|
|
467
467
|
if (s && t) {
|
|
468
|
-
const
|
|
469
|
-
if (r.data.scope === "company" ||
|
|
468
|
+
const h = r.data.scope === "job" ? (d = i.job) == null ? void 0 : d.id : void 0;
|
|
469
|
+
if (r.data.scope === "company" || h != null)
|
|
470
470
|
try {
|
|
471
471
|
o = await t.checkDuplicate({
|
|
472
|
-
email:
|
|
472
|
+
email: Yr({
|
|
473
473
|
key: r.data.email,
|
|
474
474
|
submissions: s
|
|
475
475
|
}).toString(),
|
|
476
|
-
jobId:
|
|
476
|
+
jobId: h,
|
|
477
477
|
scope: r.data.scope
|
|
478
478
|
});
|
|
479
479
|
} catch (v) {
|
|
@@ -485,13 +485,13 @@ async function _s({
|
|
|
485
485
|
value: o
|
|
486
486
|
}), e(r.nextId);
|
|
487
487
|
}
|
|
488
|
-
async function
|
|
488
|
+
async function _s({
|
|
489
489
|
next: e,
|
|
490
490
|
node: r
|
|
491
491
|
}) {
|
|
492
492
|
e(r.data.targetId);
|
|
493
493
|
}
|
|
494
|
-
async function
|
|
494
|
+
async function ks({
|
|
495
495
|
next: e,
|
|
496
496
|
node: r,
|
|
497
497
|
logger: t,
|
|
@@ -504,12 +504,13 @@ async function Cs({
|
|
|
504
504
|
}
|
|
505
505
|
s[r.data.key] = {
|
|
506
506
|
type: "string",
|
|
507
|
-
value:
|
|
507
|
+
value: pe(r.data.value, {
|
|
508
508
|
submissions: s,
|
|
509
509
|
context: i
|
|
510
510
|
})
|
|
511
511
|
}, e(r.nextId);
|
|
512
512
|
}
|
|
513
|
+
const Cs = 5e3;
|
|
513
514
|
async function Ss({
|
|
514
515
|
chat: e,
|
|
515
516
|
next: r,
|
|
@@ -520,22 +521,22 @@ async function Ss({
|
|
|
520
521
|
submissions: n,
|
|
521
522
|
analytics: o,
|
|
522
523
|
flow: d,
|
|
523
|
-
applicationRecovery:
|
|
524
|
+
applicationRecovery: h,
|
|
524
525
|
setApplicationRecovery: v,
|
|
525
526
|
forceSubmitConfirmation: x,
|
|
526
|
-
persistWriteBarrier:
|
|
527
|
+
persistWriteBarrier: p,
|
|
527
528
|
signal: m,
|
|
528
529
|
t: k
|
|
529
530
|
}) {
|
|
530
|
-
var
|
|
531
|
-
if ((
|
|
531
|
+
var V;
|
|
532
|
+
if ((V = d.data.startedWriteNodeIds) != null && V.includes(s.id) && (h == null ? void 0 : h.submitNodeId) !== s.id)
|
|
532
533
|
return await e.sendMessage({
|
|
533
534
|
type: "system",
|
|
534
535
|
variant: "warning",
|
|
535
536
|
text: k("submission_unknown")
|
|
536
537
|
}), t();
|
|
537
|
-
const
|
|
538
|
-
var U,
|
|
538
|
+
const I = async (N) => {
|
|
539
|
+
var D, U, W, ee;
|
|
539
540
|
N !== !0 && await e.userInput({
|
|
540
541
|
type: "submit",
|
|
541
542
|
key: void 0,
|
|
@@ -552,10 +553,23 @@ async function Ss({
|
|
|
552
553
|
} = o.getSessionInfo();
|
|
553
554
|
if (m.aborted)
|
|
554
555
|
return;
|
|
555
|
-
const
|
|
556
|
-
if ((
|
|
556
|
+
const E = ((D = d.data.startedWriteNodeIds) == null ? void 0 : D.includes(s.id)) === !0;
|
|
557
|
+
if ((h == null ? void 0 : h.submitNodeId) === s.id && await v(void 0), E || (d.data.startedWriteNodeIds = [...d.data.startedWriteNodeIds ?? [], s.id]), await p().catch((T) => i.error("Failed to persist application write barrier", T)), m.aborted)
|
|
557
558
|
return;
|
|
558
|
-
let
|
|
559
|
+
let A;
|
|
560
|
+
const B = setTimeout(() => {
|
|
561
|
+
A = (async () => {
|
|
562
|
+
await e.sendMessage({
|
|
563
|
+
type: "text",
|
|
564
|
+
author: "bot",
|
|
565
|
+
text: k("submission_still_working")
|
|
566
|
+
}), await e.sendMessage({
|
|
567
|
+
type: "loading",
|
|
568
|
+
text: k("submitting")
|
|
569
|
+
});
|
|
570
|
+
})().catch((T) => i.error("Failed to send submission progress message", T));
|
|
571
|
+
}, Cs);
|
|
572
|
+
let J;
|
|
559
573
|
const L = await a.fetch("/flow/submit", {
|
|
560
574
|
method: "POST",
|
|
561
575
|
body: JSON.stringify({
|
|
@@ -565,46 +579,50 @@ async function Ss({
|
|
|
565
579
|
session_id: C,
|
|
566
580
|
job: d.job,
|
|
567
581
|
flow_build: d.build,
|
|
568
|
-
submissions:
|
|
569
|
-
pre_apply:
|
|
582
|
+
submissions: es(d.nodes, ts(n || {}, s.data.submitKeys)),
|
|
583
|
+
pre_apply: fr(d.nodes, n || {}, d.data.flowSessionId)
|
|
570
584
|
})
|
|
571
|
-
}).catch((
|
|
572
|
-
if (m.aborted)
|
|
585
|
+
}).catch((T) => (J = T, fs(T) ? T.data : T));
|
|
586
|
+
if (clearTimeout(B), await A, m.aborted)
|
|
573
587
|
return;
|
|
574
588
|
s.data.key && e.setSubmission(s.data.key, {
|
|
575
589
|
type: "integration",
|
|
576
590
|
value: L
|
|
577
591
|
});
|
|
578
|
-
const J =
|
|
579
|
-
if (
|
|
592
|
+
const F = cr(L, J instanceof ps ? J.status : void 0), P = d.job ? `${s.id}@${d.job.id_type}:${d.job.id}` : s.id, H = ((U = d.data.unconfirmedAttemptKeys) == null ? void 0 : U.includes(P)) === !0, M = rs(L);
|
|
593
|
+
if (M && o.log({
|
|
580
594
|
event: "FLOW_SUBMIT",
|
|
581
595
|
properties: {
|
|
582
596
|
flow_id: d.id,
|
|
583
597
|
flow_version: d.version,
|
|
584
598
|
flow_session_id: d.data.flowSessionId,
|
|
585
599
|
flow_build: d.build,
|
|
586
|
-
service:
|
|
587
|
-
response:
|
|
600
|
+
service: M.service,
|
|
601
|
+
response: M.response,
|
|
588
602
|
flow_type: "CHATBOT_DRAWER",
|
|
589
|
-
job: d.job
|
|
603
|
+
job: d.job,
|
|
604
|
+
// Measures how many duplicates follow the candidate's own unconfirmed attempt.
|
|
605
|
+
...(F == null ? void 0 : F.outcome) === "duplicate" && {
|
|
606
|
+
outcome: H ? "duplicate_after_own_attempt" : "duplicate"
|
|
607
|
+
}
|
|
590
608
|
}
|
|
591
|
-
}),
|
|
609
|
+
}), ss(L)) {
|
|
592
610
|
const {
|
|
593
|
-
redirect_url:
|
|
594
|
-
message:
|
|
595
|
-
button_text:
|
|
611
|
+
redirect_url: T,
|
|
612
|
+
message: oe,
|
|
613
|
+
button_text: ce
|
|
596
614
|
} = L.integration_response.data;
|
|
597
615
|
await e.sendMessage({
|
|
598
616
|
type: "text",
|
|
599
617
|
author: "bot",
|
|
600
|
-
text:
|
|
618
|
+
text: oe ?? k("submission_redirect_message")
|
|
601
619
|
});
|
|
602
620
|
try {
|
|
603
|
-
const
|
|
604
|
-
y &&
|
|
621
|
+
const ie = new URL(T);
|
|
622
|
+
y && !ie.searchParams.has("anonymous_id") && ie.searchParams.set("anonymous_id", y), await e.sendMessage({
|
|
605
623
|
type: "link",
|
|
606
|
-
href:
|
|
607
|
-
text:
|
|
624
|
+
href: ie.toString(),
|
|
625
|
+
text: ce ?? k("complete_submission"),
|
|
608
626
|
onClick: () => {
|
|
609
627
|
if (!C) {
|
|
610
628
|
i.error("session_id not set, cannot log FLOW_REDIRECT event");
|
|
@@ -617,14 +635,14 @@ async function Ss({
|
|
|
617
635
|
flow_id: d.id,
|
|
618
636
|
flow_session_id: C,
|
|
619
637
|
flow_version: d.version,
|
|
620
|
-
href:
|
|
638
|
+
href: ie.toString(),
|
|
621
639
|
job: d.job
|
|
622
640
|
}
|
|
623
641
|
});
|
|
624
642
|
}
|
|
625
643
|
});
|
|
626
|
-
} catch (
|
|
627
|
-
i.error(`Invalid redirect URL: ${
|
|
644
|
+
} catch (ie) {
|
|
645
|
+
i.error(`Invalid redirect URL: ${T}`, ie), e.sendMessage({
|
|
628
646
|
type: "system",
|
|
629
647
|
variant: "error",
|
|
630
648
|
text: k("redirect_url_error")
|
|
@@ -638,67 +656,46 @@ async function Ss({
|
|
|
638
656
|
variant: "success",
|
|
639
657
|
text: k("submission_completed")
|
|
640
658
|
}), r(s.nextId);
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
fileQuestionNodeId: D.id,
|
|
659
|
+
if ((F == null ? void 0 : F.verdict) === "not_submitted" || (F == null ? void 0 : F.outcome) === "duplicate" || (F == null ? void 0 : F.outcome) === "closed" ? (E || (d.data.startedWriteNodeIds = (W = d.data.startedWriteNodeIds) == null ? void 0 : W.filter((T) => T !== s.id)), (h == null ? void 0 : h.submitNodeId) === s.id && await v(h), await p().catch((T) => i.error("Failed to persist application write barrier release", T))) : (F == null ? void 0 : F.verdict) !== "confirmed" && !H && (d.data.unconfirmedAttemptKeys = [...d.data.unconfirmedAttemptKeys ?? [], P], await p().catch((T) => i.error("Failed to persist unconfirmed attempt", T))), F) {
|
|
660
|
+
i.error(J ?? F.message);
|
|
661
|
+
const T = F.phase === "submit" && F.verdict === "confirmed" && F.code === "unreadable_document" && typeof F.field == "string" && F.status !== void 0 && F.status >= 400 && F.status < 500 && ((ee = n == null ? void 0 : n[F.field]) == null ? void 0 : ee.type) === "file" ? F.field : void 0, oe = T === void 0 ? void 0 : d.nodes.find((ce) => ce.type === "question-file" && ce.data.key === T);
|
|
662
|
+
return oe && T !== void 0 ? (e.setSubmission(T, null), await v({
|
|
663
|
+
fileQuestionNodeId: oe.id,
|
|
647
664
|
submitNodeId: s.id
|
|
648
665
|
}), await e.sendMessage({
|
|
649
666
|
type: "system",
|
|
650
667
|
variant: "error",
|
|
651
668
|
text: k("submission_unreadable_document")
|
|
652
|
-
}), r(
|
|
669
|
+
}), r(oe.id)) : F.outcome === "duplicate" ? (await e.sendMessage({
|
|
653
670
|
type: "system",
|
|
654
671
|
variant: "info",
|
|
655
|
-
text: k("submission_duplicate")
|
|
656
|
-
}),
|
|
672
|
+
text: k(H ? "submission_duplicate_earlier_attempt" : "submission_duplicate")
|
|
673
|
+
}), I(!1)) : F.outcome === "closed" ? (await e.sendMessage({
|
|
657
674
|
type: "system",
|
|
658
675
|
variant: "info",
|
|
659
676
|
text: k("submission_closed")
|
|
660
|
-
}),
|
|
677
|
+
}), I(!1)) : F.outcome === "unknown" ? (await e.sendMessage({
|
|
661
678
|
type: "system",
|
|
662
679
|
variant: "warning",
|
|
663
680
|
text: k("submission_unknown")
|
|
664
|
-
}),
|
|
681
|
+
}), I(!1)) : (F.phase === "workflow" || F.phase === "authentication") && F.retryable === !0 && F.verdict === "not_submitted" ? (await e.sendMessage({
|
|
665
682
|
type: "system",
|
|
666
683
|
variant: "error",
|
|
667
684
|
text: k("submission_retryable")
|
|
668
|
-
}),
|
|
685
|
+
}), I(!1)) : (await e.sendMessage({
|
|
669
686
|
type: "system",
|
|
670
687
|
variant: "error",
|
|
671
688
|
text: k("submission_failed")
|
|
672
689
|
}), t());
|
|
673
690
|
}
|
|
674
|
-
return i.error(
|
|
691
|
+
return i.error(J ?? L), await e.sendMessage({
|
|
675
692
|
type: "system",
|
|
676
693
|
variant: "error",
|
|
677
694
|
text: k("submission_failed")
|
|
678
695
|
}), t();
|
|
679
696
|
};
|
|
680
|
-
await
|
|
697
|
+
await I(x === !0 ? !1 : s.data.skipConfirmation);
|
|
681
698
|
}
|
|
682
|
-
const mr = (e, r) => {
|
|
683
|
-
if (!Xr(e))
|
|
684
|
-
return;
|
|
685
|
-
const t = e.integration_response;
|
|
686
|
-
if (typeof t != "object" || t === null)
|
|
687
|
-
return;
|
|
688
|
-
const s = t.error;
|
|
689
|
-
if (typeof s != "object" || s === null)
|
|
690
|
-
return;
|
|
691
|
-
const i = s.data, a = typeof i == "object" && i !== null ? i : {}, n = (p) => typeof a[p] == "string" ? a[p] : void 0, o = (p) => typeof a[p] == "boolean" ? a[p] : void 0, d = t.status;
|
|
692
|
-
return {
|
|
693
|
-
message: e.integration_response.error.message,
|
|
694
|
-
status: typeof d == "number" ? d : r instanceof hs ? r.status : void 0,
|
|
695
|
-
phase: n("phase"),
|
|
696
|
-
retryable: o("retryable"),
|
|
697
|
-
verdict: n("verdict"),
|
|
698
|
-
code: n("code"),
|
|
699
|
-
field: n("field")
|
|
700
|
-
};
|
|
701
|
-
};
|
|
702
699
|
async function Is({
|
|
703
700
|
chat: e,
|
|
704
701
|
next: r,
|
|
@@ -708,28 +705,28 @@ async function Is({
|
|
|
708
705
|
}) {
|
|
709
706
|
await e.sendMessage({
|
|
710
707
|
type: "link",
|
|
711
|
-
href:
|
|
708
|
+
href: pe(t.data.href, {
|
|
712
709
|
submissions: s,
|
|
713
710
|
context: i
|
|
714
711
|
}),
|
|
715
|
-
text:
|
|
712
|
+
text: pe(t.data.cta, {
|
|
716
713
|
submissions: s,
|
|
717
714
|
context: i
|
|
718
715
|
})
|
|
719
716
|
}), r(t.nextId);
|
|
720
717
|
}
|
|
721
|
-
async function
|
|
718
|
+
async function Fs({
|
|
722
719
|
submissions: e,
|
|
723
720
|
next: r,
|
|
724
721
|
node: t,
|
|
725
722
|
context: s
|
|
726
723
|
}) {
|
|
727
|
-
r(
|
|
724
|
+
r(ms(t, {
|
|
728
725
|
submissions: e,
|
|
729
726
|
context: s
|
|
730
727
|
}) ? t.branchId : t.nextId);
|
|
731
728
|
}
|
|
732
|
-
async function
|
|
729
|
+
async function Vs({
|
|
733
730
|
chat: e,
|
|
734
731
|
next: r,
|
|
735
732
|
node: t,
|
|
@@ -739,7 +736,7 @@ async function Fs({
|
|
|
739
736
|
await e.sendMessage({
|
|
740
737
|
author: "bot",
|
|
741
738
|
type: "text",
|
|
742
|
-
text:
|
|
739
|
+
text: pe(t.data.text, {
|
|
743
740
|
submissions: s,
|
|
744
741
|
context: i
|
|
745
742
|
})
|
|
@@ -769,7 +766,7 @@ async function Es({
|
|
|
769
766
|
await e.sendMessage({
|
|
770
767
|
author: "bot",
|
|
771
768
|
type: "text",
|
|
772
|
-
text:
|
|
769
|
+
text: pe(t.data.question, {
|
|
773
770
|
submissions: s,
|
|
774
771
|
context: i
|
|
775
772
|
})
|
|
@@ -817,7 +814,7 @@ async function Ms({
|
|
|
817
814
|
await e.sendMessage({
|
|
818
815
|
author: "bot",
|
|
819
816
|
type: "text",
|
|
820
|
-
text:
|
|
817
|
+
text: pe(t.data.question, {
|
|
821
818
|
submissions: s,
|
|
822
819
|
context: i
|
|
823
820
|
})
|
|
@@ -854,7 +851,7 @@ async function Ns({
|
|
|
854
851
|
await e.sendMessage({
|
|
855
852
|
author: "bot",
|
|
856
853
|
type: "text",
|
|
857
|
-
text:
|
|
854
|
+
text: pe(t.data.question, {
|
|
858
855
|
submissions: s,
|
|
859
856
|
context: i
|
|
860
857
|
})
|
|
@@ -893,7 +890,7 @@ async function Ls({
|
|
|
893
890
|
await e.sendMessage({
|
|
894
891
|
author: "bot",
|
|
895
892
|
type: "text",
|
|
896
|
-
text:
|
|
893
|
+
text: pe(t.data.question, {
|
|
897
894
|
submissions: s,
|
|
898
895
|
context: i
|
|
899
896
|
})
|
|
@@ -913,7 +910,7 @@ async function Ls({
|
|
|
913
910
|
text: t.data.options.filter((o) => n.value.includes(o.value)).map((o) => o.label).join(", ")
|
|
914
911
|
}), r(t.nextId);
|
|
915
912
|
}
|
|
916
|
-
async function
|
|
913
|
+
async function Ts({
|
|
917
914
|
chat: e,
|
|
918
915
|
next: r,
|
|
919
916
|
node: t,
|
|
@@ -924,7 +921,7 @@ async function Ds({
|
|
|
924
921
|
await e.sendMessage({
|
|
925
922
|
author: "bot",
|
|
926
923
|
type: "text",
|
|
927
|
-
text:
|
|
924
|
+
text: pe(t.data.question, {
|
|
928
925
|
submissions: s,
|
|
929
926
|
context: i
|
|
930
927
|
})
|
|
@@ -950,7 +947,7 @@ async function Ds({
|
|
|
950
947
|
text: n.value === !0 ? t.data.trueLabel : t.data.falseLabel
|
|
951
948
|
}), r(t.nextId);
|
|
952
949
|
}
|
|
953
|
-
async function
|
|
950
|
+
async function Ds({
|
|
954
951
|
chat: e,
|
|
955
952
|
next: r,
|
|
956
953
|
node: t,
|
|
@@ -997,7 +994,7 @@ async function Os({
|
|
|
997
994
|
await r.sendMessage({
|
|
998
995
|
author: "bot",
|
|
999
996
|
type: "text",
|
|
1000
|
-
text:
|
|
997
|
+
text: pe(e.data.question, {
|
|
1001
998
|
submissions: s,
|
|
1002
999
|
context: i
|
|
1003
1000
|
})
|
|
@@ -1049,13 +1046,13 @@ async function Bs({
|
|
|
1049
1046
|
apiClient: a,
|
|
1050
1047
|
analytics: n
|
|
1051
1048
|
}) {
|
|
1052
|
-
const o =
|
|
1049
|
+
const o = Qr(r.nodes, t || {}), {
|
|
1053
1050
|
answers: d,
|
|
1054
|
-
...
|
|
1051
|
+
...h
|
|
1055
1052
|
} = o;
|
|
1056
1053
|
s.setSubmission(e.data.key, {
|
|
1057
1054
|
type: "integration",
|
|
1058
|
-
value:
|
|
1055
|
+
value: h
|
|
1059
1056
|
});
|
|
1060
1057
|
const v = new AbortController(), x = setTimeout(() => v.abort(), 5e3);
|
|
1061
1058
|
if (a.fetch("/flow/pre-apply", {
|
|
@@ -1065,15 +1062,15 @@ async function Bs({
|
|
|
1065
1062
|
...n.getSessionInfo(),
|
|
1066
1063
|
job: r.job,
|
|
1067
1064
|
flow_build: r.build,
|
|
1068
|
-
pre_apply:
|
|
1065
|
+
pre_apply: fr(r.nodes, t || {}, r.data.flowSessionId)
|
|
1069
1066
|
})
|
|
1070
1067
|
}).catch(() => {
|
|
1071
1068
|
}).finally(() => clearTimeout(x)), o.status !== "skipped") {
|
|
1072
1069
|
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];
|
|
1073
1070
|
for (const k of ["hard", "advisory"]) {
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1076
|
-
` +
|
|
1071
|
+
const I = d.filter((V) => !V.matched && V.severity === k);
|
|
1072
|
+
I.length && m.push((k === "hard" ? "Role requirements" : "Other things to consider") + `
|
|
1073
|
+
` + I.map((V) => `• ${V.message}`).join(`
|
|
1077
1074
|
`));
|
|
1078
1075
|
}
|
|
1079
1076
|
await s.sendMessage({
|
|
@@ -1096,15 +1093,15 @@ async function Bs({
|
|
|
1096
1093
|
}
|
|
1097
1094
|
return i(e.nextId);
|
|
1098
1095
|
}
|
|
1099
|
-
const
|
|
1096
|
+
const Ve = ({
|
|
1100
1097
|
class: e,
|
|
1101
1098
|
...r
|
|
1102
1099
|
}) => {
|
|
1103
1100
|
const {
|
|
1104
1101
|
t
|
|
1105
|
-
} =
|
|
1102
|
+
} = ne();
|
|
1106
1103
|
return u("button", {
|
|
1107
|
-
class:
|
|
1104
|
+
class: Te("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50", e),
|
|
1108
1105
|
type: "submit",
|
|
1109
1106
|
...r,
|
|
1110
1107
|
children: u("svg", {
|
|
@@ -1126,24 +1123,24 @@ const Se = ({
|
|
|
1126
1123
|
})
|
|
1127
1124
|
});
|
|
1128
1125
|
};
|
|
1129
|
-
var
|
|
1126
|
+
var ye;
|
|
1130
1127
|
// @__NO_SIDE_EFFECTS__
|
|
1131
1128
|
function Xe(e) {
|
|
1132
1129
|
return {
|
|
1133
|
-
lang: (e == null ? void 0 : e.lang) ?? (
|
|
1130
|
+
lang: (e == null ? void 0 : e.lang) ?? (ye == null ? void 0 : ye.lang),
|
|
1134
1131
|
message: e == null ? void 0 : e.message,
|
|
1135
|
-
abortEarly: (e == null ? void 0 : e.abortEarly) ?? (
|
|
1136
|
-
abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (
|
|
1132
|
+
abortEarly: (e == null ? void 0 : e.abortEarly) ?? (ye == null ? void 0 : ye.abortEarly),
|
|
1133
|
+
abortPipeEarly: (e == null ? void 0 : e.abortPipeEarly) ?? (ye == null ? void 0 : ye.abortPipeEarly)
|
|
1137
1134
|
};
|
|
1138
1135
|
}
|
|
1139
1136
|
var at;
|
|
1140
1137
|
// @__NO_SIDE_EFFECTS__
|
|
1141
|
-
function
|
|
1138
|
+
function Ps(e) {
|
|
1142
1139
|
return at == null ? void 0 : at.get(e);
|
|
1143
1140
|
}
|
|
1144
1141
|
var ot;
|
|
1145
1142
|
// @__NO_SIDE_EFFECTS__
|
|
1146
|
-
function
|
|
1143
|
+
function js(e) {
|
|
1147
1144
|
return ot == null ? void 0 : ot.get(e);
|
|
1148
1145
|
}
|
|
1149
1146
|
var lt;
|
|
@@ -1153,13 +1150,13 @@ function $s(e, r) {
|
|
|
1153
1150
|
return (t = lt == null ? void 0 : lt.get(e)) == null ? void 0 : t.get(r);
|
|
1154
1151
|
}
|
|
1155
1152
|
// @__NO_SIDE_EFFECTS__
|
|
1156
|
-
function
|
|
1153
|
+
function Le(e) {
|
|
1157
1154
|
var t, s;
|
|
1158
1155
|
const r = typeof e;
|
|
1159
1156
|
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;
|
|
1160
1157
|
}
|
|
1161
|
-
function
|
|
1162
|
-
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__ */
|
|
1158
|
+
function Z(e, r, t, s, i) {
|
|
1159
|
+
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__ */ Le(a), d = {
|
|
1163
1160
|
kind: e.kind,
|
|
1164
1161
|
type: e.type,
|
|
1165
1162
|
input: a,
|
|
@@ -1172,14 +1169,14 @@ function H(e, r, t, s, i) {
|
|
|
1172
1169
|
lang: s.lang,
|
|
1173
1170
|
abortEarly: s.abortEarly,
|
|
1174
1171
|
abortPipeEarly: s.abortPipeEarly
|
|
1175
|
-
},
|
|
1172
|
+
}, h = e.kind === "schema", v = (i == null ? void 0 : i.message) ?? e.message ?? /* @__PURE__ */ $s(e.reference, d.lang) ?? (h ? /* @__PURE__ */ js(d.lang) : null) ?? s.message ?? /* @__PURE__ */ Ps(d.lang);
|
|
1176
1173
|
v !== void 0 && (d.message = typeof v == "function" ? (
|
|
1177
1174
|
// @ts-expect-error
|
|
1178
1175
|
v(d)
|
|
1179
|
-
) : v),
|
|
1176
|
+
) : v), h && (t.typed = !1), t.issues ? t.issues.push(d) : t.issues = [d];
|
|
1180
1177
|
}
|
|
1181
1178
|
// @__NO_SIDE_EFFECTS__
|
|
1182
|
-
function
|
|
1179
|
+
function he(e) {
|
|
1183
1180
|
return {
|
|
1184
1181
|
version: 1,
|
|
1185
1182
|
vendor: "valibot",
|
|
@@ -1231,7 +1228,7 @@ function gr(e, r) {
|
|
|
1231
1228
|
requirement: e,
|
|
1232
1229
|
message: r,
|
|
1233
1230
|
"~run"(t, s) {
|
|
1234
|
-
return t.typed && !this.requirement(t.value) &&
|
|
1231
|
+
return t.typed && !this.requirement(t.value) && Z(this, "input", t, s), t;
|
|
1235
1232
|
}
|
|
1236
1233
|
};
|
|
1237
1234
|
}
|
|
@@ -1246,7 +1243,7 @@ function br(e) {
|
|
|
1246
1243
|
requirement: Ws,
|
|
1247
1244
|
message: e,
|
|
1248
1245
|
"~run"(r, t) {
|
|
1249
|
-
return r.typed && !this.requirement.test(r.value) &&
|
|
1246
|
+
return r.typed && !this.requirement.test(r.value) && Z(this, "email", r, t), r;
|
|
1250
1247
|
}
|
|
1251
1248
|
};
|
|
1252
1249
|
}
|
|
@@ -1261,7 +1258,7 @@ function $e(e, r) {
|
|
|
1261
1258
|
requirement: e,
|
|
1262
1259
|
message: r,
|
|
1263
1260
|
"~run"(t, s) {
|
|
1264
|
-
return t.typed && t.value.length > this.requirement &&
|
|
1261
|
+
return t.typed && t.value.length > this.requirement && Z(this, "length", t, s, {
|
|
1265
1262
|
received: `${t.value.length}`
|
|
1266
1263
|
}), t;
|
|
1267
1264
|
}
|
|
@@ -1274,28 +1271,28 @@ function vr(e, r) {
|
|
|
1274
1271
|
type: "max_value",
|
|
1275
1272
|
reference: vr,
|
|
1276
1273
|
async: !1,
|
|
1277
|
-
expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */
|
|
1274
|
+
expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Le(e)}`,
|
|
1278
1275
|
requirement: e,
|
|
1279
1276
|
message: r,
|
|
1280
1277
|
"~run"(t, s) {
|
|
1281
|
-
return t.typed && !(t.value <= this.requirement) &&
|
|
1282
|
-
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */
|
|
1278
|
+
return t.typed && !(t.value <= this.requirement) && Z(this, "value", t, s, {
|
|
1279
|
+
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Le(t.value)
|
|
1283
1280
|
}), t;
|
|
1284
1281
|
}
|
|
1285
1282
|
};
|
|
1286
1283
|
}
|
|
1287
1284
|
// @__NO_SIDE_EFFECTS__
|
|
1288
|
-
function
|
|
1285
|
+
function Ne(e, r) {
|
|
1289
1286
|
return {
|
|
1290
1287
|
kind: "validation",
|
|
1291
1288
|
type: "min_length",
|
|
1292
|
-
reference:
|
|
1289
|
+
reference: Ne,
|
|
1293
1290
|
async: !1,
|
|
1294
1291
|
expects: `>=${e}`,
|
|
1295
1292
|
requirement: e,
|
|
1296
1293
|
message: r,
|
|
1297
1294
|
"~run"(t, s) {
|
|
1298
|
-
return t.typed && t.value.length < this.requirement &&
|
|
1295
|
+
return t.typed && t.value.length < this.requirement && Z(this, "length", t, s, {
|
|
1299
1296
|
received: `${t.value.length}`
|
|
1300
1297
|
}), t;
|
|
1301
1298
|
}
|
|
@@ -1308,12 +1305,12 @@ function xr(e, r) {
|
|
|
1308
1305
|
type: "min_value",
|
|
1309
1306
|
reference: xr,
|
|
1310
1307
|
async: !1,
|
|
1311
|
-
expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */
|
|
1308
|
+
expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ Le(e)}`,
|
|
1312
1309
|
requirement: e,
|
|
1313
1310
|
message: r,
|
|
1314
1311
|
"~run"(t, s) {
|
|
1315
|
-
return t.typed && !(t.value >= this.requirement) &&
|
|
1316
|
-
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */
|
|
1312
|
+
return t.typed && !(t.value >= this.requirement) && Z(this, "value", t, s, {
|
|
1313
|
+
received: t.value instanceof Date ? t.value.toJSON() : /* @__PURE__ */ Le(t.value)
|
|
1317
1314
|
}), t;
|
|
1318
1315
|
}
|
|
1319
1316
|
};
|
|
@@ -1329,7 +1326,7 @@ function yt(e, r) {
|
|
|
1329
1326
|
requirement: e,
|
|
1330
1327
|
message: r,
|
|
1331
1328
|
"~run"(t, s) {
|
|
1332
|
-
return t.typed && !this.requirement.test(t.value) &&
|
|
1329
|
+
return t.typed && !this.requirement.test(t.value) && Z(this, "format", t, s), t;
|
|
1333
1330
|
}
|
|
1334
1331
|
};
|
|
1335
1332
|
}
|
|
@@ -1363,7 +1360,7 @@ function wr(e) {
|
|
|
1363
1360
|
},
|
|
1364
1361
|
message: e,
|
|
1365
1362
|
"~run"(r, t) {
|
|
1366
|
-
return r.typed && !this.requirement(r.value) &&
|
|
1363
|
+
return r.typed && !this.requirement(r.value) && Z(this, "URL", r, t), r;
|
|
1367
1364
|
}
|
|
1368
1365
|
};
|
|
1369
1366
|
}
|
|
@@ -1398,7 +1395,7 @@ function kr(e, r) {
|
|
|
1398
1395
|
item: e,
|
|
1399
1396
|
message: r,
|
|
1400
1397
|
get "~standard"() {
|
|
1401
|
-
return /* @__PURE__ */
|
|
1398
|
+
return /* @__PURE__ */ he(this);
|
|
1402
1399
|
},
|
|
1403
1400
|
"~run"(t, s) {
|
|
1404
1401
|
var a;
|
|
@@ -1408,7 +1405,7 @@ function kr(e, r) {
|
|
|
1408
1405
|
for (let n = 0; n < i.length; n++) {
|
|
1409
1406
|
const o = i[n], d = this.item["~run"]({ value: o }, s);
|
|
1410
1407
|
if (d.issues) {
|
|
1411
|
-
const
|
|
1408
|
+
const h = {
|
|
1412
1409
|
type: "array",
|
|
1413
1410
|
origin: "value",
|
|
1414
1411
|
input: i,
|
|
@@ -1416,7 +1413,7 @@ function kr(e, r) {
|
|
|
1416
1413
|
value: o
|
|
1417
1414
|
};
|
|
1418
1415
|
for (const v of d.issues)
|
|
1419
|
-
v.path ? v.path.unshift(
|
|
1416
|
+
v.path ? v.path.unshift(h) : v.path = [h], (a = t.issues) == null || a.push(v);
|
|
1420
1417
|
if (t.issues || (t.issues = d.issues), s.abortEarly) {
|
|
1421
1418
|
t.typed = !1;
|
|
1422
1419
|
break;
|
|
@@ -1425,7 +1422,7 @@ function kr(e, r) {
|
|
|
1425
1422
|
d.typed || (t.typed = !1), t.value.push(d.value);
|
|
1426
1423
|
}
|
|
1427
1424
|
} else
|
|
1428
|
-
|
|
1425
|
+
Z(this, "type", t, s);
|
|
1429
1426
|
return t;
|
|
1430
1427
|
}
|
|
1431
1428
|
};
|
|
@@ -1440,10 +1437,10 @@ function Cr(e) {
|
|
|
1440
1437
|
async: !1,
|
|
1441
1438
|
message: e,
|
|
1442
1439
|
get "~standard"() {
|
|
1443
|
-
return /* @__PURE__ */
|
|
1440
|
+
return /* @__PURE__ */ he(this);
|
|
1444
1441
|
},
|
|
1445
1442
|
"~run"(r, t) {
|
|
1446
|
-
return typeof r.value == "boolean" ? r.typed = !0 :
|
|
1443
|
+
return typeof r.value == "boolean" ? r.typed = !0 : Z(this, "type", r, t), r;
|
|
1447
1444
|
}
|
|
1448
1445
|
};
|
|
1449
1446
|
}
|
|
@@ -1457,25 +1454,25 @@ function Sr(e) {
|
|
|
1457
1454
|
async: !1,
|
|
1458
1455
|
message: e,
|
|
1459
1456
|
get "~standard"() {
|
|
1460
|
-
return /* @__PURE__ */
|
|
1457
|
+
return /* @__PURE__ */ he(this);
|
|
1461
1458
|
},
|
|
1462
1459
|
"~run"(r, t) {
|
|
1463
|
-
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 :
|
|
1460
|
+
return typeof r.value == "number" && !isNaN(r.value) ? r.typed = !0 : Z(this, "type", r, t), r;
|
|
1464
1461
|
}
|
|
1465
1462
|
};
|
|
1466
1463
|
}
|
|
1467
1464
|
// @__NO_SIDE_EFFECTS__
|
|
1468
|
-
function
|
|
1465
|
+
function be(e, r) {
|
|
1469
1466
|
return {
|
|
1470
1467
|
kind: "schema",
|
|
1471
1468
|
type: "object",
|
|
1472
|
-
reference:
|
|
1469
|
+
reference: be,
|
|
1473
1470
|
expects: "Object",
|
|
1474
1471
|
async: !1,
|
|
1475
1472
|
entries: e,
|
|
1476
1473
|
message: r,
|
|
1477
1474
|
get "~standard"() {
|
|
1478
|
-
return /* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ he(this);
|
|
1479
1476
|
},
|
|
1480
1477
|
"~run"(t, s) {
|
|
1481
1478
|
var a;
|
|
@@ -1489,8 +1486,8 @@ function ye(e, r) {
|
|
|
1489
1486
|
const d = n in i ? (
|
|
1490
1487
|
// @ts-expect-error
|
|
1491
1488
|
i[n]
|
|
1492
|
-
) : /* @__PURE__ */ _r(o),
|
|
1493
|
-
if (
|
|
1489
|
+
) : /* @__PURE__ */ _r(o), h = o["~run"]({ value: d }, s);
|
|
1490
|
+
if (h.issues) {
|
|
1494
1491
|
const v = {
|
|
1495
1492
|
type: "object",
|
|
1496
1493
|
origin: "value",
|
|
@@ -1498,17 +1495,17 @@ function ye(e, r) {
|
|
|
1498
1495
|
key: n,
|
|
1499
1496
|
value: d
|
|
1500
1497
|
};
|
|
1501
|
-
for (const x of
|
|
1498
|
+
for (const x of h.issues)
|
|
1502
1499
|
x.path ? x.path.unshift(v) : x.path = [v], (a = t.issues) == null || a.push(x);
|
|
1503
|
-
if (t.issues || (t.issues =
|
|
1500
|
+
if (t.issues || (t.issues = h.issues), s.abortEarly) {
|
|
1504
1501
|
t.typed = !1;
|
|
1505
1502
|
break;
|
|
1506
1503
|
}
|
|
1507
1504
|
}
|
|
1508
|
-
|
|
1505
|
+
h.typed || (t.typed = !1), t.value[n] = h.value;
|
|
1509
1506
|
} else if (o.fallback !== void 0)
|
|
1510
1507
|
t.value[n] = /* @__PURE__ */ Gs(o);
|
|
1511
|
-
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (
|
|
1508
|
+
else if (o.type !== "exact_optional" && o.type !== "optional" && o.type !== "nullish" && (Z(this, "key", t, s, {
|
|
1512
1509
|
input: void 0,
|
|
1513
1510
|
expected: `"${n}"`,
|
|
1514
1511
|
path: [
|
|
@@ -1525,7 +1522,7 @@ function ye(e, r) {
|
|
|
1525
1522
|
break;
|
|
1526
1523
|
}
|
|
1527
1524
|
} else
|
|
1528
|
-
|
|
1525
|
+
Z(this, "type", t, s);
|
|
1529
1526
|
return t;
|
|
1530
1527
|
}
|
|
1531
1528
|
};
|
|
@@ -1541,7 +1538,7 @@ function qe(e, r) {
|
|
|
1541
1538
|
wrapped: e,
|
|
1542
1539
|
default: r,
|
|
1543
1540
|
get "~standard"() {
|
|
1544
|
-
return /* @__PURE__ */
|
|
1541
|
+
return /* @__PURE__ */ he(this);
|
|
1545
1542
|
},
|
|
1546
1543
|
"~run"(t, s) {
|
|
1547
1544
|
return t.value === void 0 && (this.default !== void 0 && (t.value = /* @__PURE__ */ _r(this, t, s)), t.value === void 0) ? (t.typed = !0, t) : this.wrapped["~run"](t, s);
|
|
@@ -1554,31 +1551,31 @@ function Ir(e, r) {
|
|
|
1554
1551
|
kind: "schema",
|
|
1555
1552
|
type: "picklist",
|
|
1556
1553
|
reference: Ir,
|
|
1557
|
-
expects: /* @__PURE__ */ Us(e.map(
|
|
1554
|
+
expects: /* @__PURE__ */ Us(e.map(Le), "|"),
|
|
1558
1555
|
async: !1,
|
|
1559
1556
|
options: e,
|
|
1560
1557
|
message: r,
|
|
1561
1558
|
get "~standard"() {
|
|
1562
|
-
return /* @__PURE__ */
|
|
1559
|
+
return /* @__PURE__ */ he(this);
|
|
1563
1560
|
},
|
|
1564
1561
|
"~run"(t, s) {
|
|
1565
|
-
return this.options.includes(t.value) ? t.typed = !0 :
|
|
1562
|
+
return this.options.includes(t.value) ? t.typed = !0 : Z(this, "type", t, s), t;
|
|
1566
1563
|
}
|
|
1567
1564
|
};
|
|
1568
1565
|
}
|
|
1569
1566
|
// @__NO_SIDE_EFFECTS__
|
|
1570
|
-
function
|
|
1567
|
+
function Fr(e, r, t) {
|
|
1571
1568
|
return {
|
|
1572
1569
|
kind: "schema",
|
|
1573
1570
|
type: "record",
|
|
1574
|
-
reference:
|
|
1571
|
+
reference: Fr,
|
|
1575
1572
|
expects: "Object",
|
|
1576
1573
|
async: !1,
|
|
1577
1574
|
key: e,
|
|
1578
1575
|
value: r,
|
|
1579
1576
|
message: t,
|
|
1580
1577
|
get "~standard"() {
|
|
1581
|
-
return /* @__PURE__ */
|
|
1578
|
+
return /* @__PURE__ */ he(this);
|
|
1582
1579
|
},
|
|
1583
1580
|
"~run"(s, i) {
|
|
1584
1581
|
var n, o;
|
|
@@ -1587,36 +1584,36 @@ function Vr(e, r, t) {
|
|
|
1587
1584
|
s.typed = !0, s.value = {};
|
|
1588
1585
|
for (const d in a)
|
|
1589
1586
|
if (/* @__PURE__ */ qs(a, d)) {
|
|
1590
|
-
const
|
|
1587
|
+
const h = a[d], v = this.key["~run"]({ value: d }, i);
|
|
1591
1588
|
if (v.issues) {
|
|
1592
|
-
const
|
|
1589
|
+
const p = {
|
|
1593
1590
|
type: "object",
|
|
1594
1591
|
origin: "key",
|
|
1595
1592
|
input: a,
|
|
1596
1593
|
key: d,
|
|
1597
|
-
value:
|
|
1594
|
+
value: h
|
|
1598
1595
|
};
|
|
1599
1596
|
for (const m of v.issues)
|
|
1600
|
-
m.path = [
|
|
1597
|
+
m.path = [p], (n = s.issues) == null || n.push(m);
|
|
1601
1598
|
if (s.issues || (s.issues = v.issues), i.abortEarly) {
|
|
1602
1599
|
s.typed = !1;
|
|
1603
1600
|
break;
|
|
1604
1601
|
}
|
|
1605
1602
|
}
|
|
1606
1603
|
const x = this.value["~run"](
|
|
1607
|
-
{ value:
|
|
1604
|
+
{ value: h },
|
|
1608
1605
|
i
|
|
1609
1606
|
);
|
|
1610
1607
|
if (x.issues) {
|
|
1611
|
-
const
|
|
1608
|
+
const p = {
|
|
1612
1609
|
type: "object",
|
|
1613
1610
|
origin: "value",
|
|
1614
1611
|
input: a,
|
|
1615
1612
|
key: d,
|
|
1616
|
-
value:
|
|
1613
|
+
value: h
|
|
1617
1614
|
};
|
|
1618
1615
|
for (const m of x.issues)
|
|
1619
|
-
m.path ? m.path.unshift(
|
|
1616
|
+
m.path ? m.path.unshift(p) : m.path = [p], (o = s.issues) == null || o.push(m);
|
|
1620
1617
|
if (s.issues || (s.issues = x.issues), i.abortEarly) {
|
|
1621
1618
|
s.typed = !1;
|
|
1622
1619
|
break;
|
|
@@ -1625,25 +1622,25 @@ function Vr(e, r, t) {
|
|
|
1625
1622
|
(!v.typed || !x.typed) && (s.typed = !1), v.typed && (s.value[v.value] = x.value);
|
|
1626
1623
|
}
|
|
1627
1624
|
} else
|
|
1628
|
-
|
|
1625
|
+
Z(this, "type", s, i);
|
|
1629
1626
|
return s;
|
|
1630
1627
|
}
|
|
1631
1628
|
};
|
|
1632
1629
|
}
|
|
1633
1630
|
// @__NO_SIDE_EFFECTS__
|
|
1634
|
-
function
|
|
1631
|
+
function se(e) {
|
|
1635
1632
|
return {
|
|
1636
1633
|
kind: "schema",
|
|
1637
1634
|
type: "string",
|
|
1638
|
-
reference:
|
|
1635
|
+
reference: se,
|
|
1639
1636
|
expects: "string",
|
|
1640
1637
|
async: !1,
|
|
1641
1638
|
message: e,
|
|
1642
1639
|
get "~standard"() {
|
|
1643
|
-
return /* @__PURE__ */
|
|
1640
|
+
return /* @__PURE__ */ he(this);
|
|
1644
1641
|
},
|
|
1645
1642
|
"~run"(r, t) {
|
|
1646
|
-
return typeof r.value == "string" ? r.typed = !0 :
|
|
1643
|
+
return typeof r.value == "string" ? r.typed = !0 : Z(this, "type", r, t), r;
|
|
1647
1644
|
}
|
|
1648
1645
|
};
|
|
1649
1646
|
}
|
|
@@ -1662,17 +1659,17 @@ function Js(e, r) {
|
|
|
1662
1659
|
...e,
|
|
1663
1660
|
entries: t,
|
|
1664
1661
|
get "~standard"() {
|
|
1665
|
-
return /* @__PURE__ */
|
|
1662
|
+
return /* @__PURE__ */ he(this);
|
|
1666
1663
|
}
|
|
1667
1664
|
};
|
|
1668
1665
|
}
|
|
1669
1666
|
// @__NO_SIDE_EFFECTS__
|
|
1670
|
-
function
|
|
1667
|
+
function _e(...e) {
|
|
1671
1668
|
return {
|
|
1672
1669
|
...e[0],
|
|
1673
1670
|
pipe: e,
|
|
1674
1671
|
get "~standard"() {
|
|
1675
|
-
return /* @__PURE__ */
|
|
1672
|
+
return /* @__PURE__ */ he(this);
|
|
1676
1673
|
},
|
|
1677
1674
|
"~run"(r, t) {
|
|
1678
1675
|
for (const s of e)
|
|
@@ -1710,7 +1707,7 @@ async function Xs(e, r, t) {
|
|
|
1710
1707
|
issues: s.issues
|
|
1711
1708
|
};
|
|
1712
1709
|
}
|
|
1713
|
-
const
|
|
1710
|
+
const Oe = ({
|
|
1714
1711
|
error: e
|
|
1715
1712
|
}) => !e || !e.message ? null : u("div", {
|
|
1716
1713
|
role: "alert",
|
|
@@ -1743,16 +1740,16 @@ const Le = ({
|
|
|
1743
1740
|
class: "break-words pr-1 text-sm",
|
|
1744
1741
|
children: e.message
|
|
1745
1742
|
})]
|
|
1746
|
-
}),
|
|
1743
|
+
}), Ae = ({
|
|
1747
1744
|
class: e,
|
|
1748
1745
|
...r
|
|
1749
1746
|
}) => {
|
|
1750
1747
|
const {
|
|
1751
1748
|
t
|
|
1752
|
-
} =
|
|
1749
|
+
} = ne();
|
|
1753
1750
|
return u("button", {
|
|
1754
1751
|
type: "button",
|
|
1755
|
-
class:
|
|
1752
|
+
class: Te("fr touch-hitbox text-neutral-10 bg-neutral-1 ring-divider hover:ring-divider active:ring-interactive-bg-hover hover:text-neutral-12 active:text-neutral-12 hover:bg-divider active:bg-interactive-bg-hover flex flex-shrink-0 items-center justify-center gap-1 self-center rounded-full py-1 pl-2 pr-2.5 text-sm ring-1 transition-all", e),
|
|
1756
1753
|
...r,
|
|
1757
1754
|
children: [u("svg", {
|
|
1758
1755
|
"aria-hidden": !0,
|
|
@@ -1785,39 +1782,39 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1785
1782
|
defaultVariants: {
|
|
1786
1783
|
optional: !1
|
|
1787
1784
|
}
|
|
1788
|
-
}), Ys = "https://api.mapbox.com/search/searchbox/v1/suggest", Qs = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", en = (e) => atob(e).split("").reverse().join(""),
|
|
1789
|
-
name: /* @__PURE__ */
|
|
1790
|
-
}), tn = /* @__PURE__ */
|
|
1791
|
-
suggestions: /* @__PURE__ */ kr(/* @__PURE__ */
|
|
1792
|
-
full_address: /* @__PURE__ */ qe(/* @__PURE__ */
|
|
1793
|
-
place_formatted: /* @__PURE__ */ qe(/* @__PURE__ */
|
|
1794
|
-
name: /* @__PURE__ */ qe(/* @__PURE__ */
|
|
1795
|
-
mapbox_id: /* @__PURE__ */
|
|
1796
|
-
context: /* @__PURE__ */ Js(/* @__PURE__ */
|
|
1797
|
-
address:
|
|
1798
|
-
street:
|
|
1799
|
-
neighborhood:
|
|
1800
|
-
locality:
|
|
1801
|
-
district:
|
|
1802
|
-
place:
|
|
1803
|
-
region:
|
|
1804
|
-
postcode:
|
|
1805
|
-
country:
|
|
1785
|
+
}), Ys = "https://api.mapbox.com/search/searchbox/v1/suggest", Qs = "ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==", en = (e) => atob(e).split("").reverse().join(""), me = /* @__PURE__ */ be({
|
|
1786
|
+
name: /* @__PURE__ */ se()
|
|
1787
|
+
}), tn = /* @__PURE__ */ be({
|
|
1788
|
+
suggestions: /* @__PURE__ */ kr(/* @__PURE__ */ be({
|
|
1789
|
+
full_address: /* @__PURE__ */ qe(/* @__PURE__ */ se()),
|
|
1790
|
+
place_formatted: /* @__PURE__ */ qe(/* @__PURE__ */ se()),
|
|
1791
|
+
name: /* @__PURE__ */ qe(/* @__PURE__ */ se()),
|
|
1792
|
+
mapbox_id: /* @__PURE__ */ se(),
|
|
1793
|
+
context: /* @__PURE__ */ Js(/* @__PURE__ */ be({
|
|
1794
|
+
address: me,
|
|
1795
|
+
street: me,
|
|
1796
|
+
neighborhood: me,
|
|
1797
|
+
locality: me,
|
|
1798
|
+
district: me,
|
|
1799
|
+
place: me,
|
|
1800
|
+
region: me,
|
|
1801
|
+
postcode: me,
|
|
1802
|
+
country: me
|
|
1806
1803
|
}))
|
|
1807
1804
|
}))
|
|
1808
1805
|
}), rn = ({
|
|
1809
1806
|
logger: e,
|
|
1810
1807
|
t: r
|
|
1811
|
-
}) =>
|
|
1808
|
+
}) => ns(() => {
|
|
1812
1809
|
var s;
|
|
1813
|
-
const t = (s =
|
|
1810
|
+
const t = (s = $.current$.peek().flow) == null ? void 0 : s.data.flowSessionId;
|
|
1814
1811
|
return t ? {
|
|
1815
1812
|
enabled: !0,
|
|
1816
1813
|
getPredictions: async (i) => {
|
|
1817
1814
|
var x;
|
|
1818
1815
|
const a = new URL(Ys);
|
|
1819
1816
|
a.searchParams.set("q", i), a.searchParams.set("session_token", t);
|
|
1820
|
-
const n = (x =
|
|
1817
|
+
const n = (x = $.current$.peek().flow) == null ? void 0 : x.locationOrigin;
|
|
1821
1818
|
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", en(Qs));
|
|
1822
1819
|
const d = await fetch(a);
|
|
1823
1820
|
if (!d.ok)
|
|
@@ -1825,30 +1822,30 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1825
1822
|
ok: !1,
|
|
1826
1823
|
error: r("address_error")
|
|
1827
1824
|
};
|
|
1828
|
-
const
|
|
1829
|
-
if (
|
|
1830
|
-
return e.error("Failed to parse address details",
|
|
1825
|
+
const h = /* @__PURE__ */ Zs(tn, await d.json());
|
|
1826
|
+
if (h.success === !1)
|
|
1827
|
+
return e.error("Failed to parse address details", h.issues), {
|
|
1831
1828
|
ok: !1,
|
|
1832
1829
|
error: r("address_error")
|
|
1833
1830
|
};
|
|
1834
1831
|
const {
|
|
1835
1832
|
suggestions: v
|
|
1836
|
-
} =
|
|
1833
|
+
} = h.output;
|
|
1837
1834
|
return {
|
|
1838
1835
|
ok: !0,
|
|
1839
|
-
data: v.map((
|
|
1840
|
-
var m, k,
|
|
1836
|
+
data: v.map((p) => {
|
|
1837
|
+
var m, k, I, V, N, y, C, E, A;
|
|
1841
1838
|
return {
|
|
1842
|
-
label:
|
|
1843
|
-
id:
|
|
1839
|
+
label: p.full_address ?? p.place_formatted ?? p.name ?? p.mapbox_id,
|
|
1840
|
+
id: p.mapbox_id,
|
|
1844
1841
|
address: {
|
|
1845
|
-
line1: ((m =
|
|
1842
|
+
line1: ((m = p.context.address) == null ? void 0 : m.name) ?? ((k = p.context.street) == null ? void 0 : k.name),
|
|
1846
1843
|
line2: void 0,
|
|
1847
|
-
line3: ((
|
|
1848
|
-
city: ((N =
|
|
1849
|
-
state: (C =
|
|
1850
|
-
postcode: (
|
|
1851
|
-
country: (
|
|
1844
|
+
line3: ((I = p.context.neighborhood) == null ? void 0 : I.name) ?? ((V = p.context.locality) == null ? void 0 : V.name),
|
|
1845
|
+
city: ((N = p.context.place) == null ? void 0 : N.name) ?? ((y = p.context.district) == null ? void 0 : y.name),
|
|
1846
|
+
state: (C = p.context.region) == null ? void 0 : C.name,
|
|
1847
|
+
postcode: (E = p.context.postcode) == null ? void 0 : E.name,
|
|
1848
|
+
country: (A = p.context.country) == null ? void 0 : A.name
|
|
1852
1849
|
}
|
|
1853
1850
|
};
|
|
1854
1851
|
})
|
|
@@ -1860,7 +1857,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1860
1857
|
}, [e, r]), Bt = (e) => {
|
|
1861
1858
|
const {
|
|
1862
1859
|
t: r
|
|
1863
|
-
} =
|
|
1860
|
+
} = ne();
|
|
1864
1861
|
return u("button", {
|
|
1865
1862
|
type: "button",
|
|
1866
1863
|
class: "touch-hitbox text-neutral-10 hover:bg-neutral-4 hover:text-neutral-12 hover:border-neutral-5 relative flex items-center gap-1 rounded-[18px] border border-solid border-transparent px-3 py-1 pl-1.5 text-sm transition-colors",
|
|
@@ -1887,15 +1884,15 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1887
1884
|
}) => {
|
|
1888
1885
|
const {
|
|
1889
1886
|
t: s
|
|
1890
|
-
} =
|
|
1887
|
+
} = ne(), [i, a] = Se(), {
|
|
1891
1888
|
enabled: n,
|
|
1892
1889
|
getPredictions: o
|
|
1893
1890
|
} = rn({
|
|
1894
1891
|
logger: t,
|
|
1895
1892
|
t: s
|
|
1896
|
-
}), [d,
|
|
1897
|
-
var
|
|
1898
|
-
if (
|
|
1893
|
+
}), [d, h] = Se(n ? "query" : "manual"), [v, x] = Se(""), [p, m] = Se(), k = fe(), I = fe(), V = (y) => {
|
|
1894
|
+
var E;
|
|
1895
|
+
if (Fe(n, "Query state should not be enabled"), y = y.trim(), y === ((E = k.current) == null ? void 0 : E.query) || y === (p == null ? void 0 : p.query) && p.status === "done")
|
|
1899
1896
|
return;
|
|
1900
1897
|
if (x(y), y === "") {
|
|
1901
1898
|
k.current = void 0, m(void 0);
|
|
@@ -1907,48 +1904,48 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1907
1904
|
m({
|
|
1908
1905
|
query: y,
|
|
1909
1906
|
status: "pending"
|
|
1910
|
-
}), o(y).then((
|
|
1911
|
-
k.current === C && (k.current = void 0, m(
|
|
1907
|
+
}), o(y).then((A) => {
|
|
1908
|
+
k.current === C && (k.current = void 0, m(A.ok ? {
|
|
1912
1909
|
query: y,
|
|
1913
1910
|
status: "done",
|
|
1914
|
-
items:
|
|
1911
|
+
items: A.data
|
|
1915
1912
|
} : {
|
|
1916
1913
|
query: y,
|
|
1917
1914
|
status: "failed",
|
|
1918
|
-
error:
|
|
1915
|
+
error: A.error
|
|
1919
1916
|
}));
|
|
1920
|
-
}, (
|
|
1921
|
-
k.current === C && (k.current = void 0, t.error("Failed to get address details",
|
|
1917
|
+
}, (A) => {
|
|
1918
|
+
k.current === C && (k.current = void 0, t.error("Failed to get address details", A), m({
|
|
1922
1919
|
query: y,
|
|
1923
1920
|
status: "failed",
|
|
1924
1921
|
error: s("address_error")
|
|
1925
1922
|
}));
|
|
1926
1923
|
});
|
|
1927
1924
|
}, N = (y, C) => {
|
|
1928
|
-
a((
|
|
1929
|
-
...
|
|
1925
|
+
a((E) => ({
|
|
1926
|
+
...E,
|
|
1930
1927
|
[y]: C
|
|
1931
1928
|
}));
|
|
1932
1929
|
};
|
|
1933
1930
|
switch (d) {
|
|
1934
1931
|
case "query":
|
|
1935
|
-
return
|
|
1932
|
+
return Fe(n, "Query state should not be enabled"), u(nn, {
|
|
1936
1933
|
input: e,
|
|
1937
1934
|
onSkip: () => r(null),
|
|
1938
1935
|
onAddressSelect: (y) => {
|
|
1939
1936
|
if (y === "") {
|
|
1940
|
-
k.current && (k.current = void 0, m(void 0)),
|
|
1937
|
+
k.current && (k.current = void 0, m(void 0)), h("manual");
|
|
1941
1938
|
return;
|
|
1942
1939
|
}
|
|
1943
|
-
const C = (
|
|
1944
|
-
C && (
|
|
1940
|
+
const C = (p == null ? void 0 : p.status) === "done" ? p.items.find((E) => E.id === y) : void 0;
|
|
1941
|
+
C && (I.current !== y && a(C.address), I.current = y, h("details"));
|
|
1945
1942
|
},
|
|
1946
|
-
onAddressSearch:
|
|
1947
|
-
lookup:
|
|
1943
|
+
onAddressSearch: V,
|
|
1944
|
+
lookup: p,
|
|
1948
1945
|
query: v
|
|
1949
1946
|
});
|
|
1950
1947
|
case "details":
|
|
1951
|
-
return
|
|
1948
|
+
return Fe(i !== void 0), u(jt, {
|
|
1952
1949
|
input: e,
|
|
1953
1950
|
logger: t,
|
|
1954
1951
|
onSubmitSuccess: r,
|
|
@@ -1956,12 +1953,12 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1956
1953
|
onFieldChange: N,
|
|
1957
1954
|
actions: u(Bt, {
|
|
1958
1955
|
onClick: () => {
|
|
1959
|
-
|
|
1956
|
+
h("query");
|
|
1960
1957
|
}
|
|
1961
1958
|
})
|
|
1962
1959
|
});
|
|
1963
1960
|
case "manual":
|
|
1964
|
-
return u(
|
|
1961
|
+
return u(jt, {
|
|
1965
1962
|
logger: t,
|
|
1966
1963
|
input: e,
|
|
1967
1964
|
onSubmitSuccess: r,
|
|
@@ -1969,7 +1966,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1969
1966
|
onFieldChange: N,
|
|
1970
1967
|
actions: n ? u(Bt, {
|
|
1971
1968
|
onClick: () => {
|
|
1972
|
-
|
|
1969
|
+
h("query");
|
|
1973
1970
|
}
|
|
1974
1971
|
}) : void 0
|
|
1975
1972
|
});
|
|
@@ -1984,10 +1981,10 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
1984
1981
|
}) => {
|
|
1985
1982
|
const {
|
|
1986
1983
|
t: n
|
|
1987
|
-
} =
|
|
1988
|
-
return
|
|
1984
|
+
} = ne(), o = fe(null);
|
|
1985
|
+
return ke(() => {
|
|
1989
1986
|
o.current && (o.current.focus(), o.current.select());
|
|
1990
|
-
}, []), u(
|
|
1987
|
+
}, []), u(ve, {
|
|
1991
1988
|
children: [u("form", {
|
|
1992
1989
|
noValidate: !0,
|
|
1993
1990
|
onSubmit: (d) => {
|
|
@@ -2039,19 +2036,19 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2039
2036
|
children: n("search")
|
|
2040
2037
|
})]
|
|
2041
2038
|
})]
|
|
2042
|
-
}), e.config.optional && u(
|
|
2039
|
+
}), e.config.optional && u(Ae, {
|
|
2043
2040
|
class: "relative",
|
|
2044
2041
|
onClick: r
|
|
2045
2042
|
})]
|
|
2046
|
-
}), (t == null ? void 0 : t.status) === "failed" ? u(
|
|
2043
|
+
}), (t == null ? void 0 : t.status) === "failed" ? u(Oe, {
|
|
2047
2044
|
error: {
|
|
2048
2045
|
message: t.error
|
|
2049
2046
|
}
|
|
2050
2047
|
}) : null, u("p", {
|
|
2051
2048
|
role: "status",
|
|
2052
2049
|
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",
|
|
2053
|
-
children: (t == null ? void 0 : t.status) === "pending" ? u(
|
|
2054
|
-
children: [u(
|
|
2050
|
+
children: (t == null ? void 0 : t.status) === "pending" ? u(ve, {
|
|
2051
|
+
children: [u(ht, {
|
|
2055
2052
|
"aria-hidden": "true",
|
|
2056
2053
|
class: "h-4 w-4 shrink-0"
|
|
2057
2054
|
}), n("address_searching")]
|
|
@@ -2094,15 +2091,15 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2094
2091
|
}, "")]
|
|
2095
2092
|
})]
|
|
2096
2093
|
});
|
|
2097
|
-
},
|
|
2094
|
+
}, Pt = ["line1", "line2", "line3", "city", "state", "postcode", "country"], jt = ({
|
|
2098
2095
|
addressFields: e,
|
|
2099
2096
|
onFieldChange: r,
|
|
2100
2097
|
onSubmitSuccess: t,
|
|
2101
2098
|
actions: s,
|
|
2102
2099
|
input: i
|
|
2103
2100
|
}) => {
|
|
2104
|
-
const a =
|
|
2105
|
-
|
|
2101
|
+
const a = fe(null);
|
|
2102
|
+
ke(() => {
|
|
2106
2103
|
if (a.current) {
|
|
2107
2104
|
const d = a.current.querySelector("input");
|
|
2108
2105
|
d && (d.focus(), d.select());
|
|
@@ -2110,11 +2107,11 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2110
2107
|
}, []);
|
|
2111
2108
|
const n = Object.keys(gt), {
|
|
2112
2109
|
t: o
|
|
2113
|
-
} =
|
|
2110
|
+
} = ne();
|
|
2114
2111
|
return u("form", {
|
|
2115
2112
|
class: "flex flex-col px-2 pt-2",
|
|
2116
2113
|
onSubmit: (d) => {
|
|
2117
|
-
const
|
|
2114
|
+
const h = new FormData(d.currentTarget), v = Object.fromEntries(h.entries());
|
|
2118
2115
|
t({
|
|
2119
2116
|
type: "address",
|
|
2120
2117
|
value: v
|
|
@@ -2123,9 +2120,9 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2123
2120
|
children: [u("div", {
|
|
2124
2121
|
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]",
|
|
2125
2122
|
ref: a,
|
|
2126
|
-
children:
|
|
2123
|
+
children: Pt.map((d, h) => {
|
|
2127
2124
|
const v = `isdk_${d}`, x = i.config.keys[d];
|
|
2128
|
-
return x ? u(
|
|
2125
|
+
return x ? u(ve, {
|
|
2129
2126
|
children: [u("label", {
|
|
2130
2127
|
for: v,
|
|
2131
2128
|
class: "text-neutral-9 [&:has(+*>input:focus)]:text-neutral-11 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",
|
|
@@ -2139,7 +2136,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2139
2136
|
name: x,
|
|
2140
2137
|
id: v,
|
|
2141
2138
|
defaultValue: e[d],
|
|
2142
|
-
onChange: (
|
|
2139
|
+
onChange: (p) => r(d, p.currentTarget.value),
|
|
2143
2140
|
required: !0,
|
|
2144
2141
|
children: [e.country && !n.includes(e.country) ? u("option", {
|
|
2145
2142
|
value: e[d],
|
|
@@ -2147,10 +2144,10 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2147
2144
|
}) : u("option", {
|
|
2148
2145
|
value: "",
|
|
2149
2146
|
children: o("select_country")
|
|
2150
|
-
}), n.map((
|
|
2151
|
-
value:
|
|
2152
|
-
children:
|
|
2153
|
-
},
|
|
2147
|
+
}), n.map((p) => u("option", {
|
|
2148
|
+
value: p,
|
|
2149
|
+
children: p
|
|
2150
|
+
}, p))]
|
|
2154
2151
|
}), u("svg", {
|
|
2155
2152
|
class: "text-neutral-12 absolute bottom-2.5 right-2 flex items-center justify-center",
|
|
2156
2153
|
width: "16",
|
|
@@ -2167,14 +2164,14 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2167
2164
|
})
|
|
2168
2165
|
})]
|
|
2169
2166
|
}) : u("input", {
|
|
2170
|
-
autoFocus:
|
|
2167
|
+
autoFocus: h === 0 ? !0 : void 0,
|
|
2171
2168
|
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",
|
|
2172
2169
|
name: x,
|
|
2173
2170
|
id: v,
|
|
2174
2171
|
defaultValue: e[d],
|
|
2175
|
-
onInput: (
|
|
2172
|
+
onInput: (p) => r(d, p.currentTarget.value),
|
|
2176
2173
|
required: !0
|
|
2177
|
-
}),
|
|
2174
|
+
}), h === Pt.length - 1 ? u("hr", {
|
|
2178
2175
|
class: "m-0 w-full border-b border-b-transparent"
|
|
2179
2176
|
}) : u("hr", {
|
|
2180
2177
|
class: "border-b-neutral-5 m-0 w-full border-b border-solid"
|
|
@@ -2184,18 +2181,18 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2184
2181
|
})
|
|
2185
2182
|
}), u("div", {
|
|
2186
2183
|
class: "bg-neutral-1 sticky bottom-0 flex items-center py-2",
|
|
2187
|
-
children: [s, u(
|
|
2184
|
+
children: [s, u(Ve, {
|
|
2188
2185
|
class: "ml-auto"
|
|
2189
2186
|
})]
|
|
2190
2187
|
})]
|
|
2191
2188
|
});
|
|
2192
2189
|
}, bt = () => {
|
|
2193
|
-
const e =
|
|
2194
|
-
return
|
|
2190
|
+
const e = fe(null);
|
|
2191
|
+
return is(() => {
|
|
2195
2192
|
var r;
|
|
2196
2193
|
(r = e.current) == null || r.focus();
|
|
2197
2194
|
}, []), e;
|
|
2198
|
-
},
|
|
2195
|
+
}, Vr = ["true", "false"], an = /* @__PURE__ */ Ir(Vr), on = "answer", Ar = "flex items-center flex-wrap gap-2 p-2.5", Er = "min-w-0 max-w-full flex-auto", Mr = pr(({
|
|
2199
2196
|
label: e,
|
|
2200
2197
|
...r
|
|
2201
2198
|
}, t) => u("button", {
|
|
@@ -2216,7 +2213,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2216
2213
|
class: "",
|
|
2217
2214
|
onSubmit: (s) => {
|
|
2218
2215
|
s.preventDefault();
|
|
2219
|
-
const i =
|
|
2216
|
+
const i = as(s).value, a = Hs(an, i);
|
|
2220
2217
|
r({
|
|
2221
2218
|
type: "boolean",
|
|
2222
2219
|
value: a === "true"
|
|
@@ -2224,7 +2221,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2224
2221
|
},
|
|
2225
2222
|
children: [u("ul", {
|
|
2226
2223
|
class: Ar,
|
|
2227
|
-
children:
|
|
2224
|
+
children: Vr.map((s, i) => u("li", {
|
|
2228
2225
|
class: Er,
|
|
2229
2226
|
children: u(Mr, {
|
|
2230
2227
|
ref: i === 0 ? t : null,
|
|
@@ -2236,7 +2233,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2236
2233
|
}))
|
|
2237
2234
|
}), e.config.optional && u("div", {
|
|
2238
2235
|
class: "px-2 pb-2",
|
|
2239
|
-
children: u(
|
|
2236
|
+
children: u(Ae, {
|
|
2240
2237
|
class: "relative w-full",
|
|
2241
2238
|
type: "button",
|
|
2242
2239
|
onClick: () => r(null)
|
|
@@ -2250,7 +2247,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2250
2247
|
return t(new Error("Invalid file"));
|
|
2251
2248
|
r(s.result);
|
|
2252
2249
|
}, s.onerror = t, s.readAsDataURL(e);
|
|
2253
|
-
}), $t = (e) => e.reduce((r, t) => r + t.sizeKb, 0), cn =
|
|
2250
|
+
}), $t = (e) => e.reduce((r, t) => r + t.sizeKb, 0), cn = De("file"), qt = 3, vt = (e) => {
|
|
2254
2251
|
const r = e.lastIndexOf(".");
|
|
2255
2252
|
return r === -1 ? [e, ""] : [e.slice(0, r), e.slice(r)];
|
|
2256
2253
|
}, dn = ({
|
|
@@ -2260,7 +2257,7 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2260
2257
|
}) => {
|
|
2261
2258
|
const [s, i] = vt(e.name);
|
|
2262
2259
|
return u("div", {
|
|
2263
|
-
class:
|
|
2260
|
+
class: Te("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline", r),
|
|
2264
2261
|
...t,
|
|
2265
2262
|
children: [u("p", {
|
|
2266
2263
|
"aria-label": "File name",
|
|
@@ -2274,14 +2271,14 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2274
2271
|
}), u("p", {
|
|
2275
2272
|
"aria-label": "File size",
|
|
2276
2273
|
class: "text-accent-11",
|
|
2277
|
-
children:
|
|
2274
|
+
children: je(e.sizeKb)
|
|
2278
2275
|
})]
|
|
2279
2276
|
});
|
|
2280
2277
|
}, Ut = ({
|
|
2281
2278
|
class: e,
|
|
2282
2279
|
...r
|
|
2283
2280
|
}) => u("li", {
|
|
2284
|
-
class:
|
|
2281
|
+
class: Te("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1", e),
|
|
2285
2282
|
...r
|
|
2286
2283
|
}), fn = (e, r) => {
|
|
2287
2284
|
const [t, s] = vt(e);
|
|
@@ -2289,55 +2286,55 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2289
2286
|
}, zt = (e) => ({
|
|
2290
2287
|
name: fn(e.name, 42),
|
|
2291
2288
|
sizeKb: e.size / 1e3
|
|
2292
|
-
}),
|
|
2289
|
+
}), pn = ({
|
|
2293
2290
|
input: e,
|
|
2294
2291
|
onSubmitSuccess: r
|
|
2295
2292
|
}) => {
|
|
2296
2293
|
var k;
|
|
2297
|
-
const t = (k =
|
|
2294
|
+
const t = (k = $.current$.value.flow) == null ? void 0 : k.data.submissions[e.key], [s, i] = Se(cn(t) && t.value.length ? {
|
|
2298
2295
|
status: "ready",
|
|
2299
2296
|
files: t.value
|
|
2300
2297
|
} : {
|
|
2301
2298
|
status: "empty"
|
|
2302
|
-
}), a =
|
|
2303
|
-
t:
|
|
2304
|
-
} =
|
|
2305
|
-
if (!
|
|
2299
|
+
}), a = fe(0), n = s.status === "ready" ? s.files : [], o = s.status === "ready" || s.status === "pending" ? s.files : [], d = s.status === "error" ? s.error : void 0, h = o.length - qt, v = $t(o), x = bt(), {
|
|
2300
|
+
t: p
|
|
2301
|
+
} = ne(), m = (I) => {
|
|
2302
|
+
if (!I.length)
|
|
2306
2303
|
return {
|
|
2307
2304
|
type: "required",
|
|
2308
|
-
message:
|
|
2305
|
+
message: p("validation_file")
|
|
2309
2306
|
};
|
|
2310
|
-
if (!
|
|
2307
|
+
if (!os(I, e.config.extensions))
|
|
2311
2308
|
return {
|
|
2312
2309
|
type: "validate",
|
|
2313
|
-
message:
|
|
2310
|
+
message: p("validation_file_ext", {
|
|
2314
2311
|
ext: e.config.extensions.join(", ")
|
|
2315
2312
|
})
|
|
2316
2313
|
};
|
|
2317
|
-
if (e.config.fileSizeLimitKib && $t(
|
|
2314
|
+
if (e.config.fileSizeLimitKib && $t(I) > e.config.fileSizeLimitKib)
|
|
2318
2315
|
return {
|
|
2319
2316
|
type: "max",
|
|
2320
|
-
message:
|
|
2321
|
-
size:
|
|
2317
|
+
message: p("validation_file_size", {
|
|
2318
|
+
size: je(e.config.fileSizeLimitKib)
|
|
2322
2319
|
})
|
|
2323
2320
|
};
|
|
2324
|
-
if (!e.config.allowMultiple &&
|
|
2321
|
+
if (!e.config.allowMultiple && I.length > 1)
|
|
2325
2322
|
return {
|
|
2326
2323
|
type: "invalid",
|
|
2327
|
-
message:
|
|
2324
|
+
message: p("validation_file_max", {
|
|
2328
2325
|
count: 1
|
|
2329
2326
|
})
|
|
2330
2327
|
};
|
|
2331
2328
|
};
|
|
2332
2329
|
return u("form", {
|
|
2333
2330
|
class: "flex flex-col gap-1 p-2.5",
|
|
2334
|
-
onSubmit: (
|
|
2335
|
-
if (
|
|
2331
|
+
onSubmit: (I) => {
|
|
2332
|
+
if (I.preventDefault(), s.status === "pending" || s.status === "error")
|
|
2336
2333
|
return;
|
|
2337
|
-
const
|
|
2338
|
-
|
|
2334
|
+
const V = m(n);
|
|
2335
|
+
V ? i({
|
|
2339
2336
|
status: "error",
|
|
2340
|
-
error:
|
|
2337
|
+
error: V
|
|
2341
2338
|
}) : r({
|
|
2342
2339
|
type: "file",
|
|
2343
2340
|
value: n
|
|
@@ -2351,19 +2348,19 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2351
2348
|
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",
|
|
2352
2349
|
children: [o.length > 0 ? u("ul", {
|
|
2353
2350
|
class: "flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",
|
|
2354
|
-
children: [o.slice(0, qt).map((
|
|
2355
|
-
const [
|
|
2351
|
+
children: [o.slice(0, qt).map((I) => {
|
|
2352
|
+
const [V, N] = vt(I.name);
|
|
2356
2353
|
return u(Ut, {
|
|
2357
2354
|
class: "flex overflow-hidden",
|
|
2358
2355
|
children: [u("span", {
|
|
2359
2356
|
class: "block truncate",
|
|
2360
|
-
children:
|
|
2357
|
+
children: V
|
|
2361
2358
|
}), u("span", {
|
|
2362
2359
|
children: N
|
|
2363
2360
|
})]
|
|
2364
2361
|
});
|
|
2365
|
-
}),
|
|
2366
|
-
children: ["+",
|
|
2362
|
+
}), h > 0 ? u(Ut, {
|
|
2363
|
+
children: ["+", h, " file", h !== 1 ? "s" : ""]
|
|
2367
2364
|
}) : null]
|
|
2368
2365
|
}) : u("div", {
|
|
2369
2366
|
class: "flex flex-col justify-center gap-4 pb-6 pt-5",
|
|
@@ -2384,13 +2381,13 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2384
2381
|
})
|
|
2385
2382
|
}), u("p", {
|
|
2386
2383
|
class: "text-neutral-12 tracking-[-0.01em]",
|
|
2387
|
-
children:
|
|
2384
|
+
children: p("upload_file", {
|
|
2388
2385
|
count: e.config.allowMultiple ? 2 : 1
|
|
2389
2386
|
})
|
|
2390
2387
|
}), e.config.fileSizeLimitKib ? u("p", {
|
|
2391
2388
|
class: "text-neutral-10 text-xs",
|
|
2392
|
-
children: ["(",
|
|
2393
|
-
size:
|
|
2389
|
+
children: ["(", p("file_max_size", {
|
|
2390
|
+
size: je(e.config.fileSizeLimitKib)
|
|
2394
2391
|
}), ")"]
|
|
2395
2392
|
}) : null]
|
|
2396
2393
|
}), u("aside", {
|
|
@@ -2398,66 +2395,66 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2398
2395
|
children: [u("p", {
|
|
2399
2396
|
id: "accepted-filetypes",
|
|
2400
2397
|
class: "sr-only",
|
|
2401
|
-
children:
|
|
2398
|
+
children: p("file_extensions")
|
|
2402
2399
|
}), u("ul", {
|
|
2403
2400
|
"aria-describedby": "accepted-filetypes",
|
|
2404
2401
|
class: "flex flex-wrap justify-center gap-2",
|
|
2405
|
-
children: e.config.extensions.map((
|
|
2402
|
+
children: e.config.extensions.map((I) => u("li", {
|
|
2406
2403
|
class: "ring-lowest outline-neutral-6 text-neutral-9 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",
|
|
2407
|
-
children:
|
|
2404
|
+
children: I.replace(".", "")
|
|
2408
2405
|
}))
|
|
2409
2406
|
})]
|
|
2410
2407
|
})]
|
|
2411
2408
|
}), u("p", {
|
|
2412
2409
|
role: "status",
|
|
2413
|
-
class:
|
|
2414
|
-
children: s.status === "pending" ? u(
|
|
2415
|
-
children: [u(
|
|
2410
|
+
class: Te("text-neutral-11 flex items-center gap-1.5 text-xs", o.length === 0 && "sr-only"),
|
|
2411
|
+
children: s.status === "pending" ? u(ve, {
|
|
2412
|
+
children: [u(ht, {
|
|
2416
2413
|
"aria-hidden": "true",
|
|
2417
2414
|
class: "h-4 w-4"
|
|
2418
|
-
}),
|
|
2415
|
+
}), p("file_preparing", {
|
|
2419
2416
|
count: o.length
|
|
2420
2417
|
})]
|
|
2421
|
-
}) : s.status === "ready" ? u(
|
|
2422
|
-
children: [
|
|
2418
|
+
}) : s.status === "ready" ? u(ve, {
|
|
2419
|
+
children: [je(v), " ", n.length > 1 ? "total" : "", u("span", {
|
|
2423
2420
|
class: "sr-only",
|
|
2424
|
-
children: [". ",
|
|
2421
|
+
children: [". ", p("file_ready", {
|
|
2425
2422
|
count: n.length
|
|
2426
2423
|
})]
|
|
2427
2424
|
})]
|
|
2428
2425
|
}) : null
|
|
2429
2426
|
}), u("input", {
|
|
2430
2427
|
id: "dropzone-file",
|
|
2431
|
-
onInput: async (
|
|
2432
|
-
|
|
2433
|
-
const
|
|
2434
|
-
if (
|
|
2428
|
+
onInput: async (I) => {
|
|
2429
|
+
Fe(I.target instanceof HTMLInputElement);
|
|
2430
|
+
const V = I.target.files ? Array.from(I.target.files) : [];
|
|
2431
|
+
if (I.target.value = "", !V.length)
|
|
2435
2432
|
return;
|
|
2436
|
-
const N = ++a.current, y = s.status === "ready", C =
|
|
2437
|
-
if (
|
|
2433
|
+
const N = ++a.current, y = s.status === "ready", C = V.map(zt), E = m(C);
|
|
2434
|
+
if (E)
|
|
2438
2435
|
return i({
|
|
2439
2436
|
status: "error",
|
|
2440
|
-
error:
|
|
2437
|
+
error: E
|
|
2441
2438
|
});
|
|
2442
2439
|
i({
|
|
2443
2440
|
status: "pending",
|
|
2444
2441
|
files: C
|
|
2445
2442
|
});
|
|
2446
2443
|
try {
|
|
2447
|
-
const
|
|
2448
|
-
...zt(
|
|
2449
|
-
data: await un(
|
|
2444
|
+
const A = await Promise.all(V.map(async (B) => ({
|
|
2445
|
+
...zt(B),
|
|
2446
|
+
data: await un(B)
|
|
2450
2447
|
})));
|
|
2451
2448
|
a.current === N && i({
|
|
2452
2449
|
status: "ready",
|
|
2453
|
-
files:
|
|
2450
|
+
files: A
|
|
2454
2451
|
});
|
|
2455
2452
|
} catch {
|
|
2456
2453
|
a.current === N && i({
|
|
2457
2454
|
status: "error",
|
|
2458
2455
|
error: {
|
|
2459
2456
|
type: "invalid",
|
|
2460
|
-
message:
|
|
2457
|
+
message: p(y ? "file_read_error_replacement" : "file_read_error")
|
|
2461
2458
|
}
|
|
2462
2459
|
});
|
|
2463
2460
|
}
|
|
@@ -2468,25 +2465,25 @@ const Ke = Ze("outline-divider ease-expo-out placeholder:text-neutral-10 text-ne
|
|
|
2468
2465
|
})]
|
|
2469
2466
|
}), u("div", {
|
|
2470
2467
|
class: "flex h-full flex-col items-center gap-2",
|
|
2471
|
-
children: [u(
|
|
2468
|
+
children: [u(Ve, {
|
|
2472
2469
|
disabled: n.length === 0
|
|
2473
|
-
}), e.config.optional && u(
|
|
2470
|
+
}), e.config.optional && u(Ae, {
|
|
2474
2471
|
class: "relative",
|
|
2475
2472
|
onClick: () => r(null)
|
|
2476
2473
|
})]
|
|
2477
2474
|
})]
|
|
2478
|
-
}), u(
|
|
2475
|
+
}), u(Oe, {
|
|
2479
2476
|
error: d
|
|
2480
2477
|
})]
|
|
2481
2478
|
});
|
|
2482
2479
|
};
|
|
2483
|
-
var We = (e) => e.type === "checkbox",
|
|
2480
|
+
var We = (e) => e.type === "checkbox", Ie = (e) => e instanceof Date, te = (e) => e == null;
|
|
2484
2481
|
const Nr = (e) => typeof e == "object";
|
|
2485
|
-
var K = (e) => !
|
|
2482
|
+
var K = (e) => !te(e) && !Array.isArray(e) && Nr(e) && !Ie(e), hn = (e) => K(e) && e.target ? We(e.target) ? e.target.checked : e.target.value : e, yn = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, mn = (e, r) => e.has(yn(r)), gn = (e) => {
|
|
2486
2483
|
const r = e.constructor && e.constructor.prototype;
|
|
2487
2484
|
return K(r) && r.hasOwnProperty("isPrototypeOf");
|
|
2488
2485
|
}, xt = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
2489
|
-
function
|
|
2486
|
+
function G(e) {
|
|
2490
2487
|
if (e instanceof Date)
|
|
2491
2488
|
return new Date(e);
|
|
2492
2489
|
const r = typeof FileList < "u" && e instanceof FileList;
|
|
@@ -2497,23 +2494,23 @@ function W(e) {
|
|
|
2497
2494
|
return e;
|
|
2498
2495
|
const s = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
2499
2496
|
for (const i in e)
|
|
2500
|
-
Object.prototype.hasOwnProperty.call(e, i) && (s[i] =
|
|
2497
|
+
Object.prototype.hasOwnProperty.call(e, i) && (s[i] = G(e[i]));
|
|
2501
2498
|
return s;
|
|
2502
2499
|
}
|
|
2503
2500
|
var Ye = (e) => /^\w*$/.test(e), q = (e) => e === void 0, wt = (e) => Array.isArray(e) ? e.filter(Boolean) : [], _t = (e) => wt(e.replace(/["|']|\]/g, "").split(/\.|\[/)), _ = (e, r, t) => {
|
|
2504
2501
|
if (!r || !K(e))
|
|
2505
2502
|
return t;
|
|
2506
|
-
const s = (Ye(r) ? [r] : _t(r)).reduce((i, a) =>
|
|
2503
|
+
const s = (Ye(r) ? [r] : _t(r)).reduce((i, a) => te(i) ? i : i[a], e);
|
|
2507
2504
|
return q(s) || s === e ? q(e[r]) ? t : e[r] : s;
|
|
2508
|
-
},
|
|
2505
|
+
}, de = (e) => typeof e == "boolean", le = (e) => typeof e == "function", j = (e, r, t) => {
|
|
2509
2506
|
let s = -1;
|
|
2510
2507
|
const i = Ye(r) ? [r] : _t(r), a = i.length, n = a - 1;
|
|
2511
2508
|
for (; ++s < a; ) {
|
|
2512
2509
|
const o = i[s];
|
|
2513
2510
|
let d = t;
|
|
2514
2511
|
if (s !== n) {
|
|
2515
|
-
const
|
|
2516
|
-
d = K(
|
|
2512
|
+
const h = e[o];
|
|
2513
|
+
d = K(h) || Array.isArray(h) ? h : isNaN(+i[s + 1]) ? {} : [];
|
|
2517
2514
|
}
|
|
2518
2515
|
if (o === "__proto__" || o === "constructor" || o === "prototype")
|
|
2519
2516
|
return;
|
|
@@ -2524,13 +2521,13 @@ const Kt = {
|
|
|
2524
2521
|
BLUR: "blur",
|
|
2525
2522
|
FOCUS_OUT: "focusout",
|
|
2526
2523
|
CHANGE: "change"
|
|
2527
|
-
},
|
|
2524
|
+
}, ue = {
|
|
2528
2525
|
onBlur: "onBlur",
|
|
2529
2526
|
onChange: "onChange",
|
|
2530
2527
|
onSubmit: "onSubmit",
|
|
2531
2528
|
onTouched: "onTouched",
|
|
2532
2529
|
all: "all"
|
|
2533
|
-
},
|
|
2530
|
+
}, ge = {
|
|
2534
2531
|
max: "max",
|
|
2535
2532
|
min: "min",
|
|
2536
2533
|
maxLength: "maxLength",
|
|
@@ -2538,7 +2535,7 @@ const Kt = {
|
|
|
2538
2535
|
pattern: "pattern",
|
|
2539
2536
|
required: "required",
|
|
2540
2537
|
validate: "validate"
|
|
2541
|
-
}, bn =
|
|
2538
|
+
}, bn = Y.createContext(null);
|
|
2542
2539
|
bn.displayName = "HookFormControlContext";
|
|
2543
2540
|
var vn = (e, r, t, s = !0) => {
|
|
2544
2541
|
const i = {
|
|
@@ -2548,17 +2545,17 @@ var vn = (e, r, t, s = !0) => {
|
|
|
2548
2545
|
Object.defineProperty(i, a, {
|
|
2549
2546
|
get: () => {
|
|
2550
2547
|
const n = a;
|
|
2551
|
-
return r._proxyFormState[n] !==
|
|
2548
|
+
return r._proxyFormState[n] !== ue.all && (r._proxyFormState[n] = !s || ue.all), t && (t[n] = !0), e[n];
|
|
2552
2549
|
}
|
|
2553
2550
|
});
|
|
2554
2551
|
return i;
|
|
2555
2552
|
};
|
|
2556
|
-
const xn = typeof window < "u" ?
|
|
2557
|
-
var
|
|
2558
|
-
function
|
|
2553
|
+
const xn = typeof window < "u" ? Y.useLayoutEffect : Y.useEffect;
|
|
2554
|
+
var re = (e) => typeof e == "string", wn = (e, r, t, s, i) => re(e) ? (s && r.watch.add(e), _(t, e, i)) : Array.isArray(e) ? e.map((a) => (s && r.watch.add(a), _(t, a))) : (s && (r.watchAll = !0), t), dt = (e) => te(e) || !Nr(e);
|
|
2555
|
+
function we(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
2559
2556
|
if (dt(e) || dt(r))
|
|
2560
2557
|
return Object.is(e, r);
|
|
2561
|
-
if (
|
|
2558
|
+
if (Ie(e) && Ie(r))
|
|
2562
2559
|
return Object.is(e.getTime(), r.getTime());
|
|
2563
2560
|
const s = Object.keys(e), i = Object.keys(r);
|
|
2564
2561
|
if (s.length !== i.length)
|
|
@@ -2572,13 +2569,13 @@ function be(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
|
2572
2569
|
return !1;
|
|
2573
2570
|
if (a !== "ref") {
|
|
2574
2571
|
const o = r[a];
|
|
2575
|
-
if (
|
|
2572
|
+
if (Ie(n) && Ie(o) || K(n) && K(o) || Array.isArray(n) && Array.isArray(o) ? !we(n, o, t) : !Object.is(n, o))
|
|
2576
2573
|
return !1;
|
|
2577
2574
|
}
|
|
2578
2575
|
}
|
|
2579
2576
|
return !0;
|
|
2580
2577
|
}
|
|
2581
|
-
const _n =
|
|
2578
|
+
const _n = Y.createContext(null);
|
|
2582
2579
|
_n.displayName = "HookFormContext";
|
|
2583
2580
|
var Lr = (e, r, t, s, i) => r ? {
|
|
2584
2581
|
...t[e],
|
|
@@ -2606,25 +2603,25 @@ var Lr = (e, r, t, s, i) => r ? {
|
|
|
2606
2603
|
}
|
|
2607
2604
|
};
|
|
2608
2605
|
};
|
|
2609
|
-
function
|
|
2606
|
+
function Tr(e, r) {
|
|
2610
2607
|
const t = {};
|
|
2611
2608
|
for (const s in e)
|
|
2612
2609
|
if (e.hasOwnProperty(s)) {
|
|
2613
2610
|
const i = e[s], a = r[s];
|
|
2614
2611
|
if (i && K(i) && a) {
|
|
2615
|
-
const n =
|
|
2612
|
+
const n = Tr(i, a);
|
|
2616
2613
|
K(n) && (t[s] = n);
|
|
2617
2614
|
} else
|
|
2618
2615
|
e[s] && (t[s] = a);
|
|
2619
2616
|
}
|
|
2620
2617
|
return t;
|
|
2621
2618
|
}
|
|
2622
|
-
var
|
|
2619
|
+
var Q = (e) => K(e) && !Object.keys(e).length, kt = (e) => e.type === "file", Ge = (e) => {
|
|
2623
2620
|
if (!xt)
|
|
2624
2621
|
return !1;
|
|
2625
2622
|
const r = e ? e.ownerDocument : 0;
|
|
2626
2623
|
return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
|
|
2627
|
-
},
|
|
2624
|
+
}, Dr = (e) => e.type === "select-multiple", Ct = (e) => e.type === "radio", kn = (e) => Ct(e) || We(e), ut = (e) => Ge(e) && e.isConnected;
|
|
2628
2625
|
function Cn(e, r) {
|
|
2629
2626
|
const t = r.slice(0, -1).length;
|
|
2630
2627
|
let s = 0;
|
|
@@ -2640,11 +2637,11 @@ function Sn(e) {
|
|
|
2640
2637
|
}
|
|
2641
2638
|
function z(e, r) {
|
|
2642
2639
|
const t = Array.isArray(r) ? r : Ye(r) ? [r] : _t(r), s = t.length === 1 ? e : Cn(e, t), i = t.length - 1, a = t[i];
|
|
2643
|
-
return s && delete s[a], i !== 0 && (K(s) &&
|
|
2640
|
+
return s && delete s[a], i !== 0 && (K(s) && Q(s) || Array.isArray(s) && Sn(s)) && z(e, t.slice(0, -1)), e;
|
|
2644
2641
|
}
|
|
2645
2642
|
var In = (e) => {
|
|
2646
2643
|
for (const r in e)
|
|
2647
|
-
if (
|
|
2644
|
+
if (le(e[r]))
|
|
2648
2645
|
return !0;
|
|
2649
2646
|
return !1;
|
|
2650
2647
|
};
|
|
@@ -2658,15 +2655,15 @@ function ft(e, r = {}) {
|
|
|
2658
2655
|
}
|
|
2659
2656
|
return r;
|
|
2660
2657
|
}
|
|
2661
|
-
function
|
|
2658
|
+
function Me(e, r, t) {
|
|
2662
2659
|
t || (t = ft(r));
|
|
2663
2660
|
for (const s in e) {
|
|
2664
2661
|
const i = e[s];
|
|
2665
2662
|
if (Or(i))
|
|
2666
|
-
q(r) || dt(t[s]) ? t[s] = ft(i, Array.isArray(i) ? [] : {}) :
|
|
2663
|
+
q(r) || dt(t[s]) ? t[s] = ft(i, Array.isArray(i) ? [] : {}) : Me(i, te(r) ? {} : r[s], t[s]);
|
|
2667
2664
|
else {
|
|
2668
2665
|
const a = r[s];
|
|
2669
|
-
t[s] = !
|
|
2666
|
+
t[s] = !we(i, a);
|
|
2670
2667
|
}
|
|
2671
2668
|
}
|
|
2672
2669
|
return t;
|
|
@@ -2687,24 +2684,24 @@ var Rr = (e) => {
|
|
|
2687
2684
|
) : Gt;
|
|
2688
2685
|
}
|
|
2689
2686
|
return Gt;
|
|
2690
|
-
}, Br = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: s }) => q(e) ? e : r ? e === "" ? NaN : e && +e : t &&
|
|
2687
|
+
}, Br = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: s }) => q(e) ? e : r ? e === "" ? NaN : e && +e : t && re(e) ? new Date(e) : s ? s(e) : e;
|
|
2691
2688
|
const Jt = {
|
|
2692
2689
|
isValid: !1,
|
|
2693
2690
|
value: null
|
|
2694
2691
|
};
|
|
2695
|
-
var
|
|
2692
|
+
var Pr = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disabled ? {
|
|
2696
2693
|
isValid: !0,
|
|
2697
2694
|
value: t.value
|
|
2698
2695
|
} : r, Jt) : Jt;
|
|
2699
2696
|
function Zt(e) {
|
|
2700
2697
|
const r = e.ref;
|
|
2701
|
-
return kt(r) ? r.files : Ct(r) ?
|
|
2698
|
+
return kt(r) ? r.files : Ct(r) ? Pr(e.refs).value : Dr(r) ? [...r.selectedOptions].map(({ value: t }) => t) : We(r) ? Rr(e.refs).value : Br(q(r.value) ? e.ref.value : r.value, e);
|
|
2702
2699
|
}
|
|
2703
|
-
var
|
|
2700
|
+
var Fn = (e, r, t, s) => {
|
|
2704
2701
|
const i = {};
|
|
2705
2702
|
for (const a of e) {
|
|
2706
2703
|
const n = _(r, a);
|
|
2707
|
-
n &&
|
|
2704
|
+
n && j(i, a, n._f);
|
|
2708
2705
|
}
|
|
2709
2706
|
return {
|
|
2710
2707
|
criteriaMode: t,
|
|
@@ -2713,14 +2710,14 @@ var Vn = (e, r, t, s) => {
|
|
|
2713
2710
|
shouldUseNativeValidation: s
|
|
2714
2711
|
};
|
|
2715
2712
|
}, He = (e) => e instanceof RegExp, Re = (e) => q(e) ? e : He(e) ? e.source : K(e) ? He(e.value) ? e.value.source : e.value : e, Xt = (e) => ({
|
|
2716
|
-
isOnSubmit: !e || e ===
|
|
2717
|
-
isOnBlur: e ===
|
|
2718
|
-
isOnChange: e ===
|
|
2719
|
-
isOnAll: e ===
|
|
2720
|
-
isOnTouch: e ===
|
|
2713
|
+
isOnSubmit: !e || e === ue.onSubmit,
|
|
2714
|
+
isOnBlur: e === ue.onBlur,
|
|
2715
|
+
isOnChange: e === ue.onChange,
|
|
2716
|
+
isOnAll: e === ue.all,
|
|
2717
|
+
isOnTouch: e === ue.onTouched
|
|
2721
2718
|
});
|
|
2722
2719
|
const Yt = "AsyncFunction";
|
|
2723
|
-
var
|
|
2720
|
+
var Vn = (e) => !!e && !!e.validate && !!(le(e.validate) && e.validate.constructor.name === Yt || K(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === Yt)), An = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), Qt = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((s) => e.startsWith(s) && /^\.\w+/.test(e.slice(s.length))));
|
|
2724
2721
|
const ze = (e, r, t, s) => {
|
|
2725
2722
|
for (const i of t || Object.keys(e)) {
|
|
2726
2723
|
const a = _(e, i);
|
|
@@ -2769,117 +2766,117 @@ function er(e, r, t) {
|
|
|
2769
2766
|
var En = (e, r, t, s) => {
|
|
2770
2767
|
t(e);
|
|
2771
2768
|
const { name: i, ...a } = e;
|
|
2772
|
-
return
|
|
2773
|
-
}, Mn = (e, r, t) => !e || !r || e === r || Ue(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), Nn = (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, Ln = (e, r) => !wt(_(e, r)).length && z(e, r),
|
|
2769
|
+
return Q(a) || Object.keys(a).length >= Object.keys(r).length || Object.keys(a).find((n) => r[n] === (!s || ue.all));
|
|
2770
|
+
}, Mn = (e, r, t) => !e || !r || e === r || Ue(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), Nn = (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, Ln = (e, r) => !wt(_(e, r)).length && z(e, r), Tn = (e, r, t) => {
|
|
2774
2771
|
const s = Ue(_(e, t));
|
|
2775
|
-
return
|
|
2772
|
+
return j(s, "root", r[t]), j(e, t, s), e;
|
|
2776
2773
|
};
|
|
2777
2774
|
function tr(e, r, t = "validate") {
|
|
2778
|
-
if (
|
|
2775
|
+
if (re(e) || Array.isArray(e) && e.every(re) || de(e) && !e)
|
|
2779
2776
|
return {
|
|
2780
2777
|
type: t,
|
|
2781
|
-
message:
|
|
2778
|
+
message: re(e) ? e : "",
|
|
2782
2779
|
ref: r
|
|
2783
2780
|
};
|
|
2784
2781
|
}
|
|
2785
|
-
var
|
|
2782
|
+
var Ee = (e) => K(e) && !He(e) ? e : {
|
|
2786
2783
|
value: e,
|
|
2787
2784
|
message: ""
|
|
2788
2785
|
}, rr = async (e, r, t, s, i, a) => {
|
|
2789
|
-
const { ref: n, refs: o, required: d, maxLength:
|
|
2790
|
-
if (!N || r.has(
|
|
2786
|
+
const { ref: n, refs: o, required: d, maxLength: h, minLength: v, min: x, max: p, pattern: m, validate: k, name: I, valueAsNumber: V, mount: N } = e._f, y = _(t, I);
|
|
2787
|
+
if (!N || r.has(I))
|
|
2791
2788
|
return {};
|
|
2792
|
-
const C = o ? o[0] : n,
|
|
2793
|
-
i && C.reportValidity && (C.setCustomValidity(
|
|
2794
|
-
},
|
|
2795
|
-
const
|
|
2796
|
-
|
|
2797
|
-
type:
|
|
2798
|
-
message:
|
|
2789
|
+
const C = o ? o[0] : n, E = (M) => {
|
|
2790
|
+
i && C.reportValidity && (C.setCustomValidity(de(M) ? "" : M || ""), C.reportValidity());
|
|
2791
|
+
}, A = {}, B = Ct(n), J = We(n), L = B || J, F = (V || kt(n)) && q(n.value) && q(y) || Ge(n) && n.value === "" || y === "" || Array.isArray(y) && !y.length, P = Lr.bind(null, I, s, A), H = (M, D, U, W = ge.maxLength, ee = ge.minLength) => {
|
|
2792
|
+
const T = M ? D : U;
|
|
2793
|
+
A[I] = {
|
|
2794
|
+
type: M ? W : ee,
|
|
2795
|
+
message: T,
|
|
2799
2796
|
ref: n,
|
|
2800
|
-
...
|
|
2797
|
+
...P(M ? W : ee, T)
|
|
2801
2798
|
};
|
|
2802
2799
|
};
|
|
2803
|
-
if (a ? !Array.isArray(y) || !y.length : d && (!
|
|
2804
|
-
const { value:
|
|
2805
|
-
if (
|
|
2806
|
-
type:
|
|
2800
|
+
if (a ? !Array.isArray(y) || !y.length : d && (!L && (F || te(y)) || de(y) && !y || J && !Rr(o).isValid || B && !Pr(o).isValid)) {
|
|
2801
|
+
const { value: M, message: D } = re(d) ? { value: !!d, message: d } : Ee(d);
|
|
2802
|
+
if (M && (A[I] = {
|
|
2803
|
+
type: ge.required,
|
|
2807
2804
|
message: D,
|
|
2808
2805
|
ref: C,
|
|
2809
|
-
...
|
|
2806
|
+
...P(ge.required, D)
|
|
2810
2807
|
}, !s))
|
|
2811
|
-
return
|
|
2808
|
+
return E(D), A;
|
|
2812
2809
|
}
|
|
2813
|
-
if (!
|
|
2814
|
-
let
|
|
2815
|
-
const
|
|
2816
|
-
if (!
|
|
2817
|
-
const
|
|
2818
|
-
|
|
2810
|
+
if (!F && (!te(x) || !te(p))) {
|
|
2811
|
+
let M, D;
|
|
2812
|
+
const U = Ee(p), W = Ee(x);
|
|
2813
|
+
if (!te(y) && !isNaN(y)) {
|
|
2814
|
+
const ee = n.valueAsNumber || y && +y;
|
|
2815
|
+
te(U.value) || (M = ee > U.value), te(W.value) || (D = ee < W.value);
|
|
2819
2816
|
} else {
|
|
2820
|
-
const
|
|
2821
|
-
|
|
2817
|
+
const ee = n.valueAsDate || new Date(y), T = (ie) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + ie), oe = n.type == "time", ce = n.type == "week";
|
|
2818
|
+
re(U.value) && y && (M = oe ? T(y) > T(U.value) : ce ? y > U.value : ee > new Date(U.value)), re(W.value) && y && (D = oe ? T(y) < T(W.value) : ce ? y < W.value : ee < new Date(W.value));
|
|
2822
2819
|
}
|
|
2823
|
-
if ((
|
|
2824
|
-
return
|
|
2820
|
+
if ((M || D) && (H(!!M, U.message, W.message, ge.max, ge.min), !s))
|
|
2821
|
+
return E(A[I].message), A;
|
|
2825
2822
|
}
|
|
2826
|
-
if ((
|
|
2827
|
-
const
|
|
2828
|
-
if ((
|
|
2829
|
-
return
|
|
2823
|
+
if ((h || v) && !F && (re(y) || a && Array.isArray(y))) {
|
|
2824
|
+
const M = Ee(h), D = Ee(v), U = !te(M.value) && y.length > +M.value, W = !te(D.value) && y.length < +D.value;
|
|
2825
|
+
if ((U || W) && (H(U, M.message, D.message), !s))
|
|
2826
|
+
return E(A[I].message), A;
|
|
2830
2827
|
}
|
|
2831
|
-
if (m && !
|
|
2832
|
-
const { value:
|
|
2833
|
-
if (He(
|
|
2834
|
-
type:
|
|
2828
|
+
if (m && !F && re(y)) {
|
|
2829
|
+
const { value: M, message: D } = Ee(m);
|
|
2830
|
+
if (He(M) && !y.match(M) && (A[I] = {
|
|
2831
|
+
type: ge.pattern,
|
|
2835
2832
|
message: D,
|
|
2836
2833
|
ref: n,
|
|
2837
|
-
...
|
|
2834
|
+
...P(ge.pattern, D)
|
|
2838
2835
|
}, !s))
|
|
2839
|
-
return
|
|
2836
|
+
return E(D), A;
|
|
2840
2837
|
}
|
|
2841
2838
|
if (k) {
|
|
2842
|
-
if (
|
|
2843
|
-
const
|
|
2844
|
-
if (D && (
|
|
2839
|
+
if (le(k)) {
|
|
2840
|
+
const M = await k(y, t), D = tr(M, C);
|
|
2841
|
+
if (D && (A[I] = {
|
|
2845
2842
|
...D,
|
|
2846
|
-
...
|
|
2843
|
+
...P(ge.validate, D.message)
|
|
2847
2844
|
}, !s))
|
|
2848
|
-
return
|
|
2845
|
+
return E(D.message), A;
|
|
2849
2846
|
} else if (K(k)) {
|
|
2850
|
-
let
|
|
2847
|
+
let M = {};
|
|
2851
2848
|
for (const D in k) {
|
|
2852
|
-
if (!
|
|
2849
|
+
if (!Q(M) && !s)
|
|
2853
2850
|
break;
|
|
2854
|
-
const
|
|
2855
|
-
|
|
2856
|
-
...
|
|
2857
|
-
...
|
|
2858
|
-
},
|
|
2851
|
+
const U = tr(await k[D](y, t), C, D);
|
|
2852
|
+
U && (M = {
|
|
2853
|
+
...U,
|
|
2854
|
+
...P(D, U.message)
|
|
2855
|
+
}, E(U.message), s && (A[I] = M));
|
|
2859
2856
|
}
|
|
2860
|
-
if (!
|
|
2857
|
+
if (!Q(M) && (A[I] = {
|
|
2861
2858
|
ref: C,
|
|
2862
|
-
...
|
|
2859
|
+
...M
|
|
2863
2860
|
}, !s))
|
|
2864
|
-
return
|
|
2861
|
+
return A;
|
|
2865
2862
|
}
|
|
2866
2863
|
}
|
|
2867
|
-
return
|
|
2864
|
+
return E(!0), A;
|
|
2868
2865
|
};
|
|
2869
|
-
const
|
|
2870
|
-
mode:
|
|
2871
|
-
reValidateMode:
|
|
2866
|
+
const Dn = {
|
|
2867
|
+
mode: ue.onSubmit,
|
|
2868
|
+
reValidateMode: ue.onChange,
|
|
2872
2869
|
shouldFocusError: !0
|
|
2873
2870
|
};
|
|
2874
2871
|
function On(e = {}) {
|
|
2875
2872
|
let r = {
|
|
2876
|
-
...
|
|
2873
|
+
...Dn,
|
|
2877
2874
|
...e
|
|
2878
2875
|
}, t = {
|
|
2879
2876
|
submitCount: 0,
|
|
2880
2877
|
isDirty: !1,
|
|
2881
2878
|
isReady: !1,
|
|
2882
|
-
isLoading:
|
|
2879
|
+
isLoading: le(r.defaultValues),
|
|
2883
2880
|
isValidating: !1,
|
|
2884
2881
|
isSubmitted: !1,
|
|
2885
2882
|
isSubmitting: !1,
|
|
@@ -2890,7 +2887,7 @@ function On(e = {}) {
|
|
|
2890
2887
|
validatingFields: {},
|
|
2891
2888
|
errors: r.errors || {},
|
|
2892
2889
|
disabled: r.disabled || !1
|
|
2893
|
-
}, s = {}, i = K(r.defaultValues) || K(r.values) ?
|
|
2890
|
+
}, s = {}, i = K(r.defaultValues) || K(r.values) ? G(r.defaultValues || r.values) || {} : {}, a = r.shouldUnregister ? {} : G(i), n = {
|
|
2894
2891
|
action: !1,
|
|
2895
2892
|
mount: !1,
|
|
2896
2893
|
watch: !1,
|
|
@@ -2901,7 +2898,7 @@ function On(e = {}) {
|
|
|
2901
2898
|
unMount: /* @__PURE__ */ new Set(),
|
|
2902
2899
|
array: /* @__PURE__ */ new Set(),
|
|
2903
2900
|
watch: /* @__PURE__ */ new Set()
|
|
2904
|
-
}, d,
|
|
2901
|
+
}, d, h = 0;
|
|
2905
2902
|
const v = {
|
|
2906
2903
|
isDirty: !1,
|
|
2907
2904
|
dirtyFields: !1,
|
|
@@ -2913,224 +2910,224 @@ function On(e = {}) {
|
|
|
2913
2910
|
}, x = {
|
|
2914
2911
|
...v
|
|
2915
2912
|
};
|
|
2916
|
-
let
|
|
2913
|
+
let p = {
|
|
2917
2914
|
...x
|
|
2918
2915
|
};
|
|
2919
2916
|
const m = {
|
|
2920
2917
|
array: Wt(),
|
|
2921
2918
|
state: Wt()
|
|
2922
|
-
}, k = r.criteriaMode ===
|
|
2923
|
-
clearTimeout(
|
|
2924
|
-
},
|
|
2925
|
-
if (!n.keepIsValid && !r.disabled && (x.isValid ||
|
|
2919
|
+
}, k = r.criteriaMode === ue.all, I = (l) => (c) => {
|
|
2920
|
+
clearTimeout(h), h = setTimeout(l, c);
|
|
2921
|
+
}, V = async (l) => {
|
|
2922
|
+
if (!n.keepIsValid && !r.disabled && (x.isValid || p.isValid || l)) {
|
|
2926
2923
|
let c;
|
|
2927
|
-
r.resolver ? (c =
|
|
2924
|
+
r.resolver ? (c = Q((await L()).errors), N()) : c = await P(s, !0), c !== t.isValid && m.state.next({
|
|
2928
2925
|
isValid: c
|
|
2929
2926
|
});
|
|
2930
2927
|
}
|
|
2931
2928
|
}, N = (l, c) => {
|
|
2932
|
-
!r.disabled && (x.isValidating || x.validatingFields ||
|
|
2933
|
-
f && (c ?
|
|
2929
|
+
!r.disabled && (x.isValidating || x.validatingFields || p.isValidating || p.validatingFields) && ((l || Array.from(o.mount)).forEach((f) => {
|
|
2930
|
+
f && (c ? j(t.validatingFields, f, c) : z(t.validatingFields, f));
|
|
2934
2931
|
}), m.state.next({
|
|
2935
2932
|
validatingFields: t.validatingFields,
|
|
2936
|
-
isValidating: !
|
|
2933
|
+
isValidating: !Q(t.validatingFields)
|
|
2937
2934
|
}));
|
|
2938
2935
|
}, y = (l, c = [], f, w, b = !0, g = !0) => {
|
|
2939
2936
|
if (w && f && !r.disabled) {
|
|
2940
2937
|
if (n.action = !0, g && Array.isArray(_(s, l))) {
|
|
2941
|
-
const
|
|
2942
|
-
b &&
|
|
2938
|
+
const S = f(_(s, l), w.argA, w.argB);
|
|
2939
|
+
b && j(s, l, S);
|
|
2943
2940
|
}
|
|
2944
2941
|
if (g && Array.isArray(_(t.errors, l))) {
|
|
2945
|
-
const
|
|
2946
|
-
b &&
|
|
2942
|
+
const S = f(_(t.errors, l), w.argA, w.argB);
|
|
2943
|
+
b && j(t.errors, l, S), Ln(t.errors, l);
|
|
2947
2944
|
}
|
|
2948
|
-
if ((x.touchedFields ||
|
|
2949
|
-
const
|
|
2950
|
-
b &&
|
|
2945
|
+
if ((x.touchedFields || p.touchedFields) && g && Array.isArray(_(t.touchedFields, l))) {
|
|
2946
|
+
const S = f(_(t.touchedFields, l), w.argA, w.argB);
|
|
2947
|
+
b && j(t.touchedFields, l, S);
|
|
2951
2948
|
}
|
|
2952
|
-
(x.dirtyFields ||
|
|
2949
|
+
(x.dirtyFields || p.dirtyFields) && (t.dirtyFields = Me(i, a)), m.state.next({
|
|
2953
2950
|
name: l,
|
|
2954
|
-
isDirty:
|
|
2951
|
+
isDirty: M(l, c),
|
|
2955
2952
|
dirtyFields: t.dirtyFields,
|
|
2956
2953
|
errors: t.errors,
|
|
2957
2954
|
isValid: t.isValid
|
|
2958
2955
|
});
|
|
2959
2956
|
} else
|
|
2960
|
-
|
|
2957
|
+
j(a, l, c);
|
|
2961
2958
|
}, C = (l, c) => {
|
|
2962
|
-
|
|
2959
|
+
j(t.errors, l, c), m.state.next({
|
|
2963
2960
|
errors: t.errors
|
|
2964
2961
|
});
|
|
2965
|
-
},
|
|
2962
|
+
}, E = (l) => {
|
|
2966
2963
|
t.errors = l, m.state.next({
|
|
2967
2964
|
errors: t.errors,
|
|
2968
2965
|
isValid: !1
|
|
2969
2966
|
});
|
|
2970
|
-
},
|
|
2967
|
+
}, A = (l, c, f, w) => {
|
|
2971
2968
|
const b = _(s, l);
|
|
2972
2969
|
if (b) {
|
|
2973
2970
|
const g = _(a, l, q(f) ? _(i, l) : f);
|
|
2974
|
-
q(g) || w && w.defaultChecked || c ?
|
|
2971
|
+
q(g) || w && w.defaultChecked || c ? j(a, l, c ? g : Zt(b._f)) : W(l, g), n.mount && !n.action && V();
|
|
2975
2972
|
}
|
|
2976
|
-
},
|
|
2977
|
-
let g = !1,
|
|
2978
|
-
const
|
|
2973
|
+
}, B = (l, c, f, w, b) => {
|
|
2974
|
+
let g = !1, S = !1;
|
|
2975
|
+
const O = {
|
|
2979
2976
|
name: l
|
|
2980
2977
|
};
|
|
2981
2978
|
if (!r.disabled) {
|
|
2982
2979
|
if (!f || w) {
|
|
2983
|
-
(x.isDirty ||
|
|
2984
|
-
const
|
|
2985
|
-
|
|
2980
|
+
(x.isDirty || p.isDirty) && (S = t.isDirty, t.isDirty = O.isDirty = M(), g = S !== O.isDirty);
|
|
2981
|
+
const R = we(_(i, l), c);
|
|
2982
|
+
S = !!_(t.dirtyFields, l), R ? z(t.dirtyFields, l) : j(t.dirtyFields, l, !0), O.dirtyFields = t.dirtyFields, g = g || (x.dirtyFields || p.dirtyFields) && S !== !R;
|
|
2986
2983
|
}
|
|
2987
2984
|
if (f) {
|
|
2988
|
-
const
|
|
2989
|
-
|
|
2985
|
+
const R = _(t.touchedFields, l);
|
|
2986
|
+
R || (j(t.touchedFields, l, f), O.touchedFields = t.touchedFields, g = g || (x.touchedFields || p.touchedFields) && R !== f);
|
|
2990
2987
|
}
|
|
2991
|
-
g && b && m.state.next(
|
|
2988
|
+
g && b && m.state.next(O);
|
|
2992
2989
|
}
|
|
2993
|
-
return g ?
|
|
2990
|
+
return g ? O : {};
|
|
2994
2991
|
}, J = (l, c, f, w) => {
|
|
2995
|
-
const b = _(t.errors, l), g = (x.isValid ||
|
|
2996
|
-
if (r.delayError && f ? (d =
|
|
2997
|
-
const
|
|
2992
|
+
const b = _(t.errors, l), g = (x.isValid || p.isValid) && de(c) && t.isValid !== c;
|
|
2993
|
+
if (r.delayError && f ? (d = I(() => C(l, f)), d(r.delayError)) : (clearTimeout(h), d = null, f ? j(t.errors, l, f) : z(t.errors, l)), (f ? !we(b, f) : b) || !Q(w) || g) {
|
|
2994
|
+
const S = {
|
|
2998
2995
|
...w,
|
|
2999
|
-
...g &&
|
|
2996
|
+
...g && de(c) ? { isValid: c } : {},
|
|
3000
2997
|
errors: t.errors,
|
|
3001
2998
|
name: l
|
|
3002
2999
|
};
|
|
3003
3000
|
t = {
|
|
3004
3001
|
...t,
|
|
3005
|
-
...
|
|
3006
|
-
}, m.state.next(
|
|
3002
|
+
...S
|
|
3003
|
+
}, m.state.next(S);
|
|
3007
3004
|
}
|
|
3008
|
-
},
|
|
3009
|
-
const { errors: c } = await
|
|
3005
|
+
}, L = async (l) => (N(l, !0), await r.resolver(a, r.context, Fn(l || o.mount, s, r.criteriaMode, r.shouldUseNativeValidation))), F = async (l) => {
|
|
3006
|
+
const { errors: c } = await L(l);
|
|
3010
3007
|
if (N(l), l)
|
|
3011
3008
|
for (const f of l) {
|
|
3012
3009
|
const w = _(c, f);
|
|
3013
|
-
w ?
|
|
3010
|
+
w ? j(t.errors, f, w) : z(t.errors, f);
|
|
3014
3011
|
}
|
|
3015
3012
|
else
|
|
3016
3013
|
t.errors = c;
|
|
3017
3014
|
return c;
|
|
3018
|
-
},
|
|
3015
|
+
}, P = async (l, c, f = {
|
|
3019
3016
|
valid: !0
|
|
3020
3017
|
}) => {
|
|
3021
3018
|
for (const w in l) {
|
|
3022
3019
|
const b = l[w];
|
|
3023
3020
|
if (b) {
|
|
3024
|
-
const { _f: g, ...
|
|
3021
|
+
const { _f: g, ...S } = b;
|
|
3025
3022
|
if (g) {
|
|
3026
|
-
const
|
|
3027
|
-
|
|
3028
|
-
const
|
|
3029
|
-
if (
|
|
3023
|
+
const O = o.array.has(g.name), R = b._f && Vn(b._f);
|
|
3024
|
+
R && x.validatingFields && N([g.name], !0);
|
|
3025
|
+
const X = await rr(b, o.disabled, a, k, r.shouldUseNativeValidation && !c, O);
|
|
3026
|
+
if (R && x.validatingFields && N([g.name]), X[g.name] && (f.valid = !1, c || e.shouldUseNativeValidation))
|
|
3030
3027
|
break;
|
|
3031
|
-
!c && (_(
|
|
3028
|
+
!c && (_(X, g.name) ? O ? Tn(t.errors, X, g.name) : j(t.errors, g.name, X[g.name]) : z(t.errors, g.name));
|
|
3032
3029
|
}
|
|
3033
|
-
!
|
|
3030
|
+
!Q(S) && await P(S, c, f);
|
|
3034
3031
|
}
|
|
3035
3032
|
}
|
|
3036
3033
|
return f.valid;
|
|
3037
|
-
},
|
|
3034
|
+
}, H = () => {
|
|
3038
3035
|
for (const l of o.unMount) {
|
|
3039
3036
|
const c = _(s, l);
|
|
3040
3037
|
c && (c._f.refs ? c._f.refs.every((f) => !ut(f)) : !ut(c._f.ref)) && tt(l);
|
|
3041
3038
|
}
|
|
3042
3039
|
o.unMount = /* @__PURE__ */ new Set();
|
|
3043
|
-
},
|
|
3044
|
-
...n.mount ? a : q(c) ? i :
|
|
3045
|
-
}, f, c),
|
|
3040
|
+
}, M = (l, c) => !r.disabled && (l && c && j(a, l, c), !we(St(), i)), D = (l, c, f) => wn(l, o, {
|
|
3041
|
+
...n.mount ? a : q(c) ? i : re(l) ? { [l]: c } : c
|
|
3042
|
+
}, f, c), U = (l) => wt(_(n.mount ? a : i, l, r.shouldUnregister ? _(i, l, []) : [])), W = (l, c, f = {}) => {
|
|
3046
3043
|
const w = _(s, l);
|
|
3047
3044
|
let b = c;
|
|
3048
3045
|
if (w) {
|
|
3049
3046
|
const g = w._f;
|
|
3050
|
-
g && (!g.disabled &&
|
|
3051
|
-
(!
|
|
3052
|
-
}) : g.refs.forEach((
|
|
3047
|
+
g && (!g.disabled && j(a, l, Br(c, g)), b = Ge(g.ref) && te(c) ? "" : c, Dr(g.ref) ? [...g.ref.options].forEach((S) => S.selected = b.includes(S.value)) : g.refs ? We(g.ref) ? g.refs.forEach((S) => {
|
|
3048
|
+
(!S.defaultChecked || !S.disabled) && (Array.isArray(b) ? S.checked = !!b.find((O) => O === S.value) : S.checked = b === S.value || !!b);
|
|
3049
|
+
}) : g.refs.forEach((S) => S.checked = S.value === b) : kt(g.ref) ? g.ref.value = "" : (g.ref.value = b, g.ref.type || m.state.next({
|
|
3053
3050
|
name: l,
|
|
3054
|
-
values:
|
|
3051
|
+
values: G(a)
|
|
3055
3052
|
})));
|
|
3056
3053
|
}
|
|
3057
|
-
(f.shouldDirty || f.shouldTouch) &&
|
|
3058
|
-
},
|
|
3054
|
+
(f.shouldDirty || f.shouldTouch) && B(l, b, f.shouldTouch, f.shouldDirty, !0), f.shouldValidate && ie(l);
|
|
3055
|
+
}, ee = (l, c, f) => {
|
|
3059
3056
|
for (const w in c) {
|
|
3060
3057
|
if (!c.hasOwnProperty(w))
|
|
3061
3058
|
return;
|
|
3062
|
-
const b = c[w], g = l + "." + w,
|
|
3063
|
-
(o.array.has(l) || K(b) ||
|
|
3059
|
+
const b = c[w], g = l + "." + w, S = _(s, g);
|
|
3060
|
+
(o.array.has(l) || K(b) || S && !S._f) && !Ie(b) ? ee(g, b, f) : W(g, b, f);
|
|
3064
3061
|
}
|
|
3065
|
-
},
|
|
3066
|
-
const w = _(s, l), b = o.array.has(l), g =
|
|
3067
|
-
|
|
3062
|
+
}, T = (l, c, f = {}) => {
|
|
3063
|
+
const w = _(s, l), b = o.array.has(l), g = G(c);
|
|
3064
|
+
j(a, l, g), b ? (m.array.next({
|
|
3068
3065
|
name: l,
|
|
3069
|
-
values:
|
|
3070
|
-
}), (x.isDirty || x.dirtyFields ||
|
|
3066
|
+
values: G(a)
|
|
3067
|
+
}), (x.isDirty || x.dirtyFields || p.isDirty || p.dirtyFields) && f.shouldDirty && m.state.next({
|
|
3071
3068
|
name: l,
|
|
3072
|
-
dirtyFields:
|
|
3073
|
-
isDirty:
|
|
3074
|
-
})) : w && !w._f && !
|
|
3069
|
+
dirtyFields: Me(i, a),
|
|
3070
|
+
isDirty: M(l, g)
|
|
3071
|
+
})) : w && !w._f && !te(g) ? ee(l, g, f) : W(l, g, f), Qt(l, o) ? m.state.next({
|
|
3075
3072
|
...t,
|
|
3076
3073
|
name: l,
|
|
3077
|
-
values:
|
|
3074
|
+
values: G(a)
|
|
3078
3075
|
}) : m.state.next({
|
|
3079
3076
|
name: n.mount ? l : void 0,
|
|
3080
|
-
values:
|
|
3077
|
+
values: G(a)
|
|
3081
3078
|
});
|
|
3082
|
-
},
|
|
3079
|
+
}, oe = async (l) => {
|
|
3083
3080
|
n.mount = !0;
|
|
3084
3081
|
const c = l.target;
|
|
3085
3082
|
let f = c.name, w = !0;
|
|
3086
|
-
const b = _(s, f), g = (
|
|
3087
|
-
w = Number.isNaN(
|
|
3088
|
-
},
|
|
3083
|
+
const b = _(s, f), g = (R) => {
|
|
3084
|
+
w = Number.isNaN(R) || Ie(R) && isNaN(R.getTime()) || we(R, _(a, f, R));
|
|
3085
|
+
}, S = Xt(r.mode), O = Xt(r.reValidateMode);
|
|
3089
3086
|
if (b) {
|
|
3090
|
-
let
|
|
3091
|
-
const
|
|
3092
|
-
|
|
3093
|
-
const it =
|
|
3094
|
-
if (!
|
|
3087
|
+
let R, X;
|
|
3088
|
+
const Ce = c.type ? Zt(b._f) : hn(l), xe = l.type === Kt.BLUR || l.type === Kt.FOCUS_OUT, Hr = !An(b._f) && !r.resolver && !_(t.errors, f) && !b._f.deps || Nn(xe, _(t.touchedFields, f), t.isSubmitted, O, S), nt = Qt(f, o, xe);
|
|
3089
|
+
j(a, f, Ce), xe ? (!c || !c.readOnly) && (b._f.onBlur && b._f.onBlur(l), d && d(0)) : b._f.onChange && b._f.onChange(l);
|
|
3090
|
+
const it = B(f, Ce, xe), Jr = !Q(it) || nt;
|
|
3091
|
+
if (!xe && m.state.next({
|
|
3095
3092
|
name: f,
|
|
3096
3093
|
type: l.type,
|
|
3097
|
-
values:
|
|
3094
|
+
values: G(a)
|
|
3098
3095
|
}), Hr)
|
|
3099
|
-
return (x.isValid ||
|
|
3100
|
-
if (!
|
|
3101
|
-
const { errors:
|
|
3102
|
-
if (N([f]), g(
|
|
3103
|
-
const Zr = er(t.errors, s, f),
|
|
3104
|
-
|
|
3096
|
+
return (x.isValid || p.isValid) && (r.mode === "onBlur" ? xe && V() : xe || V()), Jr && m.state.next({ name: f, ...nt ? {} : it });
|
|
3097
|
+
if (!xe && nt && m.state.next({ ...t }), r.resolver) {
|
|
3098
|
+
const { errors: Tt } = await L([f]);
|
|
3099
|
+
if (N([f]), g(Ce), w) {
|
|
3100
|
+
const Zr = er(t.errors, s, f), Dt = er(Tt, s, Zr.name || f);
|
|
3101
|
+
R = Dt.error, f = Dt.name, X = Q(Tt);
|
|
3105
3102
|
}
|
|
3106
3103
|
} else
|
|
3107
|
-
N([f], !0),
|
|
3108
|
-
w && (b._f.deps && (!Array.isArray(b._f.deps) || b._f.deps.length > 0) &&
|
|
3104
|
+
N([f], !0), R = (await rr(b, o.disabled, a, k, r.shouldUseNativeValidation))[f], N([f]), g(Ce), w && (R ? X = !1 : (x.isValid || p.isValid) && (X = await P(s, !0)));
|
|
3105
|
+
w && (b._f.deps && (!Array.isArray(b._f.deps) || b._f.deps.length > 0) && ie(b._f.deps), J(f, X, R, it));
|
|
3109
3106
|
}
|
|
3110
|
-
},
|
|
3107
|
+
}, ce = (l, c) => {
|
|
3111
3108
|
if (_(t.errors, c) && l.focus)
|
|
3112
3109
|
return l.focus(), 1;
|
|
3113
|
-
},
|
|
3110
|
+
}, ie = async (l, c = {}) => {
|
|
3114
3111
|
let f, w;
|
|
3115
3112
|
const b = Ue(l);
|
|
3116
3113
|
if (r.resolver) {
|
|
3117
|
-
const g = await
|
|
3118
|
-
f =
|
|
3114
|
+
const g = await F(q(l) ? l : b);
|
|
3115
|
+
f = Q(g), w = l ? !b.some((S) => _(g, S)) : f;
|
|
3119
3116
|
} else
|
|
3120
3117
|
l ? (w = (await Promise.all(b.map(async (g) => {
|
|
3121
|
-
const
|
|
3122
|
-
return await
|
|
3123
|
-
}))).every(Boolean), !(!w && !t.isValid) &&
|
|
3118
|
+
const S = _(s, g);
|
|
3119
|
+
return await P(S && S._f ? { [g]: S } : S);
|
|
3120
|
+
}))).every(Boolean), !(!w && !t.isValid) && V()) : w = f = await P(s);
|
|
3124
3121
|
return m.state.next({
|
|
3125
|
-
...!
|
|
3122
|
+
...!re(l) || (x.isValid || p.isValid) && f !== t.isValid ? {} : { name: l },
|
|
3126
3123
|
...r.resolver || !l ? { isValid: f } : {},
|
|
3127
3124
|
errors: t.errors
|
|
3128
|
-
}), c.shouldFocus && !w && ze(s,
|
|
3125
|
+
}), c.shouldFocus && !w && ze(s, ce, l ? b : o.mount), w;
|
|
3129
3126
|
}, St = (l, c) => {
|
|
3130
3127
|
let f = {
|
|
3131
3128
|
...n.mount ? a : i
|
|
3132
3129
|
};
|
|
3133
|
-
return c && (f =
|
|
3130
|
+
return c && (f = Tr(c.dirtyFields ? t.dirtyFields : t.touchedFields, f)), q(l) ? f : re(l) ? _(f, l) : l.map((w) => _(f, w));
|
|
3134
3131
|
}, It = (l, c) => ({
|
|
3135
3132
|
invalid: !!_((c || t).errors, l),
|
|
3136
3133
|
isDirty: !!_((c || t).dirtyFields, l),
|
|
@@ -3147,10 +3144,10 @@ function On(e = {}) {
|
|
|
3147
3144
|
}) : m.state.next({
|
|
3148
3145
|
errors: {}
|
|
3149
3146
|
});
|
|
3150
|
-
},
|
|
3151
|
-
const w = (_(s, l, { _f: {} })._f || {}).ref, b = _(t.errors, l) || {}, { ref: g, message:
|
|
3152
|
-
|
|
3153
|
-
...
|
|
3147
|
+
}, Ft = (l, c, f) => {
|
|
3148
|
+
const w = (_(s, l, { _f: {} })._f || {}).ref, b = _(t.errors, l) || {}, { ref: g, message: S, type: O, ...R } = b;
|
|
3149
|
+
j(t.errors, l, {
|
|
3150
|
+
...R,
|
|
3154
3151
|
...c,
|
|
3155
3152
|
ref: w
|
|
3156
3153
|
}), m.state.next({
|
|
@@ -3158,9 +3155,9 @@ function On(e = {}) {
|
|
|
3158
3155
|
errors: t.errors,
|
|
3159
3156
|
isValid: !1
|
|
3160
3157
|
}), f && f.shouldFocus && w && w.focus && w.focus();
|
|
3161
|
-
}, qr = (l, c) =>
|
|
3158
|
+
}, qr = (l, c) => le(l) ? m.state.subscribe({
|
|
3162
3159
|
next: (f) => "values" in f && l(D(void 0, c), f)
|
|
3163
|
-
}) : D(l, c, !0),
|
|
3160
|
+
}) : D(l, c, !0), Vt = (l) => m.state.subscribe({
|
|
3164
3161
|
next: (c) => {
|
|
3165
3162
|
Mn(l.name, c.name, l.exact) && En(c, l.formState || x, Gr, l.reRenderRoot) && l.callback({
|
|
3166
3163
|
values: { ...a },
|
|
@@ -3169,10 +3166,10 @@ function On(e = {}) {
|
|
|
3169
3166
|
defaultValues: i
|
|
3170
3167
|
});
|
|
3171
3168
|
}
|
|
3172
|
-
}).unsubscribe, Ur = (l) => (n.mount = !0,
|
|
3173
|
-
...
|
|
3169
|
+
}).unsubscribe, Ur = (l) => (n.mount = !0, p = {
|
|
3170
|
+
...p,
|
|
3174
3171
|
...l.formState
|
|
3175
|
-
},
|
|
3172
|
+
}, Vt({
|
|
3176
3173
|
...l,
|
|
3177
3174
|
formState: {
|
|
3178
3175
|
...v,
|
|
@@ -3182,20 +3179,20 @@ function On(e = {}) {
|
|
|
3182
3179
|
for (const f of l ? Ue(l) : o.mount)
|
|
3183
3180
|
o.mount.delete(f), o.array.delete(f), c.keepValue || (z(s, f), z(a, f)), !c.keepError && z(t.errors, f), !c.keepDirty && z(t.dirtyFields, f), !c.keepTouched && z(t.touchedFields, f), !c.keepIsValidating && z(t.validatingFields, f), !r.shouldUnregister && !c.keepDefaultValue && z(i, f);
|
|
3184
3181
|
m.state.next({
|
|
3185
|
-
values:
|
|
3182
|
+
values: G(a)
|
|
3186
3183
|
}), m.state.next({
|
|
3187
3184
|
...t,
|
|
3188
|
-
...c.keepDirty ? { isDirty:
|
|
3189
|
-
}), !c.keepIsValid &&
|
|
3185
|
+
...c.keepDirty ? { isDirty: M() } : {}
|
|
3186
|
+
}), !c.keepIsValid && V();
|
|
3190
3187
|
}, At = ({ disabled: l, name: c }) => {
|
|
3191
|
-
if (
|
|
3188
|
+
if (de(l) && n.mount || l || o.disabled.has(c)) {
|
|
3192
3189
|
const b = o.disabled.has(c) !== !!l;
|
|
3193
|
-
l ? o.disabled.add(c) : o.disabled.delete(c), b && n.mount && !n.action &&
|
|
3190
|
+
l ? o.disabled.add(c) : o.disabled.delete(c), b && n.mount && !n.action && V();
|
|
3194
3191
|
}
|
|
3195
3192
|
}, rt = (l, c = {}) => {
|
|
3196
3193
|
let f = _(s, l);
|
|
3197
|
-
const w =
|
|
3198
|
-
return
|
|
3194
|
+
const w = de(c.disabled) || de(r.disabled);
|
|
3195
|
+
return j(s, l, {
|
|
3199
3196
|
...f || {},
|
|
3200
3197
|
_f: {
|
|
3201
3198
|
...f && f._f ? f._f : { ref: { name: l } },
|
|
@@ -3204,9 +3201,9 @@ function On(e = {}) {
|
|
|
3204
3201
|
...c
|
|
3205
3202
|
}
|
|
3206
3203
|
}), o.mount.add(l), f ? At({
|
|
3207
|
-
disabled:
|
|
3204
|
+
disabled: de(c.disabled) ? c.disabled : r.disabled,
|
|
3208
3205
|
name: l
|
|
3209
|
-
}) :
|
|
3206
|
+
}) : A(l, !0, c.value), {
|
|
3210
3207
|
...w ? { disabled: c.disabled || r.disabled } : {},
|
|
3211
3208
|
...r.progressive ? {
|
|
3212
3209
|
required: !!c.required,
|
|
@@ -3217,33 +3214,33 @@ function On(e = {}) {
|
|
|
3217
3214
|
pattern: Re(c.pattern)
|
|
3218
3215
|
} : {},
|
|
3219
3216
|
name: l,
|
|
3220
|
-
onChange:
|
|
3221
|
-
onBlur:
|
|
3217
|
+
onChange: oe,
|
|
3218
|
+
onBlur: oe,
|
|
3222
3219
|
ref: (b) => {
|
|
3223
3220
|
if (b) {
|
|
3224
3221
|
rt(l, c), f = _(s, l);
|
|
3225
|
-
const g = q(b.value) && b.querySelectorAll && b.querySelectorAll("input,select,textarea")[0] || b,
|
|
3226
|
-
if (
|
|
3222
|
+
const g = q(b.value) && b.querySelectorAll && b.querySelectorAll("input,select,textarea")[0] || b, S = kn(g), O = f._f.refs || [];
|
|
3223
|
+
if (S ? O.find((R) => R === g) : g === f._f.ref)
|
|
3227
3224
|
return;
|
|
3228
|
-
|
|
3225
|
+
j(s, l, {
|
|
3229
3226
|
_f: {
|
|
3230
3227
|
...f._f,
|
|
3231
|
-
...
|
|
3228
|
+
...S ? {
|
|
3232
3229
|
refs: [
|
|
3233
|
-
...
|
|
3230
|
+
...O.filter(ut),
|
|
3234
3231
|
g,
|
|
3235
3232
|
...Array.isArray(_(i, l)) ? [{}] : []
|
|
3236
3233
|
],
|
|
3237
3234
|
ref: { type: g.type, name: l }
|
|
3238
3235
|
} : { ref: g }
|
|
3239
3236
|
}
|
|
3240
|
-
}),
|
|
3237
|
+
}), A(l, !1, void 0, g);
|
|
3241
3238
|
} else
|
|
3242
3239
|
f = _(s, l, {}), f._f && (f._f.mount = !1), (r.shouldUnregister || c.shouldUnregister) && !(mn(o.array, l) && n.action) && o.unMount.add(l);
|
|
3243
3240
|
}
|
|
3244
3241
|
};
|
|
3245
|
-
}, st = () => r.shouldFocusError && ze(s,
|
|
3246
|
-
|
|
3242
|
+
}, st = () => r.shouldFocusError && ze(s, ce, o.mount), zr = (l) => {
|
|
3243
|
+
de(l) && (m.state.next({ disabled: l }), ze(s, (c, f) => {
|
|
3247
3244
|
const w = _(s, f);
|
|
3248
3245
|
w && (c.disabled = w._f.disabled || l, Array.isArray(w._f.refs) && w._f.refs.forEach((b) => {
|
|
3249
3246
|
b.disabled = w._f.disabled || l;
|
|
@@ -3252,18 +3249,18 @@ function On(e = {}) {
|
|
|
3252
3249
|
}, Et = (l, c) => async (f) => {
|
|
3253
3250
|
let w;
|
|
3254
3251
|
f && (f.preventDefault && f.preventDefault(), f.persist && f.persist());
|
|
3255
|
-
let b =
|
|
3252
|
+
let b = G(a);
|
|
3256
3253
|
if (m.state.next({
|
|
3257
3254
|
isSubmitting: !0
|
|
3258
3255
|
}), r.resolver) {
|
|
3259
|
-
const { errors: g, values:
|
|
3260
|
-
N(), t.errors = g, b =
|
|
3256
|
+
const { errors: g, values: S } = await L();
|
|
3257
|
+
N(), t.errors = g, b = G(S);
|
|
3261
3258
|
} else
|
|
3262
|
-
await
|
|
3259
|
+
await P(s);
|
|
3263
3260
|
if (o.disabled.size)
|
|
3264
3261
|
for (const g of o.disabled)
|
|
3265
3262
|
z(b, g);
|
|
3266
|
-
if (z(t.errors, "root"),
|
|
3263
|
+
if (z(t.errors, "root"), Q(t.errors)) {
|
|
3267
3264
|
m.state.next({
|
|
3268
3265
|
errors: {}
|
|
3269
3266
|
});
|
|
@@ -3277,47 +3274,47 @@ function On(e = {}) {
|
|
|
3277
3274
|
if (m.state.next({
|
|
3278
3275
|
isSubmitted: !0,
|
|
3279
3276
|
isSubmitting: !1,
|
|
3280
|
-
isSubmitSuccessful:
|
|
3277
|
+
isSubmitSuccessful: Q(t.errors) && !w,
|
|
3281
3278
|
submitCount: t.submitCount + 1,
|
|
3282
3279
|
errors: t.errors
|
|
3283
3280
|
}), w)
|
|
3284
3281
|
throw w;
|
|
3285
3282
|
}, Kr = (l, c = {}) => {
|
|
3286
|
-
_(s, l) && (q(c.defaultValue) ?
|
|
3283
|
+
_(s, l) && (q(c.defaultValue) ? T(l, G(_(i, l))) : (T(l, c.defaultValue), j(i, l, G(c.defaultValue))), c.keepTouched || z(t.touchedFields, l), c.keepDirty || (z(t.dirtyFields, l), t.isDirty = c.defaultValue ? M(l, G(_(i, l))) : M()), c.keepError || (z(t.errors, l), x.isValid && V()), m.state.next({ ...t }));
|
|
3287
3284
|
}, Mt = (l, c = {}) => {
|
|
3288
|
-
const f = l ?
|
|
3285
|
+
const f = l ? G(l) : i, w = G(f), b = Q(l), g = b ? i : w;
|
|
3289
3286
|
if (c.keepDefaultValues || (i = f), !c.keepValues) {
|
|
3290
3287
|
if (c.keepDirtyValues) {
|
|
3291
|
-
const
|
|
3288
|
+
const S = /* @__PURE__ */ new Set([
|
|
3292
3289
|
...o.mount,
|
|
3293
|
-
...Object.keys(
|
|
3290
|
+
...Object.keys(Me(i, a))
|
|
3294
3291
|
]);
|
|
3295
|
-
for (const
|
|
3296
|
-
const
|
|
3297
|
-
|
|
3292
|
+
for (const O of Array.from(S)) {
|
|
3293
|
+
const R = _(t.dirtyFields, O), X = _(a, O), Ce = _(g, O);
|
|
3294
|
+
R && !q(X) ? j(g, O, X) : !R && !q(Ce) && T(O, Ce);
|
|
3298
3295
|
}
|
|
3299
3296
|
} else {
|
|
3300
3297
|
if (xt && q(l))
|
|
3301
|
-
for (const
|
|
3302
|
-
const
|
|
3303
|
-
if (
|
|
3304
|
-
const
|
|
3305
|
-
if (Ge(
|
|
3306
|
-
const
|
|
3307
|
-
if (
|
|
3308
|
-
|
|
3298
|
+
for (const S of o.mount) {
|
|
3299
|
+
const O = _(s, S);
|
|
3300
|
+
if (O && O._f) {
|
|
3301
|
+
const R = Array.isArray(O._f.refs) ? O._f.refs[0] : O._f.ref;
|
|
3302
|
+
if (Ge(R)) {
|
|
3303
|
+
const X = R.closest("form");
|
|
3304
|
+
if (X) {
|
|
3305
|
+
X.reset();
|
|
3309
3306
|
break;
|
|
3310
3307
|
}
|
|
3311
3308
|
}
|
|
3312
3309
|
}
|
|
3313
3310
|
}
|
|
3314
3311
|
if (c.keepFieldsRef)
|
|
3315
|
-
for (const
|
|
3316
|
-
|
|
3312
|
+
for (const S of o.mount)
|
|
3313
|
+
T(S, _(g, S));
|
|
3317
3314
|
else
|
|
3318
3315
|
s = {};
|
|
3319
3316
|
}
|
|
3320
|
-
a = r.shouldUnregister ? c.keepDefaultValues ?
|
|
3317
|
+
a = r.shouldUnregister ? c.keepDefaultValues ? G(i) : {} : G(g), m.array.next({
|
|
3321
3318
|
values: { ...g }
|
|
3322
3319
|
}), m.state.next({
|
|
3323
3320
|
values: { ...g }
|
|
@@ -3331,23 +3328,23 @@ function On(e = {}) {
|
|
|
3331
3328
|
watch: /* @__PURE__ */ new Set(),
|
|
3332
3329
|
watchAll: !1,
|
|
3333
3330
|
focus: ""
|
|
3334
|
-
}, n.mount = !x.isValid || !!c.keepIsValid || !!c.keepDirtyValues || !r.shouldUnregister && !
|
|
3331
|
+
}, n.mount = !x.isValid || !!c.keepIsValid || !!c.keepDirtyValues || !r.shouldUnregister && !Q(g), n.watch = !!r.shouldUnregister, n.keepIsValid = !!c.keepIsValid, n.action = !1, c.keepErrors || (t.errors = {}), m.state.next({
|
|
3335
3332
|
submitCount: c.keepSubmitCount ? t.submitCount : 0,
|
|
3336
|
-
isDirty: b ? !1 : c.keepDirty ? t.isDirty : !!(c.keepDefaultValues && !
|
|
3333
|
+
isDirty: b ? !1 : c.keepDirty ? t.isDirty : !!(c.keepDefaultValues && !we(l, i)),
|
|
3337
3334
|
isSubmitted: c.keepIsSubmitted ? t.isSubmitted : !1,
|
|
3338
|
-
dirtyFields: b ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ?
|
|
3335
|
+
dirtyFields: b ? {} : c.keepDirtyValues ? c.keepDefaultValues && a ? Me(i, a) : t.dirtyFields : c.keepDefaultValues && l ? Me(i, l) : c.keepDirty ? t.dirtyFields : {},
|
|
3339
3336
|
touchedFields: c.keepTouched ? t.touchedFields : {},
|
|
3340
3337
|
errors: c.keepErrors ? t.errors : {},
|
|
3341
3338
|
isSubmitSuccessful: c.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
|
|
3342
3339
|
isSubmitting: !1,
|
|
3343
3340
|
defaultValues: i
|
|
3344
3341
|
});
|
|
3345
|
-
}, Nt = (l, c) => Mt(
|
|
3342
|
+
}, Nt = (l, c) => Mt(le(l) ? l(a) : l, { ...r.resetOptions, ...c }), Wr = (l, c = {}) => {
|
|
3346
3343
|
const f = _(s, l), w = f && f._f;
|
|
3347
3344
|
if (w) {
|
|
3348
3345
|
const b = w.refs ? w.refs[0] : w.ref;
|
|
3349
3346
|
b.focus && setTimeout(() => {
|
|
3350
|
-
b.focus(), c.shouldSelect &&
|
|
3347
|
+
b.focus(), c.shouldSelect && le(b.select) && b.select();
|
|
3351
3348
|
});
|
|
3352
3349
|
}
|
|
3353
3350
|
}, Gr = (l) => {
|
|
@@ -3361,25 +3358,25 @@ function On(e = {}) {
|
|
|
3361
3358
|
unregister: tt,
|
|
3362
3359
|
getFieldState: It,
|
|
3363
3360
|
handleSubmit: Et,
|
|
3364
|
-
setError:
|
|
3365
|
-
_subscribe:
|
|
3366
|
-
_runSchema:
|
|
3361
|
+
setError: Ft,
|
|
3362
|
+
_subscribe: Vt,
|
|
3363
|
+
_runSchema: L,
|
|
3367
3364
|
_updateIsValidating: N,
|
|
3368
3365
|
_focusError: st,
|
|
3369
3366
|
_getWatch: D,
|
|
3370
|
-
_getDirty:
|
|
3371
|
-
_setValid:
|
|
3367
|
+
_getDirty: M,
|
|
3368
|
+
_setValid: V,
|
|
3372
3369
|
_setFieldArray: y,
|
|
3373
3370
|
_setDisabledField: At,
|
|
3374
|
-
_setErrors:
|
|
3375
|
-
_getFieldArray:
|
|
3371
|
+
_setErrors: E,
|
|
3372
|
+
_getFieldArray: U,
|
|
3376
3373
|
_reset: Mt,
|
|
3377
|
-
_resetDefaultValues: () =>
|
|
3374
|
+
_resetDefaultValues: () => le(r.defaultValues) && r.defaultValues().then((l) => {
|
|
3378
3375
|
Nt(l, r.resetOptions), m.state.next({
|
|
3379
3376
|
isLoading: !1
|
|
3380
3377
|
});
|
|
3381
3378
|
}),
|
|
3382
|
-
_removeUnmounted:
|
|
3379
|
+
_removeUnmounted: H,
|
|
3383
3380
|
_disableForm: zr,
|
|
3384
3381
|
_subjects: m,
|
|
3385
3382
|
_proxyFormState: x,
|
|
@@ -3418,17 +3415,17 @@ function On(e = {}) {
|
|
|
3418
3415
|
}
|
|
3419
3416
|
},
|
|
3420
3417
|
subscribe: Ur,
|
|
3421
|
-
trigger:
|
|
3418
|
+
trigger: ie,
|
|
3422
3419
|
register: rt,
|
|
3423
3420
|
handleSubmit: Et,
|
|
3424
3421
|
watch: qr,
|
|
3425
|
-
setValue:
|
|
3422
|
+
setValue: T,
|
|
3426
3423
|
getValues: St,
|
|
3427
3424
|
reset: Nt,
|
|
3428
3425
|
resetField: Kr,
|
|
3429
3426
|
clearErrors: $r,
|
|
3430
3427
|
unregister: tt,
|
|
3431
|
-
setError:
|
|
3428
|
+
setError: Ft,
|
|
3432
3429
|
setFocus: Wr,
|
|
3433
3430
|
getFieldState: It
|
|
3434
3431
|
};
|
|
@@ -3438,10 +3435,10 @@ function On(e = {}) {
|
|
|
3438
3435
|
};
|
|
3439
3436
|
}
|
|
3440
3437
|
function Qe(e = {}) {
|
|
3441
|
-
const r =
|
|
3438
|
+
const r = Y.useRef(void 0), t = Y.useRef(void 0), [s, i] = Y.useState({
|
|
3442
3439
|
isDirty: !1,
|
|
3443
3440
|
isValidating: !1,
|
|
3444
|
-
isLoading:
|
|
3441
|
+
isLoading: le(e.defaultValues),
|
|
3445
3442
|
isSubmitted: !1,
|
|
3446
3443
|
isSubmitting: !1,
|
|
3447
3444
|
isSubmitSuccessful: !1,
|
|
@@ -3453,14 +3450,14 @@ function Qe(e = {}) {
|
|
|
3453
3450
|
errors: e.errors || {},
|
|
3454
3451
|
disabled: e.disabled || !1,
|
|
3455
3452
|
isReady: !1,
|
|
3456
|
-
defaultValues:
|
|
3453
|
+
defaultValues: le(e.defaultValues) ? void 0 : e.defaultValues
|
|
3457
3454
|
});
|
|
3458
3455
|
if (!r.current)
|
|
3459
3456
|
if (e.formControl)
|
|
3460
3457
|
r.current = {
|
|
3461
3458
|
...e.formControl,
|
|
3462
3459
|
formState: s
|
|
3463
|
-
}, e.defaultValues && !
|
|
3460
|
+
}, e.defaultValues && !le(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
3464
3461
|
else {
|
|
3465
3462
|
const { formControl: n, ...o } = On(e);
|
|
3466
3463
|
r.current = {
|
|
@@ -3479,30 +3476,30 @@ function Qe(e = {}) {
|
|
|
3479
3476
|
...o,
|
|
3480
3477
|
isReady: !0
|
|
3481
3478
|
})), a._formState.isReady = !0, n;
|
|
3482
|
-
}, [a]),
|
|
3479
|
+
}, [a]), Y.useEffect(() => a._disableForm(e.disabled), [a, e.disabled]), Y.useEffect(() => {
|
|
3483
3480
|
e.mode && (a._options.mode = e.mode), e.reValidateMode && (a._options.reValidateMode = e.reValidateMode);
|
|
3484
|
-
}, [a, e.mode, e.reValidateMode]),
|
|
3481
|
+
}, [a, e.mode, e.reValidateMode]), Y.useEffect(() => {
|
|
3485
3482
|
e.errors && (a._setErrors(e.errors), a._focusError());
|
|
3486
|
-
}, [a, e.errors]),
|
|
3483
|
+
}, [a, e.errors]), Y.useEffect(() => {
|
|
3487
3484
|
e.shouldUnregister && a._subjects.state.next({
|
|
3488
3485
|
values: a._getWatch()
|
|
3489
3486
|
});
|
|
3490
|
-
}, [a, e.shouldUnregister]),
|
|
3487
|
+
}, [a, e.shouldUnregister]), Y.useEffect(() => {
|
|
3491
3488
|
if (a._proxyFormState.isDirty) {
|
|
3492
3489
|
const n = a._getDirty();
|
|
3493
3490
|
n !== s.isDirty && a._subjects.state.next({
|
|
3494
3491
|
isDirty: n
|
|
3495
3492
|
});
|
|
3496
3493
|
}
|
|
3497
|
-
}, [a, s.isDirty]),
|
|
3494
|
+
}, [a, s.isDirty]), Y.useEffect(() => {
|
|
3498
3495
|
var n;
|
|
3499
|
-
e.values && !
|
|
3496
|
+
e.values && !we(e.values, t.current) ? (a._reset(e.values, {
|
|
3500
3497
|
keepFieldsRef: !0,
|
|
3501
3498
|
...a._options.resetOptions
|
|
3502
3499
|
}), !((n = a._options.resetOptions) === null || n === void 0) && n.keepIsValid || a._setValid(), t.current = e.values, i((o) => ({ ...o }))) : a._resetDefaultValues();
|
|
3503
|
-
}, [a, e.values]),
|
|
3500
|
+
}, [a, e.values]), Y.useEffect(() => {
|
|
3504
3501
|
a._state.mount || (a._setValid(), a._state.mount = !0), a._state.watch && (a._state.watch = !1, a._subjects.state.next({ ...a._formState })), a._removeUnmounted();
|
|
3505
|
-
}), r.current.formState =
|
|
3502
|
+
}), r.current.formState = Y.useMemo(() => vn(s, a), [a, s]), r.current;
|
|
3506
3503
|
}
|
|
3507
3504
|
const sr = (e, r, t) => {
|
|
3508
3505
|
if (e && "reportValidity" in e) {
|
|
@@ -3519,14 +3516,14 @@ const sr = (e, r, t) => {
|
|
|
3519
3516
|
const t = {};
|
|
3520
3517
|
for (const s in e) {
|
|
3521
3518
|
const i = _(r.fields, s), a = Object.assign(e[s] || {}, { ref: i && i.ref });
|
|
3522
|
-
if (
|
|
3519
|
+
if (Pn(r.names || Object.keys(e), s)) {
|
|
3523
3520
|
const n = Object.assign({}, _(t, s));
|
|
3524
|
-
|
|
3521
|
+
j(n, "root", a), j(t, s, n);
|
|
3525
3522
|
} else
|
|
3526
|
-
|
|
3523
|
+
j(t, s, a);
|
|
3527
3524
|
}
|
|
3528
3525
|
return t;
|
|
3529
|
-
},
|
|
3526
|
+
}, Pn = (e, r) => e.some((t) => t.startsWith(r + "."));
|
|
3530
3527
|
var et = function(e, r, t) {
|
|
3531
3528
|
return t === void 0 && (t = {}), function(s, i, a) {
|
|
3532
3529
|
try {
|
|
@@ -3534,10 +3531,10 @@ var et = function(e, r, t) {
|
|
|
3534
3531
|
return Promise.resolve(/* @__PURE__ */ Xs(e, s, Object.assign({}, r, { abortPipeEarly: !n }))).then(function(o) {
|
|
3535
3532
|
if (o.issues) {
|
|
3536
3533
|
for (var d = {}; o.issues.length; ) {
|
|
3537
|
-
var
|
|
3538
|
-
if (v && (d[v] || (d[v] = { message:
|
|
3539
|
-
var x = d[v].types,
|
|
3540
|
-
d[v] = Lr(v, n, d,
|
|
3534
|
+
var h = o.issues[0], v = /* @__PURE__ */ zs(h);
|
|
3535
|
+
if (v && (d[v] || (d[v] = { message: h.message, type: h.type }), n)) {
|
|
3536
|
+
var x = d[v].types, p = x && x[h.type];
|
|
3537
|
+
d[v] = Lr(v, n, d, h.type, p ? [].concat(p, h.message) : h.message);
|
|
3541
3538
|
}
|
|
3542
3539
|
o.issues.shift();
|
|
3543
3540
|
}
|
|
@@ -3550,22 +3547,22 @@ var et = function(e, r, t) {
|
|
|
3550
3547
|
}
|
|
3551
3548
|
};
|
|
3552
3549
|
};
|
|
3553
|
-
const nr = 27, ir = 12, ar = 10,
|
|
3550
|
+
const nr = 27, ir = 12, ar = 10, jn = De("enum"), $n = (e, r) => {
|
|
3554
3551
|
const t = {
|
|
3555
3552
|
min: e.minSelected ?? 0,
|
|
3556
3553
|
max: e.maxSelected ?? e.options.length
|
|
3557
3554
|
};
|
|
3558
|
-
return et(/* @__PURE__ */
|
|
3559
|
-
checked: /* @__PURE__ */
|
|
3555
|
+
return et(/* @__PURE__ */ be({
|
|
3556
|
+
checked: /* @__PURE__ */ _e(/* @__PURE__ */ Fr(/* @__PURE__ */ se(), /* @__PURE__ */ Cr()), /* @__PURE__ */ mt((s) => Object.entries(s).filter(([i, a]) => a).map(([i, a]) => i)), /* @__PURE__ */ $e(t.max, r("validation_multiple_choice_max", {
|
|
3560
3557
|
count: t.max
|
|
3561
|
-
})), /* @__PURE__ */
|
|
3558
|
+
})), /* @__PURE__ */ Ne(t.min, r("validation_multiple_choice_min", {
|
|
3562
3559
|
count: t.min
|
|
3563
3560
|
})))
|
|
3564
3561
|
}));
|
|
3565
|
-
}, qn =
|
|
3562
|
+
}, qn = pr(({
|
|
3566
3563
|
option: e,
|
|
3567
3564
|
...r
|
|
3568
|
-
}, t) => u(
|
|
3565
|
+
}, t) => u(ve, {
|
|
3569
3566
|
children: [u("input", {
|
|
3570
3567
|
class: "peer sr-only h-full",
|
|
3571
3568
|
type: "checkbox",
|
|
@@ -3590,9 +3587,9 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3590
3587
|
onSubmitSuccess: r
|
|
3591
3588
|
}) => {
|
|
3592
3589
|
var v, x;
|
|
3593
|
-
const t = e.key ? (v =
|
|
3590
|
+
const t = e.key ? (v = $.current$.value.flow) == null ? void 0 : v.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, {
|
|
3594
3591
|
t: a
|
|
3595
|
-
} =
|
|
3592
|
+
} = ne(), {
|
|
3596
3593
|
register: n,
|
|
3597
3594
|
handleSubmit: o,
|
|
3598
3595
|
formState: {
|
|
@@ -3600,10 +3597,10 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3600
3597
|
}
|
|
3601
3598
|
} = Qe({
|
|
3602
3599
|
defaultValues: {
|
|
3603
|
-
checked: s ? {} :
|
|
3600
|
+
checked: s ? {} : jn(t) ? Object.fromEntries(t.value.map((p) => [p, !0])) : {}
|
|
3604
3601
|
},
|
|
3605
3602
|
resolver: $n(e.config, a)
|
|
3606
|
-
}),
|
|
3603
|
+
}), h = bt();
|
|
3607
3604
|
return i ? u("ul", {
|
|
3608
3605
|
style: {
|
|
3609
3606
|
maxHeight: 6.5 * nr + 5 * ir + 2 * ar
|
|
@@ -3611,30 +3608,30 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3611
3608
|
class: or({
|
|
3612
3609
|
variant: "booleanLike"
|
|
3613
3610
|
}),
|
|
3614
|
-
children: e.config.options.map((
|
|
3611
|
+
children: e.config.options.map((p, m) => u("li", {
|
|
3615
3612
|
class: Er,
|
|
3616
3613
|
children: u(Mr, {
|
|
3617
3614
|
type: "submit",
|
|
3618
3615
|
ref: (k) => {
|
|
3619
|
-
k && m === 0 && (
|
|
3616
|
+
k && m === 0 && (h.current = k);
|
|
3620
3617
|
},
|
|
3621
|
-
label:
|
|
3618
|
+
label: p.label,
|
|
3622
3619
|
value: "true",
|
|
3623
3620
|
onClick: () => r({
|
|
3624
3621
|
type: "enum",
|
|
3625
|
-
value: [
|
|
3622
|
+
value: [p.value]
|
|
3626
3623
|
})
|
|
3627
3624
|
})
|
|
3628
|
-
},
|
|
3625
|
+
}, p.value))
|
|
3629
3626
|
}) : u("form", {
|
|
3630
3627
|
noValidate: !0,
|
|
3631
|
-
onSubmit: (
|
|
3628
|
+
onSubmit: (p) => o((m) => {
|
|
3632
3629
|
const k = m.checked;
|
|
3633
3630
|
r({
|
|
3634
3631
|
type: "enum",
|
|
3635
3632
|
value: k
|
|
3636
3633
|
});
|
|
3637
|
-
})(
|
|
3634
|
+
})(p),
|
|
3638
3635
|
children: [u("div", {
|
|
3639
3636
|
class: "flex items-center gap-1",
|
|
3640
3637
|
children: [u("ul", {
|
|
@@ -3644,31 +3641,31 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3644
3641
|
class: or({
|
|
3645
3642
|
variant: e.config.options.length === 1 ? "singleOption" : void 0
|
|
3646
3643
|
}),
|
|
3647
|
-
children: e.config.options.map((
|
|
3648
|
-
const k = `checked.${
|
|
3649
|
-
ref:
|
|
3650
|
-
...
|
|
3644
|
+
children: e.config.options.map((p, m) => {
|
|
3645
|
+
const k = `checked.${p.value}`, {
|
|
3646
|
+
ref: I,
|
|
3647
|
+
...V
|
|
3651
3648
|
} = n(k);
|
|
3652
3649
|
return u("li", {
|
|
3653
3650
|
class: "relative",
|
|
3654
3651
|
children: u(qn, {
|
|
3655
|
-
option:
|
|
3652
|
+
option: p,
|
|
3656
3653
|
autoFocus: m === 0,
|
|
3657
3654
|
ref: (N) => {
|
|
3658
|
-
N && m === 0 && (
|
|
3655
|
+
N && m === 0 && (h.current = N), I(N);
|
|
3659
3656
|
},
|
|
3660
3657
|
id: k,
|
|
3661
|
-
...
|
|
3658
|
+
...V,
|
|
3662
3659
|
onClick: s ? () => r({
|
|
3663
3660
|
type: "enum",
|
|
3664
|
-
value: [
|
|
3661
|
+
value: [p.value]
|
|
3665
3662
|
}) : void 0
|
|
3666
3663
|
})
|
|
3667
|
-
},
|
|
3664
|
+
}, p.value);
|
|
3668
3665
|
})
|
|
3669
3666
|
}), u("div", {
|
|
3670
3667
|
class: "flex flex-col items-center gap-2 pr-2.5 pt-2.5",
|
|
3671
|
-
children: [s ? null : u(
|
|
3668
|
+
children: [s ? null : u(Ve, {}), e.config.minSelected === 0 && u(Ae, {
|
|
3672
3669
|
class: "relative",
|
|
3673
3670
|
type: "button",
|
|
3674
3671
|
onClick: () => r({
|
|
@@ -3679,15 +3676,15 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3679
3676
|
})]
|
|
3680
3677
|
}), u("div", {
|
|
3681
3678
|
class: "px-1",
|
|
3682
|
-
children: u(
|
|
3679
|
+
children: u(Oe, {
|
|
3683
3680
|
error: (x = d.checked) == null ? void 0 : x.root
|
|
3684
3681
|
})
|
|
3685
3682
|
})]
|
|
3686
3683
|
});
|
|
3687
|
-
}, zn =
|
|
3684
|
+
}, zn = De("number"), Kn = (e, r) => {
|
|
3688
3685
|
const t = e.min ?? Number.MIN_SAFE_INTEGER, s = e.max ?? Number.MAX_SAFE_INTEGER, i = e.decimalCases ?? 0;
|
|
3689
|
-
return et(/* @__PURE__ */
|
|
3690
|
-
number: /* @__PURE__ */
|
|
3686
|
+
return et(/* @__PURE__ */ be({
|
|
3687
|
+
number: /* @__PURE__ */ _e(/* @__PURE__ */ Sr(r("validation_number")), /* @__PURE__ */ xr(t, r("validation_number_min", {
|
|
3691
3688
|
min: t
|
|
3692
3689
|
})), /* @__PURE__ */ vr(s, r("validation_number_max", {
|
|
3693
3690
|
max: s
|
|
@@ -3700,9 +3697,9 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3700
3697
|
onSubmitSuccess: r
|
|
3701
3698
|
}) => {
|
|
3702
3699
|
var x;
|
|
3703
|
-
const t = e.config.defaultValue, s = e.key ? (x =
|
|
3700
|
+
const t = e.config.defaultValue, s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, {
|
|
3704
3701
|
t: i
|
|
3705
|
-
} =
|
|
3702
|
+
} = ne(), {
|
|
3706
3703
|
register: a,
|
|
3707
3704
|
handleSubmit: n,
|
|
3708
3705
|
formState: {
|
|
@@ -3715,19 +3712,19 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3715
3712
|
resolver: Kn(e.config, i)
|
|
3716
3713
|
}), {
|
|
3717
3714
|
ref: d,
|
|
3718
|
-
...
|
|
3715
|
+
...h
|
|
3719
3716
|
} = a("number", {
|
|
3720
3717
|
required: !e.config.optional,
|
|
3721
3718
|
valueAsNumber: !0
|
|
3722
|
-
}), v =
|
|
3723
|
-
return
|
|
3719
|
+
}), v = fe();
|
|
3720
|
+
return ke(() => {
|
|
3724
3721
|
v.current && (v.current.focus(), v.current.select());
|
|
3725
3722
|
}, []), u("form", {
|
|
3726
3723
|
class: "flex flex-col gap-1 p-2.5",
|
|
3727
|
-
onSubmit: n((
|
|
3728
|
-
|
|
3724
|
+
onSubmit: n((p) => {
|
|
3725
|
+
p.number !== void 0 && r({
|
|
3729
3726
|
type: "number",
|
|
3730
|
-
value:
|
|
3727
|
+
value: p.number
|
|
3731
3728
|
});
|
|
3732
3729
|
}),
|
|
3733
3730
|
children: [u("div", {
|
|
@@ -3735,14 +3732,14 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3735
3732
|
children: [u("div", {
|
|
3736
3733
|
class: "relative min-w-0 flex-grow",
|
|
3737
3734
|
children: [u("input", {
|
|
3738
|
-
...
|
|
3735
|
+
...h,
|
|
3739
3736
|
id: "chat-input",
|
|
3740
3737
|
autocomplete: "off",
|
|
3741
3738
|
autoCapitalize: "off",
|
|
3742
3739
|
autoCorrect: "off",
|
|
3743
3740
|
autoFocus: !0,
|
|
3744
|
-
ref: (
|
|
3745
|
-
|
|
3741
|
+
ref: (p) => {
|
|
3742
|
+
p && (v.current = p), d(p);
|
|
3746
3743
|
},
|
|
3747
3744
|
type: "text",
|
|
3748
3745
|
min: e.config.min,
|
|
@@ -3752,12 +3749,12 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3752
3749
|
className: "[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"
|
|
3753
3750
|
}),
|
|
3754
3751
|
placeholder: e.config.placeholder
|
|
3755
|
-
}), e.config.optional && u(
|
|
3752
|
+
}), e.config.optional && u(Ae, {
|
|
3756
3753
|
class: "absolute bottom-0 right-0.5 top-0",
|
|
3757
3754
|
onClick: () => r(null)
|
|
3758
3755
|
})]
|
|
3759
|
-
}), u(
|
|
3760
|
-
}), u(
|
|
3756
|
+
}), u(Ve, {})]
|
|
3757
|
+
}), u(Oe, {
|
|
3761
3758
|
error: o.number
|
|
3762
3759
|
})]
|
|
3763
3760
|
});
|
|
@@ -3775,9 +3772,9 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3775
3772
|
countryCode: "",
|
|
3776
3773
|
phoneNumber: ""
|
|
3777
3774
|
};
|
|
3778
|
-
}, Hn = "44", Jn = /^[0-9 ]+$/, Zn =
|
|
3779
|
-
const r = /* @__PURE__ */
|
|
3780
|
-
return et(/* @__PURE__ */
|
|
3775
|
+
}, Hn = "44", Jn = /^[0-9 ]+$/, Zn = De("string"), Xn = De("phone"), Yn = (e) => {
|
|
3776
|
+
const r = /* @__PURE__ */ _e(/* @__PURE__ */ se(e("validation_country_code")), /* @__PURE__ */ yt(Jn, e("validation_country_code"))), t = /* @__PURE__ */ _e(/* @__PURE__ */ se(e("validation_phone")), /* @__PURE__ */ Ne(1, e("validation_phone")), /* @__PURE__ */ mt((s) => s.replace(/[^0-9]/g, "")));
|
|
3777
|
+
return et(/* @__PURE__ */ be({
|
|
3781
3778
|
countryCode: r,
|
|
3782
3779
|
phoneNumber: t
|
|
3783
3780
|
}));
|
|
@@ -3785,14 +3782,14 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3785
3782
|
input: e,
|
|
3786
3783
|
onSubmitSuccess: r
|
|
3787
3784
|
}) => {
|
|
3788
|
-
var
|
|
3789
|
-
const t = e.key ? (
|
|
3785
|
+
var I;
|
|
3786
|
+
const t = e.key ? (I = $.current$.value.flow) == null ? void 0 : I.data.submissions[e.key] : void 0, {
|
|
3790
3787
|
t: s
|
|
3791
|
-
} =
|
|
3788
|
+
} = ne(), [i, a] = Se(), n = Zn(t) ? Gn(t.value) : Xn(t) ? t.value : void 0, {
|
|
3792
3789
|
register: o,
|
|
3793
3790
|
handleSubmit: d,
|
|
3794
3791
|
formState: {
|
|
3795
|
-
errors:
|
|
3792
|
+
errors: h
|
|
3796
3793
|
},
|
|
3797
3794
|
watch: v
|
|
3798
3795
|
} = Qe({
|
|
@@ -3803,27 +3800,27 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3803
3800
|
resolver: Yn(s)
|
|
3804
3801
|
}), {
|
|
3805
3802
|
ref: x,
|
|
3806
|
-
...
|
|
3803
|
+
...p
|
|
3807
3804
|
} = o("phoneNumber", {
|
|
3808
3805
|
required: !e.config.optional
|
|
3809
|
-
}), m =
|
|
3810
|
-
return
|
|
3806
|
+
}), m = fe(), k = v("countryCode");
|
|
3807
|
+
return ke(() => {
|
|
3811
3808
|
m.current && (m.current.focus(), m.current.select());
|
|
3812
3809
|
}, []), u("form", {
|
|
3813
3810
|
noValidate: !0,
|
|
3814
3811
|
class: "flex flex-col gap-1 p-2.5",
|
|
3815
|
-
onSubmit: d((
|
|
3816
|
-
const N =
|
|
3812
|
+
onSubmit: d((V) => {
|
|
3813
|
+
const N = V.phoneNumber.replace(/[^0-9]/g, ""), y = V.countryCode.replace(/[^0-9]/g, "");
|
|
3817
3814
|
a(void 0);
|
|
3818
|
-
const C = e.config.minChars ?? 7,
|
|
3819
|
-
if (
|
|
3815
|
+
const C = e.config.minChars ?? 7, E = N.length + y.length;
|
|
3816
|
+
if (E < C)
|
|
3820
3817
|
return a(s("validation_phone_min_chars", {
|
|
3821
3818
|
count: C
|
|
3822
3819
|
}));
|
|
3823
|
-
const
|
|
3824
|
-
if (
|
|
3820
|
+
const A = e.config.maxChars;
|
|
3821
|
+
if (A != null && E > A)
|
|
3825
3822
|
return a(s("validation_max_chars", {
|
|
3826
|
-
count:
|
|
3823
|
+
count: A
|
|
3827
3824
|
}));
|
|
3828
3825
|
e.config.submissionFormat === "phone" ? r({
|
|
3829
3826
|
type: "phone",
|
|
@@ -3833,7 +3830,7 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3833
3830
|
}
|
|
3834
3831
|
}) : r({
|
|
3835
3832
|
type: "string",
|
|
3836
|
-
value: k +
|
|
3833
|
+
value: k + V.phoneNumber
|
|
3837
3834
|
});
|
|
3838
3835
|
}),
|
|
3839
3836
|
children: [u("div", {
|
|
@@ -3849,13 +3846,13 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3849
3846
|
...o("countryCode", {}),
|
|
3850
3847
|
id: `isdk_phone_${e.key}`,
|
|
3851
3848
|
class: "absolute inset-0 opacity-0",
|
|
3852
|
-
children: Object.entries(gt).map(([
|
|
3849
|
+
children: Object.entries(gt).map(([V, N]) => u("option", {
|
|
3853
3850
|
value: N,
|
|
3854
|
-
children: [
|
|
3855
|
-
},
|
|
3851
|
+
children: [V, " (+", N, ")"]
|
|
3852
|
+
}, V))
|
|
3856
3853
|
})]
|
|
3857
3854
|
}), u("input", {
|
|
3858
|
-
...
|
|
3855
|
+
...p,
|
|
3859
3856
|
id: "chat-input",
|
|
3860
3857
|
type: "tel",
|
|
3861
3858
|
inputMode: "tel",
|
|
@@ -3863,21 +3860,21 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3863
3860
|
autoCapitalize: "off",
|
|
3864
3861
|
autoCorrect: "off",
|
|
3865
3862
|
autoFocus: !0,
|
|
3866
|
-
ref: (
|
|
3867
|
-
|
|
3863
|
+
ref: (V) => {
|
|
3864
|
+
V && (m.current = V), x(V);
|
|
3868
3865
|
},
|
|
3869
3866
|
class: Ke({
|
|
3870
3867
|
optional: e.config.optional,
|
|
3871
3868
|
className: "min-w-0 flex-1 rounded-r-full"
|
|
3872
3869
|
}),
|
|
3873
3870
|
placeholder: e.config.placeholder
|
|
3874
|
-
}), e.config.optional && u(
|
|
3871
|
+
}), e.config.optional && u(Ae, {
|
|
3875
3872
|
class: "absolute bottom-0 right-1 top-0",
|
|
3876
3873
|
onClick: () => r(null)
|
|
3877
3874
|
})]
|
|
3878
|
-
}), u(
|
|
3879
|
-
}), u(
|
|
3880
|
-
error:
|
|
3875
|
+
}), u(Ve, {})]
|
|
3876
|
+
}), u(Oe, {
|
|
3877
|
+
error: h.countryCode || h.phoneNumber || {
|
|
3881
3878
|
message: i
|
|
3882
3879
|
}
|
|
3883
3880
|
})]
|
|
@@ -3933,7 +3930,7 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3933
3930
|
inputMode: "url",
|
|
3934
3931
|
formNoValidate: !0
|
|
3935
3932
|
}
|
|
3936
|
-
}, ri =
|
|
3933
|
+
}, ri = De("string"), si = (e, r) => {
|
|
3937
3934
|
const t = {
|
|
3938
3935
|
maxLength: r("validation_max_chars", {
|
|
3939
3936
|
count: e.maxChars ?? 999
|
|
@@ -3942,12 +3939,12 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3942
3939
|
count: e.minChars ?? 1
|
|
3943
3940
|
})
|
|
3944
3941
|
};
|
|
3945
|
-
return et(/* @__PURE__ */
|
|
3942
|
+
return et(/* @__PURE__ */ be({
|
|
3946
3943
|
text: {
|
|
3947
|
-
date: /* @__PURE__ */
|
|
3948
|
-
email: /* @__PURE__ */
|
|
3949
|
-
text: /* @__PURE__ */
|
|
3950
|
-
url: /* @__PURE__ */
|
|
3944
|
+
date: /* @__PURE__ */ _e(/* @__PURE__ */ se(r("validation_date")), /* @__PURE__ */ yt(/^\d{4}-\d{2}-\d{2}$/, r("validation_date"))),
|
|
3945
|
+
email: /* @__PURE__ */ _e(/* @__PURE__ */ se(r("validation_email")), /* @__PURE__ */ br(r("validation_email")), /* @__PURE__ */ Ne(e.minChars ?? 1, t.minLength), /* @__PURE__ */ $e(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3946
|
+
text: /* @__PURE__ */ _e(/* @__PURE__ */ se(), /* @__PURE__ */ Ne(e.minChars ?? 1, t.minLength), /* @__PURE__ */ $e(e.maxChars ?? 1 / 0, t.maxLength)),
|
|
3947
|
+
url: /* @__PURE__ */ _e(/* @__PURE__ */ se(r("validation_url")), /* @__PURE__ */ wr(r("validation_url")), /* @__PURE__ */ Ne(e.minChars ?? 1, t.minLength), /* @__PURE__ */ $e(e.maxChars ?? 1 / 0, t.maxLength))
|
|
3951
3948
|
}[e.format]
|
|
3952
3949
|
}));
|
|
3953
3950
|
}, ni = ({
|
|
@@ -3957,7 +3954,7 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3957
3954
|
var x;
|
|
3958
3955
|
const {
|
|
3959
3956
|
t
|
|
3960
|
-
} =
|
|
3957
|
+
} = ne(), s = e.key ? (x = $.current$.value.flow) == null ? void 0 : x.data.submissions[e.key] : void 0, i = e.config.defaultValue, {
|
|
3961
3958
|
register: a,
|
|
3962
3959
|
handleSubmit: n,
|
|
3963
3960
|
formState: {
|
|
@@ -3970,19 +3967,19 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3970
3967
|
resolver: si(e.config, t)
|
|
3971
3968
|
}), {
|
|
3972
3969
|
ref: d,
|
|
3973
|
-
...
|
|
3970
|
+
...h
|
|
3974
3971
|
} = a("text", {
|
|
3975
3972
|
required: !e.config.optional
|
|
3976
|
-
}), v =
|
|
3977
|
-
return
|
|
3973
|
+
}), v = fe();
|
|
3974
|
+
return ke(() => {
|
|
3978
3975
|
v.current && (v.current.focus(), v.current.select());
|
|
3979
3976
|
}, []), u("form", {
|
|
3980
3977
|
noValidate: !0,
|
|
3981
3978
|
class: "flex flex-col gap-1 p-2.5",
|
|
3982
|
-
onSubmit: n((
|
|
3979
|
+
onSubmit: n((p) => {
|
|
3983
3980
|
r({
|
|
3984
3981
|
type: "string",
|
|
3985
|
-
value:
|
|
3982
|
+
value: p.text
|
|
3986
3983
|
});
|
|
3987
3984
|
}),
|
|
3988
3985
|
children: [u("div", {
|
|
@@ -3991,26 +3988,26 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
3991
3988
|
class: "relative min-w-0 flex-1",
|
|
3992
3989
|
children: [u("input", {
|
|
3993
3990
|
id: "chat-input",
|
|
3994
|
-
...
|
|
3991
|
+
...h,
|
|
3995
3992
|
...ti[e.config.format],
|
|
3996
3993
|
autocomplete: "off",
|
|
3997
3994
|
autoCapitalize: "off",
|
|
3998
3995
|
autoCorrect: "off",
|
|
3999
3996
|
autoFocus: !0,
|
|
4000
|
-
ref: (
|
|
4001
|
-
|
|
3997
|
+
ref: (p) => {
|
|
3998
|
+
p && (v.current = p), d(p);
|
|
4002
3999
|
},
|
|
4003
4000
|
placeholder: e.config.placeholder,
|
|
4004
4001
|
class: Ke({
|
|
4005
4002
|
optional: !!e.config.optional,
|
|
4006
4003
|
className: "w-full rounded-full"
|
|
4007
4004
|
})
|
|
4008
|
-
}), e.config.optional && u(
|
|
4005
|
+
}), e.config.optional && u(Ae, {
|
|
4009
4006
|
class: "absolute bottom-0 right-0.5 top-0",
|
|
4010
4007
|
onClick: () => r(null)
|
|
4011
4008
|
})]
|
|
4012
|
-
}), u(
|
|
4013
|
-
}), u(
|
|
4009
|
+
}), u(Ve, {})]
|
|
4010
|
+
}), u(Oe, {
|
|
4014
4011
|
error: o.text
|
|
4015
4012
|
})]
|
|
4016
4013
|
});
|
|
@@ -4019,7 +4016,7 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
4019
4016
|
phone: Qn,
|
|
4020
4017
|
"multiple-choice": Un,
|
|
4021
4018
|
boolean: ln,
|
|
4022
|
-
file:
|
|
4019
|
+
file: pn,
|
|
4023
4020
|
submit: ei,
|
|
4024
4021
|
address: sn,
|
|
4025
4022
|
number: Wn
|
|
@@ -4027,8 +4024,8 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
4027
4024
|
logger: e
|
|
4028
4025
|
}) => {
|
|
4029
4026
|
var i;
|
|
4030
|
-
const r = (i =
|
|
4031
|
-
return
|
|
4027
|
+
const r = (i = $.current$.value.flow) == null ? void 0 : i.data.currentInput, t = fe(null), s = () => ae.onInteractionFn$.value();
|
|
4028
|
+
return ke(() => {
|
|
4032
4029
|
var a;
|
|
4033
4030
|
(a = t.current) == null || a.scrollTo({
|
|
4034
4031
|
top: 0
|
|
@@ -4044,7 +4041,7 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
4044
4041
|
const a = ii[r.type];
|
|
4045
4042
|
return u(a, {
|
|
4046
4043
|
logger: e,
|
|
4047
|
-
onSubmitSuccess:
|
|
4044
|
+
onSubmitSuccess: ae.onSubmitSuccessFn$.value,
|
|
4048
4045
|
input: r
|
|
4049
4046
|
});
|
|
4050
4047
|
})() : u("div", {
|
|
@@ -4057,7 +4054,7 @@ const nr = 27, ir = 12, ar = 10, Pn = Ne("enum"), $n = (e, r) => {
|
|
|
4057
4054
|
className: "flex-grow rounded-full"
|
|
4058
4055
|
}),
|
|
4059
4056
|
disabled: !0
|
|
4060
|
-
}), u(
|
|
4057
|
+
}), u(Ve, {
|
|
4061
4058
|
disabled: !0,
|
|
4062
4059
|
"aria-hidden": "true",
|
|
4063
4060
|
tabIndex: -1
|
|
@@ -4074,7 +4071,7 @@ var li = function(e) {
|
|
|
4074
4071
|
}, ui = function(r) {
|
|
4075
4072
|
var t = /[\\^$.*+?()[\]{}|]/g, s = RegExp(t.source);
|
|
4076
4073
|
return r && s.test(r) ? r.replace(t, "\\$&") : r;
|
|
4077
|
-
},
|
|
4074
|
+
}, jr = function(e) {
|
|
4078
4075
|
return typeof e == "string";
|
|
4079
4076
|
}, ci = function(e) {
|
|
4080
4077
|
var r = [];
|
|
@@ -4086,7 +4083,7 @@ function di(e, r, t) {
|
|
|
4086
4083
|
var s = 0, i = 0;
|
|
4087
4084
|
if (e === "")
|
|
4088
4085
|
return e;
|
|
4089
|
-
if (!e || !
|
|
4086
|
+
if (!e || !jr(e))
|
|
4090
4087
|
throw new TypeError("First argument to react-string-replace#replaceString must be a string");
|
|
4091
4088
|
var a = r;
|
|
4092
4089
|
li(a) || (a = new RegExp("(" + ui(a) + ")", "gi"));
|
|
@@ -4101,17 +4098,17 @@ function di(e, r, t) {
|
|
|
4101
4098
|
}
|
|
4102
4099
|
var fi = function(r, t, s) {
|
|
4103
4100
|
return Array.isArray(r) || (r = [r]), ci(r.map(function(i) {
|
|
4104
|
-
return
|
|
4101
|
+
return jr(i) ? di(i, t, s) : i;
|
|
4105
4102
|
}));
|
|
4106
4103
|
};
|
|
4107
|
-
const Be = /* @__PURE__ */ oi(fi),
|
|
4108
|
-
const r = Be(e,
|
|
4109
|
-
const [, d,
|
|
4110
|
-
return
|
|
4104
|
+
const Be = /* @__PURE__ */ oi(fi), pi = /(\[[^\]]+\]\([^)]+\))/g, hi = /\[([^\]]+)\]\(([^)]+)\)/, yi = /(https?:\/\/[^\s]+)/g, mi = /_(.*?)_/g, gi = /\*\*(.*?)\*\*/g, bi = /\\n|\n/g, lr = "text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline", vi = (e) => {
|
|
4105
|
+
const r = Be(e, pi, (n, o) => {
|
|
4106
|
+
const [, d, h] = n.match(hi) ?? [];
|
|
4107
|
+
return h ? u("a", {
|
|
4111
4108
|
class: lr,
|
|
4112
|
-
href:
|
|
4113
|
-
children: d ??
|
|
4114
|
-
},
|
|
4109
|
+
href: h,
|
|
4110
|
+
children: d ?? h
|
|
4111
|
+
}, h + o) : u("span", {
|
|
4115
4112
|
children: "INVALID LINK"
|
|
4116
4113
|
});
|
|
4117
4114
|
}), t = Be(r, yi, (n, o) => u("a", {
|
|
@@ -4184,9 +4181,9 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4184
4181
|
...r
|
|
4185
4182
|
}) => u("div", {
|
|
4186
4183
|
"aria-hidden": !0,
|
|
4187
|
-
children:
|
|
4184
|
+
children: ae.isBotTyping$.value === !0 ? u("div", {
|
|
4188
4185
|
"aria-label": "Typing…",
|
|
4189
|
-
class:
|
|
4186
|
+
class: Te("flex gap-1 p-4", e),
|
|
4190
4187
|
...r,
|
|
4191
4188
|
children: Array.from({
|
|
4192
4189
|
length: 3
|
|
@@ -4212,16 +4209,16 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4212
4209
|
}), Ii = ({
|
|
4213
4210
|
lastSentMessageFooter: e
|
|
4214
4211
|
}) => {
|
|
4215
|
-
const r =
|
|
4212
|
+
const r = $.current$.value.flow, t = (r == null ? void 0 : r.data.messages) ?? [], s = r ? pt(r) : void 0;
|
|
4216
4213
|
return u("ol", {
|
|
4217
4214
|
"aria-label": "Chat messages",
|
|
4218
4215
|
"aria-live": "polite",
|
|
4219
4216
|
class: "mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",
|
|
4220
|
-
children: [t.map((i, a) => u(
|
|
4217
|
+
children: [t.map((i, a) => u(ve, {
|
|
4221
4218
|
children: u("li", {
|
|
4222
4219
|
class: "flex",
|
|
4223
4220
|
tabIndex: a === t.length - 1 ? -1 : void 0,
|
|
4224
|
-
children: [s && i.groupId === s && !t.slice(a + 1).some((n) => n.groupId === s) ? e : null,
|
|
4221
|
+
children: [s && i.groupId === s && !t.slice(a + 1).some((n) => n.groupId === s) ? e : null, ls(i).with({
|
|
4225
4222
|
type: "system"
|
|
4226
4223
|
}, (n) => u("p", {
|
|
4227
4224
|
class: Si({
|
|
@@ -4230,10 +4227,10 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4230
4227
|
children: n.text
|
|
4231
4228
|
})).with({
|
|
4232
4229
|
type: "text",
|
|
4233
|
-
author:
|
|
4230
|
+
author: us.union("bot", "user")
|
|
4234
4231
|
}, (n) => {
|
|
4235
4232
|
const o = a === t.length - 1, d = n.author === "bot" ? vi(n.text) : n.text;
|
|
4236
|
-
return u(
|
|
4233
|
+
return u(ve, {
|
|
4237
4234
|
children: u(wi, {
|
|
4238
4235
|
animate: o,
|
|
4239
4236
|
side: Ci[n.author],
|
|
@@ -4264,9 +4261,9 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4264
4261
|
type: "loading"
|
|
4265
4262
|
}, (n) => {
|
|
4266
4263
|
const o = t[t.length - 1];
|
|
4267
|
-
return !(n === o) ||
|
|
4264
|
+
return !(n === o) || ae.isBotTyping$.value ? null : u("div", {
|
|
4268
4265
|
class: "flex flex-grow flex-col items-center justify-center gap-2",
|
|
4269
|
-
children: [u(
|
|
4266
|
+
children: [u(ht, {
|
|
4270
4267
|
"aria-hidden": n.text ? "true" : void 0,
|
|
4271
4268
|
class: "text-neutral-6 h-8 w-8"
|
|
4272
4269
|
}), n.text ? u("p", {
|
|
@@ -4287,37 +4284,37 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4287
4284
|
}) => {
|
|
4288
4285
|
const {
|
|
4289
4286
|
flow: i
|
|
4290
|
-
} =
|
|
4291
|
-
|
|
4292
|
-
const a =
|
|
4287
|
+
} = $.current$.value;
|
|
4288
|
+
Fe(i, "Flow is required to exist to show chatbot body");
|
|
4289
|
+
const a = $.viewState$.value, {
|
|
4293
4290
|
chatRef: n,
|
|
4294
4291
|
chatService: o
|
|
4295
|
-
} =
|
|
4292
|
+
} = cs(), {
|
|
4296
4293
|
t: d
|
|
4297
|
-
} =
|
|
4298
|
-
return
|
|
4299
|
-
a === "maximised" &&
|
|
4300
|
-
}, [a]),
|
|
4294
|
+
} = ne(), [h, v] = Se();
|
|
4295
|
+
return ke(() => {
|
|
4296
|
+
a === "maximised" && ae.scrollToEnd();
|
|
4297
|
+
}, [a]), ke(() => {
|
|
4301
4298
|
var y;
|
|
4302
4299
|
const {
|
|
4303
4300
|
state: x,
|
|
4304
|
-
flow:
|
|
4305
|
-
} =
|
|
4301
|
+
flow: p
|
|
4302
|
+
} = $.current$.peek();
|
|
4306
4303
|
if (x !== "loaded")
|
|
4307
4304
|
throw new Error(d("invalid_state"));
|
|
4308
|
-
let m =
|
|
4309
|
-
if (
|
|
4305
|
+
let m = p.data.nodeHistory.at(-1);
|
|
4306
|
+
if (ae.scrollToEnd(), $.setInput(void 0), p.data.isFinished)
|
|
4310
4307
|
return;
|
|
4311
4308
|
const k = () => {
|
|
4312
|
-
const C =
|
|
4313
|
-
!C || C.data.hasInteracted || (
|
|
4309
|
+
const C = $.current$.peek().flow;
|
|
4310
|
+
!C || C.data.hasInteracted || ($.markAsInteracted(), Ot(t, C, "FLOW_INTERACT"));
|
|
4314
4311
|
};
|
|
4315
|
-
|
|
4312
|
+
ae.onInteractionFn$.value = k, m === void 0 ? (m = dr(i.nodes).id, $.setCurrentNodeId(m), Ot(t, p, "FLOW_START")) : $.removeMessagesSentByNodeIds([m]);
|
|
4316
4313
|
const {
|
|
4317
|
-
interpret:
|
|
4318
|
-
abort:
|
|
4314
|
+
interpret: I,
|
|
4315
|
+
abort: V,
|
|
4319
4316
|
undo: N
|
|
4320
|
-
} =
|
|
4317
|
+
} = bs({
|
|
4321
4318
|
context: i.context,
|
|
4322
4319
|
analytics: {
|
|
4323
4320
|
service: t,
|
|
@@ -4331,21 +4328,21 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4331
4328
|
t: d,
|
|
4332
4329
|
getApplicationRecovery: () => {
|
|
4333
4330
|
var C;
|
|
4334
|
-
return (C =
|
|
4331
|
+
return (C = $.current$.peek().flow) == null ? void 0 : C.data.applicationRecovery;
|
|
4335
4332
|
},
|
|
4336
|
-
setApplicationRecovery:
|
|
4337
|
-
persistWriteBarrier: () =>
|
|
4333
|
+
setApplicationRecovery: $.setApplicationRecovery,
|
|
4334
|
+
persistWriteBarrier: () => $.persistWriteBarrier(p),
|
|
4338
4335
|
// We need to get fresh submissions, that’s why we call `peek` here.
|
|
4339
4336
|
getSubmissions: () => {
|
|
4340
4337
|
var C;
|
|
4341
|
-
return (C =
|
|
4338
|
+
return (C = $.current$.peek().flow) == null ? void 0 : C.data.submissions;
|
|
4342
4339
|
},
|
|
4343
|
-
onInterpret: (C) =>
|
|
4340
|
+
onInterpret: (C) => $.setCurrentNodeId(C.id),
|
|
4344
4341
|
onFlowEnd: async () => {
|
|
4345
|
-
var
|
|
4346
|
-
|
|
4347
|
-
const C =
|
|
4348
|
-
|
|
4342
|
+
var E;
|
|
4343
|
+
$.markAsFinished();
|
|
4344
|
+
const C = $.current$.peek().flow;
|
|
4345
|
+
Fe(C), t.log({
|
|
4349
4346
|
event: "FLOW_END",
|
|
4350
4347
|
properties: {
|
|
4351
4348
|
flow_id: i.id,
|
|
@@ -4354,15 +4351,15 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4354
4351
|
flow_build: i.build,
|
|
4355
4352
|
job: i.job
|
|
4356
4353
|
},
|
|
4357
|
-
customProperties: (
|
|
4354
|
+
customProperties: (E = i.analytics) == null ? void 0 : E.customProperties
|
|
4358
4355
|
});
|
|
4359
4356
|
}
|
|
4360
4357
|
});
|
|
4361
|
-
return v(() => N),
|
|
4362
|
-
|
|
4363
|
-
}),
|
|
4358
|
+
return v(() => N), I(m), () => {
|
|
4359
|
+
ae.onInteractionFn$.value === k && (ae.onInteractionFn$.value = () => {
|
|
4360
|
+
}), V();
|
|
4364
4361
|
};
|
|
4365
|
-
}, [t, r, o, e, i, s, d]), u(
|
|
4362
|
+
}, [t, r, o, e, i, s, d]), u(ve, {
|
|
4366
4363
|
children: [u("div", {
|
|
4367
4364
|
class: "relative flex min-h-0 w-full max-w-full flex-grow flex-col",
|
|
4368
4365
|
children: [u("div", {
|
|
@@ -4375,34 +4372,34 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4375
4372
|
WebkitOverflowScrolling: "touch"
|
|
4376
4373
|
},
|
|
4377
4374
|
children: u(Ii, {
|
|
4378
|
-
lastSentMessageFooter: !
|
|
4379
|
-
undoFn:
|
|
4375
|
+
lastSentMessageFooter: !pt(i) || !h ? null : u(Fi, {
|
|
4376
|
+
undoFn: h
|
|
4380
4377
|
})
|
|
4381
4378
|
})
|
|
4382
|
-
}),
|
|
4379
|
+
}), ae.isReadingHistory$.value && !i.data.isFinished && !ae.isBotTyping$.value && u("div", {
|
|
4383
4380
|
class: "absolute bottom-2 left-1/2 -translate-x-1/2",
|
|
4384
4381
|
children: u(hr, {
|
|
4385
4382
|
class: "bg-neutral-1 ring-divider shadow-surface-md ring-1",
|
|
4386
4383
|
"aria-label": d("jump_to_current"),
|
|
4387
4384
|
onClick: () => {
|
|
4388
|
-
var
|
|
4389
|
-
|
|
4385
|
+
var p, m;
|
|
4386
|
+
ae.scrollToEnd(), (m = ((p = n.current) == null ? void 0 : p.querySelector('li[tabindex="-1"]')) ?? n.current) == null || m.focus({
|
|
4390
4387
|
preventScroll: !0
|
|
4391
4388
|
});
|
|
4392
4389
|
},
|
|
4393
|
-
children: u(
|
|
4390
|
+
children: u(ds, {})
|
|
4394
4391
|
})
|
|
4395
4392
|
})]
|
|
4396
4393
|
}), u(ai, {
|
|
4397
4394
|
logger: e
|
|
4398
4395
|
})]
|
|
4399
4396
|
});
|
|
4400
|
-
},
|
|
4397
|
+
}, Fi = ({
|
|
4401
4398
|
undoFn: e
|
|
4402
4399
|
}) => {
|
|
4403
4400
|
const {
|
|
4404
4401
|
t: r
|
|
4405
|
-
} =
|
|
4402
|
+
} = ne();
|
|
4406
4403
|
return u("div", {
|
|
4407
4404
|
class: "flex flex-1 items-center justify-end px-1",
|
|
4408
4405
|
children: u(hr, {
|
|
@@ -4410,8 +4407,8 @@ const Be = /* @__PURE__ */ oi(fi), hi = /(\[[^\]]+\]\([^)]+\))/g, pi = /\[([^\]]
|
|
|
4410
4407
|
onClick: async () => {
|
|
4411
4408
|
const {
|
|
4412
4409
|
flow: t
|
|
4413
|
-
} =
|
|
4414
|
-
|
|
4410
|
+
} = $.current$.peek();
|
|
4411
|
+
Fe(t), e(t.data.nodeHistory);
|
|
4415
4412
|
},
|
|
4416
4413
|
children: u("path", {
|
|
4417
4414
|
d: "M3 13h2.67l6.66-6.67a1.9 1.9 0 0 0 0-2.66 1.91 1.91 0 0 0-2.66 0L3 10.33V13Zm4.6-7.25 2.67 2.67"
|