@zonos/elements 1.5.1 → 1.5.3
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/dist/cjs/_isBigCommerceNativeCheckout-3-xbKbAO.js +133 -0
- package/dist/cjs/{cart-CiXlehwQ.js → cart-C39TMSgB.js} +27 -13
- package/dist/cjs/{collect-Drr8fY-q.js → collect-lF9DenLk.js} +4 -4
- package/dist/cjs/{getMissingRequiredShippingFields-DI6qF1z3.js → getMissingRequiredShippingFields-svcnpumn.js} +1 -1
- package/dist/cjs/{handleFetch-DQLhurnE.js → handleFetch-DVfjFTYO.js} +181 -71
- package/dist/cjs/{hasInclusivePrice-84KS94yH.js → hasInclusivePrice-CEPf3_FG.js} +1 -1
- package/dist/cjs/index.cjs.js +158 -47
- package/dist/cjs/{invoice-5hVfSXpb.js → invoice-BD3pCr8P.js} +3 -3
- package/dist/cjs/{localization-B2mjW0Xa.js → localization-BhNVhLZs.js} +24 -48
- package/dist/cjs/{paypal-pd8Nz_R_.js → paypal-Bd1qmwiv.js} +4 -4
- package/dist/cjs/{placeTestOrder-DrI8rD9o.js → placeTestOrder-BMQRvX2q.js} +3 -3
- package/dist/cjs/{renderCheckoutCurrency-u5q8YdUb.js → renderCheckoutCurrency-DE2p8CT8.js} +2 -2
- package/dist/cjs/{shouldShowLanguageSelect-gBg4KeTQ.js → shouldShowLanguageSelect-NOVWOU53.js} +1 -1
- package/dist/cjs/{submitGtag-Rc-S3PnH.js → submitGtag-D4sB7w4z.js} +1 -1
- package/dist/cjs/{taxIdFields-BrIaPTcd.js → taxIdFields-BKbk2bhi.js} +2 -2
- package/dist/cjs/{updateCheckoutSessionAttributes-d0IKpwW8.js → updateCheckoutSessionAttributes-KxwcsKhM.js} +1 -1
- package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +6 -6
- package/dist/cjs/zonos-address-display_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-address_4.cjs.entry.js +4 -4
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +4 -4
- package/dist/cjs/zonos-card_5.cjs.entry.js +5 -5
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +18 -18
- package/dist/cjs/zonos-checkout.cjs.entry.js +48 -22
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +9 -9
- package/dist/cjs/zonos-collect.cjs.entry.js +6 -6
- package/dist/cjs/zonos-controller.cjs.entry.js +65 -40
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +9 -9
- package/dist/cjs/zonos-invoice.cjs.entry.js +6 -6
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +8 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +14 -4
- package/dist/collection/components/main/mountCheckoutWithoutStripe.js +12 -0
- package/dist/collection/components/main/zonos-controller.js +26 -10
- package/dist/collection/components/store/checkout/cart.js +3 -2
- package/dist/collection/components/store/checkout/stripe.js +23 -10
- package/dist/collection/components/store/storageStore.js +7 -6
- package/dist/collection/components/utils/__tests__/helpers/blockStorage.js +24 -0
- package/dist/collection/components/utils/api/getExchangeRate.js +2 -1
- package/dist/collection/components/utils/checkout/isBigCommerceCheckoutBypassEnabled.js +2 -1
- package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +32 -12
- package/dist/collection/components/utils/handleFetch.js +19 -9
- package/dist/collection/components/utils/hello/countryOverrideStorage.js +17 -40
- package/dist/collection/components/utils/logging/installConstructorCapture.js +58 -0
- package/dist/collection/components/utils/logging/reportBlockedStorage.js +34 -0
- package/dist/collection/components/utils/logging/sendErrorLog.js +8 -1
- package/dist/collection/components/utils/logging/startZonosInit.js +35 -0
- package/dist/collection/components/utils/logging/thrownMessage.js +16 -0
- package/dist/collection/components/utils/safeStorage.js +39 -0
- package/dist/collection/scripts/_bigcommerceCheckoutPath.js +16 -0
- package/dist/collection/scripts/_detectBigCommerceHost.js +12 -0
- package/dist/collection/scripts/_getZonosQaUrl.js +3 -2
- package/dist/collection/scripts/_isBigCommerceNativeCheckout.js +107 -0
- package/dist/collection/scripts/_loadStripe.js +15 -4
- package/dist/collection/scripts/_zonosBase.js +46 -33
- package/dist/collection/types/generated/graphql.frontend.types.js +0 -16
- package/dist/collection/types/generated/graphql.internal.types.js +215 -1
- package/dist/esm/_isBigCommerceNativeCheckout-Bb90IMVt.js +128 -0
- package/dist/esm/{cart-DmJkjiDE.js → cart-b84n0nhi.js} +26 -14
- package/dist/esm/{collect-BV5GTPmh.js → collect-B_AEVONL.js} +4 -4
- package/dist/esm/{getMissingRequiredShippingFields-DljgpDZe.js → getMissingRequiredShippingFields-EY10c34-.js} +1 -1
- package/dist/esm/{handleFetch-D5GYDF-O.js → handleFetch-BFVO7oAR.js} +178 -72
- package/dist/esm/{hasInclusivePrice-DhGXpH2D.js → hasInclusivePrice-DfEiyzw7.js} +1 -1
- package/dist/esm/index.js +158 -47
- package/dist/esm/{invoice-CO-iqlni.js → invoice-dQ0ONK5Q.js} +3 -3
- package/dist/esm/{localization-DHM91diu.js → localization-B5CRzthT.js} +25 -49
- package/dist/esm/{paypal-BfW5aLJw.js → paypal-CF_oM0B6.js} +4 -4
- package/dist/esm/{placeTestOrder-CyWUFhxD.js → placeTestOrder-BTpfyqPL.js} +3 -3
- package/dist/esm/{renderCheckoutCurrency-B31ZNkUv.js → renderCheckoutCurrency-CpeuDWx-.js} +2 -2
- package/dist/esm/{shouldShowLanguageSelect-DwSfSHar.js → shouldShowLanguageSelect-CJinx9-m.js} +1 -1
- package/dist/esm/{submitGtag-BEFrutel.js → submitGtag-C5xzFHjG.js} +1 -1
- package/dist/esm/{taxIdFields-ByEYfsO5.js → taxIdFields-BCyXnc9O.js} +2 -2
- package/dist/esm/{updateCheckoutSessionAttributes-B0bQH0uw.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
- package/dist/esm/zonos-address-completion-dialog_7.entry.js +6 -6
- package/dist/esm/zonos-address-display_2.entry.js +2 -2
- package/dist/esm/zonos-address_4.entry.js +4 -4
- package/dist/esm/zonos-airwallex-payment.entry.js +4 -4
- package/dist/esm/zonos-card_5.entry.js +5 -5
- package/dist/esm/zonos-cart-items_12.entry.js +18 -18
- package/dist/esm/zonos-checkout.entry.js +48 -22
- package/dist/esm/zonos-collect-cart-items_3.entry.js +3 -3
- package/dist/esm/zonos-collect-finish_6.entry.js +9 -9
- package/dist/esm/zonos-collect.entry.js +6 -6
- package/dist/esm/zonos-controller.entry.js +65 -40
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +3 -3
- package/dist/esm/zonos-hello-dialog.entry.js +3 -3
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +5 -5
- package/dist/esm/zonos-invoice-finish_5.entry.js +9 -9
- package/dist/esm/zonos-invoice.entry.js +6 -6
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-policy-consent_2.entry.js +4 -4
- package/dist/esm-es5/_isBigCommerceNativeCheckout-Bb90IMVt.js +40 -0
- package/dist/esm-es5/{cart-DmJkjiDE.js → cart-b84n0nhi.js} +59 -59
- package/dist/esm-es5/{collect-BV5GTPmh.js → collect-B_AEVONL.js} +2 -2
- package/dist/esm-es5/{getMissingRequiredShippingFields-DljgpDZe.js → getMissingRequiredShippingFields-EY10c34-.js} +3 -3
- package/dist/esm-es5/handleFetch-BFVO7oAR.js +73 -0
- package/dist/esm-es5/{hasInclusivePrice-DhGXpH2D.js → hasInclusivePrice-DfEiyzw7.js} +1 -1
- package/dist/esm-es5/index.js +94 -65
- package/dist/esm-es5/{invoice-CO-iqlni.js → invoice-dQ0ONK5Q.js} +1 -1
- package/dist/esm-es5/{localization-DHM91diu.js → localization-B5CRzthT.js} +7 -10
- package/dist/esm-es5/{paypal-BfW5aLJw.js → paypal-CF_oM0B6.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-CyWUFhxD.js → placeTestOrder-BTpfyqPL.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-B31ZNkUv.js → renderCheckoutCurrency-CpeuDWx-.js} +5 -5
- package/dist/esm-es5/{shouldShowLanguageSelect-DwSfSHar.js → shouldShowLanguageSelect-CJinx9-m.js} +1 -1
- package/dist/esm-es5/{submitGtag-BEFrutel.js → submitGtag-C5xzFHjG.js} +1 -1
- package/dist/esm-es5/{taxIdFields-ByEYfsO5.js → taxIdFields-BCyXnc9O.js} +1 -1
- package/dist/esm-es5/{updateCheckoutSessionAttributes-B0bQH0uw.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +2 -2
- package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +6 -6
- package/dist/esm-es5/zonos-cart-items_12.entry.js +127 -127
- package/dist/esm-es5/zonos-checkout.entry.js +22 -11
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +21 -12
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +3 -3
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +22 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/main/mountCheckoutWithoutStripe.d.ts +8 -0
- package/dist/types/components/store/checkout/stripe.d.ts +4 -1
- package/dist/types/components/utils/__tests__/helpers/blockStorage.d.ts +3 -0
- package/dist/types/components/utils/logging/installConstructorCapture.d.ts +20 -0
- package/dist/types/components/utils/logging/reportBlockedStorage.d.ts +16 -0
- package/dist/types/components/utils/logging/startZonosInit.d.ts +5 -0
- package/dist/types/components/utils/logging/thrownMessage.d.ts +1 -0
- package/dist/types/components/utils/safeStorage.d.ts +4 -0
- package/dist/types/scripts/_bigcommerceCheckoutPath.d.ts +12 -0
- package/dist/types/scripts/_detectBigCommerceHost.d.ts +5 -0
- package/dist/types/scripts/_isBigCommerceNativeCheckout.d.ts +21 -0
- package/dist/types/scripts/_zonosBase.d.ts +16 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +0 -22
- package/dist/types/types/generated/graphql.frontend.types.ts +0 -51
- package/dist/types/types/generated/graphql.internal.types.d.ts +270 -1
- package/dist/types/types/generated/graphql.internal.types.ts +341 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-8fa6cfff.entry.js → p-02faff47.entry.js} +1 -1
- package/dist/zonos-elements/{p-216a908d.system.entry.js → p-0c68cbbb.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-vTIygnHq.system.js → p-1OG3IJgY.system.js} +1 -1
- package/dist/zonos-elements/{p-960070d0.system.entry.js → p-1cd2d097.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-1e6db427.entry.js → p-255e411a.entry.js} +1 -1
- package/dist/zonos-elements/p-2c_UqKJL.system.js +7 -0
- package/dist/zonos-elements/{p-DprOoI2W.system.js → p-3AUMK-5E.system.js} +154 -154
- package/dist/zonos-elements/{p-d3345b2c.entry.js → p-3ee87d8b.entry.js} +1 -1
- package/dist/zonos-elements/{p-cccaad60.system.entry.js → p-42fa5694.system.entry.js} +10 -10
- package/dist/zonos-elements/p-49eaaab8.entry.js +1 -0
- package/dist/zonos-elements/{p-fda89981.system.entry.js → p-4ce4c49f.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-f3d9a380.system.entry.js → p-5622fc50.system.entry.js} +263 -252
- package/dist/zonos-elements/{p-5585db86.system.entry.js → p-59457fd9.system.entry.js} +73 -64
- package/dist/zonos-elements/{p-65817880.entry.js → p-66398133.entry.js} +1 -1
- package/dist/zonos-elements/{p-d8f375da.system.entry.js → p-674323ac.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-678b9214.entry.js → p-71d9a5b7.entry.js} +1 -1
- package/dist/zonos-elements/{p-189cc594.system.entry.js → p-81780f8f.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-6e691736.entry.js → p-821b83a2.entry.js} +1 -1
- package/dist/zonos-elements/{p-1fda4aec.system.entry.js → p-877a82d2.system.entry.js} +94 -94
- package/dist/zonos-elements/p-8daec112.entry.js +1 -0
- package/dist/zonos-elements/{p-46a839d2.system.entry.js → p-93bc75fd.system.entry.js} +13 -13
- package/dist/zonos-elements/{p-2ca826b9.system.entry.js → p-976b3bf3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-84e76348.entry.js → p-9a4947a5.entry.js} +1 -1
- package/dist/zonos-elements/p-9f7693bf.entry.js +1 -0
- package/dist/zonos-elements/p-BIJM2Kj-.js +1 -0
- package/dist/zonos-elements/p-BJFa5RwX.js +1 -0
- package/dist/zonos-elements/{p-6vSUiBfr.system.js → p-BOh4ifdL.system.js} +51 -54
- package/dist/zonos-elements/p-BZAX-HmS.js +1 -0
- package/dist/zonos-elements/p-Bb90IMVt.js +1 -0
- package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
- package/dist/zonos-elements/{p-CbhN65lj.system.js → p-BvoPE_nb.system.js} +1 -1
- package/dist/zonos-elements/{p-iAIzUA4k.js → p-C3E55OqH.js} +1 -1
- package/dist/zonos-elements/{p-CBUz18kA.system.js → p-C3gF3UV5.system.js} +23 -23
- package/dist/zonos-elements/{p-XoQH3S7Z.system.js → p-CD2ahEZn.system.js} +1 -1
- package/dist/zonos-elements/p-CEBBLbvF.js +1 -0
- package/dist/zonos-elements/{p-CGNVm52g.system.js → p-CEV0O_IQ.system.js} +5 -5
- package/dist/zonos-elements/{p-D1e9zNDA.js → p-CJmWr75U.js} +1 -1
- package/dist/zonos-elements/{p-DgUrB-1a.system.js → p-CZ-uYiCo.system.js} +1 -1
- package/dist/zonos-elements/p-Cn2xE-9t.system.js +256 -0
- package/dist/zonos-elements/p-CtvXi9wL.system.js +41 -0
- package/dist/zonos-elements/{p-BrQ8n8NS.system.js → p-Cw_Qnyow.system.js} +3 -3
- package/dist/zonos-elements/p-CzXNXgyI.js +1 -0
- package/dist/zonos-elements/p-D0DkOoAw.system.js +73 -0
- package/dist/zonos-elements/p-D9OPKqLg.js +1 -0
- package/dist/zonos-elements/{p-ojtNq-r5.system.js → p-DXlojp_Y.system.js} +1 -1
- package/dist/zonos-elements/{p-DpwmHU8R.js → p-Df62LRNs.js} +2 -2
- package/dist/zonos-elements/{p-CHKKvuiz.js → p-Lsqrpzc5.js} +1 -1
- package/dist/zonos-elements/{p-C9XLkmmb.system.js → p-YQFbWtjn.system.js} +1 -1
- package/dist/zonos-elements/p-a27f48e4.entry.js +1 -0
- package/dist/zonos-elements/{p-941a95a1.system.entry.js → p-a6bb296c.system.entry.js} +7 -7
- package/dist/zonos-elements/{p-2b63865a.system.entry.js → p-abb85879.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-12b24ebb.entry.js → p-b8653024.entry.js} +1 -1
- package/dist/zonos-elements/p-b9d7a3b6.entry.js +1 -0
- package/dist/zonos-elements/{p-f5f95990.system.entry.js → p-be067e12.system.entry.js} +15 -15
- package/dist/zonos-elements/p-bmrOH9oh.js +1 -0
- package/dist/zonos-elements/p-c185bc23.entry.js +1 -0
- package/dist/zonos-elements/{p-2d513aa3.entry.js → p-c6e78de2.entry.js} +1 -1
- package/dist/zonos-elements/{p-55813e9f.system.entry.js → p-ca97a1cd.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-3e705c9b.entry.js → p-cbb96382.entry.js} +1 -1
- package/dist/zonos-elements/{p-53eac12f.system.entry.js → p-dbf4d156.system.entry.js} +14 -14
- package/dist/zonos-elements/{p-6410fa11.system.entry.js → p-df240119.system.entry.js} +16 -16
- package/dist/zonos-elements/{p-1cc42a98.system.entry.js → p-e16e4db6.system.entry.js} +17 -17
- package/dist/zonos-elements/{p-064d8829.system.entry.js → p-eb016dd8.system.entry.js} +20 -20
- package/dist/zonos-elements/{p-1199baef.system.entry.js → p-eb5c67a0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ef5344ea.entry.js → p-ed8a7a7f.entry.js} +1 -1
- package/dist/zonos-elements/{p-4917b74d.entry.js → p-ef932fda.entry.js} +1 -1
- package/dist/zonos-elements/{p-e7fdb2c9.entry.js → p-f792ba5f.entry.js} +1 -1
- package/dist/zonos-elements/{p-DiMEP3mh.js → p-fZcKMzE-.js} +1 -1
- package/dist/zonos-elements/{p-CMo3ZweU.js → p-fdritVtG.js} +1 -1
- package/dist/zonos-elements/p-fffe6376.entry.js +1 -0
- package/dist/zonos-elements/p-gEViRqvf.js +1 -0
- package/dist/zonos-elements/{p-Dtu_Japy.system.js → p-v8IEjQ2z.system.js} +39 -39
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +10 -10
- package/dist/esm-es5/handleFetch-D5GYDF-O.js +0 -60
- package/dist/zonos-elements/p-107f287b.entry.js +0 -1
- package/dist/zonos-elements/p-25eb99d4.entry.js +0 -1
- package/dist/zonos-elements/p-46b9f0cf.entry.js +0 -1
- package/dist/zonos-elements/p-636b71d4.entry.js +0 -1
- package/dist/zonos-elements/p-7dc7f328.entry.js +0 -1
- package/dist/zonos-elements/p-8f9d8795.entry.js +0 -1
- package/dist/zonos-elements/p-BMPYH-LT.js +0 -1
- package/dist/zonos-elements/p-C70h5mKA.js +0 -1
- package/dist/zonos-elements/p-CTiqplrr.js +0 -1
- package/dist/zonos-elements/p-Ch1w0Lr7.js +0 -1
- package/dist/zonos-elements/p-D1SmY_fZ.js +0 -1
- package/dist/zonos-elements/p-D6xXnsM_.js +0 -1
- package/dist/zonos-elements/p-DE4a-QD5.js +0 -1
- package/dist/zonos-elements/p-DQrMfUzi.system.js +0 -227
- package/dist/zonos-elements/p-DZdkJHK9.system.js +0 -7
- package/dist/zonos-elements/p-U33isUJG.js +0 -1
- package/dist/zonos-elements/p-ebe157b5.entry.js +0 -1
- package/dist/zonos-elements/p-zVLAvre1.system.js +0 -60
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var t=function(n,e){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)if(Object.prototype.hasOwnProperty.call(n,e))t[e]=n[e]};return t(n,e)};return function(n,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t(n,e);function i(){this.constructor=n}n.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}();var __awaiter=this&&this.__awaiter||function(t,n,e,i){function o(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function u(t){try{c(i["throw"](t))}catch(t){r(t)}}function c(t){t.done?e(t.value):o(t.value).then(s,u)}c((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=u(0),s["throw"]=u(1),s["return"]=u(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(t){return function(n){return c([t,n])}}function c(u){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(i=1,o&&(r=u[0]&2?o["return"]:u[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;if(o=0,r)u=[u[0]&2,r.value];switch(u[0]){case 0:case 1:r=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1];r=u;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(u);break}if(r[2])e.ops.pop();e.trys.pop();continue}u=n.call(t,e)}catch(t){u=[6,t];o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,e){if(e||arguments.length===2)for(var i=0,o=n.length,r;i<o;i++){if(r||!(i in n)){if(!r)r=Array.prototype.slice.call(n,0,i);r[i]=n[i]}}return t.concat(r||Array.prototype.slice.call(n))};System.register(["./p-CIevpRv_.system.js","./p-
|
|
1
|
+
var __extends=this&&this.__extends||function(){var t=function(n,e){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)if(Object.prototype.hasOwnProperty.call(n,e))t[e]=n[e]};return t(n,e)};return function(n,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t(n,e);function i(){this.constructor=n}n.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}}();var __awaiter=this&&this.__awaiter||function(t,n,e,i){function o(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function s(t){try{c(i.next(t))}catch(t){r(t)}}function u(t){try{c(i["throw"](t))}catch(t){r(t)}}function c(t){t.done?e(t.value):o(t.value).then(s,u)}c((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=u(0),s["throw"]=u(1),s["return"]=u(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(t){return function(n){return c([t,n])}}function c(u){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(i=1,o&&(r=u[0]&2?o["return"]:u[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;if(o=0,r)u=[u[0]&2,r.value];switch(u[0]){case 0:case 1:r=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1];r=u;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(u);break}if(r[2])e.ops.pop();e.trys.pop();continue}u=n.call(t,e)}catch(t){u=[6,t];o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,e){if(e||arguments.length===2)for(var i=0,o=n.length,r;i<o;i++){if(r||!(i in n)){if(!r)r=Array.prototype.slice.call(n,0,i);r[i]=n[i]}}return t.concat(r||Array.prototype.slice.call(n))};System.register(["./p-CIevpRv_.system.js","./p-DTgUqgwV.system.js","./p-BOh4ifdL.system.js","./p-D0DkOoAw.system.js","./p-3AUMK-5E.system.js","./p-CKhl__Kc.system.js","./p-BbgqQIHv.system.js","./p-DXlojp_Y.system.js","./p-CtvXi9wL.system.js","./p-CzKlS3E-.system.js","./p-DsBuZ6ob.system.js","./p-DW-fW8yR.system.js","./p-zsTASoh2.system.js"],(function(t){"use strict";var n,e,i,o,r,s,u,c,a,f,l,d,h,v,w,m,p,g,y,_,b,S;return{setters:[function(t){n=t.r;e=t.d;i=t.h;o=t.a},function(t){r=t.z;s=t.a;u=t.b},function(t){c=t.m;a=t.n;f=t.o;l=t.s;d=t.d},function(t){h=t.l;v=t.h;w=t.c},function(t){m=t.e},function(t){p=t.g;g=t.i;y=t.a},function(t){_=t.l},function(t){b=t.e},function(t){S=t.i},null,null,null,null],execute:function(){var z=this;var j=function(){
|
|
2
2
|
// append checkout component if doesn't exist
|
|
3
|
-
var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var
|
|
3
|
+
var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var O=function(t){
|
|
4
4
|
// allow to load checkout if cartData is ready (Checkout can be loaded right awaiy if tempCartUUID is in the URL)
|
|
5
5
|
if(!t.placeOrderButtonSelector&&!t.alwaysTriggerInternationalCheckoutSelector&&!window.Zonos.cartData){
|
|
6
6
|
// do nothing if checkout button anchor is not set
|
|
7
7
|
return}
|
|
8
8
|
// check if checkout button anchor selector user pass in is valid
|
|
9
|
-
if(t.placeOrderButtonSelector&&!
|
|
9
|
+
if(t.placeOrderButtonSelector&&!c(t.placeOrderButtonSelector)){h('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}if(t.alwaysTriggerInternationalCheckoutSelector&&!c(t.alwaysTriggerInternationalCheckoutSelector)){h('Selector alwaysTriggerInternationalCheckoutSelector "'.concat(t.alwaysTriggerInternationalCheckoutSelector,'" is not a valid selector'));return}j()};
|
|
10
|
+
/**
|
|
11
|
+
* Mount `<zonos-checkout>` without a Stripe instance.
|
|
12
|
+
*
|
|
13
|
+
* Native BigCommerce checkout must not receive Stripe.js. Creating the
|
|
14
|
+
* element still runs `zonos-checkout.init()`, which registers the
|
|
15
|
+
* international-address watcher and then returns before the Stripe poll.
|
|
16
|
+
*/var I=function(){O(r.checkoutSettings)};var k=function(){return __awaiter(z,void 0,void 0,(function(){var t,n,e,i,o,r,s;return __generator(this,(function(u){switch(u.label){case 0:if(window.Zonos.cartSettings){_("Reusing cached zonos settings");return[2/*return*/,{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode}]}t=p();n=new URLSearchParams;if(t.overrideShouldEnabledCustomAddress){n.set("overrideShouldEnabledCustomAddress",t.overrideShouldEnabledCustomAddress)}e=a();if(e){n.set("zCountry",e)}return[4/*yield*/,v("/api/zonos-elements/zonos-settings?".concat(n.toString()))];case 1:i=u.sent(),o=i.errors,r=i.json,s=i.zonosMode;if(o.length){h("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2/*return*/,{errors:o,json:null,zonosMode:s}]}return[2/*return*/,{errors:[],json:r,zonosMode:s}]}}))}))};var C=function(){
|
|
10
17
|
// append checkout component if doesn't exist
|
|
11
|
-
var t=document.querySelector("zonos-collect");if(!t){var n=document.createElement("zonos-collect");document.body.appendChild(n)}};var
|
|
18
|
+
var t=document.querySelector("zonos-collect");if(!t){var n=document.createElement("zonos-collect");document.body.appendChild(n)}};var A=function(){
|
|
12
19
|
// allow to load checkout if cartData is ready (Checkout can be loaded right away if tempCartUUID is in the URL)
|
|
13
|
-
if(!window.Zonos.cartData){return}
|
|
20
|
+
if(!window.Zonos.cartData){return}C()};var E=function(){
|
|
14
21
|
// append checkout component if doesn't exist
|
|
15
|
-
var t=document.querySelector("zonos-invoice");if(!t){var n=document.createElement("zonos-invoice");document.body.appendChild(n)}};var
|
|
22
|
+
var t=document.querySelector("zonos-invoice");if(!t){var n=document.createElement("zonos-invoice");document.body.appendChild(n)}};var T=function(){
|
|
16
23
|
// allow to load checkout if cartData is ready (Checkout can be loaded right away if tempCartUUID is in the URL)
|
|
17
|
-
if(!window.Zonos.cartData){return}
|
|
24
|
+
if(!window.Zonos.cartData){return}E()};var P="zonos-domestic-element-hide-style";
|
|
18
25
|
/**
|
|
19
26
|
* Probe whether the host parser understands `:is(...)`. Real browsers do
|
|
20
27
|
* (Chrome 88+, Firefox 78+, Safari 14+); older environments and some test
|
|
@@ -23,22 +30,22 @@ if(!window.Zonos.cartData){return}k()};var A="zonos-domestic-element-hide-style"
|
|
|
23
30
|
* When not supported, we distribute the prefix across each top-level
|
|
24
31
|
* comma-separated piece instead — so the rule still applies in that
|
|
25
32
|
* environment.
|
|
26
|
-
*/var
|
|
33
|
+
*/var L=typeof document!=="undefined"&&function(){try{document.querySelector(":is(.zonos-is-probe)");return true}catch(t){return false}}();
|
|
27
34
|
/**
|
|
28
35
|
* Split a CSS selector string on top-level commas. Commas inside parentheses
|
|
29
36
|
* (`:not(.a, .b)`, `:nth-child(2n+1)`) or attribute brackets
|
|
30
37
|
* (`[data-foo=","]`) are preserved as part of the piece.
|
|
31
|
-
*/var
|
|
38
|
+
*/var x=function(t){var n=[];var e=0;var i=0;var o="";for(var r=0;r<t.length;r++){var s=t[r];if(s==="("){e++}else if(s===")"){e--}else if(s==="["){i++}else if(s==="]"){i--}if(s===","&&e===0&&i===0){var u=o.trim();if(u){n.push(u)}o=""}else{o+=s}}var c=o.trim();if(c){n.push(c)}return n};
|
|
32
39
|
/**
|
|
33
40
|
* Build the fully-scoped selector that will land in the injected `<style>`
|
|
34
41
|
* tag. Exported so tests can exercise both branches of the `:is()`-support
|
|
35
42
|
* fallback without having to mock the module-level probe.
|
|
36
|
-
*/var
|
|
43
|
+
*/var D=function(t){var n=t.merchantSelector,e=t.supportsIs;if(e){return"body.z-intl :is(".concat(n,")")}
|
|
37
44
|
// Fallback: distribute the `body.z-intl ` ancestor prefix across each
|
|
38
45
|
// top-level comma-separated piece. Parentheses/brackets are respected,
|
|
39
46
|
// so pseudo-classes that take selector lists (`:not(.a, .b)`) and
|
|
40
47
|
// attribute selectors that contain commas stay intact.
|
|
41
|
-
return
|
|
48
|
+
return x(n).map((function(t){return"body.z-intl ".concat(t)})).join(", ")};
|
|
42
49
|
/**
|
|
43
50
|
* Inject a `<style>` tag that hides storefront elements matching the
|
|
44
51
|
* merchant-configured `checkoutSettings.domesticElementSelector`, scoped to
|
|
@@ -46,97 +53,97 @@ return E(n).map((function(t){return"body.z-intl ".concat(t)})).join(", ")};
|
|
|
46
53
|
* shipping zone (Hello sets the body class). The exact selector we emit is
|
|
47
54
|
* also the selector we validate — see [[buildDomesticHideSelector]] for the
|
|
48
55
|
* `:is()`-support branching.
|
|
49
|
-
*/var
|
|
56
|
+
*/var F=function(t){if(typeof document==="undefined"||!t){return}var n=D({merchantSelector:t,supportsIs:L});
|
|
50
57
|
// A raw `<` is never a valid CSS selector character, and it is the
|
|
51
58
|
// character that would close a `<style>` tag if this string were ever
|
|
52
59
|
// assigned as HTML. Some parsers (current jsdom) do not throw on it, so
|
|
53
60
|
// reject it before `querySelector`. `>` stays allowed: it is the child
|
|
54
61
|
// combinator.
|
|
55
|
-
if(n.includes("<")){
|
|
62
|
+
if(n.includes("<")){_('Skip domesticElementSelector injection: "'.concat(t,'" contains "<"'),"warn");return}
|
|
56
63
|
// The browser's own parser is the source of truth — `document.querySelector`
|
|
57
64
|
// throws `DOMException(SyntaxError)` for syntactically invalid selectors.
|
|
58
65
|
// Validating the exact string we're about to emit catches both malformed
|
|
59
66
|
// input and payloads that close `:is(` early to escape the wrapper.
|
|
60
|
-
try{document.querySelector(n)}catch(e){
|
|
67
|
+
try{document.querySelector(n)}catch(e){_('Skip domesticElementSelector injection: "'.concat(t,'" produced an invalid CSS selector ("').concat(n,'")'),"warn");return}
|
|
61
68
|
// Already injected — settings can re-emit on hot reload during dev.
|
|
62
|
-
if(document.getElementById(
|
|
69
|
+
if(document.getElementById(P)){return}var e=document.createElement("style");e.id=P;e.textContent="".concat(n," { display: none !important; }");(document.head||document.body).appendChild(e);_("Zonos domestic element hide style injected")};var B=function(t){var n=document.querySelector(t);
|
|
63
70
|
// append checkout component if doesn't exist
|
|
64
|
-
var e=document.querySelector("zonos-hello");if(!e&&n){var i=document.createElement("zonos-hello");n.appendChild(i);return true}return false};var
|
|
71
|
+
var e=document.querySelector("zonos-hello");if(!e&&n){var i=document.createElement("zonos-hello");n.appendChild(i);return true}return false};var G=function(t){switch(t){case"BOTTOM_RIGHT":return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";default:return"bottom-right"}};
|
|
65
72
|
/**
|
|
66
73
|
* Injects the hello mobile wrapper to the DOM and returns the anchor element selector
|
|
67
74
|
* @returns anchor element selector
|
|
68
|
-
*/var
|
|
75
|
+
*/var M=function(t){var n=t.position,e=n===void 0?"bottom-right":n;var i=".zonos--hello-mobile-wrapper";var o=document.querySelector(i);if(o){return i}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(e==="top-right"){r.style.top="72px";r.style.right="24px"}if(e==="top-left"){r.style.top="72px";r.style.left="24px"}if(e==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(e==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483647";document.body.appendChild(r);return i};var R=function(t){return __awaiter(z,void 0,void 0,(function(){var n,e,i,o,r;return __generator(this,(function(s){if(window.Zonos.isLegacyCheckout){_("Hello is disabled when isLegacyCheckout","info");return[2/*return*/]}n=t.anchorElementSelector;e=n;
|
|
69
76
|
/**
|
|
70
77
|
* Use default mobile anchor only if desktopLocation is provided and no anchorElementSelector is provided
|
|
71
78
|
* So for bigcommerce, we don't need to manually add a anchor every time we onboard a new store
|
|
72
|
-
**/if(!t.anchorElementSelector&&t.desktopLocation){i=
|
|
79
|
+
**/if(!t.anchorElementSelector&&t.desktopLocation){i=M({position:"bottom-right"});e=i}
|
|
73
80
|
// check if checkout button anchor selector user pass in is valid to setup hello
|
|
74
|
-
if(!e||!
|
|
81
|
+
if(!e||!c(e)){h('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2/*return*/]}_("Hello init complete");o=B(e);
|
|
75
82
|
// keep watching for the anchor element to be added to the DOM, then inject hello component
|
|
76
|
-
if(!o){r=new MutationObserver((function(){var t=
|
|
83
|
+
if(!o){r=new MutationObserver((function(){var t=B(e);if(t){
|
|
77
84
|
// disconnect observer if hello is successfully injected
|
|
78
85
|
r.disconnect()}}));r.observe(document.body,{childList:true,subtree:true});setTimeout((function(){
|
|
79
86
|
// inject hello to mobile anchor if hello is still not found
|
|
80
|
-
|
|
87
|
+
B(e)}),1e3);setTimeout((function(){if(t.notFoundElementFallback){_("Hello anchor selector ".concat(t.anchorElementSelector," not found after 3 seconds, falling back to 'notFoundElementFallback': ").concat(t.notFoundElementFallback),"info");var n=M({position:G(t.notFoundElementFallback)});B(n)}}),3e3)}return[2/*return*/]}))}))};
|
|
81
88
|
/**
|
|
82
89
|
* Base class for iframe communication
|
|
83
|
-
*/var
|
|
90
|
+
*/var H=/** @class */function(){function t(t,n){var e=this;this.targetId=t;this.allowedEvents=n;this.listeners=new Map;this.handleMessage=function(t){var n,i,o;var r=t.data;var s=((n=e.iframe)===null||n===void 0?void 0:n.contentWindow)||((o=(i=e.iframe)===null||i===void 0?void 0:i.contentDocument)===null||o===void 0?void 0:o.defaultView);
|
|
84
91
|
// check if the message is from the same src
|
|
85
|
-
if(t.source!==s){return}if(!e.isValidMessage(r)){return}var u=e.listeners.get(r.type);u===null||u===void 0?void 0:u.forEach((function(t){try{t(r.payload)}catch(t){
|
|
92
|
+
if(t.source!==s){return}if(!e.isValidMessage(r)){return}var u=e.listeners.get(r.type);u===null||u===void 0?void 0:u.forEach((function(t){try{t(r.payload)}catch(t){h("Error in event listener:",t)}}))};this.initializeEventListeners();
|
|
86
93
|
// get the iframe element
|
|
87
|
-
this.iframe=document.getElementById(this.targetId)}t.prototype.initializeEventListeners=function(){window.addEventListener("message",this.handleMessage)};t.prototype.isValidMessage=function(t){if(!t||typeof t!=="object")return false;var n=t;return n.id===this.targetId&&typeof n.type==="string"&&this.allowedEvents.includes(n.type)&&n.payload!==undefined};t.prototype.on=function(t,n){var e=this;if(!this.listeners.has(t)){this.listeners.set(t,new Set)}
|
|
94
|
+
this.iframe=document.getElementById(this.targetId)}t.prototype.initializeEventListeners=function(){window.addEventListener("message",this.handleMessage)};t.prototype.isValidMessage=function(t){if(!t||typeof t!=="object")return false;var n=t;return n.id===this.targetId&&typeof n.type==="string"&&this.allowedEvents.includes(n.type)&&n.payload!==undefined};t.prototype.on=function(t,n){var e=this;if(!this.listeners.has(t)){this.listeners.set(t,new Set)}_("[CheckoutAddressService] listening to ".concat(t),"info");var i=n;var o=this.listeners.get(t);if(o){o.add(i)}return function(){var n=e.listeners.get(t);if(n){n.delete(i)}}};t.prototype.destroy=function(){window.removeEventListener("message",this.handleMessage);this.listeners.clear()};return t}();
|
|
88
95
|
/**
|
|
89
96
|
* Service for communicating with the Google Places iframe
|
|
90
|
-
*/var
|
|
97
|
+
*/var U=/** @class */function(t){__extends(n,t);function n(){_("=== [Google Places Service] Initializing","info");return t.call(this,g.GOOGLE_PLACES,["fetchAutocompleteSuggestions","initializeGooglePlacesService","placeSelected","onFetchAutocompleteSuggestions","onInitializeGooglePlacesService","onPlaceSelected"])||this}n.prototype.sendMessage=function(t,n){var e;if(!((e=this.iframe)===null||e===void 0?void 0:e.contentWindow)){return}var i={id:this.targetId,logType:window.Zonos.iframeLogType,payload:n,type:t};_("GooglePlacesService] parent --\x3e ".concat(t),"info",n);this.iframe.contentWindow.postMessage(i,"*")};n.prototype.initialize=function(){this.sendMessage("initializeGooglePlacesService",{})};n.prototype.fetchSuggestions=function(t){var n=t.country,e=t.query,i=t.type;if(!n){return}this.sendMessage("fetchAutocompleteSuggestions",{request:{includedRegionCodes:[n],input:e},type:i})};n.prototype.selectPlace=function(t){var n=t.placeId,e=t.type;this.sendMessage("placeSelected",{placeId:n,type:e})};return n}(H);
|
|
91
98
|
/**
|
|
92
99
|
* Checkout service for managing address selection and validation
|
|
93
|
-
*/var
|
|
100
|
+
*/var K=/** @class */function(){function t(){var t=this;this.googlePlaceInitialized=false;_("=== [CheckoutAddressService] Initializing","info");this.googlePlaces=new U;this.googlePlaces.on("onInitializeGooglePlacesService",(function(){_("=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService","info");t.googlePlaceInitialized=true}));this.initialize()}t.prototype.initialize=function(){this.googlePlaces.initialize()};t.prototype.onInitializeGooglePlacesService=function(t){return this.googlePlaces.on("onInitializeGooglePlacesService",(function(){_("[CheckoutAddressService] parent <-- onInitializeGooglePlacesService");t()}))};t.prototype.isGooglePlaceInitialized=function(){return this.googlePlaceInitialized};
|
|
94
101
|
/**
|
|
95
102
|
* Set up event listeners for address suggestions
|
|
96
|
-
*/t.prototype.onAddressSuggestions=function(t){this.suggestionsCallback=t;return this.googlePlaces.on("onFetchAutocompleteSuggestions",(function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}
|
|
103
|
+
*/t.prototype.onAddressSuggestions=function(t){this.suggestionsCallback=t;return this.googlePlaces.on("onFetchAutocompleteSuggestions",(function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}_.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ".concat(n[0].type),"info"],n,false));t.apply(void 0,n)}))};
|
|
97
104
|
/**
|
|
98
105
|
* Set up event listeners for selected address
|
|
99
|
-
*/t.prototype.onAddressSelected=function(t){this.placeSelectedCallback=t;return this.googlePlaces.on("onPlaceSelected",(function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}
|
|
106
|
+
*/t.prototype.onAddressSelected=function(t){this.placeSelectedCallback=t;return this.googlePlaces.on("onPlaceSelected",(function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}_.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onPlaceSelected ".concat(n[0].type),"info"],n,false));t.apply(void 0,n)}))};
|
|
100
107
|
/**
|
|
101
108
|
* Request address suggestions based on user input
|
|
102
109
|
*/t.prototype.getAddressSuggestions=function(t){var n=t.country,e=t.query,i=t.type;if(!this.googlePlaceInitialized){return}this.googlePlaces.fetchSuggestions({country:n,query:e,type:i})};
|
|
103
110
|
/**
|
|
104
111
|
* Select an address from suggestions
|
|
105
|
-
*/t.prototype.selectAddress=function(t){var n=t.placeId,e=t.type;this.googlePlaces.selectPlace({placeId:n,type:e})};t.prototype.destroy=function(){this.googlePlaces.destroy();if(this.suggestionsCallback){this.suggestionsCallback=undefined}if(this.placeSelectedCallback){this.placeSelectedCallback=undefined}};return t}();var
|
|
112
|
+
*/t.prototype.selectAddress=function(t){var n=t.placeId,e=t.type;this.googlePlaces.selectPlace({placeId:n,type:e})};t.prototype.destroy=function(){this.googlePlaces.destroy();if(this.suggestionsCallback){this.suggestionsCallback=undefined}if(this.placeSelectedCallback){this.placeSelectedCallback=undefined}};return t}();var N=function(){return":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}"};var q=t("zonos_controller",/** @class */function(){function t(t){n(this,t);this.paypalInitEvent=e(this,"paypalInitEvent",7);this.stripeInitEvent=e(this,"stripeInitEvent",7)}
|
|
106
113
|
/**
|
|
107
114
|
* Method to initialize checkout element
|
|
108
|
-
*/t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){
|
|
115
|
+
*/t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init checkout element","warn");return[2/*return*/]}m.stripe=t;void O(r.checkoutSettings);_("init checkout element");return[2/*return*/]}))}))};
|
|
109
116
|
/**
|
|
110
117
|
* Method to initialize Collect element
|
|
111
|
-
*/t.prototype.initCollectElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){
|
|
118
|
+
*/t.prototype.initCollectElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init Collect element","warn");return[2/*return*/]}m.stripe=t;void A();_("init Collect element");return[2/*return*/]}))}))};
|
|
112
119
|
/**
|
|
113
120
|
* Method to initialize Collect element
|
|
114
|
-
*/t.prototype.initInvoiceElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){
|
|
121
|
+
*/t.prototype.initInvoiceElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){_("Stripe is not loaded yet - cannot init Invoice element","warn");return[2/*return*/]}m.stripe=t;void T();_("init Invoice element");return[2/*return*/]}))}))};
|
|
115
122
|
/**
|
|
116
123
|
* Init zonos notification
|
|
117
124
|
*/t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};
|
|
118
125
|
/**
|
|
119
126
|
* Setup google font
|
|
120
|
-
*/t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e,i,o,
|
|
127
|
+
*/t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e,i,o,u,c,a,f;return __generator(this,(function(l){switch(l.label){case 0:i=t||s();if(i==="Inter"){if(!t){
|
|
121
128
|
// Do nothing if font is Inter, since we already inject it on start
|
|
122
|
-
return[2/*return*/]}
|
|
129
|
+
return[2/*return*/]}_("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");r.appearance=Object.assign(Object.assign({},r.appearance),{fontFamily:t})}o=new URLSearchParams;o.set("family",i);return[4/*yield*/,v("/api/zonos-elements/get-font-detail?".concat(o.toString()))];case 1:u=l.sent(),c=u.errors,a=u.json;
|
|
123
130
|
// Keep using Inter font, font in the setting maybe outdated and not found in google font, API will return Inter font instead
|
|
124
|
-
if(
|
|
131
|
+
if(c.length>0){_("Failed to load font ".concat(i),"warn");r.appearance=Object.assign(Object.assign({},r.appearance),{fontFamily:"Inter"});return[2/*return*/]}f=a===null||a===void 0?void 0:a.fontUrl;if(f){(e=(n=window.Zonos).injectSupportGoogleFont)===null||e===void 0?void 0:e.call(n,f)}if(!t){return[2/*return*/]}
|
|
125
132
|
// apply override font
|
|
126
|
-
|
|
133
|
+
_("[FONT] ".concat(t," font override applied"));r.appearance=Object.assign(Object.assign({},r.appearance),{fontFamily:t});return[2/*return*/]}}))}))};t.prototype.handleLocationChange=function(){
|
|
127
134
|
// re-inject hello component if the location changes
|
|
128
|
-
void
|
|
135
|
+
void R(r.helloSettings)};
|
|
129
136
|
/**
|
|
130
137
|
* Init history listener to know when the location changes to re-inject hello component
|
|
131
138
|
*/t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.injectCustomHTML=function(t){if(!t){return}
|
|
132
139
|
// Skip injecting custom HTML for legacy checkout and collect
|
|
133
|
-
if(!window.Zonos.isLegacyCheckout||window.Zonos.isCollect||window.Zonos.isInvoice){
|
|
140
|
+
if(!window.Zonos.isLegacyCheckout||window.Zonos.isCollect||window.Zonos.isInvoice){_("=== Skip injecting custom HTML for hosted checkout","info");return}_("=== Injecting custom HTML for hosted checkout");var n=document.createElement("template");n.innerHTML=t;var e=n.content.querySelectorAll("script");e.forEach((function(t){var n=document.createElement("script");if(t.src){n.src=t.src;n.async=t.async}else{n.textContent=t.innerHTML}document.body.appendChild(n)}));
|
|
134
141
|
// Custom HTML may set window.Zonos.googleAnalyticId / window.Zonos.facebookPixelId; trigger relay ping so parent configures GA / FB Pixel
|
|
135
|
-
|
|
142
|
+
b()};t.prototype.initGooglePlacesService=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e;return __generator(this,(function(i){n=t===null||t===void 0?void 0:t.genericSettings;if(!n){return[2/*return*/]}e=n.signedTokenGooglePlaces;if(!e){return[2/*return*/]}
|
|
136
143
|
// Create private iframe to load google places api
|
|
137
|
-
|
|
144
|
+
y({id:g.GOOGLE_PLACES,onload:function(){
|
|
138
145
|
// init checkout address service
|
|
139
|
-
|
|
146
|
+
r.checkoutAddressService=new K},src:"".concat("https://route.elements.zonos.com","/iframe/google-maps?signedToken=").concat(e)});return[2/*return*/]}))}))};t.prototype.buildBaseConfig=function(t){var n,e;var i=Object.assign(Object.assign({},this.config.checkoutSettings),{
|
|
140
147
|
// Don't allow to override settlement currencies setting. This setting is only configured by Zonos
|
|
141
148
|
allowedSettlementCurrencies:undefined,
|
|
142
149
|
// Don't allow to override capture delay setting. This setting is only configured by Zonos
|
|
@@ -151,54 +158,56 @@ checkoutSettings:undefined})}
|
|
|
151
158
|
var o=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&((n=this.config.checkoutSettings)===null||n===void 0?void 0:n.successBehavior)==="CLOSE_MODAL";return Object.assign(Object.assign({},this.config),{checkoutSettings:Object.assign(Object.assign({},i),{
|
|
152
159
|
// Set success redirect url to store url if it's legacy checkout.
|
|
153
160
|
// when success behavior is CLOSE_MODAL, use the default success behavior and update the keep shopping button link to their store, because just redirect user without confirmation page would confuse them
|
|
154
|
-
successBehavior:o?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:o?((e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl)||(t===null||t===void 0?void 0:t.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl})})};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();
|
|
161
|
+
successBehavior:o?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:o?((e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl)||(t===null||t===void 0?void 0:t.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl})})};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();r.zonosApiKey=this.zonosApiKey;
|
|
155
162
|
// running with scope async function to avoid blocking the main thread
|
|
156
|
-
(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,i,o,
|
|
163
|
+
(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,i,o,s,c,a,l,d,h,v,m,p,g,y,b,z,j;var O=this;return __generator(this,(function(C){switch(C.label){case 0:return[4/*yield*/,k()];case 1:c=C.sent(),a=c.errors,l=c.json,d=c.zonosMode;if(((n=(t=a[0])===null||t===void 0?void 0:t.type)===null||n===void 0?void 0:n.toString())==="403"){_("Failed to load zonos settings. This domain may not have access","warn");return[2/*return*/]}h=((e=l===null||l===void 0?void 0:l.checkoutSettings)===null||e===void 0?void 0:e.customHTML)||"";this.injectCustomHTML(h);
|
|
157
164
|
// init zonos notification
|
|
158
165
|
this.initZonosNotification();v=function(){var t,n,e;if(window.Zonos.isLegacyCheckout){
|
|
159
166
|
// Try to use new settings first for legacy stores
|
|
160
|
-
return((t=
|
|
167
|
+
return((t=l===null||l===void 0?void 0:l.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=O.config.appearance)===null||n===void 0?void 0:n.logoUrl)}
|
|
161
168
|
// Otherwise respect override
|
|
162
|
-
return(e=
|
|
169
|
+
return(e=O.config.appearance)===null||e===void 0?void 0:e.logoUrl};m=this.buildBaseConfig(l);p=Object.assign(Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:v()})}),m);
|
|
163
170
|
// load default setting if failed to load user settings
|
|
164
|
-
|
|
171
|
+
u({overrideSettings:p,zonosSettings:l});r.zonosMode=d;
|
|
165
172
|
// Inject the merchant's domestic-element hide style now that
|
|
166
173
|
// checkoutSettings have been merged into the store.
|
|
167
|
-
|
|
174
|
+
F(r.checkoutSettings.domesticElementSelector);
|
|
168
175
|
// setup google font after store loaded
|
|
169
|
-
void this.setupGoogleFont();if(
|
|
176
|
+
void this.setupGoogleFont();if(r.helloSettings.visibilityStatus==="DISABLED"){
|
|
170
177
|
// Store owner disabled this intentionally
|
|
171
|
-
|
|
178
|
+
_("=== Hello is disabled by store owner ===","warn")}if(r.helloSettings&&r.helloSettings.visibilityStatus==="ENABLED"){_("Initializing hello");void R(r.helloSettings)}
|
|
172
179
|
// init localization store
|
|
173
|
-
return[4/*yield*/,
|
|
180
|
+
return[4/*yield*/,f()];case 2:
|
|
174
181
|
// init localization store
|
|
175
|
-
|
|
176
|
-
//
|
|
177
|
-
this.stripeInitEvent.emit({publishableKey:
|
|
182
|
+
C.sent();g=((i=l===null||l===void 0?void 0:l.checkoutSettings)===null||i===void 0?void 0:i.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!g||!this.stripeInitEvent){_("Checkout failed to load -- missing publishable key","warn");return[2/*return*/]}y=S();if(window.Zonos.isCollect||window.Zonos.isInvoice){
|
|
183
|
+
// Collect and Invoice off native checkout still ask for Stripe.
|
|
184
|
+
if(!y){this.stripeInitEvent.emit({publishableKey:g.token})}
|
|
178
185
|
// init google places service
|
|
179
|
-
void this.initGooglePlacesService(
|
|
186
|
+
void this.initGooglePlacesService(l);return[2/*return*/]}if(r.checkoutSettings.subscriptionStatus==="INACTIVE"){_('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");_("zonos controller loaded");return[2/*return*/]}if(r.checkoutSettings.visibilityStatus==="DISABLED"){_("=== Checkout is disabled by store owner ===","warn");_("zonos controller loaded");return[2/*return*/]}b=
|
|
180
187
|
// eslint-disable-next-line @typescript-eslint/no-deprecated -- gating Stripe load also honors the legacy callback
|
|
181
|
-
typeof((o=
|
|
182
|
-
//
|
|
183
|
-
|
|
188
|
+
typeof((o=r.checkoutSettings)===null||o===void 0?void 0:o.buildCartDetail)==="function"||typeof((s=r.checkoutSettings)===null||s===void 0?void 0:s.createCartId)==="function";z=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||w("session","zonos--client-secret");j=!!(window.Zonos.cartId&&window.Zonos.cartData)||!!z;if(!b&&!j){_("Skip loading Stripe because no cart callback (buildCartDetail/createCartId), prefetched cart, or payment client secret is present","warn");return[2/*return*/]}
|
|
189
|
+
// Cart callbacks, a prefetched cart, and a client secret do not override
|
|
190
|
+
// the native BigCommerce checkout skip. Mount checkout anyway so the
|
|
191
|
+
// international-address watcher runs, without Stripe.js.
|
|
192
|
+
if(y){I()}else{this.stripeInitEvent.emit({publishableKey:g.token})}
|
|
184
193
|
// init google places service
|
|
185
|
-
void this.initGooglePlacesService(
|
|
194
|
+
void this.initGooglePlacesService(l);return[2/*return*/]}}))}))})();return[2/*return*/]}))}))};
|
|
186
195
|
/**
|
|
187
196
|
* Show notification
|
|
188
|
-
*/t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){n=document.querySelector("zonos-notification");if(!n){
|
|
197
|
+
*/t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){n=document.querySelector("zonos-notification");if(!n){_("Failed to show notification - zonos-notification not found","warn");return[2/*return*/]}void n.showNotification(t);return[2/*return*/]}))}))};
|
|
189
198
|
/**
|
|
190
199
|
* Reset the Checkout session id and client secret (required for dashboard store switching)
|
|
191
|
-
*/t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){
|
|
200
|
+
*/t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){l.checkoutSessionId=null;m.clientSecret="";return[2/*return*/]}))}))};
|
|
192
201
|
/**
|
|
193
202
|
* Override the setting
|
|
194
203
|
* @param config config that need to override the default setting
|
|
195
|
-
*/t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){
|
|
204
|
+
*/t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){u({overrideSettings:t,zonosSettings:null});return[2/*return*/]}))}))};
|
|
196
205
|
/**
|
|
197
206
|
* Override country code. Used in dashboard create test cart.
|
|
198
|
-
*/t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){
|
|
207
|
+
*/t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){_("Override country code to ".concat(t));void d({isInitializing:false,newSelectedCountryCode:t});return[2/*return*/]}))}))};
|
|
199
208
|
/**
|
|
200
209
|
* Get appearance from setting
|
|
201
|
-
*/t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2/*return*/,
|
|
210
|
+
*/t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2/*return*/,r.appearance]}))}))};
|
|
202
211
|
/**
|
|
203
212
|
* Update the organizationName
|
|
204
|
-
*/t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){
|
|
213
|
+
*/t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){r.organizationName=t;return[2/*return*/]}))}))};t.prototype.render=function(){return i(o,{key:"0d8bcffcb7e22891c082a4916b00b87bdf5fc2e8",class:"zonos--elements"})};return t}());q.style=N()}}}));
|