@zonos/elements 1.3.223 → 1.3.224
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/VarianceTest-bec00ea8.js +91 -0
- package/dist/cjs/{cart-3a2a062c.js → cart-af017ac3.js} +41 -40
- package/dist/cjs/{debounce-465a4328.js → debounce-2c9f3f1e.js} +1 -1
- package/dist/cjs/{getBorderRadius-1b5e33cf.js → getBorderRadius-c7d9f676.js} +1 -1
- package/dist/cjs/{handleFetch-45f35cac.js → handleFetch-954f30e1.js} +5 -82
- package/dist/cjs/index.cjs.js +40 -37
- package/dist/cjs/{isDarkColor-428965f4.js → isDarkColor-994c38e4.js} +1 -1
- package/dist/cjs/{localization-12e7e934.js → localization-21030292.js} +82 -24
- package/dist/cjs/{paypal-a1377508.js → paypal-2b22f0f5.js} +17 -16
- package/dist/cjs/{placeTestOrder-6fcce33e.js → placeTestOrder-9cde1ca4.js} +3 -3
- package/dist/cjs/{renderFallback-39ba034b.js → renderFallback-9300dbaf.js} +8 -7
- package/dist/cjs/{translationStore-951ed4b4.js → translationStore-ce2c700d.js} +1 -1
- package/dist/cjs/{updateCheckoutSessionAttributes-c0853fdd.js → updateCheckoutSessionAttributes-a4899e90.js} +2 -2
- package/dist/cjs/zonos-address_11.cjs.entry.js +16 -16
- package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
- package/dist/cjs/zonos-banner_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-button_3.cjs.entry.js +4 -4
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +25 -25
- package/dist/cjs/zonos-checkout.cjs.entry.js +68 -67
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +8 -8
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +19 -19
- package/dist/cjs/zonos-collect.cjs.entry.js +20 -20
- package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-controller.cjs.entry.js +40 -39
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +6 -6
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +14 -14
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
- package/dist/cjs/zonos-hello.cjs.entry.js +12 -12
- package/dist/cjs/zonos-input.cjs.entry.js +3 -3
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +5 -5
- package/dist/cjs/zonos-text.cjs.entry.js +2 -2
- package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
- package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
- package/dist/cjs/{zonosStore-f8ee56aa.js → zonosStore-5d489c65.js} +8 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +4 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -0
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.css +1 -0
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/store/hello/localization.js +12 -9
- package/dist/collection/components/store/zonosStore.js +8 -1
- package/dist/collection/components/utils/api/getZonosSettings.js +2 -0
- package/dist/collection/components/utils/hello/currencyConversion/currencyDisplay.js +2 -0
- package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +5 -0
- package/dist/collection/components/utils/logging/sendLoadCheckoutFacadeLog.js +1 -1
- package/dist/collection/components/utils/logging/sendLoadNativeCheckoutLog.js +1 -1
- package/dist/collection/scripts/_zonosBase.js +3 -0
- package/dist/collection/types/generated/graphql.internal.types.js +3 -0
- package/dist/collection/utils/performBlurCurrency.js +50 -0
- package/dist/esm/VarianceTest-572cecf5.js +86 -0
- package/dist/esm/{cart-7f06662c.js → cart-11b87221.js} +7 -6
- package/dist/esm/{debounce-c34d1270.js → debounce-f081e4d8.js} +1 -1
- package/dist/esm/{getBorderRadius-87593ff4.js → getBorderRadius-6281d902.js} +1 -1
- package/dist/esm/{handleFetch-99218189.js → handleFetch-a844cac1.js} +2 -76
- package/dist/esm/index.js +13 -9
- package/dist/esm/{isDarkColor-1f58b6be.js → isDarkColor-83e0c27e.js} +1 -1
- package/dist/esm/{localization-192886e4.js → localization-9320a65d.js} +71 -13
- package/dist/esm/{paypal-53f1b4a1.js → paypal-338a4350.js} +7 -6
- package/dist/esm/{placeTestOrder-95cbb623.js → placeTestOrder-d28f33c2.js} +3 -3
- package/dist/esm/{renderFallback-6352363c.js → renderFallback-28ef3364.js} +5 -4
- package/dist/esm/{translationStore-fb98a08d.js → translationStore-7eebaa41.js} +1 -1
- package/dist/esm/{updateCheckoutSessionAttributes-92f42882.js → updateCheckoutSessionAttributes-160720f6.js} +2 -2
- package/dist/esm/zonos-address_11.entry.js +9 -9
- package/dist/esm/zonos-badge.entry.js +2 -2
- package/dist/esm/zonos-banner_2.entry.js +3 -3
- package/dist/esm/zonos-button_3.entry.js +4 -4
- package/dist/esm/zonos-cart-items_12.entry.js +12 -12
- package/dist/esm/zonos-checkout.entry.js +15 -14
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-collect-cart-items_3.entry.js +8 -8
- package/dist/esm/zonos-collect-finish_6.entry.js +11 -11
- package/dist/esm/zonos-collect.entry.js +10 -10
- package/dist/esm/zonos-confirm-dialog_2.entry.js +4 -4
- package/dist/esm/zonos-controller.entry.js +10 -9
- package/dist/esm/zonos-country-flag.entry.js +5 -5
- package/dist/esm/zonos-country-select_4.entry.js +6 -6
- package/dist/esm/zonos-empty-state-payment_4.entry.js +9 -9
- package/dist/esm/zonos-hello-dialog.entry.js +5 -5
- package/dist/esm/zonos-hello.entry.js +6 -6
- package/dist/esm/zonos-input.entry.js +3 -3
- package/dist/esm/zonos-language-select_2.entry.js +5 -5
- package/dist/esm/zonos-logo.entry.js +2 -2
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-stripe-input.entry.js +5 -5
- package/dist/esm/zonos-text.entry.js +2 -2
- package/dist/esm/zonos-toggle.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +2 -2
- package/dist/esm/{zonosStore-c456b933.js → zonosStore-e3d0493a.js} +8 -2
- package/dist/esm-es5/VarianceTest-572cecf5.js +1 -0
- package/dist/esm-es5/cart-11b87221.js +1 -0
- package/dist/esm-es5/{debounce-c34d1270.js → debounce-f081e4d8.js} +1 -1
- package/dist/esm-es5/{getBorderRadius-87593ff4.js → getBorderRadius-6281d902.js} +1 -1
- package/dist/esm-es5/handleFetch-a844cac1.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-1f58b6be.js → isDarkColor-83e0c27e.js} +1 -1
- package/dist/esm-es5/localization-9320a65d.js +1 -0
- package/dist/esm-es5/{paypal-53f1b4a1.js → paypal-338a4350.js} +2 -2
- package/dist/esm-es5/{placeTestOrder-95cbb623.js → placeTestOrder-d28f33c2.js} +1 -1
- package/dist/esm-es5/renderFallback-28ef3364.js +1 -0
- package/dist/esm-es5/{translationStore-fb98a08d.js → translationStore-7eebaa41.js} +1 -1
- package/dist/esm-es5/{updateCheckoutSessionAttributes-92f42882.js → updateCheckoutSessionAttributes-160720f6.js} +1 -1
- package/dist/esm-es5/zonos-address_11.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner_2.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.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-confirm-dialog_2.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-empty-state-payment_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-input.entry.js +1 -1
- 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-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-toggle.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/esm-es5/zonosStore-e3d0493a.js +1 -0
- package/dist/scripts/blurCurrencyOnInit.js +1 -0
- package/dist/scripts/index.d.ts +38 -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/scripts/_zonosBase.d.ts +8 -3
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +7 -3
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +2 -2
- package/dist/types/types/generated/graphql.internal.types.d.ts +13 -2
- package/dist/types/types/generated/graphql.internal.types.ts +13 -2
- package/dist/types/types/global.d.ts +8 -0
- package/dist/types/types/utils/ZonosSettings.d.ts +8 -2
- package/dist/types/utils/performBlurCurrency.d.ts +2 -0
- package/dist/zonos-elements/base.css +1 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-01174496.system.js +1 -0
- package/dist/zonos-elements/p-0260fd13.js +1 -0
- package/dist/zonos-elements/{p-e970f2aa.system.entry.js → p-04c1dc63.system.entry.js} +1 -1
- package/dist/zonos-elements/p-0a377722.js +1 -0
- package/dist/zonos-elements/p-0a92e3fd.entry.js +1 -0
- package/dist/zonos-elements/{p-8350937d.system.entry.js → p-0b6a3a09.system.entry.js} +1 -1
- package/dist/zonos-elements/p-0d82e1fd.entry.js +1 -0
- package/dist/zonos-elements/{p-a7485913.system.js → p-0ec82d78.system.js} +2 -2
- package/dist/zonos-elements/{p-2b9c124d.js → p-0ffd710e.js} +1 -1
- package/dist/zonos-elements/p-112c6453.system.js +1 -0
- package/dist/zonos-elements/{p-62fa680d.system.js → p-182da73f.system.js} +1 -1
- package/dist/zonos-elements/p-1868a283.entry.js +1 -0
- package/dist/zonos-elements/{p-ba18c5f5.system.entry.js → p-1a67ae71.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-520bd291.system.entry.js → p-1b9cc0e2.system.entry.js} +1 -1
- package/dist/zonos-elements/p-1c5ba523.js +1 -0
- package/dist/zonos-elements/p-1ef793d0.entry.js +1 -0
- package/dist/zonos-elements/{p-0ed63ce0.system.js → p-23c46dfa.system.js} +1 -1
- package/dist/zonos-elements/{p-e7f8595f.system.js → p-24e26a2c.system.js} +1 -1
- package/dist/zonos-elements/p-252fa1da.entry.js +1 -0
- package/dist/zonos-elements/{p-53b46925.entry.js → p-2616ba72.entry.js} +1 -1
- package/dist/zonos-elements/p-2657f099.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7d2d2c94.entry.js → p-2dc38ef3.entry.js} +1 -1
- package/dist/zonos-elements/{p-12ce9746.system.entry.js → p-360d7101.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-19f25feb.system.entry.js → p-375994d1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ee6f8c02.system.entry.js → p-38f42f10.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4637f365.system.entry.js → p-4004c838.system.entry.js} +1 -1
- package/dist/zonos-elements/p-41dd1cb8.js +1 -0
- package/dist/zonos-elements/{p-e63b8b24.system.js → p-433d76b4.system.js} +1 -1
- package/dist/zonos-elements/{p-a77ed1b9.entry.js → p-4523b982.entry.js} +1 -1
- package/dist/zonos-elements/{p-fc27467b.entry.js → p-4ce3489a.entry.js} +1 -1
- package/dist/zonos-elements/{p-a61a9b65.system.entry.js → p-4da7b6a8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7b56e345.js → p-4dfe97ad.js} +2 -2
- package/dist/zonos-elements/{p-cd1ebef9.system.js → p-57413c34.system.js} +1 -1
- package/dist/zonos-elements/{p-4d9ad3b1.system.entry.js → p-576d76fa.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5c43ecdf.system.entry.js +1 -0
- package/dist/zonos-elements/{p-9fdd3264.system.entry.js → p-5f7a9b69.system.entry.js} +1 -1
- package/dist/zonos-elements/p-6092af05.entry.js +1 -0
- package/dist/zonos-elements/{p-9b062dfb.entry.js → p-67787bd4.entry.js} +1 -1
- package/dist/zonos-elements/{p-7c4e7651.entry.js → p-6bab9096.entry.js} +1 -1
- package/dist/zonos-elements/p-6d423364.entry.js +1 -0
- package/dist/zonos-elements/p-725605f6.system.js +1 -0
- package/dist/zonos-elements/p-7af39c98.js +1 -0
- package/dist/zonos-elements/{p-7f7abdf2.system.entry.js → p-7cee0e68.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7eb8e2d4.js +1 -0
- package/dist/zonos-elements/p-81b357f7.system.js +1 -1
- package/dist/zonos-elements/p-820ad058.js +1 -0
- package/dist/zonos-elements/{p-5e3d2bd2.system.entry.js → p-873b6185.system.entry.js} +1 -1
- package/dist/zonos-elements/p-89c5164b.system.js +1 -0
- package/dist/zonos-elements/p-91f32c73.system.js +1 -0
- package/dist/zonos-elements/{p-245f6ad4.system.entry.js → p-9e03a145.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0ae53ff0.js → p-a199bb13.js} +1 -1
- package/dist/zonos-elements/p-ae3e4f2b.entry.js +1 -0
- package/dist/zonos-elements/{p-567f7de7.entry.js → p-b4bf2f03.entry.js} +1 -1
- package/dist/zonos-elements/p-b5b3f908.system.js +1 -0
- package/dist/zonos-elements/{p-a5b0a636.entry.js → p-b658c28a.entry.js} +1 -1
- package/dist/zonos-elements/{p-de626806.system.entry.js → p-b6ef4a5e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4f8563ad.system.entry.js → p-b91df44b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e8accbef.system.entry.js → p-ba334962.system.entry.js} +1 -1
- package/dist/zonos-elements/p-bccd49d7.system.entry.js +1 -0
- package/dist/zonos-elements/p-bdeb20cb.js +1 -0
- package/dist/zonos-elements/{p-a95d2034.system.entry.js → p-bfc0fc85.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c4b3c878.entry.js → p-c81f6387.entry.js} +1 -1
- package/dist/zonos-elements/{p-efa6203f.entry.js → p-c998e4ed.entry.js} +1 -1
- package/dist/zonos-elements/{p-9396059b.entry.js → p-cb0e6468.entry.js} +1 -1
- package/dist/zonos-elements/{p-421dfb66.system.entry.js → p-cb11d11b.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cc599cd9.entry.js +1 -0
- package/dist/zonos-elements/p-ce4c6ae0.entry.js +1 -0
- package/dist/zonos-elements/{p-14f9bc8c.entry.js → p-d2f7ea09.entry.js} +1 -1
- package/dist/zonos-elements/{p-0c0fda23.js → p-d42b5113.js} +1 -1
- package/dist/zonos-elements/{p-00423fa0.system.js → p-d531b524.system.js} +1 -1
- package/dist/zonos-elements/p-d938f42f.system.js +1 -0
- package/dist/zonos-elements/{p-f4fa8720.entry.js → p-d96545ae.entry.js} +1 -1
- package/dist/zonos-elements/{p-eb6a35ce.system.entry.js → p-dc56b469.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-45d288d0.system.entry.js → p-e00e5d64.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8194fcd8.entry.js → p-e60b988c.entry.js} +1 -1
- package/dist/zonos-elements/{p-56e0ed65.js → p-e688e493.js} +1 -1
- package/dist/zonos-elements/{p-295d9c07.system.entry.js → p-f548807d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e7b05da2.entry.js → p-f912e9c3.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.css +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +4 -3
- package/dist/cjs/VarianceTest-0cb1e118.js +0 -12
- package/dist/esm/VarianceTest-fef2d958.js +0 -10
- package/dist/esm-es5/VarianceTest-fef2d958.js +0 -1
- package/dist/esm-es5/cart-7f06662c.js +0 -1
- package/dist/esm-es5/handleFetch-99218189.js +0 -1
- package/dist/esm-es5/localization-192886e4.js +0 -1
- package/dist/esm-es5/renderFallback-6352363c.js +0 -1
- package/dist/esm-es5/zonosStore-c456b933.js +0 -1
- package/dist/zonos-elements/p-04a01cb1.js +0 -1
- package/dist/zonos-elements/p-062430f9.system.js +0 -1
- package/dist/zonos-elements/p-0e28207a.js +0 -1
- package/dist/zonos-elements/p-1cd1da90.system.js +0 -1
- package/dist/zonos-elements/p-2131fa8b.entry.js +0 -1
- package/dist/zonos-elements/p-30432622.system.entry.js +0 -1
- package/dist/zonos-elements/p-366ea017.entry.js +0 -1
- package/dist/zonos-elements/p-3f3c92db.system.entry.js +0 -1
- package/dist/zonos-elements/p-4a3abbf2.js +0 -1
- package/dist/zonos-elements/p-4dcbbd60.js +0 -1
- package/dist/zonos-elements/p-5a2dd041.system.js +0 -1
- package/dist/zonos-elements/p-640a6898.system.js +0 -1
- package/dist/zonos-elements/p-6afbbe66.entry.js +0 -1
- package/dist/zonos-elements/p-6cfe66fe.entry.js +0 -1
- package/dist/zonos-elements/p-6f6573a5.system.js +0 -1
- package/dist/zonos-elements/p-7ce093aa.js +0 -1
- package/dist/zonos-elements/p-9d863a3b.system.js +0 -1
- package/dist/zonos-elements/p-a435931e.system.entry.js +0 -1
- package/dist/zonos-elements/p-a8a312b2.js +0 -1
- package/dist/zonos-elements/p-a9b3cfe1.entry.js +0 -1
- package/dist/zonos-elements/p-abcefd25.entry.js +0 -1
- package/dist/zonos-elements/p-b76db2ac.js +0 -1
- package/dist/zonos-elements/p-bbf48b31.entry.js +0 -1
- package/dist/zonos-elements/p-bdf183a3.entry.js +0 -1
- package/dist/zonos-elements/p-d1b415cd.entry.js +0 -1
- package/dist/zonos-elements/p-d2098bef.entry.js +0 -1
- package/dist/zonos-elements/p-da200c19.system.js +0 -1
- package/dist/zonos-elements/p-df0cbde4.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CartAdjustmentType, CartCheckoutWorkflowQuery, CartType, CountryCode, CurrencyCode, ItemMeasurementType, ItemType, ItemUnitOfMeasure } from "../../generated/graphql.internal.types";
|
|
1
|
+
import type { CartAdjustmentType, CartCheckoutWorkflowQuery, CartType, CountryCode, CurrencyCode, ItemMeasurementType, ItemType, ItemUnitOfMeasure, LandedCostSettingsQuery } from "../../generated/graphql.internal.types";
|
|
2
2
|
import type { GenericZonosSettings } from "../../utils/ZonosSettings";
|
|
3
3
|
export type NormalizedItemAttribute = {
|
|
4
4
|
key: string;
|
|
@@ -59,7 +59,7 @@ export type NormalizedTempCart = {
|
|
|
59
59
|
storeId: number;
|
|
60
60
|
type: CartType;
|
|
61
61
|
};
|
|
62
|
-
type Settings = Omit<CartCheckoutWorkflowQuery['cartCheckoutWorkflow'], 'cart'> & {
|
|
62
|
+
type Settings = Omit<CartCheckoutWorkflowQuery['cartCheckoutWorkflow'], 'cart'> & LandedCostSettingsQuery & {
|
|
63
63
|
genericSettings: GenericZonosSettings | null;
|
|
64
64
|
};
|
|
65
65
|
export type CartCheckoutResult = {
|
|
@@ -2193,6 +2193,7 @@ export declare const landedCostQuoteType: {
|
|
|
2193
2193
|
readonly Collect: "COLLECT";
|
|
2194
2194
|
readonly Hello: "HELLO";
|
|
2195
2195
|
readonly InclusivePrice: "INCLUSIVE_PRICE";
|
|
2196
|
+
readonly PrepayCollect: "PREPAY_COLLECT";
|
|
2196
2197
|
};
|
|
2197
2198
|
export type LandedCostQuoteType = (typeof landedCostQuoteType)[keyof typeof landedCostQuoteType];
|
|
2198
2199
|
export declare const landedCostTariffRate: {
|
|
@@ -2412,6 +2413,8 @@ export declare const orderBillingAdjustmentFeeType: {
|
|
|
2412
2413
|
readonly BrokerageFee: "BROKERAGE_FEE";
|
|
2413
2414
|
readonly Buffer: "BUFFER";
|
|
2414
2415
|
readonly Cod: "COD";
|
|
2416
|
+
readonly CollectOrder: "COLLECT_ORDER";
|
|
2417
|
+
readonly CollectPercent: "COLLECT_PERCENT";
|
|
2415
2418
|
readonly Country: "COUNTRY";
|
|
2416
2419
|
readonly CurrencyConversionFee: "CURRENCY_CONVERSION_FEE";
|
|
2417
2420
|
readonly DdpServiceFee: "DDP_SERVICE_FEE";
|
|
@@ -4118,6 +4121,7 @@ export type GetTaxIdByCountryQuery = {
|
|
|
4118
4121
|
};
|
|
4119
4122
|
export type LandedCostSettingsQuery = {
|
|
4120
4123
|
landedCostSettings: {
|
|
4124
|
+
defaultNativeCurrency: CurrencyCode | null;
|
|
4121
4125
|
landedCostGuarantee: LandedCostGuaranteeType | null;
|
|
4122
4126
|
} | null;
|
|
4123
4127
|
};
|
|
@@ -4448,7 +4452,7 @@ export type CartCheckoutWorkflowQuery = {
|
|
|
4448
4452
|
checkoutSettings: {
|
|
4449
4453
|
allowedCharacterSets: AllowedCharacterSets;
|
|
4450
4454
|
allowedSettlementCurrencies: AllowedSettlementCurrencies;
|
|
4451
|
-
|
|
4455
|
+
successBehavior: CheckoutSuccessBehavior;
|
|
4452
4456
|
captureDelay: number;
|
|
4453
4457
|
companyFieldsStatus: CheckoutCompanyFieldsStatus;
|
|
4454
4458
|
createdAt: string;
|
|
@@ -4487,7 +4491,7 @@ export type CartCheckoutWorkflowQuery = {
|
|
|
4487
4491
|
organization: string;
|
|
4488
4492
|
placeOrderButtonSelector: string | null;
|
|
4489
4493
|
subscriptionStatus: CheckoutSubscriptionStatus;
|
|
4490
|
-
|
|
4494
|
+
successRedirectUrl: string;
|
|
4491
4495
|
analyticsProviders: Array<{
|
|
4492
4496
|
status: AnalyticsProviderStatus;
|
|
4493
4497
|
type: AnalyticsProviderType;
|
|
@@ -4532,6 +4536,10 @@ export type CartCheckoutWorkflowQuery = {
|
|
|
4532
4536
|
updatedBy: string;
|
|
4533
4537
|
visibilityStatus: HelloVisibilityStatus;
|
|
4534
4538
|
};
|
|
4539
|
+
landedCostSettings: {
|
|
4540
|
+
defaultNativeCurrency: CurrencyCode | null;
|
|
4541
|
+
landedCostGuarantee: LandedCostGuaranteeType | null;
|
|
4542
|
+
};
|
|
4535
4543
|
onlineStoreSettings: {
|
|
4536
4544
|
allowedDomains: Array<string>;
|
|
4537
4545
|
url: string;
|
|
@@ -4634,6 +4642,7 @@ export type GetReceiptCheckoutSessionQuery = {
|
|
|
4634
4642
|
} | null;
|
|
4635
4643
|
createdAt: string;
|
|
4636
4644
|
id: string;
|
|
4645
|
+
paymentMethods: Array<string> | null;
|
|
4637
4646
|
paymentProcessor: PaymentProcessorCode;
|
|
4638
4647
|
paymentStatus: OrderPaymentStatus;
|
|
4639
4648
|
}> | null;
|
|
@@ -4675,6 +4684,7 @@ export type GetReceiptOrderQuery = {
|
|
|
4675
4684
|
} | null;
|
|
4676
4685
|
createdAt: string;
|
|
4677
4686
|
id: string;
|
|
4687
|
+
paymentMethods: Array<string> | null;
|
|
4678
4688
|
paymentProcessor: PaymentProcessorCode;
|
|
4679
4689
|
paymentStatus: OrderPaymentStatus;
|
|
4680
4690
|
}> | null;
|
|
@@ -4711,6 +4721,7 @@ export type ReceiptOrderFragment = {
|
|
|
4711
4721
|
} | null;
|
|
4712
4722
|
createdAt: string;
|
|
4713
4723
|
id: string;
|
|
4724
|
+
paymentMethods: Array<string> | null;
|
|
4714
4725
|
paymentProcessor: PaymentProcessorCode;
|
|
4715
4726
|
paymentStatus: OrderPaymentStatus;
|
|
4716
4727
|
}> | null;
|
|
@@ -2651,6 +2651,7 @@ export const landedCostQuoteType = {
|
|
|
2651
2651
|
Collect: 'COLLECT',
|
|
2652
2652
|
Hello: 'HELLO',
|
|
2653
2653
|
InclusivePrice: 'INCLUSIVE_PRICE',
|
|
2654
|
+
PrepayCollect: 'PREPAY_COLLECT',
|
|
2654
2655
|
} as const;
|
|
2655
2656
|
|
|
2656
2657
|
export type LandedCostQuoteType =
|
|
@@ -2914,6 +2915,8 @@ export const orderBillingAdjustmentFeeType = {
|
|
|
2914
2915
|
BrokerageFee: 'BROKERAGE_FEE',
|
|
2915
2916
|
Buffer: 'BUFFER',
|
|
2916
2917
|
Cod: 'COD',
|
|
2918
|
+
CollectOrder: 'COLLECT_ORDER',
|
|
2919
|
+
CollectPercent: 'COLLECT_PERCENT',
|
|
2917
2920
|
Country: 'COUNTRY',
|
|
2918
2921
|
CurrencyConversionFee: 'CURRENCY_CONVERSION_FEE',
|
|
2919
2922
|
DdpServiceFee: 'DDP_SERVICE_FEE',
|
|
@@ -4765,6 +4768,7 @@ export type GetTaxIdByCountryQuery = {
|
|
|
4765
4768
|
|
|
4766
4769
|
export type LandedCostSettingsQuery = {
|
|
4767
4770
|
landedCostSettings: {
|
|
4771
|
+
defaultNativeCurrency: CurrencyCode | null;
|
|
4768
4772
|
landedCostGuarantee: LandedCostGuaranteeType | null;
|
|
4769
4773
|
} | null;
|
|
4770
4774
|
};
|
|
@@ -5056,7 +5060,7 @@ export type CartCheckoutWorkflowQuery = {
|
|
|
5056
5060
|
checkoutSettings: {
|
|
5057
5061
|
allowedCharacterSets: AllowedCharacterSets;
|
|
5058
5062
|
allowedSettlementCurrencies: AllowedSettlementCurrencies;
|
|
5059
|
-
|
|
5063
|
+
successBehavior: CheckoutSuccessBehavior;
|
|
5060
5064
|
captureDelay: number;
|
|
5061
5065
|
companyFieldsStatus: CheckoutCompanyFieldsStatus;
|
|
5062
5066
|
createdAt: string;
|
|
@@ -5095,7 +5099,7 @@ export type CartCheckoutWorkflowQuery = {
|
|
|
5095
5099
|
organization: string;
|
|
5096
5100
|
placeOrderButtonSelector: string | null;
|
|
5097
5101
|
subscriptionStatus: CheckoutSubscriptionStatus;
|
|
5098
|
-
|
|
5102
|
+
successRedirectUrl: string;
|
|
5099
5103
|
analyticsProviders: Array<{
|
|
5100
5104
|
status: AnalyticsProviderStatus;
|
|
5101
5105
|
type: AnalyticsProviderType;
|
|
@@ -5137,6 +5141,10 @@ export type CartCheckoutWorkflowQuery = {
|
|
|
5137
5141
|
updatedBy: string;
|
|
5138
5142
|
visibilityStatus: HelloVisibilityStatus;
|
|
5139
5143
|
};
|
|
5144
|
+
landedCostSettings: {
|
|
5145
|
+
defaultNativeCurrency: CurrencyCode | null;
|
|
5146
|
+
landedCostGuarantee: LandedCostGuaranteeType | null;
|
|
5147
|
+
};
|
|
5140
5148
|
onlineStoreSettings: { allowedDomains: Array<string>; url: string };
|
|
5141
5149
|
organizationId: string;
|
|
5142
5150
|
shippingZones: Array<{
|
|
@@ -5208,6 +5216,7 @@ export type GetReceiptCheckoutSessionQuery = {
|
|
|
5208
5216
|
cardDetail: { cardBrand: string | null; last4: string | null } | null;
|
|
5209
5217
|
createdAt: string;
|
|
5210
5218
|
id: string;
|
|
5219
|
+
paymentMethods: Array<string> | null;
|
|
5211
5220
|
paymentProcessor: PaymentProcessorCode;
|
|
5212
5221
|
paymentStatus: OrderPaymentStatus;
|
|
5213
5222
|
}> | null;
|
|
@@ -5243,6 +5252,7 @@ export type GetReceiptOrderQuery = {
|
|
|
5243
5252
|
cardDetail: { cardBrand: string | null; last4: string | null } | null;
|
|
5244
5253
|
createdAt: string;
|
|
5245
5254
|
id: string;
|
|
5255
|
+
paymentMethods: Array<string> | null;
|
|
5246
5256
|
paymentProcessor: PaymentProcessorCode;
|
|
5247
5257
|
paymentStatus: OrderPaymentStatus;
|
|
5248
5258
|
}> | null;
|
|
@@ -5275,6 +5285,7 @@ export type ReceiptOrderFragment = {
|
|
|
5275
5285
|
cardDetail: { cardBrand: string | null; last4: string | null } | null;
|
|
5276
5286
|
createdAt: string;
|
|
5277
5287
|
id: string;
|
|
5288
|
+
paymentMethods: Array<string> | null;
|
|
5278
5289
|
paymentProcessor: PaymentProcessorCode;
|
|
5279
5290
|
paymentStatus: OrderPaymentStatus;
|
|
5280
5291
|
}> | null;
|
|
@@ -31,6 +31,14 @@ declare global {
|
|
|
31
31
|
* A flag to determine if the current page is a BigCommerce page
|
|
32
32
|
*/
|
|
33
33
|
stencilBootstrap?: unknown;
|
|
34
|
+
/**
|
|
35
|
+
* Currency selector to perform blur currency on init
|
|
36
|
+
*/
|
|
37
|
+
zonosBlurCurrencyOnInitCurrencySelector?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Interval id to perform blur currency on init
|
|
40
|
+
*/
|
|
41
|
+
zonosBlurCurrencyOnInitIntervalId?: NodeJS.Timeout;
|
|
34
42
|
}
|
|
35
43
|
|
|
36
44
|
namespace NodeJS {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { CountryFields } from "../CountryFields";
|
|
2
|
-
import type { AppearanceSettingsQuery, CheckoutSettingsQuery, CountryCode, HelloSettingsQuery, OnlineStoreSettingsQuery, OrganizationQuery } from "../generated/graphql.internal.types";
|
|
2
|
+
import type { AppearanceSettingsQuery, CheckoutSettingsQuery, CountryCode, HelloSettingsQuery, LandedCostSettingsQuery, OnlineStoreSettingsQuery, OrganizationQuery, ShippingZonesQuery } from "../generated/graphql.internal.types";
|
|
3
3
|
export type GenericZonosSettings = {
|
|
4
|
+
/**
|
|
5
|
+
* Whether to blur the currency while initializing Zonos to avoid price flickering.
|
|
6
|
+
*/
|
|
7
|
+
blurCurrencyOnInit?: boolean;
|
|
4
8
|
/**
|
|
5
9
|
* Country that should be enable the custom address fields in the checkout based on the country user is from.
|
|
6
10
|
*/
|
|
@@ -36,7 +40,9 @@ export type GenericZonosSettings = {
|
|
|
36
40
|
*/
|
|
37
41
|
usdSettlementCountryEnabled?: CountryCode[];
|
|
38
42
|
};
|
|
39
|
-
export type ZonosSettingsBase = AppearanceSettingsQuery & CheckoutSettingsQuery & HelloSettingsQuery & OnlineStoreSettingsQuery & OrganizationQuery
|
|
43
|
+
export type ZonosSettingsBase = AppearanceSettingsQuery & CheckoutSettingsQuery & HelloSettingsQuery & OnlineStoreSettingsQuery & OrganizationQuery & ShippingZonesQuery & {
|
|
44
|
+
landedCostSettings: NonNullable<LandedCostSettingsQuery['landedCostSettings']>;
|
|
45
|
+
};
|
|
40
46
|
export type ZonosSettings = ZonosSettingsBase & {
|
|
41
47
|
genericSettings: GenericZonosSettings | null;
|
|
42
48
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.z--blur{filter:blur(5px);transition:filter .3s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{g as r,a as i,l,h as u,b as m}from"./p-a8a312b2.js";import{g as p,_ as w,c as f,a as h}from"./p-b2d81c98.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-b2d81c98.js";export{a as availableTestKeys}from"./p-04a01cb1.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const y=["jsdelivr","cdnjs","unpkg","vercel"],v="jsdelivr",O=e=>{const n=y.indexOf(e);return y[n+1]||null},S=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.223.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return l(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},g="https://js.stripe.com/v3",z=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,b="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let j=null;const N=Promise.resolve().then((()=>{return e=null,null!==j||(j=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(b),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${g}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&z.test(o.src))return o}return null})();t&&e?console.warn(b):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${g}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),j;var e}));let I=!1;N.catch((e=>{I||console.warn(e)}));const k=async({cartId:e,retries:n})=>{const t=r(),s=o(),i=p()||void 0,c=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&c.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:d,json:a,zonosMode:m}=await u(`/api/zonos-elements/get-cart?${c.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:i,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),w=!a||d.length;return w&&n?(l("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),k({cartId:e,retries:n-1})):w?null:Object.assign(Object.assign({},a),{zonosMode:m})};var T;const R=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),$="https://v1.3.223.js.zonos.com",Z=R||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.223",L="https://fonts.googleapis.com",U=/^https:\/\/fonts\.googleapis\.com/;class A{}T=A,A.doneInit=!1,A.cartSettings=null,A.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),A.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),A._paypalMockResponse=null,A.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,A.isBigCommerce=!1,A.releaseDate="1752091697360",A.isLegacyCheckout=!1,A.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",A.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),A.overrideUseCustomAddressForm=!1,A.isCollect=!1,A.isNpm=!0,A.zonosQaUrl=null,A.zonosQaUrlApi=null,A.trackEventLogs=[],A.version="v1.3.223",A.modeAlerted=!1,A.cartData=null,A.paypal=null,A.zonosMode=null,A.IframeService=t,A.getCurrentTimestamp=()=>(new Date).getTime(),A.zonosController=null,A.loadTimeApiInfoList=[],A.logIntervalId=null,A.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d,storeId:a,zonosApiKey:p}=e;if(T.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),T.doneInit)return;if(l(`====== ZONOS DEBUG MODE: on (${T.version}) ======`),T.zonosApiKey=p,T.storeId=a,T.isNpm){l("====== ZONOS LOADING FROM NPM ======");const n=S();if(n&&!window.isZonosPreview){l(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=T.isNpm,window.Zonos.isBigCommerce=T.isBigCommerce,window.Zonos.isLegacyCheckout=T.isLegacyCheckout,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!p&&!T.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!T.cartData&&T.cartId){l("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=w(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await k({cartId:e,retries:5});return l("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(T.cartId);if(!e)return void m("Failed to get cart data");T.cartData=e.cartData,T.zonosApiKey=e.zonosApiKey,T.cartSettings=e.settings}const o=await(async()=>{const e=r(),n=i();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(l("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return l("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(l(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(T.zonosApiKey=o)}const h=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(T.cartId&&T.cartData||h){l("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${f}`,document.body.appendChild(e)}l("init zonos"),T.restoreNativeBrowserFunctions(),T.injectCustomScriptForHostedCheckout(),T.injectZonosCdn(),T.injectZonosCss(),T.injectFonts(),T.injectCheckoutInternationalButton(),T.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d}}),T.doneInit=!0},A.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${h}`)){const e=document.createElement("button");e.id=h,e.style.display="none",document.body.appendChild(e)}},A.injectCustomScriptForHostedCheckout=()=>{const e=T.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){l("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){l("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else l("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},A.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},A.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${h}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},A.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},A.showNotification=e=>{var n;null===(n=T.zonosController)||void 0===n||n.showNotification(e)},A.updateOrganizationName=e=>{var n;null===(n=T.zonosController)||void 0===n||n.updateOrganizationName(e)},A.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},A.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},A.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=T.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;l("loading Stripe");const o=await(async(...e)=>{I=!0;const n=Date.now();return N.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(n.publishableKey);o?(window.Zonos.stripe=o,window.Zonos.isCollect?t.initCollectElement(o):t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),T.zonosController=t,l("Zonos controller injected!")},A.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${T.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void l(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,r=document.createElement("script");n?r.type="module":r.noModule=!0,r.src=t,r.crossOrigin="anonymous",r.onerror=()=>{m(`Failed to load ${r.src}`);const t=O(e);t&&T.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(r)},A.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return Z;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.223";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.223";case"vercel":return $}};return T.isNpm&&S()||n()},A.injectZonosCdn=()=>{T.injectScript({cdnType:v,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),T.injectScript({cdnType:v,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),l("Zonos cdn script injected!")},A.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=T.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${$}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=O(e);o&&T.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},A.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?l("Zonos style links already injected","warn"):(T.injectStylesheet({cdnType:v,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),l("Zonos style css injected!"))},A.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void l("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!U.test(o.href))return o}return null})())return void l("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=L,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${L}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),l("Zonos font injected!")},A.setupGoogleFont=e=>{var n;null===(n=T.zonosController)||void 0===n||n.setupGoogleFont(e)},A.injectSupportGoogleFont=e=>{var n;l(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${L}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=L,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void l(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),l(`[FONT] ${o} font injected!`)};const C=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],E=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],P=[...C,...E];export{A as Zonos,P as checkoutSessionAttributeKeys,E as checkoutSessionImmutableAttributeKeys,C as checkoutSessionMutableAttributeKeys}
|
|
1
|
+
import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{l as r}from"./p-0a377722.js";export{a as availableTestKeys}from"./p-0a377722.js";import{g as i,a as l,h as u,l as m}from"./p-41dd1cb8.js";import{g as p,_ as w,c as f,a as h}from"./p-b2d81c98.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-b2d81c98.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const y=["jsdelivr","cdnjs","unpkg","vercel"],v="jsdelivr",O=e=>{const n=y.indexOf(e);return y[n+1]||null},S=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.224.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return r(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},g="https://js.stripe.com/v3",z=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,j="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let b=null;const N=Promise.resolve().then((()=>{return e=null,null!==b||(b=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(j),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${g}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&z.test(o.src))return o}return null})();t&&e?console.warn(j):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${g}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),b;var e}));let I=!1;N.catch((e=>{I||console.warn(e)}));const k=async({cartId:e,retries:n})=>{const t=i(),s=o(),c=p()||void 0,d=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&d.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:l,json:a,zonosMode:m}=await u(`/api/zonos-elements/get-cart?${d.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:c,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),w=!a||l.length;return w&&n?(r("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),k({cartId:e,retries:n-1})):w?null:Object.assign(Object.assign({},a),{zonosMode:m})};var T;const R=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),$=Date.now(),Z="https://v1.3.224.js.zonos.com",L=R||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.224",U="https://fonts.googleapis.com",A=/^https:\/\/fonts\.googleapis\.com/;class C{}T=C,C.doneInit=!1,C.cartSettings=null,C.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),C.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),C._paypalMockResponse=null,C.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,C.isBigCommerce=!1,C.releaseDate="1752786758525",C.isLegacyCheckout=!1,C.startLoadTime=$,C.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",C.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),C.overrideUseCustomAddressForm=!1,C.isCollect=!1,C.isNpm=!0,C.zonosQaUrl=null,C.zonosQaUrlApi=null,C.trackEventLogs=[],C.version="v1.3.224",C.modeAlerted=!1,C.cartData=null,C.paypal=null,C.zonosMode=null,C.IframeService=t,C.getCurrentTimestamp=()=>(new Date).getTime(),C.zonosController=null,C.loadTimeApiInfoList=[],C.logIntervalId=null,C.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d,storeId:a,zonosApiKey:p}=e;if(T.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),T.doneInit)return;if(r(`====== ZONOS DEBUG MODE: on (${T.version}) ======`),T.zonosApiKey=p,T.storeId=a,T.isNpm){r("====== ZONOS LOADING FROM NPM ======");const n=S();if(n&&!window.isZonosPreview){r(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=T.isNpm,window.Zonos.isBigCommerce=T.isBigCommerce,window.Zonos.isLegacyCheckout=T.isLegacyCheckout,window.Zonos.zonosMode=T.zonosMode,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!p&&!T.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!T.cartData&&T.cartId){r("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=w(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await k({cartId:e,retries:5});return r("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(T.cartId);if(!e)return void m("Failed to get cart data");T.cartData=e.cartData,T.zonosApiKey=e.zonosApiKey,T.cartSettings=e.settings}const o=await(async()=>{const e=i(),n=l();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(r("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return r("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(r(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(T.zonosApiKey=o)}const h=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(T.cartId&&T.cartData||h){r("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${f}`,document.body.appendChild(e)}r("init zonos"),T.restoreNativeBrowserFunctions(),T.injectCustomScriptForHostedCheckout(),T.injectZonosCdn(),T.injectZonosCss(),T.injectFonts(),T.injectCheckoutInternationalButton(),T.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d}}),T.doneInit=!0},C.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${h}`)){const e=document.createElement("button");e.id=h,e.style.display="none",document.body.appendChild(e)}},C.injectCustomScriptForHostedCheckout=()=>{const e=T.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){r("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){r("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else r("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},C.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},C.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${h}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},C.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},C.showNotification=e=>{var n;null===(n=T.zonosController)||void 0===n||n.showNotification(e)},C.updateOrganizationName=e=>{var n;null===(n=T.zonosController)||void 0===n||n.updateOrganizationName(e)},C.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},C.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},C.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=T.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;r("loading Stripe");const o=await(async(...e)=>{I=!0;const n=Date.now();return N.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(n.publishableKey);o?(window.Zonos.stripe=o,window.Zonos.isCollect?t.initCollectElement(o):t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),T.zonosController=t,r("Zonos controller injected!")},C.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${T.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void r(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,i=document.createElement("script");n?i.type="module":i.noModule=!0,i.src=t,i.crossOrigin="anonymous",i.onerror=()=>{m(`Failed to load ${i.src}`);const t=O(e);t&&T.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(i)},C.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return L;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.224";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.224";case"vercel":return Z}};return T.isNpm&&S()||n()},C.injectZonosCdn=()=>{T.injectScript({cdnType:v,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),T.injectScript({cdnType:v,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),r("Zonos cdn script injected!")},C.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=T.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${Z}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=O(e);o&&T.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},C.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?r("Zonos style links already injected","warn"):(T.injectStylesheet({cdnType:v,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),r("Zonos style css injected!"))},C.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void r("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${U}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!A.test(o.href))return o}return null})())return void r("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=U,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${U}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),r("Zonos font injected!")},C.setupGoogleFont=e=>{var n;null===(n=T.zonosController)||void 0===n||n.setupGoogleFont(e)},C.injectSupportGoogleFont=e=>{var n;r(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${U}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=U,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void r(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),r(`[FONT] ${o} font injected!`)};const E=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],P=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],F=[...E,...P];export{C as Zonos,F as checkoutSessionAttributeKeys,P as checkoutSessionImmutableAttributeKeys,E as checkoutSessionMutableAttributeKeys}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(n,e,r,o){function t(n){return n instanceof r?n:new r((function(e){e(n)}))}return new(r||(r=Promise))((function(r,i){function a(n){try{s(o.next(n))}catch(n){i(n)}}function u(n){try{s(o["throw"](n))}catch(n){i(n)}}function s(n){n.done?r(n.value):t(n.value).then(a,u)}s((o=o.apply(n,e||[])).next())}))};var __generator=this&&this.__generator||function(n,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,t,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(n){return function(e){return s([n,e])}}function s(u){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(r=0)),r)try{if(o=1,t&&(i=u[0]&2?t["return"]:u[0]?t["throw"]||((i=t["return"])&&i.call(t),0):t.next)&&!(i=i.call(t,u[1])).done)return i;if(t=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:r.label++;return{value:u[1],done:false};case 5:r.label++;t=u[1];u=[0];continue;case 7:u=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1];i=u;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(u);break}if(i[2])r.ops.pop();r.trys.pop();continue}u=e.call(n,r)}catch(n){u=[6,n];t=0}finally{o=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(n,e,r){if(r||arguments.length===2)for(var o=0,t=e.length,i;o<t;o++){if(i||!(o in e)){if(!i)i=Array.prototype.slice.call(e,0,o);i[o]=e[o]}}return n.concat(i||Array.prototype.slice.call(e))};System.register(["./p-d938f42f.system.js"],(function(n){"use strict";var e;return{setters:[function(n){e=n.l}],execute:function(){var r=this;var o=n("l",(function(n){var r=[];for(var o=1;o<arguments.length;o++){r[o-1]=arguments[o]}e.apply(void 0,__spreadArray([n,"error"],r,false))}));var t=n("a",(function(){return window.location.search.includes("zonosStagingMode=1")}));var i=n("g",(function(){var n;return((n=window.Zonos.zonosApiKey)===null||n===void 0?void 0:n.includes("test"))||window.location.search.includes("zonosTestMode=1")}));var a=["cloudflare","vercel"];var u=a[0];var s=n("f",{cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"});var c=s[u];var d=function(n){if(n===void 0){n=u}var e=a.indexOf(n);var r=a[e+1];if(!r){return null}return r};var l=n("j",(function(n){if(typeof n==="string"){try{var e=JSON.parse(n);return e}catch(n){return null}}return null}));var f=890;var v=n("i",(function(n){return n||window.innerWidth<f}));var w=function(){var n="connection"in window.navigator?window.navigator.connection:null;var e="mozConnection"in window.navigator?window.navigator.mozConnection:null;var r="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;var o=n||e||r;return o};var p=n("b",(function(){var n="userAgentData"in window.navigator?window.navigator.userAgentData:null;var e=w();return{connectionDownlink:e===null||e===void 0?void 0:e.downlink,connectionEffectiveType:e===null||e===void 0?void 0:e.effectiveType,connectionRtt:e===null||e===void 0?void 0:e.rtt,connectionSaveData:e===null||e===void 0?void 0:e.saveData,isHostedCheckout:window.Zonos.isLegacyCheckout,screenHeight:window.screen.height,screenWidth:window.innerWidth,userAgent:n&&n.brands.length>0?n:window.navigator.userAgent}}));var h=["/api/zonos-elements/log-script-load","/api/zonos-elements/log-bulk-load-data"];var b=function(n){var e=n.apiPath,r=n.apiType,o=n.loadTimeInternal,t=n.loadTimeTotal;if(h.includes(e)){return}var i=t-o;if(i<0){return}var a=e.split("?")[0]||e;var u=p();var s=typeof u.userAgent==="object"&&u.userAgent.mobile;var c={apiType:r,connectionType:u.connectionEffectiveType,href:a,isHostedCheckout:window.Zonos.isLegacyCheckout,isMobile:v(s),loadTimeBrowserApi:i,loadTimeInternal:o,loadTimeTotal:t,metadata:Object.assign({},u),screenHeight:u.screenHeight,screenWidth:u.screenWidth,userAgent:typeof u.userAgent==="string"?u.userAgent:u.userAgent["brands"].map((function(n){return n.brand})).filter((function(n){return!/Not.*A.*Brand.*/.test(n)})).join(",")};window.Zonos.loadTimeApiInfoList.push(c)};var y=1*3600*1e3;var m=n("s",(function(n){return __awaiter(r,[n],void 0,(function(n){var r,o,t,i,a;var u=n.endpoint,l=n.errors,f=n.metadata,v=n.shouldPostReleaseErrorReporting;return __generator(this,(function(n){e("sendErrorLog","warn",u,f,l);if(v){r=Number(window.Zonos.releaseDate);o=(new Date).getTime();if(o-r>y){return[2]}}t="userAgentData"in window.navigator?window.navigator.userAgentData:null;i={endpoint:u,errors:l,href:window.location.href,metadata:Object.assign({appVersion:window.Zonos.version,domain:window.Zonos.domain,publicCredential:window.Zonos.zonosApiKey,userAgent:t&&t.brands.length>0?t:window.navigator.userAgent},f)};try{void fetch("".concat(c,"/api/zonos-elements/log-error"),{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(n){a=d();if(!a){return[2]}void fetch("".concat(s[a],"/api/zonos-elements/log-error"),{body:JSON.stringify(i),method:"POST"})}return[2]}))}))}));var g=undefined&&undefined.__rest||function(n,e){var r={};for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0)r[o]=n[o];if(n!=null&&typeof Object.getOwnPropertySymbols==="function")for(var t=0,o=Object.getOwnPropertySymbols(n);t<o.length;t++){if(e.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(n,o[t]))r[o[t]]=n[o[t]]}return r};var _=function(n){return __awaiter(r,[n],void 0,(function(n){var e,r,o;var t=n.response,i=n.shouldLog,a=i===void 0?true:i,u=n.shouldThrow,s=u===void 0?false:u;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,t.text()];case 1:e=n.sent();r=l(e);if(!r){throw new Error("Failed to parse content: ".concat(e))}return[2,r];case 2:o=n.sent();if(s){throw o}if(a){console.error(o)}return[2,null];case 3:return[2]}}))}))};var T=function(n){try{var e=btoa(n).replace(/=/g,"");return e}catch(e){return n.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}};var j=function(n){return __awaiter(r,[n],void 0,(function(n){var e,r,o,t,i,a,c,d,l,f,v,f,w,p,c,h,c;var b=n.basePathType,y=n.options,m=n.path;return __generator(this,(function(n){switch(n.label){case 0:r=window.Zonos.zonosQaUrlApi||s[b]||u;o=r+m;t=new URL(o);i=window.Zonos.cartId?"".concat(window.location.hostname,"-").concat(window.Zonos.cartId):window.location.hostname;t.searchParams.set("zToken",T(i));n.label=1;case 1:n.trys.push([1,3,,4]);return[4,fetch(t.toString(),y)];case 2:e=n.sent();return[3,4];case 3:a=n.sent();if(a instanceof Error){return[2,{baseUrl:r,errors:[{message:a.message,type:"unknown"}],json:null,response:null,zonosMode:null}]}c="Failed to fetch";return[2,{baseUrl:r,errors:[{message:c,type:"unknown"}],json:null,response:null,zonosMode:null}];case 4:d=e.headers.get("Zonos-Mode");l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&d&&l){window.Zonos.modeAlerted=true}if(!e.ok)return[3,6];return[4,_({response:e})];case 5:f=n.sent();return[2,{baseUrl:r,errors:[],json:f,response:e,zonosMode:d}];case 6:v=e.status.toString();n.label=7;case 7:n.trys.push([7,9,,10]);return[4,_({response:e,shouldThrow:true})];case 8:f=n.sent();if(f&&"errors"in f&&Array.isArray(f.errors)){w=f.errors;p=w.map((function(n){if(typeof n==="string"){return{message:n,type:v}}return n}));return[2,{baseUrl:r,errors:p,json:null,response:e,zonosMode:d}]}c=JSON.stringify(f);return[2,{baseUrl:r,errors:[{message:c,type:v}],json:null,response:e,zonosMode:d}];case 9:h=n.sent();c="Unknown error";return[2,{baseUrl:r,errors:[{message:"".concat(v,": ").concat(c),type:v}],json:null,response:null,zonosMode:d}];case 10:return[2]}}))}))};var k=function(n){return __awaiter(r,[n],void 0,(function(n){var r,o,t,i,a,u,c,f,v,w,p,h,y,_,T,z,O;var A=n.basePathType,S=n.options,M=n.path;return __generator(this,(function(n){switch(n.label){case 0:t=M.startsWith("/api/bigcommerce");i=t?"vercel":A;a=performance.now();return[4,j({basePathType:i,options:S,path:M})];case 1:u=n.sent(),c=u.errors,f=u.response,v=g(u,["errors","response"]);w=performance.now();p=w-a;e("".concat(M," (").concat(p.toFixed(2),"ms)"),"info");h=f===null||f===void 0?void 0:f.headers.get("Zonos-Duration");if((f===null||f===void 0?void 0:f.status)===200){b({apiPath:M,apiType:i,loadTimeInternal:h?Number(h):0,loadTimeTotal:p})}y=d(i);_=c.find((function(n){var e=n.type;return e==="unknown"}));T=c.find((function(n){var e=n.message;return typeof e==="string"&&(e.includes("signal is aborted")||e.includes("The operation was aborted")||e.includes("Fetch is aborted"))}));z=!!_||(f===null||f===void 0?void 0:f.status)===404||(f===null||f===void 0?void 0:f.status)===500;O=y&&z;if(z&&!T){void m({endpoint:s[i]+M,errors:c.map((function(n){var e=n.message;return"API: ".concat(e)})),metadata:{currentBasePath:i,nextFallbackApiType:y,requestHeaders:S===null||S===void 0?void 0:S.headers,requestPayload:l((r=S===null||S===void 0?void 0:S.body)===null||r===void 0?void 0:r.toString())||((o=S===null||S===void 0?void 0:S.body)===null||o===void 0?void 0:o.toString()),shouldCallFallback:O,status:f===null||f===void 0?void 0:f.status,statusText:f===null||f===void 0?void 0:f.statusText},shouldPostReleaseErrorReporting:true})}if(O){e('=== "'.concat(M,'" failed to fetch, trying next fallback ').concat(y));return[2,k({basePathType:y,options:S,path:M})]}return[2,Object.assign({errors:c,response:f},v)]}}))}))};var z=n("h",(function(n,e){return __awaiter(r,void 0,void 0,(function(){var r,o,a,s,c,d;return __generator(this,(function(l){r=g(e||{},[]);o=r.body?JSON.stringify(r.body):undefined;a=r.method||"GET";s=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Staging-Mode":t()?"1":undefined,"Zonos-Test-Mode":i()?"1":undefined,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},r.headers);Object.keys(s).forEach((function(n){return s[n]===undefined&&delete s[n]}));c=Object.assign(Object.assign({},r),{body:a==="GET"?undefined:o,headers:s,method:a});d=new URLSearchParams(window.location.search).get("useFallbackApi");return[2,k({basePathType:d||u,options:c,path:n})]}))}))}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as o,z as e}from"./p-7af39c98.js";import{c as n,B as t,e as d,C as i}from"./p-1c5ba523.js";import{s as a}from"./p-7eb8e2d4.js";import{h as l,s,l as r}from"./p-41dd1cb8.js";import{b as u}from"./p-0a377722.js";import{h as c}from"./p-b30c2ad9.js";const{state:p}=o((()=>({amountDutyTaxFeeTotal:null,amountTotalPaid:null,isFetchingShippingInfo:!0,landedCostShortId:null,originCompanyName:null,partyBillingId:null,shippingAddress:null}))),v=async({landedCostId:o,retries:n=5})=>{var t,i,a,r,u,c,m,C,I;p.isFetchingShippingInfo=!0;const g=await l("/api/zonos-elements/collect/get-shipping-info-by-lc-id",{body:{landedCostId:o},method:"POST"});if(g.errors.length)return n>0?(await new Promise((o=>setTimeout(o,1e3))),v({landedCostId:o,retries:n-1})):null;p.landedCostShortId=(null===(t=g.json)||void 0===t?void 0:t.landedCostShortId)||null,p.isFetchingShippingInfo=!1,p.shippingAddress=(null===(i=g.json)||void 0===i?void 0:i.shipping)||null;const h=null===(a=d.checkoutSession)||void 0===a?void 0:a.landedCost,w=null===(r=d.checkoutSession)||void 0===r?void 0:r.subtotals,L=((null===(u=null==h?void 0:h.amountSubtotals)||void 0===u?void 0:u.shipping)||0)+((null===(c=null==h?void 0:h.amountSubtotals)||void 0===c?void 0:c.items)||0);p.amountTotalPaid=L*((null===(m=null==w?void 0:w.exchangeRate)||void 0===m?void 0:m.rate)||1),p.amountDutyTaxFeeTotal=((null==w?void 0:w.duties)||0)+((null==w?void 0:w.taxes)||0)+((null==w?void 0:w.fees)||0),p.originCompanyName=(null===(I=null===(C=g.json)||void 0===C?void 0:C.origin)||void 0===I?void 0:I.companyName)||null,0===p.amountTotalPaid&&s({endpoint:"COLLECT_NO_TOTAL_PAID",errors:[],metadata:{landedCostId:o,organizationId:e.organizationId}})},m=async()=>{var o,e,i,c;if(!(null===(o=n.stripeBillingAddressEventData)||void 0===o?void 0:o.complete))return{partiesCreated:!1};const v=null===(i=null===(e=d.checkoutSession)||void 0===e?void 0:e.landedCost)||void 0===i?void 0:i.rootId;if(!v)return s({endpoint:"PF_NO_SELECTED_LANDED_COST",errors:["No selected landed cost"],metadata:{allLogs:u,cartId:window.Zonos.cartId,checkoutSessionId:a.checkoutSessionId}}),{partiesCreated:!1};if(!a.checkoutSessionId)return s({endpoint:"COLLECT_NO_CHECKOUT_SESSION_ID",errors:["No checkout session id"],metadata:{allLogs:u,cartId:window.Zonos.cartId,landedCostRootId:v}}),{partiesCreated:!1};const m=t({address:n.stripeBillingAddressEventData.value.address,firstName:n.stripeBillingAddressEventData.value.firstName,lastName:n.stripeBillingAddressEventData.value.lastName,name:n.stripeBillingAddressEventData.value.name,phone:n.stripeBillingAddressEventData.value.phone}),C="1"===new URLSearchParams(window.location.search).get("zonosE2ETest"),{errors:I,json:g}=await l("/api/zonos-elements/create-billing-party",{body:{billingAddress:m,checkoutSessionId:a.checkoutSessionId,companyName:n.companyName,email:(null===(c=n.stripeLinkEventData)||void 0===c?void 0:c.value.email)||"",isTest:C,rootId:v},method:"POST"});return I.length||!g?(r("Error occurs when creating billing party",JSON.stringify(I,null,2)),s({endpoint:"COLLECT_BILLING_PARTY_CREATE_FAILED",errors:["[COLLECT] Failed to create billing party"],metadata:{allLogs:u,cartId:window.Zonos.cartId,checkoutSessionId:a.checkoutSessionId,errors:I,json:g}}),{partiesCreated:!1}):(p.partyBillingId=g.billToPartyId,{partiesCreated:!0})},C=async o=>{const e=o.landedCost;return!!e&&(d.landedCostData=[Object.assign(Object.assign({},o),{landedCost:Object.assign({},e),landedCostId:e.id})],i({applySubtotalsOnly:!0,landedCostId:e.id,selectedShippingOption:e.shipmentRating}))},I=o=>o||window.innerWidth<1024&&window.innerWidth>=768,g=o=>o||window.innerWidth<768,h=({content:o,isLoading:e,skeletonHeight:n,skeletonWidth:t})=>e?c("zonos-skeleton",{skeletonHeight:n,skeletonWidth:t}):o;export{I as a,v as b,C as c,m as d,p as e,g as i,h as r}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(o,e,t,n){function i(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,r){function s(o){try{a(n.next(o))}catch(o){r(o)}}function l(o){try{a(n["throw"](o))}catch(o){r(o)}}function a(o){o.done?t(o.value):i(o.value).then(s,l)}a((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(e){return a([o,e])}}function a(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(t=0)),t)try{if(n=1,i&&(r=l[0]&2?i["return"]:l[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,l[1])).done)return r;if(i=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:t.label++;return{value:l[1],done:false};case 5:t.label++;i=l[1];l=[0];continue;case 7:l=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){t.label=l[1];break}if(l[0]===6&&t.label<r[1]){t.label=r[1];r=l;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(l);break}if(r[2])t.ops.pop();t.trys.pop();continue}l=e.call(o,t)}catch(o){l=[6,o];i=0}finally{n=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-5fc34563.system.js","./p-cd1ebef9.system.js","./p-640a6898.system.js","./p-62fa680d.system.js","./p-9d863a3b.system.js","./p-23e7c655.system.js","./p-062430f9.system.js","./p-bc7bf53e.system.js","./p-5a2dd041.system.js"],(function(o){"use strict";var e,t,n,i,r,s,l,a,h,d,u,f,c,w,v,g,m,z,p,b,x,y;return{setters:[function(o){e=o.r;t=o.h;n=o.H;i=o.a},function(o){r=o.d},function(o){s=o.l;l=o.i;a=o.g;h=o.h;d=o.j;u=o.k;f=o.m;c=o.d},function(o){w=o.t},function(o){v=o.z;g=o.g;m=o.m},function(o){z=o.c},function(o){p=o.h;b=o.b;x=o.l},function(o){y=o.g},function(){}],execute:function(){var k=this;var _=function(o){return __awaiter(k,[o],void 0,(function(o){var e,t,n,i,r;var s=o.items,l=o.shipFrom,a=o.shipTo;return __generator(this,(function(o){switch(o.label){case 0:t={items:s,shipFrom:l,shipTo:a};return[4,p("/api/zonos-elements/check-item-restrictions",{body:t,method:"POST"})];case 1:n=o.sent(),i=n.errors,r=n.json;if(i.length||!r){b("Error fetching item restrictions: ".concat((e=i.find(Boolean))===null||e===void 0?void 0:e.message));return[2,[]]}return[2,r.filter(Boolean)]}}))}))};var L=function(o){return __awaiter(k,void 0,void 0,(function(){var e,t,n,i;return __generator(this,(function(r){switch(r.label){case 0:if(!o.length){return[2,[]]}e=s.selectedCountryCode;if(!e){b("Hello could not check item restrictions - No country code selected");return[2,[]]}t=o.map((function(o){return{description:o.description,name:o.title}}));return[4,_({items:t,shipFrom:"AD",shipTo:e})];case 1:n=r.sent();i=n.map((function(o){var e;var n=((e=t.filter((function(e){return e.description===o.itemDescription})).find(Boolean))===null||e===void 0?void 0:e.name)||"";return Object.assign(Object.assign({},o),{name:n})}));return[2,i]}}))}))};var O=function(o){var e=o===null||o===void 0?void 0:o.replace("www.","").replace("https://","");return e&&new RegExp(e).test(window.location.href)};var T=function(){var o=v.helloSettings,e=o.cartUrlPattern,t=o.homepageUrlPattern,n=o.productDetailUrlPattern,i=o.productListUrlPattern;if(O(e)){return"cart"}if(O(n)){return"productDetail"}if(O(i)){return"productList"}if(O(t)){return"home"}return""};var j=function(){var o,e;var t=v.helloSettings,n=t.productAddToCartElementSelector,i=t.productDescriptionElementSelector,r=t.productTitleElementSelector,s=t.restrictionBehavior;if(!r||!i){x("Hello could not check item restrictions - must provide title and description selectors.")}var a=r&&l(r)&&document.querySelectorAll(r)||[];var h=i&&l(i)&&document.querySelectorAll(i)||[];if(a.length!==h.length){x("Hello could not check item restrictions - Title and description selectors do not match");return[]}var d=s==="RESTRICT_AND_BLOCK";var u=d&&n&&l(n)&&document.querySelectorAll(n)||[];if(d&&u.length!==h.length){x('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match')}var f=[];for(var c=0;c<a.length;c++){var w=a[c];var g=h[c];var m=u[c];if(w&&g){var z={cartButtonNode:m||null,description:((o=g.textContent)===null||o===void 0?void 0:o.trim())||"",title:((e=w.textContent)===null||e===void 0?void 0:e.trim())||""};f.push(z)}}return f};var E=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + 16px));transform:translateX(calc(-100% + 16px));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:16px;border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:16px;padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - 16px));transform:translateX(calc(100% - 16px));right:0;left:auto;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}";var D=E;var S=3e3;var I=o("zonos_hello",function(){function o(o){var t=this;e(this,o);this.showPeekMessage=false;this.zonosStoreHelloSettings=v.helloSettings;this.showDialog=false;this.peekMessage="";this.initialUrl="";this.allRestrictedItems=[];this.allFoundProducts=[];this.productsOnPage=[];this.isHelloWidgetRendered=false;this.isMobile=false;this.getHelloPeekMessage=function(o){var e=v.currentHelloPage==="productDetail"||v.currentHelloPage==="productList";if(e&&t.allRestrictedItems.length){var n=w("click to learn more");var i=v.currentHelloPage==="productDetail"?w("Restricted item"):w("Restricted items found");return"".concat(i," - ").concat(n)}switch(v.currentHelloPage){case"cart":return w("Prepay duties and taxes at checkout");case"productList":case"productDetail":return w("See duty and tax thresholds");default:return w("Welcome to [storeName]",{storeName:o})}};this.enableShowPeekMessage=function(){if(t.peekMessage){t.showPeekMessage=true}};this.getNewItemRestrictions=function(o){return __awaiter(t,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:e=v.currentHelloPage==="productDetail"||v.currentHelloPage==="productList";if(!e||v.helloSettings.restrictionBehavior==="DISABLED"){return[2,[]]}return[4,L(o)];case 1:t=n.sent();return[2,t]}}))}))};this.triggerShowPeekMessage=function(){t.peekMessage=t.getHelloPeekMessage(v.organizationName);var o=v.helloSettings,e=o.peekMessageBehavior,n=o.peekMessageDelay;var i=n*1e3;if(e==="ENABLED"){setTimeout((function(){t.enableShowPeekMessage();var o=t.allRestrictedItems.some((function(o){return t.productsOnPage.some((function(e){return e.description===o.itemDescription}))}));if(!o){setTimeout((function(){t.showPeekMessage=false}),S)}}),i)}};this.disableAddToCartButtons=function(){if(t.productsOnPage.length){t.productsOnPage.forEach((function(o){var e,n;var i=t.allRestrictedItems.some((function(e){return e.itemDescription===o.description}));if(i){(e=o.cartButtonNode)===null||e===void 0?void 0:e.setAttribute("disabled","disabled")}else{(n=o.cartButtonNode)===null||n===void 0?void 0:n.removeAttribute("disabled")}}))}};this.handleItemRestrictions=function(){return __awaiter(t,void 0,void 0,(function(){var o,e;var t,n;var i=this;return __generator(this,(function(r){switch(r.label){case 0:this.productsOnPage=j();o=this.productsOnPage.filter((function(o){return!i.allFoundProducts.some((function(e){return e.title===o.title}))}));return[4,this.getNewItemRestrictions(o)];case 1:e=r.sent();(t=this.allRestrictedItems).push.apply(t,e);(n=this.allFoundProducts).push.apply(n,o);this.disableAddToCartButtons();return[2]}}))}))};this.reloadHelloData=function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleItemRestrictions()];case 1:o.sent();this.triggerShowPeekMessage();return[2]}}))}))};this.handleProductCountChange=r((function(){var o=v.helloSettings.productTitleElementSelector;if(o){var e=j();if(t.allFoundProducts.length!==e.length&&window.location.href===t.initialUrl){if(!t.allFoundProducts.length){return}void t.reloadHelloData()}}}),1e3);this.watchProductCountChange=function(){var o;var e=new MutationObserver(t.handleProductCountChange);e.observe(document.body,{childList:true,subtree:true});(o=t.observerWatcher)===null||o===void 0?void 0:o.push(e)};this.watchPriceChange=function(){var o;var e=new MutationObserver((function(){return void t.displayCurrency()}));e.observe(document.body,{attributes:true,childList:true,subtree:true});(o=t.observerWatcher)===null||o===void 0?void 0:o.push(e)};this.updateHelloOnPageChange=function(){t.watchProductCountChange();setInterval((function(){if(window.location.href!==t.initialUrl){var o=t.initialUrl&&new URL(t.initialUrl);var e=o&&a(o.searchParams);if(e!==s.selectedCountryCode){t.allFoundProducts=[];t.allRestrictedItems=[];t.productsOnPage=[]}t.initialUrl=window.location.href;v.currentHelloPage=T();var n=new URL(window.location.href);var i=a(n.searchParams);if(!i){h(s.selectedCountryCode);return}void t.reloadHelloData()}}),1e3)};this.changeShowDialog=function(o){t.showDialog=o};this.shouldAnimateLeftDesktop=function(){var o=t.helloRef&&getComputedStyle(t.helloRef).position;if(t.helloRef&&o==="relative"){var e=y(t.helloRef);return e}};this.shouldRenderHello=function(o){if(o===void 0){o=true}if(!s.localizationLoaded){return false}var e=v.helloSettings.showForCountries;if(o){if(!s.isShippableCountry){x("Hello: not shippable country - Show for countries: ".concat(e))}}if(e==="ONLY_SHIPPABLE"){return s.isShippableCountry}if(e==="ALL"){return true}return e===null||e===void 0?void 0:e.includes(s.selectedCountryCode||"")}}o.prototype.showDialogHandler=function(o){var e;if(o){var t=(e=this.helloElement)===null||e===void 0?void 0:e.parentElement;if(t&&t.parentElement===document.body){t.style.zIndex="2147483647";document.body.appendChild(t)}}};o.prototype.getCountryList=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,s.helloCountryList]}))}))};o.prototype.componentWillLoad=function(){var o=this;var e=setInterval((function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){if(!this.helloRef){return[2]}if(v.loadedConfig){this.helloRef.setAttribute("data-zonos-hello-loaded","");this.updateHelloOnPageChange();this.watchPriceChange();this.handleAppearanceSettingsOverrideChange();clearInterval(e)}return[2]}))}))}),100)};o.prototype.disconnectedCallback=function(){var o;(o=this.observerWatcher)===null||o===void 0?void 0:o.forEach((function(o){return o.disconnect()}))};o.prototype.displayCurrency=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){if(v.helloSettings.currencyBehavior==="DISABLED"){return[2]}if(!s.exchangeRate){x("Could not display currency. Exchange rate and format data is not available.","warn");return[2]}d();return[2]}))}))};o.prototype.convertAndFormat=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,u(o)]}))}))};o.prototype.convert=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,f(o)]}))}))};o.prototype.format=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,c({amount:o})]}))}))};o.prototype.openHelloDialog=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.changeShowDialog(o);return[2]}))}))};o.prototype.handleResize=function(){this.isMobile=window.innerWidth<=768};o.prototype.handleHelloWidgetInitializedState=function(o){var e=o.countryCode,t=o.currencyCode;var n,i;if(this.isHelloWidgetRendered){return}if(s.selectedCountryCode&&typeof v.helloSettings.onInitSuccess==="function"){this.isHelloWidgetRendered=true;void((i=(n=v.helloSettings).onInitSuccess)===null||i===void 0?void 0:i.call(n,{countryCode:e,currencyCode:t}))}};o.prototype.getHelloLocation=function(){var o=this.mobileLocationOverride||v.helloSettings.mobileLocation;var e=v.helloSettings.desktopLocation;var t=this.isMobile;switch(true){case t:{var n=this.animateFromLeftOverride||(o===null||o===void 0?void 0:o.includes("LEFT"));var i=o===null||o===void 0?void 0:o.includes("TOP");return{isMobileWindow:t,isOnLeft:n,isOnTop:i,shouldFloat:!!o}}default:case!t:{var r=!v.helloSettings.anchorElementSelector&&!!e;var n=this.animateFromLeftOverride||(e===null||e===void 0?void 0:e.includes("LEFT"))||this.shouldAnimateLeftDesktop();var i=e===null||e===void 0?void 0:e.includes("TOP");return{isMobileWindow:t,isOnLeft:n,isOnTop:i,shouldFloat:r}}}};o.prototype.handleAppearanceSettingsOverrideChange=function(){var o;if((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme){this.appearanceSettingsOverride.theme=g(this.appearanceSettingsOverride.theme)}};o.prototype.componentDidLoad=function(){this.isMobile=window.innerWidth<=768};o.prototype.render=function(){var o=this;var e,i;var r=(e=v.helloSettings.excludedUrlPatterns)===null||e===void 0?void 0:e.some((function(o){return o&&new RegExp(o).test(window.location.href)}));if(r){x("Hello is excluded on this url","warn");return null}var l=s.selectedCountryCode,a=s.targetCurrency;var h=this.getHelloLocation(),d=h.isOnLeft,u=h.isOnTop,f=h.shouldFloat;var c=m(v.appearance,this.appearanceSettingsOverride||null);var w=c.theme;var g=(i=this.allRestrictedItems)===null||i===void 0?void 0:i.filter((function(e){return o.productsOnPage.some((function(o){return o.description===e.itemDescription}))}));this.peekMessage=this.getHelloPeekMessage(v.organizationName);var p=this.shouldRenderHello()&&!!l;if(p&&!this.isHelloWidgetRendered){this.handleHelloWidgetInitializedState({countryCode:l,currencyCode:a})}return t(n,{class:"zonos--hello zonos--elements","data-theme":w},p&&t("div",{class:z(["zonos--hello-wrapper",f&&"zonos--hello-widget-float"])},t("button",{class:z(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",d&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",u&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions",f&&"zonos--hello-widget-float"]),onClick:function(){void o.changeShowDialog(!o.showDialog)},onMouseEnter:function(){return o.enableShowPeekMessage()},onMouseLeave:function(){return o.showPeekMessage=false},ref:function(e){return e&&(o.helloRef=e)},type:"button"},t("zonos-text",{class:"zonos--hello-message"},this.peekMessage),l&&t("div",{class:"zonos--hello-country-flag-wrapper"},t("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:l}))),t("div",{class:z(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override",f&&"zonos--hello-widget-float"]),style:{height:this.showDialog?"fit-content":"0px"}},t("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:c,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:g,setIsOpen:this.changeShowDialog}))))};Object.defineProperty(o.prototype,"helloElement",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{showDialog:["showDialogHandler"],appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}},enumerable:false,configurable:true});return o}());I.style=D}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(o,e,t,n){function i(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,r){function s(o){try{a(n.next(o))}catch(o){r(o)}}function l(o){try{a(n["throw"](o))}catch(o){r(o)}}function a(o){o.done?t(o.value):i(o.value).then(s,l)}a((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(e){return a([o,e])}}function a(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(t=0)),t)try{if(n=1,i&&(r=l[0]&2?i["return"]:l[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,l[1])).done)return r;if(i=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:t.label++;return{value:l[1],done:false};case 5:t.label++;i=l[1];l=[0];continue;case 7:l=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){t.label=l[1];break}if(l[0]===6&&t.label<r[1]){t.label=r[1];r=l;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(l);break}if(r[2])t.ops.pop();t.trys.pop();continue}l=e.call(o,t)}catch(o){l=[6,o];i=0}finally{n=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-5fc34563.system.js","./p-57413c34.system.js","./p-b5b3f908.system.js","./p-182da73f.system.js","./p-89c5164b.system.js","./p-23e7c655.system.js","./p-01174496.system.js","./p-bc7bf53e.system.js","./p-d938f42f.system.js"],(function(o){"use strict";var e,t,n,i,r,s,l,a,h,d,u,f,c,w,v,g,m,z,p,b,x,y;return{setters:[function(o){e=o.r;t=o.h;n=o.H;i=o.a},function(o){r=o.d},function(o){s=o.l;l=o.i;a=o.g;h=o.h;d=o.j;u=o.k;f=o.m;c=o.d},function(o){w=o.t},function(o){v=o.z;g=o.g;m=o.m},function(o){z=o.c},function(o){p=o.h;b=o.l},function(o){x=o.g},function(o){y=o.l}],execute:function(){var k=this;var _=function(o){return __awaiter(k,[o],void 0,(function(o){var e,t,n,i,r;var s=o.items,l=o.shipFrom,a=o.shipTo;return __generator(this,(function(o){switch(o.label){case 0:t={items:s,shipFrom:l,shipTo:a};return[4,p("/api/zonos-elements/check-item-restrictions",{body:t,method:"POST"})];case 1:n=o.sent(),i=n.errors,r=n.json;if(i.length||!r){b("Error fetching item restrictions: ".concat((e=i.find(Boolean))===null||e===void 0?void 0:e.message));return[2,[]]}return[2,r.filter(Boolean)]}}))}))};var L=function(o){return __awaiter(k,void 0,void 0,(function(){var e,t,n,i;return __generator(this,(function(r){switch(r.label){case 0:if(!o.length){return[2,[]]}e=s.selectedCountryCode;if(!e){b("Hello could not check item restrictions - No country code selected");return[2,[]]}t=o.map((function(o){return{description:o.description,name:o.title}}));return[4,_({items:t,shipFrom:"AD",shipTo:e})];case 1:n=r.sent();i=n.map((function(o){var e;var n=((e=t.filter((function(e){return e.description===o.itemDescription})).find(Boolean))===null||e===void 0?void 0:e.name)||"";return Object.assign(Object.assign({},o),{name:n})}));return[2,i]}}))}))};var O=function(o){var e=o===null||o===void 0?void 0:o.replace("www.","").replace("https://","");return e&&new RegExp(e).test(window.location.href)};var T=function(){var o=v.helloSettings,e=o.cartUrlPattern,t=o.homepageUrlPattern,n=o.productDetailUrlPattern,i=o.productListUrlPattern;if(O(e)){return"cart"}if(O(n)){return"productDetail"}if(O(i)){return"productList"}if(O(t)){return"home"}return""};var j=function(){var o,e;var t=v.helloSettings,n=t.productAddToCartElementSelector,i=t.productDescriptionElementSelector,r=t.productTitleElementSelector,s=t.restrictionBehavior;if(!r||!i){y("Hello could not check item restrictions - must provide title and description selectors.")}var a=r&&l(r)&&document.querySelectorAll(r)||[];var h=i&&l(i)&&document.querySelectorAll(i)||[];if(a.length!==h.length){y("Hello could not check item restrictions - Title and description selectors do not match");return[]}var d=s==="RESTRICT_AND_BLOCK";var u=d&&n&&l(n)&&document.querySelectorAll(n)||[];if(d&&u.length!==h.length){y('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match')}var f=[];for(var c=0;c<a.length;c++){var w=a[c];var g=h[c];var m=u[c];if(w&&g){var z={cartButtonNode:m||null,description:((o=g.textContent)===null||o===void 0?void 0:o.trim())||"",title:((e=w.textContent)===null||e===void 0?void 0:e.trim())||""};f.push(z)}}return f};var E=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + 16px));transform:translateX(calc(-100% + 16px));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:16px;border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:16px;padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - 16px));transform:translateX(calc(100% - 16px));right:0;left:auto;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}";var D=E;var S=3e3;var I=o("zonos_hello",function(){function o(o){var t=this;e(this,o);this.showPeekMessage=false;this.zonosStoreHelloSettings=v.helloSettings;this.showDialog=false;this.peekMessage="";this.initialUrl="";this.allRestrictedItems=[];this.allFoundProducts=[];this.productsOnPage=[];this.isHelloWidgetRendered=false;this.isMobile=false;this.getHelloPeekMessage=function(o){var e=v.currentHelloPage==="productDetail"||v.currentHelloPage==="productList";if(e&&t.allRestrictedItems.length){var n=w("click to learn more");var i=v.currentHelloPage==="productDetail"?w("Restricted item"):w("Restricted items found");return"".concat(i," - ").concat(n)}switch(v.currentHelloPage){case"cart":return w("Prepay duties and taxes at checkout");case"productList":case"productDetail":return w("See duty and tax thresholds");default:return w("Welcome to [storeName]",{storeName:o})}};this.enableShowPeekMessage=function(){if(t.peekMessage){t.showPeekMessage=true}};this.getNewItemRestrictions=function(o){return __awaiter(t,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:e=v.currentHelloPage==="productDetail"||v.currentHelloPage==="productList";if(!e||v.helloSettings.restrictionBehavior==="DISABLED"){return[2,[]]}return[4,L(o)];case 1:t=n.sent();return[2,t]}}))}))};this.triggerShowPeekMessage=function(){t.peekMessage=t.getHelloPeekMessage(v.organizationName);var o=v.helloSettings,e=o.peekMessageBehavior,n=o.peekMessageDelay;var i=n*1e3;if(e==="ENABLED"){setTimeout((function(){t.enableShowPeekMessage();var o=t.allRestrictedItems.some((function(o){return t.productsOnPage.some((function(e){return e.description===o.itemDescription}))}));if(!o){setTimeout((function(){t.showPeekMessage=false}),S)}}),i)}};this.disableAddToCartButtons=function(){if(t.productsOnPage.length){t.productsOnPage.forEach((function(o){var e,n;var i=t.allRestrictedItems.some((function(e){return e.itemDescription===o.description}));if(i){(e=o.cartButtonNode)===null||e===void 0?void 0:e.setAttribute("disabled","disabled")}else{(n=o.cartButtonNode)===null||n===void 0?void 0:n.removeAttribute("disabled")}}))}};this.handleItemRestrictions=function(){return __awaiter(t,void 0,void 0,(function(){var o,e;var t,n;var i=this;return __generator(this,(function(r){switch(r.label){case 0:this.productsOnPage=j();o=this.productsOnPage.filter((function(o){return!i.allFoundProducts.some((function(e){return e.title===o.title}))}));return[4,this.getNewItemRestrictions(o)];case 1:e=r.sent();(t=this.allRestrictedItems).push.apply(t,e);(n=this.allFoundProducts).push.apply(n,o);this.disableAddToCartButtons();return[2]}}))}))};this.reloadHelloData=function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleItemRestrictions()];case 1:o.sent();this.triggerShowPeekMessage();return[2]}}))}))};this.handleProductCountChange=r((function(){var o=v.helloSettings.productTitleElementSelector;if(o){var e=j();if(t.allFoundProducts.length!==e.length&&window.location.href===t.initialUrl){if(!t.allFoundProducts.length){return}void t.reloadHelloData()}}}),1e3);this.watchProductCountChange=function(){var o;var e=new MutationObserver(t.handleProductCountChange);e.observe(document.body,{childList:true,subtree:true});(o=t.observerWatcher)===null||o===void 0?void 0:o.push(e)};this.watchPriceChange=function(){var o;var e=new MutationObserver((function(){return void t.displayCurrency()}));e.observe(document.body,{attributes:true,childList:true,subtree:true});(o=t.observerWatcher)===null||o===void 0?void 0:o.push(e)};this.updateHelloOnPageChange=function(){t.watchProductCountChange();setInterval((function(){if(window.location.href!==t.initialUrl){var o=t.initialUrl&&new URL(t.initialUrl);var e=o&&a(o.searchParams);if(e!==s.selectedCountryCode){t.allFoundProducts=[];t.allRestrictedItems=[];t.productsOnPage=[]}t.initialUrl=window.location.href;v.currentHelloPage=T();var n=new URL(window.location.href);var i=a(n.searchParams);if(!i){h(s.selectedCountryCode);return}void t.reloadHelloData()}}),1e3)};this.changeShowDialog=function(o){t.showDialog=o};this.shouldAnimateLeftDesktop=function(){var o=t.helloRef&&getComputedStyle(t.helloRef).position;if(t.helloRef&&o==="relative"){var e=x(t.helloRef);return e}};this.shouldRenderHello=function(o){if(o===void 0){o=true}if(!s.localizationLoaded){return false}var e=v.helloSettings.showForCountries;if(o){if(!s.isShippableCountry){y("Hello: not shippable country - Show for countries: ".concat(e))}}if(e==="ONLY_SHIPPABLE"){return s.isShippableCountry}if(e==="ALL"){return true}return e===null||e===void 0?void 0:e.includes(s.selectedCountryCode||"")}}o.prototype.showDialogHandler=function(o){var e;if(o){var t=(e=this.helloElement)===null||e===void 0?void 0:e.parentElement;if(t&&t.parentElement===document.body){t.style.zIndex="2147483647";document.body.appendChild(t)}}};o.prototype.getCountryList=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,s.helloCountryList]}))}))};o.prototype.componentWillLoad=function(){var o=this;var e=setInterval((function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){if(!this.helloRef){return[2]}if(v.loadedConfig){this.helloRef.setAttribute("data-zonos-hello-loaded","");this.updateHelloOnPageChange();this.watchPriceChange();this.handleAppearanceSettingsOverrideChange();clearInterval(e)}return[2]}))}))}),100)};o.prototype.disconnectedCallback=function(){var o;(o=this.observerWatcher)===null||o===void 0?void 0:o.forEach((function(o){return o.disconnect()}))};o.prototype.displayCurrency=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){if(v.helloSettings.currencyBehavior==="DISABLED"){return[2]}if(!s.exchangeRate){y("Could not display currency. Exchange rate and format data is not available.","warn");return[2]}d();return[2]}))}))};o.prototype.convertAndFormat=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,u(o)]}))}))};o.prototype.convert=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,f(o)]}))}))};o.prototype.format=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,c({amount:o})]}))}))};o.prototype.openHelloDialog=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.changeShowDialog(o);return[2]}))}))};o.prototype.handleResize=function(){this.isMobile=window.innerWidth<=768};o.prototype.handleHelloWidgetInitializedState=function(o){var e=o.countryCode,t=o.currencyCode;var n,i;if(this.isHelloWidgetRendered){return}if(s.selectedCountryCode&&typeof v.helloSettings.onInitSuccess==="function"){this.isHelloWidgetRendered=true;void((i=(n=v.helloSettings).onInitSuccess)===null||i===void 0?void 0:i.call(n,{countryCode:e,currencyCode:t}))}};o.prototype.getHelloLocation=function(){var o=this.mobileLocationOverride||v.helloSettings.mobileLocation;var e=v.helloSettings.desktopLocation;var t=this.isMobile;switch(true){case t:{var n=this.animateFromLeftOverride||(o===null||o===void 0?void 0:o.includes("LEFT"));var i=o===null||o===void 0?void 0:o.includes("TOP");return{isMobileWindow:t,isOnLeft:n,isOnTop:i,shouldFloat:!!o}}default:case!t:{var r=!v.helloSettings.anchorElementSelector&&!!e;var n=this.animateFromLeftOverride||(e===null||e===void 0?void 0:e.includes("LEFT"))||this.shouldAnimateLeftDesktop();var i=e===null||e===void 0?void 0:e.includes("TOP");return{isMobileWindow:t,isOnLeft:n,isOnTop:i,shouldFloat:r}}}};o.prototype.handleAppearanceSettingsOverrideChange=function(){var o;if((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme){this.appearanceSettingsOverride.theme=g(this.appearanceSettingsOverride.theme)}};o.prototype.componentDidLoad=function(){this.isMobile=window.innerWidth<=768};o.prototype.render=function(){var o=this;var e,i;var r=(e=v.helloSettings.excludedUrlPatterns)===null||e===void 0?void 0:e.some((function(o){return o&&new RegExp(o).test(window.location.href)}));if(r){y("Hello is excluded on this url","warn");return null}var l=s.selectedCountryCode,a=s.targetCurrency;var h=this.getHelloLocation(),d=h.isOnLeft,u=h.isOnTop,f=h.shouldFloat;var c=m(v.appearance,this.appearanceSettingsOverride||null);var w=c.theme;var g=(i=this.allRestrictedItems)===null||i===void 0?void 0:i.filter((function(e){return o.productsOnPage.some((function(o){return o.description===e.itemDescription}))}));this.peekMessage=this.getHelloPeekMessage(v.organizationName);var p=this.shouldRenderHello()&&!!l;if(p&&!this.isHelloWidgetRendered){this.handleHelloWidgetInitializedState({countryCode:l,currencyCode:a})}return t(n,{class:"zonos--hello zonos--elements","data-theme":w},p&&t("div",{class:z(["zonos--hello-wrapper",f&&"zonos--hello-widget-float"])},t("button",{class:z(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",d&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",u&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions",f&&"zonos--hello-widget-float"]),onClick:function(){void o.changeShowDialog(!o.showDialog)},onMouseEnter:function(){return o.enableShowPeekMessage()},onMouseLeave:function(){return o.showPeekMessage=false},ref:function(e){return e&&(o.helloRef=e)},type:"button"},t("zonos-text",{class:"zonos--hello-message"},this.peekMessage),l&&t("div",{class:"zonos--hello-country-flag-wrapper"},t("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:l}))),t("div",{class:z(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override",f&&"zonos--hello-widget-float"]),style:{height:this.showDialog?"fit-content":"0px"}},t("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:c,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:g,setIsOpen:this.changeShowDialog}))))};Object.defineProperty(o.prototype,"helloElement",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{showDialog:["showDialogHandler"],appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}},enumerable:false,configurable:true});return o}());I.style=D}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=performance.now(),n=[],a=()=>{const n=performance.now()-e,a=n>1e3?`${(n/1e3).toFixed(2)}s`:`${n.toFixed(2)}ms`;return{elapsedTime:n,elapsedTimePretty:a}},o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(n){return e&&"function"==typeof e.toString?e.toString():"Unable to stringify info"}},t=(e,t,...r)=>{var i,s;const{elapsedTimePretty:d}=a(),l=[`(${d})`,...r],c=l.map(o).join(" ");if(n.push([t,e,c].filter(Boolean).join(" ")),!(null===(i=window.Zonos)||void 0===i?void 0:i.debug)&&!window.location.search.match(/\?.*(&*)zonosDebug=1/))return;let u=document.querySelector("iframe#zonos---debug-logging-iframe");u||(u=document.createElement("iframe"),u.id="zonos---debug-logging-iframe",u.style.display="none",u.style.opacity="0",u.style.position="absolute",u.style.top="-9999px",u.style.left="-9999px",u.style.width="1px",u.style.height="1px",u.style.border="none",u.style.overflow="hidden",u.style.visibility="hidden",document.body.appendChild(u));const f=(null===(s=u.contentWindow)||void 0===s?void 0:s.window.console)||window.console;switch(t){case"warn":f.warn(e,...l);break;case"info":f.info(e,...l);break;case"error":f.error(e,...l);break;default:f.groupCollapsed(e,...l),f.trace(),f.groupEnd()}},r={hosted_vs_native:{availableVariants:["hosted","native"]},test_A_B:{availableVariants:["A","B"]}};export{r as a,n as b,a as g,t as l}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,h as s,H as e,F as c}from"./p-b30c2ad9.js";import{c as t,i as l,d as n,e as i,o as a,f as r,k as z,l as d,u as h,w as m,A as p,y as u,g}from"./p-1c5ba523.js";import{i as f,a as b,c as x,b as w,d as v,e as y,r as k}from"./p-0260fd13.js";import{p as C,a as S}from"./p-4dfe97ad.js";import{s as I,c as j,d as L,l as O}from"./p-7eb8e2d4.js";import{t as T}from"./p-d42b5113.js";import{z as U}from"./p-7af39c98.js";import{b as E}from"./p-29c80a34.js";import{h as P,s as A,l as N,g as _}from"./p-41dd1cb8.js";import{c as D}from"./p-b4b7f705.js";import{l as B}from"./p-0a377722.js";import{l as F}from"./p-97aceb11.js";import"./p-e688e493.js";import"./p-0ffd710e.js";const H=class{constructor(s){o(this,s),this.storeUnsubscribeList=[],this.onChangeLocaleListener=()=>{},this.mobile=!1,this.tablet=!1,this.stripe=window.Zonos.stripe,this.showLanguageDialogMobile=!1,this.submitLoading=!1,this.collapseReview=!0,this.isMobile=!1,this.isTablet=!1,this.isOverlayLoading=!0,this.isCartCollected=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.confirmationId=null,this.clientSecret=t.clientSecret,this.stripeCustomerSessionClientSecret=t.stripeCustomerSessionClientSecret,this.getBaseCurrencySettlementInfo=()=>{const o=i.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:s}}=o;return s?{settlementAmount:(s.discounts||0)+s.items+s.landedCostTotal+s.shipping}:null},this.applyStripeTheme=async()=>{const o=U.appearance.theme;await l({overrideTheme:this.isMobile?o:void 0,paypalEnabled:C()})},this.fetchCheckoutSession=async o=>{const{json:s}=await P("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"});return s},this.checkStripePaymentIntentStatus=async()=>{var o;const s=!!window.Zonos.cartData,e=new URL(window.location.href).searchParams,c=e.get("payment_intent_client_secret"),l=e.get("zonosCheckoutSessionId");if(B("Payment intent exist, checking stripe payment intent status"),!c)return B("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:s};const{error:i,status:a}=await n({clientSecret:c});if(new URLSearchParams(window.location.search).get("redirect_status")&&l){B(i?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen");const s=await this.fetchCheckoutSession(l);return this.confirmationId=(null===(o=null==s?void 0:s.checkoutSession.landedCost)||void 0===o?void 0:o.shortId)||null,I.checkoutSessionId=l,t.clientSecret=c,this.setToFinishStep(a),{shouldAllowOrder:!1}}return s?(B("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(B("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})}}resizeListener(){this.isMobile=f(this.mobile),this.isTablet=b(this.tablet)}async setToFinishStep(o){t.stripe=window.Zonos.stripe,i.step="finish",this.storybookPaymentStatusOverride=o,this.isOverlayLoading=!1}async initCollectCart(){var o,s,e,c,t,l,h,m,p,u,g;if(!window.Zonos.cartData)return;const f=null===(s=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.items[0])||void 0===s?void 0:s.currencyCode;f&&(i.currency=f);const b=null===(c=null===(e=window.Zonos.cartData)||void 0===e?void 0:e.references)||void 0===c?void 0:c.checkoutSessionId,v=null===(l=null===(t=window.Zonos.cartData)||void 0===t?void 0:t.references)||void 0===l?void 0:l.landedCostId;if(!v)return void a({messages:[T("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:U.organizationName})],title:T("Invalid session")});b?(B("Setting checkout session id from cart reference","info",b),I.checkoutSessionId=b):(B("Clear checkout session id from storage so we start from a fresh session for the collect cart"),I.checkoutSessionId=null);const{shouldAllowOrder:y}=await this.checkStripePaymentIntentStatus();if(y){try{const{adjustments:o,cartItems:s}=E(window.Zonos.cartData);if(await r({adjustments:o,cartItems:s,landedCostId:v,shouldInitSessionOnFailure:!1}),!I.checkoutSessionId&&!b){const o=await z();if(B(`stripeStoreInitCheckoutSession: ${o}`),!o)throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}if((!i.checkoutSession||(null===(h=i.checkoutSession)||void 0===h?void 0:h.completedAt))&&b){const o=await this.fetchCheckoutSession(b);if(this.confirmationId=(null===(m=null==o?void 0:o.checkoutSession.landedCost)||void 0===m?void 0:m.shortId)||null,null==o?void 0:o.checkoutSession.completedAt)return void this.setToFinishStep("succeeded");if(null==o?void 0:o.checkoutSession.clientSecret){const{status:s}=await n({clientSecret:o.checkoutSession.clientSecret});if("processing"===s||"succeeded"===s)return void this.setToFinishStep(s)}throw A({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:b,cartId:null===(p=window.Zonos.cartData)||void 0===p?void 0:p.id,cartLandedCostId:v}}),new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it")}if(!i.checkoutSession)throw A({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:b||"N/A",cartId:null===(u=window.Zonos.cartData)||void 0===u?void 0:u.id,cartLandedCostId:v||"N/A"}}),new Error("Could not update/create checkout session for this collect cart");d();const e=null===(g=i.checkoutSession)||void 0===g?void 0:g.landedCost;if(!e)throw new Error("Landed cost could not be found in checkout session after creating/updating them");await x(Object.assign(Object.assign({},i.checkoutSession),{id:I.checkoutSessionId||""})),w({landedCostId:e.id}),this.applyStripeTheme()}catch(o){N(o),a({messages:[T("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:U.organizationName})],title:T("Invalid session")})}this.isOverlayLoading=!1}}toggleLanguageDialog(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile}async handleStripePaymentContinue(){var o,s,e,c;if(null===(o=t.stripeBillingAddressElement)||void 0===o||o.getValue(),null===(s=t.stripeLinkEventData)||void 0===s?void 0:s.complete)if(null===(e=t.stripeBillingAddressEventData)||void 0===e?void 0:e.complete)if("USD"!==t.checkoutSettlementCurrency||!t.shouldRenderPayInUsdButton||this.payInUsdConfirmDialogOpen){if(this.payInUsdConfirmDialogOpen=!1,S.paypalErrorMessage=null,t.hasPaymentError=!1,this.submitLoading=!0,i.inventoryCheckErrorMessage=null,!await h())return t.hasPaymentError=!0,t.customErrorMessage=T("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:t.checkoutSettlementCurrency}),void(this.submitLoading=!1);await v();try{return await m({noLandedCostCheck:!0}),i.step="finish",void(this.confirmationId=y.landedCostShortId||(null===(c=i.selectedLandedCost)||void 0===c?void 0:c.landedCostId)||null)}catch(o){N(o),t.hasPaymentError=!0}this.submitLoading=!1}else this.payInUsdConfirmDialogOpen=!0;else{const o=document.querySelector(".zonos--billing-address");null==o||o.scrollIntoView({behavior:"smooth"})}else{const o=document.querySelector("zonos-link-authentication");null==o||o.scrollIntoView({behavior:"smooth"})}}componentWillLoad(){t.stripe=window.Zonos.stripe,i.step="payment",this.initCollectCart(),this.resizeListener(),this.storeUnsubscribeList=[p("clientSecret",(()=>{this.applyStripeTheme()})),j("selectedLocale",(()=>{this.applyStripeTheme()}))],B(`mobile: ${this.isMobile}`)}disconnectedCallback(){u(),g(),this.onChangeLocaleListener(),this.storeUnsubscribeList.forEach((o=>o()))}render(){this.clientSecret=t.clientSecret,t.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=t.stripeCustomerSessionClientSecret);const o=this.getBaseCurrencySettlementInfo(),{logoUrl:l,theme:n}=U.appearance,a=()=>{const o=`${l}?timestamp=${Date.now()}`;return s("div",{class:"zonos--logo"},o&&s("img",{alt:`${U.organizationName} logo`,src:o}))},r=_(),z=()=>{var o;const e=new URLSearchParams(window.location.search),t=e.get("zonosQaUrl"),l=e.get("zonosDebug"),n=null===(o=F.find((o=>o.code===O.selectedLocale)))||void 0===o?void 0:o.label;return s(c,null,s("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},s("div",{class:"zonos--logo-wrapper"},a(),r&&s("zonos-badge",{badgeColor:"orange",size:"small"},T("Test mode")),"1"===l&&s("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&s("zonos-badge",{badgeColor:"purple",size:"small"},t)),s("div",{class:"zonos--header-right"},s("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:()=>this.toggleLanguageDialog(),variant:"outline"},n,s("zonos-icon",{"aria-label":"Language select",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"})),s("div",{class:D(["zonos--collect-language-dialog",this.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},s("zonos-language-select",{handleOnClose:()=>this.toggleLanguageDialog()})))),k({content:s("zonos-text",{class:"zonos--header-title",type:"header"},y.originCompanyName?T("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:y.originCompanyName}):T("Customs charges from your recent purchase are available for payment")),isLoading:y.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};return s(e,{class:D(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":n},(()=>this.isOverlayLoading||t.isFetchingSession?null:s("div",{class:"zonos--content"},"finish"!==i.step&&"error"!==i.step&&s(c,null,(this.isMobile||this.isTablet)&&z(),s("div",{class:"zonos--left","data-theme":n},!this.isMobile&&!this.isTablet&&z(),s("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},T("Billing info")),s("zonos-v-stack",{spacing:16},s("zonos-link-authentication",{titleText:""}),s("zonos-address",{titleText:"",type:"billing"})),s("zonos-collect-payment",{class:D(["zonos--collect-container"]),continueLoading:this.submitLoading,onContinueClicked:async()=>{await this.handleStripePaymentContinue()}})),s("div",{class:"zonos--right","data-theme":n},s("zonos-collect-review",{mobile:this.isMobile,tablet:this.isTablet}),s("div",{class:"zonos--order-details-container"},s("zonos-collect-order-details",{collapsed:this.collapseReview,mobile:this.isMobile,onCollapseClicked:()=>{this.collapseReview=!this.collapseReview}})),s("div",{class:"flex--wrapper"},s("zonos-v-stack",{spacing:16},s("zonos-collect-subtotal",null)),!this.isMobile&&!this.isTablet&&s("zonos-collect-footer",{"data-theme":n,mobile:this.isMobile,tablet:this.isTablet})))),("finish"===i.step||"error"===i.step)&&s("div",{class:"zonos--done","data-theme":n},s("div",{class:"zonos--header"},a()),s("zonos-collect-finish",{confirmationId:this.confirmationId,overrideNotification:"error"===i.step&&i.error?Object.assign(Object.assign({},i.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),(this.isMobile||this.isTablet||"finish"===i.step||"error"===i.step)&&s("zonos-collect-footer",{"data-theme":n,mobile:this.isMobile,tablet:this.isTablet})))(),o&&s("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:T("Cancel"),dialogConfirmBtnText:T("Pay [orderTotal]",{orderTotal:L({amount:o.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:T("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:T("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),s("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}};H.style=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-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-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";export{H as zonos_collect}
|