@zonos/elements 1.0.16 → 1.0.17-alpha.1

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.
Files changed (91) hide show
  1. package/dist/cjs/{cart-e27fd17c.js → cart-108bc407.js} +8 -1
  2. package/dist/cjs/cart-108bc407.js.map +1 -0
  3. package/dist/cjs/zonos-address_2.cjs.entry.js +1 -1
  4. package/dist/cjs/zonos-banner_2.cjs.entry.js +1 -1
  5. package/dist/cjs/zonos-cart-items_10.cjs.entry.js +5 -3
  6. package/dist/cjs/zonos-cart-items_10.cjs.entry.js.map +1 -1
  7. package/dist/cjs/zonos-checkout.cjs.entry.js +6 -2
  8. package/dist/cjs/zonos-checkout.cjs.entry.js.map +1 -1
  9. package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
  10. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +3 -1
  11. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js.map +1 -1
  12. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +1 -1
  13. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js.map +1 -1
  14. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +5 -1
  15. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js.map +1 -1
  16. package/dist/collection/components/store/checkout/cart.js +6 -0
  17. package/dist/collection/components/store/checkout/cart.js.map +1 -1
  18. package/dist/collection/components/store/checkout/stripe.js +2 -0
  19. package/dist/collection/components/store/checkout/stripe.js.map +1 -1
  20. package/dist/collection/environment.js +9 -1
  21. package/dist/collection/environment.js.map +1 -1
  22. package/dist/collection/scripts/loadStripe.js +3 -3
  23. package/dist/collection/scripts/loadStripe.js.map +1 -1
  24. package/dist/collection/scripts/stripe.js +6 -6
  25. package/dist/collection/scripts/stripe.js.map +1 -1
  26. package/dist/collection/scripts/zonos.js +2 -2
  27. package/dist/collection/scripts/zonos.js.map +1 -1
  28. package/dist/collection/types/generated/graphql.customer.types.js +5 -0
  29. package/dist/collection/types/generated/graphql.customer.types.js.map +1 -1
  30. package/dist/components/stripe.js +8 -1
  31. package/dist/components/stripe.js.map +1 -1
  32. package/dist/components/zonos-cart-items2.js +3 -1
  33. package/dist/components/zonos-cart-items2.js.map +1 -1
  34. package/dist/components/zonos-checkout-finish2.js +1 -1
  35. package/dist/components/zonos-checkout-finish2.js.map +1 -1
  36. package/dist/components/zonos-checkout.js +5 -1
  37. package/dist/components/zonos-checkout.js.map +1 -1
  38. package/dist/esm/{cart-36c33342.js → cart-2f83e048.js} +8 -1
  39. package/dist/esm/cart-2f83e048.js.map +1 -0
  40. package/dist/esm/zonos-address_2.entry.js +1 -1
  41. package/dist/esm/zonos-banner_2.entry.js +1 -1
  42. package/dist/esm/zonos-cart-items_10.entry.js +5 -3
  43. package/dist/esm/zonos-cart-items_10.entry.js.map +1 -1
  44. package/dist/esm/zonos-checkout.entry.js +6 -2
  45. package/dist/esm/zonos-checkout.entry.js.map +1 -1
  46. package/dist/esm/zonos-controller.entry.js +1 -1
  47. package/dist/esm-es5/cart-2f83e048.js +2 -0
  48. package/dist/esm-es5/cart-2f83e048.js.map +1 -0
  49. package/dist/esm-es5/zonos-address_2.entry.js +1 -1
  50. package/dist/esm-es5/zonos-banner_2.entry.js +1 -1
  51. package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
  52. package/dist/esm-es5/zonos-cart-items_10.entry.js.map +1 -1
  53. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  54. package/dist/esm-es5/zonos-checkout.entry.js.map +1 -1
  55. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  56. package/dist/scripts/loadStripe.js +118 -0
  57. package/dist/scripts/loadZonos.js +300 -0
  58. package/dist/scripts/stripe.js +126 -0
  59. package/dist/scripts/zonos.js +300 -0
  60. package/dist/types/components/store/checkout/cart.d.ts +14 -0
  61. package/dist/types/components/store/checkout/stripe.d.ts +1 -1
  62. package/dist/types/scripts/loadStripe.d.ts +1 -1
  63. package/dist/types/scripts/stripe.d.ts +2 -2
  64. package/dist/types/types/generated/graphql.customer.types.d.ts +48 -0
  65. package/dist/types/types/generated/graphql.customer.types.ts +50 -0
  66. package/dist/zonos-elements/{cart-36c33342.js → cart-2f83e048.js} +8 -1
  67. package/dist/zonos-elements/cart-2f83e048.js.map +1 -0
  68. package/dist/zonos-elements/cart-9780fa28.system.js +2 -0
  69. package/dist/zonos-elements/cart-9780fa28.system.js.map +1 -0
  70. package/dist/zonos-elements/zonos-address_2.entry.js +1 -1
  71. package/dist/zonos-elements/zonos-address_2.system.entry.js +1 -1
  72. package/dist/zonos-elements/zonos-banner_2.entry.js +1 -1
  73. package/dist/zonos-elements/zonos-banner_2.system.entry.js +1 -1
  74. package/dist/zonos-elements/zonos-cart-items_10.entry.js +5 -3
  75. package/dist/zonos-elements/zonos-cart-items_10.entry.js.map +1 -1
  76. package/dist/zonos-elements/zonos-cart-items_10.system.entry.js +1 -1
  77. package/dist/zonos-elements/zonos-cart-items_10.system.entry.js.map +1 -1
  78. package/dist/zonos-elements/zonos-checkout.entry.js +6 -2
  79. package/dist/zonos-elements/zonos-checkout.entry.js.map +1 -1
  80. package/dist/zonos-elements/zonos-checkout.system.entry.js +1 -1
  81. package/dist/zonos-elements/zonos-checkout.system.entry.js.map +1 -1
  82. package/dist/zonos-elements/zonos-controller.entry.js +1 -1
  83. package/dist/zonos-elements/zonos-controller.system.entry.js +1 -1
  84. package/package.json +2 -2
  85. package/dist/cjs/cart-e27fd17c.js.map +0 -1
  86. package/dist/esm/cart-36c33342.js.map +0 -1
  87. package/dist/esm-es5/cart-36c33342.js +0 -2
  88. package/dist/esm-es5/cart-36c33342.js.map +0 -1
  89. package/dist/zonos-elements/cart-36c33342.js.map +0 -1
  90. package/dist/zonos-elements/cart-ecd9011b.system.js +0 -2
  91. package/dist/zonos-elements/cart-ecd9011b.system.js.map +0 -1
