@zonos/elements 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cart-108bc407.js → cart-a969ee0b.js} +8 -8
- package/dist/cjs/{cart-108bc407.js.map → cart-a969ee0b.js.map} +1 -1
- package/dist/cjs/{getBorderRadius-2904800c.js → getBorderRadius-ae52cae1.js} +2 -2
- package/dist/cjs/{getBorderRadius-2904800c.js.map → getBorderRadius-ae52cae1.js.map} +1 -1
- package/dist/cjs/{isDarkColor-a86b8a05.js → isDarkColor-e1a7bf45.js} +2 -2
- package/dist/cjs/{isDarkColor-a86b8a05.js.map → isDarkColor-e1a7bf45.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-f6a1b679.js → localization-d510574c.js} +200 -12
- package/dist/cjs/localization-d510574c.js.map +1 -0
- package/dist/cjs/{submitGtag-b1b96579.js → submitGtag-4de4430f.js} +3 -3
- package/dist/cjs/{submitGtag-b1b96579.js.map → submitGtag-4de4430f.js.map} +1 -1
- package/dist/cjs/zonos-address_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-banner.cjs.entry.js +68 -0
- package/dist/cjs/zonos-banner.cjs.entry.js.map +1 -0
- package/dist/cjs/zonos-button_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +12 -12
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -9
- package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
- package/dist/cjs/zonos-controller.cjs.entry.js.map +1 -1
- package/dist/cjs/zonos-country-flag_4.cjs.entry.js +6 -6
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +12 -8
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +237 -22
- package/dist/cjs/zonos-hello.cjs.entry.js.map +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +60 -0
- package/dist/cjs/zonos-payment.cjs.entry.js.map +1 -0
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/{zonosStore-960e5542.js → zonosStore-d9cdaec6.js} +6 -22
- package/dist/cjs/zonosStore-d9cdaec6.js.map +1 -0
- package/dist/collection/components/checkout/zonos-checkout/assets/LeftArrow.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/assets/MessageIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/assets/RemoveIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/assets/InfoIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/RemoveIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/SuccessIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronDownIcon.svg +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronUpIcon.svg +1 -1
- package/dist/collection/components/common/zonos-banner/zonos-banner.css +6 -1
- package/dist/collection/components/common/zonos-banner/zonos-banner.js +1 -1
- package/dist/collection/components/common/zonos-banner/zonos-banner.js.map +1 -1
- package/dist/collection/components/common/zonos-country-select/assets/arrowLeftBlue.svg +1 -1
- package/dist/collection/components/common/zonos-dialog/assets/removeIcon.svg +1 -1
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js.map +1 -1
- package/dist/collection/components/hello/zonos-hello/zonos-hello.css +20 -2
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +135 -20
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js.map +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/assets/bagIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/assets/messageIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/assets/moneyIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/assets/removeIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/chevronDownIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/zonosIcon.svg +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.css +12 -4
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +30 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js.map +1 -1
- package/dist/collection/components/store/hello/localization.js +2 -4
- package/dist/collection/components/store/hello/localization.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +9 -0
- package/dist/collection/components/store/translationStore/strings.arabic.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.base.js +9 -0
- package/dist/collection/components/store/translationStore/strings.base.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.chinese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.danish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.danish.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.dutch.js +9 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.french.js +9 -0
- package/dist/collection/components/store/translationStore/strings.french.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.german.js +9 -0
- package/dist/collection/components/store/translationStore/strings.german.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.hebrew.js +9 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.indonesian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.italian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.italian.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.japanese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.korean.js +9 -0
- package/dist/collection/components/store/translationStore/strings.korean.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.norwegian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.polish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.polish.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.portuguese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.russian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.russian.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.spanish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.swedish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.turkish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js.map +1 -1
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js.map +1 -1
- package/dist/collection/components/store/zonosStore.js +5 -3
- package/dist/collection/components/store/zonosStore.js.map +1 -1
- package/dist/collection/components/utils/api/checkItemRestrictions.js +18 -0
- package/dist/collection/components/utils/api/checkItemRestrictions.js.map +1 -0
- package/dist/collection/components/utils/hello/detectItemRestrictions.js +29 -0
- package/dist/collection/components/utils/hello/detectItemRestrictions.js.map +1 -0
- package/dist/collection/components/utils/hello/getCurrentHelloLocalePage.js +8 -7
- package/dist/collection/components/utils/hello/getCurrentHelloLocalePage.js.map +1 -1
- package/dist/collection/components/utils/hello/getProductsOnPage.js +49 -0
- package/dist/collection/components/utils/hello/getProductsOnPage.js.map +1 -0
- package/dist/collection/components/utils/hello/setZonosCountryUrlParam.js +10 -0
- package/dist/collection/components/utils/hello/setZonosCountryUrlParam.js.map +1 -0
- package/dist/collection/environment.js +34 -7
- package/dist/collection/environment.js.map +1 -1
- package/dist/collection/scripts/loadStripe.js +3 -3
- package/dist/collection/scripts/loadStripe.js.map +1 -1
- package/dist/collection/scripts/stripe.js +3 -3
- package/dist/collection/scripts/stripe.js.map +1 -1
- package/dist/collection/scripts/zonos.js +83 -30
- package/dist/collection/scripts/zonos.js.map +1 -1
- package/dist/collection/types/generated/graphql.customer.types.js +34 -0
- package/dist/collection/types/generated/graphql.customer.types.js.map +1 -1
- package/dist/collection/types/hello/HelloConfig.js.map +1 -1
- package/dist/collection/types/hello/Product.js +2 -0
- package/dist/collection/types/hello/Product.js.map +1 -0
- package/dist/collection/types/hello/RestrictedItem.js +2 -0
- package/dist/collection/types/hello/RestrictedItem.js.map +1 -0
- package/dist/components/localization.js +198 -11
- package/dist/components/localization.js.map +1 -1
- package/dist/components/stripe.js +3 -3
- package/dist/components/stripe.js.map +1 -1
- package/dist/components/zonos-banner2.js +2 -2
- package/dist/components/zonos-banner2.js.map +1 -1
- package/dist/components/zonos-cart-subtotal2.js +1 -1
- package/dist/components/zonos-checkout-finish2.js +2 -2
- package/dist/components/zonos-checkout.js +3 -3
- package/dist/components/zonos-controller.js +1 -1
- package/dist/components/zonos-controller.js.map +1 -1
- package/dist/components/zonos-country-select2.js +1 -1
- package/dist/components/zonos-dialog2.js +1 -1
- package/dist/components/zonos-hello-dialog-footer2.js +2 -2
- package/dist/components/zonos-hello-dialog2.js +18 -7
- package/dist/components/zonos-hello-dialog2.js.map +1 -1
- package/dist/components/zonos-hello.js +247 -22
- package/dist/components/zonos-hello.js.map +1 -1
- package/dist/components/zonos-review2.js +2 -2
- package/dist/components/zonos-shipping-rich-radio2.js +1 -1
- package/dist/components/zonos-shipping-rich-radio2.js.map +1 -1
- package/dist/components/zonosStore.js +5 -21
- package/dist/components/zonosStore.js.map +1 -1
- package/dist/{zonos-elements/cart-2f83e048.js → esm/cart-d00e1acb.js} +8 -8
- package/dist/esm/{cart-2f83e048.js.map → cart-d00e1acb.js.map} +1 -1
- package/dist/{zonos-elements/getBorderRadius-82fbaf25.js → esm/getBorderRadius-e8ad5967.js} +2 -2
- package/dist/esm/{getBorderRadius-82fbaf25.js.map → getBorderRadius-e8ad5967.js.map} +1 -1
- package/dist/{zonos-elements/isDarkColor-b21326ae.js → esm/isDarkColor-3bb345f4.js} +2 -2
- package/dist/{zonos-elements/isDarkColor-b21326ae.js.map → esm/isDarkColor-3bb345f4.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/{zonos-elements/localization-4a424f49.js → esm/localization-1d92a557.js} +200 -13
- package/dist/esm/localization-1d92a557.js.map +1 -0
- package/dist/{zonos-elements/submitGtag-fbdb454b.js → esm/submitGtag-85914088.js} +3 -3
- package/dist/esm/{submitGtag-fbdb454b.js.map → submitGtag-85914088.js.map} +1 -1
- package/dist/esm/zonos-address_2.entry.js +5 -5
- package/dist/esm/zonos-banner.entry.js +64 -0
- package/dist/esm/zonos-banner.entry.js.map +1 -0
- package/dist/esm/zonos-button_2.entry.js +3 -3
- package/dist/esm/zonos-cart-items_10.entry.js +12 -12
- package/dist/esm/zonos-checkout.entry.js +9 -9
- package/dist/esm/zonos-controller.entry.js +6 -6
- package/dist/esm/zonos-controller.entry.js.map +1 -1
- package/dist/esm/zonos-country-flag_4.entry.js +6 -6
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +12 -8
- package/dist/esm/zonos-hello-dialog.entry.js.map +1 -1
- package/dist/esm/zonos-hello.entry.js +237 -22
- package/dist/esm/zonos-hello.entry.js.map +1 -1
- package/dist/esm/zonos-payment.entry.js +56 -0
- package/dist/esm/zonos-payment.entry.js.map +1 -0
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-shipping-rich-radio.entry.js.map +1 -1
- package/dist/{zonos-elements/zonosStore-13a7b534.js → esm/zonosStore-1c9c7d76.js} +6 -22
- package/dist/esm/zonosStore-1c9c7d76.js.map +1 -0
- package/dist/esm-es5/cart-d00e1acb.js +2 -0
- package/dist/esm-es5/{cart-2f83e048.js.map → cart-d00e1acb.js.map} +1 -1
- package/dist/esm-es5/{getBorderRadius-82fbaf25.js → getBorderRadius-e8ad5967.js} +2 -2
- package/dist/esm-es5/{isDarkColor-b21326ae.js → isDarkColor-3bb345f4.js} +2 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/localization-1d92a557.js +2 -0
- package/dist/esm-es5/localization-1d92a557.js.map +1 -0
- package/dist/esm-es5/{submitGtag-fbdb454b.js → submitGtag-85914088.js} +2 -2
- package/dist/esm-es5/zonos-address_2.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +2 -0
- package/dist/esm-es5/zonos-banner.entry.js.map +1 -0
- package/dist/esm-es5/zonos-button_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js.map +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js.map +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js.map +1 -1
- package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag_4.entry.js.map +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-elements.js.map +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js.map +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js.map +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +2 -0
- package/dist/esm-es5/zonos-payment.entry.js.map +1 -0
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js.map +1 -1
- package/dist/esm-es5/zonosStore-1c9c7d76.js +2 -0
- package/dist/esm-es5/zonosStore-1c9c7d76.js.map +1 -0
- package/dist/scripts/loadStripe.js +6 -6
- package/dist/scripts/loadZonos.js +92 -35
- package/dist/scripts/stripe.js +5 -5
- package/dist/scripts/zonos.js +92 -35
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +24 -1
- package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +9 -0
- package/dist/types/components/store/zonosStore.d.ts +1 -1
- package/dist/types/components/utils/api/checkItemRestrictions.d.ts +22 -0
- package/dist/types/components/utils/hello/detectItemRestrictions.d.ts +14 -0
- package/dist/types/components/utils/hello/getCurrentHelloLocalePage.d.ts +2 -1
- package/dist/types/components/utils/hello/getProductsOnPage.d.ts +2 -0
- package/dist/types/components/utils/hello/setZonosCountryUrlParam.d.ts +2 -0
- package/dist/types/components.d.ts +12 -0
- package/dist/types/environment.d.ts +9 -0
- package/dist/types/scripts/loadStripe.d.ts +1 -1
- package/dist/types/scripts/stripe.d.ts +2 -2
- package/dist/types/scripts/zonos.d.ts +2 -0
- package/dist/types/types/generated/graphql.customer.types.d.ts +75 -1
- package/dist/types/types/generated/graphql.customer.types.ts +113 -1
- package/dist/types/types/hello/HelloConfig.d.ts +4 -0
- package/dist/types/types/hello/Product.d.ts +5 -0
- package/dist/types/types/hello/RestrictedItem.d.ts +6 -0
- package/dist/zonos-elements/assets/ChevronDownIcon.svg +1 -1
- package/dist/zonos-elements/assets/ChevronUpIcon.svg +1 -1
- package/dist/zonos-elements/assets/InfoIcon.svg +1 -1
- package/dist/zonos-elements/assets/LeftArrow.svg +1 -1
- package/dist/zonos-elements/assets/MessageIcon.svg +1 -1
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/assets/SuccessIcon.svg +1 -1
- package/dist/zonos-elements/assets/bagIcon.svg +1 -1
- package/dist/zonos-elements/assets/messageIcon.svg +1 -1
- package/dist/zonos-elements/assets/moneyIcon.svg +1 -1
- package/dist/zonos-elements/assets/removeIcon.svg +1 -1
- package/dist/zonos-elements/cart-c641ddaf.system.js +2 -0
- package/dist/zonos-elements/{cart-9780fa28.system.js.map → cart-c641ddaf.system.js.map} +1 -1
- package/dist/{esm/cart-2f83e048.js → zonos-elements/cart-d00e1acb.js} +8 -8
- package/dist/zonos-elements/{cart-2f83e048.js.map → cart-d00e1acb.js.map} +1 -1
- package/dist/zonos-elements/{getBorderRadius-4fbe49de.system.js → getBorderRadius-b59c3ada.system.js} +2 -2
- package/dist/{esm/getBorderRadius-82fbaf25.js → zonos-elements/getBorderRadius-e8ad5967.js} +2 -2
- package/dist/zonos-elements/{getBorderRadius-82fbaf25.js.map → getBorderRadius-e8ad5967.js.map} +1 -1
- package/dist/zonos-elements/{isDarkColor-dc2b7c8f.system.js → isDarkColor-231502d4.system.js} +2 -2
- package/dist/{esm/isDarkColor-b21326ae.js → zonos-elements/isDarkColor-3bb345f4.js} +2 -2
- package/dist/{esm/isDarkColor-b21326ae.js.map → zonos-elements/isDarkColor-3bb345f4.js.map} +1 -1
- package/dist/{esm/localization-4a424f49.js → zonos-elements/localization-1d92a557.js} +200 -13
- package/dist/zonos-elements/localization-1d92a557.js.map +1 -0
- package/dist/zonos-elements/localization-a6b6a5a5.system.js +2 -0
- package/dist/zonos-elements/localization-a6b6a5a5.system.js.map +1 -0
- package/dist/zonos-elements/submitGtag-764af8c4.system.js +2 -0
- package/dist/{esm/submitGtag-fbdb454b.js → zonos-elements/submitGtag-85914088.js} +3 -3
- package/dist/zonos-elements/{submitGtag-fbdb454b.js.map → submitGtag-85914088.js.map} +1 -1
- package/dist/zonos-elements/zonos-address_2.entry.js +5 -5
- package/dist/zonos-elements/zonos-address_2.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-banner.entry.js +64 -0
- package/dist/zonos-elements/zonos-banner.entry.js.map +1 -0
- package/dist/zonos-elements/zonos-banner.system.entry.js +2 -0
- package/dist/zonos-elements/zonos-banner.system.entry.js.map +1 -0
- package/dist/zonos-elements/zonos-button_2.entry.js +3 -3
- package/dist/zonos-elements/zonos-button_2.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-cart-items_10.entry.js +12 -12
- package/dist/zonos-elements/zonos-cart-items_10.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-cart-items_10.system.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-checkout.entry.js +9 -9
- package/dist/zonos-elements/zonos-checkout.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-checkout.system.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-controller.entry.js +6 -6
- package/dist/zonos-elements/zonos-controller.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-controller.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-controller.system.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-country-flag_4.entry.js +6 -6
- package/dist/zonos-elements/zonos-country-flag_4.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-country-flag_4.system.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.system.js +1 -1
- package/dist/zonos-elements/zonos-elements.system.js.map +1 -1
- package/dist/zonos-elements/zonos-hello-dialog.entry.js +12 -8
- package/dist/zonos-elements/zonos-hello-dialog.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-hello-dialog.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-hello-dialog.system.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-hello.entry.js +237 -22
- package/dist/zonos-elements/zonos-hello.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-hello.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-hello.system.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-payment.entry.js +56 -0
- package/dist/zonos-elements/zonos-payment.entry.js.map +1 -0
- package/dist/zonos-elements/zonos-payment.system.entry.js +2 -0
- package/dist/zonos-elements/zonos-payment.system.entry.js.map +1 -0
- package/dist/zonos-elements/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/zonos-elements/zonos-shipping-rich-radio.entry.js.map +1 -1
- package/dist/zonos-elements/zonos-shipping-rich-radio.system.entry.js +1 -1
- package/dist/zonos-elements/zonos-shipping-rich-radio.system.entry.js.map +1 -1
- package/dist/{esm/zonosStore-13a7b534.js → zonos-elements/zonosStore-1c9c7d76.js} +6 -22
- package/dist/zonos-elements/zonosStore-1c9c7d76.js.map +1 -0
- package/dist/zonos-elements/zonosStore-e5c545ea.system.js +2 -0
- package/dist/zonos-elements/zonosStore-e5c545ea.system.js.map +1 -0
- package/package.json +1 -1
- package/dist/cjs/localization-f6a1b679.js.map +0 -1
- package/dist/cjs/zonos-banner_2.cjs.entry.js +0 -120
- package/dist/cjs/zonos-banner_2.cjs.entry.js.map +0 -1
- package/dist/cjs/zonosStore-960e5542.js.map +0 -1
- package/dist/esm/localization-4a424f49.js.map +0 -1
- package/dist/esm/zonos-banner_2.entry.js +0 -115
- package/dist/esm/zonos-banner_2.entry.js.map +0 -1
- package/dist/esm/zonosStore-13a7b534.js.map +0 -1
- package/dist/esm-es5/cart-2f83e048.js +0 -2
- package/dist/esm-es5/localization-4a424f49.js +0 -2
- package/dist/esm-es5/localization-4a424f49.js.map +0 -1
- package/dist/esm-es5/zonos-banner_2.entry.js +0 -2
- package/dist/esm-es5/zonos-banner_2.entry.js.map +0 -1
- package/dist/esm-es5/zonosStore-13a7b534.js +0 -2
- package/dist/esm-es5/zonosStore-13a7b534.js.map +0 -1
- package/dist/zonos-elements/cart-9780fa28.system.js +0 -2
- package/dist/zonos-elements/localization-3c43290f.system.js +0 -2
- package/dist/zonos-elements/localization-3c43290f.system.js.map +0 -1
- package/dist/zonos-elements/localization-4a424f49.js.map +0 -1
- package/dist/zonos-elements/submitGtag-23ecdc20.system.js +0 -2
- package/dist/zonos-elements/zonos-banner_2.entry.js +0 -115
- package/dist/zonos-elements/zonos-banner_2.entry.js.map +0 -1
- package/dist/zonos-elements/zonos-banner_2.system.entry.js +0 -2
- package/dist/zonos-elements/zonos-banner_2.system.entry.js.map +0 -1
- package/dist/zonos-elements/zonosStore-13a7b534.js.map +0 -1
- package/dist/zonos-elements/zonosStore-77bcd7c0.system.js +0 -2
- package/dist/zonos-elements/zonosStore-77bcd7c0.system.js.map +0 -1
- /package/dist/esm-es5/{getBorderRadius-82fbaf25.js.map → getBorderRadius-e8ad5967.js.map} +0 -0
- /package/dist/esm-es5/{isDarkColor-b21326ae.js.map → isDarkColor-3bb345f4.js.map} +0 -0
- /package/dist/esm-es5/{submitGtag-fbdb454b.js.map → submitGtag-85914088.js.map} +0 -0
- /package/dist/zonos-elements/{getBorderRadius-4fbe49de.system.js.map → getBorderRadius-b59c3ada.system.js.map} +0 -0
- /package/dist/zonos-elements/{isDarkColor-dc2b7c8f.system.js.map → isDarkColor-231502d4.system.js.map} +0 -0
- /package/dist/zonos-elements/{submitGtag-23ecdc20.system.js.map → submitGtag-764af8c4.system.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
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,a){function s(o){try{l(n.next(o))}catch(o){a(o)}}function r(o){try{l(n["throw"](o))}catch(o){a(o)}}function l(o){o.done?t(o.value):i(o.value).then(s,r)}l((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function r(o){return function(e){return l([o,e])}}function l(r){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,r[0]&&(t=0)),t)try{if(n=1,i&&(a=r[0]&2?i["return"]:r[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,r[1])).done)return a;if(i=0,a)r=[r[0]&2,a.value];switch(r[0]){case 0:case 1:a=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;i=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!a||r[1]>a[0]&&r[1]<a[3])){t.label=r[1];break}if(r[0]===6&&t.label<a[1]){t.label=a[1];a=r;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(r);break}if(a[2])t.ops.pop();t.trys.pop();continue}r=e.call(o,t)}catch(o){r=[6,o];i=0}finally{n=a=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-d1aa9293.js";import{f as currencyConvertAndFormat,t as translate,a as localizationStore}from"./localization-4a424f49.js";import{z as zonosStore}from"./zonosStore-13a7b534.js";import{c as classes}from"./classes-0d95c529.js";import{g as getHasMoreSpaceOnRight}from"./getHasMoreSpaceOnRight-feba1ae2.js";var BagIcon='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n';var MessageIcon='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var MoneyIcon='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n';var RemoveIcon='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var zonosHelloDialogCss=":host{font-family:Inter;display:block}: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 .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--amino-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--amino-radius-12);outline:none;-webkit-box-shadow:var(--amino-v3-shadow-xxl);box-shadow:var(--amino-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;text-align:center;z-index:1001}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--amino-radius-12);border-bottom-right-radius:var(--amino-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:var(--amino-space-8);top:var(--amino-space-8);width:var(--amino-size-md);height:var(--amino-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--amino-hover-color);border-radius:var(--amino-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:var(--amino-space-16)}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--amino-space-8)}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:unset;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform-origin:bottom;transform-origin:bottom;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:unset;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform-origin:bottom;transform-origin:bottom;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";var ZonosHelloDialog=function(){function o(o){var e=this;registerInstance(this,o);this.closeDialog=createEvent(this,"closeDialog",7);this.clickOutsideDialogHandler=function(o){if(!o.composedPath().includes(e.dialogRef)&&e.isOpen){e.setIsOpen(false)}};this.getCurrentPageEnum=function(){switch(zonosStore.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}};this.setShowCountrySelect=function(o){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){this.showCountrySelect=o;return[2]}))}))};this.isOpen=false;this.setIsOpen=function(){};this.mobileLocationOverride=undefined;this.animateFromLeftOverride=undefined;this.appearanceSettings=undefined;this.welcomeMessage="Welcome to our Demo App!";this.showCountrySelect=false}o.prototype.globalClickHandler=function(o){this.clickOutsideDialogHandler(o)};o.prototype.isOpenHandler=function(o){if(!o){void this.setShowCountrySelect(false)}};o.prototype.render=function(){var o=this;var e;var t=localizationStore.countryLandedCost,n=localizationStore.selectedCountryCode;var i=(t===null||t===void 0?void 0:t.dutyDeminimus)?currencyConvertAndFormat(t.dutyDeminimus):null;var a=i?"".concat(translate("Spend")," ").concat(i," ").concat(translate("duty free")):translate("Duties will apply to all orders");var s=(t===null||t===void 0?void 0:t.vatTaxDeminimus)?currencyConvertAndFormat(t.vatTaxDeminimus):null;var r=s?"".concat(translate("Spend")," ").concat(s," ").concat(translate("tax free")):translate("Taxes will apply to all orders");var l=this.animateFromLeftOverride||this.dialogRef&&getHasMoreSpaceOnRight(this.dialogRef);var c=localizationStore.customMessages;var d="".concat(translate("Welcome to")," ").concat(zonosStore.organizationName,"!");var u=((e=c.find((function(o){return o.pageName==="hello_default"})))===null||e===void 0?void 0:e.message)||translate("Know about duties and taxes before you buy. Shop with confidence!");var g=this.getCurrentPageEnum();var f=c.filter((function(o){return o.pageName===g}));return h(Host,{class:"zonos--elements"},h("div",{"aria-hidden":"true",class:classes(["zonos--hello-dialog",l&&"zonos--hello-dialog-animate-from-left",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),ref:function(e){return e&&(o.dialogRef=e)}},h("div",{class:"zonos--hello-dialog-content"},h("zonos-button",{class:"zonos--close-button",icon:h("zonos-icon",{content:RemoveIcon}),noBackground:true,onClick:function(){return o.setIsOpen(false)}}),this.showCountrySelect?h("div",null,h("zonos-country-select",{closeCountrySelect:function(){return o.setShowCountrySelect(false)}})):h("div",null,h("zonos-v-stack",{spacing:24},h("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:n}),h("zonos-v-stack",{spacing:4},h("zonos-text",{type:"boldSubheader"},d),h("zonos-text",{color:"gray-800"},u)),h("zonos-v-stack",{spacing:8},h("zonos-card",{spacing:"12px"},h("zonos-v-stack",{spacing:8},h("div",{class:"zonos--flex-message"},h("zonos-icon",{content:BagIcon}),h("zonos-text",null,a)),h("div",{class:"zonos--flex-message"},h("zonos-icon",{content:MoneyIcon}),h("zonos-text",null,r)))),f.map((function(o){return h("zonos-custom-message",{icon:MessageIcon,message:o.message})})))))),!this.showCountrySelect&&h("zonos-hello-dialog-footer",{appearanceSettings:this.appearanceSettings,setShowCountrySelect:function(e){return o.setShowCountrySelect(e)}})))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{isOpen:["isOpenHandler"]}},enumerable:false,configurable:true});return o}();ZonosHelloDialog.style=zonosHelloDialogCss;export{ZonosHelloDialog as zonos_hello_dialog};
|
|
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,s){function a(o){try{l(n.next(o))}catch(o){s(o)}}function r(o){try{l(n["throw"](o))}catch(o){s(o)}}function l(o){o.done?t(o.value):i(o.value).then(a,r)}l((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(o){return function(e){return l([o,e])}}function l(r){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(t=0)),t)try{if(n=1,i&&(s=r[0]&2?i["return"]:r[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,r[1])).done)return s;if(i=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;i=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){t.label=r[1];break}if(r[0]===6&&t.label<s[1]){t.label=s[1];s=r;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(r);break}if(s[2])t.ops.pop();t.trys.pop();continue}r=e.call(o,t)}catch(o){r=[6,o];i=0}finally{n=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-d1aa9293.js";import{f as currencyConvertAndFormat,t as translate,a as localizationStore}from"./localization-1d92a557.js";import{z as zonosStore}from"./zonosStore-1c9c7d76.js";import{c as classes}from"./classes-0d95c529.js";import{g as getHasMoreSpaceOnRight}from"./getHasMoreSpaceOnRight-feba1ae2.js";var BagIcon='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n';var MessageIcon='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var MoneyIcon='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n';var RemoveIcon='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var zonosHelloDialogCss=":host{font-family:Inter;display:block}: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 .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--amino-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--amino-radius-12);outline:none;-webkit-box-shadow:var(--amino-v3-shadow-xxl);box-shadow:var(--amino-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:1001}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--amino-radius-12);border-bottom-right-radius:var(--amino-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:var(--amino-space-8);top:var(--amino-space-8);width:var(--amino-size-md);height:var(--amino-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--amino-hover-color);border-radius:var(--amino-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:var(--amino-space-16)}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--amino-space-12)}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:unset;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:unset;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";var ZonosHelloDialog=function(){function o(o){var e=this;registerInstance(this,o);this.closeDialog=createEvent(this,"closeDialog",7);this.clickOutsideDialogHandler=function(o){if(!o.composedPath().includes(e.dialogRef)&&e.isOpen){e.setIsOpen(false)}};this.getCurrentPageEnum=function(){switch(zonosStore.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}};this.setShowCountrySelect=function(o){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){this.showCountrySelect=o;return[2]}))}))};this.isOpen=false;this.setIsOpen=function(){};this.mobileLocationOverride=undefined;this.animateFromLeftOverride=undefined;this.appearanceSettings=undefined;this.restrictedItems=[];this.welcomeMessage="Welcome to our Demo App!";this.showCountrySelect=false}o.prototype.globalClickHandler=function(o){this.clickOutsideDialogHandler(o)};o.prototype.isOpenHandler=function(o){if(!o){void this.setShowCountrySelect(false)}};o.prototype.render=function(){var o=this;var e;var t=localizationStore.countryLandedCost,n=localizationStore.selectedCountryCode;var i=(t===null||t===void 0?void 0:t.dutyDeminimus)?currencyConvertAndFormat(t.dutyDeminimus):null;var s=i?"".concat(translate("Spend")," ").concat(i," ").concat(translate("duty free")):translate("Duties will apply to all orders");var a=(t===null||t===void 0?void 0:t.vatTaxDeminimus)?currencyConvertAndFormat(t.vatTaxDeminimus):null;var r=a?"".concat(translate("Spend")," ").concat(a," ").concat(translate("tax free")):translate("Taxes will apply to all orders");var l=this.animateFromLeftOverride||this.dialogRef&&getHasMoreSpaceOnRight(this.dialogRef);var c=localizationStore.customMessages;var d="".concat(translate("Welcome to")," ").concat(zonosStore.organizationName,"!");var u=((e=c.find((function(o){return o.pageName==="hello_default"})))===null||e===void 0?void 0:e.message)||translate("Know about duties and taxes before you buy. Shop with confidence!");var g=this.getCurrentPageEnum();var f=c.filter((function(o){return o.pageName===g}));return h(Host,{class:"zonos--elements"},h("div",{"aria-hidden":"true",class:classes(["zonos--hello-dialog",l&&"zonos--hello-dialog-animate-from-left",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),ref:function(e){return e&&(o.dialogRef=e)}},h("div",{class:"zonos--hello-dialog-content"},h("zonos-button",{class:"zonos--close-button",icon:h("zonos-icon",{content:RemoveIcon}),noBackground:true,onClick:function(){return o.setIsOpen(false)}}),this.showCountrySelect?h("div",null,h("zonos-country-select",{closeCountrySelect:function(){return o.setShowCountrySelect(false)}})):h("div",null,h("zonos-v-stack",{spacing:24},h("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:n}),h("zonos-v-stack",{class:"zonos--hello-dialog-header",spacing:4},h("zonos-text",{type:"boldSubheader"},d),h("zonos-text",{color:"gray-800"},u)),h("zonos-v-stack",{spacing:8},this.restrictedItems.map((function(o){var e;return o&&h("zonos-banner",{bannerTitle:o.name,intent:"error"},(e=o.itemRestrictions)===null||e===void 0?void 0:e.map((function(o){return h("zonos-text",{color:"red-800"},o===null||o===void 0?void 0:o.note)})))})),h("zonos-card",{spacing:"12px"},h("zonos-v-stack",{spacing:12},h("div",{class:"zonos--flex-message"},h("zonos-icon",{content:BagIcon}),h("zonos-text",null,s)),h("div",{class:"zonos--flex-message"},h("zonos-icon",{content:MoneyIcon}),h("zonos-text",null,r)))),f.map((function(o){return h("zonos-custom-message",{icon:MessageIcon,message:o.message})})))))),!this.showCountrySelect&&h("zonos-hello-dialog-footer",{appearanceSettings:this.appearanceSettings,setShowCountrySelect:function(e){return o.setShowCountrySelect(e)}})))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{isOpen:["isOpenHandler"]}},enumerable:false,configurable:true});return o}();ZonosHelloDialog.style=zonosHelloDialogCss;export{ZonosHelloDialog as zonos_hello_dialog};
|
|
2
2
|
//# sourceMappingURL=zonos-hello-dialog.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["zonosHelloDialogCss","ZonosHelloDialog","this","clickOutsideDialogHandler","e","composedPath","includes","_this","dialogRef","isOpen","setIsOpen","getCurrentPageEnum","zonosStore","currentHelloPage","setShowCountrySelect","value","__awaiter","showCountrySelect","class_1","prototype","globalClickHandler","isOpenHandler","render","countryLandedCost","localizationStore","selectedCountryCode","dutyDeminimis","dutyDeminimus","currencyConvertAndFormat","dutyDeMinimisMessage","concat","translate","taxDeminimis","vatTaxDeminimus","taxDeMinimisMessage","animateLeft","animateFromLeftOverride","getHasMoreSpaceOnRight","customMessages","welcomeMessage","organizationName","defaultMessage","_a","find","x","pageName","message","currentPage","filteredMessages","filter","h","Host","class","classes","mobileLocationOverride","ref","el","icon","content","RemoveIcon","noBackground","onClick","closeCountrySelect","spacing","countryCode","type","color","BagIcon","MoneyIcon","map","MessageIcon","appearanceSettings"],"sources":["src/components/hello/zonos-hello-dialog/zonos-hello-dialog.scss?tag=zonos-hello-dialog&encapsulation=shadow","src/components/hello/zonos-hello-dialog/zonos-hello-dialog.tsx"],"sourcesContent":[":host {\n .zonos--hello-country-flag {\n @include zonos--hello-country-flag;\n }\n\n .zonos--hello-dialog {\n position: absolute;\n background: $amino-surface-color;\n width: 100vw;\n max-width: 430px;\n height: fit-content;\n max-height: 600px;\n border-radius: $amino-radius-12;\n outline: none;\n box-shadow: $amino-v3-shadow-xxl;\n overflow-y: auto;\n top: -2px;\n right: -2px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;\n transform: scale(0);\n transform-origin: top right;\n text-align: center;\n z-index: 1001;\n\n &.zonos--hello-dialog-animate-from-left {\n transform-origin: top left;\n right: unset;\n left: -2px;\n }\n\n &::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n &::-webkit-scrollbar-track {\n background: #f5f5f5;\n border-top-right-radius: $amino-radius-12;\n border-bottom-right-radius: $amino-radius-12;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background: #ccc;\n border: 4px solid transparent;\n background-clip: content-box;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #999;\n }\n\n .zonos--animate-content {\n opacity: 0;\n height: 0;\n transition: all 0.3s ease-in-out;\n }\n .zonos--show-animate-content {\n opacity: 1;\n height: 100%;\n }\n\n &.zonos--hello-dialog-open {\n opacity: 1;\n transform: scale(1);\n }\n\n .zonos--close-button {\n position: absolute;\n right: $amino-space-8;\n top: $amino-space-8;\n width: $amino-size-md;\n height: $amino-size-md;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n z-index: 10;\n &:hover {\n background: $amino-hover-color;\n border-radius: $amino-radius-6;\n }\n }\n\n .zonos--hello-dialog-content {\n padding: $amino-space-16;\n\n .zonos--hello-country-flag {\n border-radius: $amino-radius-4;\n width: 32px;\n height: 24px;\n }\n }\n\n .zonos--flex-message {\n display: flex;\n align-items: center;\n gap: $amino-space-8;\n }\n\n &.zonos--hello-dialog-mobile-override {\n @include zonos--hello-dialog-mobile;\n }\n @media (max-width: 768px) {\n @include zonos--hello-dialog-mobile;\n }\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport { localizationStore } from 'src/components/store/hello/localization';\nimport { translate } from 'src/components/store/translationStore';\nimport { zonosStore } from 'src/components/store/zonosStore';\nimport { classes } from 'src/components/utils/classes';\nimport { currencyConvertAndFormat } from 'src/components/utils/hello/currencyConversion/currencyConvertAndFormat';\nimport { getHasMoreSpaceOnRight } from 'src/components/utils/hello/getHasMoreSpaceOnRight';\nimport type { AppearanceConfig, HelloMobileLocation } from 'src/types';\nimport type { Locale_PageName_Enum } from 'src/types/generated/graphql.frontend.types';\n\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport BagIcon from './assets/bagIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport MessageIcon from './assets/messageIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport MoneyIcon from './assets/moneyIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport RemoveIcon from './assets/removeIcon.svg';\n\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-hello-dialog.scss',\n tag: 'zonos-hello-dialog',\n})\nexport class ZonosHelloDialog {\n /**\n * Whether or not the dialog is open\n */\n @Prop() isOpen: boolean = false;\n\n /**\n * The function to set the open state\n * @default () => {}\n */\n @Prop() setIsOpen: (isOpen: boolean) => void = () => {};\n\n /**\n * Force mobile styling instead of media query and use the passed location value\n * @default false\n */\n @Prop() mobileLocationOverride?: HelloMobileLocation;\n /**\n * Force left animation instead of detecting which side has more space\n * @default false\n */\n @Prop() animateFromLeftOverride?: boolean;\n /**\n * Override the appearance settings\n */\n @Prop() appearanceSettings?: Partial<AppearanceConfig>;\n\n @State() welcomeMessage: string = 'Welcome to our Demo App!';\n @State() showCountrySelect: boolean = false;\n\n /**\n * Close dialog button click\n */\n @Event() closeDialog!: EventEmitter<void>;\n\n private dialogRef!: HTMLDivElement;\n\n private clickOutsideDialogHandler = (e: MouseEvent) => {\n if (!e.composedPath().includes(this.dialogRef) && this.isOpen) {\n this.setIsOpen(false);\n }\n };\n\n private getCurrentPageEnum = (): Locale_PageName_Enum | null => {\n switch (zonosStore.currentHelloPage) {\n case 'home':\n return 'hello_homepage';\n case 'cart':\n return 'hello_cart';\n case 'productList':\n return 'hello_item_list';\n case 'productDetail':\n return 'hello_item_details';\n\n default:\n return null;\n }\n };\n\n private setShowCountrySelect = async (value: boolean) => {\n this.showCountrySelect = value;\n };\n\n @Listen('click', { target: 'document' })\n globalClickHandler(e: MouseEvent) {\n this.clickOutsideDialogHandler(e);\n }\n\n @Watch('isOpen')\n isOpenHandler(isOpen: boolean) {\n if (!isOpen) {\n void this.setShowCountrySelect(false);\n }\n }\n\n render() {\n const { countryLandedCost, selectedCountryCode } = localizationStore;\n\n // Our Robby API spells deminimis wrong here\n const dutyDeminimis = countryLandedCost?.dutyDeminimus\n ? currencyConvertAndFormat(countryLandedCost.dutyDeminimus)\n : null;\n // If deminimis is undefined or null, assume it's $0\n const dutyDeMinimisMessage = dutyDeminimis\n ? `${translate('Spend')} ${dutyDeminimis} ${translate('duty free')}`\n : translate('Duties will apply to all orders');\n\n // Our Robby API spells deminimis wrong here\n const taxDeminimis = countryLandedCost?.vatTaxDeminimus\n ? currencyConvertAndFormat(countryLandedCost.vatTaxDeminimus)\n : null;\n const taxDeMinimisMessage = taxDeminimis\n ? `${translate('Spend')} ${taxDeminimis} ${translate('tax free')}`\n : translate('Taxes will apply to all orders');\n\n const animateLeft =\n this.animateFromLeftOverride ||\n (this.dialogRef && getHasMoreSpaceOnRight(this.dialogRef));\n\n const { customMessages } = localizationStore;\n const welcomeMessage = `${translate('Welcome to')} ${\n zonosStore.organizationName\n }!`;\n const defaultMessage =\n customMessages.find(x => x.pageName === 'hello_default')?.message ||\n translate(\n 'Know about duties and taxes before you buy. Shop with confidence!',\n );\n\n const currentPage = this.getCurrentPageEnum();\n const filteredMessages = customMessages.filter(\n x => x.pageName === currentPage,\n );\n\n return (\n <Host class=\"zonos--elements\">\n <div\n aria-hidden=\"true\"\n class={classes([\n 'zonos--hello-dialog',\n animateLeft && 'zonos--hello-dialog-animate-from-left',\n !!this.mobileLocationOverride &&\n 'zonos--hello-dialog-mobile-override',\n this.isOpen && 'zonos--hello-dialog-open',\n ])}\n ref={el => el && (this.dialogRef = el)}\n >\n <div class=\"zonos--hello-dialog-content\">\n <zonos-button\n class=\"zonos--close-button\"\n icon={<zonos-icon content={RemoveIcon}></zonos-icon>}\n noBackground\n onClick={() => this.setIsOpen(false)}\n ></zonos-button>\n\n {this.showCountrySelect ? (\n <div>\n <zonos-country-select\n closeCountrySelect={() => this.setShowCountrySelect(false)}\n ></zonos-country-select>\n </div>\n ) : (\n <div>\n <zonos-v-stack spacing={24}>\n <zonos-country-flag\n class=\"zonos--hello-country-flag\"\n countryCode={selectedCountryCode}\n ></zonos-country-flag>\n\n <zonos-v-stack spacing={4}>\n <zonos-text type=\"boldSubheader\">\n {welcomeMessage}\n </zonos-text>\n <zonos-text color=\"gray-800\">{defaultMessage}</zonos-text>\n </zonos-v-stack>\n\n <zonos-v-stack spacing={8}>\n <zonos-card spacing=\"12px\">\n <zonos-v-stack spacing={8}>\n <div class=\"zonos--flex-message\">\n <zonos-icon content={BagIcon}></zonos-icon>\n <zonos-text>{dutyDeMinimisMessage}</zonos-text>\n </div>\n\n <div class=\"zonos--flex-message\">\n <zonos-icon content={MoneyIcon}></zonos-icon>\n <zonos-text>{taxDeMinimisMessage}</zonos-text>\n </div>\n </zonos-v-stack>\n </zonos-card>\n\n {filteredMessages.map(x => (\n <zonos-custom-message\n icon={MessageIcon}\n message={x.message}\n ></zonos-custom-message>\n ))}\n </zonos-v-stack>\n </zonos-v-stack>\n </div>\n )}\n </div>\n\n {!this.showCountrySelect && (\n <zonos-hello-dialog-footer\n appearanceSettings={this.appearanceSettings}\n setShowCountrySelect={value => this.setShowCountrySelect(value)}\n ></zonos-hello-dialog-footer>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"mtLAAA,IAAMA,oBAAsB,g/H,ICoCfC,iBAAgB,W,qGAqCnBC,KAAAC,0BAA4B,SAACC,GACnC,IAAKA,EAAEC,eAAeC,SAASC,EAAKC,YAAcD,EAAKE,OAAQ,CAC7DF,EAAKG,UAAU,M,GAIXR,KAAAS,mBAAqB,WAC3B,OAAQC,WAAWC,kBACjB,IAAK,OACH,MAAO,iBACT,IAAK,OACH,MAAO,aACT,IAAK,cACH,MAAO,kBACT,IAAK,gBACH,MAAO,qBAET,QACE,OAAO,K,EAILX,KAAAY,qBAAuB,SAAOC,GAAc,OAAAC,UAAAT,OAAA,qB,qCAClDL,KAAKe,kBAAoBF,E,6BAxDD,M,eAMqB,a,mIAiBb,2B,uBACI,K,CAoCtCG,EAAAC,UAAAC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AM,OAAAA,IAAOjD,EAAKC,UAAYgD,EAAxB,GAEXN,EAAA,OAAKE,MAAM,+BACTF,EAAA,gBACEE,MAAM,sBACNK,KAAMP,EAAA,cAAYQ,QAASC,aAC3BC,aAAY,KACZC,QAAS,WAAM,OAAAtD,EAAKG,UAAU,MAAf,IAGhBR,KAAKe,kBACJiC,EAAA,WACEA,EAAA,wBACEY,mBAAoB,WAAM,OAAAvD,EAAKO,qBAAqB,MAA1B,KAI9BoC,EAAA,WACEA,EAAA,iBAAea,QAAS,IACtBb,EAAA,sBACEE,MAAM,4BACNY,YAAavC,IAGfyB,EAAA,iBAAea,QAAS,GACtBb,EAAA,cAAYe,KAAK,iBACd1B,GAEHW,EAAA,cAAYgB,MAAM,YAAYzB,IAGhCS,EAAA,iBAAea,QAAS,GACtBb,EAAA,cAAYa,QAAQ,QAClBb,EAAA,iBAAea,QAAS,GACtBb,EAAA,OAAKE,MAAM,uBACTF,EAAA,cAAYQ,QAASS,UACrBjB,EAAA,kBAAarB,IAGfqB,EAAA,OAAKE,MAAM,uBACTF,EAAA,cAAYQ,QAASU,YACrBlB,EAAA,kBAAahB,MAKlBc,EAAiBqB,KAAI,SAAAzB,GAAC,OACrBM,EAAA,wBACEO,KAAMa,YACNxB,QAASF,EAAEE,SAHQ,SAY/B5C,KAAKe,mBACLiC,EAAA,6BACEqB,mBAAoBrE,KAAKqE,mBACzBzD,qBAAsB,SAAAC,GAAS,OAAAR,EAAKO,qBAAqBC,EAA1B,K,iPA1LhB,G"}
|
|
1
|
+
{"version":3,"names":["zonosHelloDialogCss","ZonosHelloDialog","this","clickOutsideDialogHandler","e","composedPath","includes","_this","dialogRef","isOpen","setIsOpen","getCurrentPageEnum","zonosStore","currentHelloPage","setShowCountrySelect","value","__awaiter","showCountrySelect","class_1","prototype","globalClickHandler","isOpenHandler","render","countryLandedCost","localizationStore","selectedCountryCode","dutyDeminimis","dutyDeminimus","currencyConvertAndFormat","dutyDeMinimisMessage","concat","translate","taxDeminimis","vatTaxDeminimus","taxDeMinimisMessage","animateLeft","animateFromLeftOverride","getHasMoreSpaceOnRight","customMessages","welcomeMessage","organizationName","defaultMessage","_a","find","x","pageName","message","currentPage","filteredMessages","filter","h","Host","class","classes","mobileLocationOverride","ref","el","icon","content","RemoveIcon","noBackground","onClick","closeCountrySelect","spacing","countryCode","type","color","restrictedItems","map","item","bannerTitle","name","intent","itemRestrictions","note","BagIcon","MoneyIcon","MessageIcon","appearanceSettings"],"sources":["src/components/hello/zonos-hello-dialog/zonos-hello-dialog.scss?tag=zonos-hello-dialog&encapsulation=shadow","src/components/hello/zonos-hello-dialog/zonos-hello-dialog.tsx"],"sourcesContent":[":host {\n .zonos--hello-country-flag {\n @include zonos--hello-country-flag;\n }\n\n .zonos--hello-dialog {\n position: absolute;\n background: $amino-surface-color;\n width: 100vw;\n max-width: 430px;\n height: fit-content;\n max-height: 600px;\n border-radius: $amino-radius-12;\n outline: none;\n box-shadow: $amino-v3-shadow-xxl;\n overflow-y: auto;\n top: -2px;\n right: -2px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;\n transform: scale(0);\n transform-origin: top right;\n z-index: 1001;\n\n .zonos--hello-dialog-header {\n text-align: center;\n }\n\n &.zonos--hello-dialog-animate-from-left {\n transform-origin: top left;\n right: unset;\n left: -2px;\n }\n\n &::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n &::-webkit-scrollbar-track {\n background: #f5f5f5;\n border-top-right-radius: $amino-radius-12;\n border-bottom-right-radius: $amino-radius-12;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background: #ccc;\n border: 4px solid transparent;\n background-clip: content-box;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #999;\n }\n\n .zonos--animate-content {\n opacity: 0;\n height: 0;\n transition: all 0.3s ease-in-out;\n }\n .zonos--show-animate-content {\n opacity: 1;\n height: 100%;\n }\n\n &.zonos--hello-dialog-open {\n opacity: 1;\n transform: scale(1);\n }\n\n .zonos--close-button {\n position: absolute;\n right: $amino-space-8;\n top: $amino-space-8;\n width: $amino-size-md;\n height: $amino-size-md;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n z-index: 10;\n &:hover {\n background: $amino-hover-color;\n border-radius: $amino-radius-6;\n }\n }\n\n .zonos--hello-dialog-content {\n padding: $amino-space-16;\n\n .zonos--hello-country-flag {\n border-radius: $amino-radius-4;\n width: 32px;\n height: 24px;\n }\n }\n\n .zonos--flex-message {\n display: flex;\n align-items: center;\n gap: $amino-space-12;\n }\n\n &.zonos--hello-dialog-mobile-override {\n @include zonos--hello-dialog-mobile;\n }\n @media (max-width: 768px) {\n @include zonos--hello-dialog-mobile;\n }\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport { localizationStore } from 'src/components/store/hello/localization';\nimport { translate } from 'src/components/store/translationStore';\nimport { zonosStore } from 'src/components/store/zonosStore';\nimport { classes } from 'src/components/utils/classes';\nimport { currencyConvertAndFormat } from 'src/components/utils/hello/currencyConversion/currencyConvertAndFormat';\nimport { getHasMoreSpaceOnRight } from 'src/components/utils/hello/getHasMoreSpaceOnRight';\nimport type { AppearanceConfig, HelloMobileLocation } from 'src/types';\nimport type { Locale_PageName_Enum } from 'src/types/generated/graphql.frontend.types';\nimport type { RestrictedItem } from 'src/types/hello/RestrictedItem';\n\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport BagIcon from './assets/bagIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport MessageIcon from './assets/messageIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport MoneyIcon from './assets/moneyIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport RemoveIcon from './assets/removeIcon.svg';\n\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-hello-dialog.scss',\n tag: 'zonos-hello-dialog',\n})\nexport class ZonosHelloDialog {\n /**\n * Whether or not the dialog is open\n */\n @Prop() isOpen: boolean = false;\n\n /**\n * The function to set the open state\n * @default () => {}\n */\n @Prop() setIsOpen: (isOpen: boolean) => void = () => {};\n\n /**\n * Force mobile styling instead of media query and use the passed location value\n * @default false\n */\n @Prop() mobileLocationOverride?: HelloMobileLocation;\n /**\n * Force left animation instead of detecting which side has more space\n * @default false\n */\n @Prop() animateFromLeftOverride?: boolean;\n /**\n * Override the appearance settings\n */\n @Prop() appearanceSettings?: Partial<AppearanceConfig>;\n\n /**\n * Item restrictions array if any\n * @default []\n */\n @Prop() restrictedItems: RestrictedItem[] = [];\n\n @State() welcomeMessage: string = 'Welcome to our Demo App!';\n @State() showCountrySelect: boolean = false;\n\n /**\n * Close dialog button click\n */\n @Event() closeDialog!: EventEmitter<void>;\n\n private dialogRef!: HTMLDivElement;\n\n private clickOutsideDialogHandler = (e: MouseEvent) => {\n if (!e.composedPath().includes(this.dialogRef) && this.isOpen) {\n this.setIsOpen(false);\n }\n };\n\n private getCurrentPageEnum = (): Locale_PageName_Enum | null => {\n switch (zonosStore.currentHelloPage) {\n case 'home':\n return 'hello_homepage';\n case 'cart':\n return 'hello_cart';\n case 'productList':\n return 'hello_item_list';\n case 'productDetail':\n return 'hello_item_details';\n\n default:\n return null;\n }\n };\n\n private setShowCountrySelect = async (value: boolean) => {\n this.showCountrySelect = value;\n };\n\n @Listen('click', { target: 'document' })\n globalClickHandler(e: MouseEvent) {\n this.clickOutsideDialogHandler(e);\n }\n\n @Watch('isOpen')\n isOpenHandler(isOpen: boolean) {\n if (!isOpen) {\n void this.setShowCountrySelect(false);\n }\n }\n\n render() {\n const { countryLandedCost, selectedCountryCode } = localizationStore;\n\n // Our Robby API spells deminimis wrong here\n const dutyDeminimis = countryLandedCost?.dutyDeminimus\n ? currencyConvertAndFormat(countryLandedCost.dutyDeminimus)\n : null;\n // If deminimis is undefined or null, assume it's $0\n const dutyDeMinimisMessage = dutyDeminimis\n ? `${translate('Spend')} ${dutyDeminimis} ${translate('duty free')}`\n : translate('Duties will apply to all orders');\n\n // Our Robby API spells deminimis wrong here\n const taxDeminimis = countryLandedCost?.vatTaxDeminimus\n ? currencyConvertAndFormat(countryLandedCost.vatTaxDeminimus)\n : null;\n const taxDeMinimisMessage = taxDeminimis\n ? `${translate('Spend')} ${taxDeminimis} ${translate('tax free')}`\n : translate('Taxes will apply to all orders');\n\n const animateLeft =\n this.animateFromLeftOverride ||\n (this.dialogRef && getHasMoreSpaceOnRight(this.dialogRef));\n\n const { customMessages } = localizationStore;\n const welcomeMessage = `${translate('Welcome to')} ${\n zonosStore.organizationName\n }!`;\n const defaultMessage =\n customMessages.find(x => x.pageName === 'hello_default')?.message ||\n translate(\n 'Know about duties and taxes before you buy. Shop with confidence!',\n );\n\n const currentPage = this.getCurrentPageEnum();\n const filteredMessages = customMessages.filter(\n x => x.pageName === currentPage,\n );\n\n return (\n <Host class=\"zonos--elements\">\n <div\n aria-hidden=\"true\"\n class={classes([\n 'zonos--hello-dialog',\n animateLeft && 'zonos--hello-dialog-animate-from-left',\n !!this.mobileLocationOverride &&\n 'zonos--hello-dialog-mobile-override',\n this.isOpen && 'zonos--hello-dialog-open',\n ])}\n ref={el => el && (this.dialogRef = el)}\n >\n <div class=\"zonos--hello-dialog-content\">\n <zonos-button\n class=\"zonos--close-button\"\n icon={<zonos-icon content={RemoveIcon}></zonos-icon>}\n noBackground\n onClick={() => this.setIsOpen(false)}\n ></zonos-button>\n\n {this.showCountrySelect ? (\n <div>\n <zonos-country-select\n closeCountrySelect={() => this.setShowCountrySelect(false)}\n ></zonos-country-select>\n </div>\n ) : (\n <div>\n <zonos-v-stack spacing={24}>\n <zonos-country-flag\n class=\"zonos--hello-country-flag\"\n countryCode={selectedCountryCode}\n ></zonos-country-flag>\n\n <zonos-v-stack class=\"zonos--hello-dialog-header\" spacing={4}>\n <zonos-text type=\"boldSubheader\">\n {welcomeMessage}\n </zonos-text>\n <zonos-text color=\"gray-800\">{defaultMessage}</zonos-text>\n </zonos-v-stack>\n\n <zonos-v-stack spacing={8}>\n {this.restrictedItems.map(\n item =>\n item && (\n <zonos-banner bannerTitle={item.name} intent=\"error\">\n {item.itemRestrictions?.map(x => (\n <zonos-text color=\"red-800\">{x?.note}</zonos-text>\n ))}\n </zonos-banner>\n ),\n )}\n\n <zonos-card spacing=\"12px\">\n <zonos-v-stack spacing={12}>\n <div class=\"zonos--flex-message\">\n <zonos-icon content={BagIcon}></zonos-icon>\n <zonos-text>{dutyDeMinimisMessage}</zonos-text>\n </div>\n\n <div class=\"zonos--flex-message\">\n <zonos-icon content={MoneyIcon}></zonos-icon>\n <zonos-text>{taxDeMinimisMessage}</zonos-text>\n </div>\n </zonos-v-stack>\n </zonos-card>\n\n {filteredMessages.map(x => (\n <zonos-custom-message\n icon={MessageIcon}\n message={x.message}\n ></zonos-custom-message>\n ))}\n </zonos-v-stack>\n </zonos-v-stack>\n </div>\n )}\n </div>\n\n {!this.showCountrySelect && (\n <zonos-hello-dialog-footer\n appearanceSettings={this.appearanceSettings}\n setShowCountrySelect={value => this.setShowCountrySelect(value)}\n ></zonos-hello-dialog-footer>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"utLAAA,IAAMA,oBAAsB,8zI,ICqCfC,iBAAgB,W,qGA2CnBC,KAAAC,0BAA4B,SAACC,GACnC,IAAKA,EAAEC,eAAeC,SAASC,EAAKC,YAAcD,EAAKE,OAAQ,CAC7DF,EAAKG,UAAU,M,GAIXR,KAAAS,mBAAqB,WAC3B,OAAQC,WAAWC,kBACjB,IAAK,OACH,MAAO,iBACT,IAAK,OACH,MAAO,aACT,IAAK,cACH,MAAO,kBACT,IAAK,gBACH,MAAO,qBAET,QACE,OAAO,K,EAILX,KAAAY,qBAAuB,SAAOC,GAAc,OAAAC,UAAAT,OAAA,qB,qCAClDL,KAAKe,kBAAoBF,E,6BA9DD,M,eAMqB,a,oIAqBH,G,oBAEV,2B,uBACI,K,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iPA3MhB,G"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,t,r){function n(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r["throw"](e))}catch(e){i(e)}}function l(e){e.done?t(e.value):n(e.value).then(s,a)}l((r=r.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,n,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(o){return l([e,o])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(t=0)),t)try{if(r=1,n&&(i=a[0]&2?n["return"]:a[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;if(n=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;n=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1];i=a;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(a);break}if(i[2])t.ops.pop();t.trys.pop();continue}a=o.call(e,t)}catch(e){a=[6,e];n=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host}from"./index-d1aa9293.js";import{_ as _root,i as isObjectLike_1,e as _baseGetTag,f as isObject_1,z as zonosStore,m as mergeConfig}from"./zonosStore-13a7b534.js";import{t as translate,a as localizationStore,e as currencyDisplay,f as currencyConvertAndFormat,g as currencyConvert,j as currencyFormat,l as log}from"./localization-4a424f49.js";import{c as classes}from"./classes-0d95c529.js";import{g as getHasMoreSpaceOnRight}from"./getHasMoreSpaceOnRight-feba1ae2.js";var now=function(){return _root.Date.now()};var now_1=now;var reWhitespace=/\s/;function trimmedEndIndex(e){var o=e.length;while(o--&&reWhitespace.test(e.charAt(o))){}return o}var _trimmedEndIndex=trimmedEndIndex;var reTrimStart=/^\s+/;function baseTrim(e){return e?e.slice(0,_trimmedEndIndex(e)+1).replace(reTrimStart,""):e}var _baseTrim=baseTrim;var symbolTag="[object Symbol]";function isSymbol(e){return typeof e=="symbol"||isObjectLike_1(e)&&_baseGetTag(e)==symbolTag}var isSymbol_1=isSymbol;var NAN=0/0;var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;var reIsBinary=/^0b[01]+$/i;var reIsOctal=/^0o[0-7]+$/i;var freeParseInt=parseInt;function toNumber(e){if(typeof e=="number"){return e}if(isSymbol_1(e)){return NAN}if(isObject_1(e)){var o=typeof e.valueOf=="function"?e.valueOf():e;e=isObject_1(o)?o+"":o}if(typeof e!="string"){return e===0?e:+e}e=_baseTrim(e);var t=reIsBinary.test(e);return t||reIsOctal.test(e)?freeParseInt(e.slice(2),t?2:8):reIsBadHex.test(e)?NAN:+e}var toNumber_1=toNumber;var FUNC_ERROR_TEXT="Expected a function";var nativeMax=Math.max,nativeMin=Math.min;function debounce(e,o,t){var r,n,i,s,a,l,h=0,d=false,f=false,m=true;if(typeof e!="function"){throw new TypeError(FUNC_ERROR_TEXT)}o=toNumber_1(o)||0;if(isObject_1(t)){d=!!t.leading;f="maxWait"in t;i=f?nativeMax(toNumber_1(t.maxWait)||0,o):i;m="trailing"in t?!!t.trailing:m}function c(o){var t=r,i=n;r=n=undefined;h=o;s=e.apply(i,t);return s}function u(e){h=e;a=setTimeout(w,o);return d?c(e):s}function g(e){var t=e-l,r=e-h,n=o-t;return f?nativeMin(n,i-r):n}function p(e){var t=e-l,r=e-h;return l===undefined||t>=o||t<0||f&&r>=i}function w(){var e=now_1();if(p(e)){return b(e)}a=setTimeout(w,g(e))}function b(e){a=undefined;if(m&&r){return c(e)}r=n=undefined;return s}function v(){if(a!==undefined){clearTimeout(a)}h=0;r=l=n=a=undefined}function z(){return a===undefined?s:b(now_1())}function x(){var e=now_1(),t=p(e);r=arguments;n=this;l=e;if(t){if(a===undefined){return u(l)}if(f){clearTimeout(a);a=setTimeout(w,o);return c(l)}}if(a===undefined){a=setTimeout(w,o)}return s}x.cancel=v;x.flush=z;return x}var debounce_1=debounce;var zonosHelloCss=":host{font-family:Inter;display:block}: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:0}@media (max-width: 768px){:host .zonos--hello-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:0}}: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(--amino-page-background);font-size:var(--amino-font-size-s);border:var(--amino-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;width:100%;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(--amino-text-color);position:absolute;background:var(--amino-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% + var(--amino-space-16)));transform:translateX(calc(-100% + var(--amino-space-16)));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--amino-border);border-bottom:var(--amino-border)}: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:var(--amino-space-16);border:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:0;border-bottom-left-radius:0}: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{border-top-right-radius:0;border-bottom-right-radius:0}: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:var(--amino-space-16);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% - var(--amino-space-16)));transform:translateX(calc(100% - var(--amino-space-16)));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;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(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center}@media (max-width: 768px){:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}}@media (max-width: 768px){:host .zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;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-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}}:host .zonos--hello-mobile-override.zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-mobile-override.zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;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-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.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-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}";var ZonosHello=function(){function e(e){var o=this;registerInstance(this,e);this.getHelloPeekMessage=function(){switch(zonosStore.currentHelloPage){case"cart":return translate("Prepay duties and taxes at checkout");case"productList":case"productDetail":return translate("See duty and tax thresholds");default:return"".concat(translate("Welcome to")," ").concat(zonosStore.organizationName)}};this.enableShowPeekMessage=function(){if(o.peekMessage){o.showPeekMessage=true}};this.changeShowDialog=function(e){o.showDialog=e};this.shouldAnimateLeftDesktop=function(){var e=o.helloRef&&getComputedStyle(o.helloRef).position;if(o.helloRef&&e==="relative"){var t=getHasMoreSpaceOnRight(o.helloRef);return t}};this.mobileLocationOverride=undefined;this.animateFromLeftOverride=undefined;this.appearanceSettingsOverride=undefined;this.showPeekMessage=false;this.zonosStoreHelloSettings=zonosStore.helloSettings;this.showDialog=false;this.peekMessage=""}e.prototype.componentDidLoad=function(){var e=this;var o=setInterval((function(){if(!e.helloRef){return}if(zonosStore.loadedConfig){e.helloRef.setAttribute("data-zonos-hello-loaded","");e.peekMessage=e.getHelloPeekMessage();var t=zonosStore.helloSettings,r=t.peekMessageBehavior,n=t.peekMessageDelay;var i=n*1e3;if(r==="ENABLED"){setTimeout((function(){e.enableShowPeekMessage();setTimeout((function(){e.showPeekMessage=false}),3e3)}),i)}clearInterval(o)}}),100)};e.prototype.displayCurrency=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!localizationStore.exchangeRate){console.error("Could not display currency. Exchange rate and format data is not available.");return[2]}currencyDisplay();return[2]}))}))};e.prototype.convertAndFormat=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){currencyConvertAndFormat(e);return[2]}))}))};e.prototype.convert=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){currencyConvert(e);return[2]}))}))};e.prototype.format=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){currencyFormat(e);return[2]}))}))};e.prototype.handleResize=function(){debounce_1(this.render.bind(this),500)};e.prototype.render=function(){var e=this;var o;var t=(o=zonosStore.helloSettings.excludedUrlPatterns)===null||o===void 0?void 0:o.some((function(e){return new RegExp(e).test(window.location.href)}));if(t){log("Hello is excluded on this url","warn");return null}var r=localizationStore.selectedCountryCode;var n=this.mobileLocationOverride||zonosStore.helloSettings.mobileLocation;var i=window.innerWidth<768;var s=this.animateFromLeftOverride||i&&n.includes("LEFT")||this.shouldAnimateLeftDesktop()||false;var a=n.includes("TOP");var l=mergeConfig(zonosStore.appearance,this.appearanceSettingsOverride);var d=l.theme;return h(Host,{class:"zonos--hello zonos--elements","data-theme":d},r&&h("div",{class:"zonos--hello-wrapper"},h("button",{class:classes(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",s&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",a&&"zonos--hello-widget-top"]),onClick:function(){e.changeShowDialog(!e.showDialog)},onMouseEnter:function(){return e.enableShowPeekMessage()},onMouseLeave:function(){return e.showPeekMessage=false},ref:function(o){return o&&(e.helloRef=o)}},h("span",{class:"zonos--hello-message"},this.peekMessage),r&&h("div",{class:"zonos--hello-country-flag-wrapper"},h("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:r}))),h("div",{class:classes(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override"]),style:{height:this.showDialog?"fit-content":"0px"}},h("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:l,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,setIsOpen:this.changeShowDialog}))))};return e}();ZonosHello.style=zonosHelloCss;export{ZonosHello as zonos_hello};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,t,r){function n(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r["throw"](e))}catch(e){i(e)}}function l(e){e.done?t(e.value):n(e.value).then(s,a)}l((r=r.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,n,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(o){return l([e,o])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(t=0)),t)try{if(r=1,n&&(i=a[0]&2?n["return"]:a[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;if(n=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;n=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1];i=a;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(a);break}if(i[2])t.ops.pop();t.trys.pop();continue}a=o.call(e,t)}catch(e){a=[6,e];n=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host}from"./index-d1aa9293.js";import{_ as _root,i as isObjectLike_1,e as _baseGetTag,f as isObject_1,z as zonosStore,m as mergeConfig}from"./zonosStore-1c9c7d76.js";import{h as handleFetch,b as logError,a as localizationStore,i as isValidSelector,t as translate,s as setZonosCountryUrlParam,e as currencyDisplay,f as currencyConvertAndFormat,g as currencyConvert,j as currencyFormat,l as log}from"./localization-1d92a557.js";import{c as classes}from"./classes-0d95c529.js";import{g as getHasMoreSpaceOnRight}from"./getHasMoreSpaceOnRight-feba1ae2.js";var now=function(){return _root.Date.now()};var now_1=now;var reWhitespace=/\s/;function trimmedEndIndex(e){var o=e.length;while(o--&&reWhitespace.test(e.charAt(o))){}return o}var _trimmedEndIndex=trimmedEndIndex;var reTrimStart=/^\s+/;function baseTrim(e){return e?e.slice(0,_trimmedEndIndex(e)+1).replace(reTrimStart,""):e}var _baseTrim=baseTrim;var symbolTag="[object Symbol]";function isSymbol(e){return typeof e=="symbol"||isObjectLike_1(e)&&_baseGetTag(e)==symbolTag}var isSymbol_1=isSymbol;var NAN=0/0;var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;var reIsBinary=/^0b[01]+$/i;var reIsOctal=/^0o[0-7]+$/i;var freeParseInt=parseInt;function toNumber(e){if(typeof e=="number"){return e}if(isSymbol_1(e)){return NAN}if(isObject_1(e)){var o=typeof e.valueOf=="function"?e.valueOf():e;e=isObject_1(o)?o+"":o}if(typeof e!="string"){return e===0?e:+e}e=_baseTrim(e);var t=reIsBinary.test(e);return t||reIsOctal.test(e)?freeParseInt(e.slice(2),t?2:8):reIsBadHex.test(e)?NAN:+e}var toNumber_1=toNumber;var FUNC_ERROR_TEXT="Expected a function";var nativeMax=Math.max,nativeMin=Math.min;function debounce(e,o,t){var r,n,i,s,a,l,d=0,h=false,c=false,u=true;if(typeof e!="function"){throw new TypeError(FUNC_ERROR_TEXT)}o=toNumber_1(o)||0;if(isObject_1(t)){h=!!t.leading;c="maxWait"in t;i=c?nativeMax(toNumber_1(t.maxWait)||0,o):i;u="trailing"in t?!!t.trailing:u}function f(o){var t=r,i=n;r=n=undefined;d=o;s=e.apply(i,t);return s}function m(e){d=e;a=setTimeout(v,o);return h?f(e):s}function g(e){var t=e-l,r=e-d,n=o-t;return c?nativeMin(n,i-r):n}function p(e){var t=e-l,r=e-d;return l===undefined||t>=o||t<0||c&&r>=i}function v(){var e=now_1();if(p(e)){return w(e)}a=setTimeout(v,g(e))}function w(e){a=undefined;if(u&&r){return f(e)}r=n=undefined;return s}function b(){if(a!==undefined){clearTimeout(a)}d=0;r=l=n=a=undefined}function z(){return a===undefined?s:w(now_1())}function y(){var e=now_1(),t=p(e);r=arguments;n=this;l=e;if(t){if(a===undefined){return m(l)}if(c){clearTimeout(a);a=setTimeout(v,o);return f(l)}}if(a===undefined){a=setTimeout(v,o)}return s}y.cancel=b;y.flush=z;return y}var debounce_1=debounce;var checkItemRestrictions=function(e){var o=e.items,t=e.shipFrom,r=e.shipTo;return __awaiter(void 0,void 0,void 0,(function(){var e,n,i,s,a,l;return __generator(this,(function(d){switch(d.label){case 0:n="".concat("https://v1.route.js.zonos.com","/api/check-item-restrictions");i={items:o,shipFrom:t,shipTo:r};return[4,handleFetch(n,{body:i,method:"POST"})];case 1:s=d.sent(),a=s.errors,l=s.json;if(a.length||!l){logError("Error fetching item restrictions: ".concat((e=a.find(Boolean))===null||e===void 0?void 0:e.message));return[2,[]]}return[2,l.filter(Boolean)]}}))}))};var detectItemRestrictions=function(e){return __awaiter(void 0,void 0,void 0,(function(){var o,t,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(!e.length){return[2,[]]}o=localizationStore.selectedCountryCode;if(!o){logError("Hello Could not check item restrictions - No country code selected");return[2,[]]}t=e.map((function(e){return{description:e.description,name:e.title}}));return[4,checkItemRestrictions({items:t,shipFrom:"AD",shipTo:o})];case 1:r=i.sent();n=r.map((function(e){var o;var r=((o=t.filter((function(o){return o.description===e.itemDescription})).find(Boolean))===null||o===void 0?void 0:o.name)||"";return Object.assign(Object.assign({},e),{name:r})}));return[2,n]}}))}))};var getCurrentHelloLocalePage=function(){var e=window.location.href;var o=zonosStore.helloSettings,t=o.cartUrlPattern,r=o.homepageUrlPattern,n=o.productDetailUrlPattern,i=o.productListUrlPattern;if(t&&new RegExp(t).test(e)){return"cart"}if(n&&new RegExp(n).test(e)){return"productDetail"}if(i&&new RegExp(i).test(e)){return"productList"}if(r&&new RegExp(r).test(e)){return"home"}return""};var getProductsOnPage=function(){var e,o;var t=zonosStore.helloSettings,r=t.productAddToCartElementSelector,n=t.productDescriptionElementSelector,i=t.productTitleElementSelector,s=t.restrictionBehavior;if(!i||!n){logError("Hello Could not check item restrictions - must provide title and description selectors.")}var a=i&&isValidSelector(i)&&document.querySelectorAll(i)||[];var l=n&&isValidSelector(n)&&document.querySelectorAll(n)||[];if(a.length!==l.length){logError("Hello Could not check item restrictions - Title and description selectors do not match");return[]}var d=s==="RESTRICT_AND_BLOCK";var h=d&&r&&isValidSelector(r)&&document.querySelectorAll(r)||[];if(d&&h.length!==l.length){logError('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match')}var c=[];for(var u=0;u<a.length;u++){var f=a[u];var m=l[u];var g=h[u];if(f&&m){var p={cartButtonNode:g||null,description:((e=m.textContent)===null||e===void 0?void 0:e.trim())||"",title:((o=f.textContent)===null||o===void 0?void 0:o.trim())||""};c.push(p)}}return c};var zonosHelloCss=":host{font-family:Inter;display:block}: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{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(--amino-page-background);font-size:var(--amino-font-size-s);border:var(--amino-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;width:100%;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(--amino-text-color);position:absolute;background:var(--amino-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% + var(--amino-space-16)));transform:translateX(calc(-100% + var(--amino-space-16)));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--amino-border);border-bottom:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--amino-red-100);border:1px solid var(--amino-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--amino-red-100);color:var(--amino-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(--amino-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:var(--amino-space-16);border:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:0;border-bottom-left-radius:0}: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{border-top-right-radius:0;border-bottom-right-radius:0}: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:var(--amino-space-16);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% - var(--amino-space-16)));transform:translateX(calc(100% - var(--amino-space-16)));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;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(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center}@media (max-width: 768px){:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}}@media (max-width: 768px){:host .zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;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-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}}:host .zonos--hello-mobile-override.zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;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-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.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-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}";var PEEK_MESSAGE_DELAY_MS=3e3;var RESIZE_DEBOUNCE_DELAY_MS=500;var ZonosHello=function(){function e(e){var o=this;registerInstance(this,e);this.getHelloPeekMessage=function(){var e=zonosStore.currentHelloPage==="productDetail"||zonosStore.currentHelloPage==="productList";if(e&&o.allRestrictedItems.length){var t=translate("click to learn more");var r=zonosStore.currentHelloPage==="productDetail"?translate("Restricted item"):translate("Restricted items found");return"".concat(r," - ").concat(t)}switch(zonosStore.currentHelloPage){case"cart":return translate("Prepay duties and taxes at checkout");case"productList":case"productDetail":return translate("See duty and tax thresholds");default:return"".concat(translate("Welcome to")," ").concat(zonosStore.organizationName)}};this.enableShowPeekMessage=function(){if(o.peekMessage){o.showPeekMessage=true}};this.getNewItemRestrictions=function(e){return __awaiter(o,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:o=zonosStore.currentHelloPage==="productDetail"||zonosStore.currentHelloPage==="productList";if(!o||zonosStore.helloSettings.restrictionBehavior==="DISABLED"){return[2,[]]}return[4,detectItemRestrictions(e)];case 1:t=r.sent();return[2,t]}}))}))};this.triggerShowPeekMessage=function(){o.peekMessage=o.getHelloPeekMessage();var e=zonosStore.helloSettings,t=e.peekMessageBehavior,r=e.peekMessageDelay;var n=r*1e3;if(t==="ENABLED"){setTimeout((function(){o.enableShowPeekMessage();setTimeout((function(){o.showPeekMessage=false}),PEEK_MESSAGE_DELAY_MS)}),n)}};this.disableAddToCartButtons=function(){if(o.productsOnPage.length){o.productsOnPage.forEach((function(e){var t,r;var n=o.allRestrictedItems.some((function(o){return o.itemDescription===e.description}));if(n){(t=e.cartButtonNode)===null||t===void 0?void 0:t.setAttribute("disabled","disabled")}else{(r=e.cartButtonNode)===null||r===void 0?void 0:r.removeAttribute("disabled")}}))}};this.handleItemRestrictions=function(){return __awaiter(o,void 0,void 0,(function(){var e,o;var t,r;var n=this;return __generator(this,(function(i){switch(i.label){case 0:this.productsOnPage=getProductsOnPage();e=this.productsOnPage.filter((function(e){return!n.allFoundProducts.some((function(o){return o.title===e.title}))}));return[4,this.getNewItemRestrictions(e)];case 1:o=i.sent();(t=this.allRestrictedItems).push.apply(t,o);(r=this.allFoundProducts).push.apply(r,e);this.disableAddToCartButtons();return[2]}}))}))};this.reloadHelloData=function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.handleItemRestrictions()];case 1:e.sent();this.triggerShowPeekMessage();void this.displayCurrency();return[2]}}))}))};this.handleProductCountChange=debounce_1((function(){var e=zonosStore.helloSettings.productTitleElementSelector;if(e){var t=getProductsOnPage();if(o.allFoundProducts.length!==t.length&&window.location.href===o.initialUrl){if(!o.allFoundProducts.length){return}void o.reloadHelloData()}}}),1e3);this.watchProductCountChange=function(){var e=new MutationObserver(o.handleProductCountChange);e.observe(document.body,{childList:true,subtree:true})};this.updateHelloOnPageChange=function(){o.watchProductCountChange();setInterval((function(){if(window.location.href!==o.initialUrl){var e=o.initialUrl&&new URL(o.initialUrl);var t=e&&e.searchParams.get("zonosCountry");if(t!==localizationStore.selectedCountryCode){o.allFoundProducts=[];o.allRestrictedItems=[];o.productsOnPage=[]}o.initialUrl=window.location.href;zonosStore.currentHelloPage=getCurrentHelloLocalePage();var r=new URL(window.location.href);var n=r.searchParams.get("zonosCountry");if(!n){setZonosCountryUrlParam(localizationStore.selectedCountryCode);return}void o.reloadHelloData()}}),1e3)};this.changeShowDialog=function(e){o.showDialog=e};this.shouldAnimateLeftDesktop=function(){var e=o.helloRef&&getComputedStyle(o.helloRef).position;if(o.helloRef&&e==="relative"){var t=getHasMoreSpaceOnRight(o.helloRef);return t}};this.mobileLocationOverride=undefined;this.animateFromLeftOverride=undefined;this.appearanceSettingsOverride=undefined;this.showPeekMessage=false;this.zonosStoreHelloSettings=zonosStore.helloSettings;this.showDialog=false;this.peekMessage="";this.initialUrl="";this.allRestrictedItems=[];this.allFoundProducts=[];this.productsOnPage=[]}e.prototype.componentWillLoad=function(){var e=this;var o=setInterval((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){if(!this.helloRef){return[2]}if(zonosStore.loadedConfig){this.helloRef.setAttribute("data-zonos-hello-loaded","");this.updateHelloOnPageChange();clearInterval(o)}return[2]}))}))}),100)};e.prototype.displayCurrency=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!localizationStore.exchangeRate){console.error("Could not display currency. Exchange rate and format data is not available.");return[2]}currencyDisplay();return[2]}))}))};e.prototype.convertAndFormat=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){currencyConvertAndFormat(e);return[2]}))}))};e.prototype.convert=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){currencyConvert(e);return[2]}))}))};e.prototype.format=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){currencyFormat(e);return[2]}))}))};e.prototype.handleResize=function(){debounce_1(this.render.bind(this),RESIZE_DEBOUNCE_DELAY_MS)};e.prototype.render=function(){var e=this;var o,t;var r=(o=zonosStore.helloSettings.excludedUrlPatterns)===null||o===void 0?void 0:o.some((function(e){return new RegExp(e).test(window.location.href)}));if(r){log("Hello is excluded on this url","warn");return null}var n=localizationStore.selectedCountryCode;var i=this.mobileLocationOverride||zonosStore.helloSettings.mobileLocation;var s=window.innerWidth<768;var a=this.animateFromLeftOverride||s&&i.includes("LEFT")||this.shouldAnimateLeftDesktop()||false;var l=i.includes("TOP");var d=mergeConfig(zonosStore.appearance,this.appearanceSettingsOverride);var c=d.theme;var u=(t=this.allRestrictedItems)===null||t===void 0?void 0:t.filter((function(o){return e.productsOnPage.some((function(e){return e.description===o.itemDescription}))}));return h(Host,{class:"zonos--hello zonos--elements","data-theme":c},n&&h("div",{class:"zonos--hello-wrapper"},h("button",{class:classes(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",a&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",l&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions"]),onClick:function(){e.changeShowDialog(!e.showDialog)},onMouseEnter:function(){return e.enableShowPeekMessage()},onMouseLeave:function(){return e.showPeekMessage=false},ref:function(o){return o&&(e.helloRef=o)}},h("span",{class:"zonos--hello-message"},this.peekMessage),n&&h("div",{class:"zonos--hello-country-flag-wrapper"},h("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:n}))),h("div",{class:classes(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override"]),style:{height:this.showDialog?"fit-content":"0px"}},h("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:d,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:u,setIsOpen:this.changeShowDialog}))))};return e}();ZonosHello.style=zonosHelloCss;export{ZonosHello as zonos_hello};
|
|
2
2
|
//# sourceMappingURL=zonos-hello.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["now","root","Date","now_1","reWhitespace","trimmedEndIndex","string","index","length","test","charAt","_trimmedEndIndex","reTrimStart","baseTrim","slice","replace","_baseTrim","symbolTag","isSymbol","value","isObjectLike","baseGetTag","isSymbol_1","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","toNumber","isObject","other","valueOf","isBinary","toNumber_1","FUNC_ERROR_TEXT","nativeMax","Math","max","nativeMin","min","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","undefined","apply","leadingEdge","setTimeout","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","clearTimeout","flush","debounced","isInvoking","arguments","this","debounce_1","zonosHelloCss","ZonosHello","getHelloPeekMessage","zonosStore","currentHelloPage","translate","concat","organizationName","enableShowPeekMessage","_this","peekMessage","showPeekMessage","changeShowDialog","showDialog","shouldAnimateLeftDesktop","elPosition","helloRef","getComputedStyle","position","hasMoreSpaceOnRight","getHasMoreSpaceOnRight","helloSettings","class_1","prototype","componentDidLoad","initInterval","setInterval","loadedConfig","setAttribute","_b","peekMessageBehavior","peekMessageDelay","peekMessageDelayToUse","clearInterval","displayCurrency","localizationStore","exchangeRate","console","error","currencyDisplay","convertAndFormat","currencyConvertAndFormat","convert","currencyConvert","format","currencyFormat","handleResize","render","bind","isExcludedUrl","_a","excludedUrlPatterns","some","pattern","RegExp","window","location","href","log","selectedCountryCode","mobileLocation","mobileLocationOverride","isMobileWindow","innerWidth","isOnLeft","animateFromLeftOverride","includes","isOnTop","appearanceSettings","mergeConfig","appearance","appearanceSettingsOverride","theme","h","Host","class","classes","onClick","onMouseEnter","onMouseLeave","ref","el","countryCode","style","height","isOpen","setIsOpen"],"sources":["node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js","node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js","node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js","node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js","node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js","node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js","src/components/hello/zonos-hello/zonos-hello.scss?tag=zonos-hello&encapsulation=shadow","src/components/hello/zonos-hello/zonos-hello.tsx"],"sourcesContent":["var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n",":host {\n display: inline-block;\n\n .zonos--hello-wrapper {\n position: relative;\n\n .zonos--hello-dialog-wrapper-mobile-override {\n @include zonos--hello-dialog-wrapper-mobile;\n }\n @media (max-width: 768px) {\n @include zonos--hello-dialog-wrapper-mobile;\n }\n }\n\n .zonos--hello-widget {\n // Base CSS is catered to the right positioned widget (animating in from the right)\n transition: all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);\n padding: 6px;\n border-radius: 30px;\n background: $amino-page-background;\n font-size: $amino-font-size-s;\n border: $amino-border;\n display: flex;\n align-items: center;\n cursor: pointer;\n height: fit-content;\n width: fit-content;\n position: relative;\n z-index: 1000;\n\n > .zonos--hello-message {\n order: 0; // Position text on the left\n width: 100%;\n max-width: 0;\n height: 100%;\n white-space: nowrap;\n transition: border 0.3s ease-in,\n all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);\n overflow: hidden;\n color: $amino-text-color;\n position: absolute;\n background: $amino-page-background;\n display: flex;\n align-items: center;\n border-top-left-radius: 30px;\n border-bottom-left-radius: 30px;\n left: 0;\n transform: translateX(calc(-100% + $amino-space-16));\n width: fit-content;\n border-top: $amino-border;\n border-bottom: $amino-border;\n }\n\n &.zonos--hello-show-peek-message {\n max-width: 100vw;\n width: 100%;\n\n > .zonos--hello-message {\n max-width: 100vw;\n padding: 0 6px;\n padding-right: $amino-space-16;\n border: $amino-border;\n }\n\n &:not(.zonos--hello-widget-animate-from-left) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n > .zonos--hello-message {\n border-right: none;\n }\n }\n\n &.zonos--hello-widget-animate-from-left {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n > .zonos--hello-message {\n border-left: 0;\n }\n\n > .zonos--hello-message {\n padding-left: $amino-space-16;\n padding-right: 6px;\n border-left: none;\n }\n }\n }\n\n &.zonos--hello-widget-animate-from-left {\n > .zonos--hello-message {\n order: 1; // Position text on the right\n transform: translateX(calc(100% - $amino-space-16));\n right: 0;\n left: auto;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-top-right-radius: 30px;\n border-bottom-right-radius: 30px;\n }\n }\n\n .zonos--hello-country-flag-wrapper {\n display: flex;\n justify-content: center;\n\n .zonos--hello-country-flag {\n @include zonos--hello-country-flag;\n\n @media (max-width: 768px) {\n @include zonos--hello-country-flag-mobile;\n }\n }\n }\n\n // Mobile styles (fixed position)\n @media (max-width: 768px) {\n @include zonos--hello-widget-mobile;\n }\n }\n\n // Apply mobile styles on mobile override prop\n .zonos--hello-mobile-override {\n &.zonos--hello-widget {\n @include zonos--hello-widget-mobile;\n\n .zonos--hello-country-flag {\n @include zonos--hello-country-flag-mobile;\n }\n }\n }\n}\n","import { Component, h, Host, Listen, Method, Prop, State } from '@stencil/core';\nimport debounce from 'lodash/debounce';\n\nimport { localizationStore } from 'src/components/store/hello/localization';\nimport { translate } from 'src/components/store/translationStore';\nimport {\n type AppearanceConfig,\n zonosStore,\n} from 'src/components/store/zonosStore';\nimport { classes } from 'src/components/utils/classes';\nimport { currencyConvert } from 'src/components/utils/hello/currencyConversion/currencyConvert';\nimport { currencyConvertAndFormat } from 'src/components/utils/hello/currencyConversion/currencyConvertAndFormat';\nimport { currencyDisplay } from 'src/components/utils/hello/currencyConversion/currencyDisplay';\nimport { currencyFormat } from 'src/components/utils/hello/currencyConversion/currencyFormat';\nimport { getHasMoreSpaceOnRight } from 'src/components/utils/hello/getHasMoreSpaceOnRight';\nimport { log } from 'src/components/utils/logging/log';\nimport { mergeConfig } from 'src/components/utils/mergeConfig';\nimport type { HelloMobileLocation } from 'src/types/generated/graphql.customer.types';\n\n@Component({\n shadow: true,\n styleUrl: 'zonos-hello.scss',\n tag: 'zonos-hello',\n})\nexport class ZonosHello {\n private helloRef?: HTMLButtonElement;\n\n /**\n * Force mobile styling instead of media query and use the passed location value\n * @default false\n */\n @Prop() mobileLocationOverride?: HelloMobileLocation;\n /**\n * Force left animation instead of detecting which side has more space\n * @default false\n */\n @Prop() animateFromLeftOverride?: boolean;\n /**\n * Override the appearance settings\n */\n @Prop() appearanceSettingsOverride?: Partial<AppearanceConfig>;\n\n @State() showPeekMessage: boolean = false;\n @State() zonosStoreHelloSettings = zonosStore.helloSettings;\n @State() showDialog: boolean = false;\n @State() peekMessage: string | null = '';\n\n private getHelloPeekMessage = () => {\n switch (zonosStore.currentHelloPage) {\n case 'cart':\n return translate(`Prepay duties and taxes at checkout`);\n case 'productList':\n case 'productDetail':\n return translate(`See duty and tax thresholds`);\n\n default:\n return `${translate('Welcome to')} ${zonosStore.organizationName}`;\n }\n };\n\n private enableShowPeekMessage = () => {\n if (this.peekMessage) {\n this.showPeekMessage = true;\n }\n };\n\n componentDidLoad() {\n const initInterval = setInterval(() => {\n if (!this.helloRef) {\n return;\n }\n if (zonosStore.loadedConfig) {\n this.helloRef.setAttribute('data-zonos-hello-loaded', '');\n\n this.peekMessage = this.getHelloPeekMessage();\n const { peekMessageBehavior, peekMessageDelay } =\n zonosStore.helloSettings;\n // peek message delay is passed in seconds, but setTimeout expects milliseconds\n const peekMessageDelayToUse = peekMessageDelay * 1000;\n\n if (peekMessageBehavior === 'ENABLED') {\n setTimeout(() => {\n this.enableShowPeekMessage();\n\n setTimeout(() => {\n this.showPeekMessage = false;\n }, 3000);\n }, peekMessageDelayToUse);\n }\n\n clearInterval(initInterval);\n }\n }, 100);\n }\n\n /**\n * This method will trigger the currency conversion and display the converted value\n * @returns void\n */\n @Method()\n async displayCurrency() {\n if (!localizationStore.exchangeRate) {\n // eslint-disable-next-line no-console\n console.error(\n 'Could not display currency. Exchange rate and format data is not available.',\n );\n return;\n }\n currencyDisplay();\n }\n\n /**\n * This method will call convert and format, and return the converted and formatted string\n * @returns string\n */\n @Method()\n async convertAndFormat(value: number) {\n currencyConvertAndFormat(value);\n }\n\n /**\n * This method will convert the currency and return the converted value\n * @returns number\n */\n @Method()\n async convert(value: number) {\n currencyConvert(value);\n }\n\n /**\n * This method will format the currency and return the formatted string\n * @returns number\n */\n @Method()\n async format(value: number) {\n currencyFormat(value);\n }\n\n private changeShowDialog = (value: boolean) => {\n this.showDialog = value;\n };\n\n private shouldAnimateLeftDesktop = () => {\n // Get element position (relative = desktop, fixed = mobile)\n const elPosition =\n this.helloRef && getComputedStyle(this.helloRef).position;\n\n // If relative position, determine if peek message should animate left or right. Mobile is pre-determined.\n if (this.helloRef && elPosition === 'relative') {\n const hasMoreSpaceOnRight = getHasMoreSpaceOnRight(this.helloRef);\n\n // Determine peek message direction\n return hasMoreSpaceOnRight;\n }\n };\n\n @Listen('resize', { target: 'window' })\n handleResize() {\n debounce(this.render.bind(this), 500);\n }\n\n render() {\n const isExcludedUrl = zonosStore.helloSettings.excludedUrlPatterns?.some(\n pattern => new RegExp(pattern).test(window.location.href),\n );\n if (isExcludedUrl) {\n log('Hello is excluded on this url', 'warn');\n return null;\n }\n\n const { selectedCountryCode } = localizationStore;\n const mobileLocation =\n this.mobileLocationOverride || zonosStore.helloSettings.mobileLocation;\n const isMobileWindow = window.innerWidth < 768;\n\n const isOnLeft =\n this.animateFromLeftOverride ||\n (isMobileWindow && mobileLocation.includes('LEFT')) ||\n this.shouldAnimateLeftDesktop() ||\n false;\n\n const isOnTop = mobileLocation.includes('TOP');\n\n const appearanceSettings = mergeConfig(\n zonosStore.appearance,\n this.appearanceSettingsOverride,\n );\n const { theme } = appearanceSettings;\n\n return (\n <Host class=\"zonos--hello zonos--elements\" data-theme={theme}>\n {selectedCountryCode && (\n <div class=\"zonos--hello-wrapper\">\n <button\n class={classes([\n 'zonos--hello-widget',\n this.showPeekMessage && 'zonos--hello-show-peek-message',\n this.mobileLocationOverride && 'zonos--hello-mobile-override',\n isOnLeft &&\n 'zonos--hello-widget-left zonos--hello-widget-animate-from-left',\n isOnTop && 'zonos--hello-widget-top',\n ])}\n onClick={() => {\n this.changeShowDialog(!this.showDialog);\n }}\n onMouseEnter={() => this.enableShowPeekMessage()}\n onMouseLeave={() => (this.showPeekMessage = false)}\n ref={el => el && (this.helloRef = el)}\n >\n <span class=\"zonos--hello-message\">{this.peekMessage}</span>\n\n {selectedCountryCode && (\n <div class=\"zonos--hello-country-flag-wrapper\">\n <zonos-country-flag\n class=\"zonos--hello-country-flag\"\n countryCode={selectedCountryCode}\n ></zonos-country-flag>\n </div>\n )}\n </button>\n\n <div\n class={classes([\n 'zonos--hello-dialog-wrapper',\n this.mobileLocationOverride &&\n 'zonos--hello-dialog-wrapper-mobile-override',\n ])}\n style={{ height: this.showDialog ? 'fit-content' : '0px' }}\n >\n <zonos-hello-dialog\n animateFromLeftOverride={this.animateFromLeftOverride}\n appearanceSettings={appearanceSettings}\n isOpen={this.showDialog}\n mobileLocationOverride={this.mobileLocationOverride}\n setIsOpen={this.changeShowDialog}\n ></zonos-hello-dialog>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"y8DAkBA,IAAIA,IAAM,WACR,OAAOC,MAAKC,KAAKF,KACnB,EAEA,IAAAG,MAAiBH,ICrBjB,IAAII,aAAe,KAUnB,SAASC,gBAAgBC,GACvB,IAAIC,EAAQD,EAAOE,OAEnB,MAAOD,KAAWH,aAAaK,KAAKH,EAAOI,OAAOH,IAAS,EAC3D,OAAOA,CACT,CAEA,IAAAI,iBAAiBN,gBCfjB,IAAIO,YAAc,OASlB,SAASC,SAASP,GAChB,OAAOA,EACHA,EAAOQ,MAAM,EAAGT,iBAAgBC,GAAU,GAAGS,QAAQH,YAAa,IAClEN,CACN,CAEA,IAAAU,UAAiBH,SCdjB,IAAII,UAAY,kBAmBhB,SAASC,SAASC,GAChB,cAAcA,GAAS,UACpBC,eAAaD,IAAUE,YAAWF,IAAUF,SACjD,CAEA,IAAAK,WAAiBJ,SCvBjB,IAAIK,IAAM,EAAI,EAGd,IAAIC,WAAa,qBAGjB,IAAIC,WAAa,aAGjB,IAAIC,UAAY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A,sBACEE,MAAM,4BACNO,YAAavB,MAMrBc,EAAA,OACEE,MAAOC,QAAQ,CACb,8BACA9E,KAAK+D,wBACH,gDAEJsB,MAAO,CAAEC,OAAQtF,KAAKe,WAAa,cAAgB,QAEnD4D,EAAA,sBACER,wBAAyBnE,KAAKmE,wBAC9BG,mBAAoBA,EACpBiB,OAAQvF,KAAKe,WACbgD,uBAAwB/D,KAAK+D,uBAC7ByB,UAAWxF,KAAKc,qB,WAlNT,G"}
|
|
1
|
+
{"version":3,"names":["now","root","Date","now_1","reWhitespace","trimmedEndIndex","string","index","length","test","charAt","_trimmedEndIndex","reTrimStart","baseTrim","slice","replace","_baseTrim","symbolTag","isSymbol","value","isObjectLike","baseGetTag","isSymbol_1","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","toNumber","isObject","other","valueOf","isBinary","toNumber_1","FUNC_ERROR_TEXT","nativeMax","Math","max","nativeMin","min","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","undefined","apply","leadingEdge","setTimeout","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","clearTimeout","flush","debounced","isInvoking","arguments","this","debounce_1","checkItemRestrictions","_c","items","shipFrom","shipTo","url","concat","body","handleFetch","method","_d","_e","sent","errors","json","logError","_a","find","Boolean","message","filter","detectItemRestrictions","newProducts","__awaiter","selectedCountryCode","localizationStore","map","product","description","name","title","restrictedItems","restrictedItemsWithName","item","x","itemDescription","Object","assign","getCurrentHelloLocalePage","href","window","location","zonosStore","helloSettings","cartUrlPattern","homepageUrlPattern","productDetailUrlPattern","productListUrlPattern","RegExp","getProductsOnPage","productAddToCartElementSelector","productDescriptionElementSelector","productTitleElementSelector","restrictionBehavior","titleNodes","isValidSelector","document","querySelectorAll","descriptionNodes","shouldDisableCart","cartButtonNodes","mergedElements","i","titleNode","descriptionNode","cartButtonNode","element","textContent","trim","_b","push","zonosHelloCss","PEEK_MESSAGE_DELAY_MS","RESIZE_DEBOUNCE_DELAY_MS","ZonosHello","getHelloPeekMessage","isRestrictionPage","currentHelloPage","_this","allRestrictedItems","clickMessage","translate","restrictMessage","organizationName","enableShowPeekMessage","peekMessage","showPeekMessage","getNewItemRestrictions","newRestrictions","triggerShowPeekMessage","peekMessageBehavior","peekMessageDelay","peekMessageDelayToUse","disableAddToCartButtons","productsOnPage","forEach","isRestricted","some","setAttribute","removeAttribute","handleItemRestrictions","allFoundProducts","foundProduct","reloadHelloData","displayCurrency","handleProductCountChange","allProductsOnPage","initialUrl","watchProductCountChange","observer","MutationObserver","observe","childList","subtree","updateHelloOnPageChange","setInterval","prevUrl","URL","initialZonosCountry","searchParams","get","currentUrl","zonosCountry","setZonosCountryUrlParam","changeShowDialog","showDialog","shouldAnimateLeftDesktop","elPosition","helloRef","getComputedStyle","position","hasMoreSpaceOnRight","getHasMoreSpaceOnRight","class_1","prototype","componentWillLoad","initInterval","loadedConfig","clearInterval","exchangeRate","console","error","currencyDisplay","convertAndFormat","currencyConvertAndFormat","convert","currencyConvert","format","currencyFormat","handleResize","render","bind","isExcludedUrl","excludedUrlPatterns","pattern","log","mobileLocation","mobileLocationOverride","isMobileWindow","innerWidth","isOnLeft","animateFromLeftOverride","includes","isOnTop","appearanceSettings","mergeConfig","appearance","appearanceSettingsOverride","theme","restrictedItemsOnPage","restriction","h","Host","class","classes","onClick","onMouseEnter","onMouseLeave","ref","el","countryCode","style","height","isOpen","setIsOpen"],"sources":["node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/now.js","node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_trimmedEndIndex.js","node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseTrim.js","node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/isSymbol.js","node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/toNumber.js","node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/debounce.js","src/components/utils/api/checkItemRestrictions.ts","src/components/utils/hello/detectItemRestrictions.ts","src/components/utils/hello/getCurrentHelloLocalePage.ts","src/components/utils/hello/getProductsOnPage.ts","src/components/hello/zonos-hello/zonos-hello.scss?tag=zonos-hello&encapsulation=shadow","src/components/hello/zonos-hello/zonos-hello.tsx"],"sourcesContent":["var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","import { handleFetch } from 'src/components/utils/handleFetch';\nimport { logError } from 'src/components/utils/logging/logError';\nimport type {\n CheckItemRestrictionsMutation,\n CountryCode,\n} from 'src/types/generated/graphql.customer.types';\n\ntype Item = {\n description: string;\n name: string;\n};\n\ntype RequestBody = {\n items: Item[];\n shipFrom: CountryCode;\n shipTo: CountryCode;\n};\n\nexport const checkItemRestrictions = async ({\n items,\n shipFrom,\n shipTo,\n}: {\n items: Item[];\n shipFrom: CountryCode;\n shipTo: CountryCode;\n}) => {\n const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/check-item-restrictions`;\n const body: RequestBody = {\n items,\n shipFrom,\n shipTo,\n };\n const { errors, json } = await handleFetch<\n CheckItemRestrictionsMutation['itemRestrictionApply']['items']\n >(url, { body, method: 'POST' });\n\n if (errors.length || !json) {\n logError(\n `Error fetching item restrictions: ${errors.find(Boolean)?.message}`,\n );\n return [];\n }\n\n return json.filter(Boolean);\n};\n","import { localizationStore } from 'src/components/store/hello/localization';\nimport { checkItemRestrictions } from 'src/components/utils/api/checkItemRestrictions';\nimport { logError } from 'src/components/utils/logging/logError';\nimport type { Product } from 'src/types/hello/Product';\n\nexport const detectItemRestrictions = async (newProducts: Product[]) => {\n if (!newProducts.length) {\n return [];\n }\n const { selectedCountryCode } = localizationStore;\n if (!selectedCountryCode) {\n logError(\n 'Hello Could not check item restrictions - No country code selected',\n );\n return [];\n }\n\n const items = newProducts.map(product => ({\n description: product.description,\n name: product.title,\n }));\n\n const restrictedItems = await checkItemRestrictions({\n items: items,\n shipFrom: 'AD',\n shipTo: selectedCountryCode,\n });\n\n const restrictedItemsWithName = restrictedItems.map(item => {\n const name =\n items.filter(x => x.description === item.itemDescription).find(Boolean)\n ?.name || '';\n\n return {\n ...item,\n name,\n };\n });\n\n return restrictedItemsWithName;\n};\n","import { type Page, zonosStore } from 'src/components/store/zonosStore';\n\nexport const getCurrentHelloLocalePage = (): Page | '' => {\n const { href } = window.location;\n const {\n cartUrlPattern,\n homepageUrlPattern,\n productDetailUrlPattern,\n productListUrlPattern,\n } = zonosStore.helloSettings;\n\n // The 'if' statements are sorted by most specific to least specific to help with regex matching\n\n if (cartUrlPattern && new RegExp(cartUrlPattern).test(href)) {\n return 'cart';\n }\n\n if (\n productDetailUrlPattern &&\n new RegExp(productDetailUrlPattern).test(href)\n ) {\n return 'productDetail';\n }\n\n if (productListUrlPattern && new RegExp(productListUrlPattern).test(href)) {\n return 'productList';\n }\n\n if (homepageUrlPattern && new RegExp(homepageUrlPattern).test(href)) {\n return 'home';\n }\n\n return '';\n};\n","import { zonosStore } from 'src/components/store/zonosStore';\nimport { isValidSelector } from 'src/components/utils/isValidSelector';\nimport { logError } from 'src/components/utils/logging/logError';\nimport type { Product } from 'src/types/hello/Product';\n\nexport const getProductsOnPage = (): Product[] => {\n const {\n productAddToCartElementSelector,\n productDescriptionElementSelector,\n productTitleElementSelector,\n restrictionBehavior,\n } = zonosStore.helloSettings;\n\n if (!productTitleElementSelector || !productDescriptionElementSelector) {\n logError(\n `Hello Could not check item restrictions - must provide title and description selectors.`,\n );\n }\n\n const titleNodes =\n (productTitleElementSelector &&\n isValidSelector(productTitleElementSelector) &&\n document.querySelectorAll(productTitleElementSelector)) ||\n [];\n\n const descriptionNodes =\n (productDescriptionElementSelector &&\n isValidSelector(productDescriptionElementSelector) &&\n document.querySelectorAll(productDescriptionElementSelector)) ||\n [];\n\n if (titleNodes.length !== descriptionNodes.length) {\n // If the title and description selectors don't match, kill item restrictions altogether\n logError(\n 'Hello Could not check item restrictions - Title and description selectors do not match',\n );\n return [];\n }\n\n const shouldDisableCart = restrictionBehavior === 'RESTRICT_AND_BLOCK';\n const cartButtonNodes =\n (shouldDisableCart &&\n productAddToCartElementSelector &&\n isValidSelector(productAddToCartElementSelector) &&\n document.querySelectorAll(productAddToCartElementSelector)) ||\n [];\n\n if (shouldDisableCart && cartButtonNodes.length !== descriptionNodes.length) {\n // If the \"add to cart\" selectors don't match, log the error and continue\n logError(\n 'Hello could not disable \"Add to cart\" buttons - Title and add to cart selectors do not match',\n );\n }\n\n const mergedElements = [];\n\n for (let i = 0; i < titleNodes.length; i++) {\n const titleNode = titleNodes[i];\n const descriptionNode = descriptionNodes[i];\n const cartButtonNode = cartButtonNodes[i];\n\n if (titleNode && descriptionNode) {\n const element = {\n cartButtonNode: cartButtonNode || null,\n description: descriptionNode.textContent?.trim() || '',\n title: titleNode.textContent?.trim() || '',\n };\n\n mergedElements.push(element);\n }\n }\n\n return mergedElements;\n};\n",":host {\n display: inline-block;\n\n .zonos--hello-wrapper {\n position: relative;\n\n .zonos--hello-dialog-wrapper-mobile-override {\n @include zonos--hello-dialog-wrapper-mobile;\n }\n @media (max-width: 768px) {\n @include zonos--hello-dialog-wrapper-mobile;\n }\n }\n\n .zonos--hello-widget {\n // Base CSS is catered to the right positioned widget (animating in from the right)\n transition: all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);\n padding: 6px;\n border-radius: 30px;\n background: $amino-page-background;\n font-size: $amino-font-size-s;\n border: $amino-border;\n display: flex;\n align-items: center;\n cursor: pointer;\n height: fit-content;\n width: fit-content;\n position: relative;\n z-index: 1000;\n\n > .zonos--hello-message {\n order: 0; // Position text on the left\n width: 100%;\n max-width: 0;\n height: 100%;\n white-space: nowrap;\n transition: border 0.3s ease-in,\n all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);\n overflow: hidden;\n color: $amino-text-color;\n position: absolute;\n background: $amino-page-background;\n display: flex;\n align-items: center;\n border-top-left-radius: 30px;\n border-bottom-left-radius: 30px;\n left: 0;\n transform: translateX(calc(-100% + $amino-space-16));\n width: fit-content;\n border-top: $amino-border;\n border-bottom: $amino-border;\n }\n\n &.zonos--hello-has-restrictions {\n background: $amino-red-100;\n border: 1px solid $amino-red-200;\n\n > .zonos--hello-message {\n background: $amino-red-100;\n color: $amino-red-800;\n font-weight: 500;\n }\n\n &.zonos--hello-show-peek-message > .zonos--hello-message {\n border: 1px solid $amino-red-200;\n }\n }\n\n &.zonos--hello-show-peek-message {\n max-width: 100vw;\n width: 100%;\n\n > .zonos--hello-message {\n max-width: 100vw;\n padding: 0 6px;\n padding-right: $amino-space-16;\n border: $amino-border;\n }\n\n &:not(.zonos--hello-widget-animate-from-left) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n > .zonos--hello-message {\n border-right: none;\n }\n }\n\n &.zonos--hello-widget-animate-from-left {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n > .zonos--hello-message {\n border-left: 0;\n }\n\n > .zonos--hello-message {\n padding-left: $amino-space-16;\n padding-right: 6px;\n border-left: none;\n }\n }\n }\n\n &.zonos--hello-widget-animate-from-left {\n > .zonos--hello-message {\n order: 1; // Position text on the right\n transform: translateX(calc(100% - $amino-space-16));\n right: 0;\n left: auto;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n border-top-right-radius: 30px;\n border-bottom-right-radius: 30px;\n }\n }\n\n .zonos--hello-country-flag-wrapper {\n display: flex;\n justify-content: center;\n\n .zonos--hello-country-flag {\n @include zonos--hello-country-flag;\n\n @media (max-width: 768px) {\n @include zonos--hello-country-flag-mobile;\n }\n }\n }\n\n // Mobile styles (fixed position)\n @media (max-width: 768px) {\n @include zonos--hello-widget-mobile;\n }\n }\n\n // Apply mobile styles on mobile override prop\n .zonos--hello-mobile-override {\n &.zonos--hello-widget {\n @include zonos--hello-widget-mobile;\n\n .zonos--hello-country-flag {\n @include zonos--hello-country-flag-mobile;\n }\n }\n }\n}\n","import { Component, h, Host, Listen, Method, Prop, State } from '@stencil/core';\nimport debounce from 'lodash/debounce';\n\nimport { localizationStore } from 'src/components/store/hello/localization';\nimport { translate } from 'src/components/store/translationStore';\nimport {\n type AppearanceConfig,\n zonosStore,\n} from 'src/components/store/zonosStore';\nimport { classes } from 'src/components/utils/classes';\nimport { currencyConvert } from 'src/components/utils/hello/currencyConversion/currencyConvert';\nimport { currencyConvertAndFormat } from 'src/components/utils/hello/currencyConversion/currencyConvertAndFormat';\nimport { currencyDisplay } from 'src/components/utils/hello/currencyConversion/currencyDisplay';\nimport { currencyFormat } from 'src/components/utils/hello/currencyConversion/currencyFormat';\nimport { detectItemRestrictions } from 'src/components/utils/hello/detectItemRestrictions';\nimport { getCurrentHelloLocalePage } from 'src/components/utils/hello/getCurrentHelloLocalePage';\nimport { getHasMoreSpaceOnRight } from 'src/components/utils/hello/getHasMoreSpaceOnRight';\nimport { getProductsOnPage } from 'src/components/utils/hello/getProductsOnPage';\nimport { setZonosCountryUrlParam } from 'src/components/utils/hello/setZonosCountryUrlParam';\nimport { log } from 'src/components/utils/logging/log';\nimport { mergeConfig } from 'src/components/utils/mergeConfig';\nimport type { HelloMobileLocation } from 'src/types/generated/graphql.customer.types';\nimport type { Product } from 'src/types/hello/Product';\nimport type { RestrictedItem } from 'src/types/hello/RestrictedItem';\n\nconst PEEK_MESSAGE_DELAY_MS = 3000;\nconst RESIZE_DEBOUNCE_DELAY_MS = 500;\n\n@Component({\n shadow: true,\n styleUrl: 'zonos-hello.scss',\n tag: 'zonos-hello',\n})\nexport class ZonosHello {\n private helloRef?: HTMLButtonElement;\n\n /**\n * Force mobile styling instead of media query and use the passed location value\n * @default false\n */\n @Prop() mobileLocationOverride?: HelloMobileLocation;\n /**\n * Force left animation instead of detecting which side has more space\n * @default false\n */\n @Prop() animateFromLeftOverride?: boolean;\n /**\n * Override the appearance settings\n */\n @Prop() appearanceSettingsOverride?: Partial<AppearanceConfig>;\n\n @State() showPeekMessage: boolean = false;\n @State() zonosStoreHelloSettings = zonosStore.helloSettings;\n @State() showDialog: boolean = false;\n @State() peekMessage: string | null = '';\n @State() initialUrl: string = '';\n /**\n * This array will hold all restricted items handled by Hello thus far\n */\n @State() allRestrictedItems: RestrictedItem[] = [];\n /**\n * This array will hold all products handled by Hello thus far\n */\n @State() allFoundProducts: Product[] = [];\n /**\n * This array will hold all products currently on the page\n */\n @State() productsOnPage: Product[] = [];\n\n private getHelloPeekMessage = () => {\n const isRestrictionPage =\n zonosStore.currentHelloPage === 'productDetail' ||\n zonosStore.currentHelloPage === 'productList';\n if (isRestrictionPage && this.allRestrictedItems.length) {\n const clickMessage = translate('click to learn more');\n const restrictMessage =\n zonosStore.currentHelloPage === 'productDetail'\n ? translate('Restricted item')\n : translate('Restricted items found');\n\n return `${restrictMessage} - ${clickMessage}`;\n }\n\n switch (zonosStore.currentHelloPage) {\n case 'cart':\n return translate(`Prepay duties and taxes at checkout`);\n case 'productList':\n case 'productDetail':\n return translate(`See duty and tax thresholds`);\n\n default:\n return `${translate('Welcome to')} ${zonosStore.organizationName}`;\n }\n };\n\n private enableShowPeekMessage = () => {\n if (this.peekMessage) {\n this.showPeekMessage = true;\n }\n };\n\n private getNewItemRestrictions = async (newProducts: Product[]) => {\n const isRestrictionPage =\n zonosStore.currentHelloPage === 'productDetail' ||\n zonosStore.currentHelloPage === 'productList';\n\n // Only run detectItemRestrictions on product pages if the restrictionBehavior is not DISABLED\n if (\n !isRestrictionPage ||\n zonosStore.helloSettings.restrictionBehavior === 'DISABLED'\n ) {\n return [];\n }\n\n const newRestrictions = await detectItemRestrictions(newProducts);\n return newRestrictions;\n };\n\n private triggerShowPeekMessage = () => {\n this.peekMessage = this.getHelloPeekMessage();\n const { peekMessageBehavior, peekMessageDelay } = zonosStore.helloSettings;\n // peek message delay is passed in seconds, but setTimeout expects milliseconds\n const peekMessageDelayToUse = peekMessageDelay * 1000;\n\n if (peekMessageBehavior === 'ENABLED') {\n setTimeout(() => {\n this.enableShowPeekMessage();\n\n setTimeout(() => {\n this.showPeekMessage = false;\n }, PEEK_MESSAGE_DELAY_MS);\n }, peekMessageDelayToUse);\n }\n };\n\n private disableAddToCartButtons = () => {\n // Remove disabled attribute from all \"add to cart\" buttons\n if (this.productsOnPage.length) {\n this.productsOnPage.forEach(product => {\n const isRestricted = this.allRestrictedItems.some(\n item => item.itemDescription === product.description,\n );\n\n // if a product description matches a restrictedItems itemDescription, then disable the add to cart button. Otherwise, enable it.\n if (isRestricted) {\n product.cartButtonNode?.setAttribute('disabled', 'disabled');\n } else {\n product.cartButtonNode?.removeAttribute('disabled');\n }\n });\n }\n };\n\n private handleItemRestrictions = async () => {\n this.productsOnPage = getProductsOnPage();\n\n const newProducts = this.productsOnPage.filter(\n product =>\n !this.allFoundProducts.some(\n foundProduct => foundProduct.title === product.title,\n ),\n );\n const newRestrictions = await this.getNewItemRestrictions(newProducts);\n\n this.allRestrictedItems.push(...newRestrictions);\n this.allFoundProducts.push(...newProducts);\n\n this.disableAddToCartButtons();\n };\n\n private reloadHelloData = async () => {\n await this.handleItemRestrictions();\n this.triggerShowPeekMessage();\n void this.displayCurrency();\n };\n\n private handleProductCountChange = debounce(() => {\n const { productTitleElementSelector } = zonosStore.helloSettings;\n\n if (productTitleElementSelector) {\n const allProductsOnPage = getProductsOnPage();\n if (\n this.allFoundProducts.length !== allProductsOnPage.length &&\n window.location.href === this.initialUrl\n ) {\n // if allFoundProducts length is 0 (first render or no products), kill item restriction process as initial restrictions are handled in updateHelloOnPageChange\n if (!this.allFoundProducts.length) {\n return;\n }\n\n void this.reloadHelloData();\n }\n }\n }, 1000);\n\n private watchProductCountChange = () => {\n const observer = new MutationObserver(this.handleProductCountChange);\n\n observer.observe(document.body, {\n childList: true,\n subtree: true,\n });\n };\n\n private updateHelloOnPageChange = () => {\n // If the product count changes on the same url (loading more products), update the peek message and item restrictions\n this.watchProductCountChange();\n\n // Check url change on interval. If changed, update the peek message and item restrictions\n setInterval(() => {\n if (window.location.href !== this.initialUrl) {\n const prevUrl = this.initialUrl && new URL(this.initialUrl);\n const initialZonosCountry =\n prevUrl && prevUrl.searchParams.get('zonosCountry');\n\n // If the zonosCountry url param changes, reset current item restriction tracking\n if (initialZonosCountry !== localizationStore.selectedCountryCode) {\n this.allFoundProducts = [];\n this.allRestrictedItems = [];\n this.productsOnPage = [];\n }\n\n this.initialUrl = window.location.href;\n zonosStore.currentHelloPage = getCurrentHelloLocalePage();\n\n const currentUrl = new URL(window.location.href);\n const zonosCountry = currentUrl.searchParams.get('zonosCountry');\n if (!zonosCountry) {\n setZonosCountryUrlParam(localizationStore.selectedCountryCode);\n return;\n }\n\n void this.reloadHelloData();\n }\n }, 1000);\n };\n\n componentWillLoad() {\n const initInterval = setInterval(async () => {\n if (!this.helloRef) {\n return;\n }\n if (zonosStore.loadedConfig) {\n this.helloRef.setAttribute('data-zonos-hello-loaded', '');\n\n this.updateHelloOnPageChange();\n\n clearInterval(initInterval);\n }\n }, 100);\n }\n\n /**\n * This method will trigger the currency conversion and display the converted value\n * @returns void\n */\n @Method()\n async displayCurrency() {\n if (!localizationStore.exchangeRate) {\n // eslint-disable-next-line no-console\n console.error(\n 'Could not display currency. Exchange rate and format data is not available.',\n );\n return;\n }\n currencyDisplay();\n }\n\n /**\n * This method will call convert and format, and return the converted and formatted string\n * @returns string\n */\n @Method()\n async convertAndFormat(value: number) {\n currencyConvertAndFormat(value);\n }\n\n /**\n * This method will convert the currency and return the converted value\n * @returns number\n */\n @Method()\n async convert(value: number) {\n currencyConvert(value);\n }\n\n /**\n * This method will format the currency and return the formatted string\n * @returns number\n */\n @Method()\n async format(value: number) {\n currencyFormat(value);\n }\n\n private changeShowDialog = (value: boolean) => {\n this.showDialog = value;\n };\n\n private shouldAnimateLeftDesktop = () => {\n // Get Hello position (relative = desktop, fixed = mobile)\n const elPosition =\n this.helloRef && getComputedStyle(this.helloRef).position;\n\n // If relative position, determine if peek message should animate left or right. Mobile is pre-determined.\n if (this.helloRef && elPosition === 'relative') {\n const hasMoreSpaceOnRight = getHasMoreSpaceOnRight(this.helloRef);\n\n return hasMoreSpaceOnRight;\n }\n };\n\n @Listen('resize', { target: 'window' })\n handleResize() {\n debounce(this.render.bind(this), RESIZE_DEBOUNCE_DELAY_MS);\n }\n\n render() {\n const isExcludedUrl = zonosStore.helloSettings.excludedUrlPatterns?.some(\n pattern => new RegExp(pattern).test(window.location.href),\n );\n if (isExcludedUrl) {\n log('Hello is excluded on this url', 'warn');\n return null;\n }\n\n const { selectedCountryCode } = localizationStore;\n const mobileLocation =\n this.mobileLocationOverride || zonosStore.helloSettings.mobileLocation;\n const isMobileWindow = window.innerWidth < 768;\n\n const isOnLeft =\n this.animateFromLeftOverride ||\n (isMobileWindow && mobileLocation.includes('LEFT')) ||\n this.shouldAnimateLeftDesktop() ||\n false;\n\n const isOnTop = mobileLocation.includes('TOP');\n\n const appearanceSettings = mergeConfig(\n zonosStore.appearance,\n this.appearanceSettingsOverride,\n );\n const { theme } = appearanceSettings;\n\n const restrictedItemsOnPage = this.allRestrictedItems?.filter(product =>\n this.productsOnPage.some(\n restriction => restriction.description === product.itemDescription,\n ),\n );\n\n return (\n <Host class=\"zonos--hello zonos--elements\" data-theme={theme}>\n {selectedCountryCode && (\n <div class=\"zonos--hello-wrapper\">\n <button\n class={classes([\n 'zonos--hello-widget',\n this.showPeekMessage && 'zonos--hello-show-peek-message',\n this.mobileLocationOverride && 'zonos--hello-mobile-override',\n isOnLeft &&\n 'zonos--hello-widget-left zonos--hello-widget-animate-from-left',\n isOnTop && 'zonos--hello-widget-top',\n !!this.allRestrictedItems.length &&\n 'zonos--hello-has-restrictions',\n ])}\n onClick={() => {\n this.changeShowDialog(!this.showDialog);\n }}\n onMouseEnter={() => this.enableShowPeekMessage()}\n onMouseLeave={() => (this.showPeekMessage = false)}\n ref={el => el && (this.helloRef = el)}\n >\n <span class=\"zonos--hello-message\">{this.peekMessage}</span>\n\n {selectedCountryCode && (\n <div class=\"zonos--hello-country-flag-wrapper\">\n <zonos-country-flag\n class=\"zonos--hello-country-flag\"\n countryCode={selectedCountryCode}\n ></zonos-country-flag>\n </div>\n )}\n </button>\n\n <div\n class={classes([\n 'zonos--hello-dialog-wrapper',\n this.mobileLocationOverride &&\n 'zonos--hello-dialog-wrapper-mobile-override',\n ])}\n style={{ height: this.showDialog ? 'fit-content' : '0px' }}\n >\n <zonos-hello-dialog\n animateFromLeftOverride={this.animateFromLeftOverride}\n appearanceSettings={appearanceSettings}\n isOpen={this.showDialog}\n mobileLocationOverride={this.mobileLocationOverride}\n restrictedItems={restrictedItemsOnPage}\n setIsOpen={this.changeShowDialog}\n ></zonos-hello-dialog>\n </div>\n </div>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"0hEAkBA,IAAIA,IAAM,WACR,OAAOC,MAAKC,KAAKF,KACnB,EAEA,IAAAG,MAAiBH,ICrBjB,IAAII,aAAe,KAUnB,SAASC,gBAAgBC,GACvB,IAAIC,EAAQD,EAAOE,OAEnB,MAAOD,KAAWH,aAAaK,KAAKH,EAAOI,OAAOH,IAAS,EAC3D,OAAOA,CACT,CAEA,IAAAI,iBAAiBN,gBCfjB,IAAIO,YAAc,OASlB,SAASC,SAASP,GAChB,OAAOA,EACHA,EAAOQ,MAAM,EAAGT,iBAAgBC,GAAU,GAAGS,QAAQH,YAAa,IAClEN,CACN,CAEA,IAAAU,UAAiBH,SCdjB,IAAII,UAAY,kBAmBhB,SAASC,SAASC,GAChB,cAAcA,GAAS,UACpBC,eAAaD,IAAUE,YAAWF,IAAUF,SACjD,CAEA,IAAAK,WAAiBJ,SCvBjB,IAAIK,IAAM,EAAI,EAGd,IAAIC,WAAa,qBAGjB,IAAIC,WAAa,aAGjB,IAAIC,UAAY,cAG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,EAAEjD,QAAO,SAAAO,GAC5D,OAAAmD,EAAKgB,eAAeG,MAClB,SAAAyE,GAAe,OAAAA,EAAY9I,cAAgBD,EAAQQ,eAApC,GADjB,IAKF,OACEwI,EAACC,KAAI,CAACC,MAAM,+BAA8B,aAAaL,GACpDhJ,GACCmJ,EAAA,OAAKE,MAAM,wBACTF,EAAA,UACEE,MAAOC,QAAQ,CACb,sBACAhL,KAAKwF,iBAAmB,iCACxBxF,KAAK+J,wBAA0B,+BAC/BG,GACE,iEACFG,GAAW,4BACTrK,KAAKiF,mBAAmBtJ,QACxB,kCAEJsP,QAAS,WACPjG,EAAK8C,kBAAkB9C,EAAK+C,W,EAE9BmD,aAAc,WAAM,OAAAlG,EAAKM,uBAAL,EACpB6F,aAAc,kBAAOnG,EAAKQ,gBAAkB,KAA9B,EACd4F,IAAK,SAAAC,GAAM,OAAAA,IAAOrG,EAAKkD,SAAWmD,EAAvB,GAEXR,EAAA,QAAME,MAAM,wBAAwB/K,KAAKuF,aAExC7D,GACCmJ,EAAA,OAAKE,MAAM,qCACTF,EAAA,sBACEE,MAAM,4BACNO,YAAa5J,MAMrBmJ,EAAA,OACEE,MAAOC,QAAQ,CACb,8BACAhL,KAAK+J,wBACH,gDAEJwB,MAAO,CAAEC,OAAQxL,KAAK+H,WAAa,cAAgB,QAEnD8C,EAAA,sBACEV,wBAAyBnK,KAAKmK,wBAC9BG,mBAAoBA,EACpBmB,OAAQzL,KAAK+H,WACbgC,uBAAwB/J,KAAK+J,uBAC7B9H,gBAAiB0I,EACjBe,UAAW1L,KAAK8H,qB,WA9WT,G"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as registerInstance,h,H as Host,d as getElement}from"./index-d1aa9293.js";import{s as stripeStore}from"./cart-d00e1acb.js";import"./zonosStore-1c9c7d76.js";import"./localization-1d92a557.js";import"./isDarkColor-3bb345f4.js";import"./getBorderRadius-e8ad5967.js";var zonosPaymentCss=".sc-zonos-payment-h{font-family:Inter;display:block}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:var(--amino-space-16)}";var ZonosPayment=function(){function t(t){registerInstance(this,t);this.titleText=undefined;this.stripe=stripeStore.stripe;this.stripeElements=stripeStore.stripeElements}t.prototype.watchInitStripe=function(){if(!this.stripeElements){return}var t=stripeStore.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"});var e=this.el.querySelector(".zonos--payment-component");if(!e){console.error("Cannot find container element for paymentElement");return}t.mount(e);t.on("change",(function(t){stripeStore.stripePaymentEventData=t}));stripeStore.stripePaymentElement=t};t.prototype.componentDidLoad=function(){this.watchInitStripe()};t.prototype.render=function(){return h(Host,{class:"zonos--payment zonos--elements"},this.titleText&&h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{class:"zonos--payment-component"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return t}();ZonosPayment.style=zonosPaymentCss;export{ZonosPayment as zonos_payment};
|
|
2
|
+
//# sourceMappingURL=zonos-payment.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["zonosPaymentCss","ZonosPayment","stripeStore","stripe","stripeElements","prototype","watchInitStripe","this","paymentElement","stripePaymentElement","create","layout","paymentElementContainer","el","querySelector","console","error","mount","on","event","stripePaymentEventData","componentDidLoad","render","h","Host","class","titleText","type"],"sources":["src/components/stripe/zonos-payment/zonos-payment.scss?tag=zonos-payment&encapsulation=scoped","src/components/stripe/zonos-payment/zonos-payment.tsx"],"sourcesContent":[":host {\n .zonos--title {\n margin-bottom: $amino-space-16;\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Component, Element, h, Host, Prop, State, Watch } from '@stencil/core';\nimport type { Stripe, StripeElements } from '@stripe/stripe-js';\n\nimport { stripeStore } from 'src/components/store/checkout/stripe';\n\n@Component({\n /**\n * Use `scope` here just because this component is using stripe elements and stripe\n * need to be able to inject iframe into this component\n * **NOTE**: Prefer `shadow` when creating new component\n * */\n scoped: true,\n styleUrl: 'zonos-payment.scss',\n tag: 'zonos-payment',\n})\n/**\n * This component is a wrapper for the stripe authentication element that would render default style object\n */\nexport class ZonosPayment {\n /**\n * The title text for the authentication element\n */\n @Prop() titleText?: string;\n\n @State() stripe: Stripe | null = stripeStore.stripe;\n\n @State() stripeElements: StripeElements | null = stripeStore.stripeElements;\n\n @Element() el!: HTMLZonosPaymentElement;\n\n @Watch('stripeElements')\n @Watch('stripe')\n watchInitStripe() {\n if (!this.stripeElements) {\n return;\n }\n\n // Create and mount the Authentication Element in ${type} mode\n const paymentElement =\n stripeStore.stripePaymentElement ||\n this.stripeElements.create('payment', {\n layout: 'tabs',\n });\n\n const paymentElementContainer = this.el.querySelector<HTMLElement>(\n '.zonos--payment-component',\n );\n\n if (!paymentElementContainer) {\n // eslint-disable-next-line no-console\n console.error('Cannot find container element for paymentElement');\n return;\n }\n\n paymentElement.mount(paymentElementContainer);\n paymentElement.on('change', event => {\n stripeStore.stripePaymentEventData = event;\n });\n\n stripeStore.stripePaymentElement = paymentElement;\n }\n\n componentDidLoad() {\n // @Watch doesn't get trigger on initial load\n this.watchInitStripe();\n }\n\n render() {\n // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here\n return (\n <Host class=\"zonos--payment zonos--elements\">\n {this.titleText && (\n <zonos-text class=\"zonos--title\" type=\"semiBoldLabel\">\n {this.titleText}\n </zonos-text>\n )}\n <div class=\"zonos--payment-component\"></div>\n </Host>\n );\n }\n}\n"],"mappings":"gRAAA,IAAMA,gBAAkB,4wB,ICmBXC,aAAY,W,4EAMUC,YAAYC,O,oBAEID,YAAYE,c,CAM7DH,EAAAI,UAAAC,gBAAA,WACE,IAAKC,KAAKH,eAAgB,CACxB,M,CAIF,IAAMI,EACJN,YAAYO,sBACZF,KAAKH,eAAeM,OAAO,UAAW,CACpCC,OAAQ,SAGZ,IAAMC,EAA0BL,KAAKM,GAAGC,cACtC,6BAGF,IAAKF,EAAyB,CAE5BG,QAAQC,MAAM,oDACd,M,CAGFR,EAAeS,MAAML,GACrBJ,EAAeU,GAAG,UAAU,SAAAC,GAC1BjB,YAAYkB,uBAAyBD,C,IAGvCjB,YAAYO,qBAAuBD,C,EAGrCP,EAAAI,UAAAgB,iBAAA,WAEEd,KAAKD,iB,EAGPL,EAAAI,UAAAiB,OAAA,WAEE,OACEC,EAACC,KAAI,CAACC,MAAM,kCACTlB,KAAKmB,WACJH,EAAA,cAAYE,MAAM,eAAeE,KAAK,iBACnCpB,KAAKmB,WAGVH,EAAA,OAAKE,MAAM,6B,+RA1DM,G"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host}from"./index-d1aa9293.js";import{z as zonosStore}from"./zonosStore-
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host}from"./index-d1aa9293.js";import{z as zonosStore}from"./zonosStore-1c9c7d76.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-e8ad5967.js";import{i as isColorVariable}from"./isColorVariable-4cda28c9.js";var zonosShippingRichRadioCss=":host{font-family:Inter;display:block}: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:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host input{margin:0;accent-color:var(--selected-border-color, var(--amino-blue-600))}:host .zonos--shipping-rich-radio-item{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;padding:var(--amino-space-16);-ms-flex-align:center;align-items:center;gap:var(--amino-space-16);cursor:pointer;border:1px solid var(--amino-gray-200)}:host .zonos--shipping-rich-radio-item:first-child{border-top-left-radius:var(--border-radius, var(--amino-radius-10));border-top-right-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:last-child{border-bottom-left-radius:var(--border-radius, var(--amino-radius-10));border-bottom-right-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item.selected{border-color:var(--selected-border-color, var(--amino-blue-600))}:host .zonos--shipping-info{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}:host .zonos--shipping-detail{-ms-flex:1;flex:1}:host .zonos--sub-detail{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap}";var ZonosShippingRichRadio=function(){function o(o){var i=this;registerInstance(this,o);this.radioSelected=createEvent(this,"radioSelected",7);this.handleRichRadioSelect=function(o){var e;i.selectedItem=o;(e=i.radioSelected)===null||e===void 0?void 0:e.emit(o)};this.getRadioItemStyleVariables=function(){var o=i.borderColor||zonosStore.appearance.colorSecondary;var e=isColorVariable(o)?"var(--amino-".concat(o,")"):o;return{"--border-radius":getBorderRadius(i.borderStyle),"--selected-border-color":e||"unset"}};this.items=undefined;this.borderColor=undefined;this.borderStyle=undefined;this.theme=undefined;this.selectedItem=null}o.prototype.render=function(){var o=this;var i;return h(Host,{class:"zonos--shipping-rich-radio zonos--elements","data-theme":this.theme,style:this.getRadioItemStyleVariables()},(i=this.items)===null||i===void 0?void 0:i.map((function(i){var e;var s=((e=o.selectedItem)===null||e===void 0?void 0:e.value)===i.value;return h("div",{"aria-hidden":"true",class:classes(["zonos--shipping-rich-radio-item",s&&"selected"]),onClick:function(){return o.handleRichRadioSelect(i)}},h("input",{checked:s,class:"zonos--shipping-rich-radio-input",name:"zonos--shipping-rich-radio",type:"radio",value:i.value}),h("div",{class:"zonos--shipping-info"},h("div",{class:"zonos--shipping-detail"},h("zonos-text",{class:"zonos--shipping-label",type:"label"},i.label),(i.sublabel||i.caption)&&h("div",{class:"zonos--sub-detail"},i.sublabel&&h("zonos-text",{color:"gray-800"},i.sublabel),i.caption&&h("zonos-text",{color:"gray-400"},i.caption))),h("zonos-text",{type:"semiBoldLabel"},i.price)))})))};return o}();ZonosShippingRichRadio.style=zonosShippingRichRadioCss;export{ZonosShippingRichRadio as zonos_shipping_rich_radio};
|
|
2
2
|
//# sourceMappingURL=zonos-shipping-rich-radio.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["zonosShippingRichRadioCss","ZonosShippingRichRadio","this","handleRichRadioSelect","item","_this","selectedItem","_a","radioSelected","emit","getRadioItemStyleVariables","usedColor","borderColor","zonosStore","appearance","colorSecondary","secondaryColor","isColorVariable","concat","getBorderRadius","borderStyle","prototype","render","h","Host","class","theme","style","items","map","selected","value","classes","onClick","checked","name","type","label","sublabel","caption","color","price"],"sources":["src/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.scss?tag=zonos-shipping-rich-radio&encapsulation=shadow","src/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.tsx"],"sourcesContent":["$selected-border-color: var(--selected-border-color, $amino-blue-600);\n$border-radius: var(--border-radius, $amino-radius-10);\n:host {\n display: flex;\n flex-direction: column;\n input {\n margin: 0;\n accent-color: $selected-border-color;\n }\n .zonos--shipping-rich-radio-item {\n display: flex;\n flex: 1;\n padding: $amino-space-16;\n align-items: center;\n gap: $amino-space-16;\n cursor: pointer;\n border: 1px solid $amino-gray-200;\n &:first-child {\n border-top-left-radius: $border-radius;\n border-top-right-radius: $border-radius;\n }\n &:last-child {\n border-bottom-left-radius: $border-radius;\n border-bottom-right-radius: $border-radius;\n }\n\n &.selected {\n border-color: $selected-border-color;\n }\n }\n .zonos--shipping-info {\n display: flex;\n align-items: center;\n flex: 1;\n }\n .zonos--shipping-detail {\n flex: 1;\n }\n .zonos--sub-detail {\n display: inline-flex;\n gap: 8px;\n flex-wrap: wrap;\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Prop,\n State,\n} from '@stencil/core';\n\nimport { zonosStore } from 'src/components/store/zonosStore';\nimport { classes } from 'src/components/utils/classes';\nimport { getBorderRadius } from 'src/components/utils/getBorderRadius';\nimport { isColorVariable } from 'src/components/utils/isColorVariable';\nimport type { Color, ElementsUiStyle, ElementsUiTheme } from 'src/types';\n\nexport type ShippingRichRadioItem = {\n caption?: string;\n label: string;\n price: string;\n sublabel?: string;\n value: string | number;\n};\n\n@Component({\n shadow: true,\n styleUrl: 'zonos-shipping-rich-radio.scss',\n tag: 'zonos-shipping-rich-radio',\n})\nexport class ZonosShippingRichRadio {\n /**\n * List of items to display\n */\n @Prop() items!: ShippingRichRadioItem[];\n\n /**\n * Override border color of the radio item\n */\n @Prop() borderColor?: Color | (string & { _placeholder?: never });\n\n /**\n * Override border color of the radio item\n */\n @Prop() borderStyle?: ElementsUiStyle;\n\n /**\n * Theme of the radio item\n */\n @Prop() theme?: ElementsUiTheme;\n /**\n * Selected item\n * @default {null|firstItem}\n */\n @State() selectedItem: ShippingRichRadioItem | null = null;\n\n /**\n * Event emitted when an item is selected\n */\n @Event() radioSelected?: EventEmitter<ShippingRichRadioItem>;\n\n private handleRichRadioSelect = (item: ShippingRichRadioItem) => {\n this.selectedItem = item;\n this.radioSelected?.emit(item);\n };\n\n private getRadioItemStyleVariables = () => {\n const usedColor = this.borderColor || zonosStore.appearance.colorSecondary;\n const secondaryColor = isColorVariable(usedColor)\n ? `var(--amino-${usedColor})`\n : usedColor;\n\n return {\n '--border-radius': getBorderRadius(this.borderStyle),\n '--selected-border-color': secondaryColor || 'unset',\n };\n };\n\n render() {\n return (\n <Host\n class=\"zonos--shipping-rich-radio zonos--elements\"\n data-theme={this.theme}\n style={this.getRadioItemStyleVariables()}\n >\n {this.items?.map(item => {\n const selected = this.selectedItem?.value === item.value;\n return (\n <div\n aria-hidden=\"true\"\n class={classes([\n 'zonos--shipping-rich-radio-item',\n selected && 'selected',\n ])}\n onClick={() => this.handleRichRadioSelect(item)}\n >\n <input\n checked={selected}\n class=\"zonos--shipping-rich-radio-input\"\n name=\"zonos--shipping-rich-radio\"\n type=\"radio\"\n value={item.value}\n />\n <div class=\"zonos--shipping-info\">\n <div class=\"zonos--shipping-detail\">\n <zonos-text type=\"label\"
|
|
1
|
+
{"version":3,"names":["zonosShippingRichRadioCss","ZonosShippingRichRadio","this","handleRichRadioSelect","item","_this","selectedItem","_a","radioSelected","emit","getRadioItemStyleVariables","usedColor","borderColor","zonosStore","appearance","colorSecondary","secondaryColor","isColorVariable","concat","getBorderRadius","borderStyle","prototype","render","h","Host","class","theme","style","items","map","selected","value","classes","onClick","checked","name","type","label","sublabel","caption","color","price"],"sources":["src/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.scss?tag=zonos-shipping-rich-radio&encapsulation=shadow","src/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.tsx"],"sourcesContent":["$selected-border-color: var(--selected-border-color, $amino-blue-600);\n$border-radius: var(--border-radius, $amino-radius-10);\n:host {\n display: flex;\n flex-direction: column;\n input {\n margin: 0;\n accent-color: $selected-border-color;\n }\n .zonos--shipping-rich-radio-item {\n display: flex;\n flex: 1;\n padding: $amino-space-16;\n align-items: center;\n gap: $amino-space-16;\n cursor: pointer;\n border: 1px solid $amino-gray-200;\n &:first-child {\n border-top-left-radius: $border-radius;\n border-top-right-radius: $border-radius;\n }\n &:last-child {\n border-bottom-left-radius: $border-radius;\n border-bottom-right-radius: $border-radius;\n }\n\n &.selected {\n border-color: $selected-border-color;\n }\n }\n .zonos--shipping-info {\n display: flex;\n align-items: center;\n flex: 1;\n }\n .zonos--shipping-detail {\n flex: 1;\n }\n .zonos--sub-detail {\n display: inline-flex;\n gap: 8px;\n flex-wrap: wrap;\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Prop,\n State,\n} from '@stencil/core';\n\nimport { zonosStore } from 'src/components/store/zonosStore';\nimport { classes } from 'src/components/utils/classes';\nimport { getBorderRadius } from 'src/components/utils/getBorderRadius';\nimport { isColorVariable } from 'src/components/utils/isColorVariable';\nimport type { Color, ElementsUiStyle, ElementsUiTheme } from 'src/types';\n\nexport type ShippingRichRadioItem = {\n caption?: string;\n label: string;\n price: string;\n sublabel?: string;\n value: string | number;\n};\n\n@Component({\n shadow: true,\n styleUrl: 'zonos-shipping-rich-radio.scss',\n tag: 'zonos-shipping-rich-radio',\n})\nexport class ZonosShippingRichRadio {\n /**\n * List of items to display\n */\n @Prop() items!: ShippingRichRadioItem[];\n\n /**\n * Override border color of the radio item\n */\n @Prop() borderColor?: Color | (string & { _placeholder?: never });\n\n /**\n * Override border color of the radio item\n */\n @Prop() borderStyle?: ElementsUiStyle;\n\n /**\n * Theme of the radio item\n */\n @Prop() theme?: ElementsUiTheme;\n /**\n * Selected item\n * @default {null|firstItem}\n */\n @State() selectedItem: ShippingRichRadioItem | null = null;\n\n /**\n * Event emitted when an item is selected\n */\n @Event() radioSelected?: EventEmitter<ShippingRichRadioItem>;\n\n private handleRichRadioSelect = (item: ShippingRichRadioItem) => {\n this.selectedItem = item;\n this.radioSelected?.emit(item);\n };\n\n private getRadioItemStyleVariables = () => {\n const usedColor = this.borderColor || zonosStore.appearance.colorSecondary;\n const secondaryColor = isColorVariable(usedColor)\n ? `var(--amino-${usedColor})`\n : usedColor;\n\n return {\n '--border-radius': getBorderRadius(this.borderStyle),\n '--selected-border-color': secondaryColor || 'unset',\n };\n };\n\n render() {\n return (\n <Host\n class=\"zonos--shipping-rich-radio zonos--elements\"\n data-theme={this.theme}\n style={this.getRadioItemStyleVariables()}\n >\n {this.items?.map(item => {\n const selected = this.selectedItem?.value === item.value;\n return (\n <div\n aria-hidden=\"true\"\n class={classes([\n 'zonos--shipping-rich-radio-item',\n selected && 'selected',\n ])}\n onClick={() => this.handleRichRadioSelect(item)}\n >\n <input\n checked={selected}\n class=\"zonos--shipping-rich-radio-input\"\n name=\"zonos--shipping-rich-radio\"\n type=\"radio\"\n value={item.value}\n />\n <div class=\"zonos--shipping-info\">\n <div class=\"zonos--shipping-detail\">\n <zonos-text class=\"zonos--shipping-label\" type=\"label\">\n {item.label}\n </zonos-text>\n {(item.sublabel || item.caption) && (\n <div class=\"zonos--sub-detail\">\n {item.sublabel && (\n <zonos-text color=\"gray-800\">\n {item.sublabel}\n </zonos-text>\n )}\n {item.caption && (\n <zonos-text color=\"gray-400\">{item.caption}</zonos-text>\n )}\n </div>\n )}\n </div>\n <zonos-text type=\"semiBoldLabel\">{item.price}</zonos-text>\n </div>\n </div>\n );\n })}\n </Host>\n );\n }\n}\n"],"mappings":"0TAAA,IAAMA,0BAA4B,46C,IC6BrBC,uBAAsB,W,yGA+BzBC,KAAAC,sBAAwB,SAACC,G,MAC/BC,EAAKC,aAAeF,GACpBG,EAAAF,EAAKG,iBAAa,MAAAD,SAAA,SAAAA,EAAEE,KAAKL,E,EAGnBF,KAAAQ,2BAA6B,WACnC,IAAMC,EAAYN,EAAKO,aAAeC,WAAWC,WAAWC,eAC5D,IAAMC,EAAiBC,gBAAgBN,GACnC,eAAAO,OAAeP,EAAS,KACxBA,EAEJ,MAAO,CACL,kBAAmBQ,gBAAgBd,EAAKe,aACxC,0BAA2BJ,GAAkB,Q,oHApBK,I,CAwBtDf,EAAAoB,UAAAC,OAAA,eAAAjB,EAAAH,K,MACE,OACEqB,EAACC,KAAI,CACHC,MAAM,6CAA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