@verbb/formie-browser 1.0.12 → 1.0.14

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 (383) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/chunks/{address-country-Rx6GQTND.js → address-country-Dn71jroa.js} +10 -4
  3. package/dist/chunks/{address-finder-k7_BXaRe.js → address-finder-O49uDRoR.js} +2 -2
  4. package/dist/chunks/{address-state-BwE01m2_.js → address-state-ByYatUur.js} +154 -143
  5. package/dist/chunks/{api-DqpfkZWL.js → api-D6kJ7kXZ.js} +183 -179
  6. package/dist/chunks/{api-BUb6P-xu.js → api-DYYsVIub.js} +77 -47
  7. package/dist/chunks/{api-sPqGbOww.js → api-ghNr2uxX.js} +15 -9
  8. package/dist/chunks/{bpoint-Dlq34XH1.js → bpoint-D0RKFM4F.js} +3 -3
  9. package/dist/chunks/calculations-YEoVCG2q.js +310 -0
  10. package/dist/chunks/{captcha-eu-CGm8Lbrj.js → captcha-eu-DERJbXnH.js} +5 -4
  11. package/dist/chunks/{checkbox-radio-BY2aTCOG.js → checkbox-radio-gsm8QPJg.js} +74 -75
  12. package/dist/chunks/{combobox-C0EuExSI.js → combobox-CWNdx4Fk.js} +290 -279
  13. package/dist/chunks/conditions-DqNHLTbN.js +464 -0
  14. package/dist/chunks/country-from-ip-DDj_mFki.js +29 -0
  15. package/dist/chunks/csrf-DxHg_ZYt.js +61 -0
  16. package/dist/chunks/{custom-google-maps-BsaSirEZ.js → custom-google-maps-C4l2S3GO.js} +9 -3
  17. package/dist/chunks/{custom-link-CJ1-FjEM.js → custom-link-CLazgKYH.js} +8 -2
  18. package/dist/chunks/{custom-maps-DYW_pBid.js → custom-maps-DqcAlD0v.js} +10 -4
  19. package/dist/chunks/{date-picker-5CA_-zGb.js → date-picker-RUnevF7l.js} +456 -430
  20. package/dist/chunks/{dist-BdUy8m_p.js → dist-ZLeW0zZ3.js} +1280 -452
  21. package/dist/chunks/{eway-D9_m8ooj.js → eway-or6dtjoT.js} +3 -3
  22. package/dist/chunks/field-references.resolver-Ca8MguFv.js +104 -0
  23. package/dist/chunks/{file-upload-rqfZNqlH.js → file-upload-Bm-TXyNB.js} +104 -96
  24. package/dist/chunks/friendly-captcha-v1-GFqCt1Mh.js +34 -0
  25. package/dist/chunks/{friendly-captcha-v2-CLSAbkqx.js → friendly-captcha-v2-WoW246JG.js} +6 -5
  26. package/dist/chunks/{friendly-challenge-8uPatWqk.js → friendly-challenge-DPG9MJb1.js} +111 -102
  27. package/dist/chunks/{go-cardless-DAT3ZaQf.js → go-cardless-DzJ-0FKg.js} +2 -2
  28. package/dist/chunks/google-address-C1P1nTDM.js +163 -0
  29. package/dist/chunks/{hcaptcha-CGLAmgjO.js → hcaptcha-D0T8aIHz.js} +3 -3
  30. package/dist/chunks/{hidden-D7_Ch-QN.js → hidden-BZhXnNPe.js} +8 -2
  31. package/dist/chunks/http-C2QdHuWO.js +27 -0
  32. package/dist/chunks/{leaflet-src-j-lHNmhR.js → leaflet-src-DE6rv6M-.js} +42 -46
  33. package/dist/chunks/{loqate-CJPzBmSm.js → loqate-DD1S7PY9.js} +2 -2
  34. package/dist/chunks/{mollie-Bibhl67p.js → mollie-DG8Ju83x.js} +2 -2
  35. package/dist/chunks/{moneris-H2wSqk9h.js → moneris-C8m3Fvqu.js} +3 -3
  36. package/dist/chunks/opayo-B3EvrVxw.js +188 -0
  37. package/dist/chunks/{paddle-DkvIxQdG.js → paddle-BIYR9Um3.js} +3 -3
  38. package/dist/chunks/{password-validation-T0vDQPCr.js → password-validation-C8_uO_c_.js} +18 -12
  39. package/dist/chunks/{paypal-CQpAF7Ua.js → paypal-B_yxIo2d.js} +7 -5
  40. package/dist/chunks/{payway-CwDkC7YZ.js → payway-CeOzS0sL.js} +3 -3
  41. package/dist/chunks/{phone-country-D3ayr60L.js → phone-country-bAqje17P.js} +80 -63
  42. package/dist/chunks/{place-kit-BGHklIZ-.js → place-kit-BE5gi3vo.js} +3 -3
  43. package/dist/chunks/{placekit-autocomplete.esm-DWVabQlq.js → placekit-autocomplete.esm-CZZERYur.js} +11 -15
  44. package/dist/chunks/{recaptcha-enterprise-XPId5-bS.js → recaptcha-enterprise-CruXddZq.js} +4 -4
  45. package/dist/chunks/{recaptcha-shared-CLYJvojk.js → recaptcha-shared-AQRMDMme.js} +1 -1
  46. package/dist/chunks/{recaptcha-v2-checkbox-Cy-0PEPc.js → recaptcha-v2-checkbox-CCnJYCnG.js} +4 -4
  47. package/dist/chunks/{recaptcha-v2-invisible-BwRH540O.js → recaptcha-v2-invisible-BuVqRRYn.js} +4 -4
  48. package/dist/chunks/{recaptcha-v3-No4Ykrhk.js → recaptcha-v3-CloqhO2A.js} +4 -4
  49. package/dist/chunks/{repeater-BVnPUqTj.js → repeater-DwE27jI1.js} +25 -19
  50. package/dist/chunks/request-profile-DhwkeCpS.js +10 -0
  51. package/dist/chunks/rich-text-uV4o_pGk.js +361 -0
  52. package/dist/chunks/{chunk-3b4jIN3o.js → rolldown-runtime-DtPi1Y-2.js} +2 -2
  53. package/dist/chunks/{sdk-BhHAYgga.js → sdk-lkwSvlpM.js} +282 -234
  54. package/dist/chunks/{shared-Bx9s0i0P.js → shared-OKhSay59.js} +27 -21
  55. package/dist/chunks/{signature-xz4QO7CR.js → signature-7cldFbqj.js} +160 -112
  56. package/dist/chunks/{snaptcha-DKx98oon.js → snaptcha-C04kNGYQ.js} +2 -2
  57. package/dist/chunks/{square-DwdcOI1G.js → square-DEzxv9D9.js} +8 -6
  58. package/dist/chunks/{stripe-DaoG2FT1.js → stripe-CVPQGDz3.js} +10 -11
  59. package/dist/chunks/{summary-Dks0gXS3.js → summary-BF_8mrXI.js} +47 -45
  60. package/dist/chunks/{survey-likert-DkE6bR7B.js → survey-likert-fk1hUPff.js} +7 -1
  61. package/dist/chunks/{survey-rank-DN6x4IZM.js → survey-rank-BsLGl2LX.js} +37 -25
  62. package/dist/chunks/{survey-rating-BnsNL9U5.js → survey-rating-DVS6e6fM.js} +17 -5
  63. package/dist/chunks/{table-CAjCJHrL.js → table-DnIBdeKF.js} +21 -15
  64. package/dist/chunks/{text-limit-Bn18WrPU.js → text-limit-LGMPhFuC.js} +40 -34
  65. package/dist/chunks/{theme-classes-Tv7q7ToE.js → theme-classes-DAQuEqdP.js} +1 -1
  66. package/dist/chunks/{turnstile-DJakPzQD.js → turnstile-n9DNyPxi.js} +3 -3
  67. package/dist/chunks/{upload-manager-W-QDgxKD.js → upload-manager-BbiUosZq.js} +410 -350
  68. package/dist/chunks/{utils-Vqp8i_RM.js → utils-DpUBPadZ.js} +20 -14
  69. package/dist/css/formie-base.css +104 -1
  70. package/dist/css/theme/_messages.css +2 -0
  71. package/dist/css/theme/_tokens.css +31 -25
  72. package/dist/css/theme/fields/_signature.css +2 -1
  73. package/dist/css/theme/forms/_form.css +5 -1
  74. package/dist/index.d.ts +5 -4
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +1778 -1425
  77. package/dist/js/contracts/client.d.ts +5 -3
  78. package/dist/js/contracts/client.d.ts.map +1 -1
  79. package/dist/js/contracts/common.d.ts +2 -2
  80. package/dist/js/contracts/common.d.ts.map +1 -1
  81. package/dist/js/contracts/modules.d.ts +37 -12
  82. package/dist/js/contracts/modules.d.ts.map +1 -1
  83. package/dist/js/contracts/schema.d.ts +20 -38
  84. package/dist/js/contracts/schema.d.ts.map +1 -1
  85. package/dist/js/contracts/theme.d.ts +4 -1
  86. package/dist/js/contracts/theme.d.ts.map +1 -1
  87. package/dist/js/core/client-rendered-modules.d.ts +17 -0
  88. package/dist/js/core/client-rendered-modules.d.ts.map +1 -0
  89. package/dist/js/core/create-formie-client.d.ts.map +1 -1
  90. package/dist/js/core/field-error-aria.d.ts +23 -0
  91. package/dist/js/core/field-error-aria.d.ts.map +1 -0
  92. package/dist/js/core/hydrate-modules.d.ts +10 -8
  93. package/dist/js/core/hydrate-modules.d.ts.map +1 -1
  94. package/dist/js/core/submit-result-state.d.ts.map +1 -1
  95. package/dist/js/core/submit-result-ui.d.ts.map +1 -1
  96. package/dist/js/core/validation-focus.d.ts.map +1 -1
  97. package/dist/js/modules/address/address-finder.d.ts +1 -1
  98. package/dist/js/modules/address/address-finder.d.ts.map +1 -1
  99. package/dist/js/modules/address/factories.d.ts +3 -3
  100. package/dist/js/modules/address/factories.d.ts.map +1 -1
  101. package/dist/js/modules/address/google-address.d.ts +2 -1
  102. package/dist/js/modules/address/google-address.d.ts.map +1 -1
  103. package/dist/js/modules/address/index.d.ts +2 -2
  104. package/dist/js/modules/address/index.d.ts.map +1 -1
  105. package/dist/js/modules/address/loqate.d.ts +1 -1
  106. package/dist/js/modules/address/loqate.d.ts.map +1 -1
  107. package/dist/js/modules/address/place-kit.d.ts +1 -1
  108. package/dist/js/modules/address/place-kit.d.ts.map +1 -1
  109. package/dist/js/modules/captchas/captcha-eu.d.ts +1 -1
  110. package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -1
  111. package/dist/js/modules/captchas/factories.d.ts +11 -11
  112. package/dist/js/modules/captchas/factories.d.ts.map +1 -1
  113. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +1 -1
  114. package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -1
  115. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +1 -1
  116. package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -1
  117. package/dist/js/modules/captchas/hcaptcha.d.ts +1 -1
  118. package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -1
  119. package/dist/js/modules/captchas/index.d.ts +2 -2
  120. package/dist/js/modules/captchas/index.d.ts.map +1 -1
  121. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +1 -1
  122. package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -1
  123. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +1 -1
  124. package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -1
  125. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +1 -1
  126. package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -1
  127. package/dist/js/modules/captchas/recaptcha-v3.d.ts +1 -1
  128. package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -1
  129. package/dist/js/modules/captchas/snaptcha.d.ts +1 -1
  130. package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -1
  131. package/dist/js/modules/captchas/turnstile.d.ts +1 -1
  132. package/dist/js/modules/captchas/turnstile.d.ts.map +1 -1
  133. package/dist/js/modules/fields/address-country.d.ts +2 -2
  134. package/dist/js/modules/fields/address-country.d.ts.map +1 -1
  135. package/dist/js/modules/fields/address-state.d.ts +2 -2
  136. package/dist/js/modules/fields/address-state.d.ts.map +1 -1
  137. package/dist/js/modules/fields/calculations.d.ts +2 -2
  138. package/dist/js/modules/fields/calculations.d.ts.map +1 -1
  139. package/dist/js/modules/fields/checkbox-radio.d.ts +2 -2
  140. package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -1
  141. package/dist/js/modules/fields/combobox.d.ts +2 -2
  142. package/dist/js/modules/fields/combobox.d.ts.map +1 -1
  143. package/dist/js/modules/fields/conditions/config.d.ts.map +1 -1
  144. package/dist/js/modules/fields/conditions/effects.d.ts +1 -0
  145. package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
  146. package/dist/js/modules/fields/conditions/evaluator.d.ts +4 -1
  147. package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -1
  148. package/dist/js/modules/fields/conditions/references.d.ts.map +1 -1
  149. package/dist/js/modules/fields/conditions/submission-context.d.ts +15 -0
  150. package/dist/js/modules/fields/conditions/submission-context.d.ts.map +1 -0
  151. package/dist/js/modules/fields/conditions/types.d.ts +3 -1
  152. package/dist/js/modules/fields/conditions/types.d.ts.map +1 -1
  153. package/dist/js/modules/fields/conditions/values.d.ts +1 -1
  154. package/dist/js/modules/fields/conditions/values.d.ts.map +1 -1
  155. package/dist/js/modules/fields/conditions.d.ts +2 -2
  156. package/dist/js/modules/fields/conditions.d.ts.map +1 -1
  157. package/dist/js/modules/fields/custom-google-maps.d.ts +2 -2
  158. package/dist/js/modules/fields/custom-google-maps.d.ts.map +1 -1
  159. package/dist/js/modules/fields/custom-link.d.ts +2 -2
  160. package/dist/js/modules/fields/custom-link.d.ts.map +1 -1
  161. package/dist/js/modules/fields/custom-maps.d.ts +2 -2
  162. package/dist/js/modules/fields/custom-maps.d.ts.map +1 -1
  163. package/dist/js/modules/fields/date-picker.d.ts +2 -2
  164. package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
  165. package/dist/js/modules/fields/file-upload.d.ts +2 -2
  166. package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
  167. package/dist/js/modules/fields/hidden.d.ts +2 -2
  168. package/dist/js/modules/fields/hidden.d.ts.map +1 -1
  169. package/dist/js/modules/fields/index.d.ts +2 -2
  170. package/dist/js/modules/fields/index.d.ts.map +1 -1
  171. package/dist/js/modules/fields/password-validation.d.ts +2 -2
  172. package/dist/js/modules/fields/password-validation.d.ts.map +1 -1
  173. package/dist/js/modules/fields/phone-country.d.ts +2 -2
  174. package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
  175. package/dist/js/modules/fields/repeater.d.ts +2 -2
  176. package/dist/js/modules/fields/repeater.d.ts.map +1 -1
  177. package/dist/js/modules/fields/rich-text.d.ts +2 -2
  178. package/dist/js/modules/fields/rich-text.d.ts.map +1 -1
  179. package/dist/js/modules/fields/shared.d.ts +1 -0
  180. package/dist/js/modules/fields/shared.d.ts.map +1 -1
  181. package/dist/js/modules/fields/signature.d.ts +2 -2
  182. package/dist/js/modules/fields/signature.d.ts.map +1 -1
  183. package/dist/js/modules/fields/summary.d.ts +2 -2
  184. package/dist/js/modules/fields/summary.d.ts.map +1 -1
  185. package/dist/js/modules/fields/survey-likert.d.ts +2 -2
  186. package/dist/js/modules/fields/survey-likert.d.ts.map +1 -1
  187. package/dist/js/modules/fields/survey-rank.d.ts +2 -2
  188. package/dist/js/modules/fields/survey-rank.d.ts.map +1 -1
  189. package/dist/js/modules/fields/survey-rating.d.ts +2 -2
  190. package/dist/js/modules/fields/survey-rating.d.ts.map +1 -1
  191. package/dist/js/modules/fields/table.d.ts +2 -2
  192. package/dist/js/modules/fields/table.d.ts.map +1 -1
  193. package/dist/js/modules/fields/text-limit.d.ts +2 -2
  194. package/dist/js/modules/fields/text-limit.d.ts.map +1 -1
  195. package/dist/js/modules/fields/upload-manager.d.ts +2 -2
  196. package/dist/js/modules/fields/upload-manager.d.ts.map +1 -1
  197. package/dist/js/modules/loader.d.ts +10 -4
  198. package/dist/js/modules/loader.d.ts.map +1 -1
  199. package/dist/js/modules/payments/bpoint.d.ts +1 -1
  200. package/dist/js/modules/payments/bpoint.d.ts.map +1 -1
  201. package/dist/js/modules/payments/eway.d.ts +1 -1
  202. package/dist/js/modules/payments/eway.d.ts.map +1 -1
  203. package/dist/js/modules/payments/factories.d.ts +7 -7
  204. package/dist/js/modules/payments/factories.d.ts.map +1 -1
  205. package/dist/js/modules/payments/go-cardless.d.ts +1 -1
  206. package/dist/js/modules/payments/go-cardless.d.ts.map +1 -1
  207. package/dist/js/modules/payments/index.d.ts +2 -2
  208. package/dist/js/modules/payments/index.d.ts.map +1 -1
  209. package/dist/js/modules/payments/mollie.d.ts +1 -1
  210. package/dist/js/modules/payments/mollie.d.ts.map +1 -1
  211. package/dist/js/modules/payments/moneris.d.ts +1 -1
  212. package/dist/js/modules/payments/moneris.d.ts.map +1 -1
  213. package/dist/js/modules/payments/opayo.d.ts +1 -1
  214. package/dist/js/modules/payments/opayo.d.ts.map +1 -1
  215. package/dist/js/modules/payments/paddle.d.ts +1 -1
  216. package/dist/js/modules/payments/paddle.d.ts.map +1 -1
  217. package/dist/js/modules/payments/paypal.d.ts +1 -1
  218. package/dist/js/modules/payments/paypal.d.ts.map +1 -1
  219. package/dist/js/modules/payments/payway.d.ts +1 -1
  220. package/dist/js/modules/payments/payway.d.ts.map +1 -1
  221. package/dist/js/modules/payments/square.d.ts +1 -1
  222. package/dist/js/modules/payments/square.d.ts.map +1 -1
  223. package/dist/js/modules/payments/stripe.d.ts +1 -1
  224. package/dist/js/modules/payments/stripe.d.ts.map +1 -1
  225. package/dist/js/modules/payments/utils.d.ts +6 -0
  226. package/dist/js/modules/payments/utils.d.ts.map +1 -1
  227. package/dist/js/modules/registry.d.ts +6 -4
  228. package/dist/js/modules/registry.d.ts.map +1 -1
  229. package/dist/js/submit/pipeline.d.ts.map +1 -1
  230. package/dist/js/theme/browser-theme-state.generated.d.ts +24 -0
  231. package/dist/js/theme/browser-theme-state.generated.d.ts.map +1 -0
  232. package/dist/js/theme/theme-classes.d.ts +3 -3
  233. package/dist/js/theme/theme-classes.d.ts.map +1 -1
  234. package/dist/js/transport/forms-api.d.ts +5 -3
  235. package/dist/js/transport/forms-api.d.ts.map +1 -1
  236. package/dist/js/utils/country-from-ip.d.ts +2 -2
  237. package/dist/js/utils/country-from-ip.d.ts.map +1 -1
  238. package/dist/js/utils/csrf.d.ts +17 -0
  239. package/dist/js/utils/csrf.d.ts.map +1 -0
  240. package/dist/js/utils/field-references.parser.d.ts +1 -0
  241. package/dist/js/utils/field-references.parser.d.ts.map +1 -1
  242. package/dist/js/utils/field-references.resolver.d.ts.map +1 -1
  243. package/dist/js/utils/field-references.types.d.ts +1 -0
  244. package/dist/js/utils/field-references.types.d.ts.map +1 -1
  245. package/dist/js/utils/http.d.ts +3 -1
  246. package/dist/js/utils/http.d.ts.map +1 -1
  247. package/dist/js/utils/request-profile.d.ts +4 -0
  248. package/dist/js/utils/request-profile.d.ts.map +1 -0
  249. package/dist/js/utils/unload-warning.d.ts.map +1 -1
  250. package/dist/js/validation/rules/email.d.ts.map +1 -1
  251. package/dist/js/validation/rules/match.d.ts.map +1 -1
  252. package/dist/js/validation/rules/number.d.ts.map +1 -1
  253. package/dist/js/validation/rules/required.d.ts.map +1 -1
  254. package/dist/js/validation/rules/shared.d.ts.map +1 -1
  255. package/dist/js/validation/rules/url.d.ts.map +1 -1
  256. package/dist/js/validation/skip.d.ts +7 -0
  257. package/dist/js/validation/skip.d.ts.map +1 -0
  258. package/dist/js/validation/submit-readiness.d.ts.map +1 -1
  259. package/dist/js/validation/validator.d.ts.map +1 -1
  260. package/package.json +43 -12
  261. package/src/css/formie-base.css +104 -1
  262. package/src/css/theme/_messages.css +2 -0
  263. package/src/css/theme/_tokens.css +31 -25
  264. package/src/css/theme/fields/_signature.css +2 -1
  265. package/src/css/theme/forms/_form.css +5 -1
  266. package/src/index.ts +13 -8
  267. package/src/js/contracts/client.ts +5 -3
  268. package/src/js/contracts/common.ts +5 -6
  269. package/src/js/contracts/modules.ts +41 -12
  270. package/src/js/contracts/schema.ts +21 -43
  271. package/src/js/contracts/theme.ts +6 -1
  272. package/src/js/core/client-rendered-modules.ts +69 -0
  273. package/src/js/core/create-formie-client.ts +119 -73
  274. package/src/js/core/field-error-aria.ts +93 -0
  275. package/src/js/core/hydrate-modules.ts +54 -29
  276. package/src/js/core/submit-result-state.ts +34 -45
  277. package/src/js/core/submit-result-ui.ts +21 -65
  278. package/src/js/core/validation-focus.ts +20 -20
  279. package/src/js/modules/address/address-finder.ts +1 -1
  280. package/src/js/modules/address/factories.ts +15 -13
  281. package/src/js/modules/address/google-address.ts +10 -6
  282. package/src/js/modules/address/index.ts +2 -2
  283. package/src/js/modules/address/loqate.ts +1 -1
  284. package/src/js/modules/address/place-kit.ts +1 -1
  285. package/src/js/modules/captchas/captcha-eu.ts +2 -2
  286. package/src/js/modules/captchas/factories.ts +66 -42
  287. package/src/js/modules/captchas/friendly-captcha-v1.ts +12 -2
  288. package/src/js/modules/captchas/friendly-captcha-v2.ts +4 -2
  289. package/src/js/modules/captchas/hcaptcha.ts +5 -5
  290. package/src/js/modules/captchas/index.ts +2 -2
  291. package/src/js/modules/captchas/recaptcha-enterprise.ts +2 -2
  292. package/src/js/modules/captchas/recaptcha-v2-checkbox.ts +3 -3
  293. package/src/js/modules/captchas/recaptcha-v2-invisible.ts +2 -2
  294. package/src/js/modules/captchas/recaptcha-v3.ts +2 -2
  295. package/src/js/modules/captchas/snaptcha.ts +1 -1
  296. package/src/js/modules/captchas/turnstile.ts +3 -3
  297. package/src/js/modules/fields/address-country.ts +6 -4
  298. package/src/js/modules/fields/address-state.ts +20 -12
  299. package/src/js/modules/fields/calculations.ts +5 -3
  300. package/src/js/modules/fields/checkbox-radio.ts +24 -42
  301. package/src/js/modules/fields/combobox.ts +25 -9
  302. package/src/js/modules/fields/conditions/config.ts +17 -20
  303. package/src/js/modules/fields/conditions/effects.ts +23 -26
  304. package/src/js/modules/fields/conditions/evaluator.ts +21 -29
  305. package/src/js/modules/fields/conditions/references.ts +16 -5
  306. package/src/js/modules/fields/conditions/submission-context.ts +80 -0
  307. package/src/js/modules/fields/conditions/types.ts +3 -1
  308. package/src/js/modules/fields/conditions/values.ts +31 -6
  309. package/src/js/modules/fields/conditions.ts +59 -18
  310. package/src/js/modules/fields/custom-google-maps.ts +5 -3
  311. package/src/js/modules/fields/custom-link.ts +5 -3
  312. package/src/js/modules/fields/custom-maps.ts +5 -3
  313. package/src/js/modules/fields/date-picker.ts +40 -4
  314. package/src/js/modules/fields/file-upload.ts +19 -10
  315. package/src/js/modules/fields/hidden.ts +5 -3
  316. package/src/js/modules/fields/index.ts +2 -2
  317. package/src/js/modules/fields/password-validation.ts +5 -3
  318. package/src/js/modules/fields/phone-country.ts +33 -6
  319. package/src/js/modules/fields/repeater.ts +5 -3
  320. package/src/js/modules/fields/rich-text.ts +20 -4
  321. package/src/js/modules/fields/shared.ts +13 -0
  322. package/src/js/modules/fields/signature.ts +64 -6
  323. package/src/js/modules/fields/summary.ts +8 -20
  324. package/src/js/modules/fields/survey-likert.ts +5 -3
  325. package/src/js/modules/fields/survey-rank.ts +21 -3
  326. package/src/js/modules/fields/survey-rating.ts +17 -3
  327. package/src/js/modules/fields/table.ts +5 -3
  328. package/src/js/modules/fields/text-limit.ts +5 -3
  329. package/src/js/modules/fields/upload-manager.ts +190 -49
  330. package/src/js/modules/loader.ts +345 -281
  331. package/src/js/modules/payments/bpoint.ts +2 -2
  332. package/src/js/modules/payments/eway.ts +2 -2
  333. package/src/js/modules/payments/factories.ts +53 -52
  334. package/src/js/modules/payments/go-cardless.ts +1 -1
  335. package/src/js/modules/payments/index.ts +2 -2
  336. package/src/js/modules/payments/mollie.ts +1 -1
  337. package/src/js/modules/payments/moneris.ts +2 -2
  338. package/src/js/modules/payments/opayo.ts +21 -8
  339. package/src/js/modules/payments/paddle.ts +10 -6
  340. package/src/js/modules/payments/payment.ts +22 -18
  341. package/src/js/modules/payments/paypal.ts +1 -1
  342. package/src/js/modules/payments/payway.ts +2 -2
  343. package/src/js/modules/payments/square.ts +2 -2
  344. package/src/js/modules/payments/stripe.ts +5 -5
  345. package/src/js/modules/payments/utils.ts +14 -0
  346. package/src/js/modules/registry.ts +19 -11
  347. package/src/js/submit/pipeline.ts +10 -11
  348. package/src/js/theme/browser-theme-state.generated.ts +25 -0
  349. package/src/js/theme/theme-classes.ts +3 -3
  350. package/src/js/transport/forms-api.ts +66 -67
  351. package/src/js/utils/country-from-ip.ts +14 -9
  352. package/src/js/utils/csrf.ts +136 -0
  353. package/src/js/utils/field-references.parser.ts +13 -113
  354. package/src/js/utils/field-references.resolver.ts +27 -64
  355. package/src/js/utils/field-references.row-scope.ts +1 -1
  356. package/src/js/utils/field-references.types.ts +1 -0
  357. package/src/js/utils/http.ts +5 -5
  358. package/src/js/utils/request-profile.ts +10 -0
  359. package/src/js/utils/unload-warning.ts +12 -4
  360. package/src/js/validation/rules/email.ts +3 -5
  361. package/src/js/validation/rules/match.ts +2 -1
  362. package/src/js/validation/rules/minmax.ts +4 -43
  363. package/src/js/validation/rules/number.ts +3 -47
  364. package/src/js/validation/rules/pattern.ts +3 -8
  365. package/src/js/validation/rules/required.ts +2 -1
  366. package/src/js/validation/rules/shared.ts +5 -1
  367. package/src/js/validation/rules/url.ts +3 -10
  368. package/src/js/validation/skip.ts +9 -0
  369. package/src/js/validation/submit-readiness.ts +9 -2
  370. package/src/js/validation/validator.ts +35 -59
  371. package/dist/chunks/calculations-DERi2xaC.js +0 -299
  372. package/dist/chunks/conditions-65kBcFWW.js +0 -424
  373. package/dist/chunks/country-from-ip-BwxKaBuJ.js +0 -26
  374. package/dist/chunks/field-references.resolver-CHwn0G0L.js +0 -145
  375. package/dist/chunks/friendly-captcha-v1-C_2reOXr.js +0 -31
  376. package/dist/chunks/google-address-BH3Zhi06.js +0 -161
  377. package/dist/chunks/http-D-JExro7.js +0 -27
  378. package/dist/chunks/opayo-CR0DtsLa.js +0 -179
  379. package/dist/chunks/rich-text-Bg_--4TG.js +0 -349
  380. package/dist/js/modules/fields/conditions/transforms.d.ts +0 -3
  381. package/dist/js/modules/fields/conditions/transforms.d.ts.map +0 -1
  382. package/src/js/modules/fields/conditions/transforms.ts +0 -206
  383. package/src/js/modules/payments/stub-payment-module.ts +0 -87