@@ -0,0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AAG,eAAe,CAAC;;IAEjC,oCAAoC,EAAE,CAAC;GACxC;AACH;;;;","names":["onChange","reset"],"sources":["src/components/utils/api/prepCalculateLandedCost.ts","src/components/utils/api/calculateLandedCost.ts","src/styles/stripe/addressRuleStyle.ts","src/styles/stripe/defaultVariable.ts","src/components/store/checkout/stripe.ts","src/components/utils/formatDate.ts","src/components/utils/getDaysDifference.ts","src/components/store/checkout/cart.ts"],"sourcesContent":["import { cartStore } from 'src/components/store/checkout/cart';\nimport { stripeStore } from 'src/components/store/checkout/stripe';\nimport type { CalculateLandedCostRequest } from 'src/types/checkout/api/CalculateLandedCostRequest';\n\nexport const prepCalculateLandedCost = (): CalculateLandedCostRequest => {\n // maybe we don't need email now for prefetch the landed cost\n const stripeLinkData = stripeStore.stripeLinkEventData;\n\n const stripeAddressData = stripeStore.stripeAddressEventData;\n if (!stripeAddressData || !stripeAddressData.complete) {\n throw new Error('Missing stripe address data');\n }\n\n return {\n checkoutSessionId: cartStore.checkoutSessionId || '',\n contact: {\n email: stripeLinkData?.value.email || '',\n // firstName and lastName should be valid now since stripe only mark\n // the address as complete when both fields are filled.\n firstName: stripeAddressData.value.firstName || '',\n lastName: stripeAddressData.value.lastName || '',\n phone: stripeAddressData.value.phone || '',\n },\n items: cartStore.items.map(item => ({\n amount: item.amount,\n countryOfOrigin: item.countryOfOrigin,\n currencyCode: item.currencyCode,\n imageUrl: item.imageUrl,\n name: item.name,\n productId: item.productId,\n quantity: item.quantity,\n })),\n shippingAddress: {\n addressLine1: stripeAddressData.value.address.line1,\n addressLine2: stripeAddressData.value.address.line2 || '',\n city: stripeAddressData.value.address.city,\n country: stripeAddressData.value.address.country,\n postalCode: stripeAddressData.value.address.postal_code,\n state: stripeAddressData.value.address.state,\n },\n };\n};\n","import { prepCalculateLandedCost } from 'src/components/utils/api/prepCalculateLandedCost';\nimport { handleFetch } from 'src/components/utils/handleFetch';\nimport type { CalculateLandedCostRequest } from 'src/types/checkout/api/CalculateLandedCostRequest';\nimport type { CalculateLandedCostMutation } from 'src/types/generated/graphql.customer.types';\n\nexport const calculateLandedCost = async (\n abortController?: AbortController,\n) => {\n // request to get landed cost info\n const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/calculate-landed-cost`;\n const { errors, json } = await handleFetch<\n CalculateLandedCostMutation,\n CalculateLandedCostRequest\n >(url, {\n body: prepCalculateLandedCost(),\n method: 'POST',\n signal: abortController?.signal,\n });\n if (errors.length || !json) {\n throw new Error('Failed to calculate landed cost');\n }\n\n return json;\n};\n","import type { ElementsUiTheme, StripeRuleType } from 'src/types';\n\nexport const addressRuleStyle = ({\n theme,\n}: {\n theme: ElementsUiTheme;\n}): StripeRuleType => {\n switch (theme) {\n default:\n return {\n '.Input': {\n // need to reset everything and the paddingTop to default, otherwise the paddingTop will not be updated.\n padding: '0',\n paddingBottom: '8px',\n paddingLeft: '16px',\n paddingRight: '8px',\n // any value here will be add up to the default paddingTop (20px).\n paddingTop: '6px',\n },\n };\n }\n};\n","import type { Appearance } from '@stripe/stripe-js';\n\nimport { getBorderRadius } from 'src/components/utils/getBorderRadius';\nimport type {\n ElementsUiStyle,\n ElementsUiTheme,\n} from 'src/types/generated/graphql.customer.types';\n\nexport const defaultVariable = ({\n borderStyle,\n theme,\n}: {\n borderStyle?: ElementsUiStyle;\n theme: ElementsUiTheme;\n}): Appearance['variables'] => {\n switch (theme) {\n case 'DARK':\n return {\n borderRadius: getBorderRadius(borderStyle),\n colorBackground: '#101117',\n colorBackgroundText: '#C5C6CA',\n colorText: '#C5C6CA',\n colorTextPlaceholder: '#C5C6CA',\n };\n default:\n return {\n borderRadius: getBorderRadius(borderStyle),\n };\n }\n};\n","import { createStore } from '@stencil/store';\nimport type {\n PaymentIntent,\n Stripe,\n StripeAddressElement,\n StripeAddressElementChangeEvent,\n StripeElements,\n StripeElementsOptionsClientSecret,\n StripeLinkAuthenticationElement,\n StripeLinkAuthenticationElementChangeEvent,\n StripePaymentElement,\n StripePaymentElementChangeEvent,\n} from '@stripe/stripe-js';\n\nimport {\n cartStore,\n cartStoreApplySubtotals,\n} from 'src/components/store/checkout/cart';\nimport { localizationStore } from 'src/components/store/hello/localization';\nimport { translate } from 'src/components/store/translationStore';\nimport { zonosStore } from 'src/components/store/zonosStore';\nimport { calculateLandedCost } from 'src/components/utils/api/calculateLandedCost';\nimport { handleFetch } from 'src/components/utils/handleFetch';\nimport { isDarkColor } from 'src/components/utils/isDarkColor';\nimport { log } from 'src/components/utils/logging/log';\nimport { logError } from 'src/components/utils/logging/logError';\nimport { addressRuleStyle } from 'src/styles/stripe/addressRuleStyle';\nimport { defaultVariable } from 'src/styles/stripe/defaultVariable';\nimport type {\n CheckoutSessionCreateMutation,\n CheckoutSessionUpdateMutation,\n CountryCode,\n ElementsUiStyle,\n ElementsUiTheme,\n} from 'src/types/generated/graphql.customer.types';\n\nexport type ContactOption = {\n address: {\n city: string;\n country: string;\n line1: string;\n line2?: string;\n postal_code: string;\n state: string;\n };\n name: string;\n phone?: string;\n};\n\ntype StripeStore = {\n // client secret is used to render link and payment elements\n clientSecret: string | null;\n fetchingLandedCostAbordController: AbortController | null;\n // toggle to indicate if we are pre-fetching/fetching landed cost\n isFetchingLandedCost: boolean;\n // toggle to indicate if we are fetching checkout session\n isFetchingSession: boolean;\n stripe: Stripe | null;\n stripeAddressElement: StripeAddressElement | null;\n stripeAddressEventData: StripeAddressElementChangeEvent | null;\n stripeAddressUsedWhenFetchingLC: StripeAddressElementChangeEvent | null;\n stripeElements: StripeElements | null;\n stripeLinkElement: StripeLinkAuthenticationElement | null;\n stripeLinkEventData: StripeLinkAuthenticationElementChangeEvent | null;\n stripeLinkUsedWhenFetchingLC: StripeLinkAuthenticationElementChangeEvent | null;\n stripePaymentElement: StripePaymentElement | null;\n stripePaymentEventData: StripePaymentElementChangeEvent | null;\n};\n\nconst {\n onChange,\n reset,\n state: stripeStore,\n} = createStore<StripeStore>(() => ({\n clientSecret: sessionStorage.getItem('zonos--client-secret') || null,\n fetchingLandedCostAbordController: null,\n isFetchingLandedCost: false,\n isFetchingSession: false,\n stripe: null,\n stripeAddressElement: null,\n stripeAddressEventData: null,\n stripeAddressUsedWhenFetchingLC: null,\n stripeElements: null,\n stripeLinkElement: null,\n stripeLinkEventData: null,\n stripeLinkUsedWhenFetchingLC: null,\n stripePaymentElement: null,\n stripePaymentEventData: null,\n}));\n\nconst getStripeOptions = ({\n clientSecret,\n overrideBorderRaidus,\n overridePrimaryColor,\n overrideTheme,\n}: {\n clientSecret?: string;\n overrideBorderRaidus?: ElementsUiStyle;\n overridePrimaryColor?: string;\n overrideTheme?: ElementsUiTheme;\n}): StripeElementsOptionsClientSecret => {\n const primaryColor =\n overridePrimaryColor || zonosStore.appearance.colorPrimary;\n const themeBasedColor =\n primaryColor && isDarkColor(primaryColor) ? 'night' : 'flat';\n // if overrideTheme is provided, use it. Otherwise, use theme based on primary color\n const theme = overrideTheme === 'DARK' ? 'night' : 'flat';\n return {\n appearance: {\n labels: 'floating',\n rules: {\n ...addressRuleStyle({ theme: 'LIGHT' }),\n },\n // get contrast theme color base on primary color\n theme: overrideTheme ? theme : themeBasedColor,\n variables: {\n ...defaultVariable({\n borderStyle: overrideBorderRaidus,\n theme: 'LIGHT',\n }),\n },\n },\n clientSecret,\n locale: localizationStore.selectedLocale,\n };\n};\n\nconst initStripeElements = async (props?: {\n overrideBorderRaidus?: ElementsUiStyle;\n overridePrimaryColor?: string;\n overrideTheme?: ElementsUiTheme;\n}) => {\n const clientSecret = stripeStore.clientSecret;\n\n if (!stripeStore.stripe) {\n log('Skip. Stripe is not initialized');\n return;\n }\n if (clientSecret) {\n const stripeOptions = getStripeOptions({\n clientSecret,\n overrideBorderRaidus: props?.overrideBorderRaidus,\n overridePrimaryColor: props?.overridePrimaryColor,\n overrideTheme: props?.overrideTheme,\n });\n\n if (!stripeStore.stripeElements) {\n // init stripe elements if it doesn't exist\n stripeStore.stripeElements = stripeStore.stripe?.elements(stripeOptions);\n } else {\n // update elements with new option if it already exists\n stripeStore.stripeElements.update(stripeOptions);\n }\n log('Stripe elements initialized');\n }\n};\n\nconst stripeStoreReset = () => {\n // clean clientSecret so that we can start the new one.\n sessionStorage.removeItem('zonos--client-secret');\n\n // cleanup stripe elements\n reset();\n // set stripe back to window.Zonos.stripe\n stripeStore.stripe = window.Zonos.stripe;\n};\n\n/**\n * Check if the address and email info used when fetching landed cost with the current email and address info are different\n * Purpose is to resend the request if the info used when fetching landed cost is different from the current info\n */\nconst isPrefetchInfoOutdated = () => {\n const hasAbortController = stripeStore.fetchingLandedCostAbordController;\n if (!hasAbortController) {\n // if there is no abort controller, this is a new request\n return false;\n }\n\n const isLinkDataDirty =\n JSON.stringify(stripeStore.stripeLinkUsedWhenFetchingLC?.value) !==\n JSON.stringify(stripeStore.stripeLinkEventData?.value);\n const isAddressDataDirty =\n JSON.stringify(stripeStore.stripeAddressUsedWhenFetchingLC?.value) !==\n JSON.stringify(stripeStore.stripeAddressEventData?.value);\n\n return isLinkDataDirty || isAddressDataDirty;\n};\n\nconst stripeStorePrefetchLandedCost = async () => {\n const stripeAddressReady = !!stripeStore.stripeAddressEventData?.complete;\n const stripeLinkReady = !!stripeStore.stripeLinkEventData?.complete;\n const shouldRefetch = isPrefetchInfoOutdated();\n\n if (shouldRefetch) {\n // if the info used when fetching landed cost is different from the current info, abort the previous request\n stripeStore.fetchingLandedCostAbordController?.abort();\n stripeStore.fetchingLandedCostAbordController = null;\n }\n\n // only fetch if we are not fetching or we need to refetch\n if (\n stripeAddressReady &&\n stripeLinkReady &&\n (shouldRefetch || !stripeStore.isFetchingLandedCost)\n ) {\n stripeStore.isFetchingLandedCost = true;\n if (stripeStore.stripeAddressEventData) {\n stripeStore.stripeAddressUsedWhenFetchingLC = {\n ...stripeStore.stripeAddressEventData,\n };\n }\n if (stripeStore.stripeLinkEventData) {\n stripeStore.stripeLinkUsedWhenFetchingLC = {\n ...stripeStore.stripeLinkEventData,\n };\n }\n try {\n const abortController = new AbortController();\n stripeStore.fetchingLandedCostAbordController = abortController;\n const { checkoutSessionWorkflow, shipmentRatingCalculateWorkflow } =\n await calculateLandedCost(abortController);\n\n // reset abort controller after we are done\n stripeStore.fetchingLandedCostAbordController = null;\n\n // update cart store with landed cost info\n cartStore.landedCostData =\n checkoutSessionWorkflow?.filter(Boolean) || null;\n\n cartStore.shippingData =\n shipmentRatingCalculateWorkflow?.filter(Boolean) || null;\n // apply new subtotal and total, this is mainly to show items in the presentment currency\n const firstLandedCostData = cartStore.landedCostData?.find(Boolean);\n const subtotals = !!firstLandedCostData\n ? firstLandedCostData.subtotals\n : null;\n if (subtotals) {\n // prefetch landed cost will not update shipping and taxes since we haven't selected shipping method yet\n cartStoreApplySubtotals({\n exchangeRate: subtotals.exchangeRate,\n items: subtotals.items,\n landedCostTotal: 0,\n presentmentCurrencyCode: subtotals.presentmentCurrencyCode,\n shipping: 0,\n total: subtotals.items,\n });\n }\n } catch (err) {\n logError(err);\n }\n stripeStore.isFetchingLandedCost = false;\n }\n};\n\nconst getStripeMessageBasedOnStatus = (status?: PaymentIntent['status']) => {\n let messages: string[] = [];\n let isError = true;\n // Inspect the PaymentIntent `status` to indicate the status of the payment\n // to your customer.\n //\n // Some payment methods will [immediately succeed or fail][0] upon\n // confirmation, while others will first enter a `processing` state.\n //\n // [0]: https://stripe.com/docs/payments/payment-methods#payment-notification\n switch (status) {\n case 'succeeded': {\n messages = [\n translate(\n 'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.',\n ),\n '',\n '',\n translate(\n \"We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.\",\n ),\n ];\n isError = false;\n break;\n }\n case 'requires_capture':\n case 'processing': {\n messages = [\n translate(\n \"Payment processing. We'll update you when payment is received.\",\n ),\n ];\n isError = false;\n break;\n }\n\n case 'requires_payment_method': {\n messages = [\n translate('Payment failed. Please try another payment method.'),\n ];\n break;\n }\n\n default: {\n messages = [translate('Something went wrong.')];\n break;\n }\n }\n return {\n isError,\n messages,\n };\n};\n\nconst stripeStoreRetrievePayment = async ({\n clientSecret: _clientSecret,\n storybookForceStatus,\n}: {\n clientSecret: string | null;\n storybookForceStatus?: PaymentIntent['status'];\n}) => {\n if (storybookForceStatus) {\n // return status right away if we are in storybook mode\n const { isError, messages } =\n getStripeMessageBasedOnStatus(storybookForceStatus);\n\n return { error: isError, messages };\n }\n const clientSecret = _clientSecret || stripeStore.clientSecret;\n if (!stripeStore.stripe || !clientSecret) {\n logError('Failed to retrieve payment intent. Stripe is not initialized');\n return { error: true, message: [translate('Something went wrong.')] };\n }\n const { paymentIntent } = await stripeStore.stripe.retrievePaymentIntent(\n clientSecret,\n );\n\n const status = paymentIntent?.status;\n\n const { isError, messages } = getStripeMessageBasedOnStatus(status);\n\n return { error: isError, messages };\n};\n\nconst stripeStoreConfirmPayment = async () => {\n const stripePaymentReady = !!stripeStore.stripePaymentEventData?.complete;\n const stripeElements = stripeStore.stripeElements;\n const stripe = stripeStore.stripe;\n const stripeClientSecret = stripeStore.clientSecret;\n if (stripe && stripeElements && stripePaymentReady && stripeClientSecret) {\n const { error } = await stripe.confirmPayment({\n confirmParams: {\n receipt_email: stripeStore.stripeLinkEventData?.value?.email,\n return_url: window.location.href,\n },\n elements: stripeElements,\n redirect: 'if_required',\n });\n\n if (error) {\n if (error.type === 'card_error' || error.type === 'validation_error') {\n throw new Error(error.message);\n }\n if (error.type === 'invalid_request_error') {\n if (error.code === 'payment_intent_unexpected_state') {\n // PaymentIntent was canceled or expired, or status is `require_capture`.\n // don't throw error here because we will reset the checkout session last step\n return;\n }\n }\n throw new Error('An unexpected error occurred.');\n }\n }\n};\n\ntype CheckoutSessionCreateRequest = {\n currency: string;\n itemsAmount: number;\n presentmentCountryCode: CountryCode | null;\n};\n\n/**\n * Init checkout session\n * @returns {boolean} whether or not the checkout session is successfully created\n */\nconst stripeStoreInitCheckoutSession = async () => {\n const total = cartStore.items.reduce(\n (amount, item) => amount + item.amount * item.quantity,\n 0,\n );\n\n if (!total || !localizationStore.targetCurrency) {\n logError('Fail to create checkout session - invalid total or currency');\n return false;\n }\n\n stripeStore.isFetchingSession = true;\n\n const { errors, json } = await handleFetch<\n CheckoutSessionCreateMutation,\n CheckoutSessionCreateRequest\n >(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/create-checkout-session`, {\n body: {\n currency: cartStore.items.find(Boolean)?.currencyCode || '',\n itemsAmount: total,\n presentmentCountryCode: localizationStore.selectedCountryCode || null,\n },\n method: 'POST',\n });\n\n stripeStore.isFetchingSession = false;\n\n if (errors.length || !json) {\n logError(\n 'Error occurs when creating checkout session',\n JSON.stringify(errors, null, 2),\n );\n\n return false;\n }\n const result = json.checkoutSessionCreate;\n\n stripeStore.clientSecret = result.clientSecret;\n // update cart store with updated informations\n cartStore.checkoutSessionId = result.id;\n cartStoreApplySubtotals({\n ...result.subtotals,\n landedCostTotal: 0,\n shipping: 0,\n total: result.subtotals.items,\n });\n log(\n 'Exchange rate updated for cart items (checkout session create)',\n 'info',\n cartStore.exchangeRate,\n );\n\n log('done-init-checkout-session');\n return true;\n};\n\ntype CheckoutSessionUpdateRequest = {\n currency?: string;\n id: string;\n itemsAmount?: number;\n landedCostId?: string;\n presentmentCountryCode: CountryCode | null;\n};\n/**\n * Update checkout session. Use for updating amount with landed cost id, or update session when cart items change\n */\nconst stripeStoreUpdateCheckoutSession = async ({\n currency,\n id,\n itemsAmount,\n landedCostId,\n presentmentCountryCode,\n}: CheckoutSessionUpdateRequest) => {\n // No need to set loading state here because this function will be called under the hood to update\n // landed cost id for the section.\n const { errors, json } = await handleFetch<\n CheckoutSessionUpdateMutation,\n CheckoutSessionUpdateRequest\n >(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/update-checkout-session`, {\n body: {\n currency,\n id,\n itemsAmount,\n landedCostId,\n presentmentCountryCode,\n },\n method: 'POST',\n });\n\n if (errors.length || !json) {\n logError(\n 'Error occurs when updating checkout session',\n JSON.stringify(errors, null, 2),\n );\n return { errors, json };\n }\n\n return { errors: [], json };\n};\n\nonChange('clientSecret', clientSecret => {\n // update stripe elements when client secret changes\n if (clientSecret && stripeStore.stripe) {\n sessionStorage.setItem('zonos--client-secret', clientSecret);\n }\n\n if (!clientSecret) {\n sessionStorage.removeItem('zonos--client-secret');\n }\n});\n\nexport {\n initStripeElements,\n stripeStore,\n stripeStoreConfirmPayment,\n stripeStoreInitCheckoutSession,\n stripeStorePrefetchLandedCost,\n stripeStoreReset,\n stripeStoreRetrievePayment,\n stripeStoreUpdateCheckoutSession,\n};\n","type Params = {\n date: Date;\n /**\n * Format options for Intl.DateTimeFormat\n * @default {day:'numeric',weekday:'long',year:'numeric'} Thursday 3, 2023\n */\n formatOptions?: Intl.DateTimeFormatOptions;\n};\n\nexport const formatDate = ({\n date,\n formatOptions = { day: 'numeric', weekday: 'long', year: 'numeric' },\n}: Params): string => {\n // format date to Thursday 3, 2023\n return new Intl.DateTimeFormat('en-US', formatOptions).format(date);\n};\n","export const getDaysDifference = (targetDate: Date) => {\n const currentDate = new Date();\n const timeDifference = targetDate.getTime() - currentDate.getTime();\n const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24)); // Convert milliseconds to days\n return daysDifference;\n};\n","import { createStore } from '@stencil/store';\n\nimport {\n stripeStore,\n stripeStoreUpdateCheckoutSession,\n} from 'src/components/store/checkout/stripe';\nimport { localizationStore } from 'src/components/store/hello/localization';\nimport { translate } from 'src/components/store/translationStore';\nimport { formatDate } from 'src/components/utils/formatDate';\nimport { getDaysDifference } from 'src/components/utils/getDaysDifference';\nimport { log } from 'src/components/utils/logging/log';\nimport { logError } from 'src/components/utils/logging/logError';\nimport type {\n CheckoutPresentmentFragment,\n CurrencyCode,\n ShipmentRatingFragment,\n} from 'src/types/generated/graphql.customer.types';\n\nexport type CartItem = {\n amount: number;\n countryOfOrigin?: string;\n currencyCode: string;\n description?: string;\n hsCode?: string;\n imageUrl?: string;\n name: string;\n productId?: string;\n quantity: number;\n};\n\ntype CartStore = {\n checkoutSessionId: string | null;\n currency: CurrencyCode;\n dutiesTaxFees: number;\n error: {\n messages: string[];\n title: string;\n } | null;\n exchangeRate: {\n id: string;\n rate: number;\n sourceCurrencyCode: CurrencyCode;\n targetCurrencyCode: CurrencyCode;\n type: string;\n } | null;\n isSelectedShippingAboveDeminimis: boolean;\n isSelectedShippingGuarantee: boolean;\n items: CartItem[];\n landedCostData: CheckoutPresentmentFragment[] | null;\n selectedLandedCost: CheckoutPresentmentFragment | null;\n selectedShippingOption: ShipmentRatingFragment | null;\n selectedShippingOptionExpectedDate: string;\n selectedShippingOptionTransitTime: string;\n shipping: number;\n shippingData: ShipmentRatingFragment[] | null;\n step: 'customer-info' | 'shipping' | 'payment' | 'finish' | 'error';\n subtotal: number;\n total: number;\n};\n\nconst {\n onChange,\n reset,\n state: cartStore,\n} = createStore<CartStore>(() => ({\n checkoutSessionId:\n sessionStorage.getItem('zonos--checkout-session-id') || null,\n currency: 'USD',\n dutiesTaxFees: 0,\n error: null,\n exchangeRate: null,\n isSelectedShippingAboveDeminimis: false,\n isSelectedShippingGuarantee: false,\n items: [],\n landedCostData: null,\n selectedLandedCost: null,\n selectedShippingOption: null,\n selectedShippingOptionExpectedDate: '',\n selectedShippingOptionTransitTime: '',\n shipping: 0,\n shippingData: null,\n step: 'customer-info',\n subtotal: 0,\n total: 0,\n}));\n\n/**\n * Format shipping transit info to be displayed on UI\n * @returns\n * - expectedDate: Thursday, Aug 12\n * - maxTransit: 5\n * - minTransit: 3\n */\nconst cartStoreGetShippingTransitInfo = (item: ShipmentRatingFragment) => {\n const minTransit = item.minTransitAt\n ? getDaysDifference(new Date(item.minTransitAt))\n : '';\n const maxTransit = item.maxTransitAt\n ? getDaysDifference(new Date(item.maxTransitAt))\n : '';\n const expectedDate = item.minTransitAt\n ? formatDate({\n date: new Date(item.minTransitAt),\n })\n : '';\n return {\n expectedDate,\n maxTransit,\n minTransit,\n };\n};\n\nconst cartStoreReset = () => {\n sessionStorage.removeItem('zonos--checkout-session-id');\n\n // reset cart store\n reset();\n};\n\nconst cartStoreUpdateToErrorState = ({\n messages,\n title,\n}: {\n messages: string[];\n title: string;\n}) => {\n cartStore.step = 'error';\n cartStore.error = {\n messages,\n title,\n };\n};\n\ntype CartSubtotals = {\n exchangeRate: {\n id: string;\n rate: number;\n sourceCurrencyCode: CurrencyCode;\n targetCurrencyCode: CurrencyCode;\n type: string;\n };\n items: number;\n landedCostTotal: number;\n presentmentCurrencyCode: CurrencyCode;\n shipping: number;\n total: number;\n};\n\nconst cartStoreApplySubtotals = (subtotals: CartSubtotals) => {\n // update exchange rate so we can use it to display cart items\n cartStore.exchangeRate = subtotals.exchangeRate;\n cartStore.dutiesTaxFees = subtotals.landedCostTotal;\n cartStore.subtotal = subtotals.items;\n cartStore.total = subtotals.total;\n cartStore.currency = subtotals.presentmentCurrencyCode;\n};\n\ntype CartStoreRecalculateTotalParams = Omit<\n Parameters<typeof stripeStoreUpdateCheckoutSession>[0],\n 'id' | 'presentmentCountryCode'\n>;\n\nconst cartStoreReCalculateTotal = async ({\n currency,\n itemsAmount,\n landedCostId,\n}: CartStoreRecalculateTotalParams) => {\n if (landedCostId && cartStore.selectedLandedCost) {\n // update cart total right away if we have landed cost id to avoid order total flickering\n const subtotals = cartStore.selectedLandedCost.subtotals;\n cartStoreApplySubtotals(subtotals);\n log(\n 'Exchange rate updated for cart items (landed cost subtotal)',\n 'info',\n cartStore.exchangeRate,\n );\n }\n // update checkout session\n if (!cartStore.checkoutSessionId) {\n logError('Could update cart total without checkout session id');\n return false;\n }\n const { json } = await stripeStoreUpdateCheckoutSession({\n currency,\n id: cartStore.checkoutSessionId,\n itemsAmount,\n landedCostId,\n presentmentCountryCode: localizationStore.selectedCountryCode,\n });\n if (!json) {\n // do nothing if we can't get checkout session\n logError('Error occurs when updating checkout session');\n cartStoreUpdateToErrorState({\n messages: [\n translate(\n \"There's been an error updating your checkout session. Please reload and try again or contact support if the error persists\",\n ),\n ],\n title: translate('Error updating Checkout'),\n });\n return false;\n }\n if (!landedCostId) {\n // This is when first open the checkout modal and we just want to get info from the old cart session.\n // use subtotals from checkout session to update cart total\n cartStoreApplySubtotals(json.checkoutSessionUpdate.subtotals);\n log(\n 'Exchange rate updated for cart items (checkout session update)',\n 'info',\n cartStore.exchangeRate,\n );\n }\n return true;\n};\n\nconst cartStoreUpdateSelectedShippingOption = async (\n selectedShippingOption: ShipmentRatingFragment,\n) => {\n cartStore.selectedShippingOption = selectedShippingOption;\n\n // update shipping transit info\n const { expectedDate, maxTransit, minTransit } =\n cartStoreGetShippingTransitInfo(cartStore.selectedShippingOption);\n cartStore.selectedShippingOptionExpectedDate = expectedDate;\n cartStore.selectedShippingOptionTransitTime =\n minTransit && maxTransit\n ? `${minTransit}-${maxTransit}`\n : `${minTransit || maxTransit}`;\n\n const selectedLandedCost = cartStore.landedCostData?.find(\n checkoutSessionPresentment =>\n checkoutSessionPresentment.landedCost?.shipmentRating?.id ===\n cartStore.selectedShippingOption?.id,\n );\n // save selected landed cost for later use\n cartStore.selectedLandedCost = selectedLandedCost || null;\n\n if (!selectedLandedCost) {\n // do nothing if we can't find landed cost for selected shipping option\n return false;\n }\n\n // update shipping value and dutiesTaxFees on selectedShippingOption change\n cartStore.shipping = selectedLandedCost.subtotals.shipping;\n\n // update deminimis status\n const isGuarantee =\n selectedLandedCost?.landedCost?.landedCostGuaranteeCode === 'ZONOS';\n // one item in deminimis with type of duty and tax has threshold value is \"ABOVE\"\n const isAboveDeminimis = !!selectedLandedCost?.landedCost?.deMinimis?.find(\n item => ['DUTY', 'TAX'].includes(item.type) && item.threshold === 'ABOVE',\n );\n cartStore.isSelectedShippingAboveDeminimis = isAboveDeminimis;\n cartStore.isSelectedShippingGuarantee = isGuarantee;\n // update session with selected landed cost\n const updateCalulateStatus = await cartStoreReCalculateTotal({\n landedCostId: selectedLandedCost.landedCost?.id,\n });\n return updateCalulateStatus;\n};\n\nonChange('checkoutSessionId', () => {\n if (!cartStore.checkoutSessionId) {\n sessionStorage.removeItem('zonos--checkout-session-id');\n return;\n }\n sessionStorage.setItem(\n 'zonos--checkout-session-id',\n cartStore.checkoutSessionId,\n );\n});\n\nconst cartStoreUpdateItems = async (items: CartItem[]) => {\n cartStore.items = items;\n const currency = items.find(Boolean)?.currencyCode as CurrencyCode;\n const total = items.reduce((amt, item) => {\n return amt + item.amount * item.quantity;\n }, 0);\n if (!currency || !total) {\n // do nothing if we can't get currency or total\n return;\n }\n cartStore.currency = currency;\n // set loading state here because this is first load checkout session when we already have checkout session id stored\n stripeStore.isFetchingSession = true;\n await cartStoreReCalculateTotal({\n currency: currency,\n itemsAmount: total,\n });\n stripeStore.isFetchingSession = false;\n};\n\nconst cartStoreResetSelectedShippingOption = () => {\n cartStore.selectedShippingOption = null;\n cartStore.isSelectedShippingAboveDeminimis = false;\n cartStore.isSelectedShippingGuarantee = false;\n cartStore.selectedShippingOptionExpectedDate = '';\n cartStore.selectedShippingOptionTransitTime = '';\n cartStore.shipping = 0;\n};\n\nconst cartStoreNextStep = () => {\n if (cartStore.step === 'customer-info') {\n cartStore.step = 'shipping';\n } else if (cartStore.step === 'shipping') {\n cartStore.step = 'payment';\n } else if (cartStore.step === 'payment') {\n cartStore.step = 'finish';\n }\n};\n\nconst cartStorePreviousStep = () => {\n if (cartStore.step === 'payment') {\n cartStore.step = 'shipping';\n } else if (cartStore.step === 'shipping') {\n cartStore.step = 'customer-info';\n // reset selected shipping option\n cartStoreResetSelectedShippingOption();\n }\n};\n\nexport {\n cartStore,\n cartStoreApplySubtotals,\n cartStoreGetShippingTransitInfo,\n cartStoreNextStep,\n cartStorePreviousStep,\n cartStoreReCalculateTotal,\n cartStoreReset,\n cartStoreUpdateItems,\n cartStoreUpdateSelectedShippingOption,\n cartStoreUpdateToErrorState,\n};\n"],"version":3}
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-d1aa9293.js';
2
- import { s as stripeStore, f as stripeStorePrefetchLandedCost } from './cart-36c33342.js';
2
+ import { s as stripeStore, f as stripeStorePrefetchLandedCost } from './cart-2f83e048.js';
3
3
  import { b as logError, a as localizationStore } from './localization-4a424f49.js';
4
4
  import './zonosStore-13a7b534.js';
5
5
  import './isDarkColor-b21326ae.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-d1aa9293.js';
2
2
  import { c as classes } from './classes-0d95c529.js';
3
- import { s as stripeStore } from './cart-36c33342.js';
3
+ import { s as stripeStore } from './cart-2f83e048.js';
4
4
  import './zonosStore-13a7b534.js';
5
5
  import './localization-4a424f49.js';
6
6
  import './isDarkColor-b21326ae.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-d1aa9293.js';
2
- import { c as cartStore, s as stripeStore, l as stripeStoreRetrievePayment, j as stripeStoreReset, m as cartStoreUpdateSelectedShippingOption, n as cartStoreGetShippingTransitInfo } from './cart-36c33342.js';
2
+ import { c as cartStore, s as stripeStore, l as stripeStoreRetrievePayment, j as stripeStoreReset, m as cartStoreUpdateSelectedShippingOption, n as cartStoreGetShippingTransitInfo } from './cart-2f83e048.js';
3
3
  import { t as translate } from './localization-4a424f49.js';
4
4
  import { g as getBorderRadius } from './getBorderRadius-82fbaf25.js';
5
5
  import { s as submitGtag, i as isCheckoutMobile } from './submitGtag-fbdb454b.js';
@@ -25,7 +25,9 @@ const ZonosCartItems = class {
25
25
  this.errorImages = [];
26
26
  }
27
27
  render() {
28
+ var _a;
28
29
  const emptyItemImg = getAssetPath('./assets/empty-item.jpeg');
30
+ const rate = ((_a = cartStore.exchangeRate) === null || _a === void 0 ? void 0 : _a.rate) || 1;
29
31
  return (h(Host, { class: "zonos--cart-items zonos--elements" }, h("table", { class: "zonos--cart-table" }, h("tbody", null, cartStore.items.map(item => {
30
32
  const itemImg = item.imageUrl;
31
33
  return (h("tr", { class: "zonos--cart-item" }, h("td", { class: "zonos--column zonos--cart-item-image" }, itemImg && !this.errorImages.includes(itemImg) ? (h("img", { alt: item.name, onError: () => {
@@ -33,7 +35,7 @@ const ZonosCartItems = class {
33
35
  }, src: item.imageUrl, style: {
34
36
  'min-width': '40px',
35
37
  }, width: 40 })) : (h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), h("td", { class: "zonos--column zonos--cart-item-name" }, h("zonos-text", { type: "label" }, item.name)), h("td", { class: "zonos--column zonos--cart-item-price" }, h("zonos-text", { type: "semiBoldLabel" }, formatCurrency({
36
- amount: item.amount * item.quantity,
38
+ amount: item.amount * item.quantity * rate,
37
39
  currency: cartStore.currency,
38
40
  })))));
39
41
  })))));
@@ -101,7 +103,7 @@ const ZonosCheckoutFinish = class {
101
103
  this.checkPaymentStatus = async () => {
102
104
  this.isLoading = true;
103
105
  const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || stripeStore.clientSecret;
104
- if (clientSecret) {
106
+ if (clientSecret || this.storybookForceStatus) {
105
107
  const { error, messages } = await stripeStoreRetrievePayment({
106
108
  clientSecret,
107
109
  storybookForceStatus: this.storybookForceStatus,
@@ -1 +1 @@
1
- {"file":"zonos-cart-items.zonos-cart-subtotal.zonos-checkout-finish.zonos-checkout-payment.zonos-collapse.zonos-customer-info.zonos-dialog.zonos-logo.zonos-review.zonos-shipping.entry.js","mappings":";;;;;;;;;AAAO,MAAM,cAAc,GAAG,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,gBAAgB,GAKjB,KACC,gBAAgB;IACZ,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IAChC,QAAQ;IACR,KAAK,EAAE,UAAU;GAClB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,QAAQ,EAAE;IAC/B,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IAC7B,QAAQ;IACR,KAAK,EAAE,UAAU;GAClB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;;ACjBvB,MAAM,iBAAiB,GAAG,yoBAAyoB;;MCWtp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,oBAAc,MAAM,EAAC,SAAS,IAC3B,SAAS,CAAC,gCAAgC,CAAC,OAAG,aAAa,OAAG,GAAG,EACjE,SAAS,CACR,yDAAyD,CAC1D,CACY,CAChB,CACG,EACN,oBACE,eAAe,EAAE,IAAI,CAAC,cAAc,iBACvB,IAAI,CAAC,QAAQ,EAC1B,OAAO,EAAE,IAAI,CAAC,eAAe,EAC7B,OAAO,EAAE,MAAM,IAAI,CAAC,oBAAoB,EAAE,EAC1C,IAAI,EAAC,IAAI;;MAET,OAAO,EAAE,IAAI,CAAC,aAAa,IAE1B,SAAS,CAAC,eAAe,CAAC,CACd,CACV,EACP;GACH;;;;;;;;;","names":["RemoveIcon"],"sources":["src/components/utils/formatCurrency.ts","src/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.scss?tag=zonos-cart-items&encapsulation=shadow","src/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.tsx","src/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.scss?tag=zonos-cart-subtotal&encapsulation=shadow","src/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.tsx","src/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.scss?tag=zonos-checkout-finish&encapsulation=shadow","src/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.tsx","src/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.scss?tag=zonos-checkout-payment&encapsulation=scoped","src/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.tsx","src/components/common/zonos-collapse/zonos-collapse.scss?tag=zonos-collapse&encapsulation=shadow","src/components/common/zonos-collapse/zonos-collapse.tsx","src/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.scss?tag=zonos-customer-info&encapsulation=scoped","src/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.tsx","src/components/common/zonos-dialog/zonos-dialog.scss?tag=zonos-dialog&encapsulation=shadow","src/components/common/zonos-dialog/zonos-dialog.tsx","src/components/common/zonos-logo/zonos-logo.scss?tag=zonos-logo&encapsulation=shadow","src/components/common/zonos-logo/zonos-logo.tsx","src/components/checkout/zonos-checkout/zonos-review/zonos-review.scss?tag=zonos-review&encapsulation=shadow","src/components/checkout/zonos-checkout/zonos-review/zonos-review.tsx","src/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.scss?tag=zonos-shipping&encapsulation=scoped","src/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.tsx"],"sourcesContent":["export const formatCurrency = ({\n amount,\n currency,\n showCurrencyText,\n}: {\n amount: number;\n currency: string;\n showCurrencyText?: boolean;\n}) =>\n showCurrencyText\n ? `${new Intl.NumberFormat('en-US', {\n currency,\n style: 'currency',\n }).format(amount)} ${currency}`\n : new Intl.NumberFormat('en-US', {\n currency,\n style: 'currency',\n }).format(amount);\n",":host {\n .zonos--cart-table {\n width: 100%;\n border: none;\n border-collapse: collapse;\n overflow: auto;\n font-size: $amino-font-size-base;\n .zonos--column {\n padding: $amino-space-8;\n font-size: $amino-font-size-base;\n &:last-child {\n text-align: right;\n }\n &:first-child {\n width: 60px;\n }\n }\n }\n img {\n min-width: 40px;\n }\n}\n","import { Component, getAssetPath, h, Host, State } from '@stencil/core';\n\nimport { cartStore } from 'src/components/store/checkout/cart';\nimport { formatCurrency } from 'src/components/utils/formatCurrency';\n\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-cart-items.scss',\n tag: 'zonos-cart-items',\n})\nexport class ZonosCartItems {\n @State() errorImages: string[] = [];\n\n render() {\n const emptyItemImg = getAssetPath('./assets/empty-item.jpeg');\n return (\n <Host class=\"zonos--cart-items zonos--elements\">\n <table class=\"zonos--cart-table\">\n <tbody>\n {cartStore.items.map(item => {\n const itemImg = item.imageUrl;\n return (\n <tr class=\"zonos--cart-item\">\n <td class=\"zonos--column zonos--cart-item-image\">\n {itemImg && !this.errorImages.includes(itemImg) ? (\n <img\n alt={item.name}\n onError={() => {\n this.errorImages = [...this.errorImages, itemImg];\n }}\n src={item.imageUrl}\n style={{\n 'min-width': '40px',\n }}\n width={40}\n />\n ) : (\n <img alt={item.name} src={emptyItemImg} width={40} />\n )}\n </td>\n <td class=\"zonos--column zonos--cart-item-name\">\n <zonos-text type=\"label\">{item.name}</zonos-text>\n </td>\n <td class=\"zonos--column zonos--cart-item-price\">\n <zonos-text type=\"semiBoldLabel\">\n {formatCurrency({\n amount: item.amount * item.quantity,\n currency: cartStore.currency,\n })}\n </zonos-text>\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n </Host>\n );\n }\n}\n",":host {\n .zonos--cart-table {\n width: 100%;\n border: none;\n border-collapse: collapse;\n overflow: auto;\n font-size: $amino-font-size-base;\n .zonos--column {\n padding: $amino-space-20 $amino-space-8;\n vertical-align: top;\n &:last-child {\n text-align: right;\n }\n &:first-child {\n width: 60px;\n }\n }\n }\n .zonos--title-with-icon {\n display: flex;\n align-items: center;\n gap: $amino-space-8;\n }\n .zonos--cart-subtotal-title,\n .zonos--cart-subtotal-price {\n border-bottom: 1px solid $amino-gray-200;\n }\n\n .zonos--cart-subtotal-price {\n text-align: right;\n }\n}\n","import { Component, Fragment, h, Host } from '@stencil/core';\n\nimport { cartStore } from 'src/components/store/checkout/cart';\nimport { translate } from 'src/components/store/translationStore';\nimport { formatCurrency } from 'src/components/utils/formatCurrency';\n\n// These assets neet to be in relative path as https://www.npmjs.com/package/stencil-inline-svg suggested\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport InfoIcon from './assets/InfoIcon.svg';\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-cart-subtotal.scss',\n tag: 'zonos-cart-subtotal',\n})\nexport class ZonosCartSubtotal {\n render() {\n const totalWithoutTaxes = cartStore.total - cartStore.dutiesTaxFees;\n const renderShippingInfo = () => {\n if (!cartStore.selectedShippingOption) {\n return (\n <>\n <zonos-text class=\"zonos--title\" type=\"semiBoldLabel\">\n {translate('Shipping')}\n </zonos-text>\n <zonos-text class=\"zonos--caption\" type=\"caption\">\n {translate('No shipping method selected')}\n </zonos-text>\n </>\n );\n }\n return (\n <>\n <zonos-text class=\"zonos--title\" type=\"semiBoldLabel\">\n {cartStore.selectedShippingOption.displayName}\n </zonos-text>\n {cartStore.selectedShippingOptionTransitTime && (\n <zonos-text class=\"zonos--caption\" type=\"caption\">\n {cartStore.selectedShippingOptionTransitTime}{' '}\n {translate('business days')}\n </zonos-text>\n )}\n </>\n );\n };\n return (\n <Host class=\"zonos--cart-subtotal zonos--elements\">\n <table class=\"zonos--cart-table\">\n <tr class=\"zonos--row zonos--cart-subtotal\">\n <td class=\"zonos--column\"></td>\n <td class=\"zonos--column zonos--cart-subtotal-title\">\n <zonos-text type=\"semiBoldLabel\">\n {translate('Cart subtotal')}\n </zonos-text>\n </td>\n <td class=\"zonos--column zonos--cart-subtotal-price\">\n <zonos-text type=\"semiBoldLabel\">\n {formatCurrency({\n amount: cartStore.subtotal,\n currency: cartStore.currency,\n })}\n </zonos-text>\n </td>\n </tr>\n <tr class=\"zonos--row zonos--cart-shipping\">\n <td class=\"zonos--column\"></td>\n <td class=\"zonos--column zonos--cart-subtotal-title\">\n {renderShippingInfo()}\n </td>\n <td class=\"zonos--column zonos--cart-subtotal-price\">\n {cartStore.shipping\n ? formatCurrency({\n amount: cartStore.shipping,\n currency: cartStore.currency,\n })\n : '-'}\n </td>\n </tr>\n {/* Only show fee row when step is payment */}\n {cartStore.step === 'payment' && (\n <tr class=\"zonos--row zonos--cart-duties\">\n <td class=\"zonos--column\"></td>\n <td class=\"zonos--column zonos--cart-subtotal-title\">\n <div class=\"zonos--title-with-icon\">\n <zonos-text class=\"zonos--title\" type=\"semiBoldLabel\">\n {translate('Duties, taxes, and fees')}\n </zonos-text>\n <zonos-icon content={InfoIcon} size={16}></zonos-icon>\n </div>\n {!!cartStore.isSelectedShippingAboveDeminimis && (\n <zonos-text color=\"gray-800\" type=\"body\">\n {translate(\n 'Order is over the de minimis threshold for both duty and tax',\n )}\n </zonos-text>\n )}\n </td>\n <td class=\"zonos--column zonos--cart-subtotal-price\">\n {cartStore.dutiesTaxFees\n ? formatCurrency({\n amount: cartStore.dutiesTaxFees,\n currency: cartStore.currency,\n })\n : '-'}\n {cartStore.isSelectedShippingGuarantee && (\n <zonos-badge>{translate('Guaranteed')}</zonos-badge>\n )}\n </td>\n </tr>\n )}\n <tr class=\"zonos--row zonos--cart-pay-total\">\n <td class=\"zonos--column\"></td>\n <td class=\"zonos--column\">\n <zonos-text class=\"zonos--title\" type=\"semiBoldLabel\">\n {translate('Order total')}\n </zonos-text>\n </td>\n <td class=\"zonos--column\">\n <zonos-text type=\"semiBoldLabel\">\n {formatCurrency({\n amount:\n // show total without taxes when step is shipping, show total with taxes when step is payment\n cartStore.step === 'shipping'\n ? totalWithoutTaxes\n : cartStore.total,\n currency: cartStore.currency,\n })}\n </zonos-text>\n </td>\n </tr>\n </table>\n </Host>\n );\n }\n}\n","$border-radius: var(--border-radius, 10px);\n\n:host {\n display: flex;\n flex-direction: column;\n .zonos--group {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n margin-bottom: $amino-space-24;\n border-radius: $border-radius;\n gap: $amino-space-24;\n max-width: 360px;\n width: auto;\n margin: auto;\n margin-top: $amino-space-24;\n background-color: $amino-gray-50;\n padding: $amino-space-20;\n }\n zonos-button {\n width: 100%;\n }\n .loading-wrapper {\n min-height: 300px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n Fragment,\n h,\n Host,\n Prop,\n State,\n} from '@stencil/core';\nimport type { PaymentIntent } from '@stripe/stripe-js';\n\nimport {\n stripeStore,\n stripeStoreReset,\n stripeStoreRetrievePayment,\n} from 'src/components/store/checkout/stripe';\nimport { translate } from 'src/components/store/translationStore';\nimport { getBorderRadius } from 'src/components/utils/getBorderRadius';\nimport { submitGtag } from 'src/components/utils/submitGtag';\nimport type { ElementsUiStyle } from 'src/types';\n\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport RemoveIcon from './assets/RemoveIcon.svg';\n/* Need to use relative import because inline-svg-stencil couldn't resolve absolute path */\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport SuccessIcon from './assets/SuccessIcon.svg';\n\ntype OverrideNotification = {\n messages: string[];\n title: string;\n type: 'success' | 'error';\n};\n\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-checkout-finish.scss',\n tag: 'zonos-checkout-finish',\n})\nexport class ZonosCheckoutFinish {\n /**\n * The border radius style of the dialog\n */\n @Prop() borderRadius: ElementsUiStyle = 'ROUNDED';\n\n /**\n * Force status to test the UI for storybook\n */\n @Prop() storybookForceStatus?: PaymentIntent['status'];\n\n /**\n * Override the notification message and title, bypass checking stripe payment status\n *\n */\n @Prop() overrideNotification?: OverrideNotification;\n\n /**\n * Event to emit when the continue button is clicked\n */\n @Event() closeClick!: EventEmitter<void>;\n\n @State() isLoading: boolean = true;\n @State() notificationType: 'success' | 'error' = 'success';\n @State() notificationTitle: string = '';\n @State() notificationMessages: string[] = [];\n\n private checkPaymentStatus = async () => {\n this.isLoading = true;\n const clientSecret =\n new URLSearchParams(window.location.search).get(\n 'payment_intent_client_secret',\n ) || stripeStore.clientSecret;\n if (clientSecret) {\n const { error, messages } = await stripeStoreRetrievePayment({\n clientSecret,\n storybookForceStatus: this.storybookForceStatus,\n });\n this.notificationType = error ? 'error' : 'success';\n this.notificationMessages = messages || [];\n this.notificationTitle = error\n ? translate('Payment failed')\n : translate(\"You're all set!\");\n\n if (error) {\n submitGtag('zonos-checkout-payment-fail');\n } else {\n submitGtag('zonos-checkout-success');\n }\n }\n stripeStoreReset();\n this.isLoading = false;\n };\n\n private closeClickHandler = () => {\n this.closeClick.emit();\n };\n\n componentDidLoad() {\n if (this.overrideNotification) {\n // just show the notification and don't check any of the payment status\n this.notificationType = this.overrideNotification.type;\n this.notificationTitle = this.overrideNotification.title;\n this.notificationMessages = this.overrideNotification.messages;\n return;\n }\n void this.checkPaymentStatus();\n }\n\n render() {\n return (\n <Host\n class=\"zonos--checkout-finish zonos--elements\"\n style={{\n '--border-radius': getBorderRadius(this.borderRadius),\n }}\n >\n {this.isLoading && (\n <div class=\"loading-wrapper\">\n <zonos-spinner></zonos-spinner>\n </div>\n )}\n {!this.isLoading && (\n <div class=\"zonos--group\">\n {this.notificationType === 'success' ? (\n <zonos-icon\n color={'blue-800'}\n content={SuccessIcon}\n size={50}\n ></zonos-icon>\n ) : (\n <zonos-icon\n color={'red-800'}\n content={RemoveIcon}\n size={50}\n ></zonos-icon>\n )}\n <zonos-text class=\"zonos--title\" type=\"semiBoldSubheader\">\n {this.notificationTitle}\n </zonos-text>\n <zonos-text>\n {this.notificationMessages.map(message => (\n <>\n {message}\n <br />\n </>\n ))}\n </zonos-text>\n <zonos-button\n onClick={() => this.closeClickHandler()}\n size=\"md\"\n variant=\"primary\"\n >\n {translate('Keep shopping')}\n </zonos-button>\n </div>\n )}\n </Host>\n );\n }\n}\n",":host {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n .zonos--title {\n margin-bottom: $amino-space-24;\n }\n .zonos--group {\n margin-bottom: $amino-space-20;\n overflow: auto;\n padding: 0 5px;\n\n @include zonos--scrollbar;\n }\n\n .zonos--payment-error-banner {\n margin-bottom: $amino-space-8;\n }\n\n zonos-button {\n width: 100%;\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport { cartStore } from 'src/components/store/checkout/cart';\nimport { stripeStore } from 'src/components/store/checkout/stripe';\nimport { translate } from 'src/components/store/translationStore';\nimport { formatCurrency } from 'src/components/utils/formatCurrency';\nimport { submitGtag } from 'src/components/utils/submitGtag';\n\n@Component({\n /**\n * Use `scope` here just because this component is `zonos-address` which is using stripe elements and stripe\n * need to be able to inject iframe into this component from the DOM\n */\n scoped: true,\n styleUrl: 'zonos-checkout-payment.scss',\n tag: 'zonos-checkout-payment',\n})\nexport class ZonosCheckoutPayment {\n /**\n * Error occurred during payment\n */\n @Prop() paymentError: boolean = false;\n\n /**\n * Whether or not the checkout is in mobile mode\n */\n @Prop() submitBtnType?: HTMLZonosButtonElement['variant'];\n\n /**\n * Whether or not the continue button is loading\n */\n @Prop() continueLoading: boolean = false;\n\n /**\n * Submit button main color\n */\n @Prop() submitBtnColor?: string;\n\n /**\n * Event to emit when the continue button is clicked\n */\n @Event() continueClicked!: EventEmitter<void>;\n\n /**\n * Whether or not the continue button is disabled\n * @default true\n */\n @State() disabled: boolean = true;\n\n @Watch('disabled')\n watchFormComplete() {\n if (!this.disabled) {\n // submit google tag when the form is complete\n submitGtag('zonos-checkout-payment-info');\n }\n }\n\n /**\n * handler for continue button click\n */\n private continueClickHandler = () => {\n this.continueClicked.emit();\n };\n\n render() {\n if (!stripeStore.stripeElements) {\n return null;\n }\n\n this.disabled = !stripeStore.stripePaymentEventData?.complete;\n\n return (\n <Host class=\"zonos--checkout-payment zonos--elements\">\n <div class=\"zonos--group\">\n <zonos-text class=\"zonos--title\" type=\"semiBoldSubheader\">\n {translate('Payment method')}\n </zonos-text>\n {this.paymentError && (\n <zonos-banner class=\"zonos--payment-error-banner\" intent=\"error\">\n {translate(\n \"We couldn't complete your payment. Please verify the payment details and try again.\",\n )}\n </zonos-banner>\n )}\n <zonos-payment></zonos-payment>\n </div>\n <zonos-button\n backgroundColor={this.submitBtnColor}\n is-disabled={this.disabled}\n loading={this.continueLoading}\n onClick={() => this.continueClickHandler()}\n size=\"lg\"\n // use primary type when on mobile mode\n variant={this.submitBtnType}\n >\n Pay{' '}\n {formatCurrency({\n amount: cartStore.total,\n currency: cartStore.currency,\n })}\n </zonos-button>\n </Host>\n );\n }\n}\n",":host {\n transition: all 0.3s ease-in-out;\n overflow: hidden;\n div {\n position: relative;\n }\n iframe {\n width: 0;\n height: 100%;\n position: absolute;\n top: 0;\n border: 0;\n }\n}\n","import { Component, h, Prop } from '@stencil/core';\nimport { Element, Host, State } from '@stencil/core/internal';\n\n@Component({\n shadow: true,\n styleUrl: 'zonos-collapse.scss',\n tag: 'zonos-collapse',\n})\nexport class ZonosCollapse {\n /**\n * Collapsed state of the element\n */\n @Prop() collapsed: boolean = false;\n /**\n * Collapsed size when collapsed\n */\n @Prop() collapseSize: number = 0;\n\n @Element() el!: HTMLZonosCollapseElement;\n\n @State() height: number = this.el.scrollHeight;\n\n private getElementHeight() {\n const fullHeight = `${this.height}px`;\n const collapsedHeight = `${this.collapseSize}px`;\n return this.collapsed ? collapsedHeight : fullHeight;\n }\n\n componentDidLoad() {\n this.height = this.el.scrollHeight;\n }\n\n componentDidRender() {\n this.el.shadowRoot\n ?.querySelector('iframe')\n ?.contentWindow?.addEventListener('resize', () => {\n this.height = this.el.scrollHeight;\n });\n }\n\n render() {\n this.height = this.el.scrollHeight;\n return (\n <Host\n class={'zonos--elements zonos--collapse'}\n style={{\n height: this.getElementHeight(),\n }}\n >\n <div>\n <iframe\n class=\"height-change-listener\"\n tabindex=\"-1\"\n title=\"collapse-height-change-listener\"\n ></iframe>\n <slot />\n </div>\n </Host>\n );\n }\n}\n",":host {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n .zonos--title {\n margin-bottom: $amino-space-20;\n }\n .zonos--link-authentication {\n margin-bottom: $amino-space-32;\n }\n\n .zonos--group {\n margin-bottom: $amino-space-20;\n overflow: auto;\n padding: 0 5px;\n\n @include zonos--scrollbar;\n }\n\n zonos-button {\n width: 100%;\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport {\n type ContactOption,\n stripeStore,\n} from 'src/components/store/checkout/stripe';\nimport { translate } from 'src/components/store/translationStore';\nimport { submitGtag } from 'src/components/utils/submitGtag';\n\n@Component({\n /**\n * Use `scope` here just because this component is `zonos-address` which is using stripe elements and stripe\n * need to be able to inject iframe into this component from the DOM\n */\n scoped: true,\n styleUrl: 'zonos-customer-info.scss',\n tag: 'zonos-customer-info',\n})\nexport class ZonosCustomerInfo {\n /**\n * Whether or not the continue button is loading\n */\n @Prop() continueLoading: boolean = false;\n\n /**\n * Whether or not the checkout is in mobile mode\n */\n @Prop() submitBtnType?: HTMLZonosButtonElement['variant'];\n\n /**\n * Submit button main color\n */\n @Prop() submitBtnColor?: string;\n\n /**\n * Default address to use for the checkout (preview mode)\n */\n @Prop() defaultAddress: ContactOption | null = null;\n\n /**\n * Event to emit when the continue button is clicked\n */\n @Event() continueClicked!: EventEmitter<void>;\n\n /**\n * Whether or not the continue button is disabled\n * @default true\n */\n @State() disabled: boolean = true;\n\n @Watch('disabled')\n watchFormComplete() {\n if (!this.disabled) {\n // submit google tag when the form is complete\n submitGtag('zonos-checkout-customer-info');\n }\n }\n\n /**\n * handler for continue button click\n */\n private continueClickHandler = () => {\n this.continueClicked.emit();\n };\n\n render() {\n if (!stripeStore.stripeElements) {\n return null;\n }\n // make sure data is valid\n this.disabled =\n !stripeStore.stripeAddressEventData?.complete ||\n !stripeStore.stripeLinkEventData?.complete;\n\n return (\n <Host class=\"zonos--customer-info zonos--elements\">\n <div class=\"zonos--group\">\n <zonos-text class=\"zonos--title\" type=\"semiBoldSubheader\">\n {translate('Customer information')}\n </zonos-text>\n <zonos-link-authentication\n titleText={translate('Contact')}\n ></zonos-link-authentication>\n <zonos-address\n defaultAddress={this.defaultAddress}\n titleText={translate('Address')}\n type=\"shipping\"\n ></zonos-address>\n </div>\n <zonos-button\n backgroundColor={this.submitBtnColor}\n isDisabled={this.disabled}\n loading={this.continueLoading}\n onClick={() => this.continueClickHandler()}\n size=\"lg\"\n // use primary type when on mobile mode\n variant={this.submitBtnType}\n >\n {translate('Continue to shipping')}\n </zonos-button>\n </Host>\n );\n }\n}\n","$border-radius: var(--border-radius, $amino-radius-10);\n$height: var(--height, auto);\n$width: var(--width, auto);\n\n:host {\n .zonos--backdrop,\n .zonos--dialog-layout {\n opacity: 0;\n z-index: -999;\n visibility: hidden;\n transition: 0.3s all ease;\n }\n // close by default\n .zonos--backdrop {\n width: 100vw;\n height: 100vh;\n left: 0px;\n top: 0px;\n background: $amino-backdrop-color;\n z-index: -999;\n opacity: 0;\n visibility: hidden;\n position: fixed;\n }\n .zonos--loading {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1002;\n background: white;\n }\n\n // close by default\n .zonos--dialog-layout {\n width: 100vw;\n height: 100vh;\n left: 0;\n top: 0;\n position: fixed;\n display: flex;\n justify-content: center;\n align-items: center;\n color: $amino-text-color;\n visibility: hidden;\n }\n\n .zonos--dialog {\n position: relative;\n z-index: 1001;\n background: $amino-gray-0;\n max-width: calc(90vw);\n max-height: 90vh;\n min-height: 500px;\n height: $height;\n width: $width;\n border-radius: $border-radius;\n outline: none;\n box-shadow: $amino-v3-shadow-xxl;\n border: $amino-border;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n }\n\n .zonos--header {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: $amino-space-16 $amino-space-24;\n\n .-zonos-stencil-library--header-text {\n flex-grow: 1;\n }\n\n .zonos--close-button {\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 border-radius: $amino-radius-10;\n &:hover {\n background: $amino-hover-color;\n }\n }\n }\n\n .zonos--body {\n padding: $amino-space-8 $amino-space-24;\n max-height: 100%;\n height: 100%;\n overflow: auto;\n &.zonos--no-body-padding {\n padding: 0;\n }\n }\n\n .zonos--footer {\n padding: $amino-space-16 $amino-space-24;\n }\n}\n\n:host(.open) {\n .zonos--dialog-layout,\n .zonos--backdrop {\n visibility: visible;\n }\n .zonos--backdrop {\n z-index: 1001;\n opacity: 0.65;\n }\n .zonos--dialog-layout {\n opacity: 1;\n z-index: 1002;\n transform: scale(1);\n }\n}\n\n:host(.no-border) {\n .zonos--dialog {\n border: none;\n }\n}\n\n:host(.mobile) {\n .zonos--dialog {\n max-width: 100vw;\n max-height: 100vh;\n height: 100%;\n width: 100%;\n border-radius: 0;\n box-shadow: none;\n border: none;\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Listen,\n Prop,\n State,\n} from '@stencil/core';\n\nimport { classes } from 'src/components/utils/classes';\nimport { getBorderRadius } from 'src/components/utils/getBorderRadius';\nimport type { ElementsUiStyle } from 'src/types';\n\n/** These assets neet to be in relative path as https://www.npmjs.com/package/stencil-inline-svg suggested */\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-dialog.scss',\n tag: 'zonos-dialog',\n})\nexport class ZonosDialog {\n /**\n * Whether or not the dialog is open\n * @default false\n */\n @Prop() open: boolean = false;\n /**\n * The header text for the dialog\n */\n @Prop() headerText: string = '';\n /**\n * The width of the dialog\n * @default 460px\n */\n @Prop() width: string = '460px';\n /**\n * The height of the dialog (max-wdith still 90vh)\n */\n @Prop() height?: string;\n /**\n * Whether or not to show the header\n * @default false\n */\n @Prop() noHeader: boolean = false;\n\n /**\n * Whether or not to have body padding\n * @default false\n */\n @Prop() noBodyPadding: boolean = false;\n\n /**\n * Whether or not to have body padding\n * @default false\n */\n @Prop() noBorder: boolean = false;\n\n /**\n * The right area for the action in the footer\n * @default null\n */\n @Prop() footerRightAction: HTMLElement | null = null;\n\n /**\n * The border style of the button\n * @default ROUNDED\n */\n @Prop() borderStyle?: ElementsUiStyle;\n\n /**\n * Close dialog button click\n */\n // @Prop() onCloseDialog!: () => void;\n\n /**\n * Whether or not to show the close button\n * @default false\n */\n @Prop() noCloseButton: boolean = false;\n\n /**\n * Whether or not to close the dialog when clicking outside of it\n * @default false\n */\n @Prop() noClickOutside: boolean = false;\n\n /**\n * Flag to determine if the checkout is on mobile\n */\n @Prop() mobile: boolean = false;\n\n /**\n * Load loading spinner for the dialog or not\n */\n @Prop() isLoading: boolean = true;\n\n @State() isMobile: boolean = false;\n\n /**\n * Close dialog button click\n */\n @Event() closeDialog!: EventEmitter<void>;\n\n @Listen('resize', { target: 'window' })\n handleWindowResize() {\n this.isMobile = this.isMobileMode();\n }\n\n private isMobileMode = () => {\n return this.mobile || window.innerWidth <= 768;\n };\n\n private closeButtonHandler = () => {\n this.closeDialog.emit();\n };\n\n private clickOutsideDialogHandler = (event: MouseEvent) => {\n if (event.target === event.currentTarget && !this.noClickOutside) {\n this.closeDialog.emit();\n }\n };\n\n componentDidLoad() {\n this.isMobile = this.isMobileMode();\n }\n\n render() {\n // disable scroll on the body when dialog is open\n if (this.open) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = 'auto';\n }\n\n const borderStyle = getBorderRadius(this.borderStyle);\n return (\n <Host\n class={classes([\n 'zonos--elements',\n this.open && 'open',\n this.isLoading && 'is-loading',\n this.noBorder && 'no-border',\n this.isMobile && 'mobile',\n ])}\n style={{\n '--border-radius': borderStyle,\n '--height': this.height || 'initial',\n '--width': this.width,\n }}\n >\n <div class=\"zonos--backdrop\"></div>\n <div\n aria-hidden=\"true\"\n class=\"zonos--dialog-layout\"\n onClick={this.clickOutsideDialogHandler}\n >\n <div class=\"zonos--dialog\">\n {this.isLoading && (\n <div class=\"zonos--loading\">\n <zonos-spinner size={30}></zonos-spinner>\n </div>\n )}\n {(this.headerText || !this.noCloseButton) && (\n <div class=\"zonos--header\">\n {this.headerText && (\n <h3 class=\"zonos--header-text\">{this.headerText}</h3>\n )}\n {!this.noCloseButton && (\n <zonos-button\n class=\"zonos--close-button\"\n icon={<zonos-icon content={RemoveIcon}></zonos-icon>}\n noBackground\n onClick={this.closeButtonHandler}\n ></zonos-button>\n )}\n </div>\n )}\n <div\n class={classes([\n 'zonos--body',\n this.noBodyPadding && 'zonos--no-body-padding',\n ])}\n >\n <slot />\n </div>\n {this.footerRightAction && (\n <div class=\"zonos--footer\">\n <div class=\"zonos--footer-right-action\">\n {this.footerRightAction}\n </div>\n </div>\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n","$filter-color: var(--filter-color);\n$width: var(--width);\n\n:host {\n display: inline-flex;\n img {\n filter: $filter-color;\n width: $width;\n }\n}\n","import { Component, getAssetPath, h, Host, Prop } from '@stencil/core';\n\nimport { classes } from 'src/components/utils/classes';\nimport type { ElementsUiTheme } from 'src/types';\n\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-logo.scss',\n tag: 'zonos-logo',\n})\nexport class ZonosLogo {\n /**\n * Theme to change the color of the logo\n */\n @Prop() theme: ElementsUiTheme = 'LIGHT';\n\n /**\n * The width of the logo\n */\n @Prop() width: string = 'auto';\n\n /**\n * css class for the component\n */\n @Prop() class: string = '';\n\n render() {\n const filterColor =\n this.theme === 'DARK'\n ? 'invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)'\n : 'whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)';\n\n return (\n <Host\n class={classes(['zonos--elements zonos--logo', this.class])}\n style={{\n '--filter-color': filterColor,\n '--width': this.width,\n }}\n >\n <img alt=\"Zonos Logo\" src={getAssetPath('./assets/ZonosLogo.png')} />\n </Host>\n );\n }\n}\n",":host {\n .zonos--total-pay {\n margin: $amino-space-16 0 $amino-space-32;\n }\n}\n\n:host(.mobile) {\n @include checkout-review-mobile;\n}\n","import { Component, h, Host, Listen, Prop, State } from '@stencil/core';\n\nimport { cartStore } from 'src/components/store/checkout/cart';\nimport { translate } from 'src/components/store/translationStore';\nimport { zonosStore } from 'src/components/store/zonosStore';\nimport { isCheckoutMobile } from 'src/components/utils/checkout/isCheckoutMobile';\nimport { classes } from 'src/components/utils/classes';\nimport { formatCurrency } from 'src/components/utils/formatCurrency';\n\n/** These assets neet to be in relative path as https://www.npmjs.com/package/stencil-inline-svg suggested */\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport ChevronDownIcon from './assets/ChevronDownIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport ChevronUpIcon from './assets/ChevronUpIcon.svg';\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-review.scss',\n tag: 'zonos-review',\n})\nexport class ZonosReview {\n /**\n * Whether or not the component is being rendered with mobile styles\n */\n @Prop() mobile: boolean = false;\n\n /**\n * Whether or not to show the collapse icon\n * This is controled from the collapsed state of the zonos-collapse component\n * to show the collapse icon\n */\n @Prop() collapsed: boolean = false;\n\n @State() isMobile: boolean = false;\n\n @Listen('resize', { target: 'window' })\n handleWindowResize() {\n this.isMobile = isCheckoutMobile(this.mobile);\n }\n\n componentWillLoad() {\n this.isMobile = isCheckoutMobile(this.mobile);\n }\n\n render() {\n const titleTextType = this.isMobile ? 'boldSubheader' : 'semiBoldLabel';\n const totalTextType = this.isMobile\n ? 'boldSubheader'\n : 'secondaryPageHeader';\n\n const titleTextColor = this.isMobile ? 'gray-1200' : 'gray-800';\n const totalWithoutTaxes = cartStore.total - cartStore.dutiesTaxFees;\n const renderCollapseIcon = () => {\n // only display the collapse icon if the component is being rendered with mobile styles\n if (!this.isMobile) {\n return null;\n }\n\n if (!this.collapsed) {\n return (\n <zonos-icon color=\"gray-1200\" content={ChevronDownIcon}></zonos-icon>\n );\n }\n return (\n <zonos-icon color=\"gray-1200\" content={ChevronUpIcon}></zonos-icon>\n );\n };\n return (\n <Host\n class={classes([\n 'zonos--review zonos--elements',\n this.isMobile && 'mobile',\n ])}\n >\n <div class=\"zonos--title\">\n <zonos-text color={titleTextColor} type={titleTextType}>\n {translate('Pay')} {zonosStore.organizationName}\n </zonos-text>\n {renderCollapseIcon()}\n </div>\n <div class=\"zonos--total-pay\">\n <zonos-text type={totalTextType}>\n {formatCurrency({\n amount:\n // show total without taxes when step is shipping, show total with taxes when step is payment\n cartStore.step === 'shipping'\n ? totalWithoutTaxes\n : cartStore.total,\n currency: cartStore.currency,\n })}\n </zonos-text>\n </div>\n </Host>\n );\n }\n}\n",":host {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n .zonos--title {\n margin-bottom: $amino-space-24;\n }\n .zonos--shipping-method-title {\n margin-bottom: $amino-space-16;\n }\n\n .zonos-shipping-rich-radio {\n margin-bottom: $amino-space-24;\n }\n\n .zonos--group {\n margin-bottom: $amino-space-20;\n overflow: auto;\n padding-right: 5px;\n\n @include zonos--scrollbar;\n }\n\n zonos-button {\n width: 100%;\n }\n zonos-banner {\n margin-top: $amino-space-24;\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport {\n cartStore,\n cartStoreGetShippingTransitInfo,\n cartStoreUpdateSelectedShippingOption,\n} from 'src/components/store/checkout/cart';\nimport { stripeStore } from 'src/components/store/checkout/stripe';\nimport { translate } from 'src/components/store/translationStore';\nimport { formatCurrency } from 'src/components/utils/formatCurrency';\nimport { submitGtag } from 'src/components/utils/submitGtag';\nimport type { ShippingRichRadioItem } from 'src/types';\n\n@Component({\n /**\n * Use `scope` here just because this component is `zonos-address` which is using stripe elements and stripe\n * need to be able to inject iframe into this component from the DOM\n */\n scoped: true,\n styleUrl: 'zonos-shipping.scss',\n tag: 'zonos-shipping',\n})\nexport class ZonosShipping {\n /**\n * Whether or not the continue button is loading\n */\n @Prop() continueLoading: boolean = false;\n\n /**\n * Submit button main color\n */\n @Prop() submitBtnColor?: string;\n\n /**\n * Whether or not the checkout is in mobile mode\n */\n @Prop() submitBtnType?: HTMLZonosButtonElement['variant'];\n\n /**\n * Event to emit when the continue button is clicked\n */\n @Event() continueClicked!: EventEmitter<void>;\n\n @State() selectedShippingMethod: ShippingRichRadioItem | null = null;\n\n /**\n * Whether or not the continue button is disabled\n * @default true\n */\n @State() disabled: boolean = true;\n\n @Watch('disabled')\n watchFormComplete() {\n if (!this.disabled) {\n // submit google tag when the form is complete\n submitGtag('zonos-checkout-shipping-info');\n }\n }\n\n private handleRadioSelected = async (\n e: CustomEvent<ShippingRichRadioItem>,\n ) => {\n this.selectedShippingMethod = e.detail;\n if (!this.selectedShippingMethod) {\n return;\n }\n\n const selectedShippingOption =\n cartStore.shippingData?.find(\n item => item.id === this.selectedShippingMethod?.value,\n ) || null;\n if (!selectedShippingOption) {\n return;\n }\n\n // save selected shipping option to store\n const updateStatus = await cartStoreUpdateSelectedShippingOption(\n selectedShippingOption,\n );\n if (!updateStatus) {\n return;\n }\n\n this.disabled = false;\n };\n\n /**\n * handler for continue button click\n */\n private continueClickHandler = () => {\n this.continueClicked.emit();\n };\n\n render() {\n const shipToCountry =\n stripeStore.stripeAddressEventData?.value.address.country;\n\n const serviceLevels = cartStore.shippingData?.flatMap(\n (item): ShippingRichRadioItem => {\n const { expectedDate, maxTransit, minTransit } =\n cartStoreGetShippingTransitInfo(item);\n const sublabel = expectedDate\n ? `${translate('Expected delivery')} ${expectedDate}`\n : '';\n const caption =\n minTransit && maxTransit\n ? `(${minTransit}-${maxTransit} ${translate('business days')})`\n : '';\n const shippingAmount =\n cartStore.landedCostData?.find(\n landedCostItem =>\n landedCostItem.landedCost?.shipmentRating.id === item.id,\n )?.subtotals.shipping || 0;\n return {\n caption,\n label: item.displayName,\n price: formatCurrency({\n amount: shippingAmount,\n currency: cartStore.currency,\n }),\n sublabel,\n value: item.id,\n };\n },\n );\n return (\n <Host class=\"zonos--shipping zonos--elements\">\n <div class=\"zonos--group\">\n <zonos-text class=\"zonos--title\" type=\"semiBoldSubheader\">\n {translate('Shipping information')}\n </zonos-text>\n <zonos-text class=\"zonos--shipping-method-title\" type=\"semiBoldLabel\">\n {translate('Shipping method')}\n </zonos-text>\n {!serviceLevels?.length ? (\n <zonos-banner\n bannerTitle=\"No shipping methods found - try editing your address or contacting support if the error persists\"\n intent=\"error\"\n ></zonos-banner>\n ) : (\n <zonos-shipping-rich-radio\n items={serviceLevels || []}\n onRadioSelected={e => this.handleRadioSelected(e)}\n ></zonos-shipping-rich-radio>\n )}\n\n {cartStore.isSelectedShippingAboveDeminimis && (\n <zonos-banner intent=\"warning\">\n {translate('Above de minimis threshold for')} {shipToCountry}.{' '}\n {translate(\n 'Duties and taxes will be applied to items and shipping.',\n )}\n </zonos-banner>\n )}\n </div>\n <zonos-button\n backgroundColor={this.submitBtnColor}\n is-disabled={this.disabled}\n loading={this.continueLoading}\n onClick={() => this.continueClickHandler()}\n size=\"lg\"\n // use primary type when on mobile mode\n variant={this.submitBtnType}\n >\n {translate('Go to payment')}\n </zonos-button>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"zonos-cart-items.zonos-cart-subtotal.zonos-checkout-finish.zonos-checkout-payment.zonos-collapse.zonos-customer-info.zonos-dialog.zonos-logo.zonos-review.zonos-shipping.entry.js","mappings":";;;;;;;;;AAAO,MAAM,cAAc,GAAG,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,gBAAgB,GAKjB,KACC,gBAAgB;IACZ,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IAChC,QAAQ;IACR,KAAK,EAAE,UAAU;GAClB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,QAAQ,EAAE;IAC/B,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;IAC7B,QAAQ;IACR,KAAK,EAAE,UAAU;GAClB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;;ACjBvB,MAAM,iBAAiB,GAAG,yoBAAyoB;;MCWtpB,cAAc;;;uBACQ,EAAE;;EAEnC,MAAM;;IACJ,MAAM,YAAY,GAAG,YAAY,CAAC,0BAA0B,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,CAAA,MAAA,SAAS,CAAC,YAAY,0CAAE,IAAI,KAAI,CAAC,CAAC;IAC/C,QACE,EAAC,IAAI,IAAC,KAAK,EAAC,mCAAmC,IAC7C,aAAO,KAAK,EAAC,mBAAmB,IAC9B,iBACG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI;MACvB,MAAM,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,OAAO,EAAE,IAAI,CAAC,eAAe,EAC7B,OAAO,EAAE,MAAM,IAAI,CAAC,oBAAoB,EAAE,EAC1C,IAAI,EAAC,IAAI;;MAET,OAAO,EAAE,IAAI,CAAC,aAAa,IAE1B,SAAS,CAAC,eAAe,CAAC,CACd,CACV,EACP;GACH;;;;;;;;;","names":["RemoveIcon"],"sources":["src/components/utils/formatCurrency.ts","src/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.scss?tag=zonos-cart-items&encapsulation=shadow","src/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.tsx","src/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.scss?tag=zonos-cart-subtotal&encapsulation=shadow","src/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.tsx","src/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.scss?tag=zonos-checkout-finish&encapsulation=shadow","src/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.tsx","src/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.scss?tag=zonos-checkout-payment&encapsulation=scoped","src/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.tsx","src/components/common/zonos-collapse/zonos-collapse.scss?tag=zonos-collapse&encapsulation=shadow","src/components/common/zonos-collapse/zonos-collapse.tsx","src/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.scss?tag=zonos-customer-info&encapsulation=scoped","src/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.tsx","src/components/common/zonos-dialog/zonos-dialog.scss?tag=zonos-dialog&encapsulation=shadow","src/components/common/zonos-dialog/zonos-dialog.tsx","src/components/common/zonos-logo/zonos-logo.scss?tag=zonos-logo&encapsulation=shadow","src/components/common/zonos-logo/zonos-logo.tsx","src/components/checkout/zonos-checkout/zonos-review/zonos-review.scss?tag=zonos-review&encapsulation=shadow","src/components/checkout/zonos-checkout/zonos-review/zonos-review.tsx","src/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.scss?tag=zonos-shipping&encapsulation=scoped","src/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.tsx"],"sourcesContent":["export const formatCurrency = ({\n amount,\n currency,\n showCurrencyText,\n}: {\n amount: number;\n currency: string;\n showCurrencyText?: boolean;\n}) =>\n showCurrencyText\n ? `${new Intl.NumberFormat('en-US', {\n currency,\n style: 'currency',\n }).format(amount)} ${currency}`\n : new Intl.NumberFormat('en-US', {\n currency,\n style: 'currency',\n }).format(amount);\n",":host {\n .zonos--cart-table {\n width: 100%;\n border: none;\n border-collapse: collapse;\n overflow: auto;\n font-size: $amino-font-size-base;\n .zonos--column {\n padding: $amino-space-8;\n font-size: $amino-font-size-base;\n &:last-child {\n text-align: right;\n }\n &:first-child {\n width: 60px;\n }\n }\n }\n img {\n min-width: 40px;\n }\n}\n","import { Component, getAssetPath, h, Host, State } from '@stencil/core';\n\nimport { cartStore } from 'src/components/store/checkout/cart';\nimport { formatCurrency } from 'src/components/utils/formatCurrency';\n\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-cart-items.scss',\n tag: 'zonos-cart-items',\n})\nexport class ZonosCartItems {\n @State() errorImages: string[] = [];\n\n render() {\n const emptyItemImg = getAssetPath('./assets/empty-item.jpeg');\n const rate = cartStore.exchangeRate?.rate || 1;\n return (\n <Host class=\"zonos--cart-items zonos--elements\">\n <table class=\"zonos--cart-table\">\n <tbody>\n {cartStore.items.map(item => {\n const itemImg = item.imageUrl;\n return (\n <tr class=\"zonos--cart-item\">\n <td class=\"zonos--column zonos--cart-item-image\">\n {itemImg && !this.errorImages.includes(itemImg) ? (\n <img\n alt={item.name}\n onError={() => {\n this.errorImages = [...this.errorImages, itemImg];\n }}\n src={item.imageUrl}\n style={{\n 'min-width': '40px',\n }}\n width={40}\n />\n ) : (\n <img alt={item.name} src={emptyItemImg} width={40} />\n )}\n </td>\n <td class=\"zonos--column zonos--cart-item-name\">\n <zonos-text type=\"label\">{item.name}</zonos-text>\n </td>\n <td class=\"zonos--column zonos--cart-item-price\">\n <zonos-text type=\"semiBoldLabel\">\n {formatCurrency({\n amount: item.amount * item.quantity * rate,\n currency: cartStore.currency,\n })}\n </zonos-text>\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n </Host>\n );\n }\n}\n",":host {\n .zonos--cart-table {\n width: 100%;\n border: none;\n border-collapse: collapse;\n overflow: auto;\n font-size: $amino-font-size-base;\n .zonos--column {\n padding: $amino-space-20 $amino-space-8;\n vertical-align: top;\n &:last-child {\n text-align: right;\n }\n &:first-child {\n width: 60px;\n }\n }\n }\n .zonos--title-with-icon {\n display: flex;\n align-items: center;\n gap: $amino-space-8;\n }\n .zonos--cart-subtotal-title,\n .zonos--cart-subtotal-price {\n border-bottom: 1px solid $amino-gray-200;\n }\n\n .zonos--cart-subtotal-price {\n text-align: right;\n }\n}\n","import { Component, Fragment, h, Host } from '@stencil/core';\n\nimport { cartStore } from 'src/components/store/checkout/cart';\nimport { translate } from 'src/components/store/translationStore';\nimport { formatCurrency } from 'src/components/utils/formatCurrency';\n\n// These assets neet to be in relative path as https://www.npmjs.com/package/stencil-inline-svg suggested\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport InfoIcon from './assets/InfoIcon.svg';\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-cart-subtotal.scss',\n tag: 'zonos-cart-subtotal',\n})\nexport class ZonosCartSubtotal {\n render() {\n const totalWithoutTaxes = cartStore.total - cartStore.dutiesTaxFees;\n const renderShippingInfo = () => {\n if (!cartStore.selectedShippingOption) {\n return (\n <>\n <zonos-text class=\"zonos--title\" type=\"semiBoldLabel\">\n {translate('Shipping')}\n </zonos-text>\n <zonos-text class=\"zonos--caption\" type=\"caption\">\n {translate('No shipping method selected')}\n </zonos-text>\n </>\n );\n }\n return (\n <>\n <zonos-text class=\"zonos--title\" type=\"semiBoldLabel\">\n {cartStore.selectedShippingOption.displayName}\n </zonos-text>\n {cartStore.selectedShippingOptionTransitTime && (\n <zonos-text class=\"zonos--caption\" type=\"caption\">\n {cartStore.selectedShippingOptionTransitTime}{' '}\n {translate('business days')}\n </zonos-text>\n )}\n </>\n );\n };\n return (\n <Host class=\"zonos--cart-subtotal zonos--elements\">\n <table class=\"zonos--cart-table\">\n <tr class=\"zonos--row zonos--cart-subtotal\">\n <td class=\"zonos--column\"></td>\n <td class=\"zonos--column zonos--cart-subtotal-title\">\n <zonos-text type=\"semiBoldLabel\">\n {translate('Cart subtotal')}\n </zonos-text>\n </td>\n <td class=\"zonos--column zonos--cart-subtotal-price\">\n <zonos-text type=\"semiBoldLabel\">\n {formatCurrency({\n amount: cartStore.subtotal,\n currency: cartStore.currency,\n })}\n </zonos-text>\n </td>\n </tr>\n <tr class=\"zonos--row zonos--cart-shipping\">\n <td class=\"zonos--column\"></td>\n <td class=\"zonos--column zonos--cart-subtotal-title\">\n {renderShippingInfo()}\n </td>\n <td class=\"zonos--column zonos--cart-subtotal-price\">\n {cartStore.shipping\n ? formatCurrency({\n amount: cartStore.shipping,\n currency: cartStore.currency,\n })\n : '-'}\n </td>\n </tr>\n {/* Only show fee row when step is payment */}\n {cartStore.step === 'payment' && (\n <tr class=\"zonos--row zonos--cart-duties\">\n <td class=\"zonos--column\"></td>\n <td class=\"zonos--column zonos--cart-subtotal-title\">\n <div class=\"zonos--title-with-icon\">\n <zonos-text class=\"zonos--title\" type=\"semiBoldLabel\">\n {translate('Duties, taxes, and fees')}\n </zonos-text>\n <zonos-icon content={InfoIcon} size={16}></zonos-icon>\n </div>\n {!!cartStore.isSelectedShippingAboveDeminimis && (\n <zonos-text color=\"gray-800\" type=\"body\">\n {translate(\n 'Order is over the de minimis threshold for both duty and tax',\n )}\n </zonos-text>\n )}\n </td>\n <td class=\"zonos--column zonos--cart-subtotal-price\">\n {cartStore.dutiesTaxFees\n ? formatCurrency({\n amount: cartStore.dutiesTaxFees,\n currency: cartStore.currency,\n })\n : '-'}\n {cartStore.isSelectedShippingGuarantee && (\n <zonos-badge>{translate('Guaranteed')}</zonos-badge>\n )}\n </td>\n </tr>\n )}\n <tr class=\"zonos--row zonos--cart-pay-total\">\n <td class=\"zonos--column\"></td>\n <td class=\"zonos--column\">\n <zonos-text class=\"zonos--title\" type=\"semiBoldLabel\">\n {translate('Order total')}\n </zonos-text>\n </td>\n <td class=\"zonos--column\">\n <zonos-text type=\"semiBoldLabel\">\n {formatCurrency({\n amount:\n // show total without taxes when step is shipping, show total with taxes when step is payment\n cartStore.step === 'shipping'\n ? totalWithoutTaxes\n : cartStore.total,\n currency: cartStore.currency,\n })}\n </zonos-text>\n </td>\n </tr>\n </table>\n </Host>\n );\n }\n}\n","$border-radius: var(--border-radius, 10px);\n\n:host {\n display: flex;\n flex-direction: column;\n .zonos--group {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n margin-bottom: $amino-space-24;\n border-radius: $border-radius;\n gap: $amino-space-24;\n max-width: 360px;\n width: auto;\n margin: auto;\n margin-top: $amino-space-24;\n background-color: $amino-gray-50;\n padding: $amino-space-20;\n }\n zonos-button {\n width: 100%;\n }\n .loading-wrapper {\n min-height: 300px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n Fragment,\n h,\n Host,\n Prop,\n State,\n} from '@stencil/core';\nimport type { PaymentIntent } from '@stripe/stripe-js';\n\nimport {\n stripeStore,\n stripeStoreReset,\n stripeStoreRetrievePayment,\n} from 'src/components/store/checkout/stripe';\nimport { translate } from 'src/components/store/translationStore';\nimport { getBorderRadius } from 'src/components/utils/getBorderRadius';\nimport { submitGtag } from 'src/components/utils/submitGtag';\nimport type { ElementsUiStyle } from 'src/types';\n\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport RemoveIcon from './assets/RemoveIcon.svg';\n/* Need to use relative import because inline-svg-stencil couldn't resolve absolute path */\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport SuccessIcon from './assets/SuccessIcon.svg';\n\ntype OverrideNotification = {\n messages: string[];\n title: string;\n type: 'success' | 'error';\n};\n\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-checkout-finish.scss',\n tag: 'zonos-checkout-finish',\n})\nexport class ZonosCheckoutFinish {\n /**\n * The border radius style of the dialog\n */\n @Prop() borderRadius: ElementsUiStyle = 'ROUNDED';\n\n /**\n * Force status to test the UI for storybook\n */\n @Prop() storybookForceStatus?: PaymentIntent['status'];\n\n /**\n * Override the notification message and title, bypass checking stripe payment status\n *\n */\n @Prop() overrideNotification?: OverrideNotification;\n\n /**\n * Event to emit when the continue button is clicked\n */\n @Event() closeClick!: EventEmitter<void>;\n\n @State() isLoading: boolean = true;\n @State() notificationType: 'success' | 'error' = 'success';\n @State() notificationTitle: string = '';\n @State() notificationMessages: string[] = [];\n\n private checkPaymentStatus = async () => {\n this.isLoading = true;\n const clientSecret =\n new URLSearchParams(window.location.search).get(\n 'payment_intent_client_secret',\n ) || stripeStore.clientSecret;\n if (clientSecret || this.storybookForceStatus) {\n const { error, messages } = await stripeStoreRetrievePayment({\n clientSecret,\n storybookForceStatus: this.storybookForceStatus,\n });\n this.notificationType = error ? 'error' : 'success';\n this.notificationMessages = messages || [];\n this.notificationTitle = error\n ? translate('Payment failed')\n : translate(\"You're all set!\");\n\n if (error) {\n submitGtag('zonos-checkout-payment-fail');\n } else {\n submitGtag('zonos-checkout-success');\n }\n }\n stripeStoreReset();\n this.isLoading = false;\n };\n\n private closeClickHandler = () => {\n this.closeClick.emit();\n };\n\n componentDidLoad() {\n if (this.overrideNotification) {\n // just show the notification and don't check any of the payment status\n this.notificationType = this.overrideNotification.type;\n this.notificationTitle = this.overrideNotification.title;\n this.notificationMessages = this.overrideNotification.messages;\n return;\n }\n void this.checkPaymentStatus();\n }\n\n render() {\n return (\n <Host\n class=\"zonos--checkout-finish zonos--elements\"\n style={{\n '--border-radius': getBorderRadius(this.borderRadius),\n }}\n >\n {this.isLoading && (\n <div class=\"loading-wrapper\">\n <zonos-spinner></zonos-spinner>\n </div>\n )}\n {!this.isLoading && (\n <div class=\"zonos--group\">\n {this.notificationType === 'success' ? (\n <zonos-icon\n color={'blue-800'}\n content={SuccessIcon}\n size={50}\n ></zonos-icon>\n ) : (\n <zonos-icon\n color={'red-800'}\n content={RemoveIcon}\n size={50}\n ></zonos-icon>\n )}\n <zonos-text class=\"zonos--title\" type=\"semiBoldSubheader\">\n {this.notificationTitle}\n </zonos-text>\n <zonos-text>\n {this.notificationMessages.map(message => (\n <>\n {message}\n <br />\n </>\n ))}\n </zonos-text>\n <zonos-button\n onClick={() => this.closeClickHandler()}\n size=\"md\"\n variant=\"primary\"\n >\n {translate('Keep shopping')}\n </zonos-button>\n </div>\n )}\n </Host>\n );\n }\n}\n",":host {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n .zonos--title {\n margin-bottom: $amino-space-24;\n }\n .zonos--group {\n margin-bottom: $amino-space-20;\n overflow: auto;\n padding: 0 5px;\n\n @include zonos--scrollbar;\n }\n\n .zonos--payment-error-banner {\n margin-bottom: $amino-space-8;\n }\n\n zonos-button {\n width: 100%;\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport { cartStore } from 'src/components/store/checkout/cart';\nimport { stripeStore } from 'src/components/store/checkout/stripe';\nimport { translate } from 'src/components/store/translationStore';\nimport { formatCurrency } from 'src/components/utils/formatCurrency';\nimport { submitGtag } from 'src/components/utils/submitGtag';\n\n@Component({\n /**\n * Use `scope` here just because this component is `zonos-address` which is using stripe elements and stripe\n * need to be able to inject iframe into this component from the DOM\n */\n scoped: true,\n styleUrl: 'zonos-checkout-payment.scss',\n tag: 'zonos-checkout-payment',\n})\nexport class ZonosCheckoutPayment {\n /**\n * Error occurred during payment\n */\n @Prop() paymentError: boolean = false;\n\n /**\n * Whether or not the checkout is in mobile mode\n */\n @Prop() submitBtnType?: HTMLZonosButtonElement['variant'];\n\n /**\n * Whether or not the continue button is loading\n */\n @Prop() continueLoading: boolean = false;\n\n /**\n * Submit button main color\n */\n @Prop() submitBtnColor?: string;\n\n /**\n * Event to emit when the continue button is clicked\n */\n @Event() continueClicked!: EventEmitter<void>;\n\n /**\n * Whether or not the continue button is disabled\n * @default true\n */\n @State() disabled: boolean = true;\n\n @Watch('disabled')\n watchFormComplete() {\n if (!this.disabled) {\n // submit google tag when the form is complete\n submitGtag('zonos-checkout-payment-info');\n }\n }\n\n /**\n * handler for continue button click\n */\n private continueClickHandler = () => {\n this.continueClicked.emit();\n };\n\n render() {\n if (!stripeStore.stripeElements) {\n return null;\n }\n\n this.disabled = !stripeStore.stripePaymentEventData?.complete;\n\n return (\n <Host class=\"zonos--checkout-payment zonos--elements\">\n <div class=\"zonos--group\">\n <zonos-text class=\"zonos--title\" type=\"semiBoldSubheader\">\n {translate('Payment method')}\n </zonos-text>\n {this.paymentError && (\n <zonos-banner class=\"zonos--payment-error-banner\" intent=\"error\">\n {translate(\n \"We couldn't complete your payment. Please verify the payment details and try again.\",\n )}\n </zonos-banner>\n )}\n <zonos-payment></zonos-payment>\n </div>\n <zonos-button\n backgroundColor={this.submitBtnColor}\n is-disabled={this.disabled}\n loading={this.continueLoading}\n onClick={() => this.continueClickHandler()}\n size=\"lg\"\n // use primary type when on mobile mode\n variant={this.submitBtnType}\n >\n Pay{' '}\n {formatCurrency({\n amount: cartStore.total,\n currency: cartStore.currency,\n })}\n </zonos-button>\n </Host>\n );\n }\n}\n",":host {\n transition: all 0.3s ease-in-out;\n overflow: hidden;\n div {\n position: relative;\n }\n iframe {\n width: 0;\n height: 100%;\n position: absolute;\n top: 0;\n border: 0;\n }\n}\n","import { Component, h, Prop } from '@stencil/core';\nimport { Element, Host, State } from '@stencil/core/internal';\n\n@Component({\n shadow: true,\n styleUrl: 'zonos-collapse.scss',\n tag: 'zonos-collapse',\n})\nexport class ZonosCollapse {\n /**\n * Collapsed state of the element\n */\n @Prop() collapsed: boolean = false;\n /**\n * Collapsed size when collapsed\n */\n @Prop() collapseSize: number = 0;\n\n @Element() el!: HTMLZonosCollapseElement;\n\n @State() height: number = this.el.scrollHeight;\n\n private getElementHeight() {\n const fullHeight = `${this.height}px`;\n const collapsedHeight = `${this.collapseSize}px`;\n return this.collapsed ? collapsedHeight : fullHeight;\n }\n\n componentDidLoad() {\n this.height = this.el.scrollHeight;\n }\n\n componentDidRender() {\n this.el.shadowRoot\n ?.querySelector('iframe')\n ?.contentWindow?.addEventListener('resize', () => {\n this.height = this.el.scrollHeight;\n });\n }\n\n render() {\n this.height = this.el.scrollHeight;\n return (\n <Host\n class={'zonos--elements zonos--collapse'}\n style={{\n height: this.getElementHeight(),\n }}\n >\n <div>\n <iframe\n class=\"height-change-listener\"\n tabindex=\"-1\"\n title=\"collapse-height-change-listener\"\n ></iframe>\n <slot />\n </div>\n </Host>\n );\n }\n}\n",":host {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n .zonos--title {\n margin-bottom: $amino-space-20;\n }\n .zonos--link-authentication {\n margin-bottom: $amino-space-32;\n }\n\n .zonos--group {\n margin-bottom: $amino-space-20;\n overflow: auto;\n padding: 0 5px;\n\n @include zonos--scrollbar;\n }\n\n zonos-button {\n width: 100%;\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport {\n type ContactOption,\n stripeStore,\n} from 'src/components/store/checkout/stripe';\nimport { translate } from 'src/components/store/translationStore';\nimport { submitGtag } from 'src/components/utils/submitGtag';\n\n@Component({\n /**\n * Use `scope` here just because this component is `zonos-address` which is using stripe elements and stripe\n * need to be able to inject iframe into this component from the DOM\n */\n scoped: true,\n styleUrl: 'zonos-customer-info.scss',\n tag: 'zonos-customer-info',\n})\nexport class ZonosCustomerInfo {\n /**\n * Whether or not the continue button is loading\n */\n @Prop() continueLoading: boolean = false;\n\n /**\n * Whether or not the checkout is in mobile mode\n */\n @Prop() submitBtnType?: HTMLZonosButtonElement['variant'];\n\n /**\n * Submit button main color\n */\n @Prop() submitBtnColor?: string;\n\n /**\n * Default address to use for the checkout (preview mode)\n */\n @Prop() defaultAddress: ContactOption | null = null;\n\n /**\n * Event to emit when the continue button is clicked\n */\n @Event() continueClicked!: EventEmitter<void>;\n\n /**\n * Whether or not the continue button is disabled\n * @default true\n */\n @State() disabled: boolean = true;\n\n @Watch('disabled')\n watchFormComplete() {\n if (!this.disabled) {\n // submit google tag when the form is complete\n submitGtag('zonos-checkout-customer-info');\n }\n }\n\n /**\n * handler for continue button click\n */\n private continueClickHandler = () => {\n this.continueClicked.emit();\n };\n\n render() {\n if (!stripeStore.stripeElements) {\n return null;\n }\n // make sure data is valid\n this.disabled =\n !stripeStore.stripeAddressEventData?.complete ||\n !stripeStore.stripeLinkEventData?.complete;\n\n return (\n <Host class=\"zonos--customer-info zonos--elements\">\n <div class=\"zonos--group\">\n <zonos-text class=\"zonos--title\" type=\"semiBoldSubheader\">\n {translate('Customer information')}\n </zonos-text>\n <zonos-link-authentication\n titleText={translate('Contact')}\n ></zonos-link-authentication>\n <zonos-address\n defaultAddress={this.defaultAddress}\n titleText={translate('Address')}\n type=\"shipping\"\n ></zonos-address>\n </div>\n <zonos-button\n backgroundColor={this.submitBtnColor}\n isDisabled={this.disabled}\n loading={this.continueLoading}\n onClick={() => this.continueClickHandler()}\n size=\"lg\"\n // use primary type when on mobile mode\n variant={this.submitBtnType}\n >\n {translate('Continue to shipping')}\n </zonos-button>\n </Host>\n );\n }\n}\n","$border-radius: var(--border-radius, $amino-radius-10);\n$height: var(--height, auto);\n$width: var(--width, auto);\n\n:host {\n .zonos--backdrop,\n .zonos--dialog-layout {\n opacity: 0;\n z-index: -999;\n visibility: hidden;\n transition: 0.3s all ease;\n }\n // close by default\n .zonos--backdrop {\n width: 100vw;\n height: 100vh;\n left: 0px;\n top: 0px;\n background: $amino-backdrop-color;\n z-index: -999;\n opacity: 0;\n visibility: hidden;\n position: fixed;\n }\n .zonos--loading {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1002;\n background: white;\n }\n\n // close by default\n .zonos--dialog-layout {\n width: 100vw;\n height: 100vh;\n left: 0;\n top: 0;\n position: fixed;\n display: flex;\n justify-content: center;\n align-items: center;\n color: $amino-text-color;\n visibility: hidden;\n }\n\n .zonos--dialog {\n position: relative;\n z-index: 1001;\n background: $amino-gray-0;\n max-width: calc(90vw);\n max-height: 90vh;\n min-height: 500px;\n height: $height;\n width: $width;\n border-radius: $border-radius;\n outline: none;\n box-shadow: $amino-v3-shadow-xxl;\n border: $amino-border;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n }\n\n .zonos--header {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n padding: $amino-space-16 $amino-space-24;\n\n .-zonos-stencil-library--header-text {\n flex-grow: 1;\n }\n\n .zonos--close-button {\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 border-radius: $amino-radius-10;\n &:hover {\n background: $amino-hover-color;\n }\n }\n }\n\n .zonos--body {\n padding: $amino-space-8 $amino-space-24;\n max-height: 100%;\n height: 100%;\n overflow: auto;\n &.zonos--no-body-padding {\n padding: 0;\n }\n }\n\n .zonos--footer {\n padding: $amino-space-16 $amino-space-24;\n }\n}\n\n:host(.open) {\n .zonos--dialog-layout,\n .zonos--backdrop {\n visibility: visible;\n }\n .zonos--backdrop {\n z-index: 1001;\n opacity: 0.65;\n }\n .zonos--dialog-layout {\n opacity: 1;\n z-index: 1002;\n transform: scale(1);\n }\n}\n\n:host(.no-border) {\n .zonos--dialog {\n border: none;\n }\n}\n\n:host(.mobile) {\n .zonos--dialog {\n max-width: 100vw;\n max-height: 100vh;\n height: 100%;\n width: 100%;\n border-radius: 0;\n box-shadow: none;\n border: none;\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Listen,\n Prop,\n State,\n} from '@stencil/core';\n\nimport { classes } from 'src/components/utils/classes';\nimport { getBorderRadius } from 'src/components/utils/getBorderRadius';\nimport type { ElementsUiStyle } from 'src/types';\n\n/** These assets neet to be in relative path as https://www.npmjs.com/package/stencil-inline-svg suggested */\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-dialog.scss',\n tag: 'zonos-dialog',\n})\nexport class ZonosDialog {\n /**\n * Whether or not the dialog is open\n * @default false\n */\n @Prop() open: boolean = false;\n /**\n * The header text for the dialog\n */\n @Prop() headerText: string = '';\n /**\n * The width of the dialog\n * @default 460px\n */\n @Prop() width: string = '460px';\n /**\n * The height of the dialog (max-wdith still 90vh)\n */\n @Prop() height?: string;\n /**\n * Whether or not to show the header\n * @default false\n */\n @Prop() noHeader: boolean = false;\n\n /**\n * Whether or not to have body padding\n * @default false\n */\n @Prop() noBodyPadding: boolean = false;\n\n /**\n * Whether or not to have body padding\n * @default false\n */\n @Prop() noBorder: boolean = false;\n\n /**\n * The right area for the action in the footer\n * @default null\n */\n @Prop() footerRightAction: HTMLElement | null = null;\n\n /**\n * The border style of the button\n * @default ROUNDED\n */\n @Prop() borderStyle?: ElementsUiStyle;\n\n /**\n * Close dialog button click\n */\n // @Prop() onCloseDialog!: () => void;\n\n /**\n * Whether or not to show the close button\n * @default false\n */\n @Prop() noCloseButton: boolean = false;\n\n /**\n * Whether or not to close the dialog when clicking outside of it\n * @default false\n */\n @Prop() noClickOutside: boolean = false;\n\n /**\n * Flag to determine if the checkout is on mobile\n */\n @Prop() mobile: boolean = false;\n\n /**\n * Load loading spinner for the dialog or not\n */\n @Prop() isLoading: boolean = true;\n\n @State() isMobile: boolean = false;\n\n /**\n * Close dialog button click\n */\n @Event() closeDialog!: EventEmitter<void>;\n\n @Listen('resize', { target: 'window' })\n handleWindowResize() {\n this.isMobile = this.isMobileMode();\n }\n\n private isMobileMode = () => {\n return this.mobile || window.innerWidth <= 768;\n };\n\n private closeButtonHandler = () => {\n this.closeDialog.emit();\n };\n\n private clickOutsideDialogHandler = (event: MouseEvent) => {\n if (event.target === event.currentTarget && !this.noClickOutside) {\n this.closeDialog.emit();\n }\n };\n\n componentDidLoad() {\n this.isMobile = this.isMobileMode();\n }\n\n render() {\n // disable scroll on the body when dialog is open\n if (this.open) {\n document.body.style.overflow = 'hidden';\n } else {\n document.body.style.overflow = 'auto';\n }\n\n const borderStyle = getBorderRadius(this.borderStyle);\n return (\n <Host\n class={classes([\n 'zonos--elements',\n this.open && 'open',\n this.isLoading && 'is-loading',\n this.noBorder && 'no-border',\n this.isMobile && 'mobile',\n ])}\n style={{\n '--border-radius': borderStyle,\n '--height': this.height || 'initial',\n '--width': this.width,\n }}\n >\n <div class=\"zonos--backdrop\"></div>\n <div\n aria-hidden=\"true\"\n class=\"zonos--dialog-layout\"\n onClick={this.clickOutsideDialogHandler}\n >\n <div class=\"zonos--dialog\">\n {this.isLoading && (\n <div class=\"zonos--loading\">\n <zonos-spinner size={30}></zonos-spinner>\n </div>\n )}\n {(this.headerText || !this.noCloseButton) && (\n <div class=\"zonos--header\">\n {this.headerText && (\n <h3 class=\"zonos--header-text\">{this.headerText}</h3>\n )}\n {!this.noCloseButton && (\n <zonos-button\n class=\"zonos--close-button\"\n icon={<zonos-icon content={RemoveIcon}></zonos-icon>}\n noBackground\n onClick={this.closeButtonHandler}\n ></zonos-button>\n )}\n </div>\n )}\n <div\n class={classes([\n 'zonos--body',\n this.noBodyPadding && 'zonos--no-body-padding',\n ])}\n >\n <slot />\n </div>\n {this.footerRightAction && (\n <div class=\"zonos--footer\">\n <div class=\"zonos--footer-right-action\">\n {this.footerRightAction}\n </div>\n </div>\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n","$filter-color: var(--filter-color);\n$width: var(--width);\n\n:host {\n display: inline-flex;\n img {\n filter: $filter-color;\n width: $width;\n }\n}\n","import { Component, getAssetPath, h, Host, Prop } from '@stencil/core';\n\nimport { classes } from 'src/components/utils/classes';\nimport type { ElementsUiTheme } from 'src/types';\n\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-logo.scss',\n tag: 'zonos-logo',\n})\nexport class ZonosLogo {\n /**\n * Theme to change the color of the logo\n */\n @Prop() theme: ElementsUiTheme = 'LIGHT';\n\n /**\n * The width of the logo\n */\n @Prop() width: string = 'auto';\n\n /**\n * css class for the component\n */\n @Prop() class: string = '';\n\n render() {\n const filterColor =\n this.theme === 'DARK'\n ? 'invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)'\n : 'whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)';\n\n return (\n <Host\n class={classes(['zonos--elements zonos--logo', this.class])}\n style={{\n '--filter-color': filterColor,\n '--width': this.width,\n }}\n >\n <img alt=\"Zonos Logo\" src={getAssetPath('./assets/ZonosLogo.png')} />\n </Host>\n );\n }\n}\n",":host {\n .zonos--total-pay {\n margin: $amino-space-16 0 $amino-space-32;\n }\n}\n\n:host(.mobile) {\n @include checkout-review-mobile;\n}\n","import { Component, h, Host, Listen, Prop, State } from '@stencil/core';\n\nimport { cartStore } from 'src/components/store/checkout/cart';\nimport { translate } from 'src/components/store/translationStore';\nimport { zonosStore } from 'src/components/store/zonosStore';\nimport { isCheckoutMobile } from 'src/components/utils/checkout/isCheckoutMobile';\nimport { classes } from 'src/components/utils/classes';\nimport { formatCurrency } from 'src/components/utils/formatCurrency';\n\n/** These assets neet to be in relative path as https://www.npmjs.com/package/stencil-inline-svg suggested */\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport ChevronDownIcon from './assets/ChevronDownIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport ChevronUpIcon from './assets/ChevronUpIcon.svg';\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-review.scss',\n tag: 'zonos-review',\n})\nexport class ZonosReview {\n /**\n * Whether or not the component is being rendered with mobile styles\n */\n @Prop() mobile: boolean = false;\n\n /**\n * Whether or not to show the collapse icon\n * This is controled from the collapsed state of the zonos-collapse component\n * to show the collapse icon\n */\n @Prop() collapsed: boolean = false;\n\n @State() isMobile: boolean = false;\n\n @Listen('resize', { target: 'window' })\n handleWindowResize() {\n this.isMobile = isCheckoutMobile(this.mobile);\n }\n\n componentWillLoad() {\n this.isMobile = isCheckoutMobile(this.mobile);\n }\n\n render() {\n const titleTextType = this.isMobile ? 'boldSubheader' : 'semiBoldLabel';\n const totalTextType = this.isMobile\n ? 'boldSubheader'\n : 'secondaryPageHeader';\n\n const titleTextColor = this.isMobile ? 'gray-1200' : 'gray-800';\n const totalWithoutTaxes = cartStore.total - cartStore.dutiesTaxFees;\n const renderCollapseIcon = () => {\n // only display the collapse icon if the component is being rendered with mobile styles\n if (!this.isMobile) {\n return null;\n }\n\n if (!this.collapsed) {\n return (\n <zonos-icon color=\"gray-1200\" content={ChevronDownIcon}></zonos-icon>\n );\n }\n return (\n <zonos-icon color=\"gray-1200\" content={ChevronUpIcon}></zonos-icon>\n );\n };\n return (\n <Host\n class={classes([\n 'zonos--review zonos--elements',\n this.isMobile && 'mobile',\n ])}\n >\n <div class=\"zonos--title\">\n <zonos-text color={titleTextColor} type={titleTextType}>\n {translate('Pay')} {zonosStore.organizationName}\n </zonos-text>\n {renderCollapseIcon()}\n </div>\n <div class=\"zonos--total-pay\">\n <zonos-text type={totalTextType}>\n {formatCurrency({\n amount:\n // show total without taxes when step is shipping, show total with taxes when step is payment\n cartStore.step === 'shipping'\n ? totalWithoutTaxes\n : cartStore.total,\n currency: cartStore.currency,\n })}\n </zonos-text>\n </div>\n </Host>\n );\n }\n}\n",":host {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n .zonos--title {\n margin-bottom: $amino-space-24;\n }\n .zonos--shipping-method-title {\n margin-bottom: $amino-space-16;\n }\n\n .zonos-shipping-rich-radio {\n margin-bottom: $amino-space-24;\n }\n\n .zonos--group {\n margin-bottom: $amino-space-20;\n overflow: auto;\n padding-right: 5px;\n\n @include zonos--scrollbar;\n }\n\n zonos-button {\n width: 100%;\n }\n zonos-banner {\n margin-top: $amino-space-24;\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport {\n cartStore,\n cartStoreGetShippingTransitInfo,\n cartStoreUpdateSelectedShippingOption,\n} from 'src/components/store/checkout/cart';\nimport { stripeStore } from 'src/components/store/checkout/stripe';\nimport { translate } from 'src/components/store/translationStore';\nimport { formatCurrency } from 'src/components/utils/formatCurrency';\nimport { submitGtag } from 'src/components/utils/submitGtag';\nimport type { ShippingRichRadioItem } from 'src/types';\n\n@Component({\n /**\n * Use `scope` here just because this component is `zonos-address` which is using stripe elements and stripe\n * need to be able to inject iframe into this component from the DOM\n */\n scoped: true,\n styleUrl: 'zonos-shipping.scss',\n tag: 'zonos-shipping',\n})\nexport class ZonosShipping {\n /**\n * Whether or not the continue button is loading\n */\n @Prop() continueLoading: boolean = false;\n\n /**\n * Submit button main color\n */\n @Prop() submitBtnColor?: string;\n\n /**\n * Whether or not the checkout is in mobile mode\n */\n @Prop() submitBtnType?: HTMLZonosButtonElement['variant'];\n\n /**\n * Event to emit when the continue button is clicked\n */\n @Event() continueClicked!: EventEmitter<void>;\n\n @State() selectedShippingMethod: ShippingRichRadioItem | null = null;\n\n /**\n * Whether or not the continue button is disabled\n * @default true\n */\n @State() disabled: boolean = true;\n\n @Watch('disabled')\n watchFormComplete() {\n if (!this.disabled) {\n // submit google tag when the form is complete\n submitGtag('zonos-checkout-shipping-info');\n }\n }\n\n private handleRadioSelected = async (\n e: CustomEvent<ShippingRichRadioItem>,\n ) => {\n this.selectedShippingMethod = e.detail;\n if (!this.selectedShippingMethod) {\n return;\n }\n\n const selectedShippingOption =\n cartStore.shippingData?.find(\n item => item.id === this.selectedShippingMethod?.value,\n ) || null;\n if (!selectedShippingOption) {\n return;\n }\n\n // save selected shipping option to store\n const updateStatus = await cartStoreUpdateSelectedShippingOption(\n selectedShippingOption,\n );\n if (!updateStatus) {\n return;\n }\n\n this.disabled = false;\n };\n\n /**\n * handler for continue button click\n */\n private continueClickHandler = () => {\n this.continueClicked.emit();\n };\n\n render() {\n const shipToCountry =\n stripeStore.stripeAddressEventData?.value.address.country;\n\n const serviceLevels = cartStore.shippingData?.flatMap(\n (item): ShippingRichRadioItem => {\n const { expectedDate, maxTransit, minTransit } =\n cartStoreGetShippingTransitInfo(item);\n const sublabel = expectedDate\n ? `${translate('Expected delivery')} ${expectedDate}`\n : '';\n const caption =\n minTransit && maxTransit\n ? `(${minTransit}-${maxTransit} ${translate('business days')})`\n : '';\n const shippingAmount =\n cartStore.landedCostData?.find(\n landedCostItem =>\n landedCostItem.landedCost?.shipmentRating.id === item.id,\n )?.subtotals.shipping || 0;\n return {\n caption,\n label: item.displayName,\n price: formatCurrency({\n amount: shippingAmount,\n currency: cartStore.currency,\n }),\n sublabel,\n value: item.id,\n };\n },\n );\n return (\n <Host class=\"zonos--shipping zonos--elements\">\n <div class=\"zonos--group\">\n <zonos-text class=\"zonos--title\" type=\"semiBoldSubheader\">\n {translate('Shipping information')}\n </zonos-text>\n <zonos-text class=\"zonos--shipping-method-title\" type=\"semiBoldLabel\">\n {translate('Shipping method')}\n </zonos-text>\n {!serviceLevels?.length ? (\n <zonos-banner\n bannerTitle=\"No shipping methods found - try editing your address or contacting support if the error persists\"\n intent=\"error\"\n ></zonos-banner>\n ) : (\n <zonos-shipping-rich-radio\n items={serviceLevels || []}\n onRadioSelected={e => this.handleRadioSelected(e)}\n ></zonos-shipping-rich-radio>\n )}\n\n {cartStore.isSelectedShippingAboveDeminimis && (\n <zonos-banner intent=\"warning\">\n {translate('Above de minimis threshold for')} {shipToCountry}.{' '}\n {translate(\n 'Duties and taxes will be applied to items and shipping.',\n )}\n </zonos-banner>\n )}\n </div>\n <zonos-button\n backgroundColor={this.submitBtnColor}\n is-disabled={this.disabled}\n loading={this.continueLoading}\n onClick={() => this.continueClickHandler()}\n size=\"lg\"\n // use primary type when on mobile mode\n variant={this.submitBtnType}\n >\n {translate('Go to payment')}\n </zonos-button>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, F as Fragment, H as Host } from './index-d1aa9293.js';
2
- import { i as initStripeElements, c as cartStore, a as cartStoreUpdateItems, b as cartStoreReset, s as stripeStore, d as stripeStoreInitCheckoutSession, e as cartStoreUpdateToErrorState, f as stripeStorePrefetchLandedCost, g as cartStoreNextStep, h as stripeStoreConfirmPayment, j as stripeStoreReset, k as cartStorePreviousStep } from './cart-36c33342.js';
2
+ import { i as initStripeElements, c as cartStore, a as cartStoreUpdateItems, b as cartStoreReset, s as stripeStore, d as stripeStoreInitCheckoutSession, e as cartStoreUpdateToErrorState, f as stripeStorePrefetchLandedCost, g as cartStoreNextStep, h as stripeStoreConfirmPayment, j as stripeStoreReset, k as cartStorePreviousStep } from './cart-2f83e048.js';
3
3
  import { l as log, a as localizationStore, t as translate } from './localization-4a424f49.js';
4
4
  import { z as zonosStore, m as mergeConfig } from './zonosStore-13a7b534.js';
5
5
  import { s as submitGtag, i as isCheckoutMobile } from './submitGtag-fbdb454b.js';
@@ -165,6 +165,10 @@ const ZonosCheckout = class {
165
165
  log('waiting for stripe to be loaded');
166
166
  return;
167
167
  }
168
+ if (this.storybookPaymentStatusOverride) {
169
+ clearInterval(interval);
170
+ return;
171
+ }
168
172
  log('init checkout');
169
173
  if (this.preview || this.forceDialogOpen) {
170
174
  void this.buildCartAndInit();
@@ -305,7 +309,7 @@ const ZonosCheckout = class {
305
309
  const reviewElementSize = (_a = this.zonosReviewRef) === null || _a === void 0 ? void 0 : _a.scrollHeight;
306
310
  return (h("div", { class: 'zonos--content', style: {
307
311
  '--border-radius': getBorderRadius(style),
308
- } }, cartStore.step !== 'finish' && (h(Fragment, null, h("div", { class: "zonos--left", "data-theme": leftSideTheme, style: {
312
+ } }, cartStore.step !== 'finish' && cartStore.step !== 'error' && (h(Fragment, null, h("div", { class: "zonos--left", "data-theme": leftSideTheme, style: {
309
313
  '--primary-color': !this.isMobile ? colorPrimary : '',
310
314
  } }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor, submitBtnType: submitBtnType })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor, submitBtnType: submitBtnType })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleCheckoutPaymentContinue(), paymentError: this.paymentError, submitBtnColor: submitButtonColor, submitBtnType: submitBtnType }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), !this.isMobile && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-collapse", { collapseSize: reviewElementSize, collapsed: this.collapseReviewMobile }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
311
315
  this.collapseReviewMobile =