@zonos/elements 1.3.289 → 1.3.291
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/{cart-WLQb2hbe.js → cart-B6Aty-21.js} +3 -3
- package/dist/cjs/{collect-B92uIdsY.js → collect-Oeo5tjN5.js} +3 -3
- package/dist/cjs/{debounce-5sZmmlCI.js → debounce-Cd2emZPn.js} +2 -2
- package/dist/cjs/{debounce-Nu2lJW4A.js → debounce-vY0QYT6o.js} +1 -1
- package/dist/cjs/{getBorderRadius-DGZiQu09.js → getBorderRadius-CyYZw4qq.js} +1 -1
- package/dist/cjs/{getMissingRequiredShippingFields-5w62gTIB.js → getMissingRequiredShippingFields-D03ICqss.js} +1 -1
- package/dist/cjs/{hasInclusivePrice-hmV0Inld.js → hasInclusivePrice-CPCoVeU3.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{invoice-Bal1mqYR.js → invoice-Cj8W7NW0.js} +3 -3
- package/dist/cjs/{localization-C5HPlCNK.js → localization-BzNeXeDe.js} +25 -16
- package/dist/cjs/{paypal-o164C26_.js → paypal-CuKshRmZ.js} +4 -4
- package/dist/cjs/{placeTestOrder-C7tAipav.js → placeTestOrder-7czjwkjm.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-Bpx-vrTQ.js → renderCheckoutCurrency-BH8t2b2x.js} +2 -2
- package/dist/cjs/{shouldShowLanguageSelect-CtwkMt8b.js → shouldShowLanguageSelect-yAbtCmd8.js} +1 -1
- package/dist/cjs/{submitGtag-CcEL-w5D.js → submitGtag-D79e8u6s.js} +1 -1
- package/dist/cjs/{throttle-BcxGntLr.js → throttle-zSVRQLC0.js} +2 -2
- package/dist/cjs/{updateCheckoutSessionAttributes-Dltl5RBx.js → updateCheckoutSessionAttributes-jMtfOL2m.js} +1 -1
- package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +7 -7
- package/dist/cjs/zonos-address-display_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-address_4.cjs.entry.js +6 -6
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +5 -5
- package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +2 -2
- package/dist/cjs/zonos-card_5.cjs.entry.js +6 -6
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +14 -14
- package/dist/cjs/zonos-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -9
- package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +4 -4
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +10 -10
- package/dist/cjs/zonos-collect.cjs.entry.js +7 -7
- package/dist/cjs/zonos-controller.cjs.entry.js +5 -5
- 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 +129 -51
- package/dist/cjs/zonos-input.cjs.entry.js +2 -2
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +10 -10
- package/dist/cjs/zonos-invoice.cjs.entry.js +7 -7
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +2 -2
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-BCNYr6Tk.js → zonosStore-Bx9jK82G.js} +2 -0
- package/dist/collection/components/hello/zonos-hello/zonos-hello.css +17 -15
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +29 -52
- package/dist/collection/components/store/hello/localization.js +4 -1
- package/dist/collection/components/store/zonosStore.js +2 -0
- package/dist/collection/components/utils/hello/countryOverrideStorage.js +20 -14
- package/dist/collection/components/utils/hello/resolveHelloFloatPlacement.js +98 -0
- package/dist/collection/types/generated/graphql.internal.types.js +176 -9
- package/dist/esm/{cart-BDc4RTBJ.js → cart-BoQp8Ema.js} +3 -3
- package/dist/esm/{collect-NRCK3t-M.js → collect-CdrR5OBy.js} +3 -3
- package/dist/esm/{debounce-D4ko2kvZ.js → debounce-BR3PaG8X.js} +1 -1
- package/dist/esm/{debounce-DWPsxJsW.js → debounce-CrmpwbEE.js} +2 -2
- package/dist/esm/{getBorderRadius-HwG64EKM.js → getBorderRadius-DYfkeXdx.js} +1 -1
- package/dist/esm/{getMissingRequiredShippingFields-D-B-N1NH.js → getMissingRequiredShippingFields-Ks6_tpjn.js} +1 -1
- package/dist/esm/{hasInclusivePrice-Bti4iudO.js → hasInclusivePrice-CbEfIhI5.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{invoice-DsvQvu4a.js → invoice-S1KahJ_Z.js} +3 -3
- package/dist/esm/{localization-Bs6hVcKV.js → localization-BIh-4pc_.js} +25 -16
- package/dist/esm/{paypal-BqyEZS_u.js → paypal-DNfvnuUU.js} +4 -4
- package/dist/esm/{placeTestOrder-x3xwMAnW.js → placeTestOrder-CQaMKFOg.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-DIBdWKN1.js → renderCheckoutCurrency-C2Tw73uR.js} +2 -2
- package/dist/esm/{shouldShowLanguageSelect-Bb9sbQ41.js → shouldShowLanguageSelect-CCD7gpSY.js} +1 -1
- package/dist/esm/{submitGtag-CCGQS060.js → submitGtag-df9AQ2zL.js} +1 -1
- package/dist/esm/{throttle-D5GyA3yr.js → throttle-Cvlvb-dm.js} +2 -2
- package/dist/esm/{updateCheckoutSessionAttributes-eRSqdC74.js → updateCheckoutSessionAttributes-4Jq6V4pO.js} +1 -1
- package/dist/esm/zonos-address-completion-dialog_7.entry.js +7 -7
- package/dist/esm/zonos-address-display_2.entry.js +3 -3
- package/dist/esm/zonos-address_4.entry.js +6 -6
- package/dist/esm/zonos-airwallex-payment.entry.js +5 -5
- package/dist/esm/zonos-badge.entry.js +1 -1
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_3.entry.js +2 -2
- package/dist/esm/zonos-card_5.entry.js +6 -6
- package/dist/esm/zonos-cart-items_12.entry.js +14 -14
- package/dist/esm/zonos-checkbox_2.entry.js +2 -2
- package/dist/esm/zonos-checkout.entry.js +9 -9
- package/dist/esm/zonos-collapse.entry.js +1 -1
- package/dist/esm/zonos-collect-cart-items_3.entry.js +4 -4
- package/dist/esm/zonos-collect-finish_6.entry.js +10 -10
- package/dist/esm/zonos-collect.entry.js +7 -7
- package/dist/esm/zonos-controller.entry.js +5 -5
- 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 +129 -51
- package/dist/esm/zonos-input.entry.js +2 -2
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +6 -6
- package/dist/esm/zonos-invoice-finish_5.entry.js +10 -10
- package/dist/esm/zonos-invoice.entry.js +7 -7
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-logo.entry.js +1 -1
- package/dist/esm/zonos-policy-consent_2.entry.js +5 -5
- package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
- package/dist/esm/zonos-stripe-input.entry.js +2 -2
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/zonos-v-stack.entry.js +1 -1
- package/dist/esm/{zonosStore-DrIOAz4M.js → zonosStore-msUlqmSD.js} +2 -0
- package/dist/esm-es5/{cart-BDc4RTBJ.js → cart-BoQp8Ema.js} +1 -1
- package/dist/esm-es5/{collect-NRCK3t-M.js → collect-CdrR5OBy.js} +1 -1
- package/dist/esm-es5/{debounce-D4ko2kvZ.js → debounce-BR3PaG8X.js} +7 -7
- package/dist/esm-es5/debounce-CrmpwbEE.js +1 -0
- package/dist/esm-es5/{getBorderRadius-HwG64EKM.js → getBorderRadius-DYfkeXdx.js} +1 -1
- package/dist/esm-es5/{getMissingRequiredShippingFields-D-B-N1NH.js → getMissingRequiredShippingFields-Ks6_tpjn.js} +3 -3
- package/dist/esm-es5/{hasInclusivePrice-Bti4iudO.js → hasInclusivePrice-CbEfIhI5.js} +1 -1
- package/dist/esm-es5/index.js +4 -4
- package/dist/esm-es5/{invoice-DsvQvu4a.js → invoice-S1KahJ_Z.js} +1 -1
- package/dist/esm-es5/{localization-Bs6hVcKV.js → localization-BIh-4pc_.js} +14 -4
- package/dist/esm-es5/{paypal-BqyEZS_u.js → paypal-DNfvnuUU.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-x3xwMAnW.js → placeTestOrder-CQaMKFOg.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-DIBdWKN1.js → renderCheckoutCurrency-C2Tw73uR.js} +2 -2
- package/dist/esm-es5/{shouldShowLanguageSelect-Bb9sbQ41.js → shouldShowLanguageSelect-CCD7gpSY.js} +1 -1
- package/dist/esm-es5/{submitGtag-CCGQS060.js → submitGtag-df9AQ2zL.js} +1 -1
- package/dist/esm-es5/{throttle-D5GyA3yr.js → throttle-Cvlvb-dm.js} +2 -2
- package/dist/esm-es5/{updateCheckoutSessionAttributes-eRSqdC74.js → updateCheckoutSessionAttributes-4Jq6V4pO.js} +1 -1
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -1
- 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-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- 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 +1 -1
- 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 +21 -24
- package/dist/esm-es5/zonos-input.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-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-DrIOAz4M.js → zonosStore-msUlqmSD.js} +1 -1
- package/dist/scripts/index.d.ts +36 -6
- 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/hello/zonos-hello/zonos-hello.d.ts +5 -3
- package/dist/types/components/utils/hello/countryOverrideStorage.d.ts +1 -1
- package/dist/types/components/utils/hello/resolveHelloFloatPlacement.d.ts +39 -0
- package/dist/types/components.d.ts +4 -6
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +10 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +239 -11
- package/dist/types/types/generated/graphql.internal.types.ts +302 -15
- package/dist/types/types/hello/HelloConfig.d.ts +12 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-d9527bd7.system.entry.js → p-04bded81.system.entry.js} +45 -45
- package/dist/zonos-elements/{p-18021e6b.entry.js → p-06fe2939.entry.js} +1 -1
- package/dist/zonos-elements/{p-058f07aa.system.entry.js → p-0a4a7742.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d261f27c.system.entry.js → p-0b81f8b9.system.entry.js} +16 -16
- package/dist/zonos-elements/{p-c5f17bad.entry.js → p-0fca452b.entry.js} +1 -1
- package/dist/zonos-elements/{p-72b6a006.system.entry.js → p-11defdca.system.entry.js} +18 -18
- package/dist/zonos-elements/{p-1568ab06.system.entry.js → p-1409de3b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2466b5f0.system.entry.js → p-17c7ea4a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8328f44d.entry.js → p-193d9722.entry.js} +1 -1
- package/dist/zonos-elements/{p-22fab1ba.system.entry.js → p-195f6e38.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-cc5306fe.system.entry.js → p-1bac5ac1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-128485dc.entry.js → p-1c150f26.entry.js} +1 -1
- package/dist/zonos-elements/{p-c4713ff1.system.entry.js → p-23352709.system.entry.js} +4 -4
- package/dist/zonos-elements/{p-cc949df1.system.entry.js → p-244e0302.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e9a3bc27.system.entry.js → p-249c1ee1.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-7681798d.entry.js → p-24f3c547.entry.js} +1 -1
- package/dist/zonos-elements/{p-5c08d36b.entry.js → p-2603dce0.entry.js} +1 -1
- package/dist/zonos-elements/{p-b78bab27.entry.js → p-34656e6c.entry.js} +1 -1
- package/dist/zonos-elements/{p-4625058a.entry.js → p-39ee1558.entry.js} +1 -1
- package/dist/zonos-elements/{p-f8fd756a.system.entry.js → p-474e8a92.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0ff26236.system.entry.js → p-4806b264.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-56159b7c.system.entry.js → p-5016d71b.system.entry.js} +58 -58
- package/dist/zonos-elements/{p-b96666ca.system.entry.js → p-51400242.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-e126e9bd.system.entry.js → p-5236c676.system.entry.js} +80 -80
- package/dist/zonos-elements/{p-cf53f67a.entry.js → p-550d4eea.entry.js} +1 -1
- package/dist/zonos-elements/{p-36559431.system.entry.js → p-552fbde1.system.entry.js} +21 -21
- package/dist/zonos-elements/{p-a6faab6a.entry.js → p-55916c90.entry.js} +1 -1
- package/dist/zonos-elements/{p-317d4665.system.entry.js → p-5b80aff2.system.entry.js} +15 -15
- package/dist/zonos-elements/p-69c3e367.system.entry.js +118 -0
- package/dist/zonos-elements/{p-3cc27e0e.system.entry.js → p-6abec43f.system.entry.js} +4 -4
- package/dist/zonos-elements/{p-635341d6.entry.js → p-6c41b00c.entry.js} +1 -1
- package/dist/zonos-elements/{p-d451d5bc.system.entry.js → p-6db7c0b1.system.entry.js} +4 -4
- package/dist/zonos-elements/{p-cc17a230.entry.js → p-6e296228.entry.js} +1 -1
- package/dist/zonos-elements/{p-beeb9d36.system.entry.js → p-756d303f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-B6X55m0b.js → p-7abqRc9V.js} +2 -2
- package/dist/zonos-elements/{p-3d536086.entry.js → p-82595838.entry.js} +1 -1
- package/dist/zonos-elements/{p-34d1545a.entry.js → p-83aa1c8c.entry.js} +1 -1
- package/dist/zonos-elements/{p-CaUXHglQ.system.js → p-8PPEbm_0.system.js} +9 -9
- package/dist/zonos-elements/{p-b6deae2b.system.entry.js → p-92fe9a1f.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-5eb82be3.entry.js → p-938fc1e4.entry.js} +1 -1
- package/dist/zonos-elements/{p-CZl1nwqv.system.js → p-B4Ufchqh.system.js} +3 -3
- package/dist/zonos-elements/p-BGktDPwA.system.js +1 -0
- package/dist/zonos-elements/{p-D2fOB4Wn.system.js → p-Be3Hpms1.system.js} +1 -1
- package/dist/zonos-elements/{p-D0erXw7p.js → p-BpDCLBwW.js} +1 -1
- package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
- package/dist/zonos-elements/{p-CPnR_T0a.system.js → p-BuU_p5DP.system.js} +58 -58
- package/dist/zonos-elements/{p-CaAod213.system.js → p-CBx5nYet.system.js} +1 -1
- package/dist/zonos-elements/{p-UM1aYZBV.system.js → p-CEK_Wk6v.system.js} +1 -1
- package/dist/zonos-elements/p-CFbfEmjN.js +1 -0
- package/dist/zonos-elements/{p-nU86HJ5w.js → p-CUaf1cEg.js} +1 -1
- package/dist/zonos-elements/p-C_z9WL8a.js +1 -0
- package/dist/zonos-elements/p-CcJF6xhQ.js +1 -0
- package/dist/zonos-elements/p-Cxuiqv1I.js +1 -0
- package/dist/zonos-elements/p-D-bZg-Pc.js +1 -0
- package/dist/zonos-elements/{p-CH6tsv9B.system.js → p-D4MevhAL.system.js} +3 -3
- package/dist/zonos-elements/{p-BybDGrH4.system.js → p-DI2vXnXc.system.js} +3 -3
- package/dist/zonos-elements/{p-CQyFoOXW.system.js → p-DNc279vN.system.js} +13 -13
- package/dist/zonos-elements/{p-Cd9xIgx7.system.js → p-DOD2I44l.system.js} +92 -82
- package/dist/zonos-elements/p-DQZncB2d.system.js +9 -0
- package/dist/zonos-elements/{p-NL_Eiq6m.system.js → p-DS-qw_qc.system.js} +15 -15
- package/dist/zonos-elements/p-DZ2mevDK.js +1 -0
- package/dist/zonos-elements/{p-uV7m6KrY.system.js → p-DoEHepOc.system.js} +1 -1
- package/dist/zonos-elements/{p-D4WI0B6-.system.js → p-DuufSrhH.system.js} +4 -4
- package/dist/zonos-elements/{p-MHVIIOVE.js → p-DzLNk-Pf.js} +1 -1
- package/dist/zonos-elements/{p-DqEtY53c.js → p-FRWZayxL.js} +1 -1
- package/dist/zonos-elements/p-Mrz_lnC1.js +1 -0
- package/dist/zonos-elements/{p-CtEsvWI6.js → p-W82paT5F.js} +1 -1
- package/dist/zonos-elements/{p-CVQ7-7E2.system.js → p-XDxdMlQl.system.js} +22 -22
- package/dist/zonos-elements/{p-CuhGrJBA.system.js → p-XqkqjeNV.system.js} +1 -1
- package/dist/zonos-elements/{p-8cac7911.system.entry.js → p-a40fd99b.system.entry.js} +12 -12
- package/dist/zonos-elements/{p-b68ca96f.entry.js → p-a938c174.entry.js} +1 -1
- package/dist/zonos-elements/{p-9ebe9a36.entry.js → p-acd50b0b.entry.js} +1 -1
- package/dist/zonos-elements/{p-fcfac62f.system.entry.js → p-b2dd7f02.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0f603278.system.entry.js → p-b5882fbb.system.entry.js} +2 -2
- package/dist/zonos-elements/{p-e582ae2a.entry.js → p-b79036fc.entry.js} +1 -1
- package/dist/zonos-elements/{p-6c6c65f0.entry.js → p-bb3546c0.entry.js} +1 -1
- package/dist/zonos-elements/{p-02628b9f.entry.js → p-c1cbfdba.entry.js} +1 -1
- package/dist/zonos-elements/{p-b88e521e.system.entry.js → p-c3646ae6.system.entry.js} +19 -19
- package/dist/zonos-elements/{p-be64d823.system.entry.js → p-c403f004.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c090cc60.entry.js → p-c47ce656.entry.js} +1 -1
- package/dist/zonos-elements/{p-68e0180a.entry.js → p-c5bab786.entry.js} +1 -1
- package/dist/zonos-elements/{p-628a0f7f.entry.js → p-c961caaf.entry.js} +1 -1
- package/dist/zonos-elements/p-c9QtIdJX.js +1 -0
- package/dist/zonos-elements/{p-CGkdA4pY.js → p-clDfq9AL.js} +1 -1
- package/dist/zonos-elements/p-d168023b.entry.js +1 -0
- package/dist/zonos-elements/{p-3e59d41c.entry.js → p-d3d0656a.entry.js} +1 -1
- package/dist/zonos-elements/{p-9b6482ef.entry.js → p-d4d2b39e.entry.js} +1 -1
- package/dist/zonos-elements/p-d74bc3e8.entry.js +1 -0
- package/dist/zonos-elements/p-db87b0dd.entry.js +1 -0
- package/dist/zonos-elements/{p-f44631d5.entry.js → p-dea26048.entry.js} +1 -1
- package/dist/zonos-elements/{p-5e074243.entry.js → p-defc2d18.entry.js} +1 -1
- package/dist/zonos-elements/{p-bdba7d9e.system.entry.js → p-dfc87b10.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-03fbe813.system.entry.js → p-e005b6a5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-02ff6f8b.system.entry.js → p-e0e9cff5.system.entry.js} +42 -42
- package/dist/zonos-elements/p-f8b50aa0.entry.js +1 -0
- package/dist/zonos-elements/{p-ClUEwqZW.system.js → p-kaOxUR9u.system.js} +6 -6
- package/dist/zonos-elements/p-rVp8hgWw.js +1 -0
- package/dist/zonos-elements/{p-i1iCWKdv.js → p-sz4L-ZnB.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/debounce-DWPsxJsW.js +0 -1
- package/dist/zonos-elements/p-037d3688.entry.js +0 -1
- package/dist/zonos-elements/p-0466650f.entry.js +0 -1
- package/dist/zonos-elements/p-163b81c0.system.entry.js +0 -121
- package/dist/zonos-elements/p-3ERbuo5a.js +0 -1
- package/dist/zonos-elements/p-97f848f6.entry.js +0 -1
- package/dist/zonos-elements/p-9H2p9XKE.js +0 -1
- package/dist/zonos-elements/p-BANhKkF2.system.js +0 -1
- package/dist/zonos-elements/p-BJufDgh3.js +0 -1
- package/dist/zonos-elements/p-BSgVcCxT.system.js +0 -9
- package/dist/zonos-elements/p-CpvnCfKt.js +0 -1
- package/dist/zonos-elements/p-CtKp6AQ4.js +0 -1
- package/dist/zonos-elements/p-DdpeA8cH.js +0 -1
- package/dist/zonos-elements/p-DkirvyAh.js +0 -1
- package/dist/zonos-elements/p-a6354d15.entry.js +0 -1
- package/dist/zonos-elements/p-opB7B9YB.js +0 -1
- package/dist/zonos-elements/p-t_ClFAJR.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,t,n){function r(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function c(e){try{a(n["throw"](e))}catch(e){i(e)}}function a(e){e.done?t(e.value):r(e.value).then(s,c)}a((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=c(0),s["throw"]=c(1),s["return"]=c(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(o){return a([e,o])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(t=0)),t)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:t.label++;return{value:c[1],done:false};case 5:t.label++;r=c[1];c=[0];continue;case 7:c=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1];i=c;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(c);break}if(i[2])t.ops.pop();t.trys.pop();continue}c=o.call(e,t)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,r=o.length,i;n<r;n++){if(i||!(n in o)){if(!i)i=Array.prototype.slice.call(o,0,n);i[n]=o[n]}}return e.concat(i||Array.prototype.slice.call(o))};System.register(["./p-CIevpRv_.system.js","./p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,t,n){function r(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function c(e){try{a(n["throw"](e))}catch(e){i(e)}}function a(e){e.done?t(e.value):r(e.value).then(s,c)}a((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=c(0),s["throw"]=c(1),s["return"]=c(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(o){return a([e,o])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(t=0)),t)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:t.label++;return{value:c[1],done:false};case 5:t.label++;r=c[1];c=[0];continue;case 7:c=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1];i=c;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(c);break}if(i[2])t.ops.pop();t.trys.pop();continue}c=o.call(e,t)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,r=o.length,i;n<r;n++){if(i||!(n in o)){if(!i)i=Array.prototype.slice.call(o,0,n);i[n]=o[n]}}return e.concat(i||Array.prototype.slice.call(o))};System.register(["./p-CIevpRv_.system.js","./p-DS-qw_qc.system.js","./p-XDxdMlQl.system.js","./p-DOD2I44l.system.js","./p-BuU_p5DP.system.js","./p-BDopxBpR.system.js","./p-zVLAvre1.system.js","./p-CBx5nYet.system.js","./p-BbgqQIHv.system.js","./p-smUku7Ku.system.js","./p-C2j7R11h.system.js","./p-DBOI98r5.system.js","./p-DQZncB2d.system.js","./p-DW-fW8yR.system.js","./p-BNtWsPPP.system.js","./p-0D0aCMu6.system.js","./p-Cby4EkFu.system.js","./p-B3GRrRtL.system.js","./p-DoEHepOc.system.js","./p-BGktDPwA.system.js","./p-8PPEbm_0.system.js"],(function(e){"use strict";var o,t,n,r,i,s,c,a,u,d,l,f,h,v,m,p,g,w,z,k,y,b,_,C,x,S,I,T,A,O,B,E,P,D,U,L,N,j,R,F,M,H,Z,G,K,V,Q,W,Y,q,J,X,$,ee,oe,te,ne,re,ie,se,ce,ae,ue,de,le,fe,he,ve,me,pe,ge,we,ze,ke,ye,be,_e,Ce,xe,Se,Ie,Te,Ae,Oe,Be,Ee;return{setters:[function(e){o=e.r;t=e.h;n=e.F;r=e.a},function(e){i=e.s;s=e.a;c=e.b;a=e.i;u=e.c;d=e.g;l=e.d;f=e.e;h=e.f;v=e.p;m=e.h;p=e.j;g=e.k;w=e.l;z=e.m;k=e.n;y=e.o;b=e.t;_=e.q;C=e.r;x=e.u;S=e.v;I=e.w;T=e.x;A=e.y;O=e.z;B=e.A;E=e.B;P=e.C;D=e.D;U=e.E;L=e.F;N=e.G;j=e.H;R=e.I;F=e.J;M=e.K},function(e){H=e.p;Z=e.s;G=e.a;K=e.b},function(e){V=e.f;Q=e.a;W=e.b;Y=e.i;q=e.l;J=e.c;X=e.d;$=e.g;ee=e.s;oe=e.V;te=e.e;ne=e.t;re=e.h;ie=e.j},function(e){se=e.z;ce=e.g;ae=e.m},function(e){ue=e.b},function(e){de=e.h;le=e.g;fe=e.j;he=e.l;ve=e.b;me=e.s;pe=e.a;ge=e.i},function(e){we=e.u},function(e){ze=e.l;ke=e.g;ye=e.b},function(e){be=e._;_e=e.c;Ce=e.d;xe=e.a;Se=e.g},function(e){Ie=e.c},function(e){Te=e.c},function(e){Ae=e.g},function(e){Oe=e.i},function(e){Be=e.s},function(e){Ee=e.R},null,null,null,null,null],execute:function(){var Pe=this;
|
|
2
2
|
/**
|
|
3
3
|
* Check if store discount is enabled
|
|
4
|
-
*/var
|
|
4
|
+
*/var De=function(){return __awaiter(Pe,void 0,void 0,(function(){var e,o,t;return __generator(this,(function(n){switch(n.label){case 0:return[4/*yield*/,de("/api/zonos-elements/get-store-discount-enabled-status")];case 1:e=n.sent(),o=e.errors,t=e.json;if(o.length||!(t===null||t===void 0?void 0:t.enabled)){return[2/*return*/,{enabled:false}]}return[2/*return*/,{enabled:true}]}}))}))};var Ue=function(e){return __awaiter(Pe,[e],void 0,(function(e){var o,t,n,r;var i=e.testKeys;return __generator(this,(function(e){switch(e.label){case 0:
|
|
5
5
|
// Do nothing if no test keys are provided
|
|
6
|
-
if(i.length===0){return[2/*return*/,null]}return[4/*yield*/,de("/api/zonos-elements/select-variance-test",{body:{testKeys:i},method:"POST"})];case 1:o=e.sent(),t=o.errors,n=o.json;if(t.length||!n){return[2/*return*/,null]}r=
|
|
6
|
+
if(i.length===0){return[2/*return*/,null]}return[4/*yield*/,de("/api/zonos-elements/select-variance-test",{body:{testKeys:i},method:"POST"})];case 1:o=e.sent(),t=o.errors,n=o.json;if(t.length||!n){return[2/*return*/,null]}r=V(n);
|
|
7
7
|
// Filter the response to only include test keys that we support
|
|
8
|
-
return[2/*return*/,r]}}))}))};var
|
|
8
|
+
return[2/*return*/,r]}}))}))};var Le=function(e){var o=e.cartId,t=e.checkoutSessionId,n=e.customerAddress1,r=e.customerAddress2,i=e.customerCity,s=e.customerCountry,c=e.customerEmail,a=e.customerFirstName,u=e.customerLastName,d=e.customerPhone,l=e.customerState,f=e.customerZip,h=e.hostedCheckoutUrl,v=e.isTestMode,m=e.isVariantTest;var p=new URLSearchParams;p.set("tempCartUUID",o);if(a){p.set("customerFirstName",a)}if(u){p.set("customerLastName",u)}if(c){p.set("customerEmail",c)}if(d){p.set("customerPhone",d)}if(f){p.set("customerZip",f)}if(i){p.set("customerCity",i)}if(l){p.set("customerState",l)}if(s){p.set("zCountry",s)}if(n){p.set("customerAddress1",n)}if(r){p.set("customerAddress2",r)}if(v){p.set("zonosTestMode","1")}if(t){p.set("zonosCheckoutSessionId",t)}if(m){p.set("zonosVariantTest","1")}return"".concat(h,"?").concat(p.toString())};
|
|
9
9
|
/**
|
|
10
10
|
* The query flag that BigCommerce carries back to `cart.php` after the
|
|
11
11
|
* shopper logs in. When present, Zonos-elements knows to resume the
|
|
@@ -50,7 +50,7 @@ if(t.get("zonosDebug")==="1"){o.searchParams.set("zonosDebug","1")}if(le()){o.se
|
|
|
50
50
|
/**
|
|
51
51
|
* Performs the actual fetch logic to determine if the customer
|
|
52
52
|
* belongs to a bypass group.
|
|
53
|
-
*/var He=function(e){return __awaiter(
|
|
53
|
+
*/var He=function(e){return __awaiter(Pe,void 0,void 0,(function(){var o,t,n,r,i,s,c,a,u,d,l,f;return __generator(this,(function(h){switch(h.label){case 0:
|
|
54
54
|
// Only relevant for BigCommerce stores — permanent no-op on other platforms
|
|
55
55
|
if(!window.Zonos.isBigCommerce){return[2/*return*/,{conclusive:true,result:Me}]}i=(o=se.genericSettings)===null||o===void 0?void 0:o.bigcommerceBypassCustomerGroupIds;if(!(i===null||i===void 0?void 0:i.length)){if(se.loadedConfig){
|
|
56
56
|
// Settings have finished loading and there are no bypass groups
|
|
@@ -77,17 +77,17 @@ return[2/*return*/,{conclusive:true,result:Me}]}l=i.includes(d);f={customerGroup
|
|
|
77
77
|
* Automatically invalidated when a fetch resolves to an inconclusive outcome,
|
|
78
78
|
* so subsequent callers retry (e.g. after the user adds an item to their
|
|
79
79
|
* cart or after settings finish loading).
|
|
80
|
-
*/var
|
|
80
|
+
*/var Ze=null;var Ge=function(e){var o=He(e);var t=o.then((function(e){var o=e.conclusive,n=e.result;if(!o&&Ze===t){
|
|
81
81
|
// Invalidate cache so the next caller performs a fresh fetch.
|
|
82
|
-
|
|
82
|
+
Ze=null}return n}));Ze=t;return t};
|
|
83
83
|
/**
|
|
84
84
|
* Start fetching the BigCommerce customer group on page load.
|
|
85
85
|
* Call this once during initialization (e.g. in `zonos-checkout.init()`).
|
|
86
86
|
* The fetch runs in the background; `checkBigCommerceBypassCustomerGroup`
|
|
87
87
|
* will await the result when needed.
|
|
88
|
-
*/var
|
|
88
|
+
*/var Ke=function(){var e;if(!window.Zonos.isBigCommerce){return}var o=(e=se.genericSettings)===null||e===void 0?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(o===null||o===void 0?void 0:o.length)){return}
|
|
89
89
|
// Fire the fetch immediately; consumers will await the same promise
|
|
90
|
-
void
|
|
90
|
+
void Ge()};
|
|
91
91
|
/**
|
|
92
92
|
* Check if the current BigCommerce customer belongs to a customer group
|
|
93
93
|
* that should bypass Zonos Checkout.
|
|
@@ -102,7 +102,7 @@ void Ke()};
|
|
|
102
102
|
* always fetches fresh BigCommerce checkout data. Use this on the
|
|
103
103
|
* BigCommerce domestic checkout page when the shipping country changes,
|
|
104
104
|
* to ensure the customer group reflects the current checkout state.
|
|
105
|
-
*/var
|
|
105
|
+
*/var Ve=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Pe,__spreadArray([],e,true),void 0,(function(e){if(e===void 0){e={}}return __generator(this,(function(o){if(e.forceRefresh||!Ze){return[2/*return*/,Ge(e.preFetched)]}return[2/*return*/,Ze]}))}))};var Qe={guestCheckoutType:null};
|
|
106
106
|
/**
|
|
107
107
|
* BigCommerce's `/checkouts/settings` values almost never change after a
|
|
108
108
|
* merchant's initial setup, so we persist the result in `localStorage` and
|
|
@@ -128,7 +128,7 @@ return null}};var Je=function(e,o){try{var t={expiresAt:Date.now()+We,guestCheck
|
|
|
128
128
|
* Results are cached in `localStorage` for `CACHE_TTL_MS` so navigations
|
|
129
129
|
* inside the same store don't all pay the proxy round trip — the setting
|
|
130
130
|
* is merchant-level and rarely changes.
|
|
131
|
-
*/var Xe=function(){return __awaiter(
|
|
131
|
+
*/var Xe=function(){return __awaiter(Pe,void 0,void 0,(function(){var e,o,t,n,r,i,s;return __generator(this,(function(c){switch(c.label){case 0:if(!window.Zonos.isBigCommerce){return[2/*return*/,Qe]}o=(e=se.checkoutSettings.bigCommerceConfig)===null||e===void 0?void 0:e.storeHash;if(!o){ze("BigCommerce checkout settings: no storeHash provided — skipping fetch","info");return[2/*return*/,Qe]}t=qe(o);if(t){return[2/*return*/,t]}return[4/*yield*/,de("/api/bigcommerce/checkout-settings",{body:{storeHash:o},method:"POST"})];case 1:n=c.sent(),r=n.errors,i=n.json;if(r.length||!i){ze("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info");return[2/*return*/,Qe]}s={guestCheckoutType:i.guestCheckoutType};Je(o,s);return[2/*return*/,s]}}))}))};var $e={redirectUrl:null,shouldForceLogin:false};
|
|
132
132
|
/**
|
|
133
133
|
* Session cache for the merchant-level "does BC require login?" answer.
|
|
134
134
|
* Hitting `/checkouts/settings` on every checkout open would add a visible
|
|
@@ -167,7 +167,7 @@ if(eo===e){eo=null}return false}));eo=e}return eo};
|
|
|
167
167
|
* Returning a `redirectUrl` is an instruction, not an action: callers drive
|
|
168
168
|
* the navigation themselves so they can short-circuit any UI state (loading
|
|
169
169
|
* overlays, dialog open flags) before `window.location.href` flips.
|
|
170
|
-
*/var no=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(
|
|
170
|
+
*/var no=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Pe,__spreadArray([],e,true),void 0,(function(e){var o,t,n,r,i;var s=e===void 0?{}:e,c=s.preFetched;return __generator(this,(function(e){switch(e.label){case 0:if(!window.Zonos.isBigCommerce){return[2/*return*/,$e]}return[4/*yield*/,oo()];case 1:o=e.sent();if(!o){return[2/*return*/,$e]}if(!c)return[3/*break*/,2];n=c.checkoutId;return[3/*break*/,4];case 2:return[4/*yield*/,Q()];case 3:n=e.sent();e.label=4;case 4:t=n;if(!t){
|
|
171
171
|
// No active cart — nothing to protect. Force-login only matters once
|
|
172
172
|
// the shopper has a cart we're about to carry into Zonos checkout.
|
|
173
173
|
return[2/*return*/,$e]}if(!c)return[3/*break*/,5];i=c.checkout;return[3/*break*/,7];case 5:return[4/*yield*/,W(t)];case 6:i=e.sent();e.label=7;case 7:r=i;if(!r){
|
|
@@ -230,7 +230,7 @@ state:e.stateOrProvinceCode||e.stateOrProvince||""},email:o,name:t,phone:e.phone
|
|
|
230
230
|
// Iterate saved addresses first so the dedup key for an address present in
|
|
231
231
|
// both lists keeps the saved-book version (which carries an `id` and is the
|
|
232
232
|
// shopper's canonical entry).
|
|
233
|
-
for(var h=0,v=__spreadArray(__spreadArray([],d,true),u,true);h<v.length;h++){var m=v[h];var
|
|
233
|
+
for(var h=0,v=__spreadArray(__spreadArray([],d,true),u,true);h<v.length;h++){var m=v[h];var p=ao(m,a);if(!p){continue}if(!s(p.address.country)){continue}var g=uo(p);if(l.has(g)){continue}l.add(g);f.push(p)}if(!c){return f}
|
|
234
234
|
// Stable-sort the survivors so addresses matching the currently-selected
|
|
235
235
|
// country come first while everything else keeps its original order.
|
|
236
236
|
return f.map((function(e,o){return{index:o,option:e}})).sort((function(e,o){var t=e.option.address.country===c;var n=o.option.address.country===c;if(t===n){return e.index-o.index}return t?-1:1})).map((function(e){return e.option}))};var fo=function(e){if(e===void 0){e=true}if(!q.localizationLoaded){return true}if(q.isDisabledCountry){if(e){ze("Checkout: disabled country")}return true}return false};var ho=function(e,
|
|
@@ -249,11 +249,11 @@ if(!q.isShippableCountry){if(e){ze("Checkout: not shippable country")}return fal
|
|
|
249
249
|
* that is internationally shippable. If so, optionally prompt the user to
|
|
250
250
|
* confirm before saving the address to session and redirecting to the home
|
|
251
251
|
* page to open the international checkout.
|
|
252
|
-
*/var
|
|
252
|
+
*/var po=function(e){return __awaiter(Pe,[e],void 0,(function(e){var o,t,n,r,i,c,a,u,d,l,f,h,v,m,p,g,w,z;var k=e.onInternationalCheckoutSelected,y=e.onLoggedInInternationalAddressDetected;return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,Q()];case 1:f=e.sent();if(!f){return[2/*return*/,"noAction"]}return[4/*yield*/,W(f)];case 2:h=e.sent();v={checkout:h,checkoutId:f};return[4/*yield*/,Ve({preFetched:v})];case 3:m=e.sent().shouldBypass;if(m){return[2/*return*/,"noAction"]}p=(t=(o=h===null||h===void 0?void 0:h.consignments)===null||o===void 0?void 0:o[0])===null||t===void 0?void 0:t.shippingAddress;if(!(p===null||p===void 0?void 0:p.countryCode)){return[2/*return*/,"noAction"]}g=p.countryCode;if(!ho(false,g)){return[2/*return*/,"noAction"]}ze(y?"Logged-in user has international shipping address: ".concat(g,", prompting user to choose checkout"):"Logged-in user has international shipping address: ".concat(g,", redirecting automatically (legacy behavior)"),"info");if(!y)return[3/*break*/,5];return[4/*yield*/,y()];case 4:w=e.sent();if(w==="stay"){ze("User opted to stay on BigCommerce native checkout despite international default address","info");return[2/*return*/,"optedOut"]}e.label=5;case 5:return[4/*yield*/,no({preFetched:v})];case 6:z=e.sent();if(z.shouldForceLogin&&z.redirectUrl){window.location.href=z.redirectUrl;return[2/*return*/,"redirected"]}if(!k)return[3/*break*/,8];return[4/*yield*/,k()];case 7:e.sent();e.label=8;case 8:
|
|
253
253
|
// Update localization store with the detected country
|
|
254
|
-
X({isInitializing:false,newSelectedCountryCode:
|
|
254
|
+
X({isInitializing:false,newSelectedCountryCode:g,persistOverride:false});
|
|
255
255
|
// Save the shipping address to session storage for the international checkout
|
|
256
|
-
s({address1:(n=
|
|
256
|
+
s({address1:(n=p.address1)!==null&&n!==void 0?n:"",address2:(r=p.address2)!==null&&r!==void 0?r:"",city:(i=p.city)!==null&&i!==void 0?i:"",countryCode:g,firstName:(c=p.firstName)!==null&&c!==void 0?c:"",lastName:(a=p.lastName)!==null&&a!==void 0?a:"",phone:(u=p.phone)!==null&&u!==void 0?u:"",postalCode:(d=p.postalCode)!==null&&d!==void 0?d:"",state:(l=p.stateOrProvince)!==null&&l!==void 0?l:""});
|
|
257
257
|
// Redirect to home page — the home page will open the international checkout
|
|
258
258
|
// when it detects the domestic shipping session. Carry over zonosQaUrl /
|
|
259
259
|
// zonosTestMode so the destination page keeps using the same build/env.
|
|
@@ -261,17 +261,17 @@ window.location.href=Fe("/");return[2/*return*/,"redirected"]}}))}))};
|
|
|
261
261
|
/**
|
|
262
262
|
* Watch for changes in domestic checkout step. Redirects user to home page to open international checkout when user selects a country in the international shipping zone.
|
|
263
263
|
* @note Only works on default bigcommerce checkout page
|
|
264
|
-
*/var
|
|
264
|
+
*/var go=function(e){var o=e.domesticRedirectedBtnSelector,t=e.onInternationalCheckoutSelected,n=e.onLoggedInInternationalAddressDetected,r=e.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}
|
|
265
265
|
/**
|
|
266
266
|
* Keep checking.
|
|
267
267
|
* @returns `true` if the caller should stop polling — either because the user
|
|
268
268
|
* is being redirected to Zonos international checkout, or because the
|
|
269
269
|
* logged-in customer is in a bypass group and should stay on BC checkout.
|
|
270
|
-
*/var c=function(e){return __awaiter(
|
|
270
|
+
*/var c=function(e){return __awaiter(Pe,void 0,void 0,(function(){var o,n,r,i,c,a,u,d,l,f;return __generator(this,(function(h){switch(h.label){case 0:n=document.querySelector(((o=se.genericSettings)===null||o===void 0?void 0:o.bigcommerceDomesticCheckoutCountrySelector)||vo);r=(n===null||n===void 0?void 0:n.value)||e;if(!r){
|
|
271
271
|
// do nothing if shipping country is not found
|
|
272
272
|
return[2/*return*/,"noAction"]}if(!ho(false,r)){
|
|
273
273
|
// do nothing if shipping country is not shippable
|
|
274
|
-
return[2/*return*/,"noAction"]}return[4/*yield*/,Q()];case 1:i=h.sent();if(!i)return[3/*break*/,3];return[4/*yield*/,W(i)];case 2:a=h.sent();return[3/*break*/,4];case 3:a=null;h.label=4;case 4:c=a;u={checkout:c,checkoutId:i};return[4/*yield*/,
|
|
274
|
+
return[2/*return*/,"noAction"]}return[4/*yield*/,Q()];case 1:i=h.sent();if(!i)return[3/*break*/,3];return[4/*yield*/,W(i)];case 2:a=h.sent();return[3/*break*/,4];case 3:a=null;h.label=4;case 4:c=a;u={checkout:c,checkoutId:i};return[4/*yield*/,Ve({forceRefresh:true,preFetched:u})];case 5:d=h.sent().shouldBypass;if(d){
|
|
275
275
|
// Logged-in customer is in a bypass group — keep them on BC native
|
|
276
276
|
// checkout and stop polling / fetching further.
|
|
277
277
|
ze("Bypass customer group detected on BC checkout, stopping interval","info");return[2/*return*/,"bypass"]}return[4/*yield*/,no({preFetched:u})];case 6:l=h.sent();if(l.shouldForceLogin&&l.redirectUrl){window.location.href=l.redirectUrl;return[2/*return*/,"redirected"]}if(!t)return[3/*break*/,8];return[4/*yield*/,t()];case 7:h.sent();h.label=8;case 8:
|
|
@@ -297,7 +297,7 @@ window.location.href=Fe("/");return[2/*return*/,"redirected"]}}))}))};
|
|
|
297
297
|
* checkout. Logged-in shoppers picking a saved address don't expose a
|
|
298
298
|
* country `<select>`, so read it from the active checkout consignment via the
|
|
299
299
|
* Storefront API; fall back to the `<select>` value when one is present.
|
|
300
|
-
*/var d=function(){return __awaiter(
|
|
300
|
+
*/var d=function(){return __awaiter(Pe,void 0,void 0,(function(){var e,o,t,n,r,i,s,c;return __generator(this,(function(a){switch(a.label){case 0:return[4/*yield*/,Q()];case 1:r=a.sent();if(!r)return[3/*break*/,3];return[4/*yield*/,W(r)];case 2:i=a.sent();s=(t=(o=(e=i===null||i===void 0?void 0:i.consignments)===null||e===void 0?void 0:e[0])===null||o===void 0?void 0:o.shippingAddress)===null||t===void 0?void 0:t.countryCode;if(s){return[2/*return*/,s]}a.label=3;case 3:c=document.querySelector(((n=se.genericSettings)===null||n===void 0?void 0:n.bigcommerceDomesticCheckoutCountrySelector)||vo);return[2/*return*/,(c===null||c===void 0?void 0:c.value)||null]}}))}))};
|
|
301
301
|
/**
|
|
302
302
|
* Req 2 (05CHECK-887): once a logged-in shopper with an international default
|
|
303
303
|
* address has chosen to "Stay on this page", we must still force them onto
|
|
@@ -312,7 +312,7 @@ window.location.href=Fe("/");return[2/*return*/,"redirected"]}}))}))};
|
|
|
312
312
|
* checkout. On any outcome other than a redirect — domestic, bypass group,
|
|
313
313
|
* or an unexpected error — replay the click so BigCommerce's own handler runs
|
|
314
314
|
* and the shopper is never left stuck on the shipping step.
|
|
315
|
-
*/var l=function(e,o){return __awaiter(
|
|
315
|
+
*/var l=function(e,o){return __awaiter(Pe,void 0,void 0,(function(){var t,n,r,i,s,u;return __generator(this,(function(l){switch(l.label){case 0:t=true;l.label=1;case 1:l.trys.push([1,9,,10]);n=null;l.label=2;case 2:l.trys.push([2,4,,5]);return[4/*yield*/,d()];case 3:n=l.sent();return[3/*break*/,5];case 4:r=l.sent();he("Error resolving selected shipping country on BC continue",r);return[3/*break*/,5];case 5:
|
|
316
316
|
// When the shopper is committing an international address we're about to
|
|
317
317
|
// save the domestic shipping session and redirect to `/`. Disconnect this
|
|
318
318
|
// /checkout-page observer first: otherwise its own session-detection
|
|
@@ -352,7 +352,7 @@ o.preventDefault();o.stopImmediatePropagation();void l(n,e)}),true)};var h=false
|
|
|
352
352
|
* international default address and chose to stay on the BigCommerce native
|
|
353
353
|
* checkout. Prevents the observer from re-prompting on subsequent DOM
|
|
354
354
|
* mutations.
|
|
355
|
-
*/var
|
|
355
|
+
*/var p=false;
|
|
356
356
|
/**
|
|
357
357
|
* Set to `true` while the logged-in international-address confirmation
|
|
358
358
|
* dialog is open and we are awaiting the user's response. While this
|
|
@@ -360,7 +360,7 @@ o.preventDefault();o.stopImmediatePropagation();void l(n,e)}),true)};var h=false
|
|
|
360
360
|
* `handleInternationalCheckoutSelected` — otherwise the interval would
|
|
361
361
|
* detect the pre-filled international country, show the loading dialog,
|
|
362
362
|
* and redirect before the user has responded to the confirm prompt.
|
|
363
|
-
*/var
|
|
363
|
+
*/var g=false;
|
|
364
364
|
// NOTE: We intentionally do NOT await `checkBigCommerceBypassCustomerGroup()`
|
|
365
365
|
// here before attaching the MutationObserver. The bypass check involves two
|
|
366
366
|
// Storefront API round-trips, and awaiting it synchronously would delay
|
|
@@ -370,22 +370,22 @@ o.preventDefault();o.stopImmediatePropagation();void l(n,e)}),true)};var h=false
|
|
|
370
370
|
// `handleInternationalCheckoutSelected` (both consult the helper), so the
|
|
371
371
|
// top-level gate is redundant. `initBigCommerceBypassCheck()` is called on
|
|
372
372
|
// page load so those inner calls typically resolve against a warm cache.
|
|
373
|
-
var w=new MutationObserver((function(){return __awaiter(
|
|
373
|
+
var w=new MutationObserver((function(){return __awaiter(Pe,void 0,void 0,(function(){var e,s,a,u,d,l,z,k,y,b;var _=this;return __generator(this,(function(C){switch(C.label){case 0:s=document.querySelector(o);a=i();
|
|
374
374
|
// append a hidden button to the body if the shipping address session is found
|
|
375
375
|
if(!s&&a){u=document.createElement("button");u.style.display="none";u.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(u);r===null||r===void 0?void 0:r(a);
|
|
376
376
|
// disconnect the observer after we found the shipping continue button
|
|
377
377
|
w.disconnect();return[2/*return*/]}d=window.location.pathname.includes("/checkout")&&window.Zonos.isBigCommerce;
|
|
378
378
|
// Should just disconnect the observer if it's not bigcommerce domestic checkout page
|
|
379
|
-
if(!d){w.disconnect();return[2/*return*/]}if(!(!
|
|
379
|
+
if(!d){w.disconnect();return[2/*return*/]}if(!(!p&&!m))return[3/*break*/,5];m=true;g=true;C.label=1;case 1:C.trys.push([1,3,4,5]);return[4/*yield*/,po({onInternationalCheckoutSelected:t,onLoggedInInternationalAddressDetected:n})];case 2:l=C.sent();if(l==="redirected"){w.disconnect();return[2/*return*/]}if(l==="optedOut"){
|
|
380
380
|
// User elected to stay on BC native checkout — don't prompt again
|
|
381
381
|
// for the rest of this session. Continue with the rest of the
|
|
382
382
|
// observer logic so the country-change watcher still fires when
|
|
383
383
|
// the user manually picks an international country in BC's UI.
|
|
384
|
-
|
|
384
|
+
p=true;
|
|
385
385
|
// Attach the "Continue" redirect hook now (once). Delegation on
|
|
386
386
|
// `document` keeps it working even after this observer disconnects
|
|
387
387
|
// when the country <select> path sets up its interval below.
|
|
388
|
-
f(w)}return[3/*break*/,5];case 3:z=C.sent();he("Error checking logged-in user shipping address",z);return[3/*break*/,5];case 4:m=false;
|
|
388
|
+
f(w)}return[3/*break*/,5];case 3:z=C.sent();he("Error checking logged-in user shipping address",z);return[3/*break*/,5];case 4:m=false;g=false;return[7/*endfinally*/];case 5:k=document.querySelector(((e=se.genericSettings)===null||e===void 0?void 0:e.bigcommerceDomesticCheckoutCountrySelector)||vo);
|
|
389
389
|
// Shouldn't do anything if it's not bigcommerce domestic checkout page
|
|
390
390
|
if(!k){
|
|
391
391
|
// do nothing if shipping country and the continue button is not found
|
|
@@ -396,15 +396,15 @@ if(v){return[2/*return*/]}v=true;
|
|
|
396
396
|
w.disconnect();y=setInterval((function(){return __awaiter(_,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){switch(t.label){case 0:
|
|
397
397
|
// Don't redirect while the logged-in international-address confirm
|
|
398
398
|
// dialog is open — the user hasn't made their choice yet.
|
|
399
|
-
if(h||
|
|
399
|
+
if(h||g){return[2/*return*/]}h=true;t.label=1;case 1:t.trys.push([1,3,,4]);return[4/*yield*/,c()];case 2:e=t.sent();
|
|
400
400
|
// Stop the interval once either:
|
|
401
401
|
// - the user is being redirected to Zonos international checkout
|
|
402
402
|
// - the logged-in customer is in a bypass group (stay on BC checkout)
|
|
403
|
-
if(e==="redirected"||e==="bypass"){clearInterval(y);return[2/*return*/]}h=false;return[3/*break*/,4];case 3:o=t.sent();h=false;return[3/*break*/,4];case 4:return[2/*return*/]}}))}))}),1e3);b=setInterval((function(){var e;if(!window.bcStripeElements){clearInterval(b);return}var o=(e=window.bcStripeElements)===null||e===void 0?void 0:e.getElement("address");if(!o){return}clearInterval(b);o.on("change",(function(e){var o=e.value.address.country;if(o&&!
|
|
403
|
+
if(e==="redirected"||e==="bypass"){clearInterval(y);return[2/*return*/]}h=false;return[3/*break*/,4];case 3:o=t.sent();h=false;return[3/*break*/,4];case 4:return[2/*return*/]}}))}))}),1e3);b=setInterval((function(){var e;if(!window.bcStripeElements){clearInterval(b);return}var o=(e=window.bcStripeElements)===null||e===void 0?void 0:e.getElement("address");if(!o){return}clearInterval(b);o.on("change",(function(e){var o=e.value.address.country;if(o&&!g){void c(o)}}));
|
|
404
404
|
// we want to attacch event to addressElement as soon as it's loaded
|
|
405
405
|
}),500);return[2/*return*/]}}))}))}));w.observe(document.body,{childList:true,subtree:true})};var wo=function(){var e=new URLSearchParams(window.location.search);ze("legacy urlParams","info",Object.fromEntries(e.entries()));var o=function(o){var t=e.get(o);if(!t||t==="undefined"){return""}return t};var t=
|
|
406
406
|
// fallback to selected country code if country is not provided
|
|
407
|
-
$(e)||q.selectedCountryCode||"US";var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerPhone");var u=o("customerZip");var d=o("customerState");var l=o("customerFirstName");var f=o("customerLastName");return{customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:l,customerLastName:f,customerName:c,customerPhone:a,customerState:d,customerZip:u}};var zo=0;var ko=function(){return __awaiter(
|
|
407
|
+
$(e)||q.selectedCountryCode||"US";var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerPhone");var u=o("customerZip");var d=o("customerState");var l=o("customerFirstName");var f=o("customerLastName");return{customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:l,customerLastName:f,customerName:c,customerPhone:a,customerState:d,customerZip:u}};var zo=0;var ko=function(){return __awaiter(Pe,void 0,void 0,(function(){var e,o;var t;return __generator(this,(function(n){switch(n.label){case 0:
|
|
408
408
|
// Don't send the log if there are no API calls to send
|
|
409
409
|
if(window.Zonos.loadTimeApiInfoList.length===0){return[2/*return*/]}ze("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});e={data:__spreadArray([],window.Zonos.loadTimeApiInfoList,true),storeId:window.Zonos.storeId||0};
|
|
410
410
|
// Clear the list after sending the log successfully
|
|
@@ -412,17 +412,17 @@ window.Zonos.loadTimeApiInfoList.length=0;return[4/*yield*/,de("/api/zonos-eleme
|
|
|
412
412
|
// If there are errors, add the logs back to the list so we can try again later
|
|
413
413
|
(t=window.Zonos.loadTimeApiInfoList).push.apply(t,e.data);zo++;if(zo>5&&window.Zonos.logIntervalId){
|
|
414
414
|
// If there are more than 3 failures, stop the interval
|
|
415
|
-
clearInterval(window.Zonos.logIntervalId)}}return[2/*return*/]}}))}))};var yo=function(){return __awaiter(
|
|
415
|
+
clearInterval(window.Zonos.logIntervalId)}}return[2/*return*/]}}))}))};var yo=function(){return __awaiter(Pe,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){e=ke().elapsedTime;o={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:e,metadata:Object.assign({allLogs:ye},ve()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};void de("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2/*return*/]}))}))};var bo=function(e){return __awaiter(Pe,[e],void 0,(function(e){var o;var t=e.loadTime;return __generator(this,(function(e){o={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:t,metadata:Object.assign({allLogs:ye},ve()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};void de("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2/*return*/]}))}))};var _o=function(e){return(e===null||e===void 0?void 0:e.filter((function(e){if(e.expiresAt&&e.expiresAt<Date.now()||!e.expiresAt){return false}return true})))||[]};var Co=function(e){var o;var t=(o=ee.enabledVariantTestKeys)===null||o===void 0?void 0:o.find((function(o){return o.testKey===e}));return(t===null||t===void 0?void 0:t.selectedVariantKey)||null};var xo=function(e){return se.enabledVariantTestKeys.includes(e)};var So=function(e){var o=e.baseTestObj,t=e.mergeTestObj;return o.map((function(e){var o=e.testKey;
|
|
416
416
|
// We will attempt to get the enabled selection from localStorage first and only re-fetch if the testKeys are changed
|
|
417
|
-
var n=t.find((function(e){var t=e.testKey;return t===o}));return{expiresAt:(n===null||n===void 0?void 0:n.expiresAt)||Date.now()+oe,selectedVariantKey:(n===null||n===void 0?void 0:n.selectedVariantKey)||null,testKey:o}}))};var
|
|
417
|
+
var n=t.find((function(e){var t=e.testKey;return t===o}));return{expiresAt:(n===null||n===void 0?void 0:n.expiresAt)||Date.now()+oe,selectedVariantKey:(n===null||n===void 0?void 0:n.selectedVariantKey)||null,testKey:o}}))};var Io=function(e){return __awaiter(Pe,[e],void 0,(function(e){var o,t,n,r,i;var s=e.cartId,c=e.retries;return __generator(this,(function(e){switch(e.label){case 0:o=le();return[4/*yield*/,de("/api/zonos-elements/get-temp-cart",{body:{isTestMode:o,options:{noOnlineStoreSettings:true},tempCartUUID:s},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:t=e.sent(),n=t.errors,r=t.json;i=!r||n.length;if(!(i&&c))return[3/*break*/,3];ze("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:c});
|
|
418
418
|
// wait 1 second before retrying
|
|
419
419
|
return[4/*yield*/,new Promise((function(e){return setTimeout(e,500)}))];case 2:
|
|
420
420
|
// wait 1 second before retrying
|
|
421
|
-
e.sent();return[2/*return*/,
|
|
421
|
+
e.sent();return[2/*return*/,Io({cartId:s,retries:c-1})];case 3:if(i){return[2/*return*/,null]}return[2/*return*/,r]}}))}))};var To=function(e){return __awaiter(Pe,void 0,void 0,(function(){var o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:o=be(e),t=o.isDgsCartId,n=o.isLegacyCartId;if(!n&&!t){he("[ZONOS - loadZonos] invalid cart id");return[2/*return*/,null]}return[4/*yield*/,Io({cartId:e,retries:5})];case 1:r=i.sent();ze("[ZONOS - loadZonos] getting temp cart data","info",r);if(!r){he("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2/*return*/,null]}window.Zonos.storeId=r.cartData.storeId;window.Zonos.zonosApiKey=r.cartData.credentialToken;return[2/*return*/,{cartData:r.cartData,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}]}}))}))};var Ao='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var Oo=function(){return".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}"};
|
|
422
422
|
// 90 minutes
|
|
423
|
-
var
|
|
423
|
+
var Bo=90*60*1e3;
|
|
424
424
|
// 6 hours
|
|
425
|
-
var
|
|
425
|
+
var Eo=6*60*60*1e3;var Po=e("zonos_checkout",/** @class */function(){function e(e){var t=this;o(this,e);this.storeUnsubscribeList=[];this.isRedirectAfterOrder=false;
|
|
426
426
|
/**
|
|
427
427
|
* Preview checkout without needing to click on the button. This would be useful for demo purpose
|
|
428
428
|
*/this.preview=false;
|
|
@@ -548,7 +548,7 @@ if(!e){return false}return true};
|
|
|
548
548
|
// Register test hosted vs native if needed to get the variant selection for this test
|
|
549
549
|
this.registerTestHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:e=this.shouldAllowHostedVsNativeTest();if(!e){return[2/*return*/]}ze("[TEST] - Registering hosted vs native test");o=Co("hosted_vs_native");
|
|
550
550
|
// No need to request variant test for this test if the test already has variant selected
|
|
551
|
-
if(o){ze("[TEST] - Hosted vs native test already has variant selected: ".concat(o));return[2/*return*/]}return[4/*yield*/,
|
|
551
|
+
if(o){ze("[TEST] - Hosted vs native test already has variant selected: ".concat(o));return[2/*return*/]}return[4/*yield*/,Ue({testKeys:["hosted_vs_native"]})];case 1:t=r.sent();
|
|
552
552
|
// Do not prevent user from proceeding if the test is not enabled or failed to get selection
|
|
553
553
|
if(!t){ze("[TEST] - Failed to get selection for hosted vs native test");return[2/*return*/]}n=So({baseTestObj:ee.enabledVariantTestKeys||[],mergeTestObj:t});
|
|
554
554
|
// Set the selected variant to the storage store
|
|
@@ -558,7 +558,7 @@ this.handleHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(
|
|
|
558
558
|
// This test is only applicable to checkout that's using createCartid callback
|
|
559
559
|
if(typeof se.checkoutSettings.createCartId!=="function"){ze("[TEST] - createCartId is not provided, skipping hosted vs native test");return[2/*return*/,{redirected:false}]}
|
|
560
560
|
// No need to do anything if the test is enabled for native
|
|
561
|
-
if(t!=="hosted"){ze("[TEST] - Hosted vs native test is enabled for native, skipping");return[2/*return*/,{redirected:false}]}if(!((e=se.genericSettings)===null||e===void 0?void 0:e.hostedCheckoutUrl)){ze("[TEST] - Hosted checkout URL is not provided");return[2/*return*/,{redirected:false}]}ze('"createCartId" is provided, start building cart');return[4/*yield*/,se.checkoutSettings.createCartId()];case 1:n=a.sent();i=null;if(typeof n==="object"){r=n.cartId;i=n.shippingData||null}else{r=n}s=wo();c=
|
|
561
|
+
if(t!=="hosted"){ze("[TEST] - Hosted vs native test is enabled for native, skipping");return[2/*return*/,{redirected:false}]}if(!((e=se.genericSettings)===null||e===void 0?void 0:e.hostedCheckoutUrl)){ze("[TEST] - Hosted checkout URL is not provided");return[2/*return*/,{redirected:false}]}ze('"createCartId" is provided, start building cart');return[4/*yield*/,se.checkoutSettings.createCartId()];case 1:n=a.sent();i=null;if(typeof n==="object"){r=n.cartId;i=n.shippingData||null}else{r=n}s=wo();c=Le(Object.assign(Object.assign({cartId:r,checkoutSessionId:ee.checkoutSessionId||undefined,hostedCheckoutUrl:se.genericSettings.hostedCheckoutUrl,isTestMode:le(),isVariantTest:true},s),i));ze("[TEST] - Redirecting to: ".concat(c));
|
|
562
562
|
// Open new page with the cart URL
|
|
563
563
|
window.open(c,"_blank");return[2/*return*/,{redirected:true}]}}))}))};this.formatDate=function(e){if(!e){return""}
|
|
564
564
|
// get date in 24/12/2024 format (without time)
|
|
@@ -617,7 +617,7 @@ return[2/*return*/]}
|
|
|
617
617
|
// Only proceed when user select confirmed.
|
|
618
618
|
if(!(e===null||e===void 0?void 0:e.confirmed)){this.confirmDialogOpen=true;return[2/*return*/]}
|
|
619
619
|
// Close the confirm dialog
|
|
620
|
-
this.confirmDialogOpen=false;
|
|
620
|
+
this.confirmDialogOpen=false;Z({event:"zonos-checkout-close",metadata:{checkoutSessionId:ee.checkoutSessionId}});this.open=this.forceDialogOpen||false;if(!this.preview&&l.step==="finish"){
|
|
621
621
|
// reset cart store if it's not preview mode and only when checkout is in the finish step.
|
|
622
622
|
h()}
|
|
623
623
|
// Clear policy consent on every close (not just finish) so a buyer who
|
|
@@ -629,10 +629,10 @@ l.step="customer-info";
|
|
|
629
629
|
// reset the tab item, so that user needs to click on Continue button to re-quote the landed cost if needed.
|
|
630
630
|
m();
|
|
631
631
|
// clear the checkout session timeout timer when checkout dialog close action is triggered
|
|
632
|
-
|
|
632
|
+
p();
|
|
633
633
|
/**
|
|
634
634
|
* Trigger callback when the checkout is closed
|
|
635
|
-
*/(t=(o=se.checkoutSettings).onClose)===null||t===void 0?void 0:t.call(o);return[2/*return*/]}))}))};e.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a,u,d,h,s,a,a,v,m,s,
|
|
635
|
+
*/(t=(o=se.checkoutSettings).onClose)===null||t===void 0?void 0:t.call(o);return[2/*return*/]}))}))};e.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a,u,d,h,s,a,a,v,m,s,p,k,y,b;return __generator(this,(function(_){switch(_.label){case 0:if(!(typeof se.checkoutSettings.createCartId==="function"))return[3/*break*/,4];ze('"createCartId" is provided, start building cart');
|
|
636
636
|
// Reset before awaiting the merchant callback so a stale banner from a
|
|
637
637
|
// previous open is not visible while the network call is in flight.
|
|
638
638
|
l.customMessage=[];return[4/*yield*/,se.checkoutSettings.createCartId()];case 1:o=_.sent();t=void 0;if(typeof o==="object"){ze("object detected, use cartId and prefill address from createCartId","info",o);t=o.cartId;
|
|
@@ -641,7 +641,7 @@ this.useShippingDataFromCreateCartId(o.shippingData);l.customerAuthenticationTok
|
|
|
641
641
|
// Normalize against misbehaving merchant callbacks: only accept an
|
|
642
642
|
// array of strings, drop everything else so a bad value can't crash
|
|
643
643
|
// the renderer (`.filter(...)` would throw on non-arrays).
|
|
644
|
-
l.customMessage=Array.isArray(o.customMessage)?o.customMessage.filter((function(e){return typeof e==="string"})):[]}else{t=o}window.Zonos.cartId=t;return[4/*yield*/,
|
|
644
|
+
l.customMessage=Array.isArray(o.customMessage)?o.customMessage.filter((function(e){return typeof e==="string"})):[]}else{t=o}window.Zonos.cartId=t;return[4/*yield*/,To(t)];case 2:n=_.sent();r=n===null||n===void 0?void 0:n.cartData;if(!r){he("Failed to build cart, please try again.");return[2/*return*/,false]}window.Zonos.cartData=r;i=ue(r),s=i.adjustments,a=i.cartItems;return[4/*yield*/,f({adjustments:s,cartItems:a})];case 3:_.sent();return[3/*break*/,12];case 4:if(!window.Zonos.cartData)return[3/*break*/,9];ze("tempCartUUID is provided, start building cart");u=(e=window.Zonos.cartData.references)===null||e===void 0?void 0:e.checkoutSessionId;if(!u)return[3/*break*/,6];ze("Setting checkout session id from cart reference","info",u);return[4/*yield*/,this.recoverCompletedOrderModificationSession(u)];case 5:d=_.sent();if(d){
|
|
645
645
|
// Recovery routes straight to the finish step, bypassing the
|
|
646
646
|
// cartStoreUpdateItems call below that would normally clear this -
|
|
647
647
|
// without it, the finish screen would spin forever (dialogLoading
|
|
@@ -650,7 +650,7 @@ c.isFetchingSession=false;return[2/*return*/,true]}ee.checkoutSessionId=u;return
|
|
|
650
650
|
// Same as zonos-collect/zonos-invoice: without this, a checkout
|
|
651
651
|
// session id left over from a previous cart in this tab would leak
|
|
652
652
|
// into this unrelated one.
|
|
653
|
-
ze("Clear checkout session id from storage so we start from a fresh session for this cart");ee.checkoutSessionId=null;_.label=7;case 7:h=ue(window.Zonos.cartData),s=h.adjustments,a=h.cartItems;return[4/*yield*/,f({adjustments:s,cartItems:a})];case 8:_.sent();return[3/*break*/,12];case 9:if(!(se.checkoutSettings.buildCartDetail&&q.selectedCountryCode))return[3/*break*/,12];ze("build cart detail");return[4/*yield*/,se.checkoutSettings.buildCartDetail({countryCode:q.selectedCountryCode,currencyCode:q.targetCurrency})];case 10:a=_.sent();v=a.filter((function(e){return e.amount>=0}));m=a.filter((function(e){return e.amount<0}));ze("cartItems","info",{cartItems:a});s=m.map((function(e){return{amount:e.amount,currencyCode:e.currencyCode,description:e.name||e.description||"",productId:e.productId||null,sku:e.sku||null,type:"CART_TOTAL"}}));return[4/*yield*/,f({adjustments:s,cartItems:v})];case 11:_.sent();_.label=12;case 12:if(!!ee.checkoutSessionId)return[3/*break*/,14];return[4/*yield*/,
|
|
653
|
+
ze("Clear checkout session id from storage so we start from a fresh session for this cart");ee.checkoutSessionId=null;_.label=7;case 7:h=ue(window.Zonos.cartData),s=h.adjustments,a=h.cartItems;return[4/*yield*/,f({adjustments:s,cartItems:a})];case 8:_.sent();return[3/*break*/,12];case 9:if(!(se.checkoutSettings.buildCartDetail&&q.selectedCountryCode))return[3/*break*/,12];ze("build cart detail");return[4/*yield*/,se.checkoutSettings.buildCartDetail({countryCode:q.selectedCountryCode,currencyCode:q.targetCurrency})];case 10:a=_.sent();v=a.filter((function(e){return e.amount>=0}));m=a.filter((function(e){return e.amount<0}));ze("cartItems","info",{cartItems:a});s=m.map((function(e){return{amount:e.amount,currencyCode:e.currencyCode,description:e.name||e.description||"",productId:e.productId||null,sku:e.sku||null,type:"CART_TOTAL"}}));return[4/*yield*/,f({adjustments:s,cartItems:v})];case 11:_.sent();_.label=12;case 12:if(!!ee.checkoutSessionId)return[3/*break*/,14];return[4/*yield*/,g()];case 13:p=_.sent();ze("stripeStoreInitCheckoutSession: ".concat(p));if(!p){return[2/*return*/,false]}_.label=14;case 14:
|
|
654
654
|
// get and set payment intent async except for staging mode
|
|
655
655
|
if(!l.isStagingMode){void w()}
|
|
656
656
|
// apply theme to stripe elements
|
|
@@ -665,7 +665,7 @@ _.sent();k=se.checkoutSettings,y=k.successBehavior,b=k.successRedirectUrl;this.i
|
|
|
665
665
|
// to payment, same as the Collect flow does for its own cart type. Lives
|
|
666
666
|
// here (rather than at each buildCartAndInit call site) so every caller
|
|
667
667
|
// gets it, including the forceDialogOpen/preview init path.
|
|
668
|
-
if(z()){l.step="payment"}return[2/*return*/,true]}}))}))};e.prototype.reloadCheckoutSession=function(){window.location.reload()};e.prototype.handleOrderDuplication=function(){var e=fe(localStorage.getItem("zonos--placed-order-info"));if(!e){localStorage.removeItem("zonos--placed-order-info");return}var o=Date.now()-e.time;ze("=== Existing placed order info: ".concat(e.orderId," - ").concat(this.formatDate(e.time)," - elapsed in hh:ss format: ").concat(new Date(o).toISOString().substring(11,8)),"warn");var t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||
|
|
668
|
+
if(z()){l.step="payment"}return[2/*return*/,true]}}))}))};e.prototype.reloadCheckoutSession=function(){window.location.reload()};e.prototype.handleOrderDuplication=function(){var e=fe(localStorage.getItem("zonos--placed-order-info"));if(!e){localStorage.removeItem("zonos--placed-order-info");return}var o=Date.now()-e.time;ze("=== Existing placed order info: ".concat(e.orderId," - ").concat(this.formatDate(e.time)," - elapsed in hh:ss format: ").concat(new Date(o).toISOString().substring(11,8)),"warn");var t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||Eo;
|
|
669
669
|
// if the order is placed within 5 minutes, confirm with the user to proceed with the order duplication
|
|
670
670
|
if(o>t){ze("=== Existing placed order info is older than ".concat(t,"ms, cleaning localStorage"),"warn");
|
|
671
671
|
// remove the placed order info if it's older than 5 minutes and do nothing.
|
|
@@ -704,7 +704,7 @@ var i=document.querySelectorAll(r.join(","));
|
|
|
704
704
|
// only attach event once, and looping through all of the button elements
|
|
705
705
|
i.forEach((function(n){var r=n.getAttribute("data-zonos-checkout-attached");if(r){
|
|
706
706
|
// do nothing if event is already attached
|
|
707
|
-
return}ze("attached event to button ".concat(o),"info",{button:n});n.addEventListener("click",(function(o){return __awaiter(e,void 0,void 0,(function(){var e,r,i,s,a,u,d,f,h,v,m,g,
|
|
707
|
+
return}ze("attached event to button ".concat(o),"info",{button:n});n.addEventListener("click",(function(o){return __awaiter(e,void 0,void 0,(function(){var e,r,i,s,a,u,d,f,h,v,m,p,g,w,z,x,S,I,T,A;return __generator(this,(function(O){switch(O.label){case 0:i=performance.now();s=t&&n.matches(t);a=n.matches("#".concat(xe));u=n.matches("#".concat(Ce))||n.matches("#".concat(_e));
|
|
708
708
|
// Allow no country set for legacy facades. Otherwise enforce it being a shippable country and not disabled.
|
|
709
709
|
if(!window.Zonos.isLegacyCheckout&&(!ho()||fo())&&!s&&!a&&!u){return[2/*return*/]}o.preventDefault();o.stopPropagation();ze("zonos checkout button clicked");return[4/*yield*/,this.checkStripePaymentIntentStatus({triggeredButton:o.target})];case 1:d=O.sent().shouldAllowOrder;
|
|
710
710
|
// Only allow order to proceed if payment intent is not succeeded
|
|
@@ -716,14 +716,14 @@ if(!d){return[2/*return*/]}
|
|
|
716
716
|
// log the load time of all API calls every 2 seconds. This is to track the load time of all API calls for checkout user
|
|
717
717
|
window.Zonos.logIntervalId=setInterval((function(){void ko()}),2e3)}if(!xo("hosted_vs_native"))return[3/*break*/,4];this.isOverlayLoading=true;return[4/*yield*/,this.registerTestHostedVsNative()];case 2:O.sent();return[4/*yield*/,this.handleHostedVsNative()];case 3:f=O.sent().redirected;this.isOverlayLoading=false;
|
|
718
718
|
// Stop the process if the user is being redirected to the hosted checkout page
|
|
719
|
-
if(f){return[2/*return*/]}O.label=4;case 4:if(!window.Zonos.isBigCommerce)return[3/*break*/,7];return[4/*yield*/,
|
|
719
|
+
if(f){return[2/*return*/]}O.label=4;case 4:if(!window.Zonos.isBigCommerce)return[3/*break*/,7];return[4/*yield*/,Ve()];case 5:h=O.sent().shouldBypass;if(h){ze("Bypass customer group detected, redirecting to BigCommerce native checkout","info");
|
|
720
720
|
// Carry over zonosQaUrl / zonosTestMode so the BC native
|
|
721
721
|
// checkout keeps loading the same Zonos elements build/env.
|
|
722
722
|
window.location.href=Fe("/checkout");return[2/*return*/]}return[4/*yield*/,no()];case 6:v=O.sent();if(v.shouldForceLogin&&v.redirectUrl){window.location.href=v.redirectUrl;return[2/*return*/]}O.label=7;case 7:
|
|
723
723
|
// start loading
|
|
724
|
-
c.isFetchingSession=true;this.open=true;O.label=8;case 8:O.trys.push([8,16,,17]);return[4/*yield*/,this.buildCartAndInit()];case 9:m=O.sent();if(!m){throw new Error("Error building cart")}if(!!window.Zonos.isLegacyCheckout)return[3/*break*/,14];
|
|
724
|
+
c.isFetchingSession=true;this.open=true;O.label=8;case 8:O.trys.push([8,16,,17]);return[4/*yield*/,this.buildCartAndInit()];case 9:m=O.sent();if(!m){throw new Error("Error building cart")}if(!!window.Zonos.isLegacyCheckout)return[3/*break*/,14];p=null;O.label=10;case 10:O.trys.push([10,12,,13]);return[4/*yield*/,k()];case 11:p=O.sent();return[3/*break*/,13];case 12:g=O.sent();
|
|
725
725
|
// A throwing merchant callback should stop checkout, not open it.
|
|
726
|
-
|
|
726
|
+
p=ne("Unable to check inventory. Please try again.");return[3/*break*/,13];case 13:if(p){
|
|
727
727
|
// Surface the same "Couldn't place order" dialog and stop
|
|
728
728
|
// before the checkout is revealed. We return here before the
|
|
729
729
|
// session/analytics setup below runs, so close the (still
|
|
@@ -731,19 +731,19 @@ g=ne("Unable to check inventory. Please try again.");return[3/*break*/,13];case
|
|
|
731
731
|
// half-initialized checkout visible behind the alert. The
|
|
732
732
|
// inventory-failure dialog renders independently of `this.open`,
|
|
733
733
|
// and "Return to cart" resets the message + closes cleanly.
|
|
734
|
-
l.inventoryCheckErrorMessage=
|
|
734
|
+
l.inventoryCheckErrorMessage=p;c.isFetchingSession=false;this.open=false;return[2/*return*/]}O.label=14;case 14:(e=window.opener)===null||e===void 0?void 0:e.postMessage({checkoutSessionId:ee.checkoutSessionId,type:"zonos-checkout-session-update"},"*");
|
|
735
735
|
// start the timer to validate the price
|
|
736
|
-
y({isPreview:this.preview,sessionTimeout:
|
|
736
|
+
y({isPreview:this.preview,sessionTimeout:Bo});Z({event:"zonos-checkout-start",metadata:{checkoutSessionId:ee.checkoutSessionId}});w=ee.checkoutSessionId;void b({checkoutSessionId:w,eventName:"checkout_open"});return[4/*yield*/,De()];case 15:z=O.sent().enabled;
|
|
737
737
|
// Hide discount input if there's no active discount configured for the store
|
|
738
|
-
l.shouldHideDiscountInput=!z;this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void yo()}else{x=performance.now();S=x-i;void bo({loadTime:S})}this.recordCheckoutInfo();
|
|
738
|
+
l.shouldHideDiscountInput=!z;this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void yo()}else{x=performance.now();S=x-i;void bo({loadTime:S})}this.recordCheckoutInfo();I=!!Se();if(I){this.markTheSessionAsAbandonedCart()}return[3/*break*/,17];case 16:T=O.sent();if(T instanceof Error){A=T.message;if(A==="Cart is expired."){this.isCartExpired=true}}
|
|
739
739
|
// stop loading
|
|
740
|
-
c.isFetchingSession=false;he(
|
|
740
|
+
c.isFetchingSession=false;he(T);if(this.isCartExpired){c.isFetchingSession=true;return[2/*return*/]}
|
|
741
741
|
// We want to log the error anytime we fail to create a checkout session
|
|
742
|
-
void me({endpoint:"Error creating Checkout",errors:[
|
|
742
|
+
void me({endpoint:"Error creating Checkout",errors:[T instanceof Error?T.toString():"Unknown error"],metadata:{allLogs:ye,cartId:window.Zonos.cartId,checkoutSessionBody:_(),href:window.location.href,storeBaseUrl:((r=window.Zonos.cartData)===null||r===void 0?void 0:r.storeBaseUrl)||se.onlineStoreSettings.url}});C({messages:[ne("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:ne("Error creating Checkout")});return[3/*break*/,17];case 17:return[2/*return*/]}}))}))}),{
|
|
743
743
|
// Trigger this event before any other event
|
|
744
744
|
capture:true,passive:false});if(!se.checkoutSettings.disablePlaceOrderButtonActivation){n.removeAttribute("disabled")}n.setAttribute("data-zonos-checkout-attached","true");
|
|
745
745
|
// if this button is the hidden button, trigger the click event
|
|
746
|
-
if(n.matches("#".concat(Ce))){n.dispatchEvent(
|
|
746
|
+
if(n.matches("#".concat(Ce))){n.dispatchEvent(Te("click"));
|
|
747
747
|
// cleanup shipping session after button is clicked
|
|
748
748
|
x();
|
|
749
749
|
// remove the button after it's clicked
|
|
@@ -751,7 +751,7 @@ n.remove()}
|
|
|
751
751
|
// For legacy checkout facade and in case the cart or stripe client secret is provided in the query param, open Checkout right away
|
|
752
752
|
if(n.matches("#".concat(_e))){
|
|
753
753
|
// trigger the click event on the button
|
|
754
|
-
n.dispatchEvent(
|
|
754
|
+
n.dispatchEvent(Te("click"));n.remove()}}))};e.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}
|
|
755
755
|
// apply theme to stripe elements
|
|
756
756
|
void this.applyStripeTheme()};e.prototype.useShippingDataFromCreateCartId=function(e){
|
|
757
757
|
// Do only if prefill address is provided
|
|
@@ -770,12 +770,12 @@ $(e)||q.selectedCountryCode;var n=o("customerCity");var r=o("customerEmail");var
|
|
|
770
770
|
* Setup all of the event listeners for the component on first load
|
|
771
771
|
*/e.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var e;var o=this;return __generator(this,(function(t){c.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;
|
|
772
772
|
// Set staging mode on init
|
|
773
|
-
l.isStagingMode=
|
|
773
|
+
l.isStagingMode=pe();
|
|
774
774
|
// Override staging mode if it's provided
|
|
775
775
|
if(typeof this.overrideStagingMode!=="undefined"){l.isStagingMode=this.overrideStagingMode}
|
|
776
776
|
// Start fetching BigCommerce customer group on page load so the bypass
|
|
777
777
|
// result is ready by the time checkout opens or the BC watcher fires
|
|
778
|
-
|
|
778
|
+
Ke();
|
|
779
779
|
// Warm the BigCommerce `/checkouts/settings` fetch (merchant's
|
|
780
780
|
// `guest_checkout_type`) so force-login gating resolves instantly when
|
|
781
781
|
// the shopper clicks checkout — otherwise the first checkout open
|
|
@@ -795,7 +795,7 @@ this.handleBigcommerceInternationalResumeFlag();
|
|
|
795
795
|
// the prefill itself guards against overwriting other prefill sources.
|
|
796
796
|
void this.prefillBigCommerceCustomerAddresses();
|
|
797
797
|
// check if bigcommerce, if user enters the shipping address that's in the shipping zone at bigcommerce checkout
|
|
798
|
-
|
|
798
|
+
go({domesticRedirectedBtnSelector:Ce,onInternationalCheckoutSelected:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.detectedDomesticCheckoutDialogOpen=true;
|
|
799
799
|
// wait for 2 secs
|
|
800
800
|
return[4/*yield*/,new Promise((function(e){return setTimeout(e,2e3)}))];case 1:
|
|
801
801
|
// wait for 2 secs
|
|
@@ -832,7 +832,7 @@ clearInterval(e)}),1e4);return[2/*return*/]}))}))};
|
|
|
832
832
|
* fires against a half-initialized store, which is what happens when
|
|
833
833
|
* the shopper refreshes back into cart.php straight from the login
|
|
834
834
|
* round trip.
|
|
835
|
-
*/e.prototype.handleBigcommerceInternationalResumeFlag=function(){if(!window.Zonos.isBigCommerce){return}var e=new URL(window.location.href);if(e.searchParams.get(Ne)!=="true"){return}e.searchParams.delete(Ne);window.history.replaceState({},"",e.toString());var o=Date.now();var t=setInterval((function(){if(!q.localizationLoaded||!q.selectedCountryCode){if(Date.now()-o>15e3){clearInterval(t);ze("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")}return}var e=document.querySelector("#".concat(xe));if(e){clearInterval(t);e.dispatchEvent(
|
|
835
|
+
*/e.prototype.handleBigcommerceInternationalResumeFlag=function(){if(!window.Zonos.isBigCommerce){return}var e=new URL(window.location.href);if(e.searchParams.get(Ne)!=="true"){return}e.searchParams.delete(Ne);window.history.replaceState({},"",e.toString());var o=Date.now();var t=setInterval((function(){if(!q.localizationLoaded||!q.selectedCountryCode){if(Date.now()-o>15e3){clearInterval(t);ze("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")}return}var e=document.querySelector("#".concat(xe));if(e){clearInterval(t);e.dispatchEvent(Te("click"));return}if(Date.now()-o>15e3){clearInterval(t);ze("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info")}}),200)};
|
|
836
836
|
/**
|
|
837
837
|
* For storybook to set to finish step, this is to trigger in the story for zonos-checkout-finish
|
|
838
838
|
*/e.prototype.setToFinishStep=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){l.step="finish";this.storybookPaymentStatusOverride=e;return[2/*return*/]}))}))};
|
|
@@ -841,21 +841,21 @@ clearInterval(e)}),1e4);return[2/*return*/]}))}))};
|
|
|
841
841
|
*/e.prototype.mockCheckoutSession=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){S(e);return[2/*return*/]}))}))};
|
|
842
842
|
/**
|
|
843
843
|
* Trigger the checkout international button
|
|
844
|
-
*/e.prototype.triggerCheckoutInternational=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(o){e=document.querySelector("#".concat(xe));if(e){e.dispatchEvent(
|
|
844
|
+
*/e.prototype.triggerCheckoutInternational=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(o){e=document.querySelector("#".concat(xe));if(e){e.dispatchEvent(Te("click"))}return[2/*return*/]}))}))};e.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a;var u=this;return __generator(this,(function(d){switch(d.label){case 0:
|
|
845
845
|
// submit google tag when the form is complete
|
|
846
|
-
|
|
846
|
+
Z({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:ee.checkoutSessionId}});r=ee.checkoutSessionId;void b({checkoutSessionId:r,eventName:"checkout_customerInfoCompleted"});this.submitLoading=true;return[4/*yield*/,I()];case 1:i=d.sent().isRequestNotReady;
|
|
847
847
|
// If the request is not ready at the time user click Continue, logging it out so we can investigate the issue
|
|
848
848
|
if(i&&l.addressFormRenderType==="stripe"){void me({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:(o=(e=c.stripeAddressEventData)===null||e===void 0?void 0:e.value)===null||o===void 0?void 0:o.address,billingAddress:(n=(t=c.stripeBillingAddressEventData)===null||t===void 0?void 0:t.value)===null||n===void 0?void 0:n.address,cartId:window.Zonos.cartId}})}s=function(e){if(l.step!=="customer-info"){
|
|
849
849
|
// stop interval if the step is not customer-info
|
|
850
850
|
clearInterval(e);return}if(!c.isFetchingLandedCost){if(l.landedCostData){
|
|
851
851
|
// start init paypal with the presentment currency when landed cost is fetched
|
|
852
|
-
void
|
|
852
|
+
void K({currency:l.currency});
|
|
853
853
|
// only go to next step if landed cost data is ready
|
|
854
|
-
|
|
854
|
+
T()}u.submitLoading=false;if(e){clearInterval(e)}}};
|
|
855
855
|
// Immediately move to the next step
|
|
856
856
|
s();a=setInterval((function(){s(a)}),20);
|
|
857
857
|
// cleanup interval if no data is fetched after 10 seconds
|
|
858
|
-
setTimeout((function(){clearInterval(a)}),1e4);return[2/*return*/]}}))}))};e.prototype.handleShippingContinue=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){
|
|
858
|
+
setTimeout((function(){clearInterval(a)}),1e4);return[2/*return*/]}}))}))};e.prototype.handleShippingContinue=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){T();return[2/*return*/]}))}))};e.prototype.handleInventoryCheckDialogConfirm=function(){
|
|
859
859
|
// reset inventory check message to close the inventory check alert
|
|
860
860
|
l.inventoryCheckErrorMessage=null;
|
|
861
861
|
// close the dialog only when it's not hosted checkout
|
|
@@ -873,7 +873,7 @@ return[2/*return*/]}
|
|
|
873
873
|
// Close the dialog after the user confirms to proceed with the payment in USD
|
|
874
874
|
this.payInUsdConfirmDialogOpen=false;o=A();h.label=1;case 1:h.trys.push([1,,18,19]);
|
|
875
875
|
// reset paypal error message
|
|
876
|
-
|
|
876
|
+
G.paypalErrorMessage=null;
|
|
877
877
|
// reset error state
|
|
878
878
|
c.hasPaymentError=false;this.submitLoading=true;
|
|
879
879
|
// reset inventory check message
|
|
@@ -889,21 +889,21 @@ l.inventoryCheckErrorMessage=ne("Unable to check inventory. Please try again.");
|
|
|
889
889
|
// Don't proceed to payment if there's an error message
|
|
890
890
|
if(l.inventoryCheckErrorMessage){
|
|
891
891
|
// stop the submit loading state
|
|
892
|
-
this.submitLoading=false;return[2/*return*/]}i=M();if(!(i>0))return[3/*break*/,8];return[4/*yield*/,
|
|
892
|
+
this.submitLoading=false;return[2/*return*/]}i=M();if(!(i>0))return[3/*break*/,8];return[4/*yield*/,B()];case 7:s=h.sent();if(!s.success){c.hasPaymentError=true;c.customErrorMessage=s.error||ne("Unable to apply store credit. Please try again.");this.submitLoading=false;return[2/*return*/]}h.label=8;case 8:if(!E())return[3/*break*/,14];h.label=9;case 9:h.trys.push([9,12,,13]);return[4/*yield*/,P()];case 10:a=h.sent();if(!a.valid){c.hasPaymentError=true;c.customErrorMessage=a.errorMessage;this.submitLoading=false;return[2/*return*/]}return[4/*yield*/,D()];case 11:u=h.sent();if(!u.success){c.hasPaymentError=true;c.customErrorMessage=u.error||ne("Unable to place order with store credit. Please try again.");this.submitLoading=false;return[2/*return*/]}T();p();return[3/*break*/,13];case 12:d=h.sent();he(d);Z({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:ee.checkoutSessionId}});c.hasPaymentError=true;return[3/*break*/,13];case 13:this.submitLoading=false;return[2/*return*/];case 14:h.trys.push([14,16,,17]);
|
|
893
893
|
// Order-modification payment-only sessions skip the shipping step,
|
|
894
894
|
// so cartStore.selectedLandedCost is never populated — bypass the
|
|
895
895
|
// landed-cost guard the same way zonos-collect does for its own
|
|
896
896
|
// no-shipping-step flow.
|
|
897
|
-
return[4/*yield*/,
|
|
897
|
+
return[4/*yield*/,U({noLandedCostCheck:z()})];case 15:
|
|
898
898
|
// Order-modification payment-only sessions skip the shipping step,
|
|
899
899
|
// so cartStore.selectedLandedCost is never populated — bypass the
|
|
900
900
|
// landed-cost guard the same way zonos-collect does for its own
|
|
901
901
|
// no-shipping-step flow.
|
|
902
|
-
h.sent();
|
|
902
|
+
h.sent();T();
|
|
903
903
|
// clear the checkout session timeout timer when purchase is complete
|
|
904
|
-
|
|
904
|
+
p();return[3/*break*/,17];case 16:f=h.sent();he(f);Z({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:ee.checkoutSessionId}});c.hasPaymentError=true;
|
|
905
905
|
// should request inventory refund if there's an error during payment
|
|
906
|
-
if(c.shouldInventoryRefund){void
|
|
906
|
+
if(c.shouldInventoryRefund){void L();c.shouldInventoryRefund=false}return[3/*break*/,17];case 17:this.submitLoading=false;return[3/*break*/,19];case 18:
|
|
907
907
|
// Release the consent lock on every terminal exit (success or failure)
|
|
908
908
|
// so the buyer can re-toggle / retry. On success the cart advances and
|
|
909
909
|
// the close-handler reset would clean this up anyway.
|
|
@@ -925,9 +925,9 @@ if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData){e=window.Zonos.cartData
|
|
|
925
925
|
* @ref https://github.com/vercel/next.js/issues/33233#issuecomment-1052349396
|
|
926
926
|
**/if(!n){window.history.replaceState(window.history.state,document.title,t);
|
|
927
927
|
// Reload the page
|
|
928
|
-
window.location.reload()}return[2/*return*/]}}))}))};e.prototype.handleWindowResize=function(){this.isMobile=
|
|
928
|
+
window.location.reload()}return[2/*return*/]}}))}))};e.prototype.handleWindowResize=function(){this.isMobile=ge(this.mobile);
|
|
929
929
|
// apply theme to stripe elements
|
|
930
|
-
void this.applyStripeTheme();ze("mobile: ".concat(this.isMobile))};e.prototype.handleMobileChange=function(){this.isMobile=
|
|
930
|
+
void this.applyStripeTheme();ze("mobile: ".concat(this.isMobile))};e.prototype.handleMobileChange=function(){this.isMobile=ge(this.mobile);
|
|
931
931
|
// apply theme to stripe elements
|
|
932
932
|
void this.applyStripeTheme();ze("mobile: ".concat(this.isMobile))};e.prototype.handleAppearanceSettingsOverrideChange=function(){var e;if((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme){
|
|
933
933
|
// update theme to browser preference theme if appearance theme is system
|
|
@@ -951,7 +951,7 @@ o.style.removeProperty("overflow")}
|
|
|
951
951
|
// reset overflow state to original state
|
|
952
952
|
if(r){t.removeAttribute(e);t.style.overflow=r}else{
|
|
953
953
|
// just remove the overflow style if it's not set
|
|
954
|
-
t.style.removeProperty("overflow")}}};e.prototype.componentWillLoad=function(){var e=this;void this.init();this.isMobile=
|
|
954
|
+
t.style.removeProperty("overflow")}}};e.prototype.componentWillLoad=function(){var e=this;void this.init();this.isMobile=ge(this.mobile);this.isIframed=window.self!==window.top;ze("iframed: ".concat(this.isIframed));
|
|
955
955
|
// Set checkout session if redirect
|
|
956
956
|
if(window.Zonos.isLegacyCheckout){this.captureParamsRedirectedForVariantTest()}
|
|
957
957
|
// update theme to browser preference theme if appearance theme is system
|
|
@@ -996,27 +996,27 @@ l.step!=="finish"&&l.step!=="error"&&!c.stripeElements||c.isFetchingSession;
|
|
|
996
996
|
// track completion via cartStore.tabItems, only ever flipped by those
|
|
997
997
|
// steps' own continue handlers) would otherwise show a stale, frozen
|
|
998
998
|
// bar instead of reflecting that this is a single-step flow.
|
|
999
|
-
var d=z();var f=ae(se.appearance,this.appearanceSettingsOverride||null),h=f.colorPrimary,v=f.colorSecondary,m=f.logoUrl,
|
|
999
|
+
var d=z();var f=ae(se.appearance,this.appearanceSettingsOverride||null),h=f.colorPrimary,v=f.colorSecondary,m=f.logoUrl,p=f.style;var g=se.appearance.zonosAttribution==="ENABLED";var w=se.appearance.theme;var k=h&&Oe(h)?"DARK":"LIGHT";
|
|
1000
1000
|
// use right side theme if it's mobile, otherwise use themePrimaryColorBased
|
|
1001
1001
|
var y=this.isMobile?w:k;
|
|
1002
1002
|
// only use submit button color if it's on desktop
|
|
1003
1003
|
var b=!this.isMobile?v:undefined;var _=q.customMessages;var C=(o=_.find((function(e){return e.pageName==="checkout_default"})))===null||o===void 0?void 0:o.message;var x=this.getCurrentLocalePageEnum();var S=_.filter((function(e){return e.pageName===x}));
|
|
1004
1004
|
|
|
1005
|
-
var
|
|
1005
|
+
var I=this.getBaseCurrencySettlementInfo();var T=function(){
|
|
1006
1006
|
// add timestamp to logo url if it's preview mode so browser won't cache it on the dashboard setting
|
|
1007
|
-
var o=e.preview?"".concat(m,"?timestamp=").concat(Date.now()):m;return t("div",{class:"zonos--logo"},o&&t("img",{alt:"".concat(se.organizationName," logo"),src:o}))};var A=le();var O=function(){var o=new URLSearchParams(window.location.search);var n=o.get("zonosQaUrl");var r=o.get("zonosDebug");var i=o.get("zonosE2ETest");var s=e.overrideStagingMode||
|
|
1007
|
+
var o=e.preview?"".concat(m,"?timestamp=").concat(Date.now()):m;return t("div",{class:"zonos--logo"},o&&t("img",{alt:"".concat(se.organizationName," logo"),src:o}))};var A=le();var O=function(){var o=new URLSearchParams(window.location.search);var n=o.get("zonosQaUrl");var r=o.get("zonosDebug");var i=o.get("zonosE2ETest");var s=e.overrideStagingMode||pe();return t("zonos-v-stack",null,t("div",{class:"zonos--logo-wrapper"},T(),A&&t("zonos-badge",{badgeColor:"orange",size:"small"},ne("Test mode")),s&&t("zonos-badge",{badgeColor:"red",size:"small"},ne("Staging mode")),r==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),n&&t("zonos-badge",{badgeColor:"purple",size:"small"},n),i&&t("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),!d&&t("zonos-checkout-progress-tabs",{backgroundColor:
|
|
1008
1008
|
// only use different contrast color when the secondary color is too off with the background in mobile
|
|
1009
|
-
e.isMobile?"--zonos-elements-gray-0":null}),S.map((function(e){return t("zonos-custom-message",{icon:Ao,message:e.message})})))};var
|
|
1009
|
+
e.isMobile?"--zonos-elements-gray-0":null}),S.map((function(e){return t("zonos-custom-message",{icon:Ao,message:e.message})})))};var B=function(){if(l.checkoutSessionTimeoutShow){return t("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:ne("Your checkout session has expired. Please reload the page to continue."),restStateTitle:ne("Session timed out"),restStateType:"Warning"},t("zonos-button",{onClick:function(){return e.reloadCheckoutSession()},variant:"primary"},ne("Reload")))}return t("div",{class:"zonos--content",style:{"--zonos--border-radius":Ae({overrideBorderStyle:p})}},l.step!=="finish"&&l.step!=="error"&&t(n,null,t("div",{class:"zonos--left","data-theme":y,style:Be({"--zonos--primary-color":!e.isMobile?h:undefined})},!e.isMobile&&O(),l.step==="customer-info"&&t("zonos-customer-info",{continueLoading:e.submitLoading,defaultAddress:e.getDefaultAddress(),isMobile:e.isMobile,onContinueClicked:function(){return e.handleCustomerInfoContinue()},submitBtnColor:b}),l.step==="shipping"&&t("zonos-shipping",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return e.handleShippingContinue()},submitBtnColor:b}),l.step==="payment"&&t("zonos-checkout-payment",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,this.handleStripePaymentContinue()];case 1:e.sent();return[2/*return*/]}}))}))},submitBtnColor:b})),t("div",{class:"zonos--right","data-theme":w},e.isMobile&&O(),t("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&t("zonos-currency-toggle",null),!e.isLegacyCheckout&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:Ee}),noBackground:true,onClick:function(){return e.closeDialogHandler()}})),t("div",{class:"flex--wrapper"},t("div",{class:"zonos--wrapper"},t("zonos-review",{collapsed:e.collapseReviewMobile,mobile:e.isMobile,onClick:function(){
|
|
1010
1010
|
// do nothing if it's not mobile
|
|
1011
1011
|
if(!e.isMobile){return}e.collapseReviewMobile=!e.collapseReviewMobile}}),t("zonos-collapse",{
|
|
1012
1012
|
// only collapsible on mobile
|
|
1013
|
-
collapsed:e.collapseReviewMobile&&e.isMobile},t("zonos-cart-items",null),e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",{submitBtnColor:b}),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Ao,message:C})))),t("zonos-cart-restricted-items",null),!e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",null),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Ao,message:C}))))),(l.step==="finish"||l.step==="error")&&t("div",{class:"zonos--done","data-theme":w},t("div",{class:"zonos--header"},
|
|
1013
|
+
collapsed:e.collapseReviewMobile&&e.isMobile},t("zonos-cart-items",null),e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",{submitBtnColor:b}),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Ao,message:C})))),t("zonos-cart-restricted-items",null),!e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",null),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Ao,message:C}))))),(l.step==="finish"||l.step==="error")&&t("div",{class:"zonos--done","data-theme":w},t("div",{class:"zonos--header"},T(),!e.isRedirectAfterOrder&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:Ee}),noBackground:true,onClick:function(){return e.handleFinishClick()},theme:w})),t("zonos-checkout-finish",{borderRadius:p,onCloseClick:function(){return e.handleFinishClick()},overrideNotification:l.step==="error"&&!!l.error?Object.assign(Object.assign({},l.error),{type:"error"}):undefined,storybookForceStatus:e.storybookPaymentStatusOverride})),t("zonos-checkout-footer",{"data-theme":w,mobile:e.isMobile,
|
|
1014
1014
|
/**
|
|
1015
1015
|
* For this component, use slot instead of passing JSX through prop of other component. Because
|
|
1016
1016
|
* the click outside event will be triggered on and targeted to whichever component that it's attached to.
|
|
1017
1017
|
* Move it into <slot /> would resolve the issue.
|
|
1018
1018
|
*/
|
|
1019
|
-
slot:!e.isMobile?"dialog-footer":undefined}))};return t(r,{class:
|
|
1019
|
+
slot:!e.isMobile?"dialog-footer":undefined}))};return t(r,{class:Ie(["zonos--checkout zonos--elements",l.step==="payment"&&"zonos--processing-payment",g&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?B():t("zonos-dialog",{borderStyle:p,class:"zonos--checkout-dialog","data-theme":w,height:"980px",isLoading:u,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return e.closeDialogHandler()},open:this.open,width:"1200px"},B()),t("zonos-dialog",{isLoading:true,loadingText:ne("You will be redirected to international checkout shortly."),loadingTitle:ne("We detected that you are shipping to an international address."),noClickOutside:true,noCloseButton:true,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),t("zonos-dialog",{isLoading:true,loadingText:ne("You will be redirected to domestic checkout shortly."),loadingTitle:ne("We detected that you are shipping to a domestic address."),noClickOutside:true,noCloseButton:true,open:this.redirectToDomesticCheckoutDialogOpen,width:"450px"}),t("zonos-confirm-dialog",{class:"zonos--logged-in-intl-address-dialog",dialogCancelBtnText:ne("Stay on this page"),dialogConfirmBtnText:ne("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:ne("Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:ne("International shipping address detected"),dialogWidth:480,onCancelClicked:function(){var o;e.loggedInIntlAddressConfirmDialogOpen=false;(o=e.loggedInIntlAddressResolver)===null||o===void 0?void 0:o.call(e,"stay");e.loggedInIntlAddressResolver=null},onConfirmClicked:function(){var o;e.loggedInIntlAddressConfirmDialogOpen=false;(o=e.loggedInIntlAddressResolver)===null||o===void 0?void 0:o.call(e,"redirect");e.loggedInIntlAddressResolver=null}}),t("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:ne("Don't close"),dialogConfirmBtnText:ne("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:ne("Would you like to close checkout and return to the site?"),dialogTitle:ne("Are you sure?"),onCancelClicked:function(){e.confirmDialogOpen=false},
|
|
1020
1020
|
// Mark user selected confirm to close the dialog
|
|
1021
1021
|
onConfirmClicked:function(){return e.closeDialogHandler({confirmed:true})}}),t("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:ne("Return to merchant site"),dialogConfirmBtnText:ne("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:
|
|
1022
1022
|
/**
|
|
@@ -1032,7 +1032,7 @@ dialogOpen:!!l.inventoryCheckErrorMessage,
|
|
|
1032
1032
|
// If dialog is in open state, the message should not be null
|
|
1033
1033
|
dialogSubtitle:l.inventoryCheckErrorMessage,dialogTitle:ne("Couldn't place order"),dialogType:"alert",
|
|
1034
1034
|
// Mark user selected confirm to close the dialog
|
|
1035
|
-
onConfirmClicked:function(){return e.handleInventoryCheckDialogConfirm()}}),
|
|
1035
|
+
onConfirmClicked:function(){return e.handleInventoryCheckDialogConfirm()}}),I&&t("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:ne("Cancel"),dialogConfirmBtnText:ne("Pay [orderTotal]",{orderTotal:ie({amount:I.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:ne("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:ne("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){e.payInUsdConfirmDialogOpen=false},
|
|
1036
1036
|
// Mark user selected confirm to continue with payment
|
|
1037
1037
|
onConfirmClicked:function(){return e.handleStripePaymentContinue()}}),t("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:ne("OK"),dialogIntent:"danger",
|
|
1038
1038
|
// Show dialog if inventory check error message is not null
|
|
@@ -1040,4 +1040,4 @@ dialogOpen:this.isCartExpired,
|
|
|
1040
1040
|
// If dialog is in open state, the message should not be null
|
|
1041
1041
|
dialogSubtitle:ne("You are being sent back to the shop to re-add items to your cart."),dialogTitle:ne("Shopping cart expired"),dialogType:"alert",
|
|
1042
1042
|
// Mark user selected confirm to close the dialog
|
|
1043
|
-
onConfirmClicked:function(){return e.handleCartExpiredDialogConfirm()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{appearanceSettingsOverride:[{appearanceSettingsOverrideChanged:0},{handleAppearanceSettingsOverrideChange:0}],overrideStagingMode:[{overrideStagingModeChanged:0}],mobile:[{handleMobileChange:0}],defaultAddress:[{handleAddressChange:0}],customerProfile:[{handleCustomerProfileChange:0}],clientSecret:[{handleClientSecretChange:0}],stripeCustomerSessionClientSecret:[{handleClientSecretChange:0}],open:[{handleOpenChange:0}]}},enumerable:false,configurable:true});return e}());
|
|
1043
|
+
onConfirmClicked:function(){return e.handleCartExpiredDialogConfirm()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{appearanceSettingsOverride:[{appearanceSettingsOverrideChanged:0},{handleAppearanceSettingsOverrideChange:0}],overrideStagingMode:[{overrideStagingModeChanged:0}],mobile:[{handleMobileChange:0}],defaultAddress:[{handleAddressChange:0}],customerProfile:[{handleCustomerProfileChange:0}],clientSecret:[{handleClientSecretChange:0}],stripeCustomerSessionClientSecret:[{handleClientSecretChange:0}],open:[{handleOpenChange:0}]}},enumerable:false,configurable:true});return e}());Po.style=Oo()}}}));
|