@@ -1,10 +1,10 @@
1
1
  import { a as e, d as t, u as n } from "./event-names-BCI2FLD8.js";
2
2
  import { t as r } from "./debug-BV0DvdHx.js";
3
- import { i, r as a, t as o } from "./theme-classes-Tv7q7ToE.js";
3
+ import { a as i, i as a, t as o } from "./theme-classes-DAQuEqdP.js";
4
4
  import { i as s } from "./i18n-BY1ds1BL.js";
5
5
  import { n as c, t as l } from "./async-nPFRNQ06.js";
6
6
  import { r as u, t as d } from "./field-references.keys-58ZSTrCW.js";
7
- import { n as f, r as p } from "./field-references.resolver-CHwn0G0L.js";
7
+ import { n as f, r as p } from "./field-references.resolver-Ca8MguFv.js";
8
8
  //#region src/js/core/dom-events.ts
9
9
  function m(e, n, r) {
10
10
  e.dispatchEvent(new CustomEvent(t(n), {
@@ -136,7 +136,8 @@ function S(e) {
136
136
  //#region src/js/validation/submit-readiness.ts
137
137
  var C = "data-formie-submit-validation-disabled", w = "data-formie-preserve-disabled", se = "data-formie-submit-ready";
138
138
  function T(e) {
139
- return e.dataset.formieDisableSubmitUntilValid === "true";
139
+ let t = e.dataset.formieDisableSubmitUntilValid?.trim().toLowerCase();
140
+ return t === "" || t === "true" || t === "1";
140
141
  }
141
142
  function ce(e) {
142
143
  return Array.from(e.querySelectorAll("button[data-formie-action=\"submit\"]")).filter((e) => e instanceof HTMLButtonElement);
@@ -154,7 +155,7 @@ function E(e, t) {
154
155
  e.hasAttribute(w) ? (e.disabled = !0, e.removeAttribute(w)) : e.disabled = !1, e.removeAttribute(C);
155
156
  return;
156
157
  }
157
- e.hasAttribute(C) || (e.disabled && e.setAttribute(w, "true"), e.setAttribute(C, "true")), e.disabled = !0;
158
+ e.hasAttribute(C) || (e.disabled && e.setAttribute(w, "true"), e.setAttribute(C, "true")), e.disabled ||= !0;
158
159
  }
159
160
  });
160
161
  }
@@ -244,14 +245,13 @@ function ge(e) {
244
245
  return e <= 0 ? "start" : e >= 100 ? "end" : "middle";
245
246
  }
246
247
  function _e(e) {
247
- return (e.dataset.formieSubmitAction || "").trim();
248
+ return (e.dataset.formieCompletionBehavior || e.dataset.formieSubmitAction || "").trim();
248
249
  }
249
250
  function P(e, t) {
250
- let n = t.meta?.effectiveSubmitAction;
251
- return typeof n == "string" && n.trim() !== "" ? n.trim() : _e(e);
251
+ return t.completion ? String(t.completion.behavior) : _e(e);
252
252
  }
253
253
  function F(e) {
254
- let t = e.dataset.formieSubmitActionFormHide;
254
+ let t = e.dataset.formieHideFormAfterSubmit ?? e.dataset.formieSubmitActionFormHide;
255
255
  if (t === void 0) return !1;
256
256
  let n = t.trim().toLowerCase();
257
257
  return n === "true" || n === "1" || n === "";
@@ -265,7 +265,7 @@ function I(e, t) {
265
265
  ].forEach((n) => {
266
266
  e.querySelectorAll(n).forEach((e) => {
267
267
  let n = e;
268
- t ? n.hidden = !0 : n.hidden = !1;
268
+ n.hidden = !!t;
269
269
  });
270
270
  });
271
271
  }
@@ -309,38 +309,38 @@ function xe(e, t) {
309
309
  }), t && (t.setAttribute("data-formie-loading", "true"), be(e, t)));
