@verbb/formie-browser 1.0.14 → 1.0.15
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 +30 -0
- package/dist/chunks/{address-country-Dn71jroa.js → address-country-BcEQKw0T.js} +1 -1
- package/dist/chunks/{address-finder-O49uDRoR.js → address-finder-BWGINCSA.js} +1 -1
- package/dist/chunks/{address-state-ByYatUur.js → address-state-DI3ndhMU.js} +98 -88
- package/dist/chunks/{api-DYYsVIub.js → api-BK9b340y.js} +16 -16
- package/dist/chunks/{api-D6kJ7kXZ.js → api-Dxl_CKw-.js} +30 -25
- package/dist/chunks/{async-nPFRNQ06.js → async-2GdXNFCE.js} +18 -1
- package/dist/chunks/{bpoint-D0RKFM4F.js → bpoint-BwtuyN_O.js} +1 -1
- package/dist/chunks/{captcha-eu-DERJbXnH.js → captcha-eu-DWLoQFKB.js} +2 -2
- package/dist/chunks/{combobox-CWNdx4Fk.js → combobox-Ba08_cHL.js} +259 -258
- package/dist/chunks/{conditions-DqNHLTbN.js → conditions-Ceeg6ReZ.js} +113 -110
- package/dist/chunks/{date-picker-RUnevF7l.js → date-picker-DaPvMrop.js} +12 -11
- package/dist/chunks/{eway-or6dtjoT.js → eway-uw0DzU-L.js} +3 -3
- package/dist/chunks/{file-upload-Bm-TXyNB.js → file-upload-B8_mH012.js} +28 -16
- package/dist/chunks/{friendly-captcha-v1-GFqCt1Mh.js → friendly-captcha-v1-CVXaXgDO.js} +1 -1
- package/dist/chunks/{friendly-captcha-v2-WoW246JG.js → friendly-captcha-v2-DkeIVTKI.js} +1 -1
- package/dist/chunks/{go-cardless-DzJ-0FKg.js → go-cardless-c4wLJdOt.js} +1 -1
- package/dist/chunks/{google-address-C1P1nTDM.js → google-address-JHYvjwgN.js} +13 -8
- package/dist/chunks/{hcaptcha-D0T8aIHz.js → hcaptcha-Dt3ELLlP.js} +2 -2
- package/dist/chunks/{loqate-DD1S7PY9.js → loqate-m51iPyO1.js} +1 -1
- package/dist/chunks/{mollie-DG8Ju83x.js → mollie-Bn0PX173.js} +1 -1
- package/dist/chunks/{moneris-C8m3Fvqu.js → moneris-BRbUvI4t.js} +1 -1
- package/dist/chunks/{opayo-B3EvrVxw.js → opayo-BwWdInEP.js} +2 -2
- package/dist/chunks/{paddle-BIYR9Um3.js → paddle-CympHVvd.js} +2 -2
- package/dist/chunks/{paypal-B_yxIo2d.js → paypal-h75h6wae.js} +2 -2
- package/dist/chunks/{payway-CeOzS0sL.js → payway-C9rHTCC_.js} +2 -2
- package/dist/chunks/{phone-country-bAqje17P.js → phone-country-B8fv-L5_.js} +1 -1
- package/dist/chunks/{place-kit-BE5gi3vo.js → place-kit-BnZGQ-L1.js} +8 -8
- package/dist/chunks/{recaptcha-enterprise-CruXddZq.js → recaptcha-enterprise-CUs8BO6V.js} +2 -2
- package/dist/chunks/{recaptcha-shared-AQRMDMme.js → recaptcha-shared-DTbTw-MF.js} +2 -2
- package/dist/chunks/{recaptcha-v2-checkbox-CCnJYCnG.js → recaptcha-v2-checkbox-P1McW4Pv.js} +2 -2
- package/dist/chunks/{recaptcha-v2-invisible-BuVqRRYn.js → recaptcha-v2-invisible-FGDqozSP.js} +2 -2
- package/dist/chunks/{recaptcha-v3-CloqhO2A.js → recaptcha-v3-CflUHeZD.js} +2 -2
- package/dist/chunks/{repeater-DwE27jI1.js → repeater-CyhDbozO.js} +47 -33
- package/dist/chunks/{scripts-CbQ7agX3.js → scripts-DrccjrFv.js} +1 -1
- package/dist/chunks/skip-CEW89ExY.js +7 -0
- package/dist/chunks/{snaptcha-C04kNGYQ.js → snaptcha-C3QLYxFT.js} +1 -1
- package/dist/chunks/{square-DEzxv9D9.js → square-C1z5DPVw.js} +2 -2
- package/dist/chunks/{stripe-CVPQGDz3.js → stripe-Dmkdkq1y.js} +2 -2
- package/dist/chunks/{summary-BF_8mrXI.js → summary-Bn-g5SDx.js} +1 -1
- package/dist/chunks/{table-DnIBdeKF.js → table-j7MlLLCc.js} +1 -1
- package/dist/chunks/{turnstile-n9DNyPxi.js → turnstile-ptihQfLl.js} +2 -2
- package/dist/chunks/{upload-manager-BbiUosZq.js → upload-manager-BW7l-BhF.js} +248 -236
- package/dist/index.js +548 -535
- package/dist/js/core/create-formie-client.d.ts.map +1 -1
- package/dist/js/core/submit-result-state.d.ts.map +1 -1
- package/dist/js/core/submit-result-ui.d.ts +3 -1
- package/dist/js/core/submit-result-ui.d.ts.map +1 -1
- package/dist/js/modules/address/google-address.d.ts +10 -0
- package/dist/js/modules/address/google-address.d.ts.map +1 -1
- package/dist/js/modules/address/place-kit.d.ts.map +1 -1
- package/dist/js/modules/fields/address-state.d.ts.map +1 -1
- package/dist/js/modules/fields/combobox.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions.d.ts.map +1 -1
- package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
- package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
- package/dist/js/modules/fields/repeater.d.ts.map +1 -1
- package/dist/js/modules/fields/upload-manager.d.ts.map +1 -1
- package/dist/js/utils/async.d.ts +1 -0
- package/dist/js/utils/async.d.ts.map +1 -1
- package/dist/js/validation/rules/required.d.ts.map +1 -1
- package/dist/js/validation/validator.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/js/core/create-formie-client.ts +17 -10
- package/src/js/core/submit-result-state.ts +17 -0
- package/src/js/core/submit-result-ui.ts +4 -3
- package/src/js/modules/address/google-address.ts +95 -37
- package/src/js/modules/address/place-kit.ts +13 -7
- package/src/js/modules/fields/address-country.ts +5 -5
- package/src/js/modules/fields/address-state.ts +74 -23
- package/src/js/modules/fields/combobox.ts +3 -0
- package/src/js/modules/fields/conditions/effects.ts +4 -5
- package/src/js/modules/fields/conditions.ts +6 -0
- package/src/js/modules/fields/date-picker.ts +6 -3
- package/src/js/modules/fields/file-upload.ts +44 -14
- package/src/js/modules/fields/phone-country.ts +2 -2
- package/src/js/modules/fields/repeater.ts +55 -4
- package/src/js/modules/fields/upload-manager.ts +54 -18
- package/src/js/utils/async.ts +34 -0
- package/src/js/validation/rules/required.ts +12 -0
- package/src/js/validation/validator.ts +14 -2
package/dist/index.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { n as e } from "./chunks/request-profile-DhwkeCpS.js";
|
|
2
2
|
import { i as t, m as n, t as r } from "./chunks/dist-ZLeW0zZ3.js";
|
|
3
3
|
import { c as i, d as a, l as o, o as s, r as c, t as l, u } from "./chunks/event-names-BCI2FLD8.js";
|
|
4
|
-
import { a as d, c as f, d as p, f as m, i as h, l as g, n as _, o as v, p as y, r as b, s as x, t as S, u as C } from "./chunks/api-
|
|
5
|
-
import { a as ee, i as te, n as
|
|
6
|
-
import { i as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { n as
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
4
|
+
import { a as d, c as f, d as p, f as m, i as h, l as g, n as _, o as v, p as y, r as b, s as x, t as S, u as C } from "./chunks/api-Dxl_CKw-.js";
|
|
5
|
+
import { a as ee, i as te, n as w, r as T, t as E } from "./chunks/debug-BV0DvdHx.js";
|
|
6
|
+
import { i as D, r as ne, t as O } from "./chunks/theme-classes-DAQuEqdP.js";
|
|
7
|
+
import { n as k } from "./chunks/skip-CEW89ExY.js";
|
|
8
|
+
import { i as re, t as ie } from "./chunks/csrf-DxHg_ZYt.js";
|
|
9
|
+
import { n as A, t as ae } from "./chunks/http-C2QdHuWO.js";
|
|
10
|
+
import { i as oe } from "./chunks/async-2GdXNFCE.js";
|
|
11
|
+
import { a as se, i as ce, n as le, r as ue, t as de } from "./chunks/i18n-BY1ds1BL.js";
|
|
12
|
+
import { n as fe, t as pe } from "./chunks/api-BK9b340y.js";
|
|
13
|
+
import { n as me, r as he, t as ge } from "./chunks/field-references.keys-58ZSTrCW.js";
|
|
14
|
+
import { i as _e, n as ve, r as ye, t as be } from "./chunks/field-references.resolver-Ca8MguFv.js";
|
|
15
|
+
import { t as xe } from "./chunks/api-ghNr2uxX.js";
|
|
14
16
|
//#region src/js/compatibility/event-map.ts
|
|
15
|
-
var
|
|
17
|
+
var Se = [
|
|
16
18
|
{
|
|
17
19
|
legacyEvent: "onFormieLoaded",
|
|
18
20
|
canonicalEvent: "formie:mount:after",
|
|
@@ -65,7 +67,7 @@ var xe = [
|
|
|
65
67
|
canonicalEvent: "formie:submit:after",
|
|
66
68
|
disposition: "approximate"
|
|
67
69
|
}
|
|
68
|
-
],
|
|
70
|
+
], Ce = [
|
|
69
71
|
{
|
|
70
72
|
legacyEvent: "formieValidatorInitialized",
|
|
71
73
|
canonicalEvent: "formie:validator:ready",
|
|
@@ -87,7 +89,7 @@ var xe = [
|
|
|
87
89
|
disposition: "safe"
|
|
88
90
|
}
|
|
89
91
|
];
|
|
90
|
-
function
|
|
92
|
+
function we(e) {
|
|
91
93
|
if (!e) return {
|
|
92
94
|
enabled: !1,
|
|
93
95
|
legacyDomEvents: !1,
|
|
@@ -107,18 +109,18 @@ function Ce(e) {
|
|
|
107
109
|
}
|
|
108
110
|
//#endregion
|
|
109
111
|
//#region src/js/compatibility/dom-adapter.ts
|
|
110
|
-
function
|
|
112
|
+
function Te(e, t, n) {
|
|
111
113
|
e.dispatchEvent(new CustomEvent(t, {
|
|
112
114
|
bubbles: !0,
|
|
113
115
|
detail: n
|
|
114
116
|
}));
|
|
115
117
|
}
|
|
116
|
-
function
|
|
118
|
+
function Ee(e, t) {
|
|
117
119
|
if (e.canonicalEvent !== "formie:submit:result") return !0;
|
|
118
120
|
let n = t;
|
|
119
121
|
return e.legacyEvent === "onAfterFormieSubmit" ? !!n?.ok : e.legacyEvent !== "onFormieSubmitError" || n?.ok === !1;
|
|
120
122
|
}
|
|
121
|
-
function
|
|
123
|
+
function De(e, t) {
|
|
122
124
|
let n = t && typeof t == "object" ? t : {}, r = typeof n.pageId == "string" ? n.pageId : "", i = Array.from(e.querySelectorAll("[data-formie-page-id]"));
|
|
123
125
|
return { data: {
|
|
124
126
|
nextPageId: r,
|
|
@@ -126,7 +128,7 @@ function Ee(e, t) {
|
|
|
126
128
|
totalPages: i.length
|
|
127
129
|
} };
|
|
128
130
|
}
|
|
129
|
-
function
|
|
131
|
+
function Oe(e, t, n, r, i) {
|
|
130
132
|
let a = globalThis.Formie || i;
|
|
131
133
|
return e.legacyEvent === "onFormieLoaded" ? { formie: a } : e.legacyEvent === "onFormieInit" ? {
|
|
132
134
|
formie: a,
|
|
@@ -138,12 +140,12 @@ function De(e, t, n, r, i) {
|
|
|
138
140
|
form: r,
|
|
139
141
|
target: n,
|
|
140
142
|
instance: i
|
|
141
|
-
} : e.legacyEvent === "onFormiePageToggle" ?
|
|
143
|
+
} : e.legacyEvent === "onFormiePageToggle" ? De(r, t) : t;
|
|
142
144
|
}
|
|
143
|
-
function
|
|
144
|
-
r.legacyDomEvents &&
|
|
145
|
+
function ke({ target: e, form: t, instance: n, options: r, unbinds: i }) {
|
|
146
|
+
r.legacyDomEvents && Se.forEach((r) => {
|
|
145
147
|
let o = (i) => {
|
|
146
|
-
i instanceof CustomEvent &&
|
|
148
|
+
i instanceof CustomEvent && Ee(r, i.detail) && Te(r.target === "document" ? document : t, r.legacyEvent, Oe(r, i.detail, e, t, n));
|
|
147
149
|
};
|
|
148
150
|
e.addEventListener(a(r.canonicalEvent), o), i.push(() => {
|
|
149
151
|
e.removeEventListener(a(r.canonicalEvent), o);
|
|
@@ -152,30 +154,30 @@ function Oe({ target: e, form: t, instance: n, options: r, unbinds: i }) {
|
|
|
152
154
|
}
|
|
153
155
|
//#endregion
|
|
154
156
|
//#region src/js/compatibility/validator-adapter.ts
|
|
155
|
-
function
|
|
157
|
+
function j(e, t, n) {
|
|
156
158
|
e.dispatchEvent(new CustomEvent(t, {
|
|
157
159
|
bubbles: !0,
|
|
158
160
|
detail: n
|
|
159
161
|
}));
|
|
160
162
|
}
|
|
161
|
-
function
|
|
163
|
+
function Ae(e, t) {
|
|
162
164
|
return !!e && typeof e == "object" && e.validator === t;
|
|
163
165
|
}
|
|
164
|
-
function
|
|
166
|
+
function je({ target: e, form: t, validatorDetail: n, options: r, unbinds: i }) {
|
|
165
167
|
if (!r.legacyValidatorEvents || !n) return;
|
|
166
168
|
let { validator: a, addValidator: o, removeValidator: s } = n, c = {
|
|
167
169
|
...n,
|
|
168
170
|
form: t,
|
|
169
171
|
target: e
|
|
170
172
|
};
|
|
171
|
-
|
|
173
|
+
j(document, "formieValidatorInitialized", c);
|
|
172
174
|
let l = (e) => {
|
|
173
|
-
e instanceof CustomEvent &&
|
|
175
|
+
e instanceof CustomEvent && Ae(e.detail, a) && j(document, "formieValidatorDestroyed", {
|
|
174
176
|
...c,
|
|
175
177
|
...e.detail
|
|
176
178
|
});
|
|
177
179
|
}, u = (n) => {
|
|
178
|
-
n instanceof CustomEvent &&
|
|
180
|
+
n instanceof CustomEvent && Ae(n.detail, a) && n.target instanceof Element && t.contains(n.target) && j(n.target, "formieValidatorShowError", {
|
|
179
181
|
...n.detail,
|
|
180
182
|
addValidator: o,
|
|
181
183
|
removeValidator: s,
|
|
@@ -183,7 +185,7 @@ function ke({ target: e, form: t, validatorDetail: n, options: r, unbinds: i })
|
|
|
183
185
|
target: e
|
|
184
186
|
});
|
|
185
187
|
}, d = (n) => {
|
|
186
|
-
n instanceof CustomEvent &&
|
|
188
|
+
n instanceof CustomEvent && Ae(n.detail, a) && n.target instanceof Element && t.contains(n.target) && j(n.target, "formieValidatorClearError", {
|
|
187
189
|
...n.detail,
|
|
188
190
|
addValidator: o,
|
|
189
191
|
removeValidator: s,
|
|
@@ -197,17 +199,17 @@ function ke({ target: e, form: t, validatorDetail: n, options: r, unbinds: i })
|
|
|
197
199
|
}
|
|
198
200
|
//#endregion
|
|
199
201
|
//#region src/js/core/error-aria-live.ts
|
|
200
|
-
function
|
|
202
|
+
function Me(e) {
|
|
201
203
|
let t = (e.dataset.formieErrorAriaLive || "polite").trim().toLowerCase();
|
|
202
204
|
return t === "assertive" || t === "off" ? t : "polite";
|
|
203
205
|
}
|
|
204
|
-
function
|
|
206
|
+
function Ne(e, t) {
|
|
205
207
|
return e === "off" ? null : t ? e : "polite";
|
|
206
208
|
}
|
|
207
|
-
function
|
|
209
|
+
function Pe(e) {
|
|
208
210
|
return e === "off" ? null : e;
|
|
209
211
|
}
|
|
210
|
-
function
|
|
212
|
+
function Fe(e, t) {
|
|
211
213
|
if (t) {
|
|
212
214
|
e.setAttribute("aria-live", t), e.setAttribute("aria-atomic", "true");
|
|
213
215
|
return;
|
|
@@ -216,11 +218,11 @@ function N(e, t) {
|
|
|
216
218
|
}
|
|
217
219
|
//#endregion
|
|
218
220
|
//#region src/js/core/field-error-aria.ts
|
|
219
|
-
function
|
|
221
|
+
function Ie(e, t) {
|
|
220
222
|
let n = (e.getAttribute("aria-describedby") || "").trim(), r = n ? n.split(/\s+/) : [];
|
|
221
223
|
r.includes(t) || r.push(t), e.setAttribute("aria-describedby", r.join(" ").trim());
|
|
222
224
|
}
|
|
223
|
-
function
|
|
225
|
+
function Le(e, t = document) {
|
|
224
226
|
let n = (e.getAttribute("aria-describedby") || "").trim();
|
|
225
227
|
if (!n) return;
|
|
226
228
|
let r = n.split(/\s+/).filter((e) => !!e && !!t.getElementById(e));
|
|
@@ -230,50 +232,47 @@ function Ne(e, t = document) {
|
|
|
230
232
|
}
|
|
231
233
|
e.removeAttribute("aria-describedby");
|
|
232
234
|
}
|
|
233
|
-
function
|
|
234
|
-
e.setAttribute("aria-errormessage", t),
|
|
235
|
+
function M(e, t) {
|
|
236
|
+
e.setAttribute("aria-errormessage", t), Ie(e, t);
|
|
235
237
|
}
|
|
236
|
-
function
|
|
238
|
+
function Re(e, t = []) {
|
|
237
239
|
t.forEach((t) => {
|
|
238
240
|
e.getAttribute("aria-errormessage") === t && e.removeAttribute("aria-errormessage");
|
|
239
|
-
}), !t.length && e.hasAttribute("aria-errormessage") && e.removeAttribute("aria-errormessage"),
|
|
240
|
-
}
|
|
241
|
-
function P(e) {
|
|
242
|
-
return !!e && e.hasAttribute("data-formie-validation-skip");
|
|
241
|
+
}), !t.length && e.hasAttribute("aria-errormessage") && e.removeAttribute("aria-errormessage"), Le(e);
|
|
243
242
|
}
|
|
244
243
|
//#endregion
|
|
245
244
|
//#region src/js/core/validation-focus.ts
|
|
246
|
-
function
|
|
245
|
+
function ze(e) {
|
|
247
246
|
return Array.from(e.querySelectorAll("[data-formie-field-handle]")).find((e) => e.getAttribute("data-formie-field-has-error") === "true" || e.querySelector("[data-formie-field-error]") !== null) || null;
|
|
248
247
|
}
|
|
249
|
-
function
|
|
250
|
-
return Array.from(e.querySelectorAll("[aria-invalid=\"true\"]")).find((e) => !
|
|
248
|
+
function Be(e) {
|
|
249
|
+
return Array.from(e.querySelectorAll("[aria-invalid=\"true\"]")).find((e) => !k(e)) || (Array.from(e.querySelectorAll("input:not([type=\"hidden\"]):not([disabled]), select:not([disabled]), textarea:not([disabled])")).find((e) => !k(e)) ?? null);
|
|
251
250
|
}
|
|
252
|
-
function
|
|
251
|
+
function Ve(e) {
|
|
253
252
|
return e.querySelector("[data-formie-message-error], [data-formie-error-container], [data-formie-errors]");
|
|
254
253
|
}
|
|
255
|
-
function
|
|
254
|
+
function He(e) {
|
|
256
255
|
e.querySelectorAll("[data-formie-field-handle]").forEach((t) => {
|
|
257
256
|
let n = t;
|
|
258
257
|
if (n.getAttribute("data-formie-field-has-error") !== "true" && n.querySelector("[data-formie-field-error]") === null) return;
|
|
259
|
-
n.setAttribute("data-formie-field-has-error", "true"),
|
|
258
|
+
n.setAttribute("data-formie-field-has-error", "true"), O(n, e, "fieldLayoutError");
|
|
260
259
|
let r = n.querySelector("[data-formie-field-error]")?.id || "";
|
|
261
260
|
n.querySelectorAll("input, select, textarea").forEach((t) => {
|
|
262
261
|
let i = t;
|
|
263
|
-
if (
|
|
264
|
-
i.setAttribute("aria-invalid", "true"),
|
|
262
|
+
if (k(i)) return;
|
|
263
|
+
i.setAttribute("aria-invalid", "true"), O(i, e, "fieldControlError"), i.setAttribute("data-formie-input-has-error", "true"), r && M(i, r);
|
|
265
264
|
let a = n.querySelector("[data-formie-instructions]");
|
|
266
|
-
a?.id &&
|
|
265
|
+
a?.id && Ie(i, a.id);
|
|
267
266
|
});
|
|
268
267
|
});
|
|
269
268
|
}
|
|
270
|
-
function
|
|
271
|
-
return !!
|
|
269
|
+
function Ue(e) {
|
|
270
|
+
return !!ze(e) || !!Ve(e);
|
|
272
271
|
}
|
|
273
|
-
function
|
|
274
|
-
let t =
|
|
272
|
+
function We(e) {
|
|
273
|
+
let t = ze(e);
|
|
275
274
|
if (t) {
|
|
276
|
-
let e =
|
|
275
|
+
let e = Be(t);
|
|
277
276
|
if (e) {
|
|
278
277
|
if (e.scrollIntoView({
|
|
279
278
|
behavior: "smooth",
|
|
@@ -290,7 +289,7 @@ function Ve(e) {
|
|
|
290
289
|
block: "center"
|
|
291
290
|
}), !0;
|
|
292
291
|
}
|
|
293
|
-
let n =
|
|
292
|
+
let n = Ve(e);
|
|
294
293
|
return n ? (n.scrollIntoView({
|
|
295
294
|
behavior: "smooth",
|
|
296
295
|
block: "center"
|
|
@@ -298,8 +297,8 @@ function Ve(e) {
|
|
|
298
297
|
}
|
|
299
298
|
//#endregion
|
|
300
299
|
//#region src/js/transport/forms-api.ts
|
|
301
|
-
var
|
|
302
|
-
function
|
|
300
|
+
var N = E("general", "transport");
|
|
301
|
+
function Ge(e) {
|
|
303
302
|
let t = {};
|
|
304
303
|
return [
|
|
305
304
|
"theme",
|
|
@@ -310,7 +309,7 @@ function He(e) {
|
|
|
310
309
|
e[n] !== void 0 && (t[n] = e[n]);
|
|
311
310
|
}), t;
|
|
312
311
|
}
|
|
313
|
-
function
|
|
312
|
+
function Ke(e, t) {
|
|
314
313
|
let n = e.success === !0, r = e.completion && typeof e.completion == "object" ? e.completion : null, i = e.payment && typeof e.payment == "object" ? e.payment : null, a = [
|
|
315
314
|
"requiresAction",
|
|
316
315
|
"pending",
|
|
@@ -351,36 +350,36 @@ function Ue(e, t) {
|
|
|
351
350
|
meta: e
|
|
352
351
|
};
|
|
353
352
|
}
|
|
354
|
-
async function
|
|
353
|
+
async function qe(e, t, n = {}, r = {}) {
|
|
355
354
|
let i = JSON.stringify({
|
|
356
355
|
handle: t,
|
|
357
356
|
renderOptions: n
|
|
358
357
|
});
|
|
359
|
-
|
|
358
|
+
N.log("requestRender start.", {
|
|
360
359
|
endpoint: e,
|
|
361
360
|
handle: t
|
|
362
361
|
});
|
|
363
|
-
let a = await
|
|
362
|
+
let a = await A(e, {
|
|
364
363
|
...r,
|
|
365
364
|
method: "POST",
|
|
366
365
|
body: i,
|
|
367
366
|
headers: { "Content-Type": "application/json" }
|
|
368
367
|
});
|
|
369
|
-
return
|
|
368
|
+
return N.log("requestRender complete.", { hasHtml: !!a.html }), a;
|
|
370
369
|
}
|
|
371
|
-
async function
|
|
370
|
+
async function Je(e, t, n = {}, r = {}) {
|
|
372
371
|
let i = JSON.stringify({
|
|
373
372
|
query: "\nquery FormieHtmlForm($handle: String!, $input: ServerRenderPayloadInput) {\n formieHtmlForm(handle: $handle, input: $input) {\n html\n }\n}",
|
|
374
373
|
variables: {
|
|
375
374
|
handle: t,
|
|
376
|
-
input:
|
|
375
|
+
input: Ge(n)
|
|
377
376
|
}
|
|
378
377
|
});
|
|
379
|
-
|
|
378
|
+
N.log("requestGraphqlRender start.", {
|
|
380
379
|
endpoint: e,
|
|
381
380
|
handle: t
|
|
382
381
|
});
|
|
383
|
-
let a = await
|
|
382
|
+
let a = await A(e, {
|
|
384
383
|
...r,
|
|
385
384
|
method: "POST",
|
|
386
385
|
body: i,
|
|
@@ -389,19 +388,19 @@ async function Ge(e, t, n = {}, r = {}) {
|
|
|
389
388
|
if (Array.isArray(a.errors) && a.errors.length > 0) throw Error(a.errors.map((e) => e.message || "Unknown GraphQL error").join("; "));
|
|
390
389
|
if (!a.data?.formieHtmlForm) throw Error(`Form not found for handle "${t}".`);
|
|
391
390
|
let o = a.data.formieHtmlForm;
|
|
392
|
-
return
|
|
391
|
+
return N.log("requestGraphqlRender complete.", { hasHtml: !!o.html }), o;
|
|
393
392
|
}
|
|
394
|
-
async function
|
|
393
|
+
async function P(e, t, n, r = {}, i) {
|
|
395
394
|
let a = new URL(e, window.location.origin);
|
|
396
|
-
a.searchParams.set("handle", t), n && a.searchParams.set("renderId", n), i && a.searchParams.set("requestToken", i),
|
|
395
|
+
a.searchParams.set("handle", t), n && a.searchParams.set("renderId", n), i && a.searchParams.set("requestToken", i), N.log("requestRefreshTokens start.", {
|
|
397
396
|
endpoint: a.toString(),
|
|
398
397
|
handle: t,
|
|
399
398
|
hasRenderId: !!n
|
|
400
399
|
});
|
|
401
|
-
let o = await
|
|
402
|
-
return
|
|
400
|
+
let o = await A(a.toString(), r);
|
|
401
|
+
return N.log("requestRefreshTokens complete.", { hasRefreshTokens: !!o.refreshTokens }), o.refreshTokens || o;
|
|
403
402
|
}
|
|
404
|
-
async function
|
|
403
|
+
async function Ye(e, t, n) {
|
|
405
404
|
let r = new URL(e, window.location.origin), i = new FormData();
|
|
406
405
|
if (n && i.append("pageId", n), t) {
|
|
407
406
|
[
|
|
@@ -418,7 +417,7 @@ async function qe(e, t, n) {
|
|
|
418
417
|
}), ie(i, t);
|
|
419
418
|
for (let [e, n] of new FormData(t)) e.startsWith("fields[") && i.append(e, n);
|
|
420
419
|
}
|
|
421
|
-
|
|
420
|
+
N.log("requestSetPage start.", {
|
|
422
421
|
requestUrl: r.toString(),
|
|
423
422
|
pageId: n || null
|
|
424
423
|
});
|
|
@@ -431,9 +430,9 @@ async function qe(e, t, n) {
|
|
|
431
430
|
let e = a.session, n = t.querySelector("input[name=\"expectedVersion\"]"), r = t.querySelector("input[name=\"requestToken\"]");
|
|
432
431
|
n && (n.value = String(e.version)), r && e.tokens?.request && (r.value = e.tokens.request);
|
|
433
432
|
}
|
|
434
|
-
return
|
|
433
|
+
return N.log("requestSetPage complete.", a), a;
|
|
435
434
|
}
|
|
436
|
-
function
|
|
435
|
+
function Xe(e, t) {
|
|
437
436
|
let n = new URL(e, window.location.origin), i = new FormData();
|
|
438
437
|
[
|
|
439
438
|
"handle",
|
|
@@ -443,7 +442,7 @@ function Je(e, t) {
|
|
|
443
442
|
].forEach((e) => {
|
|
444
443
|
let n = t.querySelector(`input[name="${e}"]`)?.value?.trim();
|
|
445
444
|
n && i.append(e, n);
|
|
446
|
-
}), ie(i, t),
|
|
445
|
+
}), ie(i, t), N.log("clearSubmissionOnUnload start.", { requestUrl: n.toString() });
|
|
447
446
|
try {
|
|
448
447
|
if (t.dataset.formieRequestProfile !== "cross-origin-public" && typeof navigator.sendBeacon == "function" && navigator.sendBeacon(n.toString(), i)) return;
|
|
449
448
|
} catch {}
|
|
@@ -454,9 +453,9 @@ function Je(e, t) {
|
|
|
454
453
|
headers: { Accept: "application/json" }
|
|
455
454
|
}, { profile: t.dataset.formieRequestProfile });
|
|
456
455
|
}
|
|
457
|
-
async function
|
|
456
|
+
async function Ze(e, t) {
|
|
458
457
|
let n = (e.getAttribute("method") || "POST").toUpperCase(), i = e.getAttribute("action") || window.location.href, a = e.dataset.formieErrorMessage?.trim() || "Submission failed.";
|
|
459
|
-
|
|
458
|
+
N.log("submitForm start.", {
|
|
460
459
|
method: n,
|
|
461
460
|
action: i,
|
|
462
461
|
submitAction: t.get("submitAction")
|
|
@@ -466,13 +465,13 @@ async function Ye(e, t) {
|
|
|
466
465
|
body: t,
|
|
467
466
|
headers: { Accept: "application/json" }
|
|
468
467
|
}, { profile: e.dataset.formieRequestProfile }), s = o.headers.get("content-type") || "";
|
|
469
|
-
if (!s.includes("application/json")) return o.ok ? (
|
|
468
|
+
if (!s.includes("application/json")) return o.ok ? (N.log("submitForm non-JSON success response.", {
|
|
470
469
|
status: o.status,
|
|
471
470
|
contentType: s
|
|
472
471
|
}), {
|
|
473
472
|
ok: !0,
|
|
474
473
|
message: "Submission completed."
|
|
475
|
-
}) : (
|
|
474
|
+
}) : (N.warn("submitForm non-JSON HTTP error.", {
|
|
476
475
|
status: o.status,
|
|
477
476
|
contentType: s
|
|
478
477
|
}), {
|
|
@@ -481,8 +480,8 @@ async function Ye(e, t) {
|
|
|
481
480
|
message: `Request failed (${o.status}).`,
|
|
482
481
|
formErrors: [`Request failed (${o.status}).`]
|
|
483
482
|
});
|
|
484
|
-
let c =
|
|
485
|
-
return
|
|
483
|
+
let c = Ke(await o.json(), a);
|
|
484
|
+
return N.log("submitForm JSON response normalized.", {
|
|
486
485
|
ok: c.ok,
|
|
487
486
|
code: c.code,
|
|
488
487
|
hasRedirect: !!c.redirect?.url,
|
|
@@ -491,20 +490,20 @@ async function Ye(e, t) {
|
|
|
491
490
|
}
|
|
492
491
|
//#endregion
|
|
493
492
|
//#region src/js/submit/pipeline.ts
|
|
494
|
-
var
|
|
493
|
+
var Qe = [
|
|
495
494
|
"prepare",
|
|
496
495
|
"validate",
|
|
497
496
|
"challenge",
|
|
498
497
|
"payment",
|
|
499
498
|
"send",
|
|
500
499
|
"result"
|
|
501
|
-
],
|
|
500
|
+
], $e = [
|
|
502
501
|
"prepare",
|
|
503
502
|
"validate",
|
|
504
503
|
"challenge",
|
|
505
504
|
"payment"
|
|
506
|
-
],
|
|
507
|
-
function
|
|
505
|
+
], F = E("general", "pipeline");
|
|
506
|
+
function I(e, t) {
|
|
508
507
|
return {
|
|
509
508
|
ok: !1,
|
|
510
509
|
stage: e,
|
|
@@ -513,13 +512,13 @@ function Qe(e, t) {
|
|
|
513
512
|
formErrors: [t || "Submission aborted."]
|
|
514
513
|
};
|
|
515
514
|
}
|
|
516
|
-
function
|
|
515
|
+
function et(e) {
|
|
517
516
|
return e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement;
|
|
518
517
|
}
|
|
519
|
-
function
|
|
518
|
+
function tt(e) {
|
|
520
519
|
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)));
|
|
521
520
|
}
|
|
522
|
-
function
|
|
521
|
+
function nt(e, t) {
|
|
523
522
|
if (t instanceof HTMLInputElement) {
|
|
524
523
|
if (t.type === "file") {
|
|
525
524
|
Array.from(t.files || []).forEach((n) => {
|
|
@@ -538,49 +537,49 @@ function tt(e, t) {
|
|
|
538
537
|
}
|
|
539
538
|
e.append(t.name, t.value);
|
|
540
539
|
}
|
|
541
|
-
function
|
|
540
|
+
function rt(e, t) {
|
|
542
541
|
t.querySelectorAll("input, select, textarea").forEach((t) => {
|
|
543
|
-
let n =
|
|
544
|
-
n && !n.closest("[data-formie-page]") &&
|
|
542
|
+
let n = et(t) ? t : null;
|
|
543
|
+
n && !n.closest("[data-formie-page]") && tt(n) && nt(e, n);
|
|
545
544
|
});
|
|
546
545
|
}
|
|
547
|
-
function
|
|
546
|
+
function it(e, t) {
|
|
548
547
|
let n = /* @__PURE__ */ new Set();
|
|
549
548
|
return t.querySelectorAll("input, select, textarea").forEach((t) => {
|
|
550
|
-
let r =
|
|
551
|
-
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),
|
|
549
|
+
let r = et(t) ? t : null;
|
|
550
|
+
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), tt(r) && nt(e, r)));
|
|
552
551
|
}), n;
|
|
553
552
|
}
|
|
554
|
-
function
|
|
553
|
+
function at(e, t) {
|
|
555
554
|
t.forEach((t) => {
|
|
556
555
|
e.has(t) || e.append(t, "");
|
|
557
556
|
});
|
|
558
557
|
}
|
|
559
|
-
function
|
|
558
|
+
function ot(e, t) {
|
|
560
559
|
let n = f(e), r = n.find((e) => !e.hasAttribute("data-formie-page-hidden")) || null;
|
|
561
560
|
if (!n.length || !r) {
|
|
562
561
|
let n = new FormData(e);
|
|
563
562
|
return n.set("submitAction", t), n;
|
|
564
563
|
}
|
|
565
564
|
let i = new FormData();
|
|
566
|
-
return
|
|
565
|
+
return rt(i, e), at(i, it(i, r)), i.set("submitAction", t), i;
|
|
567
566
|
}
|
|
568
|
-
function
|
|
567
|
+
function st(e, t) {
|
|
569
568
|
if (t !== "submit") return !1;
|
|
570
569
|
let n = f(e);
|
|
571
570
|
return !n.length || (n.find((e) => !e.hasAttribute("data-formie-page-hidden")) || n[n.length - 1]) === n[n.length - 1];
|
|
572
571
|
}
|
|
573
|
-
async function
|
|
574
|
-
|
|
572
|
+
async function ct(e, t, n, r = {}) {
|
|
573
|
+
F.log("Starting submit pipeline.", {
|
|
575
574
|
action: t,
|
|
576
575
|
preflightOnly: r.preflightOnly === !0
|
|
577
576
|
});
|
|
578
|
-
let i = !1, a, o = null, s =
|
|
577
|
+
let i = !1, a, o = null, s = st(e, t), c = {
|
|
579
578
|
form: e,
|
|
580
579
|
action: t,
|
|
581
|
-
formData:
|
|
580
|
+
formData: ot(e, t),
|
|
582
581
|
abort: (e) => {
|
|
583
|
-
i = !0, a = e,
|
|
582
|
+
i = !0, a = e, F.warn("Pipeline aborted.", { reason: e });
|
|
584
583
|
},
|
|
585
584
|
isAborted: () => i,
|
|
586
585
|
abortReason: () => a
|
|
@@ -628,68 +627,68 @@ async function st(e, t, n, r = {}) {
|
|
|
628
627
|
challenge: async () => null,
|
|
629
628
|
payment: async () => null,
|
|
630
629
|
send: async (e) => {
|
|
631
|
-
e.formData =
|
|
632
|
-
let t = await
|
|
630
|
+
e.formData = ot(e.form, e.action);
|
|
631
|
+
let t = await Ze(e.form, e.formData);
|
|
633
632
|
return o = t, t;
|
|
634
633
|
},
|
|
635
634
|
result: async (e) => (o && o.ok && o.redirect?.url && (o.redirect.target === "new-tab" ? window.open(o.redirect.url, "_blank", "noopener,noreferrer") : (e.form.setAttribute("data-formie-internal-navigation", "redirect"), window.location.href = o.redirect.url)), null)
|
|
636
635
|
};
|
|
637
636
|
{
|
|
638
637
|
let e = await n.emitSafe("formie:submit:before", c);
|
|
639
|
-
e.failed.length > 0 &&
|
|
638
|
+
e.failed.length > 0 && F.warn("Submit before listeners failed.", {
|
|
640
639
|
eventName: e.eventName,
|
|
641
640
|
failed: e.failed.length
|
|
642
641
|
});
|
|
643
642
|
}
|
|
644
643
|
if (s) {
|
|
645
644
|
let e = await n.emitSafe("formie:submit:final:before", c);
|
|
646
|
-
e.failed.length > 0 &&
|
|
645
|
+
e.failed.length > 0 && F.warn("Final submit before listeners failed.", {
|
|
647
646
|
eventName: e.eventName,
|
|
648
647
|
failed: e.failed.length
|
|
649
648
|
});
|
|
650
649
|
}
|
|
651
|
-
let u = r.preflightOnly ?
|
|
650
|
+
let u = r.preflightOnly ? $e : Qe;
|
|
652
651
|
for (let e of u) {
|
|
653
|
-
if (
|
|
652
|
+
if (F.log("Stage start.", {
|
|
654
653
|
stage: e,
|
|
655
654
|
action: t
|
|
656
|
-
}), i) return
|
|
655
|
+
}), i) return F.warn("Stage skipped due to abort.", {
|
|
657
656
|
stage: e,
|
|
658
657
|
reason: a
|
|
659
|
-
}),
|
|
658
|
+
}), I(e, a);
|
|
660
659
|
{
|
|
661
660
|
let t = await n.emitSafe(`formie:stage:${e}:before`, {
|
|
662
661
|
...c,
|
|
663
662
|
stage: e
|
|
664
663
|
});
|
|
665
|
-
t.failed.length > 0 &&
|
|
664
|
+
t.failed.length > 0 && F.warn("Stage before listeners failed.", {
|
|
666
665
|
stage: e,
|
|
667
666
|
failed: t.failed.length
|
|
668
667
|
});
|
|
669
668
|
}
|
|
670
669
|
if (i) {
|
|
671
|
-
let t =
|
|
670
|
+
let t = I(e, a);
|
|
672
671
|
{
|
|
673
672
|
let r = await n.emitSafe("formie:submit:after", t);
|
|
674
|
-
r.failed.length > 0 &&
|
|
673
|
+
r.failed.length > 0 && F.warn("Submit after listeners failed (abort before stage).", {
|
|
675
674
|
stage: e,
|
|
676
675
|
failed: r.failed.length
|
|
677
676
|
});
|
|
678
677
|
}
|
|
679
678
|
if (s) {
|
|
680
679
|
let r = await n.emitSafe("formie:submit:final:after", t);
|
|
681
|
-
r.failed.length > 0 &&
|
|
680
|
+
r.failed.length > 0 && F.warn("Final submit after listeners failed (abort before stage).", {
|
|
682
681
|
stage: e,
|
|
683
682
|
failed: r.failed.length
|
|
684
683
|
});
|
|
685
684
|
}
|
|
686
|
-
return
|
|
685
|
+
return F.warn("Aborted after stage before-hooks.", {
|
|
687
686
|
stage: e,
|
|
688
687
|
reason: a
|
|
689
688
|
}), t;
|
|
690
689
|
}
|
|
691
690
|
let r = await l[e](c);
|
|
692
|
-
|
|
691
|
+
F.log("Stage runner complete.", {
|
|
693
692
|
stage: e,
|
|
694
693
|
hasResult: !!r,
|
|
695
694
|
ok: r ? r.ok : void 0,
|
|
@@ -701,28 +700,28 @@ async function st(e, t, n, r = {}) {
|
|
|
701
700
|
stage: e,
|
|
702
701
|
result: r
|
|
703
702
|
});
|
|
704
|
-
t.failed.length > 0 &&
|
|
703
|
+
t.failed.length > 0 && F.warn("Stage after listeners failed.", {
|
|
705
704
|
stage: e,
|
|
706
705
|
failed: t.failed.length
|
|
707
706
|
});
|
|
708
707
|
}
|
|
709
708
|
if (i) {
|
|
710
|
-
let t =
|
|
709
|
+
let t = I(e, a);
|
|
711
710
|
{
|
|
712
711
|
let r = await n.emitSafe("formie:submit:after", t);
|
|
713
|
-
r.failed.length > 0 &&
|
|
712
|
+
r.failed.length > 0 && F.warn("Submit after listeners failed (abort after stage).", {
|
|
714
713
|
stage: e,
|
|
715
714
|
failed: r.failed.length
|
|
716
715
|
});
|
|
717
716
|
}
|
|
718
717
|
if (s) {
|
|
719
718
|
let r = await n.emitSafe("formie:submit:final:after", t);
|
|
720
|
-
r.failed.length > 0 &&
|
|
719
|
+
r.failed.length > 0 && F.warn("Final submit after listeners failed (abort after stage).", {
|
|
721
720
|
stage: e,
|
|
722
721
|
failed: r.failed.length
|
|
723
722
|
});
|
|
724
723
|
}
|
|
725
|
-
return
|
|
724
|
+
return F.warn("Aborted after stage after-hooks.", {
|
|
726
725
|
stage: e,
|
|
727
726
|
reason: a
|
|
728
727
|
}), t;
|
|
@@ -730,19 +729,19 @@ async function st(e, t, n, r = {}) {
|
|
|
730
729
|
if (r && !r.ok) {
|
|
731
730
|
{
|
|
732
731
|
let t = await n.emitSafe("formie:submit:after", r);
|
|
733
|
-
t.failed.length > 0 &&
|
|
732
|
+
t.failed.length > 0 && F.warn("Submit after listeners failed (failed stage).", {
|
|
734
733
|
stage: e,
|
|
735
734
|
failed: t.failed.length
|
|
736
735
|
});
|
|
737
736
|
}
|
|
738
737
|
if (s) {
|
|
739
738
|
let t = await n.emitSafe("formie:submit:final:after", r);
|
|
740
|
-
t.failed.length > 0 &&
|
|
739
|
+
t.failed.length > 0 && F.warn("Final submit after listeners failed (failed stage).", {
|
|
741
740
|
stage: e,
|
|
742
741
|
failed: t.failed.length
|
|
743
742
|
});
|
|
744
743
|
}
|
|
745
|
-
return
|
|
744
|
+
return F.warn("Pipeline short-circuited by failed stage.", {
|
|
746
745
|
stage: e,
|
|
747
746
|
code: r.code,
|
|
748
747
|
message: r.message
|
|
@@ -757,13 +756,13 @@ async function st(e, t, n, r = {}) {
|
|
|
757
756
|
};
|
|
758
757
|
{
|
|
759
758
|
let e = await n.emitSafe("formie:submit:after", d);
|
|
760
|
-
e.failed.length > 0 &&
|
|
759
|
+
e.failed.length > 0 && F.warn("Submit after listeners failed (success).", { failed: e.failed.length });
|
|
761
760
|
}
|
|
762
761
|
if (s) {
|
|
763
762
|
let e = await n.emitSafe("formie:submit:final:after", d);
|
|
764
|
-
e.failed.length > 0 &&
|
|
763
|
+
e.failed.length > 0 && F.warn("Final submit after listeners failed (success).", { failed: e.failed.length });
|
|
765
764
|
}
|
|
766
|
-
return
|
|
765
|
+
return F.log("Pipeline completed.", {
|
|
767
766
|
ok: d.ok,
|
|
768
767
|
stage: d.stage,
|
|
769
768
|
code: d.code
|
|
@@ -771,34 +770,34 @@ async function st(e, t, n, r = {}) {
|
|
|
771
770
|
}
|
|
772
771
|
//#endregion
|
|
773
772
|
//#region src/js/core/field-error-container.ts
|
|
774
|
-
function
|
|
773
|
+
function lt(e) {
|
|
775
774
|
return e.querySelector("[data-formie-field-layout]")?.getAttribute("data-formie-error-position")?.trim() === "above" ? "above" : "below";
|
|
776
775
|
}
|
|
777
|
-
function
|
|
776
|
+
function ut(e, t) {
|
|
778
777
|
let n = e.querySelector("[data-formie-field-errors]");
|
|
779
778
|
if (n) return n;
|
|
780
|
-
let r = e.querySelector("[data-formie-field-content]"), i = e.querySelector("[data-formie-field-control]"), a =
|
|
779
|
+
let r = e.querySelector("[data-formie-field-content]"), i = e.querySelector("[data-formie-field-control]"), a = lt(e), o = document.createElement("div");
|
|
781
780
|
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;
|
|
782
781
|
}
|
|
783
782
|
//#endregion
|
|
784
783
|
//#region src/js/core/submit-result-ui.ts
|
|
785
784
|
var L = /* @__PURE__ */ new WeakMap();
|
|
786
|
-
function
|
|
785
|
+
function dt(e) {
|
|
787
786
|
return (e.dataset.formieCompletionBehavior || e.dataset.formieSubmitAction || "").trim();
|
|
788
787
|
}
|
|
789
|
-
function
|
|
788
|
+
function ft(e) {
|
|
790
789
|
return (e.dataset.formieErrorMessagePosition || "top-form").trim() || "top-form";
|
|
791
790
|
}
|
|
792
|
-
function
|
|
791
|
+
function pt(e) {
|
|
793
792
|
return (e.dataset.formieSuccessMessagePosition || e.dataset.formieSubmitActionMessagePosition || "").trim();
|
|
794
793
|
}
|
|
795
|
-
function
|
|
794
|
+
function mt(e) {
|
|
796
795
|
let t = (e.dataset.formieSuccessMessageTimeout || e.dataset.formieSubmitActionMessageTimeout || "").trim();
|
|
797
796
|
if (!t) return null;
|
|
798
797
|
let n = Number.parseFloat(t);
|
|
799
798
|
return !Number.isFinite(n) || n < 0 ? null : Math.round(n * 1e3);
|
|
800
799
|
}
|
|
801
|
-
function
|
|
800
|
+
function R(e) {
|
|
802
801
|
let t = e.dataset.formieHideFormAfterSubmit ?? e.dataset.formieSubmitActionFormHide;
|
|
803
802
|
if (t === void 0) return !1;
|
|
804
803
|
let n = t.trim().toLowerCase();
|
|
@@ -818,33 +817,33 @@ function vt(e, t) {
|
|
|
818
817
|
return t === "bottom-form" ? _t(e) : gt(e);
|
|
819
818
|
}
|
|
820
819
|
function yt(e, t) {
|
|
821
|
-
return t === "top-form" ? gt(e) : t === "bottom-form" && !
|
|
820
|
+
return t === "top-form" ? gt(e) : t === "bottom-form" && !R(e) ? _t(e) : e;
|
|
822
821
|
}
|
|
823
822
|
function bt(e) {
|
|
824
|
-
let t =
|
|
825
|
-
return r || (r = document.createElement("div"), r.setAttribute("data-formie-errors", "true"),
|
|
823
|
+
let t = ft(e), n = vt(e, t), r = n.querySelector("[data-formie-error-container], [data-formie-errors]");
|
|
824
|
+
return r || (r = document.createElement("div"), r.setAttribute("data-formie-errors", "true"), O(r, e, "errors")), r.setAttribute("data-formie-error-container", "true"), t === "bottom-form" ? n.append(r) : n.prepend(r), r;
|
|
826
825
|
}
|
|
827
826
|
function xt(e, t) {
|
|
828
827
|
let n = t.querySelector("[data-formie-error-message-container], [data-formie-message][data-formie-message-error]");
|
|
829
|
-
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"),
|
|
828
|
+
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"), O(n, e, "message", "messageError"), n.setAttribute("role", "alert"), Fe(n, Pe(Me(e))), n;
|
|
830
829
|
}
|
|
831
830
|
function St(e, t) {
|
|
832
831
|
let n = e.querySelector("[data-formie-success-container]"), r = yt(e, t);
|
|
833
|
-
return n || (n = document.createElement("div"), n.setAttribute("data-formie-success-container", "true"),
|
|
832
|
+
return n || (n = document.createElement("div"), n.setAttribute("data-formie-success-container", "true"), O(n, e, "successes")), t === "bottom-form" ? r.append(n) : r.prepend(n), n;
|
|
834
833
|
}
|
|
835
834
|
function Ct(e) {
|
|
836
|
-
return
|
|
837
|
-
|
|
835
|
+
return ut(e, (t) => {
|
|
836
|
+
O(t, e, "fieldErrors");
|
|
838
837
|
});
|
|
839
838
|
}
|
|
840
839
|
function wt(e) {
|
|
841
840
|
e.querySelectorAll("[data-formie-field-handle]").forEach((t) => {
|
|
842
841
|
let n = t, r = n.querySelector("[data-formie-field-errors]"), i = Array.from(n.querySelectorAll("[data-formie-field-error]")).map((e) => e.id).filter(Boolean);
|
|
843
|
-
|
|
842
|
+
D(n, e, "fieldLayoutError"), n.removeAttribute("data-formie-field-has-error"), n.querySelectorAll("[data-formie-field-error]").forEach((e) => {
|
|
844
843
|
e.remove();
|
|
845
844
|
}), r && !r.querySelector("[data-formie-field-error]") && (r.innerHTML = ""), n.querySelectorAll("input, select, textarea").forEach((t) => {
|
|
846
845
|
let n = t;
|
|
847
|
-
n.removeAttribute("aria-invalid"),
|
|
846
|
+
n.removeAttribute("aria-invalid"), D(n, e, "fieldControlError"), n.removeAttribute("data-formie-input-has-error"), Re(n, i);
|
|
848
847
|
});
|
|
849
848
|
}), C(e);
|
|
850
849
|
}
|
|
@@ -853,7 +852,7 @@ function Tt(e) {
|
|
|
853
852
|
let n = t;
|
|
854
853
|
n.querySelectorAll("[data-formie-error]").forEach((e) => {
|
|
855
854
|
e.remove();
|
|
856
|
-
}),
|
|
855
|
+
}), D(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 = "");
|
|
857
856
|
});
|
|
858
857
|
}
|
|
859
858
|
function Et(e) {
|
|
@@ -863,8 +862,8 @@ function Et(e) {
|
|
|
863
862
|
let n = t;
|
|
864
863
|
n.querySelectorAll("[data-formie-success]").forEach((e) => {
|
|
865
864
|
e.remove();
|
|
866
|
-
}),
|
|
867
|
-
}),
|
|
865
|
+
}), D(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 = "");
|
|
866
|
+
}), dt(e) === "message" && R(e) || d(e, !1);
|
|
868
867
|
}
|
|
869
868
|
function Dt(e) {
|
|
870
869
|
e.querySelectorAll("[aria-invalid=\"true\"]").forEach((e) => {
|
|
@@ -872,29 +871,29 @@ function Dt(e) {
|
|
|
872
871
|
});
|
|
873
872
|
}
|
|
874
873
|
function Ot(e, t) {
|
|
875
|
-
let n =
|
|
874
|
+
let n = Pe(Me(e));
|
|
876
875
|
Object.entries(t).forEach(([t, r]) => {
|
|
877
876
|
let i = `fields[${t.split(".").join("][")}]`, a = e.querySelector(`[name="${CSS.escape(i)}"], [name="${CSS.escape(i + "[]")}"]`)?.closest("[data-formie-field-handle]") || e.querySelector(`[data-formie-field-handle="${CSS.escape(t)}"]`);
|
|
878
877
|
if (!a) return;
|
|
879
878
|
let o = Ct(a), s = o.id && o.id.trim() ? o.id : `${t}-errors`;
|
|
880
|
-
o.id = s,
|
|
879
|
+
o.id = s, Fe(o, n), O(a, e, "fieldLayoutError"), a.setAttribute("data-formie-field-has-error", "true"), r.forEach((t, n) => {
|
|
881
880
|
let r = document.createElement("div");
|
|
882
|
-
r.setAttribute("data-formie-field-error", "true"), r.id = `${s}-${n + 1}`,
|
|
881
|
+
r.setAttribute("data-formie-field-error", "true"), r.id = `${s}-${n + 1}`, O(r, e, "fieldError"), r.textContent = t, o.appendChild(r);
|
|
883
882
|
});
|
|
884
883
|
let c = o.querySelector("[data-formie-field-error]")?.id;
|
|
885
884
|
a.querySelectorAll("input, select, textarea").forEach((t) => {
|
|
886
885
|
let n = t;
|
|
887
|
-
n.setAttribute("aria-invalid", "true"),
|
|
886
|
+
n.setAttribute("aria-invalid", "true"), O(n, e, "fieldControlError"), n.setAttribute("data-formie-input-has-error", "true"), c && M(n, c);
|
|
888
887
|
let r = a.querySelector("[data-formie-instructions]");
|
|
889
|
-
r?.id &&
|
|
888
|
+
r?.id && Ie(n, r.id);
|
|
890
889
|
});
|
|
891
890
|
}), C(e);
|
|
892
891
|
}
|
|
893
892
|
function kt(e, t) {
|
|
894
893
|
let n = bt(e), r = xt(e, n);
|
|
895
|
-
|
|
894
|
+
O(n, e, "errors"), t.forEach((t) => {
|
|
896
895
|
let n = document.createElement("div");
|
|
897
|
-
n.setAttribute("data-formie-error", "true"), n.setAttribute("role", "alert"),
|
|
896
|
+
n.setAttribute("data-formie-error", "true"), n.setAttribute("role", "alert"), O(n, e, "error"), n.innerHTML = t, r.appendChild(n);
|
|
898
897
|
});
|
|
899
898
|
}
|
|
900
899
|
function At(e) {
|
|
@@ -904,31 +903,31 @@ function At(e) {
|
|
|
904
903
|
}
|
|
905
904
|
function jt(e, t) {
|
|
906
905
|
let n = bt(e), r = xt(e, n);
|
|
907
|
-
|
|
906
|
+
O(n, e, "errors");
|
|
908
907
|
let i = document.createElement("div");
|
|
909
|
-
i.setAttribute("data-formie-notice", "true"), i.setAttribute("role", "status"),
|
|
908
|
+
i.setAttribute("data-formie-notice", "true"), i.setAttribute("role", "status"), O(i, e, "message"), i.textContent = t, r.appendChild(i);
|
|
910
909
|
}
|
|
911
910
|
function Mt(e, t) {
|
|
912
|
-
return !t.message || t.nextPage || t.redirect ? !1 : t.action === "save" ||
|
|
911
|
+
return !t.message || t.nextPage || t.redirect ? !1 : t.action === "save" || dt(e) === "message" && pt(e) !== "";
|
|
913
912
|
}
|
|
914
|
-
function Nt(e, t) {
|
|
915
|
-
let
|
|
916
|
-
if (!
|
|
917
|
-
let
|
|
918
|
-
|
|
919
|
-
let
|
|
920
|
-
|
|
921
|
-
let
|
|
922
|
-
if (
|
|
913
|
+
function Nt(e, t, n = {}) {
|
|
914
|
+
let r = pt(e);
|
|
915
|
+
if (!r) return;
|
|
916
|
+
let i = St(e, r);
|
|
917
|
+
O(i, e, "message", "messageSuccess"), i.setAttribute("data-formie-message", "true"), i.setAttribute("data-formie-message-success", "true"), i.setAttribute("role", "status"), i.setAttribute("aria-live", "polite"), i.setAttribute("aria-atomic", "true");
|
|
918
|
+
let a = document.createElement("div");
|
|
919
|
+
a.setAttribute("data-formie-success", "true"), O(a, e, "success"), a.innerHTML = t, i.appendChild(a), n.hideForm !== !1 && R(e) && d(e, !0);
|
|
920
|
+
let o = mt(e);
|
|
921
|
+
if (o !== null) {
|
|
923
922
|
let t = window.setTimeout(() => {
|
|
924
923
|
L.delete(e), Et(e);
|
|
925
|
-
},
|
|
924
|
+
}, o);
|
|
926
925
|
L.set(e, t);
|
|
927
926
|
}
|
|
928
927
|
}
|
|
929
|
-
function
|
|
928
|
+
function z(e, t) {
|
|
930
929
|
if (wt(e), Tt(e), Et(e), Dt(e), t.ok) {
|
|
931
|
-
Mt(e, t) && Nt(e, t.message || "");
|
|
930
|
+
Mt(e, t) && Nt(e, t.message || "", { hideForm: t.action !== "save" });
|
|
932
931
|
return;
|
|
933
932
|
}
|
|
934
933
|
if (!t.ok) {
|
|
@@ -937,24 +936,24 @@ function R(e, t) {
|
|
|
937
936
|
n && jt(e, n);
|
|
938
937
|
return;
|
|
939
938
|
}
|
|
940
|
-
t.fieldErrors && Ot(e, t.fieldErrors), t.formErrors?.length ? kt(e, t.formErrors) : !t.fieldErrors && t.message && kt(e, [t.message]),
|
|
939
|
+
t.fieldErrors && Ot(e, t.fieldErrors), t.formErrors?.length ? kt(e, t.formErrors) : !t.fieldErrors && t.message && kt(e, [t.message]), We(e);
|
|
941
940
|
}
|
|
942
941
|
}
|
|
943
942
|
//#endregion
|
|
944
943
|
//#region src/js/core/submit-flow.ts
|
|
945
|
-
var Pt =
|
|
944
|
+
var Pt = E("general", "submit-flow");
|
|
946
945
|
function Ft(e) {
|
|
947
946
|
return !(!e.ok && e.stage === "validate");
|
|
948
947
|
}
|
|
949
948
|
function It(e) {
|
|
950
949
|
return e ? !!(e.keepSubmitLoading === !0 || e.ok && e.redirect?.url && e.redirect.target !== "new-tab") : !1;
|
|
951
950
|
}
|
|
952
|
-
function
|
|
951
|
+
function Lt(e) {
|
|
953
952
|
wt(e), Tt(e), Et(e), Dt(e);
|
|
954
953
|
}
|
|
955
|
-
async function
|
|
954
|
+
async function Rt(e) {
|
|
956
955
|
let { id: t, target: n, form: r, bus: i, validator: a, validateOnSubmit: o, action: s, submitter: c, waitForSubmitDelay: l, onRefreshTokensAfterSubmit: u, dispatchSubmitResult: d } = e;
|
|
957
|
-
|
|
956
|
+
Lt(r), v(r, c || null);
|
|
958
957
|
let f = {
|
|
959
958
|
ok: !1,
|
|
960
959
|
code: "SUBMIT_ERROR",
|
|
@@ -962,17 +961,17 @@ async function Lt(e) {
|
|
|
962
961
|
formErrors: ["Submission failed."]
|
|
963
962
|
};
|
|
964
963
|
try {
|
|
965
|
-
await l(r), f = await
|
|
964
|
+
await l(r), f = await ct(r, s, i, {
|
|
966
965
|
validator: a,
|
|
967
966
|
validateOnSubmit: o
|
|
968
|
-
}),
|
|
967
|
+
}), z(r, f), d(f), b(r, f, s), Ft(f) && await u(f);
|
|
969
968
|
} catch (e) {
|
|
970
969
|
f = {
|
|
971
970
|
ok: !1,
|
|
972
971
|
code: "SUBMIT_ERROR",
|
|
973
972
|
message: e instanceof Error ? e.message : "Submission failed.",
|
|
974
973
|
formErrors: [e instanceof Error ? e.message : "Submission failed."]
|
|
975
|
-
},
|
|
974
|
+
}, z(r, f), d(f), Pt.warn("Submit failed with exception.", {
|
|
976
975
|
id: t,
|
|
977
976
|
action: s,
|
|
978
977
|
target: n,
|
|
@@ -985,7 +984,7 @@ async function Lt(e) {
|
|
|
985
984
|
}
|
|
986
985
|
//#endregion
|
|
987
986
|
//#region src/js/events/event-bus.ts
|
|
988
|
-
var
|
|
987
|
+
var zt = class {
|
|
989
988
|
listeners = /* @__PURE__ */ new Map();
|
|
990
989
|
on(e, t) {
|
|
991
990
|
return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e)?.add(t), () => {
|
|
@@ -1065,66 +1064,66 @@ var Rt = class {
|
|
|
1065
1064
|
getAll() {
|
|
1066
1065
|
return Array.from(this.modules.values());
|
|
1067
1066
|
}
|
|
1068
|
-
},
|
|
1069
|
-
"address-finder": () => import("./chunks/address-finder-
|
|
1070
|
-
"google-address": () => import("./chunks/google-address-
|
|
1071
|
-
loqate: () => import("./chunks/loqate-
|
|
1072
|
-
"place-kit": () => import("./chunks/place-kit-
|
|
1073
|
-
}, Vt = {
|
|
1074
|
-
"captcha-eu": () => import("./chunks/captcha-eu-DERJbXnH.js").then((e) => e.captchaEuModule),
|
|
1075
|
-
"friendly-captcha-v1": () => import("./chunks/friendly-captcha-v1-GFqCt1Mh.js").then((e) => e.friendlyCaptchaV1Module),
|
|
1076
|
-
"friendly-captcha-v2": () => import("./chunks/friendly-captcha-v2-WoW246JG.js").then((e) => e.friendlyCaptchaV2Module),
|
|
1077
|
-
hcaptcha: () => import("./chunks/hcaptcha-D0T8aIHz.js").then((e) => e.hcaptchaModule),
|
|
1078
|
-
"recaptcha-enterprise": () => import("./chunks/recaptcha-enterprise-CruXddZq.js").then((e) => e.recaptchaEnterpriseModule),
|
|
1079
|
-
"recaptcha-v2-checkbox": () => import("./chunks/recaptcha-v2-checkbox-CCnJYCnG.js").then((e) => e.recaptchaV2CheckboxModule),
|
|
1080
|
-
"recaptcha-v2-invisible": () => import("./chunks/recaptcha-v2-invisible-BuVqRRYn.js").then((e) => e.recaptchaV2InvisibleModule),
|
|
1081
|
-
"recaptcha-v3": () => import("./chunks/recaptcha-v3-CloqhO2A.js").then((e) => e.recaptchaV3Module),
|
|
1082
|
-
snaptcha: () => import("./chunks/snaptcha-C04kNGYQ.js").then((e) => e.snaptchaModule),
|
|
1083
|
-
turnstile: () => import("./chunks/turnstile-n9DNyPxi.js").then((e) => e.turnstileModule)
|
|
1067
|
+
}, Bt = new B(), Vt = {
|
|
1068
|
+
"address-finder": () => import("./chunks/address-finder-BWGINCSA.js").then((e) => e.addressFinderModule),
|
|
1069
|
+
"google-address": () => import("./chunks/google-address-JHYvjwgN.js").then((e) => e.googleAddressModule),
|
|
1070
|
+
loqate: () => import("./chunks/loqate-m51iPyO1.js").then((e) => e.loqateModule),
|
|
1071
|
+
"place-kit": () => import("./chunks/place-kit-BnZGQ-L1.js").then((e) => e.placeKitModule)
|
|
1084
1072
|
}, Ht = {
|
|
1073
|
+
"captcha-eu": () => import("./chunks/captcha-eu-DWLoQFKB.js").then((e) => e.captchaEuModule),
|
|
1074
|
+
"friendly-captcha-v1": () => import("./chunks/friendly-captcha-v1-CVXaXgDO.js").then((e) => e.friendlyCaptchaV1Module),
|
|
1075
|
+
"friendly-captcha-v2": () => import("./chunks/friendly-captcha-v2-DkeIVTKI.js").then((e) => e.friendlyCaptchaV2Module),
|
|
1076
|
+
hcaptcha: () => import("./chunks/hcaptcha-Dt3ELLlP.js").then((e) => e.hcaptchaModule),
|
|
1077
|
+
"recaptcha-enterprise": () => import("./chunks/recaptcha-enterprise-CUs8BO6V.js").then((e) => e.recaptchaEnterpriseModule),
|
|
1078
|
+
"recaptcha-v2-checkbox": () => import("./chunks/recaptcha-v2-checkbox-P1McW4Pv.js").then((e) => e.recaptchaV2CheckboxModule),
|
|
1079
|
+
"recaptcha-v2-invisible": () => import("./chunks/recaptcha-v2-invisible-FGDqozSP.js").then((e) => e.recaptchaV2InvisibleModule),
|
|
1080
|
+
"recaptcha-v3": () => import("./chunks/recaptcha-v3-CflUHeZD.js").then((e) => e.recaptchaV3Module),
|
|
1081
|
+
snaptcha: () => import("./chunks/snaptcha-C3QLYxFT.js").then((e) => e.snaptchaModule),
|
|
1082
|
+
turnstile: () => import("./chunks/turnstile-ptihQfLl.js").then((e) => e.turnstileModule)
|
|
1083
|
+
}, Ut = {
|
|
1085
1084
|
calculations: () => import("./chunks/calculations-YEoVCG2q.js").then((e) => e.calculationsModule),
|
|
1086
1085
|
"checkbox-radio": () => import("./chunks/checkbox-radio-gsm8QPJg.js").then((e) => e.checkboxRadioModule),
|
|
1087
|
-
combobox: () => import("./chunks/combobox-
|
|
1088
|
-
conditions: () => import("./chunks/conditions-
|
|
1086
|
+
combobox: () => import("./chunks/combobox-Ba08_cHL.js").then((e) => e.comboboxModule),
|
|
1087
|
+
conditions: () => import("./chunks/conditions-Ceeg6ReZ.js").then((e) => e.conditionsModule),
|
|
1089
1088
|
"custom-google-maps": () => import("./chunks/custom-google-maps-C4l2S3GO.js").then((e) => e.customGoogleMapsModule),
|
|
1090
1089
|
"custom-link": () => import("./chunks/custom-link-CLazgKYH.js").then((e) => e.customLinkModule),
|
|
1091
1090
|
"custom-maps": () => import("./chunks/custom-maps-DqcAlD0v.js").then((e) => e.customMapsModule),
|
|
1092
|
-
"date-picker": () => import("./chunks/date-picker-
|
|
1093
|
-
"file-upload": () => import("./chunks/file-upload-
|
|
1094
|
-
"upload-manager": () => import("./chunks/upload-manager-
|
|
1091
|
+
"date-picker": () => import("./chunks/date-picker-DaPvMrop.js").then((e) => e.datePickerModule),
|
|
1092
|
+
"file-upload": () => import("./chunks/file-upload-B8_mH012.js").then((e) => e.fileUploadModule),
|
|
1093
|
+
"upload-manager": () => import("./chunks/upload-manager-BW7l-BhF.js").then((e) => e.uploadManagerModule),
|
|
1095
1094
|
hidden: () => import("./chunks/hidden-BZhXnNPe.js").then((e) => e.hiddenModule),
|
|
1096
|
-
"phone-country": () => import("./chunks/phone-country-
|
|
1095
|
+
"phone-country": () => import("./chunks/phone-country-B8fv-L5_.js").then((e) => e.phoneCountryModule),
|
|
1097
1096
|
"password-validation": () => import("./chunks/password-validation-C8_uO_c_.js").then((e) => e.passwordValidationModule),
|
|
1098
|
-
"address-country": () => import("./chunks/address-country-
|
|
1099
|
-
"address-state": () => import("./chunks/address-state-
|
|
1100
|
-
repeater: () => import("./chunks/repeater-
|
|
1097
|
+
"address-country": () => import("./chunks/address-country-BcEQKw0T.js").then((e) => e.addressCountryModule),
|
|
1098
|
+
"address-state": () => import("./chunks/address-state-DI3ndhMU.js").then((e) => e.addressStateModule),
|
|
1099
|
+
repeater: () => import("./chunks/repeater-CyhDbozO.js").then((e) => e.repeaterModule),
|
|
1101
1100
|
"rich-text": () => import("./chunks/rich-text-uV4o_pGk.js").then((e) => e.richTextModule),
|
|
1102
1101
|
signature: () => import("./chunks/signature-7cldFbqj.js").then((e) => e.signatureModule),
|
|
1103
|
-
summary: () => import("./chunks/summary-
|
|
1102
|
+
summary: () => import("./chunks/summary-Bn-g5SDx.js").then((e) => e.summaryModule),
|
|
1104
1103
|
"survey-likert": () => import("./chunks/survey-likert-fk1hUPff.js").then((e) => e.surveyLikertModule),
|
|
1105
1104
|
"survey-rank": () => import("./chunks/survey-rank-BsLGl2LX.js").then((e) => e.surveyRankModule),
|
|
1106
1105
|
"survey-rating": () => import("./chunks/survey-rating-DVS6e6fM.js").then((e) => e.surveyRatingModule),
|
|
1107
|
-
table: () => import("./chunks/table-
|
|
1106
|
+
table: () => import("./chunks/table-j7MlLLCc.js").then((e) => e.tableModule),
|
|
1108
1107
|
"text-limit": () => import("./chunks/text-limit-LGMPhFuC.js").then((e) => e.textLimitModule)
|
|
1109
|
-
}, Ut = {
|
|
1110
|
-
bpoint: () => import("./chunks/bpoint-D0RKFM4F.js").then((e) => e.bpointModule),
|
|
1111
|
-
eway: () => import("./chunks/eway-or6dtjoT.js").then((e) => e.ewayModule),
|
|
1112
|
-
"go-cardless": () => import("./chunks/go-cardless-DzJ-0FKg.js").then((e) => e.goCardlessModule),
|
|
1113
|
-
mollie: () => import("./chunks/mollie-DG8Ju83x.js").then((e) => e.mollieModule),
|
|
1114
|
-
moneris: () => import("./chunks/moneris-C8m3Fvqu.js").then((e) => e.monerisModule),
|
|
1115
|
-
opayo: () => import("./chunks/opayo-B3EvrVxw.js").then((e) => e.opayoModule),
|
|
1116
|
-
paddle: () => import("./chunks/paddle-BIYR9Um3.js").then((e) => e.paddleModule),
|
|
1117
|
-
paypal: () => import("./chunks/paypal-B_yxIo2d.js").then((e) => e.paypalModule),
|
|
1118
|
-
payway: () => import("./chunks/payway-CeOzS0sL.js").then((e) => e.paywayModule),
|
|
1119
|
-
square: () => import("./chunks/square-DEzxv9D9.js").then((e) => e.squareModule),
|
|
1120
|
-
stripe: () => import("./chunks/stripe-CVPQGDz3.js").then((e) => e.stripeModule)
|
|
1121
1108
|
}, Wt = {
|
|
1122
|
-
|
|
1123
|
-
|
|
1109
|
+
bpoint: () => import("./chunks/bpoint-BwtuyN_O.js").then((e) => e.bpointModule),
|
|
1110
|
+
eway: () => import("./chunks/eway-uw0DzU-L.js").then((e) => e.ewayModule),
|
|
1111
|
+
"go-cardless": () => import("./chunks/go-cardless-c4wLJdOt.js").then((e) => e.goCardlessModule),
|
|
1112
|
+
mollie: () => import("./chunks/mollie-Bn0PX173.js").then((e) => e.mollieModule),
|
|
1113
|
+
moneris: () => import("./chunks/moneris-BRbUvI4t.js").then((e) => e.monerisModule),
|
|
1114
|
+
opayo: () => import("./chunks/opayo-BwWdInEP.js").then((e) => e.opayoModule),
|
|
1115
|
+
paddle: () => import("./chunks/paddle-CympHVvd.js").then((e) => e.paddleModule),
|
|
1116
|
+
paypal: () => import("./chunks/paypal-h75h6wae.js").then((e) => e.paypalModule),
|
|
1117
|
+
payway: () => import("./chunks/payway-C9rHTCC_.js").then((e) => e.paywayModule),
|
|
1118
|
+
square: () => import("./chunks/square-C1z5DPVw.js").then((e) => e.squareModule),
|
|
1119
|
+
stripe: () => import("./chunks/stripe-Dmkdkq1y.js").then((e) => e.stripeModule)
|
|
1120
|
+
}, Gt = {
|
|
1121
|
+
...Ut,
|
|
1124
1122
|
...Vt,
|
|
1125
|
-
...
|
|
1123
|
+
...Ht,
|
|
1124
|
+
...Wt
|
|
1126
1125
|
}, V = /* @__PURE__ */ new Map();
|
|
1127
|
-
function
|
|
1126
|
+
function Kt(e) {
|
|
1128
1127
|
if (e instanceof Error) return {
|
|
1129
1128
|
name: e.name || "Error",
|
|
1130
1129
|
message: e.message || "No error message was provided.",
|
|
@@ -1146,7 +1145,7 @@ function Gt(e) {
|
|
|
1146
1145
|
};
|
|
1147
1146
|
}
|
|
1148
1147
|
}
|
|
1149
|
-
function
|
|
1148
|
+
function qt(e, t, n) {
|
|
1150
1149
|
let r = [...t].filter((e) => e.required), i = [
|
|
1151
1150
|
"Formie browser module diagnostics",
|
|
1152
1151
|
`Surface: ${e}`,
|
|
@@ -1157,7 +1156,7 @@ function Kt(e, t, n) {
|
|
|
1157
1156
|
i.push("", `Failure ${r + 1}`, `Module: ${t.moduleId}`, `Key: ${t.key}`, `Code: ${t.code}`), e === "cp-edit" && a && (i.push(`Error: ${a.name}: ${a.message}`), a.stack && i.push("Stack:", a.stack));
|
|
1158
1157
|
}), i.join("\n");
|
|
1159
1158
|
}
|
|
1160
|
-
async function
|
|
1159
|
+
async function Jt(e) {
|
|
1161
1160
|
if (navigator.clipboard?.writeText) {
|
|
1162
1161
|
await navigator.clipboard.writeText(e);
|
|
1163
1162
|
return;
|
|
@@ -1170,10 +1169,10 @@ async function qt(e) {
|
|
|
1170
1169
|
t.remove();
|
|
1171
1170
|
}
|
|
1172
1171
|
}
|
|
1173
|
-
async function
|
|
1172
|
+
async function Yt(e, t) {
|
|
1174
1173
|
let n = t.get(e);
|
|
1175
1174
|
if (n) return n;
|
|
1176
|
-
let r = e.startsWith("formie:") && Object.prototype.hasOwnProperty.call(
|
|
1175
|
+
let r = e.startsWith("formie:") && Object.prototype.hasOwnProperty.call(Gt, e.slice(7)) ? Gt[e.slice(7)] : void 0;
|
|
1177
1176
|
if (!r) throw Error(`Browser module ${e} is not registered.`);
|
|
1178
1177
|
V.has(e) || V.set(e, r().catch((t) => {
|
|
1179
1178
|
throw V.delete(e), t;
|
|
@@ -1182,14 +1181,14 @@ async function Jt(e, t) {
|
|
|
1182
1181
|
if (i.moduleId !== e) throw Error(`Module definition does not match ${e}.`);
|
|
1183
1182
|
return t.register(i), i;
|
|
1184
1183
|
}
|
|
1185
|
-
function
|
|
1184
|
+
function Xt(e, t, n) {
|
|
1186
1185
|
return [...new Set(e.targets.flatMap((e) => {
|
|
1187
1186
|
if (e.type === "form") return [n || t];
|
|
1188
1187
|
let r = e.type === "selector" ? e.selector : e.type === "field" ? `[data-formie-field-uid="${CSS.escape(e.uid)}"]` : e.type === "page" ? `[data-formie-page-id="${CSS.escape(e.id)}"]` : `[data-formie-action="${CSS.escape(e.action)}"]`;
|
|
1189
1188
|
return [...t.matches(r) ? [t] : [], ...t.querySelectorAll(r)];
|
|
1190
1189
|
}))].filter((e) => !e.closest("[hidden], [data-formie-hidden=\"true\"], [data-formie-conditionally-hidden], [data-formie-page-hidden]"));
|
|
1191
1190
|
}
|
|
1192
|
-
async function
|
|
1191
|
+
async function Zt(e, t) {
|
|
1193
1192
|
n(e);
|
|
1194
1193
|
let r = e.surface;
|
|
1195
1194
|
if (t.matchContext.surface !== r || t.setupContext.surface !== r) throw Error(`Browser module manifest surface ${r} cannot mount as ${t.matchContext.surface}.`);
|
|
@@ -1202,7 +1201,7 @@ async function Xt(e, t) {
|
|
|
1202
1201
|
code: "MODULE_UNAVAILABLE",
|
|
1203
1202
|
message: "A form feature could not start. Reload the page or contact the site administrator."
|
|
1204
1203
|
};
|
|
1205
|
-
s.set(e.key, i), c.set(e.key,
|
|
1204
|
+
s.set(e.key, i), c.set(e.key, Kt(n)), console.error("[formie] Browser module failure", i, n), await t.setupContext.emit("formie:browser:module:error", i);
|
|
1206
1205
|
}, m = async (e) => {
|
|
1207
1206
|
try {
|
|
1208
1207
|
await e.destroy();
|
|
@@ -1244,7 +1243,7 @@ async function Xt(e, t) {
|
|
|
1244
1243
|
let d = document.createElement("span");
|
|
1245
1244
|
d.className = "formie-module-error__copy-status", d.setAttribute("role", "status"), d.setAttribute("aria-live", "polite"), u.addEventListener("click", async () => {
|
|
1246
1245
|
try {
|
|
1247
|
-
await
|
|
1246
|
+
await Jt(n.textContent || ""), d.textContent = "Details copied.";
|
|
1248
1247
|
} catch {
|
|
1249
1248
|
d.textContent = "Copy failed. Select the details above and copy them manually.";
|
|
1250
1249
|
let e = document.createRange();
|
|
@@ -1254,7 +1253,7 @@ async function Xt(e, t) {
|
|
|
1254
1253
|
}
|
|
1255
1254
|
e.dataset.formieModuleError = "true", i !== a && a.contains(i) ? i.before(e) : a.prepend(e);
|
|
1256
1255
|
}
|
|
1257
|
-
let t = e.querySelector("[data-formie-module-error-details]"), n =
|
|
1256
|
+
let t = e.querySelector("[data-formie-module-error-details]"), n = qt(r, s.values(), c);
|
|
1258
1257
|
t && t.textContent !== n && (t.textContent = n);
|
|
1259
1258
|
}, _ = (e) => {
|
|
1260
1259
|
h() && (e.preventDefault(), e.stopImmediatePropagation(), g());
|
|
@@ -1273,7 +1272,7 @@ async function Xt(e, t) {
|
|
|
1273
1272
|
});
|
|
1274
1273
|
let d;
|
|
1275
1274
|
try {
|
|
1276
|
-
d =
|
|
1275
|
+
d = Xt(n, i, a);
|
|
1277
1276
|
} catch (e) {
|
|
1278
1277
|
s.has(n.key) || await p(n, e);
|
|
1279
1278
|
continue;
|
|
@@ -1283,7 +1282,7 @@ async function Xt(e, t) {
|
|
|
1283
1282
|
for (let [e, t] of Array.from(f.entries()).reverse()) d.includes(e) || (await m(t.instance), f.delete(e), l.splice(l.indexOf(t.instance), 1));
|
|
1284
1283
|
let h;
|
|
1285
1284
|
try {
|
|
1286
|
-
h = await
|
|
1285
|
+
h = await Yt(n.moduleId, t.registry);
|
|
1287
1286
|
} catch (e) {
|
|
1288
1287
|
s.has(n.key) || await p(n, e);
|
|
1289
1288
|
continue;
|
|
@@ -1407,16 +1406,16 @@ async function Xt(e, t) {
|
|
|
1407
1406
|
}
|
|
1408
1407
|
//#endregion
|
|
1409
1408
|
//#region src/js/utils/form-started-at.ts
|
|
1410
|
-
var
|
|
1411
|
-
function
|
|
1409
|
+
var Qt = "formie:formStartedAt:";
|
|
1410
|
+
function $t(e) {
|
|
1412
1411
|
let t = e.querySelector("input[name=\"formStartedAt\"]");
|
|
1413
1412
|
if (!t) return;
|
|
1414
|
-
let n = e.querySelector("input[name=\"renderId\"]")?.value?.trim() ?? "", r = n ? `${
|
|
1413
|
+
let n = e.querySelector("input[name=\"renderId\"]")?.value?.trim() ?? "", r = n ? `${Qt}${n}` : null, i = r ? sessionStorage.getItem(r) : null;
|
|
1415
1414
|
i || (i = String(Date.now()), r && sessionStorage.setItem(r, i)), t.value = i;
|
|
1416
1415
|
}
|
|
1417
1416
|
//#endregion
|
|
1418
1417
|
//#region src/js/utils/unload-warning.ts
|
|
1419
|
-
var
|
|
1418
|
+
var en = /* @__PURE__ */ new Set([
|
|
1420
1419
|
"action",
|
|
1421
1420
|
"redirect",
|
|
1422
1421
|
"requestToken",
|
|
@@ -1429,38 +1428,38 @@ var $t = /* @__PURE__ */ new Set([
|
|
|
1429
1428
|
"draftContext",
|
|
1430
1429
|
"progressId"
|
|
1431
1430
|
]);
|
|
1432
|
-
function
|
|
1431
|
+
function tn(e, t) {
|
|
1433
1432
|
if (e == null) return String(e);
|
|
1434
1433
|
if (typeof e == "string") return JSON.stringify(e);
|
|
1435
1434
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
1436
1435
|
if (typeof e == "function") return "[function]";
|
|
1437
1436
|
if (typeof File < "u" && e instanceof File) return `[file:${e.name}:${e.size}:${e.type}]`;
|
|
1438
1437
|
if (typeof Blob < "u" && e instanceof Blob) return `[blob:${e.size}:${e.type}]`;
|
|
1439
|
-
if (Array.isArray(e)) return `[${e.map((e) =>
|
|
1438
|
+
if (Array.isArray(e)) return `[${e.map((e) => tn(e, t)).join(",")}]`;
|
|
1440
1439
|
if (typeof e == "object") {
|
|
1441
1440
|
if (t.has(e)) return "[circular]";
|
|
1442
1441
|
t.add(e);
|
|
1443
|
-
let n = Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, n]) => `${JSON.stringify(e)}:${
|
|
1442
|
+
let n = Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, n]) => `${JSON.stringify(e)}:${tn(n, t)}`);
|
|
1444
1443
|
return t.delete(e), `{${n.join(",")}}`;
|
|
1445
1444
|
}
|
|
1446
1445
|
return JSON.stringify(String(e));
|
|
1447
1446
|
}
|
|
1448
|
-
function
|
|
1449
|
-
return
|
|
1447
|
+
function nn(e) {
|
|
1448
|
+
return tn(e, /* @__PURE__ */ new WeakSet());
|
|
1450
1449
|
}
|
|
1451
|
-
function
|
|
1450
|
+
function rn(e, t) {
|
|
1452
1451
|
if (!e) return !1;
|
|
1453
1452
|
let n = e.endsWith("[]") ? e.slice(0, -2) : e;
|
|
1454
|
-
return !
|
|
1453
|
+
return !re(n, t) && !en.has(n);
|
|
1455
1454
|
}
|
|
1456
|
-
function
|
|
1457
|
-
return
|
|
1455
|
+
function an(e) {
|
|
1456
|
+
return nn(Array.from(new FormData(e).entries()).filter(([t]) => rn(String(t || ""), e)));
|
|
1458
1457
|
}
|
|
1459
|
-
function
|
|
1458
|
+
function on(e, t = {}) {
|
|
1460
1459
|
let n = null, r = !1, i = !1, a = null, o = null, s = null, c = () => {
|
|
1461
1460
|
a !== null && (window.cancelAnimationFrame(a), a = null), o !== null && (window.clearTimeout(o), o = null), s !== null && (window.clearTimeout(s), s = null);
|
|
1462
|
-
}, l = () => r ? (i =
|
|
1463
|
-
n =
|
|
1461
|
+
}, l = () => r ? (i = an(e) !== n, i) : !1, u = () => {
|
|
1462
|
+
n = an(e), r = !0, i = !1;
|
|
1464
1463
|
}, d = () => {
|
|
1465
1464
|
c(), r = !1, a = window.requestAnimationFrame(() => {
|
|
1466
1465
|
a = null, s = window.setTimeout(() => {
|
|
@@ -1485,7 +1484,7 @@ function rn(e, t = {}) {
|
|
|
1485
1484
|
}
|
|
1486
1485
|
//#endregion
|
|
1487
1486
|
//#region src/js/validation/rules/email.ts
|
|
1488
|
-
var
|
|
1487
|
+
var sn = {
|
|
1489
1488
|
rule: ({ input: e, getRule: n }) => {
|
|
1490
1489
|
let r = n("email");
|
|
1491
1490
|
return !r || t(e.value, {
|
|
@@ -1497,23 +1496,28 @@ var an = {
|
|
|
1497
1496
|
};
|
|
1498
1497
|
//#endregion
|
|
1499
1498
|
//#region src/js/validation/rules/shared.ts
|
|
1500
|
-
function
|
|
1499
|
+
function cn(e) {
|
|
1501
1500
|
return e?.querySelector("[data-formie-field-label]")?.childNodes[0]?.textContent?.trim() || "";
|
|
1502
1501
|
}
|
|
1503
|
-
function
|
|
1502
|
+
function ln(e) {
|
|
1504
1503
|
let t = e.getRule("match");
|
|
1505
1504
|
if (!t || t === !0 || typeof t != "object" || !e.field) return null;
|
|
1506
1505
|
let n = typeof t.fieldHandle == "string" ? t.fieldHandle.trim() : "";
|
|
1507
1506
|
if (!n) return null;
|
|
1508
1507
|
let r = e.form.querySelector(`[data-formie-field-handle="${n}"]`);
|
|
1509
|
-
return r ? Array.from(r.querySelectorAll(e.config.fieldsSelector)).find((e) => (e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement) && !
|
|
1508
|
+
return r ? Array.from(r.querySelectorAll(e.config.fieldsSelector)).find((e) => (e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement) && !k(e)) ?? null : null;
|
|
1510
1509
|
}
|
|
1511
1510
|
//#endregion
|
|
1512
1511
|
//#region src/js/validation/rules.ts
|
|
1513
|
-
var
|
|
1512
|
+
var un = {
|
|
1514
1513
|
required: {
|
|
1515
1514
|
rule: ({ input: e, getRule: n }) => {
|
|
1516
1515
|
if (!n("required") || e.type === "hidden") return !0;
|
|
1516
|
+
if (e instanceof HTMLInputElement && e.type === "file") {
|
|
1517
|
+
if (e.files?.length) return !0;
|
|
1518
|
+
let t = e.closest("[data-formie-field-handle]"), n = e.name.replace(/\[\]$/, "");
|
|
1519
|
+
return Array.from(t?.querySelectorAll("input[type=\"hidden\"][data-formie-file-upload-asset-id]") || []).some((e) => !e.disabled && e.name.startsWith(`${n}[`) && Number(e.getAttribute("data-formie-file-upload-asset-id")) > 0);
|
|
1520
|
+
}
|
|
1517
1521
|
if (e.type === "checkbox" || e.type === "radio") {
|
|
1518
1522
|
let t = e.form?.querySelectorAll(`[name="${e.name}"]:not([type="hidden"]):not([disabled])`) || [];
|
|
1519
1523
|
return t.length ? Array.from(t).some((e) => e instanceof HTMLInputElement && e.checked) : e instanceof HTMLInputElement ? e.checked : !0;
|
|
@@ -1522,7 +1526,7 @@ var cn = {
|
|
|
1522
1526
|
},
|
|
1523
1527
|
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 })
|
|
1524
1528
|
},
|
|
1525
|
-
email:
|
|
1529
|
+
email: sn,
|
|
1526
1530
|
url: {
|
|
1527
1531
|
rule: ({ input: e, getRule: n }) => {
|
|
1528
1532
|
let r = n("url");
|
|
@@ -1551,18 +1555,18 @@ var cn = {
|
|
|
1551
1555
|
},
|
|
1552
1556
|
match: {
|
|
1553
1557
|
rule: (e) => {
|
|
1554
|
-
let n =
|
|
1558
|
+
let n = ln(e);
|
|
1555
1559
|
return !n || t(e.input.value, { type: "match" }, { comparison: n.value }) === null;
|
|
1556
1560
|
},
|
|
1557
1561
|
message: (e) => {
|
|
1558
|
-
let t =
|
|
1562
|
+
let t = ln(e)?.closest("[data-formie-field-handle]"), n = cn(t);
|
|
1559
1563
|
return e.input.getAttribute("data-formie-validation-match-message") ?? e.t("{label} must match {value}.", {
|
|
1560
1564
|
label: e.label,
|
|
1561
1565
|
value: n
|
|
1562
1566
|
});
|
|
1563
1567
|
}
|
|
1564
1568
|
}
|
|
1565
|
-
},
|
|
1569
|
+
}, dn = {
|
|
1566
1570
|
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,})+$/,
|
|
1567
1571
|
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*)?$/,
|
|
1568
1572
|
number: /^(?:[-+]?[0-9]*[.,]?[0-9]+)$/,
|
|
@@ -1570,14 +1574,14 @@ var cn = {
|
|
|
1570
1574
|
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))/,
|
|
1571
1575
|
time: /^(?:(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]))$/,
|
|
1572
1576
|
month: /^(?:(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])))$/
|
|
1573
|
-
},
|
|
1574
|
-
function
|
|
1577
|
+
}, H = E("general", "validator");
|
|
1578
|
+
function U(e) {
|
|
1575
1579
|
return !!e && (e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement);
|
|
1576
1580
|
}
|
|
1577
|
-
function
|
|
1581
|
+
function fn(e) {
|
|
1578
1582
|
return !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length);
|
|
1579
1583
|
}
|
|
1580
|
-
var
|
|
1584
|
+
var pn = class {
|
|
1581
1585
|
form;
|
|
1582
1586
|
errors = [];
|
|
1583
1587
|
validators = {};
|
|
@@ -1599,14 +1603,14 @@ var dn = class {
|
|
|
1599
1603
|
messagesClass: [],
|
|
1600
1604
|
messageClass: [],
|
|
1601
1605
|
fieldsSelector: "input:not([type=\"hidden\"]):not([type=\"submit\"]):not([type=\"button\"]):not([disabled]), select:not([disabled]), textarea:not([disabled])",
|
|
1602
|
-
patterns:
|
|
1606
|
+
patterns: dn,
|
|
1603
1607
|
...t
|
|
1604
|
-
}, Object.entries(
|
|
1608
|
+
}, Object.entries(un).forEach(([e, t]) => {
|
|
1605
1609
|
this.addValidator(e, t.rule, t.message);
|
|
1606
1610
|
}), this.init();
|
|
1607
1611
|
}
|
|
1608
1612
|
init() {
|
|
1609
|
-
|
|
1613
|
+
H.log("Initializing validator.", {
|
|
1610
1614
|
formId: this.form.id || null,
|
|
1611
1615
|
live: this.config.live
|
|
1612
1616
|
}), this.form.setAttribute("novalidate", "true"), this.inputs().forEach((e) => {
|
|
@@ -1614,9 +1618,9 @@ var dn = class {
|
|
|
1614
1618
|
}), this.config.live && this.addEventListeners(), this.emitEvent(document, o("ready"), { validator: this });
|
|
1615
1619
|
}
|
|
1616
1620
|
inputs(e = null) {
|
|
1617
|
-
if (
|
|
1621
|
+
if (U(e)) return k(e) ? [] : [e];
|
|
1618
1622
|
let t = e || this.form;
|
|
1619
|
-
return Array.from(t.querySelectorAll(this.config.fieldsSelector)).filter((e) =>
|
|
1623
|
+
return Array.from(t.querySelectorAll(this.config.fieldsSelector)).filter((e) => U(e) && !k(e));
|
|
1620
1624
|
}
|
|
1621
1625
|
getInputValue(e) {
|
|
1622
1626
|
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 ?? "";
|
|
@@ -1656,7 +1660,7 @@ var dn = class {
|
|
|
1656
1660
|
}), r = !0;
|
|
1657
1661
|
}
|
|
1658
1662
|
}), !r && this.shouldShowError(e) && this.removeError(e);
|
|
1659
|
-
}),
|
|
1663
|
+
}), H.log("Validation pass complete.", {
|
|
1660
1664
|
errorCount: this.errors.length,
|
|
1661
1665
|
includeHiddenPages: t.includeHiddenPages === !0
|
|
1662
1666
|
}), this.errors;
|
|
@@ -1677,7 +1681,7 @@ var dn = class {
|
|
|
1677
1681
|
e.remove();
|
|
1678
1682
|
}), n && (n.innerHTML = ""), t.querySelectorAll("input, select, textarea").forEach((e) => {
|
|
1679
1683
|
let t = e;
|
|
1680
|
-
t.removeAttribute("aria-invalid"), this.config.inputErrorClass.length && t.classList.remove(...this.config.inputErrorClass), t.removeAttribute("data-formie-input-has-error"),
|
|
1684
|
+
t.removeAttribute("aria-invalid"), this.config.inputErrorClass.length && t.classList.remove(...this.config.inputErrorClass), t.removeAttribute("data-formie-input-has-error"), Re(t, r);
|
|
1681
1685
|
});
|
|
1682
1686
|
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");
|
|
1683
1687
|
this.emitEvent(e, o("clear-error"), { validator: this }), C(this.form);
|
|
@@ -1686,15 +1690,17 @@ var dn = class {
|
|
|
1686
1690
|
let r = e.closest("[data-formie-field-handle]");
|
|
1687
1691
|
if (!r) return;
|
|
1688
1692
|
let i = r.querySelector("[data-formie-field-errors]");
|
|
1689
|
-
i ||=
|
|
1693
|
+
i ||= ut(r, (e) => {
|
|
1690
1694
|
this.config.messagesClass.length && e.classList.add(...this.config.messagesClass);
|
|
1691
1695
|
}), this.config.messagesClass.length && i.classList.add(...this.config.messagesClass), i.innerHTML = "";
|
|
1692
|
-
let a = r.getAttribute("data-formie-field-handle") || "field"
|
|
1693
|
-
i.id = i.id || `${
|
|
1696
|
+
let a = r.getAttribute("data-formie-field-handle") || "field";
|
|
1697
|
+
i.id = i.id || `${e.id || `${this.form.id}-${a}`}-errors`;
|
|
1698
|
+
let s = `${i.id}-1`;
|
|
1699
|
+
Fe(i, Ne(this.config.errorAriaLive, this.submitted));
|
|
1694
1700
|
let c = document.createElement("div");
|
|
1695
1701
|
c.setAttribute("data-formie-field-error", "true"), c.setAttribute(`data-formie-field-error-${t}`, "true"), c.setAttribute("id", s), this.config.messageClass.length && c.classList.add(...this.config.messageClass), c.textContent = n, i.appendChild(c), r.setAttribute("data-formie-field-has-error", "true"), r.querySelectorAll("input, select, textarea").forEach((e) => {
|
|
1696
1702
|
let t = e;
|
|
1697
|
-
|
|
1703
|
+
k(t) || (t.setAttribute("aria-invalid", "true"), this.config.inputErrorClass.length && t.classList.add(...this.config.inputErrorClass), t.setAttribute("data-formie-input-has-error", "true"), M(t, s));
|
|
1698
1704
|
});
|
|
1699
1705
|
for (let e = r; 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");
|
|
1700
1706
|
this.emitEvent(e, o("show-error"), {
|
|
@@ -1706,7 +1712,7 @@ var dn = class {
|
|
|
1706
1712
|
getValidatorCallbackOptions(e) {
|
|
1707
1713
|
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"));
|
|
1708
1714
|
return {
|
|
1709
|
-
t:
|
|
1715
|
+
t: ce,
|
|
1710
1716
|
input: e,
|
|
1711
1717
|
label: n,
|
|
1712
1718
|
field: t,
|
|
@@ -1717,7 +1723,7 @@ var dn = class {
|
|
|
1717
1723
|
};
|
|
1718
1724
|
}
|
|
1719
1725
|
getErrorMessage(e, t, n, r) {
|
|
1720
|
-
return (typeof n.errorMessage == "function" ? n.errorMessage(r) : n.errorMessage) ??
|
|
1726
|
+
return (typeof n.errorMessage == "function" ? n.errorMessage(r) : n.errorMessage) ?? ce("{label} is invalid.", { label: r.label });
|
|
1721
1727
|
}
|
|
1722
1728
|
getErrors() {
|
|
1723
1729
|
return this.errors;
|
|
@@ -1740,7 +1746,7 @@ var dn = class {
|
|
|
1740
1746
|
try {
|
|
1741
1747
|
n = JSON.parse(e);
|
|
1742
1748
|
} catch {
|
|
1743
|
-
return
|
|
1749
|
+
return H.warn("Invalid validation rules payload.", { formId: this.form.id || null }), t;
|
|
1744
1750
|
}
|
|
1745
1751
|
return Array.isArray(n) && n.forEach((e) => {
|
|
1746
1752
|
if (!e || typeof e != "object" || Array.isArray(e)) return;
|
|
@@ -1749,19 +1755,24 @@ var dn = class {
|
|
|
1749
1755
|
}), t;
|
|
1750
1756
|
}
|
|
1751
1757
|
destroy() {
|
|
1752
|
-
|
|
1758
|
+
H.log("Destroying validator.", { formId: this.form.id || null }), this.removeEventListeners(), this.form.removeAttribute("novalidate"), this.emitEvent(document, o("destroy"), { validator: this });
|
|
1753
1759
|
}
|
|
1754
1760
|
isVisible(e, t = {}) {
|
|
1755
1761
|
if (e.disabled || e.hasAttribute("data-formie-conditions-disabled") || e.closest("[data-formie-conditions-disabled]") || e.closest("[data-formie-conditionally-hidden]")) return !1;
|
|
1756
1762
|
if (e.closest("[data-formie-page-hidden]")) return !!t.includeHiddenPages;
|
|
1757
1763
|
let n = e.closest("[data-formie-field-handle]")?.querySelector("[data-formie-rich-text]");
|
|
1758
|
-
|
|
1764
|
+
if (n instanceof HTMLElement) return fn(n);
|
|
1765
|
+
if (e instanceof HTMLSelectElement && e.hasAttribute("data-formie-combobox-input")) {
|
|
1766
|
+
let t = e.nextElementSibling;
|
|
1767
|
+
if (t instanceof HTMLElement && t.classList.contains("formie-combobox")) return fn(t);
|
|
1768
|
+
}
|
|
1769
|
+
return fn(e);
|
|
1759
1770
|
}
|
|
1760
1771
|
blurHandler(e) {
|
|
1761
|
-
e.target instanceof HTMLElement &&
|
|
1772
|
+
e.target instanceof HTMLElement && U(e.target) && !k(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)));
|
|
1762
1773
|
}
|
|
1763
1774
|
changeHandler(e) {
|
|
1764
|
-
if (e.target instanceof HTMLElement &&
|
|
1775
|
+
if (e.target instanceof HTMLElement && U(e.target) && !k(e.target) && e.target.form?.isSameNode(this.form) && !(e instanceof CustomEvent)) {
|
|
1765
1776
|
if (e.target instanceof HTMLSelectElement) {
|
|
1766
1777
|
this.activated.add(e.target), this.validate(e.target);
|
|
1767
1778
|
return;
|
|
@@ -1770,19 +1781,19 @@ var dn = class {
|
|
|
1770
1781
|
}
|
|
1771
1782
|
}
|
|
1772
1783
|
inputHandler(e) {
|
|
1773
|
-
e.target instanceof HTMLElement &&
|
|
1784
|
+
e.target instanceof HTMLElement && U(e.target) && !k(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));
|
|
1774
1785
|
}
|
|
1775
1786
|
submit(e = null, { final: t = !1 } = {}) {
|
|
1776
|
-
return this.submitted = !0,
|
|
1787
|
+
return this.submitted = !0, H.log("Submit validation requested.", { final: t }), this.boundListeners || this.addEventListeners(), this.removeAllErrors(), this.validate(e, { includeHiddenPages: t });
|
|
1777
1788
|
}
|
|
1778
1789
|
resetLiveState() {
|
|
1779
1790
|
this.submitted = !1, this.activated = /* @__PURE__ */ new WeakSet(), this.errors = [], this.removeAllErrors();
|
|
1780
1791
|
}
|
|
1781
1792
|
addEventListeners() {
|
|
1782
|
-
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,
|
|
1793
|
+
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, H.log("Event listeners attached."));
|
|
1783
1794
|
}
|
|
1784
1795
|
removeEventListeners() {
|
|
1785
|
-
this.form.removeEventListener("blur", this.onBlur, !0), this.form.removeEventListener("change", this.onChange, !1), this.form.removeEventListener("input", this.onInput, !1), this.boundListeners = !1,
|
|
1796
|
+
this.form.removeEventListener("blur", this.onBlur, !0), this.form.removeEventListener("change", this.onChange, !1), this.form.removeEventListener("input", this.onInput, !1), this.boundListeners = !1, H.log("Event listeners removed.");
|
|
1786
1797
|
}
|
|
1787
1798
|
emitEvent(e, t, n = {}) {
|
|
1788
1799
|
e.dispatchEvent(new CustomEvent(t, {
|
|
@@ -1802,25 +1813,25 @@ var dn = class {
|
|
|
1802
1813
|
};
|
|
1803
1814
|
//#endregion
|
|
1804
1815
|
//#region src/js/validation/enter-key-guard.ts
|
|
1805
|
-
function
|
|
1816
|
+
function mn(e) {
|
|
1806
1817
|
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]");
|
|
1807
1818
|
}
|
|
1808
|
-
function
|
|
1819
|
+
function hn(e, t) {
|
|
1809
1820
|
let n = e.querySelectorAll(`[data-formie-action="${t}"]`);
|
|
1810
|
-
return Array.from(n).some((e) => !
|
|
1821
|
+
return Array.from(n).some((e) => !mn(e));
|
|
1811
1822
|
}
|
|
1812
|
-
function
|
|
1823
|
+
function gn(e) {
|
|
1813
1824
|
let { final: t } = g(e);
|
|
1814
1825
|
return "submit";
|
|
1815
1826
|
}
|
|
1816
|
-
function
|
|
1817
|
-
return !
|
|
1827
|
+
function _n(e) {
|
|
1828
|
+
return !hn(e, gn(e));
|
|
1818
1829
|
}
|
|
1819
|
-
function
|
|
1830
|
+
function vn(e) {
|
|
1820
1831
|
let t = (t) => {
|
|
1821
1832
|
if (t.key !== "Enter" || t.defaultPrevented) return;
|
|
1822
1833
|
let n = t.target;
|
|
1823
|
-
(n instanceof HTMLInputElement || n instanceof HTMLSelectElement) && (n instanceof HTMLInputElement && (n.type === "button" || n.type === "submit" || n.type === "reset" || n.type === "file") ||
|
|
1834
|
+
(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());
|
|
1824
1835
|
};
|
|
1825
1836
|
return e.addEventListener("keydown", t, !0), () => {
|
|
1826
1837
|
e.removeEventListener("keydown", t, !0);
|
|
@@ -1828,16 +1839,16 @@ function gn(e) {
|
|
|
1828
1839
|
}
|
|
1829
1840
|
//#endregion
|
|
1830
1841
|
//#region src/js/core/create-formie-client.ts
|
|
1831
|
-
var
|
|
1832
|
-
function
|
|
1842
|
+
var W = "[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", G = E("general", "client"), Dn = /* @__PURE__ */ new Set();
|
|
1843
|
+
function K(e, t) {
|
|
1833
1844
|
if (e == null || e === "") return t;
|
|
1834
1845
|
let n = e.toLowerCase();
|
|
1835
1846
|
return n !== "false" && n !== "0" && n !== "off";
|
|
1836
1847
|
}
|
|
1837
|
-
function
|
|
1838
|
-
return e.formieRefreshTokens == null ? e.formieStaticCache != null &&
|
|
1848
|
+
function On(e) {
|
|
1849
|
+
return e.formieRefreshTokens == null ? e.formieStaticCache != null && K(e.formieStaticCache, !0) : K(e.formieRefreshTokens, !0);
|
|
1839
1850
|
}
|
|
1840
|
-
function
|
|
1851
|
+
function q(e) {
|
|
1841
1852
|
let t = e instanceof HTMLElement ? e.dataset : {};
|
|
1842
1853
|
return {
|
|
1843
1854
|
mode: "server-rendered",
|
|
@@ -1845,25 +1856,25 @@ function J(e) {
|
|
|
1845
1856
|
profile: t.formieRequestProfile,
|
|
1846
1857
|
formHandle: t.formieHandle,
|
|
1847
1858
|
endpoint: t.formieEndpoint,
|
|
1848
|
-
staticCache:
|
|
1849
|
-
autoVisible:
|
|
1850
|
-
compatibility:
|
|
1859
|
+
staticCache: On(t),
|
|
1860
|
+
autoVisible: K(t.formieAutoVisible, !0),
|
|
1861
|
+
compatibility: K(t.formieCompatibility, !1)
|
|
1851
1862
|
};
|
|
1852
1863
|
}
|
|
1853
|
-
function
|
|
1864
|
+
function kn(e) {
|
|
1854
1865
|
if (e && e !== "server-rendered") throw Error("@verbb/formie-browser enhances server-rendered HTML only. Use @verbb/formie-core for client-rendered forms.");
|
|
1855
1866
|
return "server-rendered";
|
|
1856
1867
|
}
|
|
1857
|
-
function
|
|
1868
|
+
function An(e) {
|
|
1858
1869
|
return e || "rest";
|
|
1859
1870
|
}
|
|
1860
|
-
function
|
|
1871
|
+
function jn(e) {
|
|
1861
1872
|
return e instanceof HTMLFormElement ? e : e.querySelector("form");
|
|
1862
1873
|
}
|
|
1863
|
-
function
|
|
1864
|
-
|
|
1874
|
+
function Mn(e, t) {
|
|
1875
|
+
Dn.has(e) || (Dn.add(e), G.warn(t));
|
|
1865
1876
|
}
|
|
1866
|
-
function
|
|
1877
|
+
function Nn(e, t) {
|
|
1867
1878
|
if (!e) return e;
|
|
1868
1879
|
try {
|
|
1869
1880
|
return new URL(e).toString();
|
|
@@ -1875,21 +1886,21 @@ function jn(e, t) {
|
|
|
1875
1886
|
return e;
|
|
1876
1887
|
}
|
|
1877
1888
|
}
|
|
1878
|
-
function
|
|
1889
|
+
function J(e, t) {
|
|
1879
1890
|
let n = (e || "").trim();
|
|
1880
|
-
return n ? n.includes(t) ? n :
|
|
1891
|
+
return n ? n.includes(t) ? n : Nn(t, n) : t;
|
|
1881
1892
|
}
|
|
1882
|
-
function
|
|
1883
|
-
return
|
|
1893
|
+
function Pn(e, t) {
|
|
1894
|
+
return J(e.endpoint || t.dataset.formieEndpoint, bn);
|
|
1884
1895
|
}
|
|
1885
|
-
function
|
|
1896
|
+
function Fn(e, t) {
|
|
1886
1897
|
let n = (e.endpoint || t.dataset.formieEndpoint || "").trim();
|
|
1887
|
-
return n ? n.includes("/graphql") || n.endsWith("/api") || n.includes("/actions/graphql/") ? n :
|
|
1898
|
+
return n ? n.includes("/graphql") || n.endsWith("/api") || n.includes("/actions/graphql/") ? n : Nn(xn, n) : xn;
|
|
1888
1899
|
}
|
|
1889
|
-
function
|
|
1890
|
-
return
|
|
1900
|
+
function In(e, t) {
|
|
1901
|
+
return J(t.dataset.formieRefreshTokensEndpoint || e.endpoint || t.dataset.formieEndpoint, Sn);
|
|
1891
1902
|
}
|
|
1892
|
-
function
|
|
1903
|
+
function Ln(e, t) {
|
|
1893
1904
|
if (!e) return t;
|
|
1894
1905
|
try {
|
|
1895
1906
|
let n = new URL(e, window.location.origin), r = new URL(t, window.location.origin);
|
|
@@ -1900,39 +1911,39 @@ function Fn(e, t) {
|
|
|
1900
1911
|
return t;
|
|
1901
1912
|
}
|
|
1902
1913
|
}
|
|
1903
|
-
function
|
|
1904
|
-
let r = n.endpoint || e.dataset.formieEndpoint, i =
|
|
1905
|
-
t.setAttribute("action",
|
|
1906
|
-
let t = e.getAttribute("href"), n =
|
|
1907
|
-
e.setAttribute("href",
|
|
1914
|
+
function Rn(e, t, n) {
|
|
1915
|
+
let r = n.endpoint || e.dataset.formieEndpoint, i = J(r, Cn), a = t.getAttribute("action");
|
|
1916
|
+
t.setAttribute("action", Ln(a, i)), t.querySelectorAll("[data-formie-tab-link]").forEach((e) => {
|
|
1917
|
+
let t = e.getAttribute("href"), n = J(r, wn);
|
|
1918
|
+
e.setAttribute("href", Ln(t, n));
|
|
1908
1919
|
}), t.querySelectorAll("[data-formie-file-upload-hydrate-endpoint]").forEach((e) => {
|
|
1909
|
-
e.setAttribute("data-formie-file-upload-hydrate-endpoint",
|
|
1920
|
+
e.setAttribute("data-formie-file-upload-hydrate-endpoint", J(r, En));
|
|
1910
1921
|
});
|
|
1911
1922
|
}
|
|
1912
|
-
function
|
|
1923
|
+
function zn(e) {
|
|
1913
1924
|
if (e == null) return !1;
|
|
1914
1925
|
let t = e.trim().toLowerCase();
|
|
1915
1926
|
return t === "true" || t === "1" || t === "";
|
|
1916
1927
|
}
|
|
1917
|
-
function
|
|
1918
|
-
return
|
|
1928
|
+
function Bn(e) {
|
|
1929
|
+
return K(e.dataset.formieAutomaticSubmissionState, !0);
|
|
1919
1930
|
}
|
|
1920
|
-
function
|
|
1921
|
-
return
|
|
1931
|
+
function Vn(e, t, n) {
|
|
1932
|
+
return J(n.dataset.formieClearSubmissionEndpoint || e.endpoint || t.dataset.formieEndpoint, Tn);
|
|
1922
1933
|
}
|
|
1923
|
-
function
|
|
1924
|
-
return
|
|
1934
|
+
function Hn(e) {
|
|
1935
|
+
return zn(e.dataset.formieUnloadWarning);
|
|
1925
1936
|
}
|
|
1926
|
-
function
|
|
1937
|
+
function Un(e, t) {
|
|
1927
1938
|
e.setAttribute("data-formie-internal-navigation", t);
|
|
1928
1939
|
}
|
|
1929
|
-
function
|
|
1940
|
+
function Y(e) {
|
|
1930
1941
|
e.removeAttribute("data-formie-internal-navigation");
|
|
1931
1942
|
}
|
|
1932
|
-
function
|
|
1943
|
+
function Wn(e) {
|
|
1933
1944
|
return e.getAttribute("data-formie-internal-navigation") !== null;
|
|
1934
1945
|
}
|
|
1935
|
-
function
|
|
1946
|
+
function Gn(e, t) {
|
|
1936
1947
|
if (!e) return !1;
|
|
1937
1948
|
try {
|
|
1938
1949
|
return new URL(e, window.location.origin).searchParams.has(t);
|
|
@@ -1940,30 +1951,30 @@ function Wn(e, t) {
|
|
|
1940
1951
|
return !1;
|
|
1941
1952
|
}
|
|
1942
1953
|
}
|
|
1943
|
-
function Gn(e) {
|
|
1944
|
-
return Wn(window.location.href, "resumeToken") || Wn(e.getAttribute("action"), "resumeToken");
|
|
1945
|
-
}
|
|
1946
1954
|
function Kn(e) {
|
|
1955
|
+
return Gn(window.location.href, "resumeToken") || Gn(e.getAttribute("action"), "resumeToken");
|
|
1956
|
+
}
|
|
1957
|
+
function qn(e) {
|
|
1947
1958
|
return e instanceof MouseEvent ? e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey : !0;
|
|
1948
1959
|
}
|
|
1949
|
-
function
|
|
1960
|
+
function Jn(e, t = 0) {
|
|
1950
1961
|
if (!e) return t;
|
|
1951
1962
|
let n = Number.parseInt(e, 10);
|
|
1952
1963
|
return Number.isFinite(n) ? n : t;
|
|
1953
1964
|
}
|
|
1954
|
-
function
|
|
1955
|
-
return Math.max(0,
|
|
1965
|
+
function Yn(e) {
|
|
1966
|
+
return Math.max(0, Jn(e.dataset.formieSubmitDelay, yn));
|
|
1956
1967
|
}
|
|
1957
1968
|
function X(e) {
|
|
1958
|
-
return
|
|
1969
|
+
return zn(e.dataset.formieValidationOnSubmit);
|
|
1959
1970
|
}
|
|
1960
|
-
async function
|
|
1961
|
-
let t =
|
|
1971
|
+
async function Xn(e) {
|
|
1972
|
+
let t = Yn(e);
|
|
1962
1973
|
t < 1 || await new Promise((e) => {
|
|
1963
1974
|
window.setTimeout(e, t);
|
|
1964
1975
|
});
|
|
1965
1976
|
}
|
|
1966
|
-
function
|
|
1977
|
+
function Zn(e, t) {
|
|
1967
1978
|
let n = e?.getAttribute(t)?.trim();
|
|
1968
1979
|
if (!n) return null;
|
|
1969
1980
|
try {
|
|
@@ -1973,29 +1984,29 @@ function Z(e, t) {
|
|
|
1973
1984
|
return console.error(`[formie] Failed to parse ${t}.`, e), null;
|
|
1974
1985
|
}
|
|
1975
1986
|
}
|
|
1976
|
-
function
|
|
1987
|
+
function Qn(e, t) {
|
|
1977
1988
|
let n = t || (e instanceof HTMLFormElement ? e : null);
|
|
1978
1989
|
if (!n) return null;
|
|
1979
|
-
let r =
|
|
1990
|
+
let r = Zn(n, "data-formie-modules"), i = Zn(n, "data-formie-theme-classes") || Zn(n, "data-formie-theme");
|
|
1980
1991
|
return !r && !i ? null : {
|
|
1981
1992
|
modules: r || void 0,
|
|
1982
1993
|
theme: i || void 0
|
|
1983
1994
|
};
|
|
1984
1995
|
}
|
|
1985
|
-
function
|
|
1996
|
+
function $n(e) {
|
|
1986
1997
|
if (!(e instanceof HTMLElement)) return !0;
|
|
1987
1998
|
if (!e.isConnected || e.hidden || e.closest("[hidden]")) return !1;
|
|
1988
1999
|
let t = window.getComputedStyle(e);
|
|
1989
2000
|
return t.display === "none" || t.visibility === "hidden" ? !1 : e.getClientRects().length > 0;
|
|
1990
2001
|
}
|
|
1991
|
-
function
|
|
2002
|
+
function er(e, t) {
|
|
1992
2003
|
return t === document ? !0 : t instanceof Element ? t === e || t.contains(e) : !0;
|
|
1993
2004
|
}
|
|
1994
|
-
function
|
|
2005
|
+
function Z(e) {
|
|
1995
2006
|
let t = e, n = t.id ? `#${t.id}` : "", r = t.dataset?.formieHandle ? `[handle="${t.dataset.formieHandle}"]` : "";
|
|
1996
2007
|
return `${t.tagName ? t.tagName.toLowerCase() : "element"}${n}${r}`;
|
|
1997
2008
|
}
|
|
1998
|
-
function
|
|
2009
|
+
function tr(e, t) {
|
|
1999
2010
|
if (t) {
|
|
2000
2011
|
if (t.csrf?.param && t.csrf?.token) {
|
|
2001
2012
|
let n = e.querySelector(`input[name="${t.csrf.param}"]`);
|
|
@@ -2022,11 +2033,11 @@ function $n(e, t) {
|
|
|
2022
2033
|
});
|
|
2023
2034
|
}
|
|
2024
2035
|
}
|
|
2025
|
-
async function
|
|
2026
|
-
let n =
|
|
2036
|
+
async function nr(e, t) {
|
|
2037
|
+
let n = kn(t.mode), r = An(t.transport);
|
|
2027
2038
|
if (n !== "server-rendered") return null;
|
|
2028
2039
|
if (t.payload) return t.payload.html && (e.innerHTML = t.payload.html), t.payload;
|
|
2029
|
-
let i = !!
|
|
2040
|
+
let i = !!jn(e), a = t.formHandle || e.dataset.formieHandle;
|
|
2030
2041
|
if (i || !a) return null;
|
|
2031
2042
|
let o = {
|
|
2032
2043
|
mode: n,
|
|
@@ -2035,31 +2046,31 @@ async function er(e, t) {
|
|
|
2035
2046
|
siteId: t.siteId,
|
|
2036
2047
|
theme: t.theme,
|
|
2037
2048
|
themeConfig: t.themeConfig
|
|
2038
|
-
}, s = r === "graphql" ?
|
|
2049
|
+
}, s = r === "graphql" ? Fn(t, e) : Pn(t, e), c = r === "graphql" ? await Je(s, a, o, t) : await qe(s, a, {
|
|
2039
2050
|
...o,
|
|
2040
2051
|
endpoint: s
|
|
2041
2052
|
}, t);
|
|
2042
2053
|
return c?.html && (e.innerHTML = c.html), c;
|
|
2043
2054
|
}
|
|
2044
|
-
async function
|
|
2055
|
+
async function rr(e, t, n) {
|
|
2045
2056
|
if (t.refreshTokens === !1) return;
|
|
2046
2057
|
let r = t.formHandle || e.dataset.formieHandle;
|
|
2047
2058
|
if (!r) return;
|
|
2048
|
-
let i = await
|
|
2049
|
-
|
|
2059
|
+
let i = await P(In(t, e), r, n.querySelector("input[name=\"renderId\"]")?.value || void 0, t, n?.querySelector("input[name=\"requestToken\"]")?.value);
|
|
2060
|
+
tr(n, i), y(e, "formie:refresh-tokens:refreshed", i);
|
|
2050
2061
|
}
|
|
2051
|
-
function
|
|
2062
|
+
function ir(e, t, n, r, i, a) {
|
|
2052
2063
|
let o = () => {};
|
|
2053
2064
|
t.dataset.formieRequestProfile = n.profile ?? "same-origin-browser", n.profile === "cross-origin-public" && (t.dataset.formieSubmitMethod = "ajax");
|
|
2054
|
-
let s = String(t.dataset.formieSubmitMethod || "").trim().toLowerCase(), c =
|
|
2065
|
+
let s = String(t.dataset.formieSubmitMethod || "").trim().toLowerCase(), c = Vn(n, e, t), l = !1, u = t.querySelectorAll("[data-formie-action]"), d = (e) => {
|
|
2055
2066
|
if (e) {
|
|
2056
2067
|
t.setAttribute("data-formie-pending-action", e);
|
|
2057
2068
|
return;
|
|
2058
2069
|
}
|
|
2059
2070
|
t.removeAttribute("data-formie-pending-action");
|
|
2060
2071
|
};
|
|
2061
|
-
if (
|
|
2062
|
-
let n =
|
|
2072
|
+
if (Hn(t)) {
|
|
2073
|
+
let n = on(t, { shouldWarn: () => !Wn(t) });
|
|
2063
2074
|
o = n.scheduleBaselineCapture;
|
|
2064
2075
|
let r = (e) => {
|
|
2065
2076
|
if (!(e instanceof CustomEvent)) return;
|
|
@@ -2083,7 +2094,7 @@ function nr(e, t, n, r, i, a) {
|
|
|
2083
2094
|
}), t.querySelectorAll("[data-formie-tab-link]").forEach((n) => {
|
|
2084
2095
|
let r = async (n) => {
|
|
2085
2096
|
if (s !== "ajax") {
|
|
2086
|
-
|
|
2097
|
+
qn(n) && Un(t, "set-page");
|
|
2087
2098
|
return;
|
|
2088
2099
|
}
|
|
2089
2100
|
n.preventDefault();
|
|
@@ -2094,10 +2105,10 @@ function nr(e, t, n, r, i, a) {
|
|
|
2094
2105
|
href: a
|
|
2095
2106
|
});
|
|
2096
2107
|
try {
|
|
2097
|
-
let n = await
|
|
2108
|
+
let n = await Ye(a, t, i);
|
|
2098
2109
|
if (n.pageId && _(t, String(n.pageId)), !n.success) {
|
|
2099
2110
|
let { form: e = [], ...r } = n.errors ?? {};
|
|
2100
|
-
|
|
2111
|
+
Lt(t), Ot(t, r), kt(t, e), We(t);
|
|
2101
2112
|
return;
|
|
2102
2113
|
}
|
|
2103
2114
|
y(e, "formie:page:navigate:after", {
|
|
@@ -2117,9 +2128,9 @@ function nr(e, t, n, r, i, a) {
|
|
|
2117
2128
|
n.addEventListener("click", r), a.push(() => {
|
|
2118
2129
|
n.removeEventListener("click", r);
|
|
2119
2130
|
});
|
|
2120
|
-
}), !
|
|
2131
|
+
}), !Bn(t)) {
|
|
2121
2132
|
let e = !1, n = () => {
|
|
2122
|
-
e ||
|
|
2133
|
+
e || Wn(t) || Kn(t) || (e = !0, Xe(c, t));
|
|
2123
2134
|
};
|
|
2124
2135
|
window.addEventListener("pagehide", n), window.addEventListener("beforeunload", n), a.push(() => {
|
|
2125
2136
|
window.removeEventListener("pagehide", n), window.removeEventListener("beforeunload", n);
|
|
@@ -2134,7 +2145,7 @@ function nr(e, t, n, r, i, a) {
|
|
|
2134
2145
|
} else t.removeAttribute("data-formie-internal-resubmit");
|
|
2135
2146
|
let c = a.submitter, u = c?.getAttribute("data-formie-action"), f = t.getAttribute("data-formie-pending-action"), m = t.querySelector("input[name=\"submitAction\"]"), _ = u || f || m?.value || "submit", b = null, x = !1;
|
|
2136
2147
|
try {
|
|
2137
|
-
if (o) b = await
|
|
2148
|
+
if (o) b = await Rt({
|
|
2138
2149
|
target: e,
|
|
2139
2150
|
form: t,
|
|
2140
2151
|
bus: r,
|
|
@@ -2142,25 +2153,25 @@ function nr(e, t, n, r, i, a) {
|
|
|
2142
2153
|
validateOnSubmit: X(t),
|
|
2143
2154
|
action: _,
|
|
2144
2155
|
submitter: c,
|
|
2145
|
-
waitForSubmitDelay:
|
|
2156
|
+
waitForSubmitDelay: Xn,
|
|
2146
2157
|
onRefreshTokensAfterSubmit: async () => {
|
|
2147
|
-
await
|
|
2158
|
+
await rr(e, n, t);
|
|
2148
2159
|
},
|
|
2149
2160
|
dispatchSubmitResult: (t) => {
|
|
2150
2161
|
y(e, "formie:submit:result", t);
|
|
2151
2162
|
}
|
|
2152
2163
|
});
|
|
2153
2164
|
else {
|
|
2154
|
-
if (
|
|
2165
|
+
if (Lt(t), v(t, c), await Xn(t), b = await ct(t, _, r, {
|
|
2155
2166
|
validator: i,
|
|
2156
2167
|
validateOnSubmit: X(t),
|
|
2157
2168
|
preflightOnly: !0
|
|
2158
2169
|
}), b.ok) {
|
|
2159
|
-
p(t, _), l = !0,
|
|
2170
|
+
p(t, _), l = !0, Un(t, "submit"), d(null);
|
|
2160
2171
|
let e = !1, n = () => {
|
|
2161
|
-
if (e = !0, l = !1,
|
|
2172
|
+
if (e = !0, l = !1, Y(t), h(t), i && X(t)) {
|
|
2162
2173
|
let { scope: e, final: n } = g(t), r = i.submit(n ? t : e, { final: n });
|
|
2163
|
-
r.length > 0 &&
|
|
2174
|
+
r.length > 0 && z(t, {
|
|
2164
2175
|
ok: !1,
|
|
2165
2176
|
stage: "validate",
|
|
2166
2177
|
code: "VALIDATION_FAILED",
|
|
@@ -2182,7 +2193,7 @@ function nr(e, t, n, r, i, a) {
|
|
|
2182
2193
|
x = !0;
|
|
2183
2194
|
return;
|
|
2184
2195
|
}
|
|
2185
|
-
|
|
2196
|
+
z(t, b), y(e, "formie:submit:result", b), Y(t);
|
|
2186
2197
|
}
|
|
2187
2198
|
} catch (n) {
|
|
2188
2199
|
l = !1, b = {
|
|
@@ -2190,7 +2201,7 @@ function nr(e, t, n, r, i, a) {
|
|
|
2190
2201
|
code: "SUBMIT_ERROR",
|
|
2191
2202
|
message: n instanceof Error ? n.message : "Submission failed.",
|
|
2192
2203
|
formErrors: [n instanceof Error ? n.message : "Submission failed."]
|
|
2193
|
-
},
|
|
2204
|
+
}, z(t, b), y(e, "formie:submit:result", b), Y(t);
|
|
2194
2205
|
} finally {
|
|
2195
2206
|
d(null), !o && !x && !It(b) && h(t);
|
|
2196
2207
|
}
|
|
@@ -2199,14 +2210,14 @@ function nr(e, t, n, r, i, a) {
|
|
|
2199
2210
|
t.removeEventListener("submit", f);
|
|
2200
2211
|
}), o;
|
|
2201
2212
|
}
|
|
2202
|
-
async function
|
|
2213
|
+
async function ar(e, t, n) {
|
|
2203
2214
|
if (t.refreshTokens === !1 || !t.staticCache) return;
|
|
2204
|
-
let r = t.formHandle || e.dataset.formieHandle, i =
|
|
2215
|
+
let r = t.formHandle || e.dataset.formieHandle, i = In(t, e), a = n?.querySelector("input[name=\"renderId\"]")?.value || void 0;
|
|
2205
2216
|
if (!r) return;
|
|
2206
|
-
let o = await
|
|
2207
|
-
o && n && (
|
|
2217
|
+
let o = await P(i, r, a, t, n?.querySelector("input[name=\"requestToken\"]")?.value);
|
|
2218
|
+
o && n && (tr(n, o), y(e, "formie:refresh-tokens:after", o));
|
|
2208
2219
|
}
|
|
2209
|
-
function
|
|
2220
|
+
function or() {
|
|
2210
2221
|
let t = /* @__PURE__ */ new Map(), r = new B(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = [
|
|
2211
2222
|
"prepare",
|
|
2212
2223
|
"normalize",
|
|
@@ -2222,158 +2233,160 @@ function ir() {
|
|
|
2222
2233
|
return;
|
|
2223
2234
|
}
|
|
2224
2235
|
let r = (async () => {
|
|
2225
|
-
|
|
2236
|
+
G.log("Unmount requested.", { target: Z(e) });
|
|
2226
2237
|
let n = i.get(e);
|
|
2227
2238
|
n && (n(), i.delete(e));
|
|
2228
2239
|
let r = t.get(e);
|
|
2229
2240
|
if (!r) {
|
|
2230
|
-
|
|
2241
|
+
G.log("Unmount skipped (no mounted state).", { target: Z(e) });
|
|
2231
2242
|
return;
|
|
2232
2243
|
}
|
|
2233
2244
|
y(e, "formie:unmount:before", { id: r.instance.id }), r.unbinds.forEach((e) => {
|
|
2234
2245
|
e();
|
|
2235
|
-
}), r.unbinds = [], r.validator?.destroy(), r.validator = null, await r.modules.destroy(), r.bus.clear(), t.delete(e), y(e, "formie:unmount:after", { id: r.instance.id }),
|
|
2246
|
+
}), r.unbinds = [], r.validator?.destroy(), r.validator = null, await r.modules.destroy(), r.bus.clear(), t.delete(e), y(e, "formie:unmount:after", { id: r.instance.id }), G.log("Unmount complete.", {
|
|
2236
2247
|
id: r.instance.id,
|
|
2237
|
-
target:
|
|
2248
|
+
target: Z(e)
|
|
2238
2249
|
});
|
|
2239
2250
|
})().finally(() => {
|
|
2240
2251
|
a.delete(e);
|
|
2241
2252
|
});
|
|
2242
2253
|
a.set(e, r), await r;
|
|
2243
2254
|
}, c = async (a, c) => {
|
|
2244
|
-
|
|
2245
|
-
target:
|
|
2255
|
+
G.log("Mount requested.", {
|
|
2256
|
+
target: Z(a),
|
|
2246
2257
|
mode: c.mode,
|
|
2247
2258
|
autoVisible: c.autoVisible
|
|
2248
2259
|
});
|
|
2249
2260
|
let l = i.get(a);
|
|
2250
2261
|
l && (l(), i.delete(a));
|
|
2251
2262
|
let u = t.get(a);
|
|
2252
|
-
if (u) return
|
|
2263
|
+
if (u) return G.log("Mount skipped (already mounted).", {
|
|
2253
2264
|
id: u.instance.id,
|
|
2254
|
-
target:
|
|
2265
|
+
target: Z(a)
|
|
2255
2266
|
}), u.instance;
|
|
2256
|
-
let d = new
|
|
2267
|
+
let d = new zt(), f = [], p = a?.id || `formie-${t.size + 1}`, h = q(a), g = {
|
|
2257
2268
|
...h,
|
|
2258
2269
|
...c,
|
|
2259
|
-
mode:
|
|
2260
|
-
transport:
|
|
2261
|
-
}, _ =
|
|
2262
|
-
|
|
2270
|
+
mode: kn(c.mode ?? h.mode),
|
|
2271
|
+
transport: An(c.transport ?? h.transport)
|
|
2272
|
+
}, _ = await nr(a, g), v = jn(a);
|
|
2273
|
+
c.compatibility === void 0 && v?.hasAttribute("data-formie-compatibility") && (g.compatibility = q(v).compatibility);
|
|
2274
|
+
let b = we(g.compatibility);
|
|
2275
|
+
v && e(v, g), g.staticCache = c.staticCache ?? On(v ? v.dataset : a.dataset);
|
|
2263
2276
|
let S;
|
|
2264
2277
|
try {
|
|
2265
|
-
S =
|
|
2278
|
+
S = Qn(a, v), _?.modules && n(_.modules), S?.modules && n(S.modules);
|
|
2266
2279
|
} catch (e) {
|
|
2267
|
-
if (
|
|
2268
|
-
|
|
2280
|
+
if (v) {
|
|
2281
|
+
v.addEventListener("submit", (e) => {
|
|
2269
2282
|
e.preventDefault(), e.stopImmediatePropagation();
|
|
2270
2283
|
}, !0);
|
|
2271
2284
|
let e = document.createElement("div");
|
|
2272
|
-
e.setAttribute("role", "alert"), e.textContent = "This form requires a compatible Formie browser package. Update Formie and its browser packages together.",
|
|
2285
|
+
e.setAttribute("role", "alert"), e.textContent = "This form requires a compatible Formie browser package. Update Formie and its browser packages together.", v.prepend(e);
|
|
2273
2286
|
}
|
|
2274
2287
|
throw e;
|
|
2275
2288
|
}
|
|
2276
|
-
let ee =
|
|
2277
|
-
...
|
|
2289
|
+
let ee = _ || S ? {
|
|
2290
|
+
..._ || {},
|
|
2278
2291
|
...S || {}
|
|
2279
|
-
} : null, te = ee?.theme,
|
|
2292
|
+
} : null, te = ee?.theme, w = {}, T = ee?.modules ?? {
|
|
2280
2293
|
contractVersion: 2,
|
|
2281
2294
|
surface: "server-rendered",
|
|
2282
2295
|
entries: []
|
|
2283
2296
|
};
|
|
2284
|
-
n(
|
|
2285
|
-
target:
|
|
2286
|
-
hasRenderPayload: !!
|
|
2297
|
+
n(T), G.log("Resolved mount payload.", {
|
|
2298
|
+
target: Z(a),
|
|
2299
|
+
hasRenderPayload: !!_,
|
|
2287
2300
|
hasEmbeddedPayload: !!S,
|
|
2288
|
-
moduleCount:
|
|
2301
|
+
moduleCount: T.entries.length
|
|
2289
2302
|
});
|
|
2290
|
-
let
|
|
2291
|
-
live:
|
|
2292
|
-
errorAriaLive:
|
|
2293
|
-
errorMessage:
|
|
2294
|
-
fieldContainerErrorClass:
|
|
2295
|
-
inputErrorClass:
|
|
2296
|
-
messagesClass:
|
|
2297
|
-
messageClass:
|
|
2303
|
+
let E = ne(a, te, v), D = v ? new pn(v, {
|
|
2304
|
+
live: zn(v.dataset.formieValidationOnFocus),
|
|
2305
|
+
errorAriaLive: Me(v),
|
|
2306
|
+
errorMessage: v.dataset.formieErrorMessage || "",
|
|
2307
|
+
fieldContainerErrorClass: E.fieldLayoutError || [],
|
|
2308
|
+
inputErrorClass: E.fieldControlError || [],
|
|
2309
|
+
messagesClass: E.fieldErrors || [],
|
|
2310
|
+
messageClass: E.fieldError || []
|
|
2298
2311
|
}) : null;
|
|
2299
|
-
if (
|
|
2300
|
-
let e =
|
|
2301
|
-
e.formieValidation =
|
|
2312
|
+
if (v && D) {
|
|
2313
|
+
let e = v;
|
|
2314
|
+
e.formieValidation = D, w.validation = D;
|
|
2302
2315
|
let t = {
|
|
2303
|
-
validator:
|
|
2304
|
-
addValidator:
|
|
2305
|
-
removeValidator:
|
|
2316
|
+
validator: D,
|
|
2317
|
+
addValidator: D.addValidator.bind(D),
|
|
2318
|
+
removeValidator: D.removeValidator.bind(D)
|
|
2306
2319
|
};
|
|
2307
|
-
y(
|
|
2320
|
+
y(v, "formie:validator:ready", t), y(a, "formie:validator:ready", t);
|
|
2308
2321
|
}
|
|
2309
|
-
|
|
2310
|
-
let
|
|
2322
|
+
v && ($t(v), (_ || g.endpoint || a.dataset.formieEndpoint) && Rn(a, v, g), g.mode === "server-rendered" && Ue(v) && (He(v), We(v)), C(v)), Object.keys(E).length && y(a, "formie:theme:applied", { hasClasses: !0 }), v?.querySelector("craft-csrf-input") && await oe("craft-csrf-input", v);
|
|
2323
|
+
let O = await Zt(T, {
|
|
2311
2324
|
registry: r,
|
|
2312
2325
|
matchContext: {
|
|
2313
2326
|
root: a,
|
|
2314
|
-
form:
|
|
2315
|
-
surface:
|
|
2327
|
+
form: v,
|
|
2328
|
+
surface: T.surface
|
|
2316
2329
|
},
|
|
2317
2330
|
setupContext: {
|
|
2318
2331
|
formId: p,
|
|
2319
2332
|
root: a,
|
|
2320
|
-
form:
|
|
2333
|
+
form: v,
|
|
2321
2334
|
target: a,
|
|
2322
2335
|
scope: "form",
|
|
2323
|
-
surface:
|
|
2324
|
-
state:
|
|
2336
|
+
surface: T.surface,
|
|
2337
|
+
state: w,
|
|
2325
2338
|
on: (e, t) => d.on(e, t),
|
|
2326
2339
|
emit: (e, t) => (y(a, e, t), d.emitSafe(e, t).then((t) => {
|
|
2327
|
-
t.failed.length > 0 &&
|
|
2340
|
+
t.failed.length > 0 && G.warn("Lifecycle listeners failed.", {
|
|
2328
2341
|
eventName: e,
|
|
2329
2342
|
failed: t.failed.length
|
|
2330
2343
|
});
|
|
2331
2344
|
}))
|
|
2332
2345
|
}
|
|
2333
2346
|
});
|
|
2334
|
-
|
|
2335
|
-
target:
|
|
2336
|
-
moduleInstances:
|
|
2347
|
+
G.log("Module setup complete.", {
|
|
2348
|
+
target: Z(a),
|
|
2349
|
+
moduleInstances: O.instances.length
|
|
2337
2350
|
});
|
|
2338
|
-
let
|
|
2351
|
+
let k = {
|
|
2339
2352
|
id: p,
|
|
2340
2353
|
root: a,
|
|
2341
2354
|
submit: async (e = "submit") => {
|
|
2342
|
-
if (
|
|
2355
|
+
if (G.log("Submit requested.", {
|
|
2343
2356
|
id: p,
|
|
2344
|
-
target:
|
|
2357
|
+
target: Z(a),
|
|
2345
2358
|
action: e
|
|
2346
|
-
}), !
|
|
2359
|
+
}), !v) return {
|
|
2347
2360
|
ok: !1,
|
|
2348
2361
|
code: "FORM_NOT_FOUND",
|
|
2349
2362
|
message: "No form element found for mount target.",
|
|
2350
2363
|
formErrors: ["No form element found for mount target."]
|
|
2351
2364
|
};
|
|
2352
|
-
let t =
|
|
2353
|
-
if (t && (t.value = e),
|
|
2365
|
+
let t = v.querySelector("input[name=\"submitAction\"]");
|
|
2366
|
+
if (t && (t.value = e), v.getAttribute("data-formie-loading") === "true") return {
|
|
2354
2367
|
ok: !1,
|
|
2355
2368
|
code: "SUBMIT_IN_PROGRESS",
|
|
2356
2369
|
message: "Submission already in progress.",
|
|
2357
2370
|
formErrors: []
|
|
2358
2371
|
};
|
|
2359
|
-
let n =
|
|
2372
|
+
let n = v.querySelector(`[data-formie-action="${e}"]`), r = await Rt({
|
|
2360
2373
|
id: p,
|
|
2361
2374
|
target: a,
|
|
2362
|
-
form:
|
|
2375
|
+
form: v,
|
|
2363
2376
|
bus: d,
|
|
2364
|
-
validator:
|
|
2365
|
-
validateOnSubmit: X(
|
|
2377
|
+
validator: D,
|
|
2378
|
+
validateOnSubmit: X(v),
|
|
2366
2379
|
action: e,
|
|
2367
2380
|
submitter: n,
|
|
2368
|
-
waitForSubmitDelay:
|
|
2381
|
+
waitForSubmitDelay: Xn,
|
|
2369
2382
|
onRefreshTokensAfterSubmit: async () => {
|
|
2370
|
-
await
|
|
2383
|
+
await rr(a, g, v);
|
|
2371
2384
|
},
|
|
2372
2385
|
dispatchSubmitResult: (e) => {
|
|
2373
2386
|
y(a, "formie:submit:result", e);
|
|
2374
2387
|
}
|
|
2375
2388
|
});
|
|
2376
|
-
return
|
|
2389
|
+
return G.log("Submit completed.", {
|
|
2377
2390
|
id: p,
|
|
2378
2391
|
action: e,
|
|
2379
2392
|
ok: r.ok,
|
|
@@ -2386,25 +2399,25 @@ function ir() {
|
|
|
2386
2399
|
},
|
|
2387
2400
|
on: (e, t) => d.on(e, t)
|
|
2388
2401
|
};
|
|
2389
|
-
if (
|
|
2402
|
+
if (v && (je({
|
|
2390
2403
|
target: a,
|
|
2391
|
-
form:
|
|
2392
|
-
validatorDetail:
|
|
2393
|
-
validator:
|
|
2394
|
-
addValidator:
|
|
2395
|
-
removeValidator:
|
|
2404
|
+
form: v,
|
|
2405
|
+
validatorDetail: D ? {
|
|
2406
|
+
validator: D,
|
|
2407
|
+
addValidator: D.addValidator.bind(D),
|
|
2408
|
+
removeValidator: D.removeValidator.bind(D)
|
|
2396
2409
|
} : null,
|
|
2397
|
-
options:
|
|
2410
|
+
options: b,
|
|
2398
2411
|
unbinds: f
|
|
2399
|
-
}),
|
|
2412
|
+
}), ke({
|
|
2400
2413
|
target: a,
|
|
2401
|
-
form:
|
|
2402
|
-
instance:
|
|
2403
|
-
options:
|
|
2414
|
+
form: v,
|
|
2415
|
+
instance: k,
|
|
2416
|
+
options: b,
|
|
2404
2417
|
unbinds: f
|
|
2405
|
-
})),
|
|
2406
|
-
let e =
|
|
2407
|
-
|
|
2418
|
+
})), v) {
|
|
2419
|
+
let e = ir(a, v, g, d, D, f);
|
|
2420
|
+
D && (f.push(x(v, D, a)), f.push(vn(v))), await ar(a, g, v), e();
|
|
2408
2421
|
let t = window.setTimeout(e, 350);
|
|
2409
2422
|
f.push(() => window.clearTimeout(t));
|
|
2410
2423
|
}
|
|
@@ -2420,12 +2433,12 @@ function ir() {
|
|
|
2420
2433
|
payment: "payment"
|
|
2421
2434
|
}, r = t;
|
|
2422
2435
|
if (e === "prepare") try {
|
|
2423
|
-
|
|
2436
|
+
O.assertReady();
|
|
2424
2437
|
} catch {
|
|
2425
2438
|
r.abort("A required form feature could not start. Reload the page or contact the site administrator.");
|
|
2426
2439
|
return;
|
|
2427
2440
|
}
|
|
2428
|
-
for (let t of
|
|
2441
|
+
for (let t of O.instances) if (t.beforeSubmit && n[t.kind ?? "core"] === e) {
|
|
2429
2442
|
let { form: e, action: n, formData: i, abort: a, isAborted: o, abortReason: s } = r;
|
|
2430
2443
|
await t.beforeSubmit({
|
|
2431
2444
|
form: e,
|
|
@@ -2441,52 +2454,52 @@ function ir() {
|
|
|
2441
2454
|
});
|
|
2442
2455
|
f.push(t, n, r);
|
|
2443
2456
|
});
|
|
2444
|
-
let
|
|
2457
|
+
let re = d.on("formie:submit:before", async (e) => {
|
|
2445
2458
|
y(a, "formie:submit:before", e);
|
|
2446
|
-
}),
|
|
2447
|
-
if (y(a, "formie:submit:after", e), !
|
|
2459
|
+
}), ie = d.on("formie:submit:after", async (e) => {
|
|
2460
|
+
if (y(a, "formie:submit:after", e), !v) return;
|
|
2448
2461
|
let t = e;
|
|
2449
2462
|
if (t.code === "PREFLIGHT_COMPLETE") return;
|
|
2450
2463
|
let n = {
|
|
2451
|
-
form:
|
|
2464
|
+
form: v,
|
|
2452
2465
|
action: t.action ?? "submit",
|
|
2453
|
-
formData: new FormData(
|
|
2466
|
+
formData: new FormData(v)
|
|
2454
2467
|
};
|
|
2455
|
-
for (let e of
|
|
2456
|
-
}),
|
|
2468
|
+
for (let e of O.instances) await e.afterSubmit?.(n, t);
|
|
2469
|
+
}), A = d.on("formie:submit:final:before", async (e) => {
|
|
2457
2470
|
y(a, "formie:submit:final:before", e);
|
|
2458
|
-
}),
|
|
2471
|
+
}), ae = d.on("formie:submit:final:after", async (e) => {
|
|
2459
2472
|
y(a, "formie:submit:final:after", e);
|
|
2460
2473
|
});
|
|
2461
|
-
return f.push(ie,
|
|
2474
|
+
return f.push(re, ie, A, ae), t.set(a, {
|
|
2462
2475
|
options: g,
|
|
2463
2476
|
bus: d,
|
|
2464
|
-
form:
|
|
2465
|
-
validator:
|
|
2466
|
-
modules:
|
|
2477
|
+
form: v,
|
|
2478
|
+
validator: D,
|
|
2479
|
+
modules: O,
|
|
2467
2480
|
unbinds: f,
|
|
2468
|
-
instance:
|
|
2481
|
+
instance: k
|
|
2469
2482
|
}), y(a, "formie:mount:after", {
|
|
2470
2483
|
id: p,
|
|
2471
2484
|
mode: g.mode
|
|
2472
|
-
}),
|
|
2485
|
+
}), v instanceof HTMLFormElement && m(v), G.log("Mount complete.", {
|
|
2473
2486
|
id: p,
|
|
2474
|
-
target:
|
|
2487
|
+
target: Z(a),
|
|
2475
2488
|
mode: g.mode
|
|
2476
|
-
}),
|
|
2489
|
+
}), k;
|
|
2477
2490
|
}, l = (e, n) => {
|
|
2478
|
-
if (!n.autoVisible ||
|
|
2491
|
+
if (!n.autoVisible || $n(e) || typeof IntersectionObserver > "u") return c(e, n);
|
|
2479
2492
|
if (t.has(e)) return Promise.resolve(t.get(e)?.instance || null);
|
|
2480
|
-
if (i.has(e)) return
|
|
2493
|
+
if (i.has(e)) return G.log("Mount deferred (already waiting visibility).", { target: Z(e) }), Promise.resolve(null);
|
|
2481
2494
|
let r = new IntersectionObserver((t) => {
|
|
2482
|
-
t.some((t) => t.target === e && t.isIntersecting) && (r.disconnect(), i.delete(e),
|
|
2495
|
+
t.some((t) => t.target === e && t.isIntersecting) && (r.disconnect(), i.delete(e), G.log("Visibility reached, proceeding mount.", { target: Z(e) }), c(e, {
|
|
2483
2496
|
...n,
|
|
2484
2497
|
autoVisible: !1
|
|
2485
2498
|
}));
|
|
2486
2499
|
}, { threshold: .01 });
|
|
2487
2500
|
return r.observe(e), i.set(e, () => {
|
|
2488
2501
|
r.disconnect();
|
|
2489
|
-
}),
|
|
2502
|
+
}), G.log("Mount deferred until visible.", { target: Z(e) }), Promise.resolve(null);
|
|
2490
2503
|
};
|
|
2491
2504
|
return {
|
|
2492
2505
|
mount: c,
|
|
@@ -2494,7 +2507,7 @@ function ir() {
|
|
|
2494
2507
|
update: async (e, n) => {
|
|
2495
2508
|
let r = t.get(e);
|
|
2496
2509
|
if (!r) return c(e, {
|
|
2497
|
-
...
|
|
2510
|
+
...q(e),
|
|
2498
2511
|
...n,
|
|
2499
2512
|
mode: n.mode || "server-rendered"
|
|
2500
2513
|
});
|
|
@@ -2502,7 +2515,7 @@ function ir() {
|
|
|
2502
2515
|
...r.options,
|
|
2503
2516
|
...n
|
|
2504
2517
|
};
|
|
2505
|
-
let i = n.payload?.theme || r.options.payload?.theme ||
|
|
2518
|
+
let i = n.payload?.theme || r.options.payload?.theme || Qn(e, r.form)?.theme, a = ne(e, i, r.form);
|
|
2506
2519
|
return r.validator && (r.validator.config.fieldContainerErrorClass = a.fieldLayoutError || [], r.validator.config.inputErrorClass = a.fieldControlError || [], r.validator.config.messagesClass = a.fieldErrors || [], r.validator.config.messageClass = a.fieldError || []), Object.keys(a).length && y(e, "formie:theme:applied", {
|
|
2507
2520
|
hasClasses: !0,
|
|
2508
2521
|
reason: "update"
|
|
@@ -2510,24 +2523,24 @@ function ir() {
|
|
|
2510
2523
|
},
|
|
2511
2524
|
getInstance: (e) => t.get(e)?.instance || null,
|
|
2512
2525
|
refreshForCache: async (e) => {
|
|
2513
|
-
|
|
2526
|
+
Mn("refreshForCache", "Global `Formie.refreshForCache()` has been deprecated. Use built-in static-cache token refresh handling instead.");
|
|
2514
2527
|
let n = null;
|
|
2515
2528
|
if (n = typeof e == "string" ? document.getElementById(e) || document.querySelector(`[data-formie-form-id="${e}"]`) : e, !n) {
|
|
2516
|
-
|
|
2529
|
+
G.warn("refreshForCache target not found.", { targetOrId: e });
|
|
2517
2530
|
return;
|
|
2518
2531
|
}
|
|
2519
|
-
let r = t.get(n), i =
|
|
2532
|
+
let r = t.get(n), i = jn(n), a = r?.options || q(n);
|
|
2520
2533
|
if (!i) {
|
|
2521
|
-
|
|
2534
|
+
G.warn("refreshForCache found no form element for target.", { target: Z(n) });
|
|
2522
2535
|
return;
|
|
2523
2536
|
}
|
|
2524
|
-
let o = a.formHandle || n.dataset.formieHandle || i.dataset.formieHandle, s =
|
|
2537
|
+
let o = a.formHandle || n.dataset.formieHandle || i.dataset.formieHandle, s = In(a, n), c = i.querySelector("input[name=\"renderId\"]")?.value || void 0;
|
|
2525
2538
|
if (!o) {
|
|
2526
|
-
|
|
2539
|
+
G.warn("refreshForCache found no form handle for target.", { target: Z(n) });
|
|
2527
2540
|
return;
|
|
2528
2541
|
}
|
|
2529
|
-
let l = await
|
|
2530
|
-
l && (
|
|
2542
|
+
let l = await P(s, o, c, a, i?.querySelector("input[name=\"requestToken\"]")?.value);
|
|
2543
|
+
l && (tr(i, l), y(n, "formie:refresh-tokens:after", l));
|
|
2531
2544
|
},
|
|
2532
2545
|
registerModule: (e, t) => r.register(e, t),
|
|
2533
2546
|
unregisterModule: (e) => {
|
|
@@ -2535,16 +2548,16 @@ function ir() {
|
|
|
2535
2548
|
},
|
|
2536
2549
|
getRegisteredModules: () => r.getAll(),
|
|
2537
2550
|
scan: async (e) => {
|
|
2538
|
-
let t = e || document, n = Array.from(t.querySelectorAll(
|
|
2539
|
-
|
|
2551
|
+
let t = e || document, n = Array.from(t.querySelectorAll(W));
|
|
2552
|
+
G.log("Scan started.", {
|
|
2540
2553
|
scope: t === document ? "document" : t,
|
|
2541
2554
|
targetCount: n.length
|
|
2542
2555
|
});
|
|
2543
2556
|
let r = (await Promise.all(n.map((e) => {
|
|
2544
|
-
let t =
|
|
2557
|
+
let t = q(e);
|
|
2545
2558
|
return l(e, t);
|
|
2546
2559
|
}))).filter((e) => !!e);
|
|
2547
|
-
return
|
|
2560
|
+
return G.log("Scan finished.", {
|
|
2548
2561
|
mountedCount: r.length,
|
|
2549
2562
|
deferredCount: n.length - r.length
|
|
2550
2563
|
}), r;
|
|
@@ -2552,16 +2565,16 @@ function ir() {
|
|
|
2552
2565
|
observe: (e) => {
|
|
2553
2566
|
if (typeof MutationObserver > "u") return () => {};
|
|
2554
2567
|
let n = e || document;
|
|
2555
|
-
|
|
2568
|
+
G.log("Observer started.", { scope: n === document ? "document" : n });
|
|
2556
2569
|
let r = new MutationObserver((e) => {
|
|
2557
2570
|
e.forEach((e) => {
|
|
2558
2571
|
e.addedNodes.forEach((e) => {
|
|
2559
|
-
e instanceof Element && (e.matches(
|
|
2560
|
-
|
|
2572
|
+
e instanceof Element && (e.matches(W) && (G.log("Observer detected new root.", { target: Z(e) }), l(e, q(e))), e.querySelectorAll(W).forEach((e) => {
|
|
2573
|
+
G.log("Observer detected new nested root.", { target: Z(e) }), l(e, q(e));
|
|
2561
2574
|
}));
|
|
2562
2575
|
}), e.removedNodes.forEach((e) => {
|
|
2563
|
-
e instanceof Element && (t.has(e) && (
|
|
2564
|
-
t.has(e) && (
|
|
2576
|
+
e instanceof Element && (t.has(e) && (G.log("Observer detected removed root.", { target: Z(e) }), s(e)), e.querySelectorAll(W).forEach((e) => {
|
|
2577
|
+
t.has(e) && (G.log("Observer detected removed nested root.", { target: Z(e) }), s(e));
|
|
2565
2578
|
}));
|
|
2566
2579
|
});
|
|
2567
2580
|
});
|
|
@@ -2570,11 +2583,11 @@ function ir() {
|
|
|
2570
2583
|
childList: !0,
|
|
2571
2584
|
subtree: !0
|
|
2572
2585
|
}), () => {
|
|
2573
|
-
r.disconnect(),
|
|
2574
|
-
|
|
2586
|
+
r.disconnect(), G.log("Observer stopped."), i.forEach((e, t) => {
|
|
2587
|
+
er(t, n) && (e(), i.delete(t));
|
|
2575
2588
|
});
|
|
2576
2589
|
let e = [];
|
|
2577
|
-
n instanceof Element && n.matches(
|
|
2590
|
+
n instanceof Element && n.matches(W) && e.push(n), n.querySelectorAll(W).forEach((t) => {
|
|
2578
2591
|
e.push(t);
|
|
2579
2592
|
}), e.forEach((e) => {
|
|
2580
2593
|
t.has(e) && s(e);
|
|
@@ -2585,13 +2598,13 @@ function ir() {
|
|
|
2585
2598
|
}
|
|
2586
2599
|
//#endregion
|
|
2587
2600
|
//#region src/js/core/hydrate-modules.ts
|
|
2588
|
-
var
|
|
2589
|
-
async function
|
|
2601
|
+
var sr = E("general", "module-hydrator");
|
|
2602
|
+
async function cr(e) {
|
|
2590
2603
|
let t = e.root, n = e.form ?? (t instanceof HTMLFormElement ? t : t.closest("form") ?? t.querySelector("form")), r = e.surface ?? "cp-edit", i = e.modules ?? {
|
|
2591
2604
|
contractVersion: 2,
|
|
2592
2605
|
surface: r,
|
|
2593
2606
|
entries: []
|
|
2594
|
-
}, a = e.registry ?? new B(), o = new
|
|
2607
|
+
}, a = e.registry ?? new B(), o = new zt(), s = await Zt(i, {
|
|
2595
2608
|
registry: a,
|
|
2596
2609
|
setupContext: {
|
|
2597
2610
|
formId: n?.id || t.id || "formie-modules",
|
|
@@ -2616,7 +2629,7 @@ async function or(e) {
|
|
|
2616
2629
|
surface: r
|
|
2617
2630
|
}
|
|
2618
2631
|
});
|
|
2619
|
-
return
|
|
2632
|
+
return sr.log("Hydrated module manifest.", {
|
|
2620
2633
|
moduleCount: i.entries.length,
|
|
2621
2634
|
instanceCount: s.instances.length,
|
|
2622
2635
|
surface: r
|
|
@@ -2683,44 +2696,44 @@ async function or(e) {
|
|
|
2683
2696
|
}
|
|
2684
2697
|
//#endregion
|
|
2685
2698
|
//#region src/js/core/formie.ts
|
|
2686
|
-
function
|
|
2699
|
+
function Q(e) {
|
|
2687
2700
|
return e instanceof Element;
|
|
2688
2701
|
}
|
|
2689
|
-
function
|
|
2702
|
+
function lr(e) {
|
|
2690
2703
|
return e.ok;
|
|
2691
2704
|
}
|
|
2692
|
-
function
|
|
2693
|
-
return typeof e == "string" ? `selector "${e}"` :
|
|
2705
|
+
function ur(e) {
|
|
2706
|
+
return typeof e == "string" ? `selector "${e}"` : Q(e) ? `element "${e.tagName.toLowerCase()}"` : "provided element collection";
|
|
2694
2707
|
}
|
|
2695
|
-
function
|
|
2708
|
+
function dr(e) {
|
|
2696
2709
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
2697
|
-
for (let r of e)
|
|
2710
|
+
for (let r of e) Q(r) && !t.has(r) && (t.add(r), n.push(r));
|
|
2698
2711
|
return n;
|
|
2699
2712
|
}
|
|
2700
|
-
function
|
|
2701
|
-
return typeof e == "string" ? Array.from(document.querySelectorAll(e)) :
|
|
2713
|
+
function $(e) {
|
|
2714
|
+
return typeof e == "string" ? Array.from(document.querySelectorAll(e)) : Q(e) ? [e] : dr(e);
|
|
2702
2715
|
}
|
|
2703
|
-
function
|
|
2716
|
+
function fr() {
|
|
2704
2717
|
return document.readyState === "loading" ? new Promise((e) => {
|
|
2705
2718
|
document.addEventListener("DOMContentLoaded", () => e(), { once: !0 });
|
|
2706
2719
|
}) : Promise.resolve();
|
|
2707
2720
|
}
|
|
2708
|
-
async function
|
|
2709
|
-
let t =
|
|
2710
|
-
return t.length > 0 || typeof e != "string" ? t : (await
|
|
2711
|
-
}
|
|
2712
|
-
function pr(e) {
|
|
2713
|
-
return typeof e == "string" ? document : $(e) ? e.getRootNode() : document;
|
|
2721
|
+
async function pr(e) {
|
|
2722
|
+
let t = $(e);
|
|
2723
|
+
return t.length > 0 || typeof e != "string" ? t : (await fr(), $(e));
|
|
2714
2724
|
}
|
|
2715
2725
|
function mr(e) {
|
|
2726
|
+
return typeof e == "string" ? document : Q(e) ? e.getRootNode() : document;
|
|
2727
|
+
}
|
|
2728
|
+
function hr(e) {
|
|
2716
2729
|
let { element: t, observe: n, allowEmpty: r, client: i, onReady: a, onResult: o, onSuccess: s, onError: c, onEvent: l, ...u } = e;
|
|
2717
2730
|
return {
|
|
2718
2731
|
mode: "server-rendered",
|
|
2719
2732
|
...u
|
|
2720
2733
|
};
|
|
2721
2734
|
}
|
|
2722
|
-
async function
|
|
2723
|
-
let i = [], a =
|
|
2735
|
+
async function gr(e, t, n, r) {
|
|
2736
|
+
let i = [], a = hr(e);
|
|
2724
2737
|
for (let o of r) {
|
|
2725
2738
|
let r = n.get(o);
|
|
2726
2739
|
if (r) {
|
|
@@ -2730,7 +2743,7 @@ async function hr(e, t, n, r) {
|
|
|
2730
2743
|
let s = await t.mount(o, a), c = [];
|
|
2731
2744
|
if (e.onReady?.(s), c.push(s.on("formie:submit:result", (t) => {
|
|
2732
2745
|
let n = t;
|
|
2733
|
-
e.onResult?.(n, s),
|
|
2746
|
+
e.onResult?.(n, s), lr(n) ? e.onSuccess?.(n, s) : e.onError?.(n, s);
|
|
2734
2747
|
})), e.onEvent) for (let t of l) c.push(s.on(t, (n) => {
|
|
2735
2748
|
e.onEvent?.({
|
|
2736
2749
|
name: t,
|
|
@@ -2744,11 +2757,11 @@ async function hr(e, t, n, r) {
|
|
|
2744
2757
|
}
|
|
2745
2758
|
return i;
|
|
2746
2759
|
}
|
|
2747
|
-
async function
|
|
2748
|
-
let t = e.client ??
|
|
2749
|
-
if (r.length === 0 && !e.allowEmpty) throw Error(`Formie could not find any elements for ${
|
|
2750
|
-
await
|
|
2751
|
-
let i = e.observe ? t.observe(
|
|
2760
|
+
async function _r(e) {
|
|
2761
|
+
let t = e.client ?? or(), n = /* @__PURE__ */ new Map(), r = await pr(e.element);
|
|
2762
|
+
if (r.length === 0 && !e.allowEmpty) throw Error(`Formie could not find any elements for ${ur(e.element)}.`);
|
|
2763
|
+
await gr(e, t, n, r);
|
|
2764
|
+
let i = e.observe ? t.observe(mr(e.element)) : null;
|
|
2752
2765
|
return {
|
|
2753
2766
|
client: t,
|
|
2754
2767
|
get instances() {
|
|
@@ -2759,8 +2772,8 @@ async function gr(e) {
|
|
|
2759
2772
|
return r ? n.get(r)?.instance ?? t.getInstance(r) : null;
|
|
2760
2773
|
},
|
|
2761
2774
|
async rescan() {
|
|
2762
|
-
let r =
|
|
2763
|
-
return r.length === 0 ? Array.from(n.values()).map(({ instance: e }) => e) :
|
|
2775
|
+
let r = $(e.element);
|
|
2776
|
+
return r.length === 0 ? Array.from(n.values()).map(({ instance: e }) => e) : gr(e, t, n, r);
|
|
2764
2777
|
},
|
|
2765
2778
|
async destroy() {
|
|
2766
2779
|
i?.();
|
|
@@ -2771,7 +2784,7 @@ async function gr(e) {
|
|
|
2771
2784
|
}
|
|
2772
2785
|
//#endregion
|
|
2773
2786
|
//#region src/js/core/client-rendered-modules.ts
|
|
2774
|
-
var
|
|
2787
|
+
var vr = {
|
|
2775
2788
|
conditions: {
|
|
2776
2789
|
kind: "core",
|
|
2777
2790
|
reason: "Core evaluates structured conditions and the adapter renders visibility."
|
|
@@ -2805,8 +2818,8 @@ var _r = {
|
|
|
2805
2818
|
reason: "The adapter renders the structured date input contract."
|
|
2806
2819
|
}
|
|
2807
2820
|
};
|
|
2808
|
-
async function
|
|
2809
|
-
for (let [e, t] of Object.entries(
|
|
2821
|
+
async function yr(t, n, r = Bt) {
|
|
2822
|
+
for (let [e, t] of Object.entries(vr)) {
|
|
2810
2823
|
let n = `formie:${e}`;
|
|
2811
2824
|
r.get(n) || r.register({
|
|
2812
2825
|
moduleId: n,
|
|
@@ -2834,7 +2847,7 @@ async function vr(t, n, r = zt) {
|
|
|
2834
2847
|
}
|
|
2835
2848
|
};
|
|
2836
2849
|
a();
|
|
2837
|
-
let o = n.subscribe(a), s = await
|
|
2850
|
+
let o = n.subscribe(a), s = await cr({
|
|
2838
2851
|
root: t,
|
|
2839
2852
|
modules: n.getState().definition.modules,
|
|
2840
2853
|
surface: "client-rendered",
|
|
@@ -2868,4 +2881,4 @@ async function vr(t, n, r = zt) {
|
|
|
2868
2881
|
};
|
|
2869
2882
|
}
|
|
2870
2883
|
//#endregion
|
|
2871
|
-
export { l as FORMIE_HTML_EVENT_NAMES,
|
|
2884
|
+
export { l as FORMIE_HTML_EVENT_NAMES, pn as FormieValidator, Se as LEGACY_FORMIE_DOM_EVENT_BRIDGES, Ce as LEGACY_FORMIE_VALIDATOR_EVENT_BRIDGES, B as ModuleRegistry, ke as bindLegacyDomEventCompatibility, je as bindLegacyValidatorCompatibility, ye as buildFieldValueRegistry, Bt as clientRenderedModuleRegistry, E as createDebug, or as createFormieClient, w as debugLog, T as debugWarn, xe as defineAddressModule, pe as defineCaptchaModule, fe as definePassiveCaptchaModule, S as definePaymentModule, ge as fieldKeyToInputName, _r as formie, c as getFieldModuleEventName, de as getFormieTranslations, s as getGlobalModuleLifecycleEventName, i as getScopedModuleLifecycleEventName, cr as hydrateFormieModules, me as inputNameToFieldKey, te as isFormieDebugEnabled, le as mergeFormieTranslations, yr as mountClientRenderedModules, he as normalizeFieldKey, u as normalizeFormieEventName, _e as parseFieldReference, be as resolveFieldReferenceFromFormData, ve as resolveFieldReferenceLive, we as resolveLegacyCompatibilityOptions, ee as setFormieDebugEnabled, ue as setFormieTranslations, ce as t, a as toDomEventName, se as translate };
|