@verbb/formie-browser 1.0.14 → 1.0.16

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.
Files changed (156) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/chunks/{address-country-Dn71jroa.js → address-country-DLJF-OkC.js} +5 -9
  3. package/dist/chunks/{address-finder-O49uDRoR.js → address-finder-QK1m1eyv.js} +2 -2
  4. package/dist/chunks/{address-state-ByYatUur.js → address-state-CHKit8AW.js} +113 -112
  5. package/dist/chunks/{api-DYYsVIub.js → api-BPtH5RBA.js} +162 -130
  6. package/dist/chunks/{api-D6kJ7kXZ.js → api-BR2Gqy37.js} +313 -303
  7. package/dist/chunks/{api-ghNr2uxX.js → api-CmuOZ0i3.js} +1 -1
  8. package/dist/chunks/{async-nPFRNQ06.js → async-2GdXNFCE.js} +18 -1
  9. package/dist/chunks/{bpoint-D0RKFM4F.js → bpoint-GvYfyPjD.js} +1 -1
  10. package/dist/chunks/{calculations-YEoVCG2q.js → calculations-DeEmdUDq.js} +5 -7
  11. package/dist/chunks/{captcha-eu-DERJbXnH.js → captcha-eu-eU_M6snp.js} +2 -2
  12. package/dist/chunks/{checkbox-radio-gsm8QPJg.js → checkbox-radio-CSXo6svm.js} +4 -12
  13. package/dist/chunks/{combobox-CWNdx4Fk.js → combobox-CJh2DoSO.js} +323 -363
  14. package/dist/chunks/{conditions-DqNHLTbN.js → conditions-Dz3068K0.js} +140 -153
  15. package/dist/chunks/{country-from-ip-DDj_mFki.js → country-from-ip-BqQ-BqLH.js} +1 -1
  16. package/dist/chunks/{custom-google-maps-C4l2S3GO.js → custom-google-maps-rNm5VFbb.js} +2 -6
  17. package/dist/chunks/{custom-link-CLazgKYH.js → custom-link-CLqFCssQ.js} +1 -1
  18. package/dist/chunks/{custom-maps-DqcAlD0v.js → custom-maps-DgjYQDLj.js} +4 -8
  19. package/dist/chunks/{date-picker-RUnevF7l.js → date-picker-BVJxJVYT.js} +42 -58
  20. package/dist/chunks/{debug-BV0DvdHx.js → debug-rhzqP1j2.js} +2 -14
  21. package/dist/chunks/{dist-ZLeW0zZ3.js → dist-CJReDlDK.js} +13 -8
  22. package/dist/chunks/{eway-or6dtjoT.js → eway-BZuTBAUW.js} +3 -3
  23. package/dist/chunks/{field-references.resolver-Ca8MguFv.js → field-references.resolver-uSHf5-NP.js} +1 -1
  24. package/dist/chunks/{file-upload-Bm-TXyNB.js → file-upload-vEUr_EuP.js} +131 -113
  25. package/dist/chunks/{friendly-captcha-v1-GFqCt1Mh.js → friendly-captcha-v1-C_cF1WD2.js} +2 -2
  26. package/dist/chunks/{friendly-captcha-v2-WoW246JG.js → friendly-captcha-v2-BenESH-n.js} +2 -2
  27. package/dist/chunks/{friendly-challenge-DPG9MJb1.js → friendly-challenge-BgPBEMXx.js} +21 -35
  28. package/dist/chunks/{go-cardless-DzJ-0FKg.js → go-cardless-DWZeB0Bq.js} +2 -6
  29. package/dist/chunks/{google-address-C1P1nTDM.js → google-address-DQR6rsbh.js} +15 -10
  30. package/dist/chunks/{hcaptcha-D0T8aIHz.js → hcaptcha-COilLmRT.js} +2 -2
  31. package/dist/chunks/{hidden-BZhXnNPe.js → hidden-Bc2TpcgF.js} +1 -1
  32. package/dist/chunks/{http-C2QdHuWO.js → http-Dj_skqaa.js} +1 -1
  33. package/dist/chunks/{leaflet-src-DE6rv6M-.js → leaflet-src-Cg-LUOD8.js} +74 -122
  34. package/dist/chunks/{loqate-DD1S7PY9.js → loqate-ZZClcacr.js} +2 -2
  35. package/dist/chunks/{mollie-DG8Ju83x.js → mollie-8OMXIYa8.js} +2 -6
  36. package/dist/chunks/{moneris-C8m3Fvqu.js → moneris-qYHJ9EFy.js} +1 -1
  37. package/dist/chunks/opayo-DlWPEnla.js +159 -0
  38. package/dist/chunks/{paddle-BIYR9Um3.js → paddle-CArfWih0.js} +2 -2
  39. package/dist/chunks/{password-validation-C8_uO_c_.js → password-validation-HGOU9kf3.js} +2 -2
  40. package/dist/chunks/{paypal-B_yxIo2d.js → paypal-BcaMCMGY.js} +2 -2
  41. package/dist/chunks/{payway-CeOzS0sL.js → payway-vxC7_bfR.js} +4 -12
  42. package/dist/chunks/{phone-country-bAqje17P.js → phone-country-Bx9EG50h.js} +124 -141
  43. package/dist/chunks/{place-kit-BE5gi3vo.js → place-kit-BKk8xDXf.js} +10 -10
  44. package/dist/chunks/{placekit-autocomplete.esm-CZZERYur.js → placekit-autocomplete.esm-D2A_0iVU.js} +2 -5
  45. package/dist/chunks/{recaptcha-enterprise-CruXddZq.js → recaptcha-enterprise-Cx6HUpMa.js} +6 -12
  46. package/dist/chunks/recaptcha-shared-CcMI-r8t.js +33 -0
  47. package/dist/chunks/{recaptcha-v2-checkbox-CCnJYCnG.js → recaptcha-v2-checkbox-DQ9BJzcv.js} +2 -2
  48. package/dist/chunks/{recaptcha-v2-invisible-BuVqRRYn.js → recaptcha-v2-invisible-BP0T8Pan.js} +2 -2
  49. package/dist/chunks/recaptcha-v3-DKMGQ27K.js +38 -0
  50. package/dist/chunks/{repeater-DwE27jI1.js → repeater-BR0RUvTs.js} +50 -40
  51. package/dist/chunks/{rich-text-uV4o_pGk.js → rich-text-H2A6cm1t.js} +33 -11
  52. package/dist/chunks/{rolldown-runtime-DtPi1Y-2.js → rolldown-runtime-VHNaYcLd.js} +1 -1
  53. package/dist/chunks/{scripts-CbQ7agX3.js → scripts-DrccjrFv.js} +1 -1
  54. package/dist/chunks/{sdk-lkwSvlpM.js → sdk-_cmrRYgp.js} +4 -16
  55. package/dist/chunks/{shared-OKhSay59.js → shared-CJ1LIEh3.js} +1 -3
  56. package/dist/chunks/{signature-7cldFbqj.js → signature-CfKA_poI.js} +9 -41
  57. package/dist/chunks/skip-CEW89ExY.js +7 -0
  58. package/dist/chunks/{snaptcha-C04kNGYQ.js → snaptcha-P3EoSQud.js} +1 -1
  59. package/dist/chunks/{square-DEzxv9D9.js → square-Dyz0p_GU.js} +2 -2
  60. package/dist/chunks/{stripe-CVPQGDz3.js → stripe-Bfd_jp_k.js} +4 -7
  61. package/dist/chunks/{summary-BF_8mrXI.js → summary-B3CAebLV.js} +45 -37
  62. package/dist/chunks/{survey-likert-fk1hUPff.js → survey-likert-CEtUceag.js} +1 -1
  63. package/dist/chunks/{survey-rank-BsLGl2LX.js → survey-rank-Dtt97y6s.js} +3 -7
  64. package/dist/chunks/{survey-rating-DVS6e6fM.js → survey-rating-mlDMI0uq.js} +9 -23
  65. package/dist/chunks/{table-DnIBdeKF.js → table-0k6Md0IO.js} +2 -2
  66. package/dist/chunks/{text-limit-LGMPhFuC.js → text-limit-CTVML6s7.js} +10 -10
  67. package/dist/chunks/{turnstile-n9DNyPxi.js → turnstile-Sp4ubowK.js} +2 -2
  68. package/dist/chunks/{upload-manager-BbiUosZq.js → upload-manager-Ccg3d_4I.js} +258 -260
  69. package/dist/index.d.ts +1 -0
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +743 -734
  72. package/dist/js/core/create-formie-client.d.ts.map +1 -1
  73. package/dist/js/core/dom-events.d.ts +5 -0
  74. package/dist/js/core/dom-events.d.ts.map +1 -1
  75. package/dist/js/core/page-client-event.d.ts.map +1 -1
  76. package/dist/js/core/submit-result-state.d.ts.map +1 -1
  77. package/dist/js/core/submit-result-ui.d.ts +3 -1
  78. package/dist/js/core/submit-result-ui.d.ts.map +1 -1
  79. package/dist/js/core/validation-focus.d.ts.map +1 -1
  80. package/dist/js/modules/address/google-address.d.ts +10 -0
  81. package/dist/js/modules/address/google-address.d.ts.map +1 -1
  82. package/dist/js/modules/address/place-kit.d.ts.map +1 -1
  83. package/dist/js/modules/captchas/factories.d.ts.map +1 -1
  84. package/dist/js/modules/captchas/host.d.ts +4 -1
  85. package/dist/js/modules/captchas/host.d.ts.map +1 -1
  86. package/dist/js/modules/captchas/recaptcha-shared.d.ts +1 -1
  87. package/dist/js/modules/captchas/recaptcha-shared.d.ts.map +1 -1
  88. package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -1
  89. package/dist/js/modules/fields/address-state.d.ts.map +1 -1
  90. package/dist/js/modules/fields/combobox.d.ts +2 -0
  91. package/dist/js/modules/fields/combobox.d.ts.map +1 -1
  92. package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
  93. package/dist/js/modules/fields/conditions.d.ts.map +1 -1
  94. package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
  95. package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
  96. package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
  97. package/dist/js/modules/fields/repeater.d.ts.map +1 -1
  98. package/dist/js/modules/fields/rich-text.d.ts.map +1 -1
  99. package/dist/js/modules/fields/summary.d.ts.map +1 -1
  100. package/dist/js/modules/fields/text-limit.d.ts.map +1 -1
  101. package/dist/js/modules/fields/upload-manager.d.ts.map +1 -1
  102. package/dist/js/modules/payments/factories.d.ts.map +1 -1
  103. package/dist/js/modules/payments/opayo.d.ts.map +1 -1
  104. package/dist/js/submit/pipeline.d.ts +2 -0
  105. package/dist/js/submit/pipeline.d.ts.map +1 -1
  106. package/dist/js/utils/async.d.ts +1 -0
  107. package/dist/js/utils/async.d.ts.map +1 -1
  108. package/dist/js/utils/form-started-at.d.ts +1 -0
  109. package/dist/js/utils/form-started-at.d.ts.map +1 -1
  110. package/dist/js/utils/unload-warning.d.ts +4 -0
  111. package/dist/js/utils/unload-warning.d.ts.map +1 -1
  112. package/dist/js/validation/rules/required.d.ts.map +1 -1
  113. package/dist/js/validation/submit-readiness.d.ts.map +1 -1
  114. package/dist/js/validation/validator.d.ts +1 -0
  115. package/dist/js/validation/validator.d.ts.map +1 -1
  116. package/package.json +3 -3
  117. package/src/index.ts +1 -0
  118. package/src/js/core/create-formie-client.ts +37 -28
  119. package/src/js/core/dom-events.ts +30 -1
  120. package/src/js/core/page-client-event.ts +5 -7
  121. package/src/js/core/submit-result-state.ts +30 -2
  122. package/src/js/core/submit-result-ui.ts +25 -3
  123. package/src/js/core/validation-focus.ts +17 -3
  124. package/src/js/modules/address/google-address.ts +95 -37
  125. package/src/js/modules/address/place-kit.ts +13 -7
  126. package/src/js/modules/captchas/factories.ts +241 -101
  127. package/src/js/modules/captchas/host.ts +16 -0
  128. package/src/js/modules/captchas/recaptcha-enterprise.ts +1 -1
  129. package/src/js/modules/captchas/recaptcha-shared.ts +23 -5
  130. package/src/js/modules/captchas/recaptcha-v3.ts +23 -14
  131. package/src/js/modules/fields/address-country.ts +5 -5
  132. package/src/js/modules/fields/address-state.ts +80 -27
  133. package/src/js/modules/fields/combobox.ts +22 -1
  134. package/src/js/modules/fields/conditions/effects.ts +4 -5
  135. package/src/js/modules/fields/conditions.ts +9 -0
  136. package/src/js/modules/fields/date-picker.ts +6 -3
  137. package/src/js/modules/fields/file-upload.ts +55 -18
  138. package/src/js/modules/fields/phone-country.ts +25 -2
  139. package/src/js/modules/fields/repeater.ts +55 -4
  140. package/src/js/modules/fields/rich-text.ts +33 -0
  141. package/src/js/modules/fields/summary.ts +63 -10
  142. package/src/js/modules/fields/text-limit.ts +11 -0
  143. package/src/js/modules/fields/upload-manager.ts +54 -18
  144. package/src/js/modules/payments/factories.ts +87 -54
  145. package/src/js/modules/payments/opayo.ts +7 -0
  146. package/src/js/submit/pipeline.ts +16 -9
  147. package/src/js/utils/async.ts +34 -0
  148. package/src/js/utils/form-started-at.ts +19 -4
  149. package/src/js/utils/unload-warning.ts +63 -7
  150. package/src/js/validation/rules/required.ts +18 -0
  151. package/src/js/validation/submit-readiness.ts +2 -0
  152. package/src/js/validation/validator.ts +29 -6
  153. package/src/vendor.d.ts +2 -0
  154. package/dist/chunks/opayo-B3EvrVxw.js +0 -188
  155. package/dist/chunks/recaptcha-shared-AQRMDMme.js +0 -27
  156. package/dist/chunks/recaptcha-v3-CloqhO2A.js +0 -28