310
310
  }
311
311
  function B(e) {
312
- if (e.removeAttribute("data-formie-loading"), z(e).forEach((t) => {
312
+ e.removeAttribute("data-formie-loading"), z(e).forEach((t) => {
313
313
  if ("disabled" in t) {
314
314
  let e = t;
315
315
  e.disabled = e.getAttribute("data-formie-was-disabled") === "true";
316
316
  }
317
317
  R(t), t.removeAttribute("data-formie-was-disabled"), t.removeAttribute("data-formie-loading"), i(t, e, "loading", !1), t.removeAttribute("data-formie-loading-indicator"), t.removeAttribute("data-formie-loading-text");
318
- }), e.dataset.formieDisableSubmitUntilValid === "true") {
319
- let t = e;
320
- t.formieValidation && E(e, t.formieValidation);
321
- }
318
+ });
319
+ let t = e;
320
+ t.formieValidation && E(e, t.formieValidation);
322
321
  }
323
322
  function V(e, t) {
324
323
  let n = N(e), r = me(e), s = n.findIndex((e) => e.getAttribute("data-formie-page-id") === t);
325
- if (n.forEach((n) => {
324
+ n.forEach((n) => {
326
325
  n.getAttribute("data-formie-page-id") === t ? (n.removeAttribute("data-formie-page-hidden"), a(n, e, "pageHidden")) : (n.setAttribute("data-formie-page-hidden", "true"), o(n, e, "pageHidden"));
327
326
  }), r.forEach((n, r) => {
328
327
  let c = n.getAttribute("data-formie-page-id") === t, l = s > -1 && r < s;
329
328
  i(n, e, "tabCurrent", c), i(n, e, "tabComplete", l);
330
329
  let u = n.querySelector("[data-formie-tab-link]");
331
330
  u && (i(u, e, "tabLinkCurrent", c), c ? a(u, e, "tabLinkInactive") : o(u, e, "tabLinkInactive")), c ? n.setAttribute("aria-current", "page") : n.removeAttribute("aria-current"), l ? n.setAttribute("data-formie-tab-complete", "true") : n.removeAttribute("data-formie-tab-complete");
332
- }), s > -1 && n.length > 0 && ye(e, he(e, s, n.length)), A(e, "pageId", t), b(e), e.dataset.formieDisableSubmitUntilValid === "true") {
333
- let t = e;
334
- t.formieValidation && E(e, t.formieValidation);
335
- }
336
- }
337
- function Se(e, t) {
338
- let n = t.meta?.submissionUid;
339
- typeof n == "string" && n.trim() !== "" && A(e, "submissionUid", n);
340
- let r = (t.meta?.session)?.continuation?.continuationToken;
341
- typeof r == "string" && r.trim() !== "" ? A(e, "continuationToken", r) : M(e, "continuationToken");
342
- }
343
- function Ce(e) {
331
+ }), s > -1 && n.length > 0 && ye(e, he(e, s, n.length)), A(e, "pageId", t), b(e);
332
+ let c = e;
333
+ c.formieValidation && E(e, c.formieValidation);
334
+ }
335
+ function H(e, t) {
336
+ let n = t.meta?.session?.version ?? t.meta?.version;
337
+ typeof n == "number" && A(e, "expectedVersion", String(n));
338
+ let r = t.meta?.submissionUid;
339
+ typeof r == "string" && r.trim() !== "" && A(e, "submissionUid", r);
340
+ let i = (t.meta?.session)?.continuation?.progressId;
341
+ typeof i == "string" && i.trim() !== "" ? A(e, "progressId", i) : M(e, "progressId");
342
+ }
343
+ function Se(e) {
344
344
  let t = e.getAttribute("action");
345
345
  t && e.setAttribute("action", fe(t, "resumeToken"));
346
346
  try {
@@ -349,7 +349,7 @@ function Ce(e) {
349
349
  e.searchParams.delete("resumeToken"), window.history.replaceState({}, document.title, `${e.pathname}${e.search}${e.hash}`);
350
350
  } catch {}
351
351
  }
352
- function we(e, t) {
352
+ function Ce(e, t) {
353
353
  let n = t.meta?.resumeUrl;
354
354
  if (typeof n != "string" || n.trim() === "") return;
355
355
  let r = n.trim();
@@ -361,18 +361,18 @@ function we(e, t) {
361
361
  } catch {}
362
362
  }
363
363
  }
364
- function H(t, n = {}) {
364
+ function U(t, n = {}) {
365
365
  let r = t.formieValidation, i = N(t)[0]?.getAttribute("data-formie-page-id");
366
- if (L(t), t.reset(), n.preserveHiddenState || I(t, !1), M(t, "submissionId"), M(t, "submissionUid"), M(t, "continuationToken"), M(t, "pageId"), Ce(t), r?.resetLiveState(), i) {
366
+ if (L(t), t.reset(), n.preserveHiddenState || I(t, !1), M(t, "submissionId"), A(t, "expectedVersion", "0"), M(t, "submissionUid"), M(t, "progressId"), M(t, "pageId"), Se(t), r?.resetLiveState(), i) {
367
367
  V(t, i), t.dispatchEvent(new CustomEvent(e("reset"), { bubbles: !0 }));
368
368
  return;
369
369
  }
370
370
  b(t), t.dispatchEvent(new CustomEvent(e("reset"), { bubbles: !0 }));
371
371
  }
372
- function Te(e) {
372
+ function we(e) {
373
373
  return e.code === de || e.meta?.resetState === !0;
374
374
  }
375
- function Ee(e, t) {
375
+ function Te(e, t) {
376
376
  let r = t.submitData, i = /* @__PURE__ */ new Set(), a = !1;
377
377
  if (Array.isArray(r) && r.length > 0) {
378
378
  let t = r.filter((e) => typeof e == "object" && !!e && "event" in e && typeof e.event == "string");
@@ -384,32 +384,32 @@ function Ee(e, t) {
384
384
  }));
385
385
  }
386
386
  }
387
- let o = t.meta || {}, s = (o.paymentAction && typeof o.paymentAction == "object" ? o.paymentAction : null) || (o.paymentDecision && typeof o.paymentDecision == "object" ? o.paymentDecision.action : null), c = s ? String(s.event || "") : "", l = s ? s.payload : void 0, u = n(c);
388
- return u && !i.has(u) && (u.startsWith("formie:payment:") && (a = !0), e.dispatchEvent(new CustomEvent(u, {
387
+ let o = t.payment?.action, s = o ? String(o.event || "") : "", c = o ? o.payload : void 0, l = n(s);
388
+ return l && !i.has(l) && (l.startsWith("formie:payment:") && (a = !0), e.dispatchEvent(new CustomEvent(l, {
389
389
  bubbles: !0,
390
- detail: { data: l }
391
- })), k.log("Dispatching fallback payment action event.", { eventName: u })), { hasPaymentFollowUpEvent: a };
390
+ detail: { data: c }
391
+ })), k.log("Dispatching fallback payment action event.", { eventName: l })), { hasPaymentFollowUpEvent: a };
392
392
  }
393
- function De(e, t, n) {
393
+ function Ee(e, t, n) {
394
394
  if (k.log("Applying submit result state.", {
395
395
  ok: t.ok,
396
396
  action: n,
397
397
  code: t.code,
398
398
  hasRedirect: !!t.redirect?.url,
399
399
  hasSubmitData: Array.isArray(t.submitData) && t.submitData.length > 0
400
- }), Te(t)) {
401
- H(e), k.log("Resetting state due to stale/reset marker.");
400
+ }), we(t)) {
401
+ U(e), k.log("Resetting state due to stale/reset marker.");
402
402
  return;
403
403
  }
404
- let r = Ee(e, t);
404
+ let r = Te(e, t);
405
405
  if (!t.ok && t.redirect?.url && !r.hasPaymentFollowUpEvent) {
406
406
  k.log("Applying redirect fallback for failed result.", {
407
407
  url: t.redirect.url,
408
408
  target: t.redirect.target
409
- }), L(e), t.redirect.target === "new-tab" ? window.open(t.redirect.url, "_blank") : (j(e, "redirect"), window.location.href = t.redirect.url);
409
+ }), L(e), t.redirect.target === "new-tab" ? window.open(t.redirect.url, "_blank", "noopener,noreferrer") : (j(e, "redirect"), window.location.href = t.redirect.url);
410
410
  return;
411
411
  }
