@verbb/formie-browser 1.0.13 → 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.
- package/CHANGELOG.md +50 -0
- package/dist/chunks/{address-country-Rx6GQTND.js → address-country-Dn71jroa.js} +10 -4
- package/dist/chunks/{address-finder-k7_BXaRe.js → address-finder-O49uDRoR.js} +2 -2
- package/dist/chunks/{address-state-BwE01m2_.js → address-state-ByYatUur.js} +154 -143
- package/dist/chunks/{api-DqpfkZWL.js → api-D6kJ7kXZ.js} +183 -179
- package/dist/chunks/{api-BUb6P-xu.js → api-DYYsVIub.js} +77 -47
- package/dist/chunks/{api-sPqGbOww.js → api-ghNr2uxX.js} +15 -9
- package/dist/chunks/{bpoint-Dlq34XH1.js → bpoint-D0RKFM4F.js} +3 -3
- package/dist/chunks/calculations-YEoVCG2q.js +310 -0
- package/dist/chunks/{captcha-eu-CGm8Lbrj.js → captcha-eu-DERJbXnH.js} +5 -4
- package/dist/chunks/{checkbox-radio-BY2aTCOG.js → checkbox-radio-gsm8QPJg.js} +74 -75
- package/dist/chunks/{combobox-C0EuExSI.js → combobox-CWNdx4Fk.js} +290 -279
- package/dist/chunks/conditions-DqNHLTbN.js +464 -0
- package/dist/chunks/country-from-ip-DDj_mFki.js +29 -0
- package/dist/chunks/csrf-DxHg_ZYt.js +61 -0
- package/dist/chunks/{custom-google-maps-BsaSirEZ.js → custom-google-maps-C4l2S3GO.js} +9 -3
- package/dist/chunks/{custom-link-CJ1-FjEM.js → custom-link-CLazgKYH.js} +8 -2
- package/dist/chunks/{custom-maps-DYW_pBid.js → custom-maps-DqcAlD0v.js} +10 -4
- package/dist/chunks/{date-picker-F9BUBDSW.js → date-picker-RUnevF7l.js} +455 -432
- package/dist/chunks/{dist-D6i-VNgM.js → dist-ZLeW0zZ3.js} +1281 -453
- package/dist/chunks/{eway-D9_m8ooj.js → eway-or6dtjoT.js} +3 -3
- package/dist/chunks/field-references.resolver-Ca8MguFv.js +104 -0
- package/dist/chunks/{file-upload-rqfZNqlH.js → file-upload-Bm-TXyNB.js} +104 -96
- package/dist/chunks/friendly-captcha-v1-GFqCt1Mh.js +34 -0
- package/dist/chunks/{friendly-captcha-v2-CLSAbkqx.js → friendly-captcha-v2-WoW246JG.js} +6 -5
- package/dist/chunks/{friendly-challenge-8uPatWqk.js → friendly-challenge-DPG9MJb1.js} +111 -102
- package/dist/chunks/{go-cardless-DAT3ZaQf.js → go-cardless-DzJ-0FKg.js} +2 -2
- package/dist/chunks/google-address-C1P1nTDM.js +163 -0
- package/dist/chunks/{hcaptcha-CGLAmgjO.js → hcaptcha-D0T8aIHz.js} +3 -3
- package/dist/chunks/{hidden-D7_Ch-QN.js → hidden-BZhXnNPe.js} +8 -2
- package/dist/chunks/http-C2QdHuWO.js +27 -0
- package/dist/chunks/{leaflet-src-j-lHNmhR.js → leaflet-src-DE6rv6M-.js} +42 -46
- package/dist/chunks/{loqate-CJPzBmSm.js → loqate-DD1S7PY9.js} +2 -2
- package/dist/chunks/{mollie-Bibhl67p.js → mollie-DG8Ju83x.js} +2 -2
- package/dist/chunks/{moneris-H2wSqk9h.js → moneris-C8m3Fvqu.js} +3 -3
- package/dist/chunks/opayo-B3EvrVxw.js +188 -0
- package/dist/chunks/{paddle-DkvIxQdG.js → paddle-BIYR9Um3.js} +3 -3
- package/dist/chunks/{password-validation-D06uH9va.js → password-validation-C8_uO_c_.js} +18 -12
- package/dist/chunks/{paypal-CQpAF7Ua.js → paypal-B_yxIo2d.js} +7 -5
- package/dist/chunks/{payway-CwDkC7YZ.js → payway-CeOzS0sL.js} +3 -3
- package/dist/chunks/{phone-country-D3ayr60L.js → phone-country-bAqje17P.js} +80 -63
- package/dist/chunks/{place-kit-BGHklIZ-.js → place-kit-BE5gi3vo.js} +3 -3
- package/dist/chunks/{placekit-autocomplete.esm-DWVabQlq.js → placekit-autocomplete.esm-CZZERYur.js} +11 -15
- package/dist/chunks/{recaptcha-enterprise-XPId5-bS.js → recaptcha-enterprise-CruXddZq.js} +4 -4
- package/dist/chunks/{recaptcha-shared-CLYJvojk.js → recaptcha-shared-AQRMDMme.js} +1 -1
- package/dist/chunks/{recaptcha-v2-checkbox-Cy-0PEPc.js → recaptcha-v2-checkbox-CCnJYCnG.js} +4 -4
- package/dist/chunks/{recaptcha-v2-invisible-BwRH540O.js → recaptcha-v2-invisible-BuVqRRYn.js} +4 -4
- package/dist/chunks/{recaptcha-v3-No4Ykrhk.js → recaptcha-v3-CloqhO2A.js} +4 -4
- package/dist/chunks/{repeater-BVnPUqTj.js → repeater-DwE27jI1.js} +25 -19
- package/dist/chunks/request-profile-DhwkeCpS.js +10 -0
- package/dist/chunks/rich-text-uV4o_pGk.js +361 -0
- package/dist/chunks/{chunk-3b4jIN3o.js → rolldown-runtime-DtPi1Y-2.js} +2 -2
- package/dist/chunks/{sdk-BhHAYgga.js → sdk-lkwSvlpM.js} +282 -234
- package/dist/chunks/{shared-Bx9s0i0P.js → shared-OKhSay59.js} +27 -21
- package/dist/chunks/{signature-IOhuicje.js → signature-7cldFbqj.js} +138 -112
- package/dist/chunks/{snaptcha-DKx98oon.js → snaptcha-C04kNGYQ.js} +2 -2
- package/dist/chunks/{square-DwdcOI1G.js → square-DEzxv9D9.js} +8 -6
- package/dist/chunks/{stripe-DaoG2FT1.js → stripe-CVPQGDz3.js} +10 -11
- package/dist/chunks/{summary-Dks0gXS3.js → summary-BF_8mrXI.js} +47 -45
- package/dist/chunks/{survey-likert-DkE6bR7B.js → survey-likert-fk1hUPff.js} +7 -1
- package/dist/chunks/{survey-rank-DN6x4IZM.js → survey-rank-BsLGl2LX.js} +37 -25
- package/dist/chunks/{survey-rating-BnsNL9U5.js → survey-rating-DVS6e6fM.js} +17 -5
- package/dist/chunks/{table-CAjCJHrL.js → table-DnIBdeKF.js} +21 -15
- package/dist/chunks/{text-limit-BGaY0jhI.js → text-limit-LGMPhFuC.js} +40 -34
- package/dist/chunks/{theme-classes-Tv7q7ToE.js → theme-classes-DAQuEqdP.js} +1 -1
- package/dist/chunks/{turnstile-DJakPzQD.js → turnstile-n9DNyPxi.js} +3 -3
- package/dist/chunks/{upload-manager-W-QDgxKD.js → upload-manager-BbiUosZq.js} +410 -350
- package/dist/chunks/{utils-Vqp8i_RM.js → utils-DpUBPadZ.js} +20 -14
- package/dist/css/formie-base.css +104 -1
- package/dist/css/theme/_messages.css +2 -0
- package/dist/css/theme/_tokens.css +31 -25
- package/dist/css/theme/forms/_form.css +5 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1778 -1427
- package/dist/js/contracts/client.d.ts +5 -3
- package/dist/js/contracts/client.d.ts.map +1 -1
- package/dist/js/contracts/common.d.ts +2 -2
- package/dist/js/contracts/common.d.ts.map +1 -1
- package/dist/js/contracts/modules.d.ts +37 -12
- package/dist/js/contracts/modules.d.ts.map +1 -1
- package/dist/js/contracts/schema.d.ts +20 -38
- package/dist/js/contracts/schema.d.ts.map +1 -1
- package/dist/js/contracts/theme.d.ts +4 -1
- package/dist/js/contracts/theme.d.ts.map +1 -1
- package/dist/js/core/client-rendered-modules.d.ts +17 -0
- package/dist/js/core/client-rendered-modules.d.ts.map +1 -0
- package/dist/js/core/create-formie-client.d.ts.map +1 -1
- package/dist/js/core/field-error-aria.d.ts +23 -0
- package/dist/js/core/field-error-aria.d.ts.map +1 -0
- package/dist/js/core/hydrate-modules.d.ts +10 -8
- package/dist/js/core/hydrate-modules.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.map +1 -1
- package/dist/js/core/validation-focus.d.ts.map +1 -1
- package/dist/js/modules/address/address-finder.d.ts +1 -1
- package/dist/js/modules/address/address-finder.d.ts.map +1 -1
- package/dist/js/modules/address/factories.d.ts +3 -3
- package/dist/js/modules/address/factories.d.ts.map +1 -1
- package/dist/js/modules/address/google-address.d.ts +2 -1
- package/dist/js/modules/address/google-address.d.ts.map +1 -1
- package/dist/js/modules/address/index.d.ts +2 -2
- package/dist/js/modules/address/index.d.ts.map +1 -1
- package/dist/js/modules/address/loqate.d.ts +1 -1
- package/dist/js/modules/address/loqate.d.ts.map +1 -1
- package/dist/js/modules/address/place-kit.d.ts +1 -1
- package/dist/js/modules/address/place-kit.d.ts.map +1 -1
- package/dist/js/modules/captchas/captcha-eu.d.ts +1 -1
- package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -1
- package/dist/js/modules/captchas/factories.d.ts +11 -11
- package/dist/js/modules/captchas/factories.d.ts.map +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +1 -1
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -1
- package/dist/js/modules/captchas/hcaptcha.d.ts +1 -1
- package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -1
- package/dist/js/modules/captchas/index.d.ts +2 -2
- package/dist/js/modules/captchas/index.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -1
- package/dist/js/modules/captchas/recaptcha-v3.d.ts +1 -1
- package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -1
- package/dist/js/modules/captchas/snaptcha.d.ts +1 -1
- package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -1
- package/dist/js/modules/captchas/turnstile.d.ts +1 -1
- package/dist/js/modules/captchas/turnstile.d.ts.map +1 -1
- package/dist/js/modules/fields/address-country.d.ts +2 -2
- package/dist/js/modules/fields/address-country.d.ts.map +1 -1
- package/dist/js/modules/fields/address-state.d.ts +2 -2
- package/dist/js/modules/fields/address-state.d.ts.map +1 -1
- package/dist/js/modules/fields/calculations.d.ts +2 -2
- package/dist/js/modules/fields/calculations.d.ts.map +1 -1
- package/dist/js/modules/fields/checkbox-radio.d.ts +2 -2
- package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -1
- package/dist/js/modules/fields/combobox.d.ts +2 -2
- package/dist/js/modules/fields/combobox.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/config.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/effects.d.ts +1 -0
- package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/evaluator.d.ts +4 -1
- package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/references.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/submission-context.d.ts +15 -0
- package/dist/js/modules/fields/conditions/submission-context.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/types.d.ts +3 -1
- package/dist/js/modules/fields/conditions/types.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions/values.d.ts +1 -1
- package/dist/js/modules/fields/conditions/values.d.ts.map +1 -1
- package/dist/js/modules/fields/conditions.d.ts +2 -2
- package/dist/js/modules/fields/conditions.d.ts.map +1 -1
- package/dist/js/modules/fields/custom-google-maps.d.ts +2 -2
- package/dist/js/modules/fields/custom-google-maps.d.ts.map +1 -1
- package/dist/js/modules/fields/custom-link.d.ts +2 -2
- package/dist/js/modules/fields/custom-link.d.ts.map +1 -1
- package/dist/js/modules/fields/custom-maps.d.ts +2 -2
- package/dist/js/modules/fields/custom-maps.d.ts.map +1 -1
- package/dist/js/modules/fields/date-picker.d.ts +2 -2
- package/dist/js/modules/fields/date-picker.d.ts.map +1 -1
- package/dist/js/modules/fields/file-upload.d.ts +2 -2
- package/dist/js/modules/fields/file-upload.d.ts.map +1 -1
- package/dist/js/modules/fields/hidden.d.ts +2 -2
- package/dist/js/modules/fields/hidden.d.ts.map +1 -1
- package/dist/js/modules/fields/index.d.ts +2 -2
- package/dist/js/modules/fields/index.d.ts.map +1 -1
- package/dist/js/modules/fields/password-validation.d.ts +2 -2
- package/dist/js/modules/fields/password-validation.d.ts.map +1 -1
- package/dist/js/modules/fields/phone-country.d.ts +2 -2
- package/dist/js/modules/fields/phone-country.d.ts.map +1 -1
- package/dist/js/modules/fields/repeater.d.ts +2 -2
- package/dist/js/modules/fields/repeater.d.ts.map +1 -1
- package/dist/js/modules/fields/rich-text.d.ts +2 -2
- package/dist/js/modules/fields/rich-text.d.ts.map +1 -1
- package/dist/js/modules/fields/shared.d.ts +1 -0
- package/dist/js/modules/fields/shared.d.ts.map +1 -1
- package/dist/js/modules/fields/signature.d.ts +2 -2
- package/dist/js/modules/fields/signature.d.ts.map +1 -1
- package/dist/js/modules/fields/summary.d.ts +2 -2
- package/dist/js/modules/fields/summary.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-likert.d.ts +2 -2
- package/dist/js/modules/fields/survey-likert.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-rank.d.ts +2 -2
- package/dist/js/modules/fields/survey-rank.d.ts.map +1 -1
- package/dist/js/modules/fields/survey-rating.d.ts +2 -2
- package/dist/js/modules/fields/survey-rating.d.ts.map +1 -1
- package/dist/js/modules/fields/table.d.ts +2 -2
- package/dist/js/modules/fields/table.d.ts.map +1 -1
- package/dist/js/modules/fields/text-limit.d.ts +2 -2
- package/dist/js/modules/fields/text-limit.d.ts.map +1 -1
- package/dist/js/modules/fields/upload-manager.d.ts +2 -2
- package/dist/js/modules/fields/upload-manager.d.ts.map +1 -1
- package/dist/js/modules/loader.d.ts +10 -4
- package/dist/js/modules/loader.d.ts.map +1 -1
- package/dist/js/modules/payments/bpoint.d.ts +1 -1
- package/dist/js/modules/payments/bpoint.d.ts.map +1 -1
- package/dist/js/modules/payments/eway.d.ts +1 -1
- package/dist/js/modules/payments/eway.d.ts.map +1 -1
- package/dist/js/modules/payments/factories.d.ts +7 -7
- package/dist/js/modules/payments/factories.d.ts.map +1 -1
- package/dist/js/modules/payments/go-cardless.d.ts +1 -1
- package/dist/js/modules/payments/go-cardless.d.ts.map +1 -1
- package/dist/js/modules/payments/index.d.ts +2 -2
- package/dist/js/modules/payments/index.d.ts.map +1 -1
- package/dist/js/modules/payments/mollie.d.ts +1 -1
- package/dist/js/modules/payments/mollie.d.ts.map +1 -1
- package/dist/js/modules/payments/moneris.d.ts +1 -1
- package/dist/js/modules/payments/moneris.d.ts.map +1 -1
- package/dist/js/modules/payments/opayo.d.ts +1 -1
- package/dist/js/modules/payments/opayo.d.ts.map +1 -1
- package/dist/js/modules/payments/paddle.d.ts +1 -1
- package/dist/js/modules/payments/paddle.d.ts.map +1 -1
- package/dist/js/modules/payments/paypal.d.ts +1 -1
- package/dist/js/modules/payments/paypal.d.ts.map +1 -1
- package/dist/js/modules/payments/payway.d.ts +1 -1
- package/dist/js/modules/payments/payway.d.ts.map +1 -1
- package/dist/js/modules/payments/square.d.ts +1 -1
- package/dist/js/modules/payments/square.d.ts.map +1 -1
- package/dist/js/modules/payments/stripe.d.ts +1 -1
- package/dist/js/modules/payments/stripe.d.ts.map +1 -1
- package/dist/js/modules/payments/utils.d.ts +6 -0
- package/dist/js/modules/payments/utils.d.ts.map +1 -1
- package/dist/js/modules/registry.d.ts +6 -4
- package/dist/js/modules/registry.d.ts.map +1 -1
- package/dist/js/submit/pipeline.d.ts.map +1 -1
- package/dist/js/theme/browser-theme-state.generated.d.ts +24 -0
- package/dist/js/theme/browser-theme-state.generated.d.ts.map +1 -0
- package/dist/js/theme/theme-classes.d.ts +3 -3
- package/dist/js/theme/theme-classes.d.ts.map +1 -1
- package/dist/js/transport/forms-api.d.ts +5 -3
- package/dist/js/transport/forms-api.d.ts.map +1 -1
- package/dist/js/utils/country-from-ip.d.ts +2 -2
- package/dist/js/utils/country-from-ip.d.ts.map +1 -1
- package/dist/js/utils/csrf.d.ts +17 -0
- package/dist/js/utils/csrf.d.ts.map +1 -0
- package/dist/js/utils/field-references.parser.d.ts +1 -0
- package/dist/js/utils/field-references.parser.d.ts.map +1 -1
- package/dist/js/utils/field-references.resolver.d.ts.map +1 -1
- package/dist/js/utils/field-references.types.d.ts +1 -0
- package/dist/js/utils/field-references.types.d.ts.map +1 -1
- package/dist/js/utils/http.d.ts +3 -1
- package/dist/js/utils/http.d.ts.map +1 -1
- package/dist/js/utils/request-profile.d.ts +4 -0
- package/dist/js/utils/request-profile.d.ts.map +1 -0
- package/dist/js/utils/unload-warning.d.ts.map +1 -1
- package/dist/js/validation/rules/email.d.ts.map +1 -1
- package/dist/js/validation/rules/match.d.ts.map +1 -1
- package/dist/js/validation/rules/number.d.ts.map +1 -1
- package/dist/js/validation/rules/required.d.ts.map +1 -1
- package/dist/js/validation/rules/shared.d.ts.map +1 -1
- package/dist/js/validation/rules/url.d.ts.map +1 -1
- package/dist/js/validation/skip.d.ts +7 -0
- package/dist/js/validation/skip.d.ts.map +1 -0
- package/dist/js/validation/submit-readiness.d.ts.map +1 -1
- package/dist/js/validation/validator.d.ts.map +1 -1
- package/package.json +43 -12
- package/src/css/formie-base.css +104 -1
- package/src/css/theme/_messages.css +2 -0
- package/src/css/theme/_tokens.css +31 -25
- package/src/css/theme/forms/_form.css +5 -1
- package/src/index.ts +13 -8
- package/src/js/contracts/client.ts +5 -3
- package/src/js/contracts/common.ts +5 -6
- package/src/js/contracts/modules.ts +41 -12
- package/src/js/contracts/schema.ts +21 -43
- package/src/js/contracts/theme.ts +6 -1
- package/src/js/core/client-rendered-modules.ts +69 -0
- package/src/js/core/create-formie-client.ts +116 -77
- package/src/js/core/field-error-aria.ts +93 -0
- package/src/js/core/hydrate-modules.ts +54 -29
- package/src/js/core/submit-result-state.ts +34 -45
- package/src/js/core/submit-result-ui.ts +21 -65
- package/src/js/core/validation-focus.ts +20 -20
- package/src/js/modules/address/address-finder.ts +1 -1
- package/src/js/modules/address/factories.ts +15 -13
- package/src/js/modules/address/google-address.ts +10 -6
- package/src/js/modules/address/index.ts +2 -2
- package/src/js/modules/address/loqate.ts +1 -1
- package/src/js/modules/address/place-kit.ts +1 -1
- package/src/js/modules/captchas/captcha-eu.ts +2 -2
- package/src/js/modules/captchas/factories.ts +66 -42
- package/src/js/modules/captchas/friendly-captcha-v1.ts +12 -2
- package/src/js/modules/captchas/friendly-captcha-v2.ts +4 -2
- package/src/js/modules/captchas/hcaptcha.ts +5 -5
- package/src/js/modules/captchas/index.ts +2 -2
- package/src/js/modules/captchas/recaptcha-enterprise.ts +2 -2
- package/src/js/modules/captchas/recaptcha-v2-checkbox.ts +3 -3
- package/src/js/modules/captchas/recaptcha-v2-invisible.ts +2 -2
- package/src/js/modules/captchas/recaptcha-v3.ts +2 -2
- package/src/js/modules/captchas/snaptcha.ts +1 -1
- package/src/js/modules/captchas/turnstile.ts +3 -3
- package/src/js/modules/fields/address-country.ts +6 -4
- package/src/js/modules/fields/address-state.ts +20 -12
- package/src/js/modules/fields/calculations.ts +5 -3
- package/src/js/modules/fields/checkbox-radio.ts +24 -42
- package/src/js/modules/fields/combobox.ts +25 -9
- package/src/js/modules/fields/conditions/config.ts +17 -20
- package/src/js/modules/fields/conditions/effects.ts +23 -26
- package/src/js/modules/fields/conditions/evaluator.ts +21 -29
- package/src/js/modules/fields/conditions/references.ts +16 -5
- package/src/js/modules/fields/conditions/submission-context.ts +80 -0
- package/src/js/modules/fields/conditions/types.ts +3 -1
- package/src/js/modules/fields/conditions/values.ts +31 -6
- package/src/js/modules/fields/conditions.ts +59 -18
- package/src/js/modules/fields/custom-google-maps.ts +5 -3
- package/src/js/modules/fields/custom-link.ts +5 -3
- package/src/js/modules/fields/custom-maps.ts +5 -3
- package/src/js/modules/fields/date-picker.ts +34 -4
- package/src/js/modules/fields/file-upload.ts +19 -10
- package/src/js/modules/fields/hidden.ts +5 -3
- package/src/js/modules/fields/index.ts +2 -2
- package/src/js/modules/fields/password-validation.ts +5 -3
- package/src/js/modules/fields/phone-country.ts +33 -6
- package/src/js/modules/fields/repeater.ts +5 -3
- package/src/js/modules/fields/rich-text.ts +20 -4
- package/src/js/modules/fields/shared.ts +13 -0
- package/src/js/modules/fields/signature.ts +24 -4
- package/src/js/modules/fields/summary.ts +8 -20
- package/src/js/modules/fields/survey-likert.ts +5 -3
- package/src/js/modules/fields/survey-rank.ts +21 -3
- package/src/js/modules/fields/survey-rating.ts +17 -3
- package/src/js/modules/fields/table.ts +5 -3
- package/src/js/modules/fields/text-limit.ts +5 -3
- package/src/js/modules/fields/upload-manager.ts +190 -49
- package/src/js/modules/loader.ts +345 -281
- package/src/js/modules/payments/bpoint.ts +2 -2
- package/src/js/modules/payments/eway.ts +2 -2
- package/src/js/modules/payments/factories.ts +53 -52
- package/src/js/modules/payments/go-cardless.ts +1 -1
- package/src/js/modules/payments/index.ts +2 -2
- package/src/js/modules/payments/mollie.ts +1 -1
- package/src/js/modules/payments/moneris.ts +2 -2
- package/src/js/modules/payments/opayo.ts +21 -8
- package/src/js/modules/payments/paddle.ts +10 -6
- package/src/js/modules/payments/payment.ts +22 -18
- package/src/js/modules/payments/paypal.ts +1 -1
- package/src/js/modules/payments/payway.ts +2 -2
- package/src/js/modules/payments/square.ts +2 -2
- package/src/js/modules/payments/stripe.ts +5 -5
- package/src/js/modules/payments/utils.ts +14 -0
- package/src/js/modules/registry.ts +19 -11
- package/src/js/submit/pipeline.ts +10 -11
- package/src/js/theme/browser-theme-state.generated.ts +25 -0
- package/src/js/theme/theme-classes.ts +3 -3
- package/src/js/transport/forms-api.ts +66 -67
- package/src/js/utils/country-from-ip.ts +14 -9
- package/src/js/utils/csrf.ts +136 -0
- package/src/js/utils/field-references.parser.ts +13 -113
- package/src/js/utils/field-references.resolver.ts +27 -64
- package/src/js/utils/field-references.row-scope.ts +1 -1
- package/src/js/utils/field-references.types.ts +1 -0
- package/src/js/utils/http.ts +5 -5
- package/src/js/utils/request-profile.ts +10 -0
- package/src/js/utils/unload-warning.ts +12 -4
- package/src/js/validation/rules/email.ts +3 -5
- package/src/js/validation/rules/match.ts +2 -1
- package/src/js/validation/rules/minmax.ts +4 -43
- package/src/js/validation/rules/number.ts +3 -47
- package/src/js/validation/rules/pattern.ts +3 -8
- package/src/js/validation/rules/required.ts +2 -1
- package/src/js/validation/rules/shared.ts +5 -1
- package/src/js/validation/rules/url.ts +3 -10
- package/src/js/validation/skip.ts +9 -0
- package/src/js/validation/submit-readiness.ts +9 -2
- package/src/js/validation/validator.ts +35 -59
- package/dist/chunks/calculations-Dv3hYb8_.js +0 -299
- package/dist/chunks/conditions-CPH1snCx.js +0 -424
- package/dist/chunks/country-from-ip-BwxKaBuJ.js +0 -26
- package/dist/chunks/field-references.resolver-CHwn0G0L.js +0 -145
- package/dist/chunks/friendly-captcha-v1-C_2reOXr.js +0 -31
- package/dist/chunks/google-address-BH3Zhi06.js +0 -161
- package/dist/chunks/http-D-JExro7.js +0 -27
- package/dist/chunks/opayo-CR0DtsLa.js +0 -179
- package/dist/chunks/rich-text-Bg_--4TG.js +0 -349
- package/dist/js/modules/fields/conditions/transforms.d.ts +0 -3
- package/dist/js/modules/fields/conditions/transforms.d.ts.map +0 -1
- package/src/js/modules/fields/conditions/transforms.ts +0 -206
- package/src/js/modules/payments/stub-payment-module.ts +0 -87
|
@@ -1,32 +1,38 @@
|
|
|
1
1
|
import { r as e } from "./event-names-BCI2FLD8.js";
|
|
2
2
|
//#region src/js/modules/fields/shared.ts
|
|
3
3
|
var t = (e) => e.replace(/["\\]/g, "\\$&"), n = /* @__PURE__ */ new WeakMap();
|
|
4
|
-
function r(e) {
|
|
5
|
-
|
|
4
|
+
function r(e, t) {
|
|
5
|
+
let n = e.getRootNode(), r = (n) => {
|
|
6
|
+
n.target instanceof Element && n.target.contains(e) && t();
|
|
7
|
+
};
|
|
8
|
+
return n.addEventListener("formie:field:clear", r), () => n.removeEventListener("formie:field:clear", r);
|
|
6
9
|
}
|
|
7
10
|
function i(e) {
|
|
8
|
-
return
|
|
11
|
+
return typeof window.CSS?.escape == "function" ? window.CSS.escape(e) : t(e);
|
|
9
12
|
}
|
|
10
13
|
function a(e) {
|
|
11
|
-
return
|
|
14
|
+
return e.target instanceof HTMLElement && e.target.hasAttribute("data-formie-field-handle") ? [e.target] : e.target instanceof HTMLElement ? Array.from(e.target.querySelectorAll("[data-formie-field-handle]")).filter((e) => e instanceof HTMLElement) : [];
|
|
12
15
|
}
|
|
13
16
|
function o(e) {
|
|
17
|
+
return a(e)[0] || null;
|
|
18
|
+
}
|
|
19
|
+
function s(e) {
|
|
14
20
|
return e && e.formieValidation || null;
|
|
15
21
|
}
|
|
16
|
-
function
|
|
22
|
+
function c(e, t, r) {
|
|
17
23
|
if (!e) return;
|
|
18
24
|
let i = n.get(e) || /* @__PURE__ */ new Map(), a = i.get(t) || 0;
|
|
19
25
|
if (a === 0) {
|
|
20
|
-
let t =
|
|
26
|
+
let t = s(e);
|
|
21
27
|
t && r(t);
|
|
22
28
|
}
|
|
23
29
|
i.set(t, a + 1), n.set(e, i);
|
|
24
30
|
}
|
|
25
|
-
function
|
|
31
|
+
function l(e, t, r) {
|
|
26
32
|
if (!e) return;
|
|
27
33
|
let i = n.get(e), a = i?.get(t) || 0;
|
|
28
34
|
if (a <= 1) {
|
|
29
|
-
let a =
|
|
35
|
+
let a = s(e);
|
|
30
36
|
if (r.forEach((e) => {
|
|
31
37
|
a?.removeValidator(e);
|
|
32
38
|
}), i?.delete(t), !i || i.size === 0) {
|
|
@@ -38,7 +44,7 @@ function c(e, t, r) {
|
|
|
38
44
|
}
|
|
39
45
|
i?.set(t, a - 1);
|
|
40
46
|
}
|
|
41
|
-
function
|
|
47
|
+
function u(e, t, n, r) {
|
|
42
48
|
let i = /* @__PURE__ */ new Map(), a = (e) => {
|
|
43
49
|
if (!n(e) || i.has(e)) return;
|
|
44
50
|
let t = r(e);
|
|
@@ -69,27 +75,27 @@ function l(e, t, n, r) {
|
|
|
69
75
|
}), i.clear();
|
|
70
76
|
};
|
|
71
77
|
}
|
|
72
|
-
function
|
|
78
|
+
function d(e) {
|
|
73
79
|
return e.ownerDocument || document;
|
|
74
80
|
}
|
|
75
|
-
function
|
|
76
|
-
let n =
|
|
81
|
+
function f(e, t) {
|
|
82
|
+
let n = d(e);
|
|
77
83
|
if (t) {
|
|
78
|
-
let
|
|
79
|
-
e.querySelector(`template[data-formie-template-id="${
|
|
80
|
-
e.querySelector(`script[data-formie-template-id="${
|
|
81
|
-
n.querySelector(`template[data-formie-template-id="${
|
|
82
|
-
n.querySelector(`script[data-formie-template-id="${
|
|
84
|
+
let r = [
|
|
85
|
+
e.querySelector(`template[data-formie-template-id="${i(t)}"]`),
|
|
86
|
+
e.querySelector(`script[data-formie-template-id="${i(t)}"]`),
|
|
87
|
+
n.querySelector(`template[data-formie-template-id="${i(t)}"]`),
|
|
88
|
+
n.querySelector(`script[data-formie-template-id="${i(t)}"]`),
|
|
83
89
|
n.getElementById(t)
|
|
84
90
|
];
|
|
85
|
-
for (let e of
|
|
91
|
+
for (let e of r) if (e instanceof HTMLTemplateElement || e instanceof HTMLScriptElement) return e;
|
|
86
92
|
}
|
|
87
93
|
return null;
|
|
88
94
|
}
|
|
89
|
-
function
|
|
95
|
+
function p(e) {
|
|
90
96
|
return e instanceof HTMLTemplateElement ? e.innerHTML : e instanceof HTMLScriptElement ? e.textContent || "" : e.innerHTML;
|
|
91
97
|
}
|
|
92
|
-
function
|
|
98
|
+
function m(t, n, r, i) {
|
|
93
99
|
let a = e(n, r);
|
|
94
100
|
t.dispatchEvent(new CustomEvent(a, {
|
|
95
101
|
bubbles: !0,
|
|
@@ -97,4 +103,4 @@ function p(t, n, r, i) {
|
|
|
97
103
|
}));
|
|
98
104
|
}
|
|
99
105
|
//#endregion
|
|
100
|
-
export {
|
|
106
|
+
export { o as a, u as c, a as i, l, m as n, f as o, i as r, p as s, r as t, c as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./styles-BfoIZwJp.js";
|
|
2
|
-
import {
|
|
2
|
+
import { i as t, n, t as r } from "./shared-OKhSay59.js";
|
|
3
3
|
//#region ../../node_modules/signature_pad/dist/signature_pad.js
|
|
4
|
-
var
|
|
4
|
+
var i = class {
|
|
5
5
|
x;
|
|
6
6
|
y;
|
|
7
7
|
pressure;
|
|
@@ -19,28 +19,34 @@ var r = class {
|
|
|
19
19
|
velocityFrom(e) {
|
|
20
20
|
return this.time === e.time ? 0 : this.distanceTo(e) / (this.time - e.time);
|
|
21
21
|
}
|
|
22
|
-
},
|
|
22
|
+
}, a = class e {
|
|
23
23
|
constructor(e, t, n, r, i, a) {
|
|
24
24
|
this.startPoint = e, this.control2 = t, this.control1 = n, this.endPoint = r, this.startWidth = i, this.endWidth = a;
|
|
25
25
|
}
|
|
26
|
+
startPoint;
|
|
27
|
+
control2;
|
|
28
|
+
control1;
|
|
29
|
+
endPoint;
|
|
30
|
+
startWidth;
|
|
31
|
+
endWidth;
|
|
26
32
|
static fromPoints(t, n) {
|
|
27
33
|
let r = this.calculateControlPoints(t[0], t[1], t[2]).c2, i = this.calculateControlPoints(t[1], t[2], t[3]).c1;
|
|
28
34
|
return new e(t[1], r, i, t[2], n.start, n.end);
|
|
29
35
|
}
|
|
30
36
|
static calculateControlPoints(e, t, n) {
|
|
31
|
-
let
|
|
37
|
+
let r = e.x - t.x, a = e.y - t.y, o = t.x - n.x, s = t.y - n.y, c = {
|
|
32
38
|
x: (e.x + t.x) / 2,
|
|
33
39
|
y: (e.y + t.y) / 2
|
|
34
40
|
}, l = {
|
|
35
41
|
x: (t.x + n.x) / 2,
|
|
36
42
|
y: (t.y + n.y) / 2
|
|
37
|
-
}, u = Math.sqrt(
|
|
43
|
+
}, u = Math.sqrt(r * r + a * a), d = Math.sqrt(o * o + s * s), f = c.x - l.x, p = c.y - l.y, m = u + d == 0 ? 0 : d / (u + d), h = {
|
|
38
44
|
x: l.x + f * m,
|
|
39
45
|
y: l.y + p * m
|
|
40
46
|
}, g = t.x - h.x, _ = t.y - h.y;
|
|
41
47
|
return {
|
|
42
|
-
c1: new
|
|
43
|
-
c2: new
|
|
48
|
+
c1: new i(c.x + g, c.y + _),
|
|
49
|
+
c2: new i(l.x + g, l.y + _)
|
|
44
50
|
};
|
|
45
51
|
}
|
|
46
52
|
length() {
|
|
@@ -58,7 +64,7 @@ var r = class {
|
|
|
58
64
|
point(e, t, n, r, i) {
|
|
59
65
|
return t * (1 - e) * (1 - e) * (1 - e) + 3 * n * (1 - e) * (1 - e) * e + 3 * r * (1 - e) * e * e + i * e * e * e;
|
|
60
66
|
}
|
|
61
|
-
},
|
|
67
|
+
}, o = class {
|
|
62
68
|
_et;
|
|
63
69
|
constructor() {
|
|
64
70
|
try {
|
|
@@ -77,7 +83,7 @@ var r = class {
|
|
|
77
83
|
this._et.removeEventListener(e, t, n);
|
|
78
84
|
}
|
|
79
85
|
};
|
|
80
|
-
function
|
|
86
|
+
function s(e, t = 250) {
|
|
81
87
|
let n = 0, r = null, i, a, o, s = () => {
|
|
82
88
|
n = Date.now(), r = null, i = e.apply(a, o), r || (a = null, o = []);
|
|
83
89
|
};
|
|
@@ -86,10 +92,11 @@ function o(e, t = 250) {
|
|
|
86
92
|
return a = this, o = c, u <= 0 || u > t ? (r &&= (clearTimeout(r), null), n = l, i = e.apply(a, o), r || (a = null, o = [])) : r ||= window.setTimeout(s, u), i;
|
|
87
93
|
};
|
|
88
94
|
}
|
|
89
|
-
var
|
|
95
|
+
var c = class e extends o {
|
|
90
96
|
constructor(t, n = {}) {
|
|
91
|
-
super(), this.canvas = t, this.velocityFilterWeight = n.velocityFilterWeight || .7, this.minWidth = n.minWidth || .5, this.maxWidth = n.maxWidth || 2.5, this.throttle = n.throttle ?? 16, this.minDistance = n.minDistance ?? 5, this.dotSize = n.dotSize || 0, this.penColor = n.penColor || "black", this.backgroundColor = n.backgroundColor || "rgba(0,0,0,0)", this.compositeOperation = n.compositeOperation || "source-over", this.canvasContextOptions = n.canvasContextOptions ?? {}, this._strokeMoveUpdate = this.throttle ?
|
|
97
|
+
super(), this.canvas = t, this.velocityFilterWeight = n.velocityFilterWeight || .7, this.minWidth = n.minWidth || .5, this.maxWidth = n.maxWidth || 2.5, this.throttle = n.throttle ?? 16, this.minDistance = n.minDistance ?? 5, this.dotSize = n.dotSize || 0, this.penColor = n.penColor || "black", this.backgroundColor = n.backgroundColor || "rgba(0,0,0,0)", this.compositeOperation = n.compositeOperation || "source-over", this.canvasContextOptions = n.canvasContextOptions ?? {}, this._strokeMoveUpdate = this.throttle ? s(e.prototype._strokeUpdate, this.throttle) : e.prototype._strokeUpdate, this._handleMouseDown = this._handleMouseDown.bind(this), this._handleMouseMove = this._handleMouseMove.bind(this), this._handleMouseUp = this._handleMouseUp.bind(this), this._handleTouchStart = this._handleTouchStart.bind(this), this._handleTouchMove = this._handleTouchMove.bind(this), this._handleTouchEnd = this._handleTouchEnd.bind(this), this._handlePointerDown = this._handlePointerDown.bind(this), this._handlePointerMove = this._handlePointerMove.bind(this), this._handlePointerUp = this._handlePointerUp.bind(this), this._handlePointerCancel = this._handlePointerCancel.bind(this), this._handleTouchCancel = this._handleTouchCancel.bind(this), this._ctx = t.getContext("2d", this.canvasContextOptions), this.clear(), this.on();
|
|
92
98
|
}
|
|
99
|
+
canvas;
|
|
93
100
|
dotSize;
|
|
94
101
|
minWidth;
|
|
95
102
|
maxWidth;
|
|
@@ -158,7 +165,7 @@ var s = class e extends a {
|
|
|
158
165
|
return this._isEmpty;
|
|
159
166
|
}
|
|
160
167
|
fromData(e, { clear: t = !0 } = {}) {
|
|
161
|
-
t && this.clear(), this._fromData(e, this._drawCurve.bind(this), this._drawDot.bind(this)), this._data = this._data.concat(e);
|
|
168
|
+
t && this.clear(), this._fromData(e, this._drawCurve.bind(this), this._drawDot.bind(this), this._drawLine.bind(this)), this._data = this._data.concat(e);
|
|
162
169
|
}
|
|
163
170
|
toData() {
|
|
164
171
|
return this._data;
|
|
@@ -186,7 +193,7 @@ var s = class e extends a {
|
|
|
186
193
|
};
|
|
187
194
|
}
|
|
188
195
|
_handleMouseDown(e) {
|
|
189
|
-
|
|
196
|
+
this._isLeftButtonPressed(e, !0) && !this._drawingStroke && this._strokeBegin(this._pointerEventToSignatureEvent(e));
|
|
190
197
|
}
|
|
191
198
|
_handleMouseMove(e) {
|
|
192
199
|
if (!this._isLeftButtonPressed(e, !0) || !this._drawingStroke) {
|
|
@@ -226,7 +233,7 @@ var s = class e extends a {
|
|
|
226
233
|
return this._strokePointerId === void 0 ? t : this._getPointerId(e) === this._strokePointerId;
|
|
227
234
|
}
|
|
228
235
|
_handlePointerDown(e) {
|
|
229
|
-
this._drawingStroke
|
|
236
|
+
!this._drawingStroke && this._isLeftButtonPressed(e) && this._allowPointerId(e, !0) && (this._strokePointerId = this._getPointerId(e), e.preventDefault(), this._strokeBegin(this._pointerEventToSignatureEvent(e)));
|
|
230
237
|
}
|
|
231
238
|
_handlePointerMove(e) {
|
|
232
239
|
if (this._allowPointerId(e)) {
|
|
@@ -238,7 +245,7 @@ var s = class e extends a {
|
|
|
238
245
|
}
|
|
239
246
|
}
|
|
240
247
|
_handlePointerUp(e) {
|
|
241
|
-
this._isLeftButtonPressed(e)
|
|
248
|
+
!this._isLeftButtonPressed(e) && this._allowPointerId(e) && (e.preventDefault(), this._strokeEnd(this._pointerEventToSignatureEvent(e)));
|
|
242
249
|
}
|
|
243
250
|
_getPointGroupOptions(e) {
|
|
244
251
|
return {
|
|
@@ -263,10 +270,7 @@ var s = class e extends a {
|
|
|
263
270
|
case "touchstart":
|
|
264
271
|
t("touchmove", this._handleTouchMove, { passive: !1 }), t("touchend", this._handleTouchEnd, { passive: !1 }), t("touchcancel", this._handleTouchCancel, { passive: !1 });
|
|
265
272
|
break;
|
|
266
|
-
case "pointerdown":
|
|
267
|
-
t("pointermove", this._handlePointerMove, { passive: !1 }), t("pointerup", this._handlePointerUp, { passive: !1 }), t("pointercancel", this._handlePointerCancel, { passive: !1 });
|
|
268
|
-
break;
|
|
269
|
-
default:
|
|
273
|
+
case "pointerdown": t("pointermove", this._handlePointerMove, { passive: !1 }), t("pointerup", this._handlePointerUp, { passive: !1 }), t("pointercancel", this._handlePointerCancel, { passive: !1 });
|
|
270
274
|
}
|
|
271
275
|
this._drawingStroke = !0;
|
|
272
276
|
let n = this._getPointGroupOptions(), r = {
|
|
@@ -310,14 +314,14 @@ var s = class e extends a {
|
|
|
310
314
|
this._lastPoints = [], this._lastVelocity = 0, this._lastWidth = (e.minWidth + e.maxWidth) / 2, this._ctx.fillStyle = e.penColor, this._ctx.globalCompositeOperation = e.compositeOperation;
|
|
311
315
|
}
|
|
312
316
|
_createPoint(e, t, n) {
|
|
313
|
-
let
|
|
314
|
-
return new
|
|
317
|
+
let r = this.canvas.getBoundingClientRect();
|
|
318
|
+
return new i(e - r.left, t - r.top, n, (/* @__PURE__ */ new Date()).getTime());
|
|
315
319
|
}
|
|
316
320
|
_addPoint(e, t) {
|
|
317
321
|
let { _lastPoints: n } = this;
|
|
318
322
|
if (n.push(e), n.length > 2) {
|
|
319
323
|
n.length === 3 && n.unshift(n[0]);
|
|
320
|
-
let e = this._calculateCurveWidths(n[1], n[2], t), r =
|
|
324
|
+
let e = this._calculateCurveWidths(n[1], n[2], t), r = a.fromPoints(n, e);
|
|
321
325
|
return n.shift(), r;
|
|
322
326
|
}
|
|
323
327
|
return null;
|
|
@@ -349,20 +353,27 @@ var s = class e extends a {
|
|
|
349
353
|
}
|
|
350
354
|
n.closePath(), n.fill();
|
|
351
355
|
}
|
|
356
|
+
_getDotSize(e) {
|
|
357
|
+
return e.dotSize > 0 ? e.dotSize : (e.minWidth + e.maxWidth) / 2;
|
|
358
|
+
}
|
|
352
359
|
_drawDot(e, t) {
|
|
353
|
-
let n = this._ctx, r =
|
|
360
|
+
let n = this._ctx, r = this._getDotSize(t);
|
|
354
361
|
n.beginPath(), this._drawCurveSegment(e.x, e.y, r), n.closePath(), n.fillStyle = t.penColor, n.fill();
|
|
355
362
|
}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
363
|
+
_drawLine(e, t, n) {
|
|
364
|
+
let r = this._ctx;
|
|
365
|
+
r.save(), r.beginPath(), r.moveTo(e.x, e.y), r.lineTo(t.x, t.y), r.lineWidth = this._getDotSize(n) * 2, r.lineCap = "round", r.strokeStyle = n.penColor, r.stroke(), r.restore(), this._isEmpty = !1;
|
|
366
|
+
}
|
|
367
|
+
_fromData(e, t, n, r) {
|
|
368
|
+
for (let a of e) {
|
|
369
|
+
let { points: e } = a, o = this._getPointGroupOptions(a);
|
|
370
|
+
if (e.length > 2) for (let n = 0; n < e.length; n += 1) {
|
|
371
|
+
let r = e[n], a = new i(r.x, r.y, r.pressure, r.time);
|
|
372
|
+
n === 0 && this._reset(o);
|
|
373
|
+
let s = this._addPoint(a, o);
|
|
374
|
+
s && t(s, o);
|
|
364
375
|
}
|
|
365
|
-
else this._reset(
|
|
376
|
+
else e.length === 2 ? (this._reset(o), r(e[0], e[1], o)) : (this._reset(o), n(e[0], o));
|
|
366
377
|
}
|
|
367
378
|
}
|
|
368
379
|
toSVG({ includeBackgroundColor: e = !1, includeDataUrl: t = !1 } = {}) {
|
|
@@ -384,39 +395,42 @@ var s = class e extends a {
|
|
|
384
395
|
}, (e, { penColor: t, dotSize: n, minWidth: r, maxWidth: i }) => {
|
|
385
396
|
let a = document.createElement("circle"), s = n > 0 ? n : (r + i) / 2;
|
|
386
397
|
a.setAttribute("r", s.toString()), a.setAttribute("cx", e.x.toString()), a.setAttribute("cy", e.y.toString()), a.setAttribute("fill", t), o.appendChild(a);
|
|
398
|
+
}, (e, t, n) => {
|
|
399
|
+
let r = document.createElement("line");
|
|
400
|
+
r.setAttribute("x1", e.x.toString()), r.setAttribute("y1", e.y.toString()), r.setAttribute("x2", t.x.toString()), r.setAttribute("y2", t.y.toString()), r.setAttribute("stroke", n.penColor), r.setAttribute("stroke-width", (this._getDotSize(n) * 2).toString()), r.setAttribute("stroke-linecap", "round"), o.appendChild(r);
|
|
387
401
|
}), o.outerHTML;
|
|
388
402
|
}
|
|
389
|
-
},
|
|
403
|
+
}, l = "@layer formie-theme{[data-formie-field-type=signature] .formie-field-control{transition:border-color .15s,box-shadow .15s,background-color .15s;position:relative}[data-formie-field-type=signature] .formie-field-control:focus-within .formie-signature-canvas{border-color:var(--formie-focus-ring-border-color);box-shadow:var(--formie-shadow-focus)}.formie-field-has-error[data-formie-field-type=signature] .formie-signature-canvas{border-color:var(--formie-color-danger)}.formie-field-has-error[data-formie-field-type=signature] .formie-field-control:focus-within .formie-signature-canvas{box-shadow:var(--formie-shadow-danger-focus)}[data-formie-field-type=signature] .formie-signature-canvas{width:var(--formie-signature-width);min-height:var(--formie-signature-height);border:var(--formie-signature-border);background:var(--formie-signature-background);border-radius:var(--formie-signature-border-radius);touch-action:none;height:auto;transition:border-color .15s,box-shadow .15s,background-color .15s;display:block}[data-formie-field-type=signature] .formie-signature-remove-button{top:var(--formie-signature-remove-button-top);right:var(--formie-signature-remove-button-right);transform:var(--formie-signature-remove-button-transform);font-size:0;line-height:0;position:absolute}[data-formie-field-type=signature] .formie-signature-pad{position:relative}[data-formie-field-type=signature] .formie-signature-message{padding:var(--formie-space-3);border:var(--formie-signature-border);border-radius:var(--formie-signature-border-radius);background:var(--formie-signature-background);color:var(--formie-color-text-muted);font-size:var(--formie-font-size-sm);line-height:var(--formie-line-height-base);margin:0}[data-formie-field-type=signature].formie-signature-has-message .formie-signature-canvas{display:none}}", u = "input[data-formie-signature-input]", d = "canvas[data-formie-signature-canvas]", f = "[data-formie-signature-clear]", p = "[data-formie-signature-message]", m = "signature", h = 20, g = 100, _ = [
|
|
390
404
|
"hidden",
|
|
391
405
|
"data-formie-conditionally-hidden",
|
|
392
406
|
"data-formie-page-hidden",
|
|
393
407
|
"data-formie-row-hidden"
|
|
394
408
|
];
|
|
395
|
-
e(
|
|
396
|
-
function
|
|
409
|
+
e(m, [l]);
|
|
410
|
+
function v(e) {
|
|
397
411
|
let t = e.getBoundingClientRect();
|
|
398
412
|
return {
|
|
399
413
|
width: Math.round(t.width),
|
|
400
414
|
height: Math.round(t.height)
|
|
401
415
|
};
|
|
402
416
|
}
|
|
403
|
-
function
|
|
417
|
+
function y() {
|
|
404
418
|
let e = document.createElement("canvas");
|
|
405
419
|
return typeof e.getContext == "function" && !!e.getContext("2d");
|
|
406
420
|
}
|
|
407
|
-
function
|
|
408
|
-
let t = e.querySelector(
|
|
421
|
+
function b(e) {
|
|
422
|
+
let t = e.querySelector(p);
|
|
409
423
|
return t instanceof HTMLElement ? t : null;
|
|
410
424
|
}
|
|
411
|
-
function
|
|
412
|
-
let t =
|
|
425
|
+
function x(e) {
|
|
426
|
+
let t = b(e);
|
|
413
427
|
return {
|
|
414
428
|
noCanvas: t?.dataset.formieSignatureMessageNoCanvas || "This browser does not support canvas, which is required for signatures.",
|
|
415
429
|
initFailed: t?.dataset.formieSignatureMessageInitFailed || "The signature pad could not be loaded. Try refreshing the page."
|
|
416
430
|
};
|
|
417
431
|
}
|
|
418
|
-
function
|
|
419
|
-
let r =
|
|
432
|
+
function S(e, t, n) {
|
|
433
|
+
let r = b(e);
|
|
420
434
|
if (r) {
|
|
421
435
|
if (n) {
|
|
422
436
|
r.textContent = n, r.hidden = !1, t.setAttribute("aria-hidden", "true"), e.classList.add("formie-signature-has-message");
|
|
@@ -425,10 +439,10 @@ function x(e, t, n) {
|
|
|
425
439
|
r.textContent = "", r.hidden = !0, t.removeAttribute("aria-hidden"), e.classList.remove("formie-signature-has-message");
|
|
426
440
|
}
|
|
427
441
|
}
|
|
428
|
-
function
|
|
442
|
+
function C(e) {
|
|
429
443
|
return !e.hasAttribute("hidden") && !e.hasAttribute("data-formie-conditionally-hidden") && !e.hasAttribute("data-formie-page-hidden") && !e.hasAttribute("data-formie-row-hidden") && e.getClientRects().length > 0;
|
|
430
444
|
}
|
|
431
|
-
function
|
|
445
|
+
function w(e, t) {
|
|
432
446
|
if (!t) return;
|
|
433
447
|
let n = new Image();
|
|
434
448
|
n.src = t, n.onload = () => {
|
|
@@ -436,7 +450,7 @@ function C(e, t) {
|
|
|
436
450
|
r && r.drawImage(n, 0, 0, e.width / t, e.height / t);
|
|
437
451
|
};
|
|
438
452
|
}
|
|
439
|
-
function
|
|
453
|
+
function T(e) {
|
|
440
454
|
return new Promise((t) => {
|
|
441
455
|
let n = new Image();
|
|
442
456
|
n.onload = () => {
|
|
@@ -447,105 +461,117 @@ function w(e) {
|
|
|
447
461
|
}, n.onerror = () => t(null), n.src = e;
|
|
448
462
|
});
|
|
449
463
|
}
|
|
450
|
-
async function
|
|
451
|
-
let n = await
|
|
464
|
+
async function E(e, t) {
|
|
465
|
+
let n = await T(t);
|
|
452
466
|
if (!n?.width || !n?.height) return;
|
|
453
|
-
let { width: r } =
|
|
467
|
+
let { width: r } = v(e);
|
|
454
468
|
if (!(r > 0)) return;
|
|
455
469
|
let i = Math.max(1, Math.round(r * (n.height / n.width)));
|
|
456
470
|
e.style.height = `${i}px`;
|
|
457
471
|
}
|
|
458
|
-
async function
|
|
472
|
+
async function D(e, t, n) {
|
|
459
473
|
if (n) {
|
|
460
|
-
await
|
|
474
|
+
await E(t, n);
|
|
461
475
|
try {
|
|
462
476
|
await e.fromDataURL(n);
|
|
463
477
|
} catch {
|
|
464
|
-
|
|
478
|
+
w(t, n);
|
|
465
479
|
}
|
|
466
480
|
}
|
|
467
481
|
}
|
|
468
|
-
function
|
|
469
|
-
let
|
|
470
|
-
if (!
|
|
471
|
-
let
|
|
472
|
-
backgroundColor:
|
|
473
|
-
penColor:
|
|
474
|
-
dotSize:
|
|
475
|
-
minWidth:
|
|
476
|
-
maxWidth:
|
|
477
|
-
}),
|
|
478
|
-
|
|
479
|
-
}, O = () => {
|
|
480
|
-
y || (y = !0, C = !1, x(t, i, null), n(t, p, "init", { signature: w }));
|
|
481
|
-
}, k = () => {
|
|
482
|
-
y || C || (C = !0, x(t, i, c.initFailed));
|
|
483
|
-
}, A = async () => {
|
|
484
|
-
let e = r.value || (w.isEmpty() ? "" : w.toDataURL());
|
|
485
|
-
e && await T(i, e);
|
|
486
|
-
let { width: t, height: n } = _(i);
|
|
487
|
-
if (!(t > 0) || !(n > 0)) return !1;
|
|
488
|
-
let a = Math.max(window.devicePixelRatio || 1, 1), o = i.getContext("2d");
|
|
489
|
-
return o ? (i.width = t * a, i.height = n * a, o.setTransform(1, 0, 0, 1, 0, 0), o.scale(a, a), w.clear(), await E(w, i, e), O(), !0) : !1;
|
|
482
|
+
function O(e, t, i, a, o, s) {
|
|
483
|
+
let l = i.value, u = i.form, d = x(t);
|
|
484
|
+
if (!y()) return S(t, a, d.noCanvas), () => {};
|
|
485
|
+
let f = parseFloat(s.penWeight || "2") || 2, p = a.parentElement instanceof HTMLElement ? a.parentElement : t, b = 0, w = null, T = !1, O = !1, k = new c(a, {
|
|
486
|
+
backgroundColor: s.backgroundColor || "rgba(255, 255, 255, 0)",
|
|
487
|
+
penColor: s.penColor || "#000000",
|
|
488
|
+
dotSize: f,
|
|
489
|
+
minWidth: f,
|
|
490
|
+
maxWidth: f
|
|
491
|
+
}), A = () => {
|
|
492
|
+
w !== null && (window.clearTimeout(w), w = null);
|
|
490
493
|
}, j = () => {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
+
T || (T = !0, O = !1, S(t, a, null), n(t, m, "init", { signature: k }));
|
|
495
|
+
}, M = () => {
|
|
496
|
+
T || O || (O = !0, S(t, a, d.initFailed));
|
|
497
|
+
}, N = async () => {
|
|
498
|
+
let e = i.value || (k.isEmpty() ? "" : k.toDataURL());
|
|
499
|
+
e && await E(a, e);
|
|
500
|
+
let { width: t, height: n } = v(a);
|
|
501
|
+
if (!(t > 0) || !(n > 0)) return !1;
|
|
502
|
+
let r = Math.max(window.devicePixelRatio || 1, 1), o = a.getContext("2d");
|
|
503
|
+
return o ? (a.width = t * r, a.height = n * r, o.setTransform(1, 0, 0, 1, 0, 0), o.scale(r, r), k.clear(), await D(k, a, e), j(), !0) : !1;
|
|
504
|
+
}, P = () => {
|
|
505
|
+
if (!(T || O)) {
|
|
506
|
+
if (b >= h) {
|
|
507
|
+
M();
|
|
494
508
|
return;
|
|
495
509
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
},
|
|
510
|
+
A(), w = window.setTimeout(() => {
|
|
511
|
+
w = null, b += 1, F();
|
|
512
|
+
}, g);
|
|
499
513
|
}
|
|
500
|
-
},
|
|
501
|
-
if (!await
|
|
502
|
-
|
|
514
|
+
}, F = async () => {
|
|
515
|
+
if (!await N()) {
|
|
516
|
+
P();
|
|
503
517
|
return;
|
|
504
518
|
}
|
|
505
|
-
|
|
506
|
-
},
|
|
519
|
+
A(), b = 0;
|
|
520
|
+
}, I = (e = 0) => {
|
|
507
521
|
window.setTimeout(() => {
|
|
508
522
|
window.requestAnimationFrame(() => {
|
|
509
|
-
|
|
523
|
+
F();
|
|
510
524
|
});
|
|
511
525
|
}, e);
|
|
512
|
-
}, P = () => {
|
|
513
|
-
S(t) && !y && (C = !1), N();
|
|
514
|
-
}, F = () => {
|
|
515
|
-
P();
|
|
516
|
-
}, I = () => {
|
|
517
|
-
S(t) && (d = 0, C = !1, N(100));
|
|
518
526
|
}, L = () => {
|
|
519
|
-
|
|
520
|
-
}, R =
|
|
521
|
-
|
|
522
|
-
}
|
|
527
|
+
C(t) && !T && (O = !1), I();
|
|
528
|
+
}, R = () => {
|
|
529
|
+
L();
|
|
530
|
+
}, z = () => {
|
|
531
|
+
C(t) && (b = 0, O = !1, I(100));
|
|
532
|
+
}, B = () => {
|
|
533
|
+
C(t) && (b = 0, O = !1, L());
|
|
534
|
+
}, V = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
|
|
523
535
|
L();
|
|
524
|
-
}),
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
},
|
|
530
|
-
|
|
536
|
+
}), H = new MutationObserver(() => {
|
|
537
|
+
B();
|
|
538
|
+
}), U = (e) => {
|
|
539
|
+
let t = i.value !== e;
|
|
540
|
+
i.value = e, t && (i.dispatchEvent(new Event("input", { bubbles: !0 })), i.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
541
|
+
}, W = () => {
|
|
542
|
+
U(k.isEmpty() ? "" : k.toDataURL());
|
|
543
|
+
}, G = () => {
|
|
544
|
+
k.clear(), U("");
|
|
545
|
+
}, K = (e) => {
|
|
546
|
+
queueMicrotask(() => {
|
|
547
|
+
e.defaultPrevented || (k.clear(), U(l), D(k, a, l));
|
|
548
|
+
});
|
|
531
549
|
};
|
|
532
|
-
|
|
550
|
+
u?.addEventListener("reset", K);
|
|
551
|
+
let q = r(i, G);
|
|
552
|
+
return k.addEventListener("endStroke", W), window.addEventListener("resize", R), e.addEventListener("formie:page:navigate:after", z), V?.observe(p), H.observe(t, {
|
|
533
553
|
attributes: !0,
|
|
534
|
-
attributeFilter: [...
|
|
535
|
-
}),
|
|
536
|
-
|
|
554
|
+
attributeFilter: [..._]
|
|
555
|
+
}), I(), o && o.addEventListener("click", G), () => {
|
|
556
|
+
A(), q(), u?.removeEventListener("reset", K), k.removeEventListener("endStroke", W), window.removeEventListener("resize", R), e.removeEventListener("formie:page:navigate:after", z), V?.disconnect(), H.disconnect(), o && o.removeEventListener("click", G), k.clear();
|
|
537
557
|
};
|
|
538
558
|
}
|
|
539
|
-
var
|
|
540
|
-
|
|
559
|
+
var k = {
|
|
560
|
+
moduleId: `formie:${m}`,
|
|
561
|
+
version: 2,
|
|
562
|
+
surfaces: [
|
|
563
|
+
"server-rendered",
|
|
564
|
+
"client-rendered",
|
|
565
|
+
"cp-edit"
|
|
566
|
+
],
|
|
541
567
|
kind: "field",
|
|
542
|
-
match: (e) => !!e.target.querySelector(
|
|
568
|
+
match: (e) => !!e.target.querySelector(d),
|
|
543
569
|
setup: async (e) => {
|
|
544
570
|
let n = e.options || {}, r = e.root instanceof HTMLElement ? e.root : e.target instanceof HTMLElement ? e.target : null;
|
|
545
571
|
if (!r) return;
|
|
546
572
|
let i = t(e).map((e) => {
|
|
547
|
-
let t = e.querySelector(
|
|
548
|
-
return !(t instanceof HTMLInputElement) || !(i instanceof HTMLCanvasElement) ? () => {} :
|
|
573
|
+
let t = e.querySelector(u), i = e.querySelector(d), a = e.querySelector(f);
|
|
574
|
+
return !(t instanceof HTMLInputElement) || !(i instanceof HTMLCanvasElement) ? () => {} : O(r, e, t, i, a instanceof HTMLElement ? a : null, n);
|
|
549
575
|
});
|
|
550
576
|
return await e.emit("formie:module:signature:init", { count: i.length }), { destroy: () => {
|
|
551
577
|
i.forEach((e) => {
|
|
@@ -555,4 +581,4 @@ var O = {
|
|
|
555
581
|
}
|
|
556
582
|
};
|
|
557
583
|
//#endregion
|
|
558
|
-
export {
|
|
584
|
+
export { k as signatureModule };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as e } from "./api-
|
|
1
|
+
import { n as e } from "./api-DYYsVIub.js";
|
|
2
2
|
//#region src/js/modules/captchas/snaptcha.ts
|
|
3
3
|
var t = e({
|
|
4
|
-
|
|
4
|
+
moduleId: "formie:snaptcha",
|
|
5
5
|
defaultPlaceholderSelector: "[data-snaptcha-captcha-placeholder]"
|
|
6
6
|
});
|
|
7
7
|
//#endregion
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { t as e } from "./api-
|
|
1
|
+
import { t as e } from "./api-D6kJ7kXZ.js";
|
|
2
2
|
import { r as t } from "./scripts-CbQ7agX3.js";
|
|
3
3
|
//#region src/js/modules/payments/square.ts
|
|
4
4
|
var n = "FORMIE_SQUARE_SCRIPT", r = e({
|
|
5
|
-
|
|
5
|
+
moduleId: "formie:square",
|
|
6
6
|
defaultRequiredInputSuffixes: ["squarePaymentId"],
|
|
7
7
|
load: async (e) => {
|
|
8
8
|
let { provider: r } = e.options, i = r.applicationId, a = r.locationId;
|
|
9
|
-
|
|
9
|
+
if (!i?.trim() || !a?.trim()) return console.error("[formie] Missing applicationId or locationId for Square."), null;
|
|
10
|
+
let o = r.environment === "sandbox" ? "https://sandbox.web.squarecdn.com/v1/square.js" : "https://web.squarecdn.com/v1/square.js";
|
|
11
|
+
return await t("Square", {
|
|
10
12
|
id: n,
|
|
11
|
-
src:
|
|
12
|
-
}), window.Square
|
|
13
|
+
src: o
|
|
14
|
+
}), window.Square;
|
|
13
15
|
},
|
|
14
16
|
mount: async (e) => {
|
|
15
17
|
let { api: t, field: n, services: r, options: i } = e, a = i.provider, o = n.querySelector("[data-formie-square-button]");
|
|
@@ -22,7 +24,7 @@ var n = "FORMIE_SQUARE_SCRIPT", r = e({
|
|
|
22
24
|
}
|
|
23
25
|
},
|
|
24
26
|
unmount: async () => {},
|
|
25
|
-
|
|
27
|
+
onBeforePayment: async (e) => {
|
|
26
28
|
let { widget: t, services: n } = e;
|
|
27
29
|
if (!t) return n.addError("Square card is not ready."), !1;
|
|
28
30
|
try {
|