@@ -1,188 +0,0 @@
1
- import { t as e } from "./request-profile-DhwkeCpS.js";
2
- import { t } from "./dist-ZLeW0zZ3.js";
3
- import { s as n } from "./event-names-BCI2FLD8.js";
4
- import { t as r } from "./api-D6kJ7kXZ.js";
5
- import { t as i } from "./debug-BV0DvdHx.js";
6
- import { a } from "./theme-classes-DAQuEqdP.js";
7
- import { t as o } from "./csrf-DxHg_ZYt.js";
8
- import { r as s } from "./scripts-CbQ7agX3.js";
9
- import { t as c } from "./styles-BfoIZwJp.js";
10
- //#endregion
11
- //#region src/js/modules/payments/opayo.ts
12
- c("opayo", ["@layer formie-theme{.formie-opayo-drop-in{box-sizing:border-box;width:100%;min-height:10rem}}"]);
13
- var l = "FORMIE_OPAYO_SCRIPT", u = "https://live.opayo.eu.elavon.com/api/v1/js/sagepay.js", d = "https://sandbox.opayo.eu.elavon.com/api/v1/js/sagepay.js", f = "[data-formie-opayo-drop-in]", p = i("payments", "opayo"), m = n("opayo", "challenge"), h = "formie:payment:opayo:challenge:response";
14
- function g(e) {
15
- return e.checkoutMode === "dropIn";
16
- }
17
- async function _(n) {
18
- let { form: r, handle: i, sessionToken: a, services: s } = n, c = new FormData();
19
- o(c, r), c.set("action", "formie/payment-sessions/initialize"), c.append("handle", i), c.append("sessionToken", a);
20
- try {
21
- let i = await t(n.sessionEndpoint || r.action, {
22
- method: "POST",
23
- body: c
24
- }, e(r));
25
- return i.status < 200 || i.status >= 300 ? (s.addError(`${i.status}: ${i.statusText}`), p.warn("Merchant session request failed.", {
26
- status: i.status,
27
- statusText: i.statusText
28
- }), null) : (await i.json()).merchantSessionKey || (s.addError("Unable to get merchant session."), p.warn("merchantSessionKey missing in session response."), null);
29
- } catch {
30
- return s.addError("Network error. Please try again."), p.warn("Network error requesting merchant session."), null;
31
- }
32
- }
33
- function v(e) {
34
- return e.id ||= `formie-opayo-drop-in-${Math.random().toString(36).slice(2, 9)}`, e.id;
35
- }
36
- var y = r({
37
- moduleId: "formie:opayo",
38
- defaultRequiredInputSuffixes: ["opayoTokenId"],
39
- load: async (e) => {
40
- let { provider: t } = e.options, n = t.useSandbox ? d : u, r = g(t) ? "sagepayCheckout" : "sagepayOwnForm";
41
- return await s(r, {
42
- id: l,
43
- src: n,
44
- timeoutMs: 1e4
45
- }), null;
46
- },
47
- mount: async ({ field: e, services: t, provider: n }) => {
48
- if (!g(n)) return null;
49
- let r = t.form, i = window.sagepayCheckout, a = e.querySelector(f);
50
- if (!r?.action) return t.addError("Form action is missing."), p.warn("Missing form action before drop-in mount."), null;
51
- if (!i) return t.addError("Opayo script failed to load."), p.warn("sagepayCheckout global not available."), null;
52
- if (!a) return t.addError("Opayo drop-in container is missing."), p.warn("Drop-in container not found in payment field."), null;
53
- let o = n.handle || "opayo", s = await _({
54
- form: r,
55
- handle: o,
56
- sessionToken: n.sessionToken || "",
57
- sessionEndpoint: n.sessionEndpoint,
58
- services: t
59
- });
60
- if (!s) return null;
61
- let c = v(a), l = {
62
- checkout: null,
63
- merchantSessionKey: s,
64
- pendingAuthorize: null,
65
- retriedTokenise: !1
66
- };
67
- return l.checkout = i({
68
- merchantSessionKey: s,
69
- containerSelector: `#${c}`,
70
- onTokenise: (e) => {
71
- let i = l.pendingAuthorize;
72
- if (l.pendingAuthorize = null, !i) {
73
- p.warn("Drop-in tokenisation completed without a pending authorize step.");
74
- return;
75
- }
76
- if (e.success && e.cardIdentifier) {
77
- t.updateInputs("opayoTokenId", e.cardIdentifier), t.updateInputs("opayoSessionKey", l.merchantSessionKey), p.log("Drop-in tokenization succeeded.", { hasCardIdentifier: !!e.cardIdentifier }), i(!0);
78
- return;
79
- }
80
- if (!l.retriedTokenise) {
81
- l.retriedTokenise = !0, _({
82
- form: r,
83
- handle: o,
84
- sessionToken: n.sessionToken || "",
85
- sessionEndpoint: n.sessionEndpoint,
86
- services: t
87
- }).then((n) => {
88
- if (!n) {
89
- t.addError(e.errors?.[0]?.message || "Tokenization failed."), p.warn("Drop-in tokenization failed after session refresh.", e), i(!1);
90
- return;
91
- }
92
- l.merchantSessionKey = n, l.pendingAuthorize = i, l.checkout.tokenise({ newMerchantSessionKey: n });
93
- });
94
- return;
95
- }
96
- t.addError(e.errors?.[0]?.message || "Tokenization failed."), p.warn("Drop-in tokenization failed.", e), i(!1);
97
- }
98
- }), p.log("Drop-in checkout mounted.", { containerId: c }), l;
99
- },
100
- unmount: async ({ widget: e }) => {
101
- e?.checkout?.destroy?.();
102
- },
103
- onBeforePayment: async (e) => {
104
- let { field: t, services: n, options: r, provider: i, widget: a } = e, o = i.handle || "opayo", s = n.form;
105
- if (!s?.action) return n.addError("Form action is missing."), p.warn("Missing form action before authorize."), !1;
106
- if (g(i)) return a ? (a.retriedTokenise = !1, new Promise((e) => {
107
- a.pendingAuthorize = e, a.checkout.tokenise();
108
- })) : (n.addError("Opayo drop-in checkout is not ready."), p.warn("Drop-in authorize requested before widget mount."), !1);
109
- let c = window.sagepayOwnForm;
110
- if (!c) return n.addError("Opayo script failed to load."), p.warn("sagepayOwnForm global not available."), !1;
111
- let l = t.querySelector("[data-opayo-card=\"cardholder-name\"]")?.value ?? "", u = t.querySelector("[data-opayo-card=\"card-number\"]")?.value ?? "", d = t.querySelector("[data-opayo-card=\"expiry-date\"]")?.value ?? "", f = t.querySelector("[data-opayo-card=\"security-code\"]")?.value ?? "";
112
- u = u.replace(/[\s/]/g, ""), d = d.replace(/[\s/]/g, "");
113
- let m = await _({
114
- form: s,
115
- handle: o,
116
- sessionToken: i.sessionToken || "",
117
- sessionEndpoint: i.sessionEndpoint,
118
- services: n
119
- });
120
- return m ? new Promise((e) => {
121
- c({ merchantSessionKey: m }).tokeniseCardDetails({
122
- cardDetails: {
123
- cardholderName: l,
124
- cardNumber: u,
125
- expiryDate: d,
126
- securityCode: f
127
- },
128
- onTokenised: (t) => {
129
- t.success && t.cardIdentifier ? (n.updateInputs("opayoTokenId", t.cardIdentifier), n.updateInputs("opayoSessionKey", m), p.log("Tokenization succeeded.", { hasCardIdentifier: !!t.cardIdentifier }), e(!0)) : (n.addError(t.errors?.[0]?.message || "Tokenization failed."), p.warn("Tokenization failed.", t), e(!1));
130
- }
131
- });
132
- }) : !1;
133
- },
134
- setup: async (e) => {
135
- let { services: t } = e;
136
- e.target;
137
- let n = null, r = !1, i = () => {
138
- n?.parentNode && n.parentNode.removeChild(n), n = null;
139
- }, o = t.events.onForm(m, ((e) => {
140
- let o = e.detail?.data;
141
- if (!o?.acsUrl || !o?.creq) return;
142
- r = !1, p.log("Received payment challenge event.", {
143
- hasAcsUrl: !!o.acsUrl,
144
- hasCreq: !!o.creq
145
- });
146
- let s = t.form, c = s?.querySelector("input[name*=\"opayoSessionKey\"]")?.value || "", l = document.createElement("div");
147
- l.className = "formie-modal", l.id = `formie-opayo-dialog-${Math.random().toString(36).slice(2, 9)}`, l.innerHTML = "\n <div class=\"formie-modal-backdrop\" data-dialog-close></div>\n <div class=\"formie-modal-content\">\n <div data-formie-opayo-loading style=\"--formie-loading-width: 3rem; --formie-loading-height: 3rem; top: 50%; margin-top: -1.5rem;\"></div>\n <iframe width=\"100%\" height=\"100%\" style=\"width: 100%; height: 100%; position: relative; z-index: 1;\"></iframe>\n </div>\n ";
148
- let u = l.querySelector("[data-formie-opayo-loading]");
149
- u && a(u, s, "loading", !0);
150
- let d = l.querySelector("iframe"), f = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;"), m = o.returnUrl || o.redirectUrl || "", h = `<form action="${f(o.acsUrl)}" method="post">
151
- <input type="hidden" name="creq" value="${f(o.creq || "")}" />
152
- <input type="hidden" name="threeDSSessionData" value="${f(o.threeDSSessionData || "")}" />
153
- <input type="hidden" name="MD" value="${f(c)}" />
154
- <input type="hidden" name="TermUrl" value="${f(m)}" />
155
- <input type="hidden" name="ThreeDSNotificationURL" value="${f(m)}" />
156
- </form><script>document.forms[0].submit();<\/script>`;
157
- i(), document.body.appendChild(l), n = l, d?.contentWindow && (d.contentWindow.document.open(), d.contentWindow.document.write(h), d.contentWindow.document.close());
158
- })), s = (e) => {
159
- if (e.data?.message === h) {
160
- if (!n) {
161
- p.log("Ignoring 3DS response without active dialog.");
162
- return;
163
- }
164
- if (r) {
165
- p.warn("Ignoring duplicate 3DS response while processing.");
166
- return;
167
- }
168
- if (r = !0, p.log("Received payment challenge response message.", e.data?.value), i(), t.removeError(), e.data?.value?.error) {
169
- t.addError(e.data.value.error.message), t.releaseSubmitLoading(), r = !1;
170
- return;
171
- }
172
- t.updateInputs("opayo3DSComplete", e.data.value?.transactionId ?? ""), t.triggerSubmit();
173
- }
174
- };
175
- return window.addEventListener("message", s), { destroy: () => {
176
- o(), window.removeEventListener("message", s), i(), r = !1;
177
- } };
178
- },
179
- onAfterSubmit: async ({ services: e }) => {
180
- e.updateInputs([
181
- "opayoTokenId",
182
- "opayoSessionKey",
183
- "opayo3DSComplete"
184
- ], "");
185
- }
186
- });
187
- //#endregion
188
- export { y as opayoModule };
@@ -1,27 +0,0 @@
1
- import { a as e, r as t } from "./api-DYYsVIub.js";
2
- import { r as n } from "./scripts-CbQ7agX3.js";
3
- //#region src/js/modules/captchas/recaptcha-shared.ts
4
- async function r(r, i = !1, a) {
5
- let o = typeof r.language == "string" && r.language.trim() !== "" ? r.language.trim() : "en", { async: s, defer: c } = t(r.loadingMethod), l = i ? "https://www.google.com/recaptcha/enterprise.js" : "https://www.recaptcha.net/recaptcha/api.js", u = typeof a == "string" && a.trim() !== "" ? a.trim() : "explicit", d = new URL(l);
6
- return d.searchParams.set("render", u), d.searchParams.set("hl", o), u !== "explicit" && typeof r.badge == "string" && r.badge.trim() !== "" && d.searchParams.set("badge", r.badge.trim()), n("grecaptcha", {
7
- id: i ? "FORMIE_RECAPTCHA_ENTERPRISE_SCRIPT" : "FORMIE_RECAPTCHA_SCRIPT",
8
- src: d.toString(),
9
- async: s,
10
- defer: c,
11
- timeoutMs: e
12
- });
13
- }
14
- function i(e, t) {
15
- let n = e.enterprise || e;
16
- return new Promise((e, r) => {
17
- try {
18
- n.ready(() => {
19
- Promise.resolve(t()).then(e).catch(r);
20
- });
21
- } catch (e) {
22
- r(e);
23
- }
24
- });
25
- }
26
- //#endregion
27
- export { i as n, r as t };
@@ -1,28 +0,0 @@
1
- import { t as e } from "./api-DYYsVIub.js";
2
- import { n as t, t as n } from "./recaptcha-shared-AQRMDMme.js";
3
- //#region src/js/modules/captchas/recaptcha-v3.ts
4
- var r = e({
5
- moduleId: "formie:recaptcha-v3",
6
- defaultPlaceholderSelector: "[data-recaptcha-placeholder]",
7
- defaultTokenFieldNames: ["g-recaptcha-response"],
8
- load: ({ options: e }) => n(e.provider, !1, e.provider.siteKey || void 0),
9
- mount: ({ api: e, provider: t }) => new Promise((n) => {
10
- e.ready(() => {
11
- n(t.siteKey || "recaptcha-v3");
12
- });
13
- }),
14
- challenge: async ({ api: e, provider: n, placeholder: r, services: i, stageCtx: a }) => {
15
- if (!i.tokens.has() && (await t(e, async () => {
16
- let t = await e.execute(n.siteKey || "", { action: n.action || "submit" });
17
- typeof t == "string" && t.trim() !== "" && i.tokens.write(t.trim());
18
- }), !await i.tokens.wait(12e4))) {
19
- let e = i.errors.getDefaultMessage();
20
- i.errors.show(e, r), a.abort(e);
21
- }
22
- },
23
- unmount: ({ services: e }) => {
24
- e.tokens.clear();
25
- }
26
- });
27
- //#endregion
28
- export { r as recaptchaV3Module };