412
- if (Se(e, t), !t.ok) {
412
+ if (H(e, t), !t.ok) {
413
413
  k.log("Non-redirect failure; keeping current form state."), L(e);
414
414
  return;
415
415
  }
@@ -418,32 +418,32 @@ function De(e, t, n) {
418
418
  return;
419
419
  }
420
420
  if (n === "save") {
421
- L(e), we(e, t), k.log("Applied save/resume token state.");
421
+ L(e), Ce(e, t), k.log("Applied save/resume token state.");
422
422
  return;
423
423
  }
424
- if (n === "submit" && !t.redirect?.url) {
424
+ if (t.completion && n === "submit" && !t.redirect?.url) {
425
425
  let n = P(e, t), r = n === "message" && F(e);
426
426
  if (n === "reload") {
427
427
  L(e), j(e, "reload"), window.location.reload();
428
428
  return;
429
429
  }
430
430
  if (n === "reset") {
431
- H(e);
431
+ U(e);
432
432
  return;
433
433
  }
434
- L(e), H(e, { preserveHiddenState: r });
434
+ L(e), U(e, { preserveHiddenState: r });
435
435
  return;
436
436
  }
437
437
  if (n === "submit" && t.redirect?.url && t.redirect.target === "new-tab") {
438
438
  let n = P(e, t) === "message" && F(e);
439
- L(e), H(e, { preserveHiddenState: n });
439
+ L(e), U(e, { preserveHiddenState: n });
440
440
  return;
441
441
  }
442
442
  L(e);
443
443
  }
444
444
  //#endregion
445
445
  //#region src/js/modules/payments/constants.ts
446
- var Oe = 2500, ke = {
446
+ var De = 2500, Oe = {
447
447
  bpoint: ["bpointToken"],
448
448
  stripe: ["stripePaymentIntentId"],
449
449
  paypal: ["paypalOrderId", "paypalAuthId"],
@@ -458,25 +458,25 @@ var Oe = 2500, ke = {
458
458
  };
459
459
  //#endregion
460
460
  //#region src/js/utils/fields.ts
461
- function Ae(e) {
461
+ function ke(e) {
462
462
  return e.replace("{field:", "").replace("{", "").replace("}", "").replace("]", "").split("[").join("][");
463
463
  }
464
- function je(e) {
465
- return `fields[${Ae(e)}]`;
464
+ function Ae(e) {
465
+ return `fields[${ke(e)}]`;
466
466
  }
467
- function Me(e, t) {
468
- let n = je(t), r = Array.from(e.querySelectorAll(`[name="${n}"]`)), i = Array.from(e.querySelectorAll(`[name="${n}[]"]`));
467
+ function je(e, t) {
468
+ let n = Ae(t), r = Array.from(e.querySelectorAll(`[name="${n}"]`)), i = Array.from(e.querySelectorAll(`[name="${n}[]"]`));
469
469
  return (i.length ? i : r).filter((e) => e instanceof HTMLElement);
470
470
  }
471
- function U(e, t) {
472
- let n = Me(e, t);
471
+ function W(e, t) {
472
+ let n = je(e, t);
473
473
  for (let e of n) {
474
474
  let t = e.closest("[data-formie-field-handle]")?.querySelector("[data-formie-field-label]")?.childNodes[0]?.textContent?.trim();
475
475
  if (t) return t;
476
476
  }
477
477
  return "";
478
478
  }
479
- function W(e) {
479
+ function G(e) {
480
480
  let t = e.replace(/[^\d.,-]/g, ""), n = t.includes(","), r = t.includes(".");
481
481
  if (n && r) t = t.lastIndexOf(",") > t.lastIndexOf(".") ? t.replace(/\./g, "").replace(",", ".") : t.replace(/,/g, "");
482
482
  else if (n && !r) {
@@ -487,13 +487,17 @@ function W(e) {
487
487
  }
488
488
  //#endregion
489
489
  //#region src/js/modules/payments/utils.ts
490
- function G(e, t) {
490
+ function K(e) {
491
+ let t = e;
492
+ return !t.closest("[data-formie-conditionally-hidden]") && !t.closest("[data-formie-row-hidden]") && !t.closest("[data-formie-page-hidden]") && !t.closest("[hidden]");
493
+ }
494
+ function q(e, t) {
491
495
  let n = t.replace(/"/g, "\\\"");
492
496
  return e.querySelector(`input[name$="[${n}]"]`) || e.querySelector(`input[name$="${n}"]`);
493
497
  }
494
- function K(e, t) {
498
+ function J(e, t) {
495
499
  let n = t.find((t) => {
496
- let n = G(e, t);
500
+ let n = q(e, t);
497
501
  return !n || String(n.value || "").trim() === "";
498
502
  });
499
503
  return {
@@ -501,41 +505,41 @@ function K(e, t) {
501
505
  missingSuffix: n
502
506
  };
503
507
  }
504
- async function q(e, t, n) {
505
- let r = K(e, t);
508
+ async function Y(e, t, n) {
509
+ let r = J(e, t);
506
510
  if (r.ok) return r;
507
511
  let i = Date.now() + Math.max(n, 0);
508
512
  for (; Date.now() < i;) {
509
513
  await c(120);
510
- let n = K(e, t);
514
+ let n = J(e, t);
511
515
  if (n.ok) return n;
512
516
  }
513
- return K(e, t);
517
+ return J(e, t);
514
518
  }
515
519
  //#endregion
516
520
  //#region src/js/modules/payments/host.ts
517
- var Ne = new Set([
521
+ var Me = /* @__PURE__ */ new Set([
518
522
  "handle",
519
523
  "requiredInputSuffixes",
520
524
  "waitForValueMs",
521
525
  "errorMessage"
522
- ]), J = "[data-payment-success]", Y = "[data-payment-error]";
523
- function X(e, t) {
526
+ ]), X = "[data-payment-success]", Z = "[data-payment-error]";
527
+ function Ne(e, t) {
524
528
  return (typeof t.handle == "string" && t.handle.trim() !== "" ? t.handle.trim() : "") || e;
525
529
  }
526
530
  function Pe(e, t, n) {
527
- let r = t || {}, i = Object.entries(r).reduce((e, [t, n]) => (Ne.has(t) || (e[t] = n), e), {}), a = Array.isArray(r.requiredInputSuffixes) ? r.requiredInputSuffixes.map(String).filter(Boolean) : n.defaultRequiredInputSuffixes || [], o = Number(r.waitForValueMs ?? n.defaultWaitForValueMs ?? 2500), s = typeof r.errorMessage == "string" && r.errorMessage.trim() !== "" ? r.errorMessage.trim() : "Payment authorization is incomplete.";
531
+ let r = t || {}, i = Object.entries(r).reduce((e, [t, n]) => (Me.has(t) || (e[t] = n), e), {}), a = Array.isArray(r.requiredInputSuffixes) ? r.requiredInputSuffixes.map(String).filter(Boolean) : n.defaultRequiredInputSuffixes || [], o = Number(r.waitForValueMs ?? n.defaultWaitForValueMs ?? 2500), s = typeof r.errorMessage == "string" && r.errorMessage.trim() !== "" ? r.errorMessage.trim() : "Payment authorization is incomplete.";
528
532
  return {
529
- handle: X(e, r),
533
+ handle: Ne(e, r),
530
534
  transport: {
531
535
  requiredInputSuffixes: a,
532
- waitForValueMs: Number.isFinite(o) ? o : Oe,
536
+ waitForValueMs: Number.isFinite(o) ? o : De,
533
537
  errorMessage: s
534
538
  },
535
539
  provider: i
536
540
  };
537
541
  }
538
- function Z(e, t, n) {
542
+ function Q(e, t, n) {
539
543
  return e.addEventListener(t, n), () => {
540
544
  e.removeEventListener(t, n);
541
545
  };
@@ -552,47 +556,47 @@ function Fe(e, t) {
552
556
  updateInputs: (e, t) => {
553
557
  let r = Array.isArray(e) ? e : [e];
554
558
  for (let e of r) {
555
- let r = G(a, e) ?? n.querySelector(`input[name*="${e}"]`);
559
+ let r = q(a, e) ?? n.querySelector(`input[name*="${e}"]`);
556
560
  r && (r.value = t);
557
561
  }
558
562
  },
559
563
  addError: (e) => {
560
- let t = n.querySelector("[data-formie-field-type] > div, [data-field-type] > div") || n, a = t.querySelector(Y);
564
+ let t = n.querySelector("[data-formie-field-type] > div, [data-field-type] > div") || n, a = t.querySelector(Z);
561
565
  a && a.remove();
562
566
  let s = document.createElement("div");
563
567
  s.setAttribute("data-payment-error", ""), s.textContent = e, o(s, r || i, "fieldError"), t.appendChild(s);
564
568
  },
565
569
  removeError: () => {
566
- n.querySelector(Y)?.remove();
570
+ n.querySelector(Z)?.remove();
567
571
  },
568
572
  addSuccess: (e) => {
569
- let t = n.querySelector("[data-formie-field-type] > div, [data-field-type] > div") || n, a = t.querySelector(J);
573
+ let t = n.querySelector("[data-formie-field-type] > div, [data-field-type] > div") || n, a = t.querySelector(X);
570
574
  a && a.remove();
571
575
  let s = document.createElement("div");
572
576
  s.setAttribute("data-payment-success", ""), s.textContent = e, o(s, r || i, "successMessage"), t.appendChild(s);
573
577
  },
574
578
  removeSuccess: () => {
575
- n.querySelector(J)?.remove();
579
+ n.querySelector(X)?.remove();
576
580
  },
577
- hasToken: () => K(a, c).ok,
578
- waitForToken: (e = t.transport.waitForValueMs) => q(a, c, e).then((e) => e.ok),
581
+ hasToken: () => J(a, c).ok,
582
+ waitForToken: (e = t.transport.waitForValueMs) => Y(a, c, e).then((e) => e.ok),
579
583
  getFieldValue: (e, t = "string") => {
580
584
  let n = h(e);
581
- return t === "float" || t === "int" || t === "number" ? W(n) : n;
585
+ return t === "float" || t === "int" || t === "number" ? G(n) : n;
582
586
  },
583
587
  resolveAmount: (e) => {
584
- let t = r || i, n = String(e.type || "").toLowerCase() === "dynamic" && typeof e.variable == "string" && e.variable.trim() !== "", a = e.value ?? (n ? e.variable : e.fixed), o = String(a ?? "").trim(), c = typeof a == "number" ? a : W(o);
588
+ let t = r || i, n = String(e.type || "").toLowerCase() === "dynamic" && typeof e.variable == "string" && e.variable.trim() !== "", a = e.value ?? (n ? e.variable : e.fixed), o = String(a ?? "").trim(), c = typeof a == "number" ? a : G(o);
585
589
  if (Number.isFinite(c) && c > 0) return {
586
590
  ok: !0,
587
591
  value: c
588
592
  };
589
593
  if (o !== "") {
590
- let e = h(o), n = W(e);
594
+ let e = h(o), n = G(e);
591
595
  if (Number.isFinite(n) && n > 0) return {
592
596
  ok: !0,
593
597
  value: n
594
598
  };
595
- let r = U(t, o);
599
+ let r = W(t, o);
596
600
  if (!e) return {
597
601
  ok: !1,
598
602
  error: r ? s("Provide a value for \"{label}\" to proceed.", { label: r }) : s("Provide a payment amount to proceed.")
@@ -615,7 +619,7 @@ function Fe(e, t) {
615
619
  ok: !0,
616
620
  value: n
617
621
  };
618
- let r = U(t, o);
622
+ let r = W(t, o);
619
623
  if (!e) return {
620
624
  ok: !1,
621
625
  error: r ? s("Provide a value for \"{label}\" to proceed.", { label: r }) : s("Provide a payment currency to proceed.")
@@ -645,7 +649,7 @@ function Fe(e, t) {
645
649
  t();
646
650
  }, n), p = (e) => {
647
651
  let t = e.target?.name || "";
648
- !t || !c.has(t) || f();
652
+ t && c.has(t) && f();
649
653
  };
650
654
  return a.addEventListener("input", p), a.addEventListener("change", p), () => {
651
655
  a.removeEventListener("input", p), a.removeEventListener("change", p);
@@ -675,160 +679,160 @@ function Fe(e, t) {
675
679
  return { billing_details: t };
676
680
  },
677
681
  events: {
678
- onForm: (e, t) => r ? Z(r, e, t) : () => {},
679
- onRoot: (e, t) => Z(i, e, t)
682
+ onForm: (e, t) => r ? Q(r, e, t) : () => {},
683
+ onRoot: (e, t) => Q(i, e, t)
680
684
  }
681
685
  };
682
686
  }
683
687
  //#endregion
684
688
  //#region src/js/modules/payments/factories.ts
685
- var Q = r("payments");
686
- function $(e) {
687
- let t = e;
688
- return !t.closest("[data-formie-page-hidden]") && !t.closest("[hidden]");
689
- }
689
+ var $ = r("payments");
690
690
  function Ie(e) {
691
- let t = e.defaultRequiredInputSuffixes ?? ke[e.id] ?? [];
691
+ let t = e.defaultRequiredInputSuffixes ?? Oe[e.moduleId.split(":")[1]] ?? [];
692
692
  return {
693
- id: e.id,
693
+ moduleId: e.moduleId,
694
+ version: 2,
695
+ surfaces: ["server-rendered", "client-rendered"],
694
696
  kind: "payment",
695
697
  match: (e) => !!(e.target.querySelector("[data-formie-field-type=\"payment\"]") || e.target.closest("[data-formie-field-type=\"payment\"]") || e.target.getAttribute?.("data-formie-field-type") === "payment"),
696
698
  setup: async (n) => {
697
699
  let r = n.target, i = r.__formiePaymentModuleRegistry || {};
698
700
  r.__formiePaymentModuleRegistry = i;
699
- let a = i[e.id];
700
- if (a?.destroy) {
701
- Q.warn("Found stale payment module instance; destroying previous.", { moduleId: e.id });
701
+ let a = n.entryKey ?? e.moduleId, o = i[a];
702
+ if (o?.destroy) {
703
+ $.warn("Found stale payment module instance; destroying previous.", { moduleId: e.moduleId });
702
704
  try {
703
- await a.destroy();
705
+ await o.destroy();
704
706
  } catch {}
705
707
  }
706
- let o = Pe(e.id, n.options || {}, { defaultRequiredInputSuffixes: t }), s = Fe(n, o), c = {
708
+ let s = Pe(e.moduleId.split(":")[1], n.options || {}, { defaultRequiredInputSuffixes: t }), c = Fe(n, s), l = {
707
709
  ...n,
708
- options: o,
709
- services: s
710
- }, l = [], u = null, d = null, f = null, p = null, m = async () => (u ||= (Q.log("Loading payment provider API.", { moduleId: e.id }), e.load(c)), u), h = async () => {
711
- if (!e.mount || d || !$(n.target)) return;
712
- let t = await m();
710
+ options: s,
711
+ services: c
712
+ }, u = [], d = null, f = null, p = null, m = null, h = async () => (d ||= ($.log("Loading payment provider API.", { moduleId: e.moduleId }), e.load(l)), d), g = async () => {
713
+ if (!e.mount || f || !K(n.target)) return;
714
+ let t = await h();
713
715
  try {
714
- d = await e.mount({
716
+ f = await e.mount({
715
717
  api: t,
716
718
  field: n.target,
717
- services: s,
718
- options: o,
719
- provider: o.provider
720
- }), Q.log("Payment widget mounted.", {
721
- moduleId: e.id,
722
- handle: o.handle
723
- });
724
- } catch {
725
- Q.warn("Payment widget mount failed.", {
726
- moduleId: e.id,
727
- handle: o.handle
719
+ services: c,
720
+ options: s,
721
+ provider: s.provider
722
+ }), $.log("Payment widget mounted.", {
723
+ moduleId: e.moduleId,
724
+ handle: s.handle
728
725
  });
726
+ } catch (t) {
727
+ throw $.warn("Payment widget mount failed.", {
728
+ moduleId: e.moduleId,
729
+ handle: s.handle
730
+ }), t;
729
731
  }
730
732
  };
731
- if (l.push(n.on("formie:submit:before", () => {
732
- s.removeError(), s.removeSuccess();
733
+ if (u.push(n.on("formie:submit:before", () => {
734
+ c.removeError(), c.removeSuccess();
733
735
  })), e.setup) {
734
736
  let t = n.root || n.form || n.target;
735
- f = await e.setup({
736
- ...c,
737
+ p = await e.setup({
738
+ ...l,
737
739
  root: t
738
- }), f.destroy && l.push(f.destroy);
740
+ }), p.destroy && u.push(p.destroy);
739
741
  }
740
- e.mount && $(n.target) && await h(), ["formie:page:navigate:after", "formie:submit:result"].forEach((e) => {
742
+ e.mount && K(n.target) && await g(), ["formie:page:navigate:after", "formie:submit:result"].forEach((e) => {
741
743
  let t = () => {
742
- h();
744
+ g();
743
745
  };
744
- n.root.addEventListener(e, t), l.push(() => {
746
+ n.root.addEventListener(e, t), u.push(() => {
745
747
  n.root.removeEventListener(e, t);
746
748
  });
747
- });
748
- let g = async () => {
749
- if (Q.log("Destroying payment module.", {
750
- moduleId: e.id,
751
- handle: o.handle
752
- }), l.forEach((e) => e()), d && e.unmount) {
753
- let t = await m();
749
+ }), u.push(n.on("formie:conditions:evaluated", () => {
750
+ g();
751
+ }));
752
+ let _ = async () => {
753
+ if ($.log("Destroying payment module.", {
754
+ moduleId: e.moduleId,
755
+ handle: s.handle
756
+ }), u.forEach((e) => e()), f && e.unmount) {
757
+ let t = await h();
754
758
  await e.unmount({
755
759
  api: t,
756
- widget: d,
760
+ widget: f,
757
761
  field: n.target,
758
- services: s,
759
- options: o,
760
- provider: o.provider
761
- }), Q.log("Payment widget unmounted.", {
762
- moduleId: e.id,
763
- handle: o.handle
762
+ services: c,
763
+ options: s,
764
+ provider: s.provider
765
+ }), $.log("Payment widget unmounted.", {
766
+ moduleId: e.moduleId,
767
+ handle: s.handle
764
768
  });
765
769
  }
766
- i[e.id]?.destroy === g && delete i[e.id], Q.log("Payment module destroy complete.", {
767
- moduleId: e.id,
768
- handle: o.handle
770
+ i[a]?.destroy === _ && delete i[a], $.log("Payment module destroy complete.", {
771
+ moduleId: e.moduleId,
772
+ handle: s.handle
769
773
  });
770
774
  };
771
- return i[e.id] = { destroy: g }, {
772
- destroy: g,
773
- onBeforeStage: async (t) => {
774
- if (f?.onBeforeStage) {
775
- await f.onBeforeStage(t);
775
+ return i[a] = { destroy: _ }, {
776
+ destroy: _,
777
+ beforeSubmit: async (t) => {
778
+ if (p?.beforeSubmit) {
779
+ await p.beforeSubmit(t);
776
780
  return;
777
781
  }
778
- if (t.stage !== "authorize" || t.action !== "submit" || n.target.closest("[data-formie-page]")?.hasAttribute("data-formie-page-hidden")) return;
779
- await h();
780
- let r = await m();
781
- if (e.onBeforeAuthorize) {
782
- p ||= (async () => e.onBeforeAuthorize({
782
+ if (t.action !== "submit" || !K(n.target)) return;
783
+ await g();
784
+ let r = await h();
785
+ if (e.onBeforePayment) {
786
+ m ||= (async () => e.onBeforePayment({
783
787
  api: r,
784
- widget: d,
788
+ widget: f,
785
789
  field: n.target,
786
- services: s,
787
- options: o,
788
- provider: o.provider,
790
+ services: c,
791
+ options: s,
792
+ provider: s.provider,
789
793
  stageCtx: t
790
794
  }))().finally(() => {
791
- p = null;
795
+ m = null;
792
796
  });
793
- let i = await p;
794
- if (Q.log("onBeforeAuthorize resolved.", {
795
- moduleId: e.id,
796
- handle: o.handle,
797
+ let i = await m;
798
+ if ($.log("onBeforePayment resolved.", {
799
+ moduleId: e.moduleId,
800
+ handle: s.handle,
797
801
  ok: i
798
802
  }), !i) {
799
- t.abort(o.transport.errorMessage);
803
+ t.abort(s.transport.errorMessage);
800
804
  return;
801
805
  }
802
806
  return;
803
807
  }
804
- if (o.transport.requiredInputSuffixes.length === 0) return;
805
- let i = await q(n.form || n.root, o.transport.requiredInputSuffixes, o.transport.waitForValueMs);
806
- i.ok || (Q.warn("Required payment input(s) missing.", {
807
- moduleId: e.id,
808
- handle: o.handle,
808
+ if (s.transport.requiredInputSuffixes.length === 0) return;
809
+ let i = await Y(n.form || n.root, s.transport.requiredInputSuffixes, s.transport.waitForValueMs);
810
+ i.ok || ($.warn("Required payment input(s) missing.", {
811
+ moduleId: e.moduleId,
812
+ handle: s.handle,
809
813
  missingSuffix: i.missingSuffix
810
- }), t.abort(o.transport.errorMessage));
814
+ }), t.abort(s.transport.errorMessage));
811
815
  },
812
- onAfterStage: async (t, r) => {
813
- if (!(t.stage !== "dispatch" || !e.onAfterSubmit) && !(!(await e.onAfterSubmit({
816
+ afterSubmit: async (t, r) => {
817
+ if (e.onAfterSubmit && (await e.onAfterSubmit({
814
818
  field: n.target,
815
- services: s,
816
- options: o,
817
- provider: o.provider,
819
+ services: c,
820
+ options: s,
821
+ provider: s.provider,
818
822
  result: r
819
- }))?.remount || !e.mount)) {
820
- if (d && e.unmount) {
821
- let t = await m();
823
+ }))?.remount && e.mount) {
824
+ if (f && e.unmount) {
825
+ let t = await h();
822
826
  await e.unmount({
823
827
  api: t,
824
- widget: d,
828
+ widget: f,
825
829
  field: n.target,
826
- services: s,
827
- options: o,
828
- provider: o.provider
830
+ services: c,
831
+ options: s,
832
+ provider: s.provider
829
833
  });
830
834
  }
831
- d = null, await h();
835
+ f = null, await g();
832
836
  }
833
837
  }
834
838
  };
@@ -839,4 +843,4 @@ function Ie(e) {
839
843
  //#region src/js/modules/payments/api.ts
840
844
  var Le = Ie;
841
845
  //#endregion
842
- export { I as a, x as c, y as d, ae as f, B as i, S as l, V as n, xe as o, m as p, De as r, ue as s, Le as t, b as u };
846
+ export { I as a, x as c, y as d, ae as f, B as i, S as l, V as n, xe as o, m as p, Ee as r, ue as s, Le as t, b as u };