@verbb/formie-browser 1.0.7 → 1.0.8
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/CHANGELOG.md +12 -0
- package/dist/chunks/_survey-presentations-CFsgToRT.js +4 -0
- package/dist/chunks/{api-DztsCJ4r.js → api-C8wyLC-s.js} +184 -150
- package/dist/chunks/{bpoint-2qDxlKD9.js → bpoint-CwSw_p7A.js} +1 -1
- package/dist/chunks/{eway-CImXrB4g.js → eway-B30BMlDp.js} +1 -1
- package/dist/chunks/{go-cardless-Bz7HHtH0.js → go-cardless-BiF3iLel.js} +1 -1
- package/dist/chunks/{mollie-BtnB3KGh.js → mollie-D__SwtcH.js} +1 -1
- package/dist/chunks/{moneris-Bd4vUk8b.js → moneris-KJS1BKx7.js} +1 -1
- package/dist/chunks/{opayo-B-eRIXo-.js → opayo-A_LIkc-v.js} +1 -1
- package/dist/chunks/{paddle-BUFeEU4d.js → paddle-BjbOOb0m.js} +1 -1
- package/dist/chunks/{paypal-8Euw7Hrn.js → paypal-CyjHIV8v.js} +1 -1
- package/dist/chunks/{payway-dV0SzJxy.js → payway-a_cyrr3j.js} +1 -1
- package/dist/chunks/{square-reyJukb7.js → square-Bga6WXHV.js} +1 -1
- package/dist/chunks/{stripe-BC-2PBvY.js → stripe-BlqVocl3.js} +1 -1
- package/dist/chunks/{summary-D3AjxpYN.js → summary-Dks0gXS3.js} +42 -38
- package/dist/chunks/survey-likert-DmJ3klhP.js +20 -0
- package/dist/chunks/survey-rank-DeUenftw.js +127 -0
- package/dist/chunks/survey-rating-BPUYDgBJ.js +88 -0
- package/dist/css/formie-theme.css +1 -0
- package/dist/css/theme/fields/_survey-presentations.css +396 -0
- package/dist/index.js +469 -465
- package/dist/js/contracts/schema.d.ts +5 -0
- package/dist/js/contracts/schema.d.ts.map +1 -1
- package/dist/js/core/create-formie-client.d.ts.map +1 -1
- package/dist/js/core/page-client-event.d.ts +8 -4
- package/dist/js/core/page-client-event.d.ts.map +1 -1
- package/dist/js/core/submit-result-state.d.ts.map +1 -1
- package/dist/js/modules/fields/index.d.ts.map +1 -1
- package/dist/js/modules/fields/summary.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-likert.d.ts +3 -0
- package/dist/js/modules/fields/survey-likert.d.ts.map +1 -0
- package/dist/js/modules/fields/survey-rank.d.ts +3 -0
- package/dist/js/modules/fields/survey-rank.d.ts.map +1 -0
- package/dist/js/modules/fields/survey-rating.d.ts +3 -0
- package/dist/js/modules/fields/survey-rating.d.ts.map +1 -0
- package/dist/js/transport/forms-api.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/css/formie-theme.css +1 -0
- package/src/css/theme/fields/_survey-presentations.css +396 -0
- package/src/js/contracts/schema.ts +6 -0
- package/src/js/core/create-formie-client.ts +14 -1
- package/src/js/core/page-client-event.ts +86 -18
- package/src/js/core/submit-result-state.ts +6 -2
- package/src/js/modules/fields/index.ts +3 -0
- package/src/js/modules/fields/summary.ts +17 -3
- package/src/js/modules/fields/survey-likert.ts +50 -0
- package/src/js/modules/fields/survey-rank.ts +385 -0
- package/src/js/modules/fields/survey-rating.ts +182 -0
- package/src/js/transport/forms-api.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { c as e, d as t, l as n, o as r, r as i, t as a, u as o } from "./chunks/event-names-BCI2FLD8.js";
|
|
2
|
-
import { a as s, c, d as l, f as u, i as d, l as f, n as p, o as m,
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as te, r as
|
|
5
|
-
import { t as
|
|
6
|
-
import { a as
|
|
2
|
+
import { a as s, c, d as l, f as u, i as d, l as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y } from "./chunks/api-C8wyLC-s.js";
|
|
3
|
+
import { a as b, i as x, n as S, r as ee, t as C } from "./chunks/debug-BV0DvdHx.js";
|
|
4
|
+
import { n as te, r as w, t as T } from "./chunks/theme-classes-Tv7q7ToE.js";
|
|
5
|
+
import { t as E } from "./chunks/http-D-JExro7.js";
|
|
6
|
+
import { a as D, i as O, n as ne, r as re, t as ie } from "./chunks/i18n-BY1ds1BL.js";
|
|
7
7
|
import { n as ae, t as oe } from "./chunks/api-BUb6P-xu.js";
|
|
8
8
|
import { n as se, r as ce, t as le } from "./chunks/field-references.keys-58ZSTrCW.js";
|
|
9
9
|
import { i as ue, n as de, r as fe, t as pe } from "./chunks/field-references.resolver-CHwn0G0L.js";
|
|
@@ -149,13 +149,13 @@ function Se({ target: e, form: n, instance: r, options: i, unbinds: a }) {
|
|
|
149
149
|
}
|
|
150
150
|
//#endregion
|
|
151
151
|
//#region src/js/compatibility/validator-adapter.ts
|
|
152
|
-
function
|
|
152
|
+
function k(e, t, n) {
|
|
153
153
|
e.dispatchEvent(new CustomEvent(t, {
|
|
154
154
|
bubbles: !0,
|
|
155
155
|
detail: n
|
|
156
156
|
}));
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function A(e, t) {
|
|
159
159
|
return !!e && typeof e == "object" && e.validator === t;
|
|
160
160
|
}
|
|
161
161
|
function Ce({ target: e, form: t, validatorDetail: n, options: r, unbinds: i }) {
|
|
@@ -165,14 +165,14 @@ function Ce({ target: e, form: t, validatorDetail: n, options: r, unbinds: i })
|
|
|
165
165
|
form: t,
|
|
166
166
|
target: e
|
|
167
167
|
};
|
|
168
|
-
|
|
168
|
+
k(document, "formieValidatorInitialized", c);
|
|
169
169
|
let l = (e) => {
|
|
170
|
-
!(e instanceof CustomEvent) || !
|
|
170
|
+
!(e instanceof CustomEvent) || !A(e.detail, a) || k(document, "formieValidatorDestroyed", {
|
|
171
171
|
...c,
|
|
172
172
|
...e.detail
|
|
173
173
|
});
|
|
174
174
|
}, u = (n) => {
|
|
175
|
-
!(n instanceof CustomEvent) || !
|
|
175
|
+
!(n instanceof CustomEvent) || !A(n.detail, a) || !(n.target instanceof Element) || t.contains(n.target) && k(n.target, "formieValidatorShowError", {
|
|
176
176
|
...n.detail,
|
|
177
177
|
addValidator: o,
|
|
178
178
|
removeValidator: s,
|
|
@@ -180,7 +180,7 @@ function Ce({ target: e, form: t, validatorDetail: n, options: r, unbinds: i })
|
|
|
180
180
|
target: e
|
|
181
181
|
});
|
|
182
182
|
}, d = (n) => {
|
|
183
|
-
!(n instanceof CustomEvent) || !
|
|
183
|
+
!(n instanceof CustomEvent) || !A(n.detail, a) || !(n.target instanceof Element) || t.contains(n.target) && k(n.target, "formieValidatorClearError", {
|
|
184
184
|
...n.detail,
|
|
185
185
|
addValidator: o,
|
|
186
186
|
removeValidator: s,
|
|
@@ -230,11 +230,11 @@ function Me(e) {
|
|
|
230
230
|
e.querySelectorAll("[data-formie-field-handle]").forEach((t) => {
|
|
231
231
|
let n = t;
|
|
232
232
|
if (!(n.getAttribute("data-formie-field-has-error") === "true" || n.querySelector("[data-formie-field-error]") !== null)) return;
|
|
233
|
-
n.setAttribute("data-formie-field-has-error", "true"),
|
|
233
|
+
n.setAttribute("data-formie-field-has-error", "true"), T(n, e, "fieldLayoutError");
|
|
234
234
|
let r = n.querySelector("[data-formie-field-errors]")?.id || "", i = n.querySelector("[data-formie-field-error]")?.id || "";
|
|
235
235
|
n.querySelectorAll("input, select, textarea").forEach((t) => {
|
|
236
236
|
let n = t;
|
|
237
|
-
n.setAttribute("aria-invalid", "true"),
|
|
237
|
+
n.setAttribute("aria-invalid", "true"), T(n, e, "fieldControlError"), n.setAttribute("data-formie-input-has-error", "true"), r && Oe(n, r), i && n.setAttribute("aria-errormessage", i);
|
|
238
238
|
});
|
|
239
239
|
});
|
|
240
240
|
}
|
|
@@ -325,7 +325,7 @@ var Fe = class {
|
|
|
325
325
|
clear() {
|
|
326
326
|
this.listeners.clear();
|
|
327
327
|
}
|
|
328
|
-
},
|
|
328
|
+
}, j = C("general", "transport");
|
|
329
329
|
function Ie(e) {
|
|
330
330
|
let t = {};
|
|
331
331
|
return [
|
|
@@ -368,6 +368,7 @@ function Re(e, t) {
|
|
|
368
368
|
target: e.submitActionTab === "new-tab" ? "new-tab" : "same-tab"
|
|
369
369
|
} : null,
|
|
370
370
|
submitData: Array.isArray(e.submitData) ? e.submitData : void 0,
|
|
371
|
+
clientEvents: Array.isArray(e.clientEvents) ? e.clientEvents : void 0,
|
|
371
372
|
meta: e
|
|
372
373
|
};
|
|
373
374
|
}
|
|
@@ -376,16 +377,16 @@ async function ze(e, t, n = {}) {
|
|
|
376
377
|
handle: t,
|
|
377
378
|
renderOptions: n
|
|
378
379
|
});
|
|
379
|
-
|
|
380
|
+
j.log("requestRender start.", {
|
|
380
381
|
endpoint: e,
|
|
381
382
|
handle: t
|
|
382
383
|
});
|
|
383
|
-
let i = await
|
|
384
|
+
let i = await E(e, {
|
|
384
385
|
method: "POST",
|
|
385
386
|
body: r,
|
|
386
387
|
headers: { "Content-Type": "application/json" }
|
|
387
388
|
});
|
|
388
|
-
return
|
|
389
|
+
return j.log("requestRender complete.", { hasHtml: !!i.html }), i;
|
|
389
390
|
}
|
|
390
391
|
async function Be(e, t, n = {}) {
|
|
391
392
|
let r = JSON.stringify({
|
|
@@ -395,11 +396,11 @@ async function Be(e, t, n = {}) {
|
|
|
395
396
|
input: Ie(n)
|
|
396
397
|
}
|
|
397
398
|
});
|
|
398
|
-
|
|
399
|
+
j.log("requestGraphqlRender start.", {
|
|
399
400
|
endpoint: e,
|
|
400
401
|
handle: t
|
|
401
402
|
});
|
|
402
|
-
let i = await
|
|
403
|
+
let i = await E(e, {
|
|
403
404
|
method: "POST",
|
|
404
405
|
body: r,
|
|
405
406
|
headers: { "Content-Type": "application/json" }
|
|
@@ -407,19 +408,19 @@ async function Be(e, t, n = {}) {
|
|
|
407
408
|
if (Array.isArray(i.errors) && i.errors.length > 0) throw Error(i.errors.map((e) => e.message || "Unknown GraphQL error").join("; "));
|
|
408
409
|
if (!i.data?.formieHtmlForm) throw Error(`Form not found for handle "${t}".`);
|
|
409
410
|
let a = i.data.formieHtmlForm;
|
|
410
|
-
return
|
|
411
|
+
return j.log("requestGraphqlRender complete.", { hasHtml: !!a.html }), a;
|
|
411
412
|
}
|
|
412
|
-
async function
|
|
413
|
+
async function M(e, t, n) {
|
|
413
414
|
let r = new URL(e, window.location.origin);
|
|
414
|
-
r.searchParams.set("handle", t), n && r.searchParams.set("renderId", n),
|
|
415
|
+
r.searchParams.set("handle", t), n && r.searchParams.set("renderId", n), j.log("requestRefreshTokens start.", {
|
|
415
416
|
endpoint: r.toString(),
|
|
416
417
|
handle: t,
|
|
417
418
|
hasRenderId: !!n
|
|
418
419
|
});
|
|
419
|
-
let i = await
|
|
420
|
-
return
|
|
420
|
+
let i = await E(r.toString());
|
|
421
|
+
return j.log("requestRefreshTokens complete.", { hasRefreshTokens: !!i.refreshTokens }), i.refreshTokens || i;
|
|
421
422
|
}
|
|
422
|
-
async function
|
|
423
|
+
async function Ve(e, t, n) {
|
|
423
424
|
let r = new URL(e, window.location.origin), i = new FormData();
|
|
424
425
|
if (n && i.append("pageId", n), t) {
|
|
425
426
|
[
|
|
@@ -435,17 +436,17 @@ async function He(e, t, n) {
|
|
|
435
436
|
let e = t.querySelector("input[name=\"CRAFT_CSRF_TOKEN\"]")?.value?.trim();
|
|
436
437
|
e && i.append("CRAFT_CSRF_TOKEN", e);
|
|
437
438
|
}
|
|
438
|
-
|
|
439
|
+
j.log("requestSetPage start.", {
|
|
439
440
|
requestUrl: r.toString(),
|
|
440
441
|
pageId: n || null
|
|
441
442
|
});
|
|
442
|
-
let a = await
|
|
443
|
+
let a = await E(r.toString(), {
|
|
443
444
|
method: "POST",
|
|
444
445
|
body: i
|
|
445
446
|
});
|
|
446
|
-
return
|
|
447
|
+
return j.log("requestSetPage complete.", a), a;
|
|
447
448
|
}
|
|
448
|
-
function
|
|
449
|
+
function He(e, t) {
|
|
449
450
|
let n = new URL(e, window.location.origin), r = new FormData();
|
|
450
451
|
[
|
|
451
452
|
"handle",
|
|
@@ -457,7 +458,7 @@ function Ue(e, t) {
|
|
|
457
458
|
n && r.append(e, n);
|
|
458
459
|
});
|
|
459
460
|
let i = t.querySelector("input[name=\"CRAFT_CSRF_TOKEN\"]")?.value?.trim();
|
|
460
|
-
i && r.append("CRAFT_CSRF_TOKEN", i),
|
|
461
|
+
i && r.append("CRAFT_CSRF_TOKEN", i), j.log("clearSubmissionOnUnload start.", { requestUrl: n.toString() });
|
|
461
462
|
try {
|
|
462
463
|
if (typeof navigator.sendBeacon == "function" && navigator.sendBeacon(n.toString(), r)) return;
|
|
463
464
|
} catch {}
|
|
@@ -469,9 +470,9 @@ function Ue(e, t) {
|
|
|
469
470
|
headers: { Accept: "application/json" }
|
|
470
471
|
});
|
|
471
472
|
}
|
|
472
|
-
async function
|
|
473
|
+
async function Ue(e, t) {
|
|
473
474
|
let n = (e.getAttribute("method") || "POST").toUpperCase(), r = e.getAttribute("action") || window.location.href, i = e.dataset.formieErrorMessage?.trim() || "Submission failed.";
|
|
474
|
-
|
|
475
|
+
j.log("submitForm start.", {
|
|
475
476
|
method: n,
|
|
476
477
|
action: r,
|
|
477
478
|
submitAction: t.get("submitAction")
|
|
@@ -482,13 +483,13 @@ async function We(e, t) {
|
|
|
482
483
|
credentials: "include",
|
|
483
484
|
headers: { Accept: "application/json" }
|
|
484
485
|
}), o = a.headers.get("content-type") || "";
|
|
485
|
-
if (!o.includes("application/json")) return a.ok ? (
|
|
486
|
+
if (!o.includes("application/json")) return a.ok ? (j.log("submitForm non-JSON success response.", {
|
|
486
487
|
status: a.status,
|
|
487
488
|
contentType: o
|
|
488
489
|
}), {
|
|
489
490
|
ok: !0,
|
|
490
491
|
message: "Submission completed."
|
|
491
|
-
}) : (
|
|
492
|
+
}) : (j.warn("submitForm non-JSON HTTP error.", {
|
|
492
493
|
status: a.status,
|
|
493
494
|
contentType: o
|
|
494
495
|
}), {
|
|
@@ -498,7 +499,7 @@ async function We(e, t) {
|
|
|
498
499
|
formErrors: [`Request failed (${a.status}).`]
|
|
499
500
|
});
|
|
500
501
|
let s = Re(await a.json(), i);
|
|
501
|
-
return
|
|
502
|
+
return j.log("submitForm JSON response normalized.", {
|
|
502
503
|
ok: s.ok,
|
|
503
504
|
code: s.code,
|
|
504
505
|
hasRedirect: !!s.redirect?.url,
|
|
@@ -507,7 +508,7 @@ async function We(e, t) {
|
|
|
507
508
|
}
|
|
508
509
|
//#endregion
|
|
509
510
|
//#region src/js/submit/pipeline.ts
|
|
510
|
-
var
|
|
511
|
+
var We = [
|
|
511
512
|
"prepare",
|
|
512
513
|
"normalize",
|
|
513
514
|
"validate",
|
|
@@ -515,14 +516,14 @@ var Ge = [
|
|
|
515
516
|
"authorize",
|
|
516
517
|
"dispatch",
|
|
517
518
|
"finalize"
|
|
518
|
-
],
|
|
519
|
+
], Ge = [
|
|
519
520
|
"prepare",
|
|
520
521
|
"normalize",
|
|
521
522
|
"validate",
|
|
522
523
|
"screen",
|
|
523
524
|
"authorize"
|
|
524
|
-
],
|
|
525
|
-
function
|
|
525
|
+
], N = C("general", "pipeline");
|
|
526
|
+
function Ke(e, t) {
|
|
526
527
|
return {
|
|
527
528
|
ok: !1,
|
|
528
529
|
stage: e,
|
|
@@ -531,13 +532,13 @@ function qe(e, t) {
|
|
|
531
532
|
formErrors: [t || "Submission aborted."]
|
|
532
533
|
};
|
|
533
534
|
}
|
|
534
|
-
function
|
|
535
|
+
function qe(e) {
|
|
535
536
|
return e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement;
|
|
536
537
|
}
|
|
537
|
-
function
|
|
538
|
+
function Je(e) {
|
|
538
539
|
return !(!e.name || e.disabled || e instanceof HTMLInputElement && (e.type === "submit" || e.type === "button" || e.type === "reset" || e.type === "image" || (e.type === "checkbox" || e.type === "radio") && !e.checked || e.type === "file" && (!e.files || e.files.length === 0)));
|
|
539
540
|
}
|
|
540
|
-
function
|
|
541
|
+
function Ye(e, t) {
|
|
541
542
|
if (t instanceof HTMLInputElement) {
|
|
542
543
|
if (t.type === "file") {
|
|
543
544
|
Array.from(t.files || []).forEach((n) => {
|
|
@@ -556,49 +557,49 @@ function Xe(e, t) {
|
|
|
556
557
|
}
|
|
557
558
|
e.append(t.name, t.value);
|
|
558
559
|
}
|
|
559
|
-
function
|
|
560
|
+
function Xe(e, t) {
|
|
560
561
|
t.querySelectorAll("input, select, textarea").forEach((t) => {
|
|
561
|
-
let n =
|
|
562
|
-
!n || n.closest("[data-formie-page]") ||
|
|
562
|
+
let n = qe(t) ? t : null;
|
|
563
|
+
!n || n.closest("[data-formie-page]") || Je(n) && Ye(e, n);
|
|
563
564
|
});
|
|
564
565
|
}
|
|
565
|
-
function
|
|
566
|
+
function Ze(e, t) {
|
|
566
567
|
let n = /* @__PURE__ */ new Set();
|
|
567
568
|
return t.querySelectorAll("input, select, textarea").forEach((t) => {
|
|
568
|
-
let r =
|
|
569
|
-
!r || !r.name || r.disabled || r instanceof HTMLInputElement && (r.type === "submit" || r.type === "button" || r.type === "reset" || r.type === "image") || (r.name.startsWith("fields[") && n.add(r.name),
|
|
569
|
+
let r = qe(t) ? t : null;
|
|
570
|
+
!r || !r.name || r.disabled || r instanceof HTMLInputElement && (r.type === "submit" || r.type === "button" || r.type === "reset" || r.type === "image") || (r.name.startsWith("fields[") && n.add(r.name), Je(r) && Ye(e, r));
|
|
570
571
|
}), n;
|
|
571
572
|
}
|
|
572
|
-
function
|
|
573
|
+
function Qe(e, t) {
|
|
573
574
|
t.forEach((t) => {
|
|
574
575
|
e.has(t) || e.append(t, "");
|
|
575
576
|
});
|
|
576
577
|
}
|
|
577
|
-
function
|
|
578
|
+
function $e(e, t) {
|
|
578
579
|
let n = c(e), r = n.find((e) => !e.hasAttribute("data-formie-page-hidden")) || null;
|
|
579
580
|
if (!n.length || !r) {
|
|
580
581
|
let n = new FormData(e);
|
|
581
582
|
return n.set("submitAction", t), n;
|
|
582
583
|
}
|
|
583
584
|
let i = new FormData();
|
|
584
|
-
return
|
|
585
|
+
return Xe(i, e), Qe(i, Ze(i, r)), i.set("submitAction", t), i;
|
|
585
586
|
}
|
|
586
|
-
function
|
|
587
|
+
function et(e, t) {
|
|
587
588
|
if (t !== "submit") return !1;
|
|
588
589
|
let n = c(e);
|
|
589
590
|
return n.length ? (n.find((e) => !e.hasAttribute("data-formie-page-hidden")) || n[n.length - 1]) === n[n.length - 1] : !0;
|
|
590
591
|
}
|
|
591
|
-
async function
|
|
592
|
-
|
|
592
|
+
async function tt(e, t, n, r = {}) {
|
|
593
|
+
N.log("Starting submit pipeline.", {
|
|
593
594
|
action: t,
|
|
594
595
|
preflightOnly: r.preflightOnly === !0
|
|
595
596
|
});
|
|
596
|
-
let i = !1, a, o = null, s =
|
|
597
|
+
let i = !1, a, o = null, s = et(e, t), c = {
|
|
597
598
|
form: e,
|
|
598
599
|
action: t,
|
|
599
|
-
formData:
|
|
600
|
+
formData: $e(e, t),
|
|
600
601
|
abort: (e) => {
|
|
601
|
-
i = !0, a = e,
|
|
602
|
+
i = !0, a = e, N.warn("Pipeline aborted.", { reason: e });
|
|
602
603
|
},
|
|
603
604
|
isAborted: () => i,
|
|
604
605
|
abortReason: () => a
|
|
@@ -647,68 +648,68 @@ async function nt(e, t, n, r = {}) {
|
|
|
647
648
|
screen: async () => null,
|
|
648
649
|
authorize: async () => null,
|
|
649
650
|
dispatch: async (e) => {
|
|
650
|
-
e.formData =
|
|
651
|
-
let t = await
|
|
651
|
+
e.formData = $e(e.form, e.action);
|
|
652
|
+
let t = await Ue(e.form, e.formData);
|
|
652
653
|
return o = t, t;
|
|
653
654
|
},
|
|
654
655
|
finalize: async (e) => (o && o.ok && o.redirect?.url && (o.redirect.target === "new-tab" ? window.open(o.redirect.url, "_blank") : window.location.href = o.redirect.url), null)
|
|
655
656
|
};
|
|
656
657
|
{
|
|
657
658
|
let e = await n.emitSafe("formie:submit:before", c);
|
|
658
|
-
e.failed.length > 0 &&
|
|
659
|
+
e.failed.length > 0 && N.warn("Submit before listeners failed.", {
|
|
659
660
|
eventName: e.eventName,
|
|
660
661
|
failed: e.failed.length
|
|
661
662
|
});
|
|
662
663
|
}
|
|
663
664
|
if (s) {
|
|
664
665
|
let e = await n.emitSafe("formie:submit:final:before", c);
|
|
665
|
-
e.failed.length > 0 &&
|
|
666
|
+
e.failed.length > 0 && N.warn("Final submit before listeners failed.", {
|
|
666
667
|
eventName: e.eventName,
|
|
667
668
|
failed: e.failed.length
|
|
668
669
|
});
|
|
669
670
|
}
|
|
670
|
-
let u = r.preflightOnly ?
|
|
671
|
+
let u = r.preflightOnly ? Ge : We;
|
|
671
672
|
for (let e of u) {
|
|
672
|
-
if (
|
|
673
|
+
if (N.log("Stage start.", {
|
|
673
674
|
stage: e,
|
|
674
675
|
action: t
|
|
675
|
-
}), i) return
|
|
676
|
+
}), i) return N.warn("Stage skipped due to abort.", {
|
|
676
677
|
stage: e,
|
|
677
678
|
reason: a
|
|
678
|
-
}),
|
|
679
|
+
}), Ke(e, a);
|
|
679
680
|
{
|
|
680
681
|
let t = await n.emitSafe(`formie:stage:${e}:before`, {
|
|
681
682
|
...c,
|
|
682
683
|
stage: e
|
|
683
684
|
});
|
|
684
|
-
t.failed.length > 0 &&
|
|
685
|
+
t.failed.length > 0 && N.warn("Stage before listeners failed.", {
|
|
685
686
|
stage: e,
|
|
686
687
|
failed: t.failed.length
|
|
687
688
|
});
|
|
688
689
|
}
|
|
689
690
|
if (i) {
|
|
690
|
-
let t =
|
|
691
|
+
let t = Ke(e, a);
|
|
691
692
|
{
|
|
692
693
|
let r = await n.emitSafe("formie:submit:after", t);
|
|
693
|
-
r.failed.length > 0 &&
|
|
694
|
+
r.failed.length > 0 && N.warn("Submit after listeners failed (abort before stage).", {
|
|
694
695
|
stage: e,
|
|
695
696
|
failed: r.failed.length
|
|
696
697
|
});
|
|
697
698
|
}
|
|
698
699
|
if (s) {
|
|
699
700
|
let r = await n.emitSafe("formie:submit:final:after", t);
|
|
700
|
-
r.failed.length > 0 &&
|
|
701
|
+
r.failed.length > 0 && N.warn("Final submit after listeners failed (abort before stage).", {
|
|
701
702
|
stage: e,
|
|
702
703
|
failed: r.failed.length
|
|
703
704
|
});
|
|
704
705
|
}
|
|
705
|
-
return
|
|
706
|
+
return N.warn("Aborted after stage before-hooks.", {
|
|
706
707
|
stage: e,
|
|
707
708
|
reason: a
|
|
708
709
|
}), t;
|
|
709
710
|
}
|
|
710
711
|
let r = await l[e](c);
|
|
711
|
-
|
|
712
|
+
N.log("Stage runner complete.", {
|
|
712
713
|
stage: e,
|
|
713
714
|
hasResult: !!r,
|
|
714
715
|
ok: r ? r.ok : void 0,
|
|
@@ -720,28 +721,28 @@ async function nt(e, t, n, r = {}) {
|
|
|
720
721
|
stage: e,
|
|
721
722
|
result: r
|
|
722
723
|
});
|
|
723
|
-
t.failed.length > 0 &&
|
|
724
|
+
t.failed.length > 0 && N.warn("Stage after listeners failed.", {
|
|
724
725
|
stage: e,
|
|
725
726
|
failed: t.failed.length
|
|
726
727
|
});
|
|
727
728
|
}
|
|
728
729
|
if (i) {
|
|
729
|
-
let t =
|
|
730
|
+
let t = Ke(e, a);
|
|
730
731
|
{
|
|
731
732
|
let r = await n.emitSafe("formie:submit:after", t);
|
|
732
|
-
r.failed.length > 0 &&
|
|
733
|
+
r.failed.length > 0 && N.warn("Submit after listeners failed (abort after stage).", {
|
|
733
734
|
stage: e,
|
|
734
735
|
failed: r.failed.length
|
|
735
736
|
});
|
|
736
737
|
}
|
|
737
738
|
if (s) {
|
|
738
739
|
let r = await n.emitSafe("formie:submit:final:after", t);
|
|
739
|
-
r.failed.length > 0 &&
|
|
740
|
+
r.failed.length > 0 && N.warn("Final submit after listeners failed (abort after stage).", {
|
|
740
741
|
stage: e,
|
|
741
742
|
failed: r.failed.length
|
|
742
743
|
});
|
|
743
744
|
}
|
|
744
|
-
return
|
|
745
|
+
return N.warn("Aborted after stage after-hooks.", {
|
|
745
746
|
stage: e,
|
|
746
747
|
reason: a
|
|
747
748
|
}), t;
|
|
@@ -749,19 +750,19 @@ async function nt(e, t, n, r = {}) {
|
|
|
749
750
|
if (r && !r.ok) {
|
|
750
751
|
{
|
|
751
752
|
let t = await n.emitSafe("formie:submit:after", r);
|
|
752
|
-
t.failed.length > 0 &&
|
|
753
|
+
t.failed.length > 0 && N.warn("Submit after listeners failed (failed stage).", {
|
|
753
754
|
stage: e,
|
|
754
755
|
failed: t.failed.length
|
|
755
756
|
});
|
|
756
757
|
}
|
|
757
758
|
if (s) {
|
|
758
759
|
let t = await n.emitSafe("formie:submit:final:after", r);
|
|
759
|
-
t.failed.length > 0 &&
|
|
760
|
+
t.failed.length > 0 && N.warn("Final submit after listeners failed (failed stage).", {
|
|
760
761
|
stage: e,
|
|
761
762
|
failed: t.failed.length
|
|
762
763
|
});
|
|
763
764
|
}
|
|
764
|
-
return
|
|
765
|
+
return N.warn("Pipeline short-circuited by failed stage.", {
|
|
765
766
|
stage: e,
|
|
766
767
|
code: r.code,
|
|
767
768
|
message: r.message
|
|
@@ -775,13 +776,13 @@ async function nt(e, t, n, r = {}) {
|
|
|
775
776
|
};
|
|
776
777
|
{
|
|
777
778
|
let e = await n.emitSafe("formie:submit:after", d);
|
|
778
|
-
e.failed.length > 0 &&
|
|
779
|
+
e.failed.length > 0 && N.warn("Submit after listeners failed (success).", { failed: e.failed.length });
|
|
779
780
|
}
|
|
780
781
|
if (s) {
|
|
781
782
|
let e = await n.emitSafe("formie:submit:final:after", d);
|
|
782
|
-
e.failed.length > 0 &&
|
|
783
|
+
e.failed.length > 0 && N.warn("Final submit after listeners failed (success).", { failed: e.failed.length });
|
|
783
784
|
}
|
|
784
|
-
return
|
|
785
|
+
return N.log("Pipeline completed.", {
|
|
785
786
|
ok: d.ok,
|
|
786
787
|
stage: d.stage,
|
|
787
788
|
code: d.code
|
|
@@ -789,27 +790,27 @@ async function nt(e, t, n, r = {}) {
|
|
|
789
790
|
}
|
|
790
791
|
//#endregion
|
|
791
792
|
//#region src/js/core/field-error-container.ts
|
|
792
|
-
function
|
|
793
|
+
function nt(e) {
|
|
793
794
|
return e.querySelector("[data-formie-field-layout]")?.getAttribute("data-formie-error-position")?.trim() === "above" ? "above" : "below";
|
|
794
795
|
}
|
|
795
|
-
function
|
|
796
|
+
function rt(e, t) {
|
|
796
797
|
let n = e.querySelector("[data-formie-field-errors]");
|
|
797
798
|
if (n) return n;
|
|
798
|
-
let r = e.querySelector("[data-formie-field-content]"), i = e.querySelector("[data-formie-field-control]"), a =
|
|
799
|
+
let r = e.querySelector("[data-formie-field-content]"), i = e.querySelector("[data-formie-field-control]"), a = nt(e), o = document.createElement("div");
|
|
799
800
|
return o.setAttribute("data-formie-field-errors", "true"), t?.(o), r && i ? a === "above" ? r.insertBefore(o, i) : r.appendChild(o) : e.appendChild(o), o;
|
|
800
801
|
}
|
|
801
802
|
//#endregion
|
|
802
803
|
//#region src/js/validation/rules/email.ts
|
|
803
|
-
var
|
|
804
|
+
var it = {
|
|
804
805
|
rule: ({ input: e, getRule: t }) => !t("email") || !e.value || e.value.length < 1 ? !0 : /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.value),
|
|
805
806
|
message: ({ input: e, label: t, t: n }) => e.getAttribute("data-formie-validation-email-message") ?? e.getAttribute("data-formie-pattern-email-message") ?? e.getAttribute("data-pattern-email-message") ?? n("{label} is not a valid email address.", { label: t })
|
|
806
807
|
};
|
|
807
808
|
//#endregion
|
|
808
809
|
//#region src/js/validation/rules/shared.ts
|
|
809
|
-
function
|
|
810
|
+
function at(e) {
|
|
810
811
|
return e?.querySelector("[data-formie-field-label]")?.childNodes[0]?.textContent?.trim() || "";
|
|
811
812
|
}
|
|
812
|
-
function
|
|
813
|
+
function ot(e) {
|
|
813
814
|
let t = e.getRule("match");
|
|
814
815
|
if (!t || t === !0 || typeof t != "object" || !e.field) return null;
|
|
815
816
|
let n = typeof t.fieldHandle == "string" ? t.fieldHandle.trim() : "";
|
|
@@ -819,7 +820,7 @@ function st(e) {
|
|
|
819
820
|
}
|
|
820
821
|
//#endregion
|
|
821
822
|
//#region src/js/validation/rules.ts
|
|
822
|
-
var
|
|
823
|
+
var st = {
|
|
823
824
|
required: {
|
|
824
825
|
rule: ({ input: e, getRule: t }) => {
|
|
825
826
|
if (!t("required") || e.type === "hidden") return !0;
|
|
@@ -831,7 +832,7 @@ var ct = {
|
|
|
831
832
|
},
|
|
832
833
|
message: ({ input: e, label: t, t: n }) => e.getAttribute("data-formie-required-message") ?? e.getAttribute("data-required-message") ?? n("{label} cannot be blank.", { label: t })
|
|
833
834
|
},
|
|
834
|
-
email:
|
|
835
|
+
email: it,
|
|
835
836
|
url: {
|
|
836
837
|
rule: ({ input: e, getRule: t }) => {
|
|
837
838
|
if (!t("url") || !e.value || e.value.length < 1) return !0;
|
|
@@ -872,18 +873,18 @@ var ct = {
|
|
|
872
873
|
},
|
|
873
874
|
match: {
|
|
874
875
|
rule: (e) => {
|
|
875
|
-
let t =
|
|
876
|
+
let t = ot(e);
|
|
876
877
|
return t ? t.value === e.input.value : !0;
|
|
877
878
|
},
|
|
878
879
|
message: (e) => {
|
|
879
|
-
let t =
|
|
880
|
+
let t = ot(e)?.closest("[data-formie-field-handle]"), n = at(t);
|
|
880
881
|
return e.t("{label} must match {value}.", {
|
|
881
882
|
label: e.label,
|
|
882
883
|
value: n
|
|
883
884
|
});
|
|
884
885
|
}
|
|
885
886
|
}
|
|
886
|
-
},
|
|
887
|
+
}, ct = {
|
|
887
888
|
email: /^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*(\.\w{2,})+$/,
|
|
888
889
|
url: /^(?:(?:https?|HTTPS?|ftp|FTP):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)(?:\.(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)*(?:\.(?:[a-zA-Z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/,
|
|
889
890
|
number: /^(?:[-+]?[0-9]*[.,]?[0-9]+)$/,
|
|
@@ -891,11 +892,11 @@ var ct = {
|
|
|
891
892
|
date: /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))/,
|
|
892
893
|
time: /^(?:(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]))$/,
|
|
893
894
|
month: /^(?:(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])))$/
|
|
894
|
-
},
|
|
895
|
-
function
|
|
895
|
+
}, P = C("general", "validator");
|
|
896
|
+
function F(e) {
|
|
896
897
|
return !!e && (e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement);
|
|
897
898
|
}
|
|
898
|
-
function
|
|
899
|
+
function lt(e, t) {
|
|
899
900
|
let n = (e.getAttribute("aria-describedby") || "").trim();
|
|
900
901
|
if (!n) return;
|
|
901
902
|
let r = n.split(/\s+/).filter((e) => e !== t);
|
|
@@ -905,17 +906,17 @@ function ut(e, t) {
|
|
|
905
906
|
}
|
|
906
907
|
e.removeAttribute("aria-describedby");
|
|
907
908
|
}
|
|
908
|
-
function
|
|
909
|
+
function ut(e, t) {
|
|
909
910
|
let n = (e.getAttribute("aria-describedby") || "").trim(), r = n ? n.split(/\s+/) : [];
|
|
910
911
|
r.includes(t) || r.push(t), e.setAttribute("aria-describedby", r.join(" ").trim());
|
|
911
912
|
}
|
|
912
|
-
function
|
|
913
|
+
function dt(e, t) {
|
|
913
914
|
e.setAttribute("aria-errormessage", t);
|
|
914
915
|
}
|
|
915
|
-
function
|
|
916
|
+
function ft(e, t) {
|
|
916
917
|
e.getAttribute("aria-errormessage") === t && e.removeAttribute("aria-errormessage");
|
|
917
918
|
}
|
|
918
|
-
var
|
|
919
|
+
var pt = class {
|
|
919
920
|
constructor(e, t = {}) {
|
|
920
921
|
this.errors = [], this.validators = {}, this.boundListeners = !1, this.activated = /* @__PURE__ */ new WeakSet(), this.submitted = !1, this.initialValues = /* @__PURE__ */ new WeakMap(), this.form = e, this.onBlur = this.blurHandler.bind(this), this.onChange = this.changeHandler.bind(this), this.onInput = this.inputHandler.bind(this), this.config = {
|
|
921
922
|
live: !1,
|
|
@@ -926,14 +927,14 @@ var mt = class {
|
|
|
926
927
|
messagesClass: [],
|
|
927
928
|
messageClass: [],
|
|
928
929
|
fieldsSelector: "input:not([type=\"hidden\"]):not([type=\"submit\"]):not([type=\"button\"]):not([disabled]), select:not([disabled]), textarea:not([disabled])",
|
|
929
|
-
patterns:
|
|
930
|
+
patterns: ct,
|
|
930
931
|
...t
|
|
931
|
-
}, Object.entries(
|
|
932
|
+
}, Object.entries(st).forEach(([e, t]) => {
|
|
932
933
|
this.addValidator(e, t.rule, t.message);
|
|
933
934
|
}), this.init();
|
|
934
935
|
}
|
|
935
936
|
init() {
|
|
936
|
-
|
|
937
|
+
P.log("Initializing validator.", {
|
|
937
938
|
formId: this.form.id || null,
|
|
938
939
|
live: this.config.live
|
|
939
940
|
}), this.form.setAttribute("novalidate", "true"), this.inputs().forEach((e) => {
|
|
@@ -941,9 +942,9 @@ var mt = class {
|
|
|
941
942
|
}), this.config.live && this.addEventListeners(), this.emitEvent(document, n("ready"), { validator: this });
|
|
942
943
|
}
|
|
943
944
|
inputs(e = null) {
|
|
944
|
-
if (
|
|
945
|
+
if (F(e)) return [e];
|
|
945
946
|
let t = e || this.form;
|
|
946
|
-
return Array.from(t.querySelectorAll(this.config.fieldsSelector)).filter((e) =>
|
|
947
|
+
return Array.from(t.querySelectorAll(this.config.fieldsSelector)).filter((e) => F(e));
|
|
947
948
|
}
|
|
948
949
|
getInputValue(e) {
|
|
949
950
|
return e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio") ? e.checked : e instanceof HTMLInputElement && e.type === "file" ? e.files?.length ? Array.from(e.files).map((e) => e.name).join("|") : "" : e.value ?? "";
|
|
@@ -983,7 +984,7 @@ var mt = class {
|
|
|
983
984
|
}), r = !0;
|
|
984
985
|
}
|
|
985
986
|
}), !r && this.shouldShowError(e) && this.removeError(e);
|
|
986
|
-
}),
|
|
987
|
+
}), P.log("Validation pass complete.", {
|
|
987
988
|
errorCount: this.errors.length,
|
|
988
989
|
includeHiddenPages: t.includeHiddenPages === !0
|
|
989
990
|
}), this.errors;
|
|
@@ -1004,19 +1005,19 @@ var mt = class {
|
|
|
1004
1005
|
e.remove();
|
|
1005
1006
|
}), r && (r.innerHTML = ""), t.querySelectorAll("input, select, textarea").forEach((e) => {
|
|
1006
1007
|
let n = e;
|
|
1007
|
-
n.removeAttribute("aria-invalid"), this.config.inputErrorClass.length && n.classList.remove(...this.config.inputErrorClass), n.removeAttribute("data-formie-input-has-error"), i &&
|
|
1008
|
+
n.removeAttribute("aria-invalid"), this.config.inputErrorClass.length && n.classList.remove(...this.config.inputErrorClass), n.removeAttribute("data-formie-input-has-error"), i && lt(n, i), t.querySelectorAll("[data-formie-field-error]").forEach((e) => {
|
|
1008
1009
|
let t = e.id;
|
|
1009
|
-
t &&
|
|
1010
|
+
t && ft(n, t);
|
|
1010
1011
|
});
|
|
1011
1012
|
});
|
|
1012
1013
|
for (let e = t; e; e = e.parentElement?.closest("[data-formie-field-handle]")) this.config.fieldContainerErrorClass.length && e.classList.remove(...this.config.fieldContainerErrorClass), e.removeAttribute("data-formie-field-has-error");
|
|
1013
|
-
this.emitEvent(e, n("clear-error"), { validator: this }),
|
|
1014
|
+
this.emitEvent(e, n("clear-error"), { validator: this }), y(this.form);
|
|
1014
1015
|
}
|
|
1015
1016
|
showError(e, t, r) {
|
|
1016
1017
|
let i = e.closest("[data-formie-field-handle]");
|
|
1017
1018
|
if (!i) return;
|
|
1018
1019
|
let a = i.querySelector("[data-formie-field-errors]");
|
|
1019
|
-
a ||=
|
|
1020
|
+
a ||= rt(i, (e) => {
|
|
1020
1021
|
this.config.messagesClass.length && e.classList.add(...this.config.messagesClass);
|
|
1021
1022
|
}), this.config.messagesClass.length && a.classList.add(...this.config.messagesClass), a.innerHTML = "";
|
|
1022
1023
|
let o = i.getAttribute("data-formie-field-handle") || "field", s = `${o}-error`;
|
|
@@ -1024,19 +1025,19 @@ var mt = class {
|
|
|
1024
1025
|
let c = document.createElement("div");
|
|
1025
1026
|
c.setAttribute("data-formie-field-error", "true"), c.setAttribute(`data-formie-field-error-${t}`, "true"), c.setAttribute("id", s), c.setAttribute("role", "alert"), this.config.messageClass.length && c.classList.add(...this.config.messageClass), c.textContent = r, a.appendChild(c), i.setAttribute("data-formie-field-has-error", "true"), i.querySelectorAll("input, select, textarea").forEach((e) => {
|
|
1026
1027
|
let t = e;
|
|
1027
|
-
t.setAttribute("aria-invalid", "true"), this.config.inputErrorClass.length && t.classList.add(...this.config.inputErrorClass), t.setAttribute("data-formie-input-has-error", "true"),
|
|
1028
|
+
t.setAttribute("aria-invalid", "true"), this.config.inputErrorClass.length && t.classList.add(...this.config.inputErrorClass), t.setAttribute("data-formie-input-has-error", "true"), ut(t, a.id), dt(t, s);
|
|
1028
1029
|
});
|
|
1029
1030
|
for (let e = i; e; e = e.parentElement?.closest("[data-formie-field-handle]")) this.config.fieldContainerErrorClass.length && e.classList.add(...this.config.fieldContainerErrorClass), e.setAttribute("data-formie-field-has-error", "true");
|
|
1030
1031
|
this.emitEvent(e, n("show-error"), {
|
|
1031
1032
|
validator: this,
|
|
1032
1033
|
validatorName: t,
|
|
1033
1034
|
errorMessage: r
|
|
1034
|
-
}),
|
|
1035
|
+
}), y(this.form);
|
|
1035
1036
|
}
|
|
1036
1037
|
getValidatorCallbackOptions(e) {
|
|
1037
1038
|
let t = e.closest("[data-formie-field-handle]"), n = t?.querySelector("[data-formie-field-label]")?.childNodes[0]?.textContent?.trim() ?? "", r = this.parseValidationRules(t?.getAttribute("data-formie-validation"));
|
|
1038
1039
|
return {
|
|
1039
|
-
t:
|
|
1040
|
+
t: O,
|
|
1040
1041
|
input: e,
|
|
1041
1042
|
label: n,
|
|
1042
1043
|
field: t,
|
|
@@ -1047,7 +1048,7 @@ var mt = class {
|
|
|
1047
1048
|
};
|
|
1048
1049
|
}
|
|
1049
1050
|
getErrorMessage(e, t, n, r) {
|
|
1050
|
-
return (typeof n.errorMessage == "function" ? n.errorMessage(r) : n.errorMessage) ??
|
|
1051
|
+
return (typeof n.errorMessage == "function" ? n.errorMessage(r) : n.errorMessage) ?? O("{label} is invalid.", { label: r.label });
|
|
1051
1052
|
}
|
|
1052
1053
|
getErrors() {
|
|
1053
1054
|
return this.errors;
|
|
@@ -1070,7 +1071,7 @@ var mt = class {
|
|
|
1070
1071
|
try {
|
|
1071
1072
|
n = JSON.parse(e);
|
|
1072
1073
|
} catch {
|
|
1073
|
-
return
|
|
1074
|
+
return P.warn("Invalid validation rules payload.", { formId: this.form.id || null }), t;
|
|
1074
1075
|
}
|
|
1075
1076
|
return Array.isArray(n) && n.forEach((e) => {
|
|
1076
1077
|
if (!e || typeof e != "object" || Array.isArray(e)) return;
|
|
@@ -1079,16 +1080,16 @@ var mt = class {
|
|
|
1079
1080
|
}), t;
|
|
1080
1081
|
}
|
|
1081
1082
|
destroy() {
|
|
1082
|
-
|
|
1083
|
+
P.log("Destroying validator.", { formId: this.form.id || null }), this.removeEventListeners(), this.form.removeAttribute("novalidate"), this.emitEvent(document, n("destroy"), { validator: this });
|
|
1083
1084
|
}
|
|
1084
1085
|
isVisible(e, t = {}) {
|
|
1085
1086
|
return e.disabled || e.hasAttribute("data-formie-conditions-disabled") || e.closest("[data-formie-conditions-disabled]") || e.closest("[data-formie-conditionally-hidden]") ? !1 : e.closest("[data-formie-page-hidden]") ? !!t.includeHiddenPages : !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length);
|
|
1086
1087
|
}
|
|
1087
1088
|
blurHandler(e) {
|
|
1088
|
-
!(e.target instanceof HTMLElement) || !
|
|
1089
|
+
!(e.target instanceof HTMLElement) || !F(e.target) || !e.target.form?.isSameNode(this.form) || e instanceof CustomEvent || e.target instanceof HTMLInputElement && e.target.type === "file" || e.target instanceof HTMLInputElement && (e.target.type === "checkbox" || e.target.type === "radio") || (this.isDirty(e.target) && this.activated.add(e.target), this.shouldShowError(e.target) && this.validate(e.target));
|
|
1089
1090
|
}
|
|
1090
1091
|
changeHandler(e) {
|
|
1091
|
-
if (!(!(e.target instanceof HTMLElement) || !
|
|
1092
|
+
if (!(!(e.target instanceof HTMLElement) || !F(e.target) || !e.target.form?.isSameNode(this.form)) && !(e instanceof CustomEvent)) {
|
|
1092
1093
|
if (e.target instanceof HTMLSelectElement) {
|
|
1093
1094
|
this.activated.add(e.target), this.validate(e.target);
|
|
1094
1095
|
return;
|
|
@@ -1097,19 +1098,19 @@ var mt = class {
|
|
|
1097
1098
|
}
|
|
1098
1099
|
}
|
|
1099
1100
|
inputHandler(e) {
|
|
1100
|
-
!(e.target instanceof HTMLElement) || !
|
|
1101
|
+
!(e.target instanceof HTMLElement) || !F(e.target) || !e.target.form?.isSameNode(this.form) || e instanceof CustomEvent || e.target instanceof HTMLInputElement && (e.target.type === "checkbox" || e.target.type === "radio") || this.shouldShowError(e.target) && this.validate(e.target);
|
|
1101
1102
|
}
|
|
1102
1103
|
submit(e = null, { final: t = !1 } = {}) {
|
|
1103
|
-
return this.submitted = !0,
|
|
1104
|
+
return this.submitted = !0, P.log("Submit validation requested.", { final: t }), this.boundListeners || this.addEventListeners(), this.removeAllErrors(), this.validate(e, { includeHiddenPages: t });
|
|
1104
1105
|
}
|
|
1105
1106
|
resetLiveState() {
|
|
1106
1107
|
this.submitted = !1, this.activated = /* @__PURE__ */ new WeakSet(), this.errors = [], this.removeAllErrors();
|
|
1107
1108
|
}
|
|
1108
1109
|
addEventListeners() {
|
|
1109
|
-
this.boundListeners || (this.form.addEventListener("blur", this.onBlur, !0), this.form.addEventListener("change", this.onChange, !1), this.form.addEventListener("input", this.onInput, !1), this.boundListeners = !0,
|
|
1110
|
+
this.boundListeners || (this.form.addEventListener("blur", this.onBlur, !0), this.form.addEventListener("change", this.onChange, !1), this.form.addEventListener("input", this.onInput, !1), this.boundListeners = !0, P.log("Event listeners attached."));
|
|
1110
1111
|
}
|
|
1111
1112
|
removeEventListeners() {
|
|
1112
|
-
this.form.removeEventListener("blur", this.onBlur, !0), this.form.removeEventListener("change", this.onChange, !1), this.form.removeEventListener("input", this.onInput, !1), this.boundListeners = !1,
|
|
1113
|
+
this.form.removeEventListener("blur", this.onBlur, !0), this.form.removeEventListener("change", this.onChange, !1), this.form.removeEventListener("input", this.onInput, !1), this.boundListeners = !1, P.log("Event listeners removed.");
|
|
1113
1114
|
}
|
|
1114
1115
|
emitEvent(e, t, n = {}) {
|
|
1115
1116
|
e.dispatchEvent(new CustomEvent(t, {
|
|
@@ -1126,62 +1127,62 @@ var mt = class {
|
|
|
1126
1127
|
removeValidator(e) {
|
|
1127
1128
|
delete this.validators[e];
|
|
1128
1129
|
}
|
|
1129
|
-
},
|
|
1130
|
-
function
|
|
1130
|
+
}, I = /* @__PURE__ */ new WeakMap();
|
|
1131
|
+
function mt(e) {
|
|
1131
1132
|
return (e.dataset.formieSubmitAction || "").trim();
|
|
1132
1133
|
}
|
|
1133
|
-
function
|
|
1134
|
+
function ht(e) {
|
|
1134
1135
|
return (e.dataset.formieErrorMessagePosition || "top-form").trim() || "top-form";
|
|
1135
1136
|
}
|
|
1136
|
-
function
|
|
1137
|
+
function gt(e) {
|
|
1137
1138
|
return (e.dataset.formieSubmitActionMessagePosition || "").trim();
|
|
1138
1139
|
}
|
|
1139
|
-
function
|
|
1140
|
+
function _t(e) {
|
|
1140
1141
|
let t = (e.dataset.formieSubmitActionMessageTimeout || "").trim();
|
|
1141
1142
|
if (!t) return null;
|
|
1142
1143
|
let n = Number.parseFloat(t);
|
|
1143
1144
|
return !Number.isFinite(n) || n < 0 ? null : Math.round(n * 1e3);
|
|
1144
1145
|
}
|
|
1145
|
-
function
|
|
1146
|
+
function vt(e) {
|
|
1146
1147
|
let t = e.dataset.formieSubmitActionFormHide;
|
|
1147
1148
|
if (t === void 0) return !1;
|
|
1148
1149
|
let n = t.trim().toLowerCase();
|
|
1149
1150
|
return n === "true" || n === "1" || n === "";
|
|
1150
1151
|
}
|
|
1151
|
-
function
|
|
1152
|
-
let t =
|
|
1153
|
-
typeof t == "number" && (window.clearTimeout(t),
|
|
1152
|
+
function yt(e) {
|
|
1153
|
+
let t = I.get(e);
|
|
1154
|
+
typeof t == "number" && (window.clearTimeout(t), I.delete(e));
|
|
1154
1155
|
}
|
|
1155
|
-
function
|
|
1156
|
+
function bt(e) {
|
|
1156
1157
|
return e.querySelector("[data-formie-form-messages-top]") || e;
|
|
1157
1158
|
}
|
|
1158
|
-
function
|
|
1159
|
+
function xt(e) {
|
|
1159
1160
|
return e.querySelector("[data-formie-form-messages-bottom]") || e;
|
|
1160
1161
|
}
|
|
1161
|
-
function
|
|
1162
|
-
return t === "bottom-form" ?
|
|
1162
|
+
function St(e, t) {
|
|
1163
|
+
return t === "bottom-form" ? xt(e) : bt(e);
|
|
1163
1164
|
}
|
|
1164
|
-
function
|
|
1165
|
-
return t === "top-form" ?
|
|
1165
|
+
function Ct(e, t) {
|
|
1166
|
+
return t === "top-form" ? bt(e) : t === "bottom-form" && !vt(e) ? xt(e) : e;
|
|
1166
1167
|
}
|
|
1167
|
-
function
|
|
1168
|
-
let t =
|
|
1169
|
-
return r || (r = document.createElement("div"), r.setAttribute("data-formie-errors", "true"),
|
|
1168
|
+
function wt(e) {
|
|
1169
|
+
let t = ht(e), n = St(e, t), r = n.querySelector("[data-formie-error-container], [data-formie-errors]");
|
|
1170
|
+
return r || (r = document.createElement("div"), r.setAttribute("data-formie-errors", "true"), T(r, e, "errors")), r.setAttribute("data-formie-error-container", "true"), t === "bottom-form" ? n.append(r) : n.prepend(r), r;
|
|
1170
1171
|
}
|
|
1171
|
-
function
|
|
1172
|
+
function Tt(e, t) {
|
|
1172
1173
|
let n = t.querySelector("[data-formie-error-message-container], [data-formie-message][data-formie-message-error]");
|
|
1173
|
-
return n || (n = document.createElement("div"), n.setAttribute("data-formie-error-message-container", "true"), t.appendChild(n)), n.setAttribute("data-formie-message", "true"), n.setAttribute("data-formie-message-error", "true"),
|
|
1174
|
+
return n || (n = document.createElement("div"), n.setAttribute("data-formie-error-message-container", "true"), t.appendChild(n)), n.setAttribute("data-formie-message", "true"), n.setAttribute("data-formie-message-error", "true"), T(n, e, "message", "messageError"), n.setAttribute("role", "alert"), De(n, Ee(we(e))), n;
|
|
1174
1175
|
}
|
|
1175
|
-
function
|
|
1176
|
-
let n = e.querySelector("[data-formie-success-container]"), r =
|
|
1177
|
-
return n || (n = document.createElement("div"), n.setAttribute("data-formie-success-container", "true"),
|
|
1176
|
+
function Et(e, t) {
|
|
1177
|
+
let n = e.querySelector("[data-formie-success-container]"), r = Ct(e, t);
|
|
1178
|
+
return n || (n = document.createElement("div"), n.setAttribute("data-formie-success-container", "true"), T(n, e, "successes")), t === "bottom-form" ? r.append(n) : r.prepend(n), n;
|
|
1178
1179
|
}
|
|
1179
|
-
function
|
|
1180
|
-
return
|
|
1181
|
-
|
|
1180
|
+
function Dt(e) {
|
|
1181
|
+
return rt(e, (t) => {
|
|
1182
|
+
T(t, e, "fieldErrors");
|
|
1182
1183
|
});
|
|
1183
1184
|
}
|
|
1184
|
-
function
|
|
1185
|
+
function Ot(e, t) {
|
|
1185
1186
|
let n = (e.getAttribute("aria-describedby") || "").trim();
|
|
1186
1187
|
if (!n) return;
|
|
1187
1188
|
let r = n.split(/\s+/).filter((e) => e !== t).join(" ").trim();
|
|
@@ -1191,118 +1192,118 @@ function kt(e, t) {
|
|
|
1191
1192
|
}
|
|
1192
1193
|
e.removeAttribute("aria-describedby");
|
|
1193
1194
|
}
|
|
1194
|
-
function
|
|
1195
|
+
function kt(e, t) {
|
|
1195
1196
|
e.setAttribute("aria-errormessage", t);
|
|
1196
1197
|
}
|
|
1197
|
-
function
|
|
1198
|
+
function At(e, t) {
|
|
1198
1199
|
e.getAttribute("aria-errormessage") === t && e.removeAttribute("aria-errormessage");
|
|
1199
1200
|
}
|
|
1200
|
-
function
|
|
1201
|
+
function jt(e) {
|
|
1201
1202
|
e.querySelectorAll("[data-formie-field-handle]").forEach((t) => {
|
|
1202
1203
|
let n = t, r = n.querySelector("[data-formie-field-errors]"), i = r?.id || "", a = Array.from(n.querySelectorAll("[data-formie-field-error]")).map((e) => e.id).filter(Boolean);
|
|
1203
|
-
|
|
1204
|
+
w(n, e, "fieldLayoutError"), n.removeAttribute("data-formie-field-has-error"), n.querySelectorAll("[data-formie-field-error]").forEach((e) => {
|
|
1204
1205
|
e.remove();
|
|
1205
1206
|
}), r && !r.querySelector("[data-formie-field-error]") && (r.innerHTML = ""), n.querySelectorAll("input, select, textarea").forEach((t) => {
|
|
1206
1207
|
let n = t;
|
|
1207
|
-
n.removeAttribute("aria-invalid"),
|
|
1208
|
-
|
|
1208
|
+
n.removeAttribute("aria-invalid"), w(n, e, "fieldControlError"), n.removeAttribute("data-formie-input-has-error"), i && Ot(n, i), a.forEach((e) => {
|
|
1209
|
+
At(n, e);
|
|
1209
1210
|
});
|
|
1210
1211
|
});
|
|
1211
|
-
}),
|
|
1212
|
+
}), y(e);
|
|
1212
1213
|
}
|
|
1213
|
-
function
|
|
1214
|
+
function Mt(e) {
|
|
1214
1215
|
e.querySelectorAll("[data-formie-error-container], [data-formie-errors]").forEach((t) => {
|
|
1215
1216
|
let n = t;
|
|
1216
1217
|
n.querySelectorAll("[data-formie-error]").forEach((e) => {
|
|
1217
1218
|
e.remove();
|
|
1218
|
-
}),
|
|
1219
|
+
}), w(n, e, "message", "messageError"), n.removeAttribute("data-formie-message"), n.removeAttribute("data-formie-message-error"), n.removeAttribute("role"), n.removeAttribute("aria-live"), n.removeAttribute("aria-atomic"), n.querySelector("[data-formie-error]") || (n.innerHTML = "");
|
|
1219
1220
|
});
|
|
1220
1221
|
}
|
|
1221
|
-
function
|
|
1222
|
-
|
|
1222
|
+
function Nt(e) {
|
|
1223
|
+
yt(e), e.querySelectorAll("[data-formie-message-success]:not([data-formie-success-container])").forEach((e) => {
|
|
1223
1224
|
e.remove();
|
|
1224
1225
|
}), e.querySelectorAll("[data-formie-success-container]").forEach((t) => {
|
|
1225
1226
|
let n = t;
|
|
1226
1227
|
n.querySelectorAll("[data-formie-success]").forEach((e) => {
|
|
1227
1228
|
e.remove();
|
|
1228
|
-
}),
|
|
1229
|
-
}),
|
|
1229
|
+
}), w(n, e, "message", "messageSuccess"), n.removeAttribute("data-formie-message"), n.removeAttribute("data-formie-message-success"), n.removeAttribute("role"), n.removeAttribute("aria-live"), n.removeAttribute("aria-atomic"), n.querySelector("[data-formie-success]") || (n.innerHTML = "");
|
|
1230
|
+
}), mt(e) === "message" && vt(e) || s(e, !1);
|
|
1230
1231
|
}
|
|
1231
|
-
function
|
|
1232
|
+
function Pt(e) {
|
|
1232
1233
|
e.querySelectorAll("[aria-invalid=\"true\"]").forEach((e) => {
|
|
1233
1234
|
e.removeAttribute("aria-invalid");
|
|
1234
1235
|
});
|
|
1235
1236
|
}
|
|
1236
|
-
function
|
|
1237
|
+
function Ft(e, t) {
|
|
1237
1238
|
let n = (e.getAttribute("aria-describedby") || "").trim(), r = n ? n.split(/\s+/) : [];
|
|
1238
1239
|
r.includes(t) || r.push(t), e.setAttribute("aria-describedby", r.join(" ").trim());
|
|
1239
1240
|
}
|
|
1240
|
-
function
|
|
1241
|
+
function It(e, t) {
|
|
1241
1242
|
let n = Ee(we(e));
|
|
1242
1243
|
Object.entries(t).forEach(([t, r]) => {
|
|
1243
1244
|
let i = e.querySelector(`[data-formie-field-handle="${t}"]`);
|
|
1244
1245
|
if (!i) return;
|
|
1245
|
-
let a =
|
|
1246
|
-
a.id = o, De(a, n),
|
|
1246
|
+
let a = Dt(i), o = a.id && a.id.trim() ? a.id : `${t}-errors`;
|
|
1247
|
+
a.id = o, De(a, n), T(i, e, "fieldLayoutError"), i.setAttribute("data-formie-field-has-error", "true"), r.forEach((t, n) => {
|
|
1247
1248
|
let r = document.createElement("div");
|
|
1248
|
-
r.setAttribute("data-formie-field-error", "true"), r.setAttribute("role", "alert"), r.id = `${o}-${n + 1}`,
|
|
1249
|
+
r.setAttribute("data-formie-field-error", "true"), r.setAttribute("role", "alert"), r.id = `${o}-${n + 1}`, T(r, e, "fieldError"), r.textContent = t, a.appendChild(r);
|
|
1249
1250
|
});
|
|
1250
1251
|
let s = a.querySelector("[data-formie-field-error]")?.id;
|
|
1251
1252
|
i.querySelectorAll("input, select, textarea").forEach((t) => {
|
|
1252
1253
|
let n = t;
|
|
1253
|
-
n.setAttribute("aria-invalid", "true"),
|
|
1254
|
+
n.setAttribute("aria-invalid", "true"), T(n, e, "fieldControlError"), n.setAttribute("data-formie-input-has-error", "true"), Ft(n, o), s && kt(n, s);
|
|
1254
1255
|
let r = i.querySelector("[data-formie-instructions]");
|
|
1255
|
-
r?.id &&
|
|
1256
|
+
r?.id && Ft(n, r.id);
|
|
1256
1257
|
});
|
|
1257
|
-
}),
|
|
1258
|
+
}), y(e);
|
|
1258
1259
|
}
|
|
1259
|
-
function
|
|
1260
|
-
let n =
|
|
1261
|
-
|
|
1260
|
+
function Lt(e, t) {
|
|
1261
|
+
let n = wt(e), r = Tt(e, n);
|
|
1262
|
+
T(n, e, "errors"), t.forEach((t) => {
|
|
1262
1263
|
let n = document.createElement("div");
|
|
1263
|
-
n.setAttribute("data-formie-error", "true"), n.setAttribute("role", "alert"),
|
|
1264
|
+
n.setAttribute("data-formie-error", "true"), n.setAttribute("role", "alert"), T(n, e, "error"), n.innerHTML = t, r.appendChild(n);
|
|
1264
1265
|
});
|
|
1265
1266
|
}
|
|
1266
|
-
function
|
|
1267
|
-
return !t.message || t.nextPage || t.redirect ? !1 : t.action === "save" ? !0 :
|
|
1267
|
+
function Rt(e, t) {
|
|
1268
|
+
return !t.message || t.nextPage || t.redirect ? !1 : t.action === "save" ? !0 : mt(e) === "message" && gt(e) !== "";
|
|
1268
1269
|
}
|
|
1269
|
-
function
|
|
1270
|
-
let n =
|
|
1270
|
+
function zt(e, t) {
|
|
1271
|
+
let n = gt(e);
|
|
1271
1272
|
if (!n) return;
|
|
1272
|
-
let r =
|
|
1273
|
-
|
|
1273
|
+
let r = Et(e, n);
|
|
1274
|
+
T(r, e, "message", "messageSuccess"), r.setAttribute("data-formie-message", "true"), r.setAttribute("data-formie-message-success", "true"), r.setAttribute("role", "status"), r.setAttribute("aria-live", "polite"), r.setAttribute("aria-atomic", "true");
|
|
1274
1275
|
let i = document.createElement("div");
|
|
1275
|
-
i.setAttribute("data-formie-success", "true"),
|
|
1276
|
-
let a =
|
|
1276
|
+
i.setAttribute("data-formie-success", "true"), T(i, e, "success"), i.innerHTML = t, r.appendChild(i), vt(e) && s(e, !0);
|
|
1277
|
+
let a = _t(e);
|
|
1277
1278
|
if (a !== null) {
|
|
1278
1279
|
let t = window.setTimeout(() => {
|
|
1279
|
-
|
|
1280
|
+
I.delete(e), Nt(e);
|
|
1280
1281
|
}, a);
|
|
1281
|
-
|
|
1282
|
+
I.set(e, t);
|
|
1282
1283
|
}
|
|
1283
1284
|
}
|
|
1284
|
-
function
|
|
1285
|
-
if (
|
|
1286
|
-
|
|
1285
|
+
function L(e, t) {
|
|
1286
|
+
if (jt(e), Mt(e), Nt(e), Pt(e), t.ok) {
|
|
1287
|
+
Rt(e, t) && zt(e, t.message || "");
|
|
1287
1288
|
return;
|
|
1288
1289
|
}
|
|
1289
|
-
t.fieldErrors &&
|
|
1290
|
+
t.fieldErrors && It(e, t.fieldErrors), t.formErrors?.length ? Lt(e, t.formErrors) : !t.fieldErrors && t.message && Lt(e, [t.message]), Pe(e);
|
|
1290
1291
|
}
|
|
1291
1292
|
//#endregion
|
|
1292
1293
|
//#region src/js/core/submit-flow.ts
|
|
1293
|
-
var
|
|
1294
|
-
function
|
|
1294
|
+
var Bt = C("general", "submit-flow");
|
|
1295
|
+
function Vt(e) {
|
|
1295
1296
|
return !(!e.ok && e.stage === "validate");
|
|
1296
1297
|
}
|
|
1297
|
-
function
|
|
1298
|
+
function Ht(e) {
|
|
1298
1299
|
return e ? !!(e.keepSubmitLoading === !0 || e.ok && e.redirect?.url && e.redirect.target !== "new-tab") : !1;
|
|
1299
1300
|
}
|
|
1300
|
-
function
|
|
1301
|
-
|
|
1301
|
+
function Ut(e) {
|
|
1302
|
+
jt(e), Mt(e), Nt(e), Pt(e);
|
|
1302
1303
|
}
|
|
1303
|
-
async function
|
|
1304
|
+
async function Wt(e) {
|
|
1304
1305
|
let { id: t, target: n, form: r, bus: i, validator: a, validateOnSubmit: o, action: s, submitter: c, waitForSubmitDelay: l, onRefreshTokensAfterSubmit: u, dispatchSubmitResult: f } = e;
|
|
1305
|
-
|
|
1306
|
+
Ut(r), m(r, c || null);
|
|
1306
1307
|
let p = {
|
|
1307
1308
|
ok: !1,
|
|
1308
1309
|
code: "SUBMIT_ERROR",
|
|
@@ -1310,30 +1311,30 @@ async function Gt(e) {
|
|
|
1310
1311
|
formErrors: ["Submission failed."]
|
|
1311
1312
|
};
|
|
1312
1313
|
try {
|
|
1313
|
-
await l(r), p = await
|
|
1314
|
+
await l(r), p = await tt(r, s, i, {
|
|
1314
1315
|
validator: a,
|
|
1315
1316
|
validateOnSubmit: o
|
|
1316
|
-
}),
|
|
1317
|
+
}), L(r, p), g(r, p, s), Vt(p) && await u(p), f(p);
|
|
1317
1318
|
} catch (e) {
|
|
1318
1319
|
p = {
|
|
1319
1320
|
ok: !1,
|
|
1320
1321
|
code: "SUBMIT_ERROR",
|
|
1321
1322
|
message: e instanceof Error ? e.message : "Submission failed.",
|
|
1322
1323
|
formErrors: [e instanceof Error ? e.message : "Submission failed."]
|
|
1323
|
-
},
|
|
1324
|
+
}, L(r, p), f(p), Bt.warn("Submit failed with exception.", {
|
|
1324
1325
|
id: t,
|
|
1325
1326
|
action: s,
|
|
1326
1327
|
target: n,
|
|
1327
1328
|
error: e instanceof Error ? e.message : e
|
|
1328
1329
|
});
|
|
1329
1330
|
} finally {
|
|
1330
|
-
|
|
1331
|
+
Ht(p) || d(r);
|
|
1331
1332
|
}
|
|
1332
1333
|
return p;
|
|
1333
1334
|
}
|
|
1334
1335
|
//#endregion
|
|
1335
1336
|
//#region src/js/modules/registry.ts
|
|
1336
|
-
var
|
|
1337
|
+
var R = class {
|
|
1337
1338
|
constructor() {
|
|
1338
1339
|
this.modules = /* @__PURE__ */ new Map();
|
|
1339
1340
|
}
|
|
@@ -1350,12 +1351,12 @@ var I = class {
|
|
|
1350
1351
|
getAll() {
|
|
1351
1352
|
return Array.from(this.modules.values());
|
|
1352
1353
|
}
|
|
1353
|
-
},
|
|
1354
|
+
}, Gt = {
|
|
1354
1355
|
"address-finder": () => import("./chunks/address-finder-k7_BXaRe.js").then((e) => e.addressFinderModule),
|
|
1355
1356
|
"google-address": () => import("./chunks/google-address-BH3Zhi06.js").then((e) => e.googleAddressModule),
|
|
1356
1357
|
loqate: () => import("./chunks/loqate-CJPzBmSm.js").then((e) => e.loqateModule),
|
|
1357
1358
|
"place-kit": () => import("./chunks/place-kit-BGHklIZ-.js").then((e) => e.placeKitModule)
|
|
1358
|
-
},
|
|
1359
|
+
}, Kt = {
|
|
1359
1360
|
"captcha-eu": () => import("./chunks/captcha-eu-CGm8Lbrj.js").then((e) => e.captchaEuModule),
|
|
1360
1361
|
"friendly-captcha-v1": () => import("./chunks/friendly-captcha-v1-C_2reOXr.js").then((e) => e.friendlyCaptchaV1Module),
|
|
1361
1362
|
"friendly-captcha-v2": () => import("./chunks/friendly-captcha-v2-CLSAbkqx.js").then((e) => e.friendlyCaptchaV2Module),
|
|
@@ -1366,7 +1367,7 @@ var I = class {
|
|
|
1366
1367
|
"recaptcha-v3": () => import("./chunks/recaptcha-v3-No4Ykrhk.js").then((e) => e.recaptchaV3Module),
|
|
1367
1368
|
snaptcha: () => import("./chunks/snaptcha-DKx98oon.js").then((e) => e.snaptchaModule),
|
|
1368
1369
|
turnstile: () => import("./chunks/turnstile-DJakPzQD.js").then((e) => e.turnstileModule)
|
|
1369
|
-
},
|
|
1370
|
+
}, qt = {
|
|
1370
1371
|
calculations: () => import("./chunks/calculations-CeDgB9jt.js").then((e) => e.calculationsModule),
|
|
1371
1372
|
"checkbox-radio": () => import("./chunks/checkbox-radio-DQ0H67Tj.js").then((e) => e.checkboxRadioModule),
|
|
1372
1373
|
combobox: () => import("./chunks/combobox-D-2b42wn.js").then((e) => e.comboboxModule),
|
|
@@ -1384,87 +1385,90 @@ var I = class {
|
|
|
1384
1385
|
repeater: () => import("./chunks/repeater-B5leVxZU.js").then((e) => e.repeaterModule),
|
|
1385
1386
|
"rich-text": () => import("./chunks/rich-text-D0sb8bmX.js").then((e) => e.richTextModule),
|
|
1386
1387
|
signature: () => import("./chunks/signature-xz4QO7CR.js").then((e) => e.signatureModule),
|
|
1387
|
-
summary: () => import("./chunks/summary-
|
|
1388
|
+
summary: () => import("./chunks/summary-Dks0gXS3.js").then((e) => e.summaryModule),
|
|
1389
|
+
"survey-likert": () => import("./chunks/survey-likert-DmJ3klhP.js").then((e) => e.surveyLikertModule),
|
|
1390
|
+
"survey-rank": () => import("./chunks/survey-rank-DeUenftw.js").then((e) => e.surveyRankModule),
|
|
1391
|
+
"survey-rating": () => import("./chunks/survey-rating-BPUYDgBJ.js").then((e) => e.surveyRatingModule),
|
|
1388
1392
|
table: () => import("./chunks/table-C-lkQN6I.js").then((e) => e.tableModule),
|
|
1389
1393
|
"text-limit": () => import("./chunks/text-limit-DbgEFHLO.js").then((e) => e.textLimitModule)
|
|
1394
|
+
}, Jt = {
|
|
1395
|
+
bpoint: () => import("./chunks/bpoint-CwSw_p7A.js").then((e) => e.bpointModule),
|
|
1396
|
+
eway: () => import("./chunks/eway-B30BMlDp.js").then((e) => e.ewayModule),
|
|
1397
|
+
"go-cardless": () => import("./chunks/go-cardless-BiF3iLel.js").then((e) => e.goCardlessModule),
|
|
1398
|
+
mollie: () => import("./chunks/mollie-D__SwtcH.js").then((e) => e.mollieModule),
|
|
1399
|
+
moneris: () => import("./chunks/moneris-KJS1BKx7.js").then((e) => e.monerisModule),
|
|
1400
|
+
opayo: () => import("./chunks/opayo-A_LIkc-v.js").then((e) => e.opayoModule),
|
|
1401
|
+
paddle: () => import("./chunks/paddle-BjbOOb0m.js").then((e) => e.paddleModule),
|
|
1402
|
+
paypal: () => import("./chunks/paypal-CyjHIV8v.js").then((e) => e.paypalModule),
|
|
1403
|
+
payway: () => import("./chunks/payway-a_cyrr3j.js").then((e) => e.paywayModule),
|
|
1404
|
+
square: () => import("./chunks/square-Bga6WXHV.js").then((e) => e.squareModule),
|
|
1405
|
+
stripe: () => import("./chunks/stripe-BlqVocl3.js").then((e) => e.stripeModule)
|
|
1390
1406
|
}, Yt = {
|
|
1391
|
-
bpoint: () => import("./chunks/bpoint-2qDxlKD9.js").then((e) => e.bpointModule),
|
|
1392
|
-
eway: () => import("./chunks/eway-CImXrB4g.js").then((e) => e.ewayModule),
|
|
1393
|
-
"go-cardless": () => import("./chunks/go-cardless-Bz7HHtH0.js").then((e) => e.goCardlessModule),
|
|
1394
|
-
mollie: () => import("./chunks/mollie-BtnB3KGh.js").then((e) => e.mollieModule),
|
|
1395
|
-
moneris: () => import("./chunks/moneris-Bd4vUk8b.js").then((e) => e.monerisModule),
|
|
1396
|
-
opayo: () => import("./chunks/opayo-B-eRIXo-.js").then((e) => e.opayoModule),
|
|
1397
|
-
paddle: () => import("./chunks/paddle-BUFeEU4d.js").then((e) => e.paddleModule),
|
|
1398
|
-
paypal: () => import("./chunks/paypal-8Euw7Hrn.js").then((e) => e.paypalModule),
|
|
1399
|
-
payway: () => import("./chunks/payway-dV0SzJxy.js").then((e) => e.paywayModule),
|
|
1400
|
-
square: () => import("./chunks/square-reyJukb7.js").then((e) => e.squareModule),
|
|
1401
|
-
stripe: () => import("./chunks/stripe-BC-2PBvY.js").then((e) => e.stripeModule)
|
|
1402
|
-
}, Xt = {
|
|
1403
|
-
...Jt,
|
|
1404
|
-
...Kt,
|
|
1405
1407
|
...qt,
|
|
1406
|
-
...
|
|
1407
|
-
|
|
1408
|
-
|
|
1408
|
+
...Gt,
|
|
1409
|
+
...Kt,
|
|
1410
|
+
...Jt
|
|
1411
|
+
}, z = /* @__PURE__ */ new Map(), B = C("general", "loader"), Xt = Function("src", "return import(src);");
|
|
1412
|
+
async function V(t, n, i, a) {
|
|
1409
1413
|
await t(r(i), a), await t(e(n, i), a);
|
|
1410
1414
|
}
|
|
1411
|
-
function
|
|
1415
|
+
function Zt(e) {
|
|
1412
1416
|
return !!e && typeof e == "object" && typeof e.id == "string" && typeof e.setup == "function" && typeof e.match == "function";
|
|
1413
1417
|
}
|
|
1414
|
-
async function
|
|
1415
|
-
let n =
|
|
1416
|
-
return n ? (
|
|
1418
|
+
async function Qt(e, t) {
|
|
1419
|
+
let n = Yt[e];
|
|
1420
|
+
return n ? (z.has(e) || z.set(e, (async () => {
|
|
1417
1421
|
try {
|
|
1418
1422
|
let e = await n();
|
|
1419
|
-
return
|
|
1423
|
+
return Zt(e) ? (t.registry.register(e), e) : null;
|
|
1420
1424
|
} catch (t) {
|
|
1421
|
-
return console.error("[formie] Failed to load builtin module:", e, t),
|
|
1425
|
+
return console.error("[formie] Failed to load builtin module:", e, t), B.warn("Failed loading builtin module.", {
|
|
1422
1426
|
moduleId: e,
|
|
1423
1427
|
error: t
|
|
1424
1428
|
}), null;
|
|
1425
1429
|
}
|
|
1426
|
-
})()),
|
|
1430
|
+
})()), z.get(e) || null) : null;
|
|
1427
1431
|
}
|
|
1428
|
-
async function
|
|
1432
|
+
async function $t(e) {
|
|
1429
1433
|
try {
|
|
1430
|
-
let t = await
|
|
1431
|
-
return
|
|
1434
|
+
let t = await Xt(e), n = t?.default || t?.formieModule || null;
|
|
1435
|
+
return Zt(n) ? n : null;
|
|
1432
1436
|
} catch (t) {
|
|
1433
|
-
return console.error("[formie] Failed to load module from src:", e, t),
|
|
1437
|
+
return console.error("[formie] Failed to load module from src:", e, t), B.warn("Failed loading module from src.", {
|
|
1434
1438
|
src: e,
|
|
1435
1439
|
error: t
|
|
1436
1440
|
}), null;
|
|
1437
1441
|
}
|
|
1438
1442
|
}
|
|
1439
|
-
async function
|
|
1443
|
+
async function en(e, t) {
|
|
1440
1444
|
let n = t.registry.get(e.id);
|
|
1441
1445
|
if (n) return n;
|
|
1442
|
-
let r = await
|
|
1446
|
+
let r = await Qt(e.id, t);
|
|
1443
1447
|
if (r) return r;
|
|
1444
1448
|
if (e.src) {
|
|
1445
|
-
let n = await
|
|
1449
|
+
let n = await $t(e.src);
|
|
1446
1450
|
if (n) return t.registry.register(n), n;
|
|
1447
1451
|
}
|
|
1448
1452
|
return null;
|
|
1449
1453
|
}
|
|
1450
|
-
function
|
|
1454
|
+
function tn(e) {
|
|
1451
1455
|
return typeof window.CSS?.escape == "function" ? window.CSS.escape(e) : e.replace(/["\\]/g, "\\$&");
|
|
1452
1456
|
}
|
|
1453
|
-
function
|
|
1457
|
+
function H(e, t) {
|
|
1454
1458
|
return e.matches(t) ? [e, ...Array.from(e.querySelectorAll(t))] : Array.from(e.querySelectorAll(t));
|
|
1455
1459
|
}
|
|
1456
1460
|
function nn(e, t) {
|
|
1457
1461
|
let n = t.setupContext.root, r = t.setupContext.form, i = e.targetType, a = e.targetId;
|
|
1458
|
-
return i === "selector" ?
|
|
1462
|
+
return i === "selector" ? H(n, a).map((e) => ({
|
|
1459
1463
|
scope: i,
|
|
1460
1464
|
element: e
|
|
1461
|
-
})) : i === "field" ?
|
|
1465
|
+
})) : i === "field" ? H(n, `[data-formie-field-handle="${tn(a)}"]`).map((e) => ({
|
|
1462
1466
|
scope: i,
|
|
1463
1467
|
element: e
|
|
1464
|
-
})) : i === "page" ?
|
|
1468
|
+
})) : i === "page" ? H(n, `[data-formie-page-id="${tn(a)}"]`).map((e) => ({
|
|
1465
1469
|
scope: i,
|
|
1466
1470
|
element: e
|
|
1467
|
-
})) : i === "button" ?
|
|
1471
|
+
})) : i === "button" ? H(n, `[data-formie-action="${tn(a)}"]`).map((e) => ({
|
|
1468
1472
|
scope: i,
|
|
1469
1473
|
element: e
|
|
1470
1474
|
})) : [{
|
|
@@ -1480,18 +1484,18 @@ function rn(e, t) {
|
|
|
1480
1484
|
}
|
|
1481
1485
|
async function an(e, t) {
|
|
1482
1486
|
let n = [];
|
|
1483
|
-
|
|
1487
|
+
B.log("Loading module manifest.", { manifestCount: e.length });
|
|
1484
1488
|
for (let r of e) {
|
|
1485
|
-
let e = await
|
|
1489
|
+
let e = await en(r, t);
|
|
1486
1490
|
if (!e) {
|
|
1487
|
-
|
|
1491
|
+
B.warn("Skipping manifest item (definition not resolved).", {
|
|
1488
1492
|
moduleId: r.id,
|
|
1489
1493
|
src: r.src
|
|
1490
1494
|
});
|
|
1491
1495
|
continue;
|
|
1492
1496
|
}
|
|
1493
1497
|
let i = rn(r, t);
|
|
1494
|
-
|
|
1498
|
+
B.log("Resolved module targets.", {
|
|
1495
1499
|
moduleId: e.id,
|
|
1496
1500
|
targets: r.targets || [],
|
|
1497
1501
|
targetCount: i.length
|
|
@@ -1504,7 +1508,7 @@ async function an(e, t) {
|
|
|
1504
1508
|
manifestItem: r
|
|
1505
1509
|
};
|
|
1506
1510
|
if (!e.match(i)) {
|
|
1507
|
-
e.kind === "address" && console.warn(`[formie] Address module "${e.id}" skipped: target element does not contain [data-formie-address-autocomplete-input]. Enable the Auto-Complete subfield.`),
|
|
1511
|
+
e.kind === "address" && console.warn(`[formie] Address module "${e.id}" skipped: target element does not contain [data-formie-address-autocomplete-input]. Enable the Auto-Complete subfield.`), B.log("Module target did not match predicate.", {
|
|
1508
1512
|
moduleId: e.id,
|
|
1509
1513
|
scope: a.scope
|
|
1510
1514
|
});
|
|
@@ -1518,7 +1522,7 @@ async function an(e, t) {
|
|
|
1518
1522
|
options: o,
|
|
1519
1523
|
manifestItem: r
|
|
1520
1524
|
};
|
|
1521
|
-
await
|
|
1525
|
+
await V(t.setupContext.emit, s, "before-setup", c);
|
|
1522
1526
|
let l = null;
|
|
1523
1527
|
try {
|
|
1524
1528
|
let n = await e.setup({
|
|
@@ -1529,25 +1533,25 @@ async function an(e, t) {
|
|
|
1529
1533
|
});
|
|
1530
1534
|
n && (l = n);
|
|
1531
1535
|
} catch (t) {
|
|
1532
|
-
console.error(`[formie] Module "${e.id}" setup failed:`, t),
|
|
1536
|
+
console.error(`[formie] Module "${e.id}" setup failed:`, t), B.warn("Module setup failed.", {
|
|
1533
1537
|
moduleId: e.id,
|
|
1534
1538
|
scope: a.scope,
|
|
1535
1539
|
error: t
|
|
1536
1540
|
});
|
|
1537
1541
|
}
|
|
1538
|
-
await
|
|
1542
|
+
await V(t.setupContext.emit, s, "after-setup", {
|
|
1539
1543
|
...c,
|
|
1540
1544
|
instanceCreated: !!l
|
|
1541
|
-
}), l && (
|
|
1545
|
+
}), l && (B.log("Module instance created.", {
|
|
1542
1546
|
moduleId: e.id,
|
|
1543
1547
|
scope: a.scope
|
|
1544
1548
|
}), n.push({
|
|
1545
1549
|
...l,
|
|
1546
1550
|
destroy: async () => {
|
|
1547
|
-
|
|
1551
|
+
B.log("Destroying module instance.", {
|
|
1548
1552
|
moduleId: e.id,
|
|
1549
1553
|
scope: a.scope
|
|
1550
|
-
}), await
|
|
1554
|
+
}), await V(t.setupContext.emit, s, "before-destroy", c), await l.destroy(), await V(t.setupContext.emit, s, "after-destroy", c), B.log("Module instance destroyed.", {
|
|
1551
1555
|
moduleId: e.id,
|
|
1552
1556
|
scope: a.scope
|
|
1553
1557
|
});
|
|
@@ -1555,7 +1559,7 @@ async function an(e, t) {
|
|
|
1555
1559
|
}));
|
|
1556
1560
|
}
|
|
1557
1561
|
}
|
|
1558
|
-
return
|
|
1562
|
+
return B.log("Module manifest processing complete.", { instanceCount: n.length }), n;
|
|
1559
1563
|
}
|
|
1560
1564
|
//#endregion
|
|
1561
1565
|
//#region src/js/utils/form-started-at.ts
|
|
@@ -1581,38 +1585,38 @@ var cn = new Set([
|
|
|
1581
1585
|
"draftContext",
|
|
1582
1586
|
"continuationToken"
|
|
1583
1587
|
]);
|
|
1584
|
-
function
|
|
1588
|
+
function ln(e, t) {
|
|
1585
1589
|
if (e == null) return String(e);
|
|
1586
1590
|
if (typeof e == "string") return JSON.stringify(e);
|
|
1587
1591
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
1588
1592
|
if (typeof e == "function") return "[function]";
|
|
1589
1593
|
if (typeof File < "u" && e instanceof File) return `[file:${e.name}:${e.size}:${e.type}]`;
|
|
1590
1594
|
if (typeof Blob < "u" && e instanceof Blob) return `[blob:${e.size}:${e.type}]`;
|
|
1591
|
-
if (Array.isArray(e)) return `[${e.map((e) =>
|
|
1595
|
+
if (Array.isArray(e)) return `[${e.map((e) => ln(e, t)).join(",")}]`;
|
|
1592
1596
|
if (typeof e == "object") {
|
|
1593
1597
|
if (t.has(e)) return "[circular]";
|
|
1594
1598
|
t.add(e);
|
|
1595
|
-
let n = Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, n]) => `${JSON.stringify(e)}:${
|
|
1599
|
+
let n = Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, n]) => `${JSON.stringify(e)}:${ln(n, t)}`);
|
|
1596
1600
|
return t.delete(e), `{${n.join(",")}}`;
|
|
1597
1601
|
}
|
|
1598
1602
|
return JSON.stringify(String(e));
|
|
1599
1603
|
}
|
|
1600
|
-
function ln(e) {
|
|
1601
|
-
return H(e, /* @__PURE__ */ new WeakSet());
|
|
1602
|
-
}
|
|
1603
1604
|
function un(e) {
|
|
1605
|
+
return ln(e, /* @__PURE__ */ new WeakSet());
|
|
1606
|
+
}
|
|
1607
|
+
function dn(e) {
|
|
1604
1608
|
if (!e) return !1;
|
|
1605
1609
|
let t = e.endsWith("[]") ? e.slice(0, -2) : e;
|
|
1606
1610
|
return !cn.has(t);
|
|
1607
1611
|
}
|
|
1608
|
-
function
|
|
1609
|
-
return
|
|
1612
|
+
function fn(e) {
|
|
1613
|
+
return un(Array.from(new FormData(e).entries()).filter(([e]) => dn(String(e || ""))));
|
|
1610
1614
|
}
|
|
1611
|
-
function
|
|
1615
|
+
function pn(e, t = {}) {
|
|
1612
1616
|
let n = null, r = !1, i = !1, a = null, o = null, s = null, c = () => {
|
|
1613
1617
|
a !== null && (window.cancelAnimationFrame(a), a = null), o !== null && (window.clearTimeout(o), o = null), s !== null && (window.clearTimeout(s), s = null);
|
|
1614
|
-
}, l = () => r ? (i =
|
|
1615
|
-
n =
|
|
1618
|
+
}, l = () => r ? (i = fn(e) !== n, i) : !1, u = () => {
|
|
1619
|
+
n = fn(e), r = !0, i = !1;
|
|
1616
1620
|
}, d = () => {
|
|
1617
1621
|
c(), r = !1, a = window.requestAnimationFrame(() => {
|
|
1618
1622
|
a = null, s = window.setTimeout(() => {
|
|
@@ -1637,25 +1641,25 @@ function fn(e, t = {}) {
|
|
|
1637
1641
|
}
|
|
1638
1642
|
//#endregion
|
|
1639
1643
|
//#region src/js/validation/enter-key-guard.ts
|
|
1640
|
-
function
|
|
1644
|
+
function mn(e) {
|
|
1641
1645
|
return e.hasAttribute("data-formie-conditionally-hidden") || !!e.closest("[data-formie-conditionally-hidden]") || e.hasAttribute("data-formie-page-hidden") || !!e.closest("[data-formie-page-hidden]");
|
|
1642
1646
|
}
|
|
1643
|
-
function
|
|
1647
|
+
function hn(e, t) {
|
|
1644
1648
|
let n = e.querySelectorAll(`[data-formie-action="${t}"]`);
|
|
1645
|
-
return Array.from(n).some((e) => !
|
|
1649
|
+
return Array.from(n).some((e) => !mn(e));
|
|
1646
1650
|
}
|
|
1647
|
-
function
|
|
1651
|
+
function gn(e) {
|
|
1648
1652
|
let { final: t } = f(e);
|
|
1649
1653
|
return "submit";
|
|
1650
1654
|
}
|
|
1651
|
-
function gn(e) {
|
|
1652
|
-
return !mn(e, hn(e));
|
|
1653
|
-
}
|
|
1654
1655
|
function _n(e) {
|
|
1656
|
+
return !hn(e, gn(e));
|
|
1657
|
+
}
|
|
1658
|
+
function vn(e) {
|
|
1655
1659
|
let t = (t) => {
|
|
1656
1660
|
if (t.key !== "Enter" || t.defaultPrevented) return;
|
|
1657
1661
|
let n = t.target;
|
|
1658
|
-
(n instanceof HTMLInputElement || n instanceof HTMLSelectElement) && (n instanceof HTMLInputElement && (n.type === "button" || n.type === "submit" || n.type === "reset" || n.type === "file") ||
|
|
1662
|
+
(n instanceof HTMLInputElement || n instanceof HTMLSelectElement) && (n instanceof HTMLInputElement && (n.type === "button" || n.type === "submit" || n.type === "reset" || n.type === "file") || _n(e) && t.preventDefault());
|
|
1659
1663
|
};
|
|
1660
1664
|
return e.addEventListener("keydown", t, !0), () => {
|
|
1661
1665
|
e.removeEventListener("keydown", t, !0);
|
|
@@ -1663,13 +1667,13 @@ function _n(e) {
|
|
|
1663
1667
|
}
|
|
1664
1668
|
//#endregion
|
|
1665
1669
|
//#region src/js/core/create-formie-client.ts
|
|
1666
|
-
var U = "[data-formie]:not([data-formie-init=\"false\"]), [data-formie-form]:not([data-formie-init=\"false\"])",
|
|
1670
|
+
var U = "[data-formie]:not([data-formie-init=\"false\"]), [data-formie-form]:not([data-formie-init=\"false\"])", yn = 300, bn = "/actions/formie/server/forms/render", xn = "/api", Sn = "/actions/formie/server/forms/refresh-tokens", Cn = "/actions/formie/server/submissions/submit", wn = "/actions/formie/server/submissions/set-page", Tn = "/actions/formie/server/submissions/clear-submission", En = "/actions/formie/file-upload/hydrate", W = C("general", "client"), Dn = /* @__PURE__ */ new Set();
|
|
1667
1671
|
function G(e, t) {
|
|
1668
1672
|
if (e == null || e === "") return t;
|
|
1669
1673
|
let n = e.toLowerCase();
|
|
1670
1674
|
return !(n === "false" || n === "0" || n === "off");
|
|
1671
1675
|
}
|
|
1672
|
-
function
|
|
1676
|
+
function On(e) {
|
|
1673
1677
|
return e.formieRefreshTokens != null && e.formieRefreshTokens !== "" ? G(e.formieRefreshTokens, !1) : e.formieStaticCache != null && e.formieStaticCache !== "" ? G(e.formieStaticCache, !1) : !1;
|
|
1674
1678
|
}
|
|
1675
1679
|
function K(e) {
|
|
@@ -1679,7 +1683,7 @@ function K(e) {
|
|
|
1679
1683
|
transport: t.formieTransport || "rest",
|
|
1680
1684
|
formHandle: t.formieHandle,
|
|
1681
1685
|
endpoint: t.formieEndpoint,
|
|
1682
|
-
staticCache:
|
|
1686
|
+
staticCache: On(t),
|
|
1683
1687
|
autoVisible: G(t.formieAutoVisible, !0),
|
|
1684
1688
|
compatibility: G(t.formieCompatibility, !1)
|
|
1685
1689
|
};
|
|
@@ -1693,10 +1697,10 @@ function J(e) {
|
|
|
1693
1697
|
function Y(e) {
|
|
1694
1698
|
return e instanceof HTMLFormElement ? e : e.querySelector("form");
|
|
1695
1699
|
}
|
|
1696
|
-
function On(e, t) {
|
|
1697
|
-
En.has(e) || (En.add(e), W.warn(t));
|
|
1698
|
-
}
|
|
1699
1700
|
function kn(e, t) {
|
|
1701
|
+
Dn.has(e) || (Dn.add(e), W.warn(t));
|
|
1702
|
+
}
|
|
1703
|
+
function An(e, t) {
|
|
1700
1704
|
if (!e) return e;
|
|
1701
1705
|
try {
|
|
1702
1706
|
return new URL(e).toString();
|
|
@@ -1710,19 +1714,19 @@ function kn(e, t) {
|
|
|
1710
1714
|
}
|
|
1711
1715
|
function X(e, t) {
|
|
1712
1716
|
let n = (e || "").trim();
|
|
1713
|
-
return n ? n.includes("/actions/") ? n :
|
|
1714
|
-
}
|
|
1715
|
-
function An(e, t) {
|
|
1716
|
-
return X(e.endpoint || t.dataset.formieEndpoint, yn);
|
|
1717
|
+
return n ? n.includes("/actions/") ? n : An(t, n) : t;
|
|
1717
1718
|
}
|
|
1718
1719
|
function jn(e, t) {
|
|
1719
|
-
|
|
1720
|
-
return n ? n.includes("/graphql") || n.endsWith("/api") || n.includes("/actions/graphql/") ? n : kn(bn, n) : bn;
|
|
1720
|
+
return X(e.endpoint || t.dataset.formieEndpoint, bn);
|
|
1721
1721
|
}
|
|
1722
1722
|
function Mn(e, t) {
|
|
1723
|
-
|
|
1723
|
+
let n = (e.endpoint || t.dataset.formieEndpoint || "").trim();
|
|
1724
|
+
return n ? n.includes("/graphql") || n.endsWith("/api") || n.includes("/actions/graphql/") ? n : An(xn, n) : xn;
|
|
1724
1725
|
}
|
|
1725
1726
|
function Nn(e, t) {
|
|
1727
|
+
return X(t.dataset.formieRefreshTokensEndpoint || e.endpoint || t.dataset.formieEndpoint, Sn);
|
|
1728
|
+
}
|
|
1729
|
+
function Pn(e, t) {
|
|
1726
1730
|
if (!e) return t;
|
|
1727
1731
|
try {
|
|
1728
1732
|
let n = new URL(e, window.location.origin), r = new URL(t, window.location.origin);
|
|
@@ -1733,42 +1737,42 @@ function Nn(e, t) {
|
|
|
1733
1737
|
return t;
|
|
1734
1738
|
}
|
|
1735
1739
|
}
|
|
1736
|
-
function
|
|
1737
|
-
let r = n.endpoint || e.dataset.formieEndpoint, i = X(r,
|
|
1738
|
-
t.setAttribute("action",
|
|
1739
|
-
let t = e.getAttribute("href"), n = X(r,
|
|
1740
|
-
e.setAttribute("href",
|
|
1740
|
+
function Fn(e, t, n) {
|
|
1741
|
+
let r = n.endpoint || e.dataset.formieEndpoint, i = X(r, Cn), a = t.getAttribute("action");
|
|
1742
|
+
t.setAttribute("action", Pn(a, i)), t.querySelectorAll("[data-formie-tab-link]").forEach((e) => {
|
|
1743
|
+
let t = e.getAttribute("href"), n = X(r, wn);
|
|
1744
|
+
e.setAttribute("href", Pn(t, n));
|
|
1741
1745
|
}), t.querySelectorAll("[data-formie-file-upload-hydrate-endpoint]").forEach((e) => {
|
|
1742
|
-
e.setAttribute("data-formie-file-upload-hydrate-endpoint", X(r,
|
|
1746
|
+
e.setAttribute("data-formie-file-upload-hydrate-endpoint", X(r, En));
|
|
1743
1747
|
});
|
|
1744
1748
|
}
|
|
1745
|
-
function
|
|
1749
|
+
function In(e, t) {
|
|
1746
1750
|
if (e === "graphql" && t !== "server-rendered") throw Error(`Formie ${t} mode does not support GraphQL transport yet.`);
|
|
1747
1751
|
}
|
|
1748
|
-
function
|
|
1752
|
+
function Ln(e) {
|
|
1749
1753
|
if (e == null) return !1;
|
|
1750
1754
|
let t = e.trim().toLowerCase();
|
|
1751
1755
|
return t === "true" || t === "1" || t === "";
|
|
1752
1756
|
}
|
|
1753
|
-
function
|
|
1757
|
+
function Rn(e) {
|
|
1754
1758
|
return G(e.dataset.formieAutomaticSubmissionState, !0);
|
|
1755
1759
|
}
|
|
1756
|
-
function
|
|
1757
|
-
return X(n.dataset.formieClearSubmissionEndpoint || e.endpoint || t.dataset.formieEndpoint,
|
|
1760
|
+
function zn(e, t, n) {
|
|
1761
|
+
return X(n.dataset.formieClearSubmissionEndpoint || e.endpoint || t.dataset.formieEndpoint, Tn);
|
|
1758
1762
|
}
|
|
1759
|
-
function
|
|
1760
|
-
return
|
|
1763
|
+
function Bn(e) {
|
|
1764
|
+
return Ln(e.dataset.formieUnloadWarning);
|
|
1761
1765
|
}
|
|
1762
|
-
function
|
|
1766
|
+
function Vn(e, t) {
|
|
1763
1767
|
e.setAttribute("data-formie-internal-navigation", t);
|
|
1764
1768
|
}
|
|
1765
|
-
function
|
|
1769
|
+
function Hn(e) {
|
|
1766
1770
|
e.removeAttribute("data-formie-internal-navigation");
|
|
1767
1771
|
}
|
|
1768
|
-
function
|
|
1772
|
+
function Un(e) {
|
|
1769
1773
|
return e.getAttribute("data-formie-internal-navigation") !== null;
|
|
1770
1774
|
}
|
|
1771
|
-
function
|
|
1775
|
+
function Wn(e, t) {
|
|
1772
1776
|
if (!e) return !1;
|
|
1773
1777
|
try {
|
|
1774
1778
|
return new URL(e, window.location.origin).searchParams.has(t);
|
|
@@ -1776,30 +1780,30 @@ function Un(e, t) {
|
|
|
1776
1780
|
return !1;
|
|
1777
1781
|
}
|
|
1778
1782
|
}
|
|
1779
|
-
function Wn(e) {
|
|
1780
|
-
return Un(window.location.href, "resumeToken") || Un(e.getAttribute("action"), "resumeToken");
|
|
1781
|
-
}
|
|
1782
1783
|
function Gn(e) {
|
|
1784
|
+
return Wn(window.location.href, "resumeToken") || Wn(e.getAttribute("action"), "resumeToken");
|
|
1785
|
+
}
|
|
1786
|
+
function Kn(e) {
|
|
1783
1787
|
return e instanceof MouseEvent ? e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey : !0;
|
|
1784
1788
|
}
|
|
1785
|
-
function
|
|
1789
|
+
function qn(e, t = 0) {
|
|
1786
1790
|
if (!e) return t;
|
|
1787
1791
|
let n = Number.parseInt(e, 10);
|
|
1788
1792
|
return Number.isFinite(n) ? n : t;
|
|
1789
1793
|
}
|
|
1790
|
-
function
|
|
1791
|
-
return Math.max(0,
|
|
1794
|
+
function Jn(e) {
|
|
1795
|
+
return Math.max(0, qn(e.dataset.formieSubmitDelay, yn));
|
|
1792
1796
|
}
|
|
1793
1797
|
function Z(e) {
|
|
1794
|
-
return
|
|
1798
|
+
return Ln(e.dataset.formieValidationOnSubmit);
|
|
1795
1799
|
}
|
|
1796
|
-
async function
|
|
1797
|
-
let t =
|
|
1800
|
+
async function Yn(e) {
|
|
1801
|
+
let t = Jn(e);
|
|
1798
1802
|
t < 1 || await new Promise((e) => {
|
|
1799
1803
|
window.setTimeout(e, t);
|
|
1800
1804
|
});
|
|
1801
1805
|
}
|
|
1802
|
-
function
|
|
1806
|
+
function Xn(e, t) {
|
|
1803
1807
|
let n = e?.getAttribute(t)?.trim();
|
|
1804
1808
|
if (!n) return null;
|
|
1805
1809
|
try {
|
|
@@ -1808,29 +1812,29 @@ function Yn(e, t) {
|
|
|
1808
1812
|
return console.error(`[formie] Failed to parse ${t}.`, e), null;
|
|
1809
1813
|
}
|
|
1810
1814
|
}
|
|
1811
|
-
function
|
|
1815
|
+
function Zn(e, t) {
|
|
1812
1816
|
let n = t || (e instanceof HTMLFormElement ? e : null);
|
|
1813
1817
|
if (!n) return null;
|
|
1814
|
-
let r =
|
|
1818
|
+
let r = Xn(n, "data-formie-modules"), i = Xn(n, "data-formie-theme");
|
|
1815
1819
|
return !r && !i ? null : {
|
|
1816
1820
|
modules: r || void 0,
|
|
1817
1821
|
theme: i || void 0
|
|
1818
1822
|
};
|
|
1819
1823
|
}
|
|
1820
|
-
function
|
|
1824
|
+
function Qn(e) {
|
|
1821
1825
|
if (!(e instanceof HTMLElement)) return !0;
|
|
1822
1826
|
if (!e.isConnected || e.hidden || e.closest("[hidden]")) return !1;
|
|
1823
1827
|
let t = window.getComputedStyle(e);
|
|
1824
1828
|
return t.display === "none" || t.visibility === "hidden" ? !1 : e.getClientRects().length > 0;
|
|
1825
1829
|
}
|
|
1826
|
-
function
|
|
1830
|
+
function $n(e, t) {
|
|
1827
1831
|
return t === document ? !0 : t instanceof Element ? t === e || t.contains(e) : !0;
|
|
1828
1832
|
}
|
|
1829
1833
|
function Q(e) {
|
|
1830
1834
|
let t = e, n = t.id ? `#${t.id}` : "", r = t.dataset?.formieHandle ? `[handle="${t.dataset.formieHandle}"]` : "";
|
|
1831
1835
|
return `${t.tagName ? t.tagName.toLowerCase() : "element"}${n}${r}`;
|
|
1832
1836
|
}
|
|
1833
|
-
function
|
|
1837
|
+
function er(e, t) {
|
|
1834
1838
|
if (t) {
|
|
1835
1839
|
if (t.csrf?.param && t.csrf?.token) {
|
|
1836
1840
|
let n = e.querySelector(`input[name="${t.csrf.param}"]`);
|
|
@@ -1853,11 +1857,11 @@ function $n(e, t) {
|
|
|
1853
1857
|
});
|
|
1854
1858
|
}
|
|
1855
1859
|
}
|
|
1856
|
-
async function
|
|
1860
|
+
async function tr(e, t) {
|
|
1857
1861
|
let n = q(t.mode), r = J(t.transport);
|
|
1858
1862
|
if (n !== "server-rendered") return null;
|
|
1859
1863
|
if (t.payload) return t.payload.html && (e.innerHTML = t.payload.html), t.payload;
|
|
1860
|
-
|
|
1864
|
+
In(r, n);
|
|
1861
1865
|
let i = !!Y(e), a = t.formHandle || e.dataset.formieHandle;
|
|
1862
1866
|
if (i || !a) return null;
|
|
1863
1867
|
let o = {
|
|
@@ -1867,30 +1871,30 @@ async function er(e, t) {
|
|
|
1867
1871
|
siteId: t.siteId,
|
|
1868
1872
|
theme: t.theme,
|
|
1869
1873
|
themeConfig: t.themeConfig
|
|
1870
|
-
}, s = r === "graphql" ?
|
|
1874
|
+
}, s = r === "graphql" ? Mn(t, e) : jn(t, e), c = r === "graphql" ? await Be(s, a, o) : await ze(s, a, {
|
|
1871
1875
|
...o,
|
|
1872
1876
|
endpoint: s
|
|
1873
1877
|
});
|
|
1874
1878
|
return c?.html && (e.innerHTML = c.html), c;
|
|
1875
1879
|
}
|
|
1876
|
-
async function
|
|
1880
|
+
async function nr(e, t, n) {
|
|
1877
1881
|
if (t.refreshTokens === !1) return;
|
|
1878
|
-
|
|
1882
|
+
In(J(t.transport), q(t.mode));
|
|
1879
1883
|
let r = t.formHandle || e.dataset.formieHandle;
|
|
1880
1884
|
if (!r) return;
|
|
1881
|
-
let i = await
|
|
1882
|
-
|
|
1885
|
+
let i = await M(Nn(t, e), r, n.querySelector("input[name=\"renderId\"]")?.value || void 0);
|
|
1886
|
+
er(n, i), h(e, "formie:refresh-tokens:refreshed", i);
|
|
1883
1887
|
}
|
|
1884
|
-
function
|
|
1885
|
-
let o = String(t.dataset.formieSubmitMethod || "").trim().toLowerCase(), s =
|
|
1888
|
+
function rr(e, t, n, r, i, a) {
|
|
1889
|
+
let o = String(t.dataset.formieSubmitMethod || "").trim().toLowerCase(), s = zn(n, e, t), c = !1, u = t.querySelectorAll("[data-formie-action]"), g = (e) => {
|
|
1886
1890
|
if (e) {
|
|
1887
1891
|
t.setAttribute("data-formie-pending-action", e);
|
|
1888
1892
|
return;
|
|
1889
1893
|
}
|
|
1890
1894
|
t.removeAttribute("data-formie-pending-action");
|
|
1891
1895
|
};
|
|
1892
|
-
if (
|
|
1893
|
-
let n =
|
|
1896
|
+
if (Bn(t)) {
|
|
1897
|
+
let n = pn(t, { shouldWarn: () => !Un(t) }), r = (e) => {
|
|
1894
1898
|
if (!(e instanceof CustomEvent)) return;
|
|
1895
1899
|
let t = e.detail;
|
|
1896
1900
|
t?.ok && t.action === "save" && n.scheduleBaselineCapture();
|
|
@@ -1901,7 +1905,7 @@ function nr(e, t, n, r, i, a) {
|
|
|
1901
1905
|
e.removeEventListener("formie:submit:result", r), t.removeEventListener("formie:state:reset", i), n.destroy();
|
|
1902
1906
|
});
|
|
1903
1907
|
}
|
|
1904
|
-
if (
|
|
1908
|
+
if (u.forEach((e) => {
|
|
1905
1909
|
let n = (e) => {
|
|
1906
1910
|
let n = e.currentTarget.getAttribute("data-formie-action"), r = t.querySelector("input[name=\"submitAction\"]");
|
|
1907
1911
|
g(n), n && r && (r.value = n);
|
|
@@ -1912,24 +1916,24 @@ function nr(e, t, n, r, i, a) {
|
|
|
1912
1916
|
}), t.querySelectorAll("[data-formie-tab-link]").forEach((n) => {
|
|
1913
1917
|
let r = async (n) => {
|
|
1914
1918
|
if (o !== "ajax") {
|
|
1915
|
-
|
|
1919
|
+
Kn(n) && Vn(t, "set-page");
|
|
1916
1920
|
return;
|
|
1917
1921
|
}
|
|
1918
1922
|
n.preventDefault();
|
|
1919
1923
|
let r = n.currentTarget, i = r?.getAttribute("data-formie-page-id"), a = r?.getAttribute("href");
|
|
1920
1924
|
if (!(!i || !a)) {
|
|
1921
|
-
p(t, i),
|
|
1925
|
+
p(t, i), h(e, "formie:page:navigate", {
|
|
1922
1926
|
pageId: i,
|
|
1923
1927
|
href: a
|
|
1924
1928
|
});
|
|
1925
1929
|
try {
|
|
1926
|
-
|
|
1930
|
+
h(e, "formie:page:navigate:after", {
|
|
1927
1931
|
pageId: i,
|
|
1928
1932
|
href: a,
|
|
1929
|
-
response: await
|
|
1933
|
+
response: await Ve(a, t, i)
|
|
1930
1934
|
});
|
|
1931
1935
|
} catch (t) {
|
|
1932
|
-
console.error("[formie] Failed to persist page navigation state.", t),
|
|
1936
|
+
console.error("[formie] Failed to persist page navigation state.", t), h(e, "formie:page:navigate:error", {
|
|
1933
1937
|
pageId: i,
|
|
1934
1938
|
href: a,
|
|
1935
1939
|
error: t
|
|
@@ -1940,9 +1944,9 @@ function nr(e, t, n, r, i, a) {
|
|
|
1940
1944
|
n.addEventListener("click", r), a.push(() => {
|
|
1941
1945
|
n.removeEventListener("click", r);
|
|
1942
1946
|
});
|
|
1943
|
-
}), !
|
|
1947
|
+
}), !Rn(t)) {
|
|
1944
1948
|
let e = !1, n = () => {
|
|
1945
|
-
e ||
|
|
1949
|
+
e || Un(t) || Gn(t) || (e = !0, He(s, t));
|
|
1946
1950
|
};
|
|
1947
1951
|
window.addEventListener("pagehide", n), window.addEventListener("beforeunload", n), a.push(() => {
|
|
1948
1952
|
window.removeEventListener("pagehide", n), window.removeEventListener("beforeunload", n);
|
|
@@ -1955,35 +1959,35 @@ function nr(e, t, n, r, i, a) {
|
|
|
1955
1959
|
if (t.getAttribute("data-formie-internal-resubmit") !== "true") return;
|
|
1956
1960
|
t.removeAttribute("data-formie-internal-resubmit");
|
|
1957
1961
|
} else t.removeAttribute("data-formie-internal-resubmit");
|
|
1958
|
-
let
|
|
1962
|
+
let u = a.submitter, p = u?.getAttribute("data-formie-action"), _ = t.getAttribute("data-formie-pending-action"), v = t.querySelector("input[name=\"submitAction\"]"), y = p || _ || v?.value || "submit", b = null, x = !1;
|
|
1959
1963
|
try {
|
|
1960
|
-
if (s) b = await
|
|
1964
|
+
if (s) b = await Wt({
|
|
1961
1965
|
target: e,
|
|
1962
1966
|
form: t,
|
|
1963
1967
|
bus: r,
|
|
1964
1968
|
validator: i,
|
|
1965
1969
|
validateOnSubmit: Z(t),
|
|
1966
1970
|
action: y,
|
|
1967
|
-
submitter:
|
|
1968
|
-
waitForSubmitDelay:
|
|
1971
|
+
submitter: u,
|
|
1972
|
+
waitForSubmitDelay: Yn,
|
|
1969
1973
|
onRefreshTokensAfterSubmit: async () => {
|
|
1970
|
-
await
|
|
1974
|
+
await nr(e, n, t);
|
|
1971
1975
|
},
|
|
1972
1976
|
dispatchSubmitResult: (t) => {
|
|
1973
|
-
|
|
1977
|
+
h(e, "formie:submit:result", t);
|
|
1974
1978
|
}
|
|
1975
1979
|
});
|
|
1976
1980
|
else {
|
|
1977
|
-
if (
|
|
1981
|
+
if (Ut(t), m(t, u), await Yn(t), b = await tt(t, y, r, {
|
|
1978
1982
|
validator: i,
|
|
1979
1983
|
validateOnSubmit: Z(t),
|
|
1980
1984
|
preflightOnly: !0
|
|
1981
1985
|
}), b.ok) {
|
|
1982
|
-
l(t, y), c = !0,
|
|
1986
|
+
l(t, y), c = !0, Vn(t, "submit"), g(null);
|
|
1983
1987
|
let e = !1, n = () => {
|
|
1984
|
-
if (e = !0, c = !1,
|
|
1988
|
+
if (e = !0, c = !1, Hn(t), d(t), i && Z(t)) {
|
|
1985
1989
|
let { scope: e, final: n } = f(t), r = i.submit(n ? t : e, { final: n });
|
|
1986
|
-
r.length > 0 &&
|
|
1990
|
+
r.length > 0 && L(t, {
|
|
1987
1991
|
ok: !1,
|
|
1988
1992
|
stage: "validate",
|
|
1989
1993
|
code: "VALIDATION_FAILED",
|
|
@@ -2005,7 +2009,7 @@ function nr(e, t, n, r, i, a) {
|
|
|
2005
2009
|
x = !0;
|
|
2006
2010
|
return;
|
|
2007
2011
|
}
|
|
2008
|
-
|
|
2012
|
+
L(t, b), h(e, "formie:submit:result", b), Hn(t);
|
|
2009
2013
|
}
|
|
2010
2014
|
} catch (n) {
|
|
2011
2015
|
c = !1, b = {
|
|
@@ -2013,25 +2017,25 @@ function nr(e, t, n, r, i, a) {
|
|
|
2013
2017
|
code: "SUBMIT_ERROR",
|
|
2014
2018
|
message: n instanceof Error ? n.message : "Submission failed.",
|
|
2015
2019
|
formErrors: [n instanceof Error ? n.message : "Submission failed."]
|
|
2016
|
-
},
|
|
2020
|
+
}, L(t, b), h(e, "formie:submit:result", b), Hn(t);
|
|
2017
2021
|
} finally {
|
|
2018
|
-
g(null), !s && !x && !
|
|
2022
|
+
g(null), !s && !x && !Ht(b) && d(t);
|
|
2019
2023
|
}
|
|
2020
2024
|
};
|
|
2021
2025
|
t.addEventListener("submit", _), a.push(() => {
|
|
2022
2026
|
t.removeEventListener("submit", _);
|
|
2023
2027
|
});
|
|
2024
2028
|
}
|
|
2025
|
-
async function
|
|
2029
|
+
async function ir(e, t, n) {
|
|
2026
2030
|
if (t.refreshTokens === !1 || !t.staticCache) return;
|
|
2027
|
-
|
|
2028
|
-
let r = t.formHandle || e.dataset.formieHandle, i =
|
|
2031
|
+
In(J(t.transport), q(t.mode));
|
|
2032
|
+
let r = t.formHandle || e.dataset.formieHandle, i = Nn(t, e), a = n?.querySelector("input[name=\"renderId\"]")?.value || void 0;
|
|
2029
2033
|
if (!r) return;
|
|
2030
|
-
let o = await
|
|
2031
|
-
!o || !n || (
|
|
2034
|
+
let o = await M(i, r, a);
|
|
2035
|
+
!o || !n || (er(n, o), h(e, "formie:refresh-tokens:after", o));
|
|
2032
2036
|
}
|
|
2033
|
-
function
|
|
2034
|
-
let e = /* @__PURE__ */ new Map(), t = new
|
|
2037
|
+
function ar() {
|
|
2038
|
+
let e = /* @__PURE__ */ new Map(), t = new R(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = [
|
|
2035
2039
|
"prepare",
|
|
2036
2040
|
"normalize",
|
|
2037
2041
|
"validate",
|
|
@@ -2054,11 +2058,11 @@ function ir() {
|
|
|
2054
2058
|
W.log("Unmount skipped (no mounted state).", { target: Q(t) });
|
|
2055
2059
|
return;
|
|
2056
2060
|
}
|
|
2057
|
-
|
|
2061
|
+
h(t, "formie:unmount:before", { id: i.instance.id }), i.unbinds.forEach((e) => {
|
|
2058
2062
|
e();
|
|
2059
2063
|
}), i.unbinds = [], i.validator?.destroy(), i.validator = null;
|
|
2060
2064
|
for (let e of i.modules) await e.destroy();
|
|
2061
|
-
i.modules = [], i.bus.clear(), e.delete(t),
|
|
2065
|
+
i.modules = [], i.bus.clear(), e.delete(t), h(t, "formie:unmount:after", { id: i.instance.id }), W.log("Unmount complete.", {
|
|
2062
2066
|
id: i.instance.id,
|
|
2063
2067
|
target: Q(t)
|
|
2064
2068
|
});
|
|
@@ -2084,56 +2088,56 @@ function ir() {
|
|
|
2084
2088
|
...o,
|
|
2085
2089
|
mode: q(o.mode ?? p.mode),
|
|
2086
2090
|
transport: J(o.transport ?? p.transport)
|
|
2087
|
-
},
|
|
2091
|
+
}, g = _e(m.compatibility);
|
|
2088
2092
|
if (m.mode !== "server-rendered" && !Y(r)) throw Error(`Formie ${m.mode} mode is not implemented yet in the browser client.`);
|
|
2089
|
-
let
|
|
2090
|
-
m.staticCache = o.staticCache ??
|
|
2091
|
-
let
|
|
2092
|
-
...
|
|
2093
|
-
...
|
|
2094
|
-
} : null, ee =
|
|
2093
|
+
let v = await tr(r, m), b = Y(r);
|
|
2094
|
+
m.staticCache = o.staticCache ?? On(b ? b.dataset : r.dataset);
|
|
2095
|
+
let x = Zn(r, b), S = v || x ? {
|
|
2096
|
+
...v || {},
|
|
2097
|
+
...x || {}
|
|
2098
|
+
} : null, ee = S?.theme, C = {}, w = (S?.modules || []).filter((e) => !!e?.id && !!e?.type);
|
|
2095
2099
|
W.log("Resolved mount payload.", {
|
|
2096
2100
|
target: Q(r),
|
|
2097
|
-
hasRenderPayload: !!
|
|
2098
|
-
hasEmbeddedPayload: !!
|
|
2099
|
-
moduleCount:
|
|
2101
|
+
hasRenderPayload: !!v,
|
|
2102
|
+
hasEmbeddedPayload: !!x,
|
|
2103
|
+
moduleCount: w.length
|
|
2100
2104
|
});
|
|
2101
|
-
let
|
|
2102
|
-
live:
|
|
2103
|
-
errorAriaLive: we(
|
|
2104
|
-
errorMessage:
|
|
2105
|
-
fieldContainerErrorClass:
|
|
2106
|
-
inputErrorClass:
|
|
2107
|
-
messagesClass:
|
|
2108
|
-
messageClass:
|
|
2105
|
+
let T = te(r, ee, b), E = b ? new pt(b, {
|
|
2106
|
+
live: Ln(b.dataset.formieValidationOnFocus),
|
|
2107
|
+
errorAriaLive: we(b),
|
|
2108
|
+
errorMessage: b.dataset.formieErrorMessage || "",
|
|
2109
|
+
fieldContainerErrorClass: T.fieldLayoutError || [],
|
|
2110
|
+
inputErrorClass: T.fieldControlError || [],
|
|
2111
|
+
messagesClass: T.fieldErrors || [],
|
|
2112
|
+
messageClass: T.fieldError || []
|
|
2109
2113
|
}) : null;
|
|
2110
|
-
if (
|
|
2111
|
-
let e =
|
|
2112
|
-
e.formieValidation =
|
|
2114
|
+
if (b && E) {
|
|
2115
|
+
let e = b;
|
|
2116
|
+
e.formieValidation = E, C.validation = E;
|
|
2113
2117
|
let t = {
|
|
2114
|
-
validator:
|
|
2115
|
-
addValidator:
|
|
2116
|
-
removeValidator:
|
|
2118
|
+
validator: E,
|
|
2119
|
+
addValidator: E.addValidator.bind(E),
|
|
2120
|
+
removeValidator: E.removeValidator.bind(E)
|
|
2117
2121
|
};
|
|
2118
|
-
|
|
2122
|
+
h(b, "formie:validator:ready", t), h(r, "formie:validator:ready", t);
|
|
2119
2123
|
}
|
|
2120
|
-
|
|
2121
|
-
let
|
|
2124
|
+
b && (sn(b), m.themeConfig && typeof m.themeConfig == "object" && b.setAttribute("data-formie-theme-config", JSON.stringify(m.themeConfig)), m.theme && m.theme !== "formie" && b.setAttribute("data-formie-frontend-theme", m.theme), (v || m.endpoint || r.dataset.formieEndpoint) && Fn(r, b, m), m.mode === "server-rendered" && Ne(b) && (Me(b), Pe(b)), y(b)), Object.keys(T).length && h(r, "formie:theme:applied", { hasClasses: !0 });
|
|
2125
|
+
let D = await an(w, {
|
|
2122
2126
|
registry: t,
|
|
2123
2127
|
matchContext: {
|
|
2124
2128
|
root: r,
|
|
2125
|
-
form:
|
|
2129
|
+
form: b,
|
|
2126
2130
|
mode: m.mode
|
|
2127
2131
|
},
|
|
2128
2132
|
setupContext: {
|
|
2129
2133
|
formId: f,
|
|
2130
2134
|
root: r,
|
|
2131
|
-
form:
|
|
2135
|
+
form: b,
|
|
2132
2136
|
target: r,
|
|
2133
2137
|
scope: "form",
|
|
2134
|
-
state:
|
|
2138
|
+
state: C,
|
|
2135
2139
|
on: (e, t) => l.on(e, t),
|
|
2136
|
-
emit: (e, t) => (
|
|
2140
|
+
emit: (e, t) => (h(r, e, t), l.emitSafe(e, t).then((t) => {
|
|
2137
2141
|
t.failed.length > 0 && W.warn("Lifecycle listeners failed.", {
|
|
2138
2142
|
eventName: e,
|
|
2139
2143
|
failed: t.failed.length
|
|
@@ -2143,9 +2147,9 @@ function ir() {
|
|
|
2143
2147
|
});
|
|
2144
2148
|
W.log("Module setup complete.", {
|
|
2145
2149
|
target: Q(r),
|
|
2146
|
-
moduleInstances:
|
|
2150
|
+
moduleInstances: D.length
|
|
2147
2151
|
});
|
|
2148
|
-
let
|
|
2152
|
+
let O = {
|
|
2149
2153
|
id: f,
|
|
2150
2154
|
root: r,
|
|
2151
2155
|
submit: async (e = "submit") => {
|
|
@@ -2153,34 +2157,34 @@ function ir() {
|
|
|
2153
2157
|
id: f,
|
|
2154
2158
|
target: Q(r),
|
|
2155
2159
|
action: e
|
|
2156
|
-
}), !
|
|
2160
|
+
}), !b) return {
|
|
2157
2161
|
ok: !1,
|
|
2158
2162
|
code: "FORM_NOT_FOUND",
|
|
2159
2163
|
message: "No form element found for mount target.",
|
|
2160
2164
|
formErrors: ["No form element found for mount target."]
|
|
2161
2165
|
};
|
|
2162
|
-
let t =
|
|
2163
|
-
if (t && (t.value = e),
|
|
2166
|
+
let t = b.querySelector("input[name=\"submitAction\"]");
|
|
2167
|
+
if (t && (t.value = e), b.getAttribute("data-formie-loading") === "true") return {
|
|
2164
2168
|
ok: !1,
|
|
2165
2169
|
code: "SUBMIT_IN_PROGRESS",
|
|
2166
2170
|
message: "Submission already in progress.",
|
|
2167
2171
|
formErrors: []
|
|
2168
2172
|
};
|
|
2169
|
-
let n =
|
|
2173
|
+
let n = b.querySelector(`[data-formie-action="${e}"]`), i = await Wt({
|
|
2170
2174
|
id: f,
|
|
2171
2175
|
target: r,
|
|
2172
|
-
form:
|
|
2176
|
+
form: b,
|
|
2173
2177
|
bus: l,
|
|
2174
|
-
validator:
|
|
2175
|
-
validateOnSubmit: Z(
|
|
2178
|
+
validator: E,
|
|
2179
|
+
validateOnSubmit: Z(b),
|
|
2176
2180
|
action: e,
|
|
2177
2181
|
submitter: n,
|
|
2178
|
-
waitForSubmitDelay:
|
|
2182
|
+
waitForSubmitDelay: Yn,
|
|
2179
2183
|
onRefreshTokensAfterSubmit: async () => {
|
|
2180
|
-
await
|
|
2184
|
+
await nr(r, m, b);
|
|
2181
2185
|
},
|
|
2182
2186
|
dispatchSubmitResult: (e) => {
|
|
2183
|
-
|
|
2187
|
+
h(r, "formie:submit:result", e);
|
|
2184
2188
|
}
|
|
2185
2189
|
});
|
|
2186
2190
|
return W.log("Submit completed.", {
|
|
@@ -2196,62 +2200,62 @@ function ir() {
|
|
|
2196
2200
|
},
|
|
2197
2201
|
on: (e, t) => l.on(e, t)
|
|
2198
2202
|
};
|
|
2199
|
-
|
|
2203
|
+
b && (Ce({
|
|
2200
2204
|
target: r,
|
|
2201
|
-
form:
|
|
2202
|
-
validatorDetail:
|
|
2203
|
-
validator:
|
|
2204
|
-
addValidator:
|
|
2205
|
-
removeValidator:
|
|
2205
|
+
form: b,
|
|
2206
|
+
validatorDetail: E ? {
|
|
2207
|
+
validator: E,
|
|
2208
|
+
addValidator: E.addValidator.bind(E),
|
|
2209
|
+
removeValidator: E.removeValidator.bind(E)
|
|
2206
2210
|
} : null,
|
|
2207
|
-
options:
|
|
2211
|
+
options: g,
|
|
2208
2212
|
unbinds: d
|
|
2209
2213
|
}), Se({
|
|
2210
2214
|
target: r,
|
|
2211
|
-
form:
|
|
2212
|
-
instance:
|
|
2213
|
-
options:
|
|
2215
|
+
form: b,
|
|
2216
|
+
instance: O,
|
|
2217
|
+
options: g,
|
|
2214
2218
|
unbinds: d
|
|
2215
|
-
})),
|
|
2219
|
+
})), b && (rr(r, b, m, l, E, d), E && (d.push(_(b, E, r)), d.push(vn(b))), await ir(r, m, b)), i.forEach((e) => {
|
|
2216
2220
|
let t = l.on(`formie:stage:${e}:before`, async (t) => {
|
|
2217
|
-
|
|
2221
|
+
h(r, `formie:stage:${e}:before`, t);
|
|
2218
2222
|
}), n = l.on(`formie:stage:${e}:before`, async (e) => {
|
|
2219
|
-
for (let t of
|
|
2223
|
+
for (let t of D) t.onBeforeStage && await t.onBeforeStage(e);
|
|
2220
2224
|
}), i = l.on(`formie:stage:${e}:after`, async (t) => {
|
|
2221
|
-
|
|
2225
|
+
h(r, `formie:stage:${e}:after`, t);
|
|
2222
2226
|
}), a = l.on(`formie:stage:${e}:after`, async (e) => {
|
|
2223
2227
|
let t = e;
|
|
2224
|
-
for (let e of
|
|
2228
|
+
for (let e of D) e.onAfterStage && await e.onAfterStage(t, t.result);
|
|
2225
2229
|
});
|
|
2226
2230
|
d.push(t, n, i, a);
|
|
2227
2231
|
});
|
|
2228
2232
|
let ne = l.on("formie:submit:before", async (e) => {
|
|
2229
|
-
|
|
2233
|
+
h(r, "formie:submit:before", e);
|
|
2230
2234
|
}), re = l.on("formie:submit:after", async (e) => {
|
|
2231
|
-
|
|
2235
|
+
h(r, "formie:submit:after", e);
|
|
2232
2236
|
}), ie = l.on("formie:submit:final:before", async (e) => {
|
|
2233
|
-
|
|
2237
|
+
h(r, "formie:submit:final:before", e);
|
|
2234
2238
|
}), ae = l.on("formie:submit:final:after", async (e) => {
|
|
2235
|
-
|
|
2239
|
+
h(r, "formie:submit:final:after", e);
|
|
2236
2240
|
});
|
|
2237
2241
|
return d.push(ne, re, ie, ae), e.set(r, {
|
|
2238
2242
|
options: m,
|
|
2239
2243
|
bus: l,
|
|
2240
|
-
form:
|
|
2241
|
-
validator:
|
|
2242
|
-
modules:
|
|
2244
|
+
form: b,
|
|
2245
|
+
validator: E,
|
|
2246
|
+
modules: D,
|
|
2243
2247
|
unbinds: d,
|
|
2244
|
-
instance:
|
|
2245
|
-
}),
|
|
2248
|
+
instance: O
|
|
2249
|
+
}), h(r, "formie:mount:after", {
|
|
2246
2250
|
id: f,
|
|
2247
2251
|
mode: m.mode
|
|
2248
|
-
}), W.log("Mount complete.", {
|
|
2252
|
+
}), b instanceof HTMLFormElement && u(b), W.log("Mount complete.", {
|
|
2249
2253
|
id: f,
|
|
2250
2254
|
target: Q(r),
|
|
2251
2255
|
mode: m.mode
|
|
2252
|
-
}),
|
|
2256
|
+
}), O;
|
|
2253
2257
|
}, s = (t, r) => {
|
|
2254
|
-
if (!r.autoVisible ||
|
|
2258
|
+
if (!r.autoVisible || Qn(t) || typeof IntersectionObserver > "u") return o(t, r);
|
|
2255
2259
|
if (e.has(t)) return Promise.resolve(e.get(t)?.instance || null);
|
|
2256
2260
|
if (n.has(t)) return W.log("Mount deferred (already waiting visibility).", { target: Q(t) }), Promise.resolve(null);
|
|
2257
2261
|
let i = new IntersectionObserver((e) => {
|
|
@@ -2278,15 +2282,15 @@ function ir() {
|
|
|
2278
2282
|
...r.options,
|
|
2279
2283
|
...n
|
|
2280
2284
|
};
|
|
2281
|
-
let i = te(t, n.payload?.theme || r.options.payload?.theme ||
|
|
2282
|
-
return r.validator && (r.validator.config.fieldContainerErrorClass = i.fieldLayoutError || [], r.validator.config.inputErrorClass = i.fieldControlError || [], r.validator.config.messagesClass = i.fieldErrors || [], r.validator.config.messageClass = i.fieldError || []), Object.keys(i).length &&
|
|
2285
|
+
let i = te(t, n.payload?.theme || r.options.payload?.theme || Zn(t, r.form)?.theme, r.form);
|
|
2286
|
+
return r.validator && (r.validator.config.fieldContainerErrorClass = i.fieldLayoutError || [], r.validator.config.inputErrorClass = i.fieldControlError || [], r.validator.config.messagesClass = i.fieldErrors || [], r.validator.config.messageClass = i.fieldError || []), Object.keys(i).length && h(t, "formie:theme:applied", {
|
|
2283
2287
|
hasClasses: !0,
|
|
2284
2288
|
reason: "update"
|
|
2285
2289
|
}), r.instance;
|
|
2286
2290
|
},
|
|
2287
2291
|
getInstance: (t) => e.get(t)?.instance || null,
|
|
2288
2292
|
refreshForCache: async (t) => {
|
|
2289
|
-
|
|
2293
|
+
kn("refreshForCache", "Global `Formie.refreshForCache()` has been deprecated. Use built-in static-cache token refresh handling instead.");
|
|
2290
2294
|
let n = null;
|
|
2291
2295
|
if (n = typeof t == "string" ? document.getElementById(t) || document.querySelector(`[data-formie-form-id="${t}"]`) : t, !n) {
|
|
2292
2296
|
W.warn("refreshForCache target not found.", { targetOrId: t });
|
|
@@ -2297,13 +2301,13 @@ function ir() {
|
|
|
2297
2301
|
W.warn("refreshForCache found no form element for target.", { target: Q(n) });
|
|
2298
2302
|
return;
|
|
2299
2303
|
}
|
|
2300
|
-
let o = a.formHandle || n.dataset.formieHandle || i.dataset.formieHandle, s =
|
|
2304
|
+
let o = a.formHandle || n.dataset.formieHandle || i.dataset.formieHandle, s = Nn(a, n), c = i.querySelector("input[name=\"renderId\"]")?.value || void 0;
|
|
2301
2305
|
if (!o) {
|
|
2302
2306
|
W.warn("refreshForCache found no form handle for target.", { target: Q(n) });
|
|
2303
2307
|
return;
|
|
2304
2308
|
}
|
|
2305
|
-
let l = await
|
|
2306
|
-
l && (
|
|
2309
|
+
let l = await M(s, o, c);
|
|
2310
|
+
l && (er(i, l), h(n, "formie:refresh-tokens:after", l));
|
|
2307
2311
|
},
|
|
2308
2312
|
registerModule: (e, n) => t.register(e, n),
|
|
2309
2313
|
unregisterModule: (e) => {
|
|
@@ -2344,7 +2348,7 @@ function ir() {
|
|
|
2344
2348
|
subtree: !0
|
|
2345
2349
|
}), () => {
|
|
2346
2350
|
i.disconnect(), W.log("Observer stopped."), n.forEach((e, t) => {
|
|
2347
|
-
|
|
2351
|
+
$n(t, r) && (e(), n.delete(t));
|
|
2348
2352
|
});
|
|
2349
2353
|
let t = [];
|
|
2350
2354
|
r instanceof Element && r.matches(U) && t.push(r), r.querySelectorAll(U).forEach((e) => {
|
|
@@ -2358,9 +2362,9 @@ function ir() {
|
|
|
2358
2362
|
}
|
|
2359
2363
|
//#endregion
|
|
2360
2364
|
//#region src/js/core/hydrate-modules.ts
|
|
2361
|
-
var
|
|
2362
|
-
async function
|
|
2363
|
-
let t = e.root, n = e.form ?? (t instanceof HTMLFormElement ? t : t.closest("form")), r = e.modules ?? [], i = e.mode ?? "server-rendered", a = e.registry ?? new
|
|
2365
|
+
var or = C("general", "module-hydrator");
|
|
2366
|
+
async function sr(e) {
|
|
2367
|
+
let t = e.root, n = e.form ?? (t instanceof HTMLFormElement ? t : t.closest("form")), r = e.modules ?? [], i = e.mode ?? "server-rendered", a = e.registry ?? new R(), o = new Fe(), s = await an(r, {
|
|
2364
2368
|
registry: a,
|
|
2365
2369
|
setupContext: {
|
|
2366
2370
|
formId: n?.id || t.id || "formie-modules",
|
|
@@ -2381,13 +2385,13 @@ async function or(e) {
|
|
|
2381
2385
|
mode: i
|
|
2382
2386
|
}
|
|
2383
2387
|
});
|
|
2384
|
-
return
|
|
2388
|
+
return or.log("Hydrated module manifest.", {
|
|
2385
2389
|
moduleCount: r.length,
|
|
2386
2390
|
instanceCount: s.length,
|
|
2387
2391
|
mode: i
|
|
2388
2392
|
}), {
|
|
2389
2393
|
destroy: async () => {
|
|
2390
|
-
await
|
|
2394
|
+
await cr(s), o.clear();
|
|
2391
2395
|
},
|
|
2392
2396
|
on: (e, t) => o.on(e, t),
|
|
2393
2397
|
emit: async (e, t) => {
|
|
@@ -2400,11 +2404,11 @@ async function or(e) {
|
|
|
2400
2404
|
getRegisteredModules: () => a.getAll()
|
|
2401
2405
|
};
|
|
2402
2406
|
}
|
|
2403
|
-
async function
|
|
2407
|
+
async function cr(e) {
|
|
2404
2408
|
for (let t of e) try {
|
|
2405
2409
|
await t.destroy();
|
|
2406
2410
|
} catch (e) {
|
|
2407
|
-
console.error("[formie] Failed to destroy module instance.", e),
|
|
2411
|
+
console.error("[formie] Failed to destroy module instance.", e), or.warn("Failed destroying module instance.", { error: e });
|
|
2408
2412
|
}
|
|
2409
2413
|
}
|
|
2410
2414
|
//#endregion
|
|
@@ -2412,41 +2416,41 @@ async function sr(e) {
|
|
|
2412
2416
|
function $(e) {
|
|
2413
2417
|
return e instanceof Element;
|
|
2414
2418
|
}
|
|
2415
|
-
function
|
|
2419
|
+
function lr(e) {
|
|
2416
2420
|
return e.ok;
|
|
2417
2421
|
}
|
|
2418
|
-
function
|
|
2422
|
+
function ur(e) {
|
|
2419
2423
|
return typeof e == "string" ? `selector "${e}"` : $(e) ? `element "${e.tagName.toLowerCase()}"` : "provided element collection";
|
|
2420
2424
|
}
|
|
2421
|
-
function
|
|
2425
|
+
function dr(e) {
|
|
2422
2426
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
2423
2427
|
for (let r of e) !$(r) || t.has(r) || (t.add(r), n.push(r));
|
|
2424
2428
|
return n;
|
|
2425
2429
|
}
|
|
2426
|
-
function
|
|
2427
|
-
return typeof e == "string" ? Array.from(document.querySelectorAll(e)) : $(e) ? [e] :
|
|
2430
|
+
function fr(e) {
|
|
2431
|
+
return typeof e == "string" ? Array.from(document.querySelectorAll(e)) : $(e) ? [e] : dr(e);
|
|
2428
2432
|
}
|
|
2429
|
-
function
|
|
2433
|
+
function pr() {
|
|
2430
2434
|
return document.readyState === "loading" ? new Promise((e) => {
|
|
2431
2435
|
document.addEventListener("DOMContentLoaded", () => e(), { once: !0 });
|
|
2432
2436
|
}) : Promise.resolve();
|
|
2433
2437
|
}
|
|
2434
|
-
async function
|
|
2435
|
-
let t =
|
|
2436
|
-
return t.length > 0 || typeof e != "string" ? t : (await
|
|
2438
|
+
async function mr(e) {
|
|
2439
|
+
let t = fr(e);
|
|
2440
|
+
return t.length > 0 || typeof e != "string" ? t : (await pr(), fr(e));
|
|
2437
2441
|
}
|
|
2438
|
-
function
|
|
2442
|
+
function hr(e) {
|
|
2439
2443
|
return typeof e == "string" ? document : $(e) ? e.getRootNode() : document;
|
|
2440
2444
|
}
|
|
2441
|
-
function
|
|
2445
|
+
function gr(e) {
|
|
2442
2446
|
let { element: t, observe: n, allowEmpty: r, client: i, onReady: a, onResult: o, onSuccess: s, onError: c, onEvent: l, ...u } = e;
|
|
2443
2447
|
return {
|
|
2444
2448
|
mode: "server-rendered",
|
|
2445
2449
|
...u
|
|
2446
2450
|
};
|
|
2447
2451
|
}
|
|
2448
|
-
async function
|
|
2449
|
-
let i = [], o =
|
|
2452
|
+
async function _r(e, t, n, r) {
|
|
2453
|
+
let i = [], o = gr(e);
|
|
2450
2454
|
for (let s of r) {
|
|
2451
2455
|
let r = n.get(s);
|
|
2452
2456
|
if (r) {
|
|
@@ -2456,7 +2460,7 @@ async function gr(e, t, n, r) {
|
|
|
2456
2460
|
let c = await t.mount(s, o), l = [];
|
|
2457
2461
|
if (e.onReady?.(c), l.push(c.on("formie:submit:result", (t) => {
|
|
2458
2462
|
let n = t;
|
|
2459
|
-
e.onResult?.(n, c),
|
|
2463
|
+
e.onResult?.(n, c), lr(n) ? e.onSuccess?.(n, c) : e.onError?.(n, c);
|
|
2460
2464
|
})), e.onEvent) for (let t of a) l.push(c.on(t, (n) => {
|
|
2461
2465
|
e.onEvent?.({
|
|
2462
2466
|
name: t,
|
|
@@ -2470,11 +2474,11 @@ async function gr(e, t, n, r) {
|
|
|
2470
2474
|
}
|
|
2471
2475
|
return i;
|
|
2472
2476
|
}
|
|
2473
|
-
async function
|
|
2474
|
-
let t = e.client ??
|
|
2475
|
-
if (r.length === 0 && !e.allowEmpty) throw Error(`Formie could not find any elements for ${
|
|
2476
|
-
await
|
|
2477
|
-
let i = e.observe ? t.observe(
|
|
2477
|
+
async function vr(e) {
|
|
2478
|
+
let t = e.client ?? ar(), n = /* @__PURE__ */ new Map(), r = await mr(e.element);
|
|
2479
|
+
if (r.length === 0 && !e.allowEmpty) throw Error(`Formie could not find any elements for ${ur(e.element)}.`);
|
|
2480
|
+
await _r(e, t, n, r);
|
|
2481
|
+
let i = e.observe ? t.observe(hr(e.element)) : null;
|
|
2478
2482
|
return {
|
|
2479
2483
|
client: t,
|
|
2480
2484
|
get instances() {
|
|
@@ -2485,8 +2489,8 @@ async function _r(e) {
|
|
|
2485
2489
|
return r ? n.get(r)?.instance ?? t.getInstance(r) : null;
|
|
2486
2490
|
},
|
|
2487
2491
|
async rescan() {
|
|
2488
|
-
let r =
|
|
2489
|
-
return r.length === 0 ? Array.from(n.values()).map(({ instance: e }) => e) :
|
|
2492
|
+
let r = fr(e.element);
|
|
2493
|
+
return r.length === 0 ? Array.from(n.values()).map(({ instance: e }) => e) : _r(e, t, n, r);
|
|
2490
2494
|
},
|
|
2491
2495
|
async destroy() {
|
|
2492
2496
|
i?.();
|
|
@@ -2496,4 +2500,4 @@ async function _r(e) {
|
|
|
2496
2500
|
};
|
|
2497
2501
|
}
|
|
2498
2502
|
//#endregion
|
|
2499
|
-
export { a as FORMIE_HTML_EVENT_NAMES,
|
|
2503
|
+
export { a as FORMIE_HTML_EVENT_NAMES, pt as FormieValidator, he as LEGACY_FORMIE_DOM_EVENT_BRIDGES, ge as LEGACY_FORMIE_VALIDATOR_EVENT_BRIDGES, R as ModuleRegistry, Se as bindLegacyDomEventCompatibility, Ce as bindLegacyValidatorCompatibility, fe as buildFieldValueRegistry, C as createDebug, ar as createFormieClient, S as debugLog, ee as debugWarn, me as defineAddressModule, oe as defineCaptchaModule, ae as definePassiveCaptchaModule, v as definePaymentModule, le as fieldKeyToInputName, vr as formie, i as getFieldModuleEventName, ie as getFormieTranslations, r as getGlobalModuleLifecycleEventName, e as getScopedModuleLifecycleEventName, sr as hydrateFormieModules, se as inputNameToFieldKey, x as isFormieDebugEnabled, ne as mergeFormieTranslations, ce as normalizeFieldKey, o as normalizeFormieEventName, ue as parseFieldReference, pe as resolveFieldReferenceFromFormData, de as resolveFieldReferenceLive, _e as resolveLegacyCompatibilityOptions, b as setFormieDebugEnabled, re as setFormieTranslations, O as t, t as toDomEventName, D as translate };
|