@zonos/elements 1.3.51 → 1.3.53

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 (207) hide show
  1. package/dist/cjs/CheckoutConfig-65376e00.js +40 -0
  2. package/dist/cjs/{cart-546d1602.js → cart-61a8983d.js} +238 -375
  3. package/dist/cjs/{createCustomEvent-9b91480b.js → createCustomEvent-228027b5.js} +3 -2
  4. package/dist/cjs/handleFetch-842c95b0.js +322 -0
  5. package/dist/cjs/index.cjs.js +75 -35
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{paypal-83f49f9a.js → paypal-f1eb6621.js} +16 -16
  8. package/dist/cjs/zonos-address_8.cjs.entry.js +4 -4
  9. package/dist/cjs/{zonos-cart-items_12.cjs.entry.js → zonos-badge_13.cjs.entry.js} +41 -9
  10. package/dist/cjs/zonos-checkout.cjs.entry.js +75 -174
  11. package/dist/cjs/zonos-controller.cjs.entry.js +29 -27
  12. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
  14. package/dist/cjs/zonos-elements.cjs.js +1 -1
  15. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  16. package/dist/cjs/zonos-hello.cjs.entry.js +11 -11
  17. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  18. package/dist/cjs/zonos-notification_3.cjs.entry.js +9 -9
  19. package/dist/cjs/zonos-tooltip.cjs.entry.js +27 -0
  20. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +5 -2
  21. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +44 -20
  22. package/dist/collection/components/main/zonos-controller.js +2 -2
  23. package/dist/collection/components/store/checkout/cart.js +14 -2
  24. package/dist/collection/components/store/checkout/stripe.js +9 -4
  25. package/dist/collection/components/store/translationStore/strings.arabic.js +3 -3
  26. package/dist/collection/components/store/translationStore/strings.base.js +3 -3
  27. package/dist/collection/components/store/translationStore/strings.chinese.js +3 -3
  28. package/dist/collection/components/store/translationStore/strings.danish.js +3 -3
  29. package/dist/collection/components/store/translationStore/strings.dutch.js +3 -3
  30. package/dist/collection/components/store/translationStore/strings.french.js +3 -3
  31. package/dist/collection/components/store/translationStore/strings.german.js +3 -3
  32. package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -3
  33. package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -3
  34. package/dist/collection/components/store/translationStore/strings.italian.js +3 -3
  35. package/dist/collection/components/store/translationStore/strings.japanese.js +3 -3
  36. package/dist/collection/components/store/translationStore/strings.korean.js +3 -3
  37. package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -3
  38. package/dist/collection/components/store/translationStore/strings.polish.js +3 -3
  39. package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -3
  40. package/dist/collection/components/store/translationStore/strings.russian.js +3 -3
  41. package/dist/collection/components/store/translationStore/strings.spanish.js +3 -3
  42. package/dist/collection/components/store/translationStore/strings.swedish.js +3 -3
  43. package/dist/collection/components/store/translationStore/strings.turkish.js +3 -3
  44. package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -3
  45. package/dist/collection/components/utils/api/buildCartItemsByTempCart.js +14 -14
  46. package/dist/collection/components/utils/api/calculateLandedCostNormalized.js +28 -0
  47. package/dist/collection/components/utils/api/cartCalculateLandedCost.js +19 -0
  48. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +65 -0
  49. package/dist/collection/components/utils/checkout/initCheckout.js +4 -2
  50. package/dist/collection/environment.js +1 -1
  51. package/dist/collection/scripts/_getNextFallbackUrl.js +1 -0
  52. package/dist/collection/scripts/_getTempCartById.js +14 -0
  53. package/dist/collection/scripts/_zonosBase.js +39 -10
  54. package/dist/collection/scripts/cart/_getCartIdFromParam.js +9 -0
  55. package/dist/collection/scripts/cart/_setupCartData.js +18 -0
  56. package/dist/collection/types/checkout/CheckoutConfig.js +2 -1
  57. package/dist/collection/types/generated/graphql.customer.types.js +12 -0
  58. package/dist/collection/utils/formattedCloudflareApiUrl.js +8 -2
  59. package/dist/collection/utils/generateCloudflareDeployUrl.js +3 -0
  60. package/dist/esm/CheckoutConfig-57350b28.js +36 -0
  61. package/dist/esm/{cart-51529af2.js → cart-45d2861f.js} +193 -327
  62. package/dist/esm/{createCustomEvent-b8bbdf5e.js → createCustomEvent-3fcc948a.js} +2 -1
  63. package/dist/esm/handleFetch-37cea185.js +315 -0
  64. package/dist/esm/index.js +56 -17
  65. package/dist/esm/loader.js +1 -1
  66. package/dist/esm/{paypal-905325d0.js → paypal-ee310945.js} +2 -2
  67. package/dist/esm/zonos-address_8.entry.js +2 -2
  68. package/dist/esm/{zonos-cart-items_12.entry.js → zonos-badge_13.entry.js} +40 -9
  69. package/dist/esm/zonos-checkout.entry.js +61 -160
  70. package/dist/esm/zonos-controller.entry.js +8 -6
  71. package/dist/esm/zonos-country-flag.entry.js +2 -2
  72. package/dist/esm/zonos-country-select_4.entry.js +2 -2
  73. package/dist/esm/zonos-elements.js +1 -1
  74. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  75. package/dist/esm/zonos-hello.entry.js +2 -2
  76. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  77. package/dist/esm/zonos-notification_3.entry.js +3 -3
  78. package/dist/esm/zonos-tooltip.entry.js +23 -0
  79. package/dist/esm-es5/CheckoutConfig-57350b28.js +1 -0
  80. package/dist/esm-es5/cart-45d2861f.js +1 -0
  81. package/dist/esm-es5/{createCustomEvent-b8bbdf5e.js → createCustomEvent-3fcc948a.js} +1 -1
  82. package/dist/esm-es5/handleFetch-37cea185.js +1 -0
  83. package/dist/esm-es5/index.js +1 -1
  84. package/dist/esm-es5/loader.js +1 -1
  85. package/dist/esm-es5/{paypal-905325d0.js → paypal-ee310945.js} +1 -1
  86. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  87. package/dist/esm-es5/zonos-badge_13.entry.js +1 -0
  88. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  89. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  90. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  91. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  92. package/dist/esm-es5/zonos-elements.js +1 -1
  93. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  94. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  95. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  96. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  97. package/dist/esm-es5/zonos-tooltip.entry.js +1 -0
  98. package/dist/scripts/index.d.ts +74 -87
  99. package/dist/scripts/index.js +1 -1
  100. package/dist/scripts/loadZonos.js +1 -1
  101. package/dist/scripts/zonos.js +1 -1
  102. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +0 -2
  103. package/dist/types/components/store/checkout/cart.d.ts +13 -3
  104. package/dist/types/components/store/checkout/stripe.d.ts +3 -1
  105. package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -3
  106. package/dist/types/components/store/translationStore/strings.base.d.ts +3 -3
  107. package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -3
  108. package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -3
  109. package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -3
  110. package/dist/types/components/store/translationStore/strings.french.d.ts +3 -3
  111. package/dist/types/components/store/translationStore/strings.german.d.ts +3 -3
  112. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -3
  113. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -3
  114. package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -3
  115. package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -3
  116. package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -3
  117. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -3
  118. package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -3
  119. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -3
  120. package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -3
  121. package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -3
  122. package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -3
  123. package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -3
  124. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -3
  125. package/dist/types/components/store/translationStore.d.ts +1 -1
  126. package/dist/types/components/utils/api/buildCartItemsByTempCart.d.ts +8 -3
  127. package/dist/types/components/utils/api/calculateLandedCostNormalized.d.ts +2 -0
  128. package/dist/types/components/utils/api/cartCalculateLandedCost.d.ts +5 -0
  129. package/dist/types/components/utils/api/prepCalculateLandedCost.d.ts +5 -1
  130. package/dist/types/components/utils/checkout/getIsTestMode.d.ts +1 -1
  131. package/dist/types/scripts/_getNextFallbackUrl.d.ts +1 -0
  132. package/dist/types/scripts/_getTempCartById.d.ts +8 -0
  133. package/dist/types/scripts/_zonosBase.d.ts +15 -12
  134. package/dist/types/scripts/cart/_getCartIdFromParam.d.ts +4 -0
  135. package/dist/types/scripts/cart/_setupCartData.d.ts +7 -0
  136. package/dist/types/types/checkout/CheckoutConfig.d.ts +18 -3
  137. package/dist/types/types/checkout/api/CalculateLandedCostRequest.d.ts +42 -1
  138. package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +37 -0
  139. package/dist/types/types/generated/graphql.customer.types.d.ts +249 -2
  140. package/dist/types/types/generated/graphql.customer.types.ts +251 -3
  141. package/dist/types/utils/formattedCloudflareApiUrl.d.ts +2 -2
  142. package/dist/zonos-elements/index.esm.js +1 -1
  143. package/dist/zonos-elements/p-01f0b13d.entry.js +1 -0
  144. package/dist/zonos-elements/p-042c466d.system.entry.js +1 -0
  145. package/dist/zonos-elements/p-10cb0064.entry.js +1 -0
  146. package/dist/zonos-elements/p-217e1aa1.system.entry.js +1 -0
  147. package/dist/zonos-elements/{p-5e56828a.entry.js → p-259ccf8d.entry.js} +1 -1
  148. package/dist/zonos-elements/p-2a47d2cc.system.entry.js +1 -0
  149. package/dist/zonos-elements/{p-ffd76226.entry.js → p-31eb835c.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-58d9803d.entry.js → p-36360905.entry.js} +1 -1
  151. package/dist/zonos-elements/{p-1828a4ff.system.entry.js → p-3703b814.system.entry.js} +1 -1
  152. package/dist/zonos-elements/p-4146feec.js +1 -0
  153. package/dist/zonos-elements/p-446c8f02.system.entry.js +1 -0
  154. package/dist/zonos-elements/{p-2c323311.system.js → p-5590f90c.system.js} +1 -1
  155. package/dist/zonos-elements/p-588396df.js +1 -0
  156. package/dist/zonos-elements/{p-aa5d669b.js → p-6e59c6e4.js} +2 -2
  157. package/dist/zonos-elements/p-6eedc3f8.entry.js +1 -0
  158. package/dist/zonos-elements/p-747eed39.entry.js +1 -0
  159. package/dist/zonos-elements/{p-00100b17.system.entry.js → p-8228e87c.system.entry.js} +1 -1
  160. package/dist/zonos-elements/p-827868e6.entry.js +1 -0
  161. package/dist/zonos-elements/{p-cc7a4fca.entry.js → p-88005b94.entry.js} +1 -1
  162. package/dist/zonos-elements/p-895fdefb.js +1 -0
  163. package/dist/zonos-elements/p-8f7773b0.system.js +1 -0
  164. package/dist/zonos-elements/{p-9a0401fd.entry.js → p-8fa49d94.entry.js} +1 -1
  165. package/dist/zonos-elements/p-a74a7afa.system.js +1 -0
  166. package/dist/zonos-elements/{p-8473f99a.system.entry.js → p-b842b96a.system.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-9e976332.entry.js → p-bb186075.entry.js} +1 -1
  168. package/dist/zonos-elements/{p-b1a8b874.system.entry.js → p-c008648a.system.entry.js} +1 -1
  169. package/dist/zonos-elements/p-c22bac78.system.js +1 -0
  170. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  171. package/dist/zonos-elements/{p-6b42fa1b.system.entry.js → p-cd4ad1be.system.entry.js} +1 -1
  172. package/dist/zonos-elements/{p-59e85369.system.entry.js → p-d62e6bb0.system.entry.js} +1 -1
  173. package/dist/zonos-elements/{p-496e040f.system.entry.js → p-dc12f30a.system.entry.js} +1 -1
  174. package/dist/zonos-elements/p-eb2aedd0.js +1 -0
  175. package/dist/zonos-elements/{p-c89859cf.system.js → p-f124e459.system.js} +2 -2
  176. package/dist/zonos-elements/p-f87a635b.system.js +1 -0
  177. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  178. package/package.json +1 -1
  179. package/dist/cjs/logError-4e2f2020.js +0 -58
  180. package/dist/cjs/zonos-badge_2.cjs.entry.js +0 -57
  181. package/dist/collection/components/utils/api/tempCartItem/getAttributes.js +0 -66
  182. package/dist/collection/components/utils/api/tempCartItem/getMeasurements.js +0 -58
  183. package/dist/esm/logError-c456c092.js +0 -55
  184. package/dist/esm/zonos-badge_2.entry.js +0 -52
  185. package/dist/esm-es5/cart-51529af2.js +0 -1
  186. package/dist/esm-es5/logError-c456c092.js +0 -1
  187. package/dist/esm-es5/zonos-badge_2.entry.js +0 -1
  188. package/dist/esm-es5/zonos-cart-items_12.entry.js +0 -1
  189. package/dist/types/components/utils/api/tempCartItem/getAttributes.d.ts +0 -11
  190. package/dist/types/components/utils/api/tempCartItem/getMeasurements.d.ts +0 -7
  191. package/dist/types/types/checkout/api/TempCart.d.ts +0 -80
  192. package/dist/zonos-elements/p-101c41bf.entry.js +0 -1
  193. package/dist/zonos-elements/p-3c4eec63.system.entry.js +0 -1
  194. package/dist/zonos-elements/p-47945026.system.entry.js +0 -1
  195. package/dist/zonos-elements/p-47c72c50.system.entry.js +0 -1
  196. package/dist/zonos-elements/p-4e77ed65.system.entry.js +0 -1
  197. package/dist/zonos-elements/p-6013e370.entry.js +0 -1
  198. package/dist/zonos-elements/p-63db40b9.system.js +0 -1
  199. package/dist/zonos-elements/p-8b8ef484.entry.js +0 -1
  200. package/dist/zonos-elements/p-b57d24f2.entry.js +0 -1
  201. package/dist/zonos-elements/p-ba0289f9.entry.js +0 -1
  202. package/dist/zonos-elements/p-c8a3303b.js +0 -1
  203. package/dist/zonos-elements/p-d413cd13.js +0 -1
  204. package/dist/zonos-elements/p-e758ec31.system.js +0 -1
  205. package/dist/zonos-elements/p-eaa335e1.js +0 -1
  206. package/dist/zonos-elements/p-fcfde531.system.js +0 -1
  207. /package/dist/collection/types/checkout/api/{TempCart.js → NormalizedTempCart.js} +0 -0
@@ -3164,6 +3164,95 @@ export const zonosAttribution = {
3164
3164
  export type ZonosAttribution =
3165
3165
  (typeof zonosAttribution)[keyof typeof zonosAttribution];
3166
3166
 
3167
+ export type CartCalculateLandedCostMutation = {
3168
+ cartWorkflow: {
3169
+ id: string;
3170
+ items: Array<{
3171
+ amount: number;
3172
+ attributes: Array<{
3173
+ key: string | null;
3174
+ value: string | null;
3175
+ } | null> | null;
3176
+ description: string | null;
3177
+ id: string;
3178
+ imageUrl: string | null;
3179
+ name: string | null;
3180
+ quantity: number;
3181
+ restriction: { action: RestrictedItemAction; reason: string } | null;
3182
+ sku: string | null;
3183
+ }>;
3184
+ };
3185
+ cartonizeWorkflow: Array<{
3186
+ id: string;
3187
+ items: Array<{ item: { id: string } }> | null;
3188
+ type: PackagingType;
3189
+ } | null> | null;
3190
+ checkoutSessionWorkflow: Array<{
3191
+ landedCost: { id: string } | null;
3192
+ landedCostId: string;
3193
+ subtotals: {
3194
+ adjustments: number;
3195
+ duties: number;
3196
+ presentmentCurrencyCode: CurrencyCode;
3197
+ fees: number;
3198
+ items: number;
3199
+ landedCostTotal: number;
3200
+ taxes: number;
3201
+ shipping: number;
3202
+ exchangeRate: {
3203
+ id: string;
3204
+ rate: number;
3205
+ sourceCurrencyCode: CurrencyCode;
3206
+ targetCurrencyCode: CurrencyCode;
3207
+ type: ExchangeRateType;
3208
+ };
3209
+ total: number;
3210
+ };
3211
+ }> | null;
3212
+ landedCostCalculateWorkflow: Array<{
3213
+ amountSubtotals: { discounts: number | null } | null;
3214
+ landedCostGuaranteeCode: LandedCostGuaranteeCode;
3215
+ deMinimis: Array<{
3216
+ formula: string;
3217
+ threshold: DeMinimisThreshold;
3218
+ method: IncotermCode;
3219
+ note: string;
3220
+ type: DeMinimisType;
3221
+ }>;
3222
+ duties: Array<{ amount: number; currencyCode: CurrencyCode }>;
3223
+ fees: Array<{ amount: number; currencyCode: CurrencyCode }>;
3224
+ id: string;
3225
+ appliedAdjustments: Array<{
3226
+ amount: number;
3227
+ item: { amount: number } | null;
3228
+ type: LandedCostAdjustmentType | null;
3229
+ }> | null;
3230
+ method: IncotermCode;
3231
+ shipmentRating: {
3232
+ amount: number;
3233
+ currencyCode: CurrencyCode;
3234
+ displayName: string;
3235
+ id: string;
3236
+ maxTransitAt: string | null;
3237
+ minTransitAt: string | null;
3238
+ };
3239
+ taxes: Array<{ amount: number; currencyCode: CurrencyCode }>;
3240
+ } | null> | null;
3241
+ partyCreateWorkflow: Array<{
3242
+ id: string;
3243
+ organization: string;
3244
+ type: PartyType | null;
3245
+ }>;
3246
+ shipmentRatingCalculateWorkflow: Array<{
3247
+ amount: number;
3248
+ currencyCode: CurrencyCode;
3249
+ displayName: string;
3250
+ id: string;
3251
+ maxTransitAt: string | null;
3252
+ minTransitAt: string | null;
3253
+ }>;
3254
+ };
3255
+
3167
3256
  export type CalculateLandedCostMutation = {
3168
3257
  cartonizeWorkflow: Array<{
3169
3258
  id: string;
@@ -3172,7 +3261,9 @@ export type CalculateLandedCostMutation = {
3172
3261
  } | null> | null;
3173
3262
  checkoutSessionWorkflow: Array<{
3174
3263
  landedCost: { id: string } | null;
3264
+ landedCostId: string;
3175
3265
  subtotals: {
3266
+ adjustments: number;
3176
3267
  duties: number;
3177
3268
  exchangeRate: {
3178
3269
  id: string;
@@ -3205,6 +3296,7 @@ export type CalculateLandedCostMutation = {
3205
3296
  sku: string | null;
3206
3297
  }>;
3207
3298
  landedCostCalculateWorkflow: Array<{
3299
+ amountSubtotals: { discounts: number | null } | null;
3208
3300
  appliedAdjustments: Array<{
3209
3301
  amount: number;
3210
3302
  item: { amount: number } | null;
@@ -3213,8 +3305,8 @@ export type CalculateLandedCostMutation = {
3213
3305
  deMinimis: Array<{
3214
3306
  formula: string;
3215
3307
  method: IncotermCode;
3216
- note: string;
3217
3308
  threshold: DeMinimisThreshold;
3309
+ note: string;
3218
3310
  type: DeMinimisType;
3219
3311
  }>;
3220
3312
  duties: Array<{ amount: number; currencyCode: CurrencyCode }>;
@@ -3224,8 +3316,8 @@ export type CalculateLandedCostMutation = {
3224
3316
  method: IncotermCode;
3225
3317
  shipmentRating: {
3226
3318
  amount: number;
3227
- displayName: string;
3228
3319
  currencyCode: CurrencyCode;
3320
+ displayName: string;
3229
3321
  id: string;
3230
3322
  maxTransitAt: string | null;
3231
3323
  minTransitAt: string | null;
@@ -3247,9 +3339,23 @@ export type CalculateLandedCostMutation = {
3247
3339
  }>;
3248
3340
  };
3249
3341
 
3342
+ export type CartItemFragmentFragment = {
3343
+ amount: number;
3344
+ attributes: Array<{ key: string | null; value: string | null } | null> | null;
3345
+ description: string | null;
3346
+ id: string;
3347
+ imageUrl: string | null;
3348
+ name: string | null;
3349
+ quantity: number;
3350
+ restriction: { action: RestrictedItemAction; reason: string } | null;
3351
+ sku: string | null;
3352
+ };
3353
+
3250
3354
  export type CheckoutPresentmentFragment = {
3251
3355
  landedCost: { id: string } | null;
3356
+ landedCostId: string;
3252
3357
  subtotals: {
3358
+ adjustments: number;
3253
3359
  duties: number;
3254
3360
  exchangeRate: {
3255
3361
  id: string;
@@ -3269,6 +3375,7 @@ export type CheckoutPresentmentFragment = {
3269
3375
  };
3270
3376
 
3271
3377
  export type LandedCostFragment = {
3378
+ amountSubtotals: { discounts: number | null } | null;
3272
3379
  appliedAdjustments: Array<{
3273
3380
  amount: number;
3274
3381
  item: { amount: number } | null;
@@ -3376,10 +3483,12 @@ export type GetTaxIdByCountryQuery = {
3376
3483
 
3377
3484
  export type CheckoutSessionCreateMutation = {
3378
3485
  checkoutSessionCreate: {
3486
+ cartId: string | null;
3379
3487
  clientSecret: string;
3380
3488
  id: string;
3381
3489
  landedCost: {
3382
3490
  amountSubtotals: {
3491
+ discounts: number | null;
3383
3492
  duties: number;
3384
3493
  fees: number;
3385
3494
  items: number;
@@ -3395,6 +3504,7 @@ export type CheckoutSessionCreateMutation = {
3395
3504
  metadata: Array<{ key: string; value: string } | null> | null;
3396
3505
  organizationId: string;
3397
3506
  subtotals: {
3507
+ adjustments: number;
3398
3508
  duties: number;
3399
3509
  exchangeRate: {
3400
3510
  id: string;
@@ -3415,10 +3525,12 @@ export type CheckoutSessionCreateMutation = {
3415
3525
  };
3416
3526
 
3417
3527
  export type CheckoutDetailsFragment = {
3528
+ cartId: string | null;
3418
3529
  clientSecret: string;
3419
3530
  id: string;
3420
3531
  landedCost: {
3421
3532
  amountSubtotals: {
3533
+ discounts: number | null;
3422
3534
  duties: number;
3423
3535
  fees: number;
3424
3536
  items: number;
@@ -3434,6 +3546,7 @@ export type CheckoutDetailsFragment = {
3434
3546
  metadata: Array<{ key: string; value: string } | null> | null;
3435
3547
  organizationId: string;
3436
3548
  subtotals: {
3549
+ adjustments: number;
3437
3550
  duties: number;
3438
3551
  exchangeRate: {
3439
3552
  id: string;
@@ -3513,10 +3626,12 @@ export type CheckoutSessionUpdateMetadataMutation = {
3513
3626
 
3514
3627
  export type CheckoutSessionUpdateMutation = {
3515
3628
  checkoutSessionUpdate: {
3629
+ cartId: string | null;
3516
3630
  clientSecret: string;
3517
3631
  id: string;
3518
3632
  landedCost: {
3519
3633
  amountSubtotals: {
3634
+ discounts: number | null;
3520
3635
  duties: number;
3521
3636
  fees: number;
3522
3637
  items: number;
@@ -3532,6 +3647,7 @@ export type CheckoutSessionUpdateMutation = {
3532
3647
  metadata: Array<{ key: string; value: string } | null> | null;
3533
3648
  organizationId: string;
3534
3649
  subtotals: {
3650
+ adjustments: number;
3535
3651
  duties: number;
3536
3652
  exchangeRate: {
3537
3653
  id: string;
@@ -3552,10 +3668,12 @@ export type CheckoutSessionUpdateMutation = {
3552
3668
  };
3553
3669
 
3554
3670
  export type CheckoutSessionUpdateDetailsFragment = {
3671
+ cartId: string | null;
3555
3672
  clientSecret: string;
3556
3673
  id: string;
3557
3674
  landedCost: {
3558
3675
  amountSubtotals: {
3676
+ discounts: number | null;
3559
3677
  duties: number;
3560
3678
  fees: number;
3561
3679
  items: number;
@@ -3571,6 +3689,7 @@ export type CheckoutSessionUpdateDetailsFragment = {
3571
3689
  metadata: Array<{ key: string; value: string } | null> | null;
3572
3690
  organizationId: string;
3573
3691
  subtotals: {
3692
+ adjustments: number;
3574
3693
  duties: number;
3575
3694
  exchangeRate: {
3576
3695
  id: string;
@@ -3684,7 +3803,7 @@ export type ZonosSettingsQuery = {
3684
3803
  updatedAt: string;
3685
3804
  updatedBy: string;
3686
3805
  } | null;
3687
- onlineStoreSettings: { allowedDomains: Array<string> };
3806
+ onlineStoreSettings: { allowedDomains: Array<string>; url: string };
3688
3807
  organization: {
3689
3808
  id: string;
3690
3809
  name: string;
@@ -3970,6 +4089,79 @@ export type RemoveTrackingNumberMutation = {
3970
4089
  } | null;
3971
4090
  };
3972
4091
 
4092
+ export type CartQuery = {
4093
+ cart: {
4094
+ adjustments: Array<{
4095
+ amount: number;
4096
+ currencyCode: CurrencyCode;
4097
+ description: string;
4098
+ productId: string | null;
4099
+ sku: string | null;
4100
+ type: CartAdjustmentType;
4101
+ }>;
4102
+ id: string;
4103
+ items: Array<{
4104
+ amount: number;
4105
+ attributes: Array<{
4106
+ key: string | null;
4107
+ value: string | null;
4108
+ } | null> | null;
4109
+ countryOfOrigin: CountryCode | null;
4110
+ currencyCode: CurrencyCode;
4111
+ description: string | null;
4112
+ id: string;
4113
+ imageUrl: string | null;
4114
+ itemType: ItemType | null;
4115
+ measurements: Array<{
4116
+ type: ItemMeasurementType;
4117
+ unitOfMeasure: ItemUnitOfMeasure;
4118
+ value: number;
4119
+ } | null> | null;
4120
+ name: string | null;
4121
+ productId: string;
4122
+ quantity: number;
4123
+ sku: string | null;
4124
+ }>;
4125
+ metadata: Array<{ key: string; value: string }>;
4126
+ organizationId: string;
4127
+ } | null;
4128
+ };
4129
+
4130
+ export type GetCartOrganizationInfoQuery = {
4131
+ onlineStoreSettings: { url: string };
4132
+ organization: { references: { storeId: number | null } | null } | null;
4133
+ };
4134
+
4135
+ export type CartCreateMutation = {
4136
+ cartCreate: {
4137
+ adjustments: Array<{
4138
+ amount: number;
4139
+ currencyCode: CurrencyCode;
4140
+ description: string;
4141
+ productId: string | null;
4142
+ sku: string | null;
4143
+ type: CartAdjustmentType;
4144
+ }>;
4145
+ id: string;
4146
+ items: Array<{
4147
+ amount: number;
4148
+ attributes: Array<{
4149
+ key: string | null;
4150
+ value: string | null;
4151
+ } | null> | null;
4152
+ description: string | null;
4153
+ id: string;
4154
+ imageUrl: string | null;
4155
+ name: string | null;
4156
+ quantity: number;
4157
+ restriction: { action: RestrictedItemAction; reason: string } | null;
4158
+ sku: string | null;
4159
+ }>;
4160
+ metadata: Array<{ key: string; value: string }>;
4161
+ organizationId: string;
4162
+ };
4163
+ };
4164
+
3973
4165
  export type SdkFunctionWrapper = <T>(
3974
4166
  action: (requestHeaders?: Record<string, string>) => Promise<T>,
3975
4167
  operationName: string,
@@ -4029,6 +4221,48 @@ export function getSdk(
4029
4221
  'mutation',
4030
4222
  );
4031
4223
  },
4224
+ cart(
4225
+ variables?: { [x: string]: never },
4226
+ requestHeaders?: GraphQLClientRequestHeaders,
4227
+ ): Promise<CartQuery> {
4228
+ return withWrapper(
4229
+ wrappedRequestHeaders =>
4230
+ client.request<CartQuery>('', variables, {
4231
+ ...requestHeaders,
4232
+ ...wrappedRequestHeaders,
4233
+ }),
4234
+ 'cart',
4235
+ 'query',
4236
+ );
4237
+ },
4238
+ cartCalculateLandedCost(
4239
+ variables?: { [x: string]: never },
4240
+ requestHeaders?: GraphQLClientRequestHeaders,
4241
+ ): Promise<CartCalculateLandedCostMutation> {
4242
+ return withWrapper(
4243
+ wrappedRequestHeaders =>
4244
+ client.request<CartCalculateLandedCostMutation>('', variables, {
4245
+ ...requestHeaders,
4246
+ ...wrappedRequestHeaders,
4247
+ }),
4248
+ 'cartCalculateLandedCost',
4249
+ 'mutation',
4250
+ );
4251
+ },
4252
+ cartCreate(
4253
+ variables?: { [x: string]: never },
4254
+ requestHeaders?: GraphQLClientRequestHeaders,
4255
+ ): Promise<CartCreateMutation> {
4256
+ return withWrapper(
4257
+ wrappedRequestHeaders =>
4258
+ client.request<CartCreateMutation>('', variables, {
4259
+ ...requestHeaders,
4260
+ ...wrappedRequestHeaders,
4261
+ }),
4262
+ 'cartCreate',
4263
+ 'mutation',
4264
+ );
4265
+ },
4032
4266
  checkItemRestrictions(
4033
4267
  variables?: { [x: string]: never },
4034
4268
  requestHeaders?: GraphQLClientRequestHeaders,
@@ -4141,6 +4375,20 @@ export function getSdk(
4141
4375
  'query',
4142
4376
  );
4143
4377
  },
4378
+ getCartOrganizationInfo(
4379
+ variables?: { [x: string]: never },
4380
+ requestHeaders?: GraphQLClientRequestHeaders,
4381
+ ): Promise<GetCartOrganizationInfoQuery> {
4382
+ return withWrapper(
4383
+ wrappedRequestHeaders =>
4384
+ client.request<GetCartOrganizationInfoQuery>('', variables, {
4385
+ ...requestHeaders,
4386
+ ...wrappedRequestHeaders,
4387
+ }),
4388
+ 'getCartOrganizationInfo',
4389
+ 'query',
4390
+ );
4391
+ },
4144
4392
  getCheckoutPlaceOrderButtonSelector(
4145
4393
  variables?: { [x: string]: never },
4146
4394
  requestHeaders?: GraphQLClientRequestHeaders,
@@ -10,11 +10,11 @@
10
10
  * - `https://<branch_name>.<project_name>.pages.dev` if is Preview
11
11
  * - `https://route.elements.zonos.com` if is Production
12
12
  */
13
- export declare const formattedCloudflareApiUrl: ({ branchName, inCI: _inCI, inVercel: _inVercel, isVercelPreview: _isVercelPreview, projectName, url, }: {
13
+ export declare const formattedCloudflareApiUrl: ({ branchName, inCI: _inCI, inGithubAction, inVercel: _inVercel, isVercelPreview: _isVercelPreview, url, }: {
14
14
  branchName?: string;
15
15
  inCI: boolean;
16
+ inGithubAction: boolean;
16
17
  inVercel: boolean;
17
18
  isVercelPreview: boolean;
18
- projectName: string;
19
19
  url?: string;
20
20
  }) => string | undefined;
@@ -1 +1 @@
1
- import{l as e,a as n}from"./p-eaa335e1.js";const t=["jsdelivr","cdnjs","unpkg","vercel"],o=e=>{const n=t.indexOf(e);return t[n+1]||null},s="https://js.stripe.com/v3",r=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,i="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let l=null;const c=Promise.resolve().then((()=>{return e=null,null!==l||(l=new Promise(((t,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(i),window.Stripe)t(window.Stripe);else try{let l=(()=>{const e=document.querySelectorAll(`script[src^="${s}"]`);for(let n=0;n<e.length;n++){const t=e[n];if(t&&r.test(t.src))return t}return null})();l&&e?console.warn(i):l||(l=(e=>{const t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${s}${t}`;const r=document.head||document.body;return r?(r.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==l||l.addEventListener("load",(()=>{window.Stripe?t(window.Stripe):o(new Error("Stripe.js not available"))})),null==l||l.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else t(null)}))),l;var e}));let d=!1;var u;c.catch((e=>{d||console.warn(e)}));const a=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,t=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),o=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:o,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?n:null})(),m="https://v1.3.51.js.zonos.com",p=a||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.51",w="jsdelivr",f="https://rsms.me",h="https://fonts.googleapis.com",v=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class y{}u=y,y.doneInit=!1,y.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),y.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),y._paypalMockResponse=null,y.isBigCommerce=!1,y.releaseDate="1726523859808",y.isNpm=!0,y.zonosQaUrl=null,y.version="v1.3.51",y.modeAlerted=!1,y.tempCartData=null,y.paypal=null,y.getCurrentTimestamp=()=>(new Date).getTime(),y.zonosController=null,y.init=async({appearance:t,checkoutSettings:o,currencyConverter:s,helloSettings:r,onCountryChange:i,overrideCurrencyFormat:l,storeId:c,zonosApiKey:d})=>{u.doneInit||(e(`====== ZONOS DEBUG MODE: on (${u.version}) ======`),d?(u.zonosApiKey=d,u.storeId=c,e("init zonos"),u.injectZonosCdn(),u.injectZonosCss(),u.injectFonts(),u.injectController({config:{appearance:t,checkoutSettings:o,currencyConverter:s,helloSettings:r,onCountryChange:i,overrideCurrencyFormat:l},zonosApiKey:d}),u.doneInit=!0):n("Missing Zonos API key"))},y.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},y.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},y.showNotification=e=>{var n;null===(n=u.zonosController)||void 0===n||n.showNotification(e)},y.updateOrganizationName=e=>{var n;null===(n=u.zonosController)||void 0===n||n.updateOrganizationName(e)},y.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:t,placeOrderButtonSelector:o})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&o){const n=document.querySelectorAll(o),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&t&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},y.injectController=({config:t,zonosApiKey:o})=>{var s;if(document.querySelector("zonos-controller"))return;if(null===(s=t.checkoutSettings)||void 0===s?void 0:s.placeOrderButtonSelector){const e=t.checkoutSettings.placeOrderButtonSelector;u.disablePlaceOrderButtons({config:t,disable:!0,placeOrderButtonSelector:e}),new MutationObserver((()=>{u.disablePlaceOrderButtons({config:t,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=t,r.zonosApiKey=o,r.addEventListener("stripeInitEvent",(async t=>{const{detail:o}=t;e("loading Stripe");const s=await(async(...e)=>{d=!0;const n=Date.now();return c.then((t=>((e,n,t)=>{if(null===e)return null;const o=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(o,t),o})(t,e,n)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),u.zonosController=r,e("Zonos controller injected!")},y.injectScript=({cdnType:t,isModule:s,theRestUrl:r})=>{const i=`${u.getZonosUrl(t)}/${r}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,c=document.createElement("script");s?c.type="module":c.noModule=!0,c.src=i,c.crossOrigin="anonymous",c.onerror=()=>{n(`Failed to load ${c.src}`);const e=o(t);e&&u.injectScript({cdnType:e,isModule:s,theRestUrl:r})},l.appendChild(c)},y.getZonosUrl=n=>{const t=()=>{switch(n){case"jsdelivr":return p;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.51";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.51";case"vercel":return m}};return u.isNpm&&(()=>{const n=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||n)return null;const t=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.51.js.zonos.com";if(!t&&(o.includes("test.")||o.includes("test-")))return o;if(!t&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!t)return null;if("dev-elements"===t)return"https://dev.elements.zonos.com";const s=`https://${t}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${s}' for loading script`,"warn"),fetch(s).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${s}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,t=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),s})()||t()},y.injectZonosCdn=()=>{u.injectScript({cdnType:w,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),u.injectScript({cdnType:w,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},y.injectStylesheet=({cdnType:e,theRestUrl:t})=>{const s=u.getZonosUrl(e),r=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${m}/`,r.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${s}/${t}`,l.onerror=()=>{n(`Failed to load ${l.href}`);const s=o(e);s&&u.injectStylesheet({cdnType:s,theRestUrl:t})},r.appendChild(l)},y.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(u.injectStylesheet({cdnType:w,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},y.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${f}"]`);for(let n=0;n<e.length;n++){const t=e[n];if(t&&!v.test(t.href))return t}return null})())return void e("Inter font already injected","warn");const n=document.head||document.body,t=document.createElement("link");t.rel="preconnect",t.href=f,n.appendChild(t);const o=document.createElement("link");o.rel="stylesheet",o.href=`${f}/inter/inter.css`,n.appendChild(o),e("Zonos font injected!")},y.setupGoogleFont=e=>{var n;null===(n=u.zonosController)||void 0===n||n.setupGoogleFont(e)},y.injectSupportGoogleFont=n=>{var t;e(`[FONT] injecting ${n}`);const o=null===(t=n.match(/family=(.*?):/))||void 0===t?void 0:t[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${h}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=h,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${n}"]`))return void e(`[FONT] ${o} font already injected`,"warn");const r=document.createElement("link");r.rel="stylesheet",r.href=n,s.appendChild(r),e(`[FONT] ${o} font injected!`)};export{y as Zonos}
1
+ import{l as e,a as n}from"./p-4146feec.js";import{s as t,c as o}from"./p-588396df.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./p-588396df.js";const s=["jsdelivr","cdnjs","unpkg","vercel"],r="jsdelivr",i=e=>{const n=s.indexOf(e);return s[n+1]||null},l="https://js.stripe.com/v3",u=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,a="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let m=null;const p=Promise.resolve().then((()=>{return e=null,null!==m||(m=new Promise(((t,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(a),window.Stripe)t(window.Stripe);else try{let s=(()=>{const e=document.querySelectorAll(`script[src^="${l}"]`);for(let n=0;n<e.length;n++){const t=e[n];if(t&&u.test(t.src))return t}return null})();s&&e?console.warn(a):s||(s=(e=>{const t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${l}${t}`;const s=document.head||document.body;return s?(s.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==s||s.addEventListener("load",(()=>{window.Stripe?t(window.Stripe):o(new Error("Stripe.js not available"))})),null==s||s.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else t(null)}))),m;var e}));let w=!1;var f;p.catch((e=>{w||console.warn(e)}));const h=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,t=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),o=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:o,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?n:null})(),v="https://v1.3.53.js.zonos.com",y=h||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.53",z="https://rsms.me",j="https://fonts.googleapis.com",S=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class g{}f=g,g.doneInit=!1,g.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),g.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),g._paypalMockResponse=null,g.isBigCommerce=!1,g.releaseDate="1726614519273",g.isLegacyCheckout=!1,g.isNpm=!0,g.zonosQaUrl=null,g.version="v1.3.53",g.modeAlerted=!1,g.cartData=null,g.paypal=null,g.getCurrentTimestamp=()=>(new Date).getTime(),g.zonosController=null,g.init=async({appearance:s,checkoutSettings:r,currencyConverter:i,helloSettings:c,onCountryChange:l,overrideCurrencyFormat:d,storeId:u,zonosApiKey:a})=>{if(f.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!f.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${f.version}) ======`),f.zonosApiKey=a,f.storeId=u,f.isNpm){if(e("====== ZONOS LOADING FROM NPM ======"),!a&&!f.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!f.cartData&&f.cartId){e("Initialize cart data");const o=await t(f.cartId);if(!o)return void n("Failed to get cart data");f.cartData=o.cartData,f.zonosApiKey=o.zonosApiKey}}if(f.cartId&&f.cartData){e("Cart data is available, inject hidden button and trigger checkout");const n=document.createElement("button");n.style.display="none",n.id=`${o}`,document.body.appendChild(n)}e("init zonos"),f.injectZonosCdn(),f.injectZonosCss(),f.injectFonts(),f.injectController({config:{appearance:s,checkoutSettings:r,currencyConverter:i,helloSettings:c,onCountryChange:l,overrideCurrencyFormat:d}}),f.doneInit=!0}},g.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},g.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},g.showNotification=e=>{var n;null===(n=f.zonosController)||void 0===n||n.showNotification(e)},g.updateOrganizationName=e=>{var n;null===(n=f.zonosController)||void 0===n||n.updateOrganizationName(e)},g.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:t,placeOrderButtonSelector:o})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&o){const n=document.querySelectorAll(o),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&t&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},g.injectController=({config:t})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=t.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const e=t.checkoutSettings.placeOrderButtonSelector;f.disablePlaceOrderButtons({config:t,disable:!0,placeOrderButtonSelector:e}),new MutationObserver((()=>{f.disablePlaceOrderButtons({config:t,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=t,s.zonosApiKey=f.zonosApiKey||"",s.addEventListener("stripeInitEvent",(async t=>{const{detail:o}=t;e("loading Stripe");const r=await(async(...e)=>{w=!0;const n=Date.now();return p.then((t=>((e,n,t)=>{if(null===e)return null;const o=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(o,t),o})(t,e,n)))})(o.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),f.zonosController=s,e("Zonos controller injected!")},g.injectScript=({cdnType:t,isModule:o,theRestUrl:s})=>{const r=`${f.getZonosUrl(t)}/${s}`;if(document.querySelector(`script[src="${r}"]`))return void e(`Zonos script "${r}" already exists in the document`,"warn");const c=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=r,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const e=i(t);e&&f.injectScript({cdnType:e,isModule:o,theRestUrl:s})},c.appendChild(l)},g.getZonosUrl=n=>{const t=()=>{switch(n){case"jsdelivr":return y;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.53";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.53";case"vercel":return v}};return f.isNpm&&(()=>{const n=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||n)return null;const t=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.53.js.zonos.com";if(!t&&(o.includes("test.")||o.includes("test-")))return o;if(!t&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!t)return null;if("dev-elements"===t)return"https://dev.elements.zonos.com";const s=`https://${t}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${s}' for loading script`,"warn"),fetch(s).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${s}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,t=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),s})()||t()},g.injectZonosCdn=()=>{f.injectScript({cdnType:r,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),f.injectScript({cdnType:r,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},g.injectStylesheet=({cdnType:e,theRestUrl:t})=>{const o=f.getZonosUrl(e),s=document.head||document.body,r=document.createElement("link");r.rel="preconnect",r.href=`${v}/`,s.appendChild(r);const c=document.createElement("link");c.rel="stylesheet",c.href=`${o}/${t}`,c.onerror=()=>{n(`Failed to load ${c.href}`);const o=i(e);o&&f.injectStylesheet({cdnType:o,theRestUrl:t})},s.appendChild(c)},g.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(f.injectStylesheet({cdnType:r,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},g.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${z}"]`);for(let n=0;n<e.length;n++){const t=e[n];if(t&&!S.test(t.href))return t}return null})())return void e("Inter font already injected","warn");const n=document.head||document.body,t=document.createElement("link");t.rel="preconnect",t.href=z,n.appendChild(t);const o=document.createElement("link");o.rel="stylesheet",o.href=`${z}/inter/inter.css`,n.appendChild(o),e("Zonos font injected!")},g.setupGoogleFont=e=>{var n;null===(n=f.zonosController)||void 0===n||n.setupGoogleFont(e)},g.injectSupportGoogleFont=n=>{var t;e(`[FONT] injecting ${n}`);const o=null===(t=n.match(/family=(.*?):/))||void 0===t?void 0:t[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${j}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=j,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${n}"]`))return void e(`[FONT] ${o} font already injected`,"warn");const r=document.createElement("link");r.rel="stylesheet",r.href=n,s.appendChild(r),e(`[FONT] ${o} font injected!`)};export{g as Zonos}
@@ -0,0 +1 @@
1
+ import{r as o,c as t,h as n,H as e}from"./p-5b7da777.js";import{w as i,j as s,x as r,d as a,a as c}from"./p-895fdefb.js";import{z as l,b as d,d as h}from"./p-9dd6b00d.js";import{h as u,a as m,l as f}from"./p-4146feec.js";import"./p-23a84835.js";import"./p-f05f3e27.js";const p=o=>{const t=document.querySelector(o);if(!document.querySelector("zonos-hello")&&t){const o=document.createElement("zonos-hello");return t.appendChild(o),!0}return!1},w=async o=>{const{anchorElementSelector:t}=o;let n=t;if(!o.anchorElementSelector&&o.desktopLocation){const o=(({position:o="bottom-right"})=>{const t=".zonos--hello-mobile-wrapper";if(document.querySelector(t))return t;const n=document.createElement("div");return n.className="zonos--hello-mobile-wrapper",n.style.position="fixed","top-right"===o&&(n.style.top="72px",n.style.right="24px"),"top-left"===o&&(n.style.top="72px",n.style.left="24px"),"bottom-right"===o&&(n.style.bottom="72px",n.style.right="24px"),"bottom-left"===o&&(n.style.bottom="72px",n.style.left="24px"),n.style.zIndex="2147483007",document.body.appendChild(n),t})({position:"bottom-right"});n=o}if(n&&i(n)){if(f("Hello init complete"),!p(n)){const o=new MutationObserver((()=>{p(n)&&o.disconnect()}));o.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>{p(n)}),1e3)}}else m(`Selector anchorElementSelector "${o.anchorElementSelector}" is not a valid selector.`)},y=class{constructor(n){o(this,n),this.paypalInitEvent=t(this,"paypalInitEvent",7),this.stripeInitEvent=t(this,"stripeInitEvent",7),this.config=void 0,this.zonosApiKey=void 0}async initCheckoutElement(o){var t;o?(s.stripe=o,((t=l.checkoutSettings).placeOrderButtonSelector||window.Zonos.cartData)&&(!t.placeOrderButtonSelector||i(t.placeOrderButtonSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const o=document.createElement("zonos-checkout");document.body.appendChild(o)}})():m(`Selector checkoutButtonAnchor "${t.placeOrderButtonSelector}" is not a valid selector`)),f("init checkout element")):f("Stripe is not loaded yet - cannot init checkout element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const o=document.createElement("zonos-notification");document.body.appendChild(o)}async setupGoogleFont(o){var t,n;const e=o||h();if("Inter"===e){if(!o)return;f("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn"),l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:o})}const i=new URLSearchParams;i.set("family",e);const{errors:s,json:r}=await u(`/api/zonos-elements/get-font-detail?${i.toString()}`);if(s.length>0||!(null==r?void 0:r.fontUrl))return f(`Failed to load font ${e}`,"warn"),void(l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:"Inter"}));null===(n=(t=window.Zonos).injectSupportGoogleFont)||void 0===n||n.call(t,r.fontUrl),o&&(f(`[FONT] ${o} font override applied`),l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:o}))}handleLocationChange(){w(l.helloSettings)}initHistoryListener(){const o=history.pushState;history.pushState=function(){return window.dispatchEvent(new window.Event("pushstate")),window.dispatchEvent(new window.Event("locationchange")),o.apply(this,arguments)};const t=history.replaceState;history.replaceState=function(){return window.dispatchEvent(new window.Event("replacestate")),window.dispatchEvent(new window.Event("locationchange")),t.apply(this,arguments)}}async componentWillLoad(){this.initHistoryListener(),l.zonosApiKey=this.zonosApiKey,(async()=>{var o,t;const{errors:n,json:e,zonosMode:i}=await(async()=>{const{errors:o,json:t,zonosMode:n}=await u("/api/zonos-elements/zonos-settings");return o.length?(m("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings"),{errors:o,json:null,zonosMode:n}):{errors:[],json:t,zonosMode:n}})();if("403"===(null===(o=n[0])||void 0===o?void 0:o.type.toString()))return void f("Failed to load zonos settings. This domain may not have access","warn");this.initZonosNotification();const s=Object.assign(Object.assign({},this.config),{checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:void 0}):void 0});d({overrideSettings:s,zonosSettings:e}),l.zonosMode=i,this.setupGoogleFont(),"DISABLED"===l.helloSettings.visibilityStatus&&f("=== Hello is disabled by store owner ===","warn"),l.helloSettings&&"ENABLED"===l.helloSettings.visibilityStatus&&(f("Initializing hello"),w(l.helloSettings)),await r();const a=(null===(t=null==e?void 0:e.checkoutSettings)||void 0===t?void 0:t.externalServiceTokens.find((o=>"STRIPE_PUBLISHABLE_TOKEN"===o.type)))||null;if(a&&this.stripeInitEvent)return"INACTIVE"===l.checkoutSettings.subscriptionStatus?(f('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void f("zonos controller loaded")):"DISABLED"===l.checkoutSettings.visibilityStatus?(f("=== Checkout is disabled by store owner ===","warn"),void f("zonos controller loaded")):void this.stripeInitEvent.emit({publishableKey:a.token});f("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(o){const t=document.querySelector("zonos-notification");t?t.showNotification(o):f("Failed to show notification - zonos-notification not found","warn")}async reset(){a.checkoutSessionId=null,s.clientSecret=null}async overrideConfig(o){d({overrideSettings:o,zonosSettings:null})}async overrideCountry(o){f(`Override country code to ${o}`),c(o)}async getAppearanceSetting(){return l.appearance}async updateOrganizationName(o){l.organizationName=o}render(){return n(e,{key:"4d7d784a50ebcb61ee4658198f3dcf756daf8d70",class:"zonos--elements"})}};y.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";export{y as zonos_controller}
@@ -0,0 +1 @@
1
+ var __awaiter=this&&this.__awaiter||function(o,e,t,n){function s(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,c){function i(o){try{u(n.next(o))}catch(o){c(o)}}function r(o){try{u(n["throw"](o))}catch(o){c(o)}}function u(o){o.done?t(o.value):s(o.value).then(i,r)}u((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},n,s,c,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(o){return function(e){return u([o,e])}}function u(r){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(t=0)),t)try{if(n=1,s&&(c=r[0]&2?s["return"]:r[0]?s["throw"]||((c=s["return"])&&c.call(s),0):s.next)&&!(c=c.call(s,r[1])).done)return c;if(s=0,c)r=[r[0]&2,c.value];switch(r[0]){case 0:case 1:c=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;s=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(c=t.trys,c=c.length>0&&c[c.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!c||r[1]>c[0]&&r[1]<c[3])){t.label=r[1];break}if(r[0]===6&&t.label<c[1]){t.label=c[1];c=r;break}if(c&&t.label<c[2]){t.label=c[2];t.ops.push(r);break}if(c[2])t.ops.pop();t.trys.pop();continue}r=e.call(o,t)}catch(o){r=[6,o];s=0}finally{n=c=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-8f7773b0.system.js","./p-f124e459.system.js","./p-8e8defdc.system.js","./p-5590f90c.system.js","./p-aed0098c.system.js","./p-a74a7afa.system.js","./p-23e7c655.system.js","./p-e97793ce.system.js","./p-29814fd7.system.js","./p-f87a635b.system.js","./p-2770ba48.system.js"],(function(o){"use strict";var e,t,n,s,c,i,r,u,a,h,d,l,f,z,m,k,p,v,g,b,w,y,x,C,_,j,S,A,I,O,B,T,L,P,N,D,E,H,M,R,U,Z,F,V,G;return{setters:[function(o){e=o.r;t=o.h;n=o.H;s=o.F},function(o){c=o.l;i=o.s;r=o.a;u=o.b;a=o.c;h=o.i;d=o.d;l=o.e;f=o.f;z=o.g;m=o.h;k=o.j;p=o.k;v=o.m;g=o.n;b=o.t;w=o.o;y=o.p;x=o.q;C=o.r;_=o.u;j=o.v},function(o){S=o.s;A=o.p},function(o){I=o.z;O=o.g;B=o.m},function(o){T=o.c;L=o.t;P=o.g},function(o){N=o.i},function(o){D=o.l;E=o.a;H=o.s},function(o){M=o.c},function(o){R=o.g},function(o){U=o.i},function(o){Z=o.s;F=o.d;V=o.c},function(o){G=o.R}],execute:function(){var W=this;var Y=function(o){var e=o.items.map((function(o){return{amount:o.amount,attributes:o.attributes||[],countryOfOrigin:o.countryOfOrigin||undefined,currencyCode:o.currencyCode,description:o.description||"",imageUrl:o.imageUrl||"",itemType:o.itemType||"PHYSICAL_GOOD",measurements:o.measurements||[],name:o.name||o.description||"",productId:o.productId||"",quantity:o.quantity||0,sku:o.sku||""}}))||[];return{adjustments:o.adjustments,cartItems:e}};var q=function(o){if(o===void 0){o=true}if(!c.localizationLoaded){return false}if(!c.isShippableCountry){document.dispatchEvent(T("legacyCheckoutError","Unable to initiate checkout process in a country where shipping is not available"));if(o){D("Checkout: not shippable country")}return false}return true};var J=function(o){var e=o.domesticRedirectedBtnSelector,t=o.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}var n=new MutationObserver((function(){return __awaiter(W,void 0,void 0,(function(){var o,s,c,h,d;var l=this;return __generator(this,(function(f){o=document.querySelector(e);s=i();if(!o&&s){c=document.createElement("button");c.style.display="none";c.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(c);t===null||t===void 0?void 0:t(s);n.disconnect();return[2]}h=document.querySelector('select[name="shippingAddress.countryCode"]');d=document.querySelector("#checkout-shipping-continue");if(!h||!d){return[2]}n.disconnect();d.addEventListener("click",(function(o){return __awaiter(l,void 0,void 0,(function(){var e,t,n,s,c,i,d;return __generator(this,(function(l){n=h.value;if(!n){return[2]}r(n);if(!q(false)){u();return[2]}s=document.querySelector("form");if(!s){return[2]}c=new FormData(s);i=document.querySelector("input#addressLine1Input");d={address1:(e=c.get("shippingAddress.address1"))!==null&&e!==void 0?e:i&&i.value,address2:c.get("shippingAddress.address2"),city:c.get("shippingAddress.city"),countryCode:c.get("shippingAddress.countryCode"),firstName:c.get("shippingAddress.firstName"),lastName:c.get("shippingAddress.lastName"),phone:c.get("shippingAddress.phone"),postalCode:c.get("shippingAddress.postalCode"),stateOrProvince:(t=c.get("shippingAddress.stateOrProvince"))!==null&&t!==void 0?t:c.get("shippingAddress.stateOrProvinceCode")};if(Object.values(d).some((function(o){return o===undefined||o===null}))){E("One or more shipping address field is missing",Object.entries(d));void H({endpoint:"No endpoint, domestic checkout form missing fields",errors:["Bigcommerce: One or more shipping address field is missing in the domestic checkout form",JSON.stringify(Object.entries(d))],metadata:{domain:window.location.hostname,storeId:I.storeId}});return[2]}a({address1:d.address1,address2:d.address2,city:d.city,countryCode:d.countryCode,firstName:d.firstName,lastName:d.lastName,phone:d.phone,postalCode:d.postalCode,state:d.stateOrProvince});o.preventDefault();o.stopPropagation();window.location.href="/";return[2]}))}))}));return[2]}))}))}));n.observe(document.body,{childList:true,subtree:true})};var K='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var Q=".sc-zonos-checkout-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout img.sc-zonos-checkout{width:150px;min-width:150px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--close-button.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}";var X=Q;var $=90*60*1e3;var oo=o("zonos_checkout",function(){function o(o){var t=this;e(this,o);this.onChangeLocaleListener=function(){};this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,t,n,s;return __generator(this,(function(c){switch(c.label){case 0:s=((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme)||I.appearance.theme;return[4,h({overrideBorderRaidus:(e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.style,overridePrimaryColor:(t=this.appearanceSettingsOverride)===null||t===void 0?void 0:t.colorPrimary,overrideSecondaryColor:(n=this.appearanceSettingsOverride)===null||n===void 0?void 0:n.colorSecondary,overrideTheme:this.isMobile?s:undefined})];case 1:c.sent();return[2]}}))}))};this.getCurrentLocalePageEnum=function(){switch(d.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}};this.appearanceSettingsOverride=undefined;this.preview=false;this.mobile=false;this.defaultAddress=null;this.forceDialogOpen=false;this.open=this.forceDialogOpen;this.stripe=window.Zonos.stripe;this.submitLoading=false;this.collapseReviewMobile=true;this.isAttachError=false;this.isMobile=false;this.zonosReviewRef=undefined;this.storybookPaymentStatusOverride=undefined;this.isLegacyCheckout=window.Zonos.isLegacyCheckout;this.confirmDialogOpen=false;this.inventoryCheckErrorMessage=null}o.prototype.initCartInfoHandler=function(o){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=o.detail;void l({adjustments:d.adjustments,cartItems:e});return[2]}))}))};o.prototype.handleKeyPress=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(o.key==="Escape"){void this.closeDialogHandler()}return[2]}))}))};o.prototype.closeDialogHandler=function(o){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){if(!this.open){return[2]}if(!(o===null||o===void 0?void 0:o.confirmed)){this.confirmDialogOpen=true;return[2]}this.confirmDialogOpen=false;S("zonos-checkout-close");this.open=this.forceDialogOpen||false;if(!this.preview&&d.step==="finish"){f()}d.step="customer-info";z();m();(t=(e=I.checkoutSettings).onClose)===null||t===void 0?void 0:t.call(e);return[2]}))}))};o.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n,s,i,r,e,t,t,u;return __generator(this,(function(a){switch(a.label){case 0:if(!window.Zonos.cartData)return[3,2];D("tempCartUUID is provided, start building cart");o=Y(window.Zonos.cartData),e=o.adjustments,t=o.cartItems;return[4,l({adjustments:e,cartItems:t})];case 1:a.sent();return[3,9];case 2:if(!(typeof I.checkoutSettings.createCartId==="function"))return[3,6];D('"createCartId" is provided, start building cart');return[4,I.checkoutSettings.createCartId()];case 3:n=a.sent();window.Zonos.cartId=n;return[4,Z(n)];case 4:s=a.sent();i=s===null||s===void 0?void 0:s.cartData;if(!i){E("Fail to build cart, please try again.");return[2]}r=Y(i),e=r.adjustments,t=r.cartItems;return[4,l({adjustments:e,cartItems:t})];case 5:a.sent();return[3,9];case 6:if(!(I.checkoutSettings.buildCartDetail&&c.selectedCountryCode))return[3,9];D("build cart detail");return[4,I.checkoutSettings.buildCartDetail({countryCode:c.selectedCountryCode,currencyCode:c.targetCurrency})];case 7:t=a.sent();return[4,l({adjustments:[],cartItems:t})];case 8:a.sent();a.label=9;case 9:if(!!k.clientSecret)return[3,11];return[4,p()];case 10:u=a.sent();D("stripeStoreInitCheckoutSession: ".concat(u));if(!u){return[2,false]}a.label=11;case 11:return[4,this.applyStripeTheme()];case 12:a.sent();return[2,true]}}))}))};o.prototype.reloadCheckoutSession=function(){window.location.reload()};o.prototype.attachCheckout=function(){var o=this;var e=I.checkoutSettings.placeOrderButtonSelector;D("attach checkout ".concat(e));if(!e&&!window.Zonos.cartData){return}var t=[e,"#".concat(F),"#".concat(V)].filter(Boolean);var n=document.querySelectorAll(t.join(","));n.forEach((function(t){var n=t.getAttribute("data-zonos-checkout-attached");if(n){return}D("attached event to button ".concat(e),"info",{button:t});t.addEventListener("click",(function(e){return __awaiter(o,void 0,void 0,(function(){var o,t;return __generator(this,(function(n){switch(n.label){case 0:if(!q()){return[2]}e.preventDefault();e.stopPropagation();D("zonos checkout button clicked");k.isFetchingSession=true;this.open=true;n.label=1;case 1:n.trys.push([1,3,,4]);return[4,this.buildCartAndInit()];case 2:o=n.sent();if(!o){throw new Error("Error building cart")}v({isPreview:this.preview,sessionTimeout:$});S("zonos-checkout-start");void L("checkout_open");return[3,4];case 3:t=n.sent();k.isFetchingSession=false;g({messages:[b("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:b("Error creating Checkout")});return[3,4];case 4:return[2]}}))}))}),{capture:true,passive:false});if(!I.checkoutSettings.disablePlaceOrderButtonActivation){t.removeAttribute("disabled")}t.setAttribute("data-zonos-checkout-attached","true");if(t.matches(F)){t.dispatchEvent(T("click"));u();t.remove()}if(t.matches("#".concat(V))){t.dispatchEvent(T("click"));t.remove()}}))};o.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}void this.applyStripeTheme()};o.prototype.useLegacyQueryParam=function(){var o=new URLSearchParams(window.location.search);var e={country:o.get("country"),customerAddress1:o.get("customerAddress1"),customerAddress2:o.get("customerAddress2"),customerCity:o.get("customerCity"),customerEmail:o.get("customerEmail"),customerName:o.get("customerName"),customerPhone:o.get("customerPhone"),customerState:o.get("customerState"),customerZip:o.get("customerZip")};if(!e.customerAddress1||!e.customerCity||!e.customerName||!e.customerPhone||!e.customerState||!e.customerZip||!e.country){return}this.defaultAddress={address:{city:e.customerCity,country:e.country,line1:e.customerAddress1,line2:e.customerAddress2||"",postal_code:e.customerZip,state:e.customerState},email:e.customerEmail||"",name:e.customerName,phone:e.customerPhone}};o.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var o;var e=this;return __generator(this,(function(t){k.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;J({domesticRedirectedBtnSelector:F,onShippingAddressSessionFound:function(o){e.defaultAddress={address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:"".concat(o.firstName," ").concat(o.lastName),phone:o.phone}}});if(window.Zonos){this.useLegacyQueryParam()}o=setInterval((function(){k.stripe=window.Zonos.stripe;e.stripe=window.Zonos.stripe;if(!e.stripe){D("waiting for stripe to be loaded");return}if(e.storybookPaymentStatusOverride){clearInterval(o);return}D("init checkout");if(e.preview||e.forceDialogOpen){void e.buildCartAndInit()}else{e.attachCheckout();var t=new MutationObserver((function(){e.attachCheckout()}));t.observe(document.body,{childList:true,subtree:true})}clearInterval(o)}),50);setTimeout((function(){clearInterval(o)}),1e4);return[2]}))}))};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){d.step="finish";this.storybookPaymentStatusOverride=o;return[2]}))}))};o.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o;var e=this;return __generator(this,(function(t){switch(t.label){case 0:this.submitLoading=true;return[4,w()];case 1:t.sent();o=setInterval((function(){if(d.landedCostData||!k.isFetchingLandedCost){if(d.landedCostData){void A({currency:d.currency});y()}e.submitLoading=false;clearInterval(o)}}),500);return[2]}}))}))};o.prototype.handleShippingContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o=this;return __generator(this,(function(e){this.submitLoading=true;setTimeout((function(){y();o.submitLoading=false}),500);return[2]}))}))};o.prototype.handleInventoryCheckDialogCancel=function(){d.inventoryCheckErrorMessage=null};o.prototype.handleInventoryCheckDialogConfirm=function(){d.inventoryCheckErrorMessage=null;void this.closeDialogHandler({confirmed:true})};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t;return __generator(this,(function(n){switch(n.label){case 0:k.hasPaymentError=false;this.submitLoading=true;d.inventoryCheckErrorMessage=null;n.label=1;case 1:n.trys.push([1,3,,4]);o=d;return[4,x()];case 2:o.inventoryCheckErrorMessage=n.sent();return[3,4];case 3:e=n.sent();d.inventoryCheckErrorMessage=b("Unable to check inventory. Please try again.");return[3,4];case 4:if(d.inventoryCheckErrorMessage){this.submitLoading=false;return[2]}n.label=5;case 5:n.trys.push([5,7,,8]);return[4,C()];case 6:n.sent();y();m();return[3,8];case 7:t=n.sent();E(t);k.hasPaymentError=true;return[3,8];case 8:this.submitLoading=false;return[2]}}))}))};o.prototype.handleFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n;return __generator(this,(function(s){switch(s.label){case 0:_();if(!this.preview)return[3,2];d.step="customer-info";return[4,this.init()];case 1:s.sent();return[2];case 2:f();if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData){o=window.Zonos.cartData.storeBaseUrl;window.location.href=o;return[2]}e=window.location.href;t=e.split("?")[0];n=P();this.open=false;if(!n){window.history.replaceState(window.history.state,document.title,t);window.location.reload()}return[2]}}))}))};o.prototype.handleWindowResize=function(){this.isMobile=N(this.mobile);void this.applyStripeTheme();D("mobile: ".concat(this.isMobile))};o.prototype.handleMobileChange=function(){this.isMobile=N(this.mobile);void this.applyStripeTheme();D("mobile: ".concat(this.isMobile))};o.prototype.handleAppearanceSettingsOverrideChange=function(){var o;if((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme){this.appearanceSettingsOverride.theme=O(this.appearanceSettingsOverride.theme)}};o.prototype.handleAddressChange=function(){_()};o.prototype.componentWillLoad=function(){var o=this;void this.init();this.isMobile=N(this.mobile);this.handleAppearanceSettingsOverrideChange();this.onChangeLocaleListener=j("selectedLocale",(function(){void o.applyStripeTheme()}));D("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){_();f();this.onChangeLocaleListener()};o.prototype.render=function(){var o=this;var e;var i=d.step!=="finish"&&d.step!=="error"&&!k.stripeElements||k.isFetchingSession;var r=B(I.appearance,this.appearanceSettingsOverride),u=r.colorPrimary,a=r.colorSecondary,h=r.logoUrl,l=r.style;var f=I.appearance.zonosAttribution==="ENABLED";var z=I.appearance.theme;var m=u&&U(u)?"DARK":"LIGHT";var p=this.isMobile?z:m;var v=!this.isMobile?a:undefined;var g=c.customMessages;var w=(e=g.find((function(o){return o.pageName==="checkout_default"})))===null||e===void 0?void 0:e.message;var y=this.getCurrentLocalePageEnum();var x=g.filter((function(o){return o.pageName===y}));var C=function(){var e=o.preview?"".concat(h,"?timestamp=").concat(Date.now()):h;return t("div",{class:"zonos--logo"},e&&t("img",{alt:"".concat(I.organizationName," logo"),src:e,width:100}))};var _=P();var j=function(){return t("zonos-v-stack",null,t("div",{class:"zonos--logo-wrapper"},C(),_&&t("zonos-badge",{badgeColor:"orange",size:"small"},b("Test mode"))),t("zonos-checkout-progress-tabs",{backgroundColor:o.isMobile?"--zonos-elements-gray-0":null}),x.map((function(o){return t("zonos-custom-message",{icon:K,message:o.message})})))};var S=function(){if(d.checkoutSessionTimeoutShow){return t("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:b("Your checkout session has expired. Please reload the page to continue."),restStateTitle:b("Session timed out"),restStateType:"Warning"},t("zonos-button",{onClick:function(){return o.reloadCheckoutSession()},variant:"primary"},b("Reload")))}return t("div",{class:"zonos--content",style:{"--border-radius":R({overrideBorderStyle:l})}},d.step!=="finish"&&d.step!=="error"&&t(s,null,t("div",{class:"zonos--left","data-theme":p,style:{"--primary-color":!o.isMobile?u:""}},!o.isMobile&&j(),d.step==="customer-info"&&t("zonos-customer-info",{continueLoading:o.submitLoading,defaultAddress:o.defaultAddress,isMobile:o.isMobile,onContinueClicked:function(){return o.handleCustomerInfoContinue()},submitBtnColor:v}),d.step==="shipping"&&t("zonos-shipping",{continueLoading:o.submitLoading,onContinueClicked:function(){return o.handleShippingContinue()},submitBtnColor:v}),d.step==="payment"&&t("zonos-checkout-payment",{continueLoading:o.submitLoading,onContinueClicked:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:o.sent();return[2]}}))}))},submitBtnColor:v})),t("div",{class:"zonos--right","data-theme":z},o.isMobile&&j(),!o.isLegacyCheckout&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:G}),noBackground:true,onClick:function(){return o.closeDialogHandler()}}),t("div",{class:"flex--wrapper"},t("div",{class:"zonos--wrapper"},t("zonos-review",{collapsed:o.collapseReviewMobile,mobile:o.isMobile,onClick:function(){if(!o.isMobile){return}o.collapseReviewMobile=!o.collapseReviewMobile}}),t("zonos-collapse",{collapsed:o.collapseReviewMobile&&o.isMobile},t("zonos-cart-items",null),o.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",null),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:K,message:w})))),t("zonos-cart-restricted-items",null),!o.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",null),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:K,message:w}))))),(d.step==="finish"||d.step==="error")&&t("div",{class:"zonos--done","data-theme":z},t("div",{class:"zonos--header"},C(),t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:G}),noBackground:true,onClick:function(){return o.handleFinishClick()},theme:z})),t("zonos-checkout-finish",{borderRadius:l,onCloseClick:function(){return o.handleFinishClick()},overrideNotification:d.step==="error"&&!!d.error?Object.assign(Object.assign({},d.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),t("zonos-checkout-footer",{"data-theme":z,mobile:o.isMobile,slot:!o.isMobile?"dialog-footer":undefined}))};return t(n,{class:M(["zonos--checkout zonos--elements",f&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile"])},this.preview?S():t("zonos-dialog",{borderStyle:l,"data-theme":z,height:"980px",isLoading:i,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return o.closeDialogHandler()},open:this.open,width:"1200px"},S()),t("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:b("Don't close"),dialogConfirmBtnText:b("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:b("Would you like to close checkout and return to the site?"),dialogTitle:b("Are you sure?"),onCancelClicked:function(){o.confirmDialogOpen=false},onConfirmClicked:function(){return o.closeDialogHandler({confirmed:true})}}),t("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:b("Return to cart"),dialogIntent:"danger",dialogOpen:!!d.inventoryCheckErrorMessage,dialogSubtitle:d.inventoryCheckErrorMessage,dialogTitle:b("Couldn't place order"),dialogType:"alert",onCancelClicked:function(){o.handleInventoryCheckDialogCancel()},onConfirmClicked:function(){return o.handleInventoryCheckDialogConfirm()}}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"]}},enumerable:false,configurable:true});return o}());oo.style=X}}}));
@@ -0,0 +1 @@
1
+ import{r as o,c as e,h as t,F as s,H as i}from"./p-5b7da777.js";import{t as n,l,D as a}from"./p-895fdefb.js";import{z as r}from"./p-9dd6b00d.js";import{c as d}from"./p-b4b7f705.js";import{f as h}from"./p-a87561b8.js";import{g as c}from"./p-5883217a.js";import"./p-4146feec.js";import"./p-23a84835.js";import"./p-f05f3e27.js";const f=`${n("The low-value GST law passed July 1st, 2018 applies to this retailer.")} ${(({href:o,text:e})=>`<zonos-link href="${o}" target="_blank" rel="noopener noreferrer">${e}</zonos-link>`)({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst",text:n("Learn more.")})}`,m=class{constructor(t){o(this,t),this.closeDialog=e(this,"closeDialog",7),this.clickOutsideDialogHandler=o=>{!o.composedPath().includes(this.dialogRef)&&this.isOpen&&this.setIsOpen(!1)},this.getCurrentPageEnum=()=>{switch(r.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}},this.setShowCountrySelect=async o=>{this.showCountrySelect=o},this.setShowLanguageSelect=async o=>{this.showLanguageSelect=o},this.hasTaxId=()=>{var o;return null===(o=l.countryLandedCost)||void 0===o?void 0:o.hasTaxId},this.hasInclusivePrices=()=>{var o;return"ENABLED"===(null===(o=l.inclusivePricing)||void 0===o?void 0:o.status)},this.isNoThresholdCountry=o=>!(!o||!this.hasTaxId())&&["AU"].includes(o),this.getDutyMessage=()=>{const{countryLandedCost:o}=l,e=(null==o?void 0:o.dutyDeminimus)?a({amount:o.dutyDeminimus}):null;return e&&!this.isNoThresholdCountry(null==o?void 0:o.countryCode)?n("Spend [threshold] duty free.",{threshold:e}):n("Duties will apply to all orders.")},this.getTaxMessage=()=>{const{countryLandedCost:o}=l,e=(null==o?void 0:o.vatTaxDeminimus)?a({amount:o.vatTaxDeminimus}):null;return e&&!this.isNoThresholdCountry(null==o?void 0:o.countryCode)?n("Spend [threshold] tax free.",{threshold:e}):n("Taxes will apply to all orders.")},this.getUkDutyTaxMessage=o=>o.allowLowValueOrders?null:[n("Orders to [countryName] must be over [threshold] to ship.",{countryName:"United Kingdom",threshold:a({amount:o.dutyDeminimus})})],this.getAustraliaDutyTaxMessage=o=>this.hasInclusivePrices()?[f]:[n("Duties & taxes in Australia, VAT or GST is [percentage] and is due on all orders.",{percentage:100*o.vatTaxRate+"%"}),f],this.getNewZealandDutyTaxMessge=o=>this.hasInclusivePrices()?null:[n("[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.",{percentage:100*o.vatTaxRate+"%",threshold:a({amount:o.vatTaxDeminimus})})],this.getInclusivePriceMessage=()=>{const o=l.inclusivePricing;return"ENABLED"!==(null==o?void 0:o.status)?null:"INCLUDED"===o.duty.status&&"INCLUDED"===o.tax.status&&"INCLUDED"===o.fee.status?n("Product prices already include duties, taxes, and fees. No additional duties, taxes, or fees will be added at checkout, with rare exceptions."):"INCLUDED"===o.duty.status&&"INCLUDED"===o.tax.status?n("Product prices already include duties and taxes. No additional duties or taxes will be added at checkout, with rare exceptions."):"INCLUDED"===o.duty.status&&"INCLUDED"===o.fee.status?n("Product prices already include duties and fees. No additional duties or fees will be added at checkout, with rare exceptions."):"INCLUDED"===o.tax.status&&"INCLUDED"===o.fee.status?n("Product prices already include taxes and fees. No additional taxes or fees will be added at checkout, with rare exceptions."):"INCLUDED"===o.duty.status?n("Product prices already include duties. No additional duties will be added at checkout, with rare exceptions."):"INCLUDED"===o.tax.status?n("Product prices already include taxes. No additional taxes will be added at checkout, with rare exceptions."):"INCLUDED"===o.fee.status?n("Product prices already include fees. No additional fees will be added at checkout, with rare exceptions."):null},this.getAdditionalDutyTaxMessage=()=>{if(!l.countryLandedCost)return null;if(!this.hasTaxId())return null;switch(l.countryLandedCost.countryCode){case"GB":return this.getUkDutyTaxMessage(l.countryLandedCost);case"AU":return this.getAustraliaDutyTaxMessage(l.countryLandedCost);case"NZ":return this.getNewZealandDutyTaxMessge(l.countryLandedCost);default:return null}},this.isOpen=!1,this.setIsOpen=()=>{},this.mobileLocationOverride=void 0,this.animateFromLeftOverride=void 0,this.appearanceSettings=void 0,this.restrictedItems=[],this.welcomeMessage="Welcome to our Demo App!",this.showCountrySelect=!1,this.showLanguageSelect=!1}globalClickHandler(o){this.clickOutsideDialogHandler(o)}isOpenHandler(o){o||(this.setShowCountrySelect(!1),this.setShowLanguageSelect(!1))}render(){var o;const{selectedCountryCode:e}=l,a=this.hasInclusivePrices(),f=this.getInclusivePriceMessage(),m=this.getDutyMessage(),g=this.getTaxMessage(),u=this.getAdditionalDutyTaxMessage(),p=this.animateFromLeftOverride||this.dialogRef&&c(this.dialogRef),b=this.dialogRef&&(()=>{const o=this.dialogRef.getBoundingClientRect();return o.top>=window.innerHeight-o.bottom})(),{customMessages:w}=l,x=n("Welcome to [storeName]",{storeName:r.organizationName}),C=(null===(o=w.find((o=>"hello_default"===o.pageName)))||void 0===o?void 0:o.message)||n("Know about duties and taxes before you buy. Shop with confidence!"),z=h(C),v=this.getCurrentPageEnum(),y=w.filter((o=>o.pageName===v));return t(i,{key:"df052224c778ebfceeef7c827fa3da0e8a2f3dc9",class:"zonos--elements"},t("div",{key:"0ecff6a07d24a72fb4f200cce82ab09e40b48baf",class:d(["zonos--hello-dialog",p&&"zonos--hello-dialog-animate-from-left",b&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),inert:!this.isOpen,ref:o=>o&&(this.dialogRef=o)},!this.showCountrySelect&&!this.showLanguageSelect&&t("div",{key:"b2939d49930c8a34288a884582eb849a492080ff"},t("div",{key:"f1a22291d7865d57d37cbcd3c8f70c4aea57ed39",class:"zonos--hello-dialog-content"},t("zonos-button",{key:"ee3794826efc9fed856f0a320cf6428a428b4ea4",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close Zonos Hello dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>'}),noBackground:!0,onClick:()=>this.setIsOpen(!1)}),t("zonos-v-stack",{key:"3d2ff0b68268c97e385eb3cf7fcc34454d2ed3b5",spacing:24},t("zonos-country-flag",{key:"e09645ac583e59354d11b3c194d4d3f6d4780c55",class:"zonos--hello-country-flag",countryCode:e}),t("zonos-v-stack",{key:"42017a698c1678b90c8c7bbece5d623d0800e37b",class:"zonos--hello-dialog-header",spacing:4},t("zonos-text",{key:"ac30b7683dcc65773159832eadad8542d1d1bda8",type:"boldSubheader"},x),t("zonos-text",{key:"58cc0e8c51774c339b0fc735e4e98917ed614c8a",innerHTML:z,textColor:"gray-800"})),t("zonos-v-stack",{key:"0b3a3b2bf981ed72654506cc31f07edf6268b0a4",spacing:8},this.restrictedItems.map((o=>{var e;return o&&t("zonos-banner",{bannerTitle:o.name,intent:"error"},null===(e=o.itemRestrictions)||void 0===e?void 0:e.map((o=>t("zonos-text",{textColor:"red-800"},null==o?void 0:o.note))))})),t("zonos-card",{key:"196a593b167fc979bf0a2bef7f266ad3778f6ca0",spacing:"12px"},t("zonos-v-stack",{key:"94925c753ddfdd1a659580f7f78f8d6626cdcdaa",spacing:12},a?t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis",content:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M4.04505 6.64123C2.19006 8.49622 2.19006 11.5038 4.04505 13.3587L11.2929 20.6066C11.6834 20.9971 12.3166 20.9971 12.7071 20.6066L19.955 13.3587C21.8099 11.5038 21.8099 8.49622 19.955 6.64123L17.8336 4.51991C17.4431 4.12939 16.8099 4.12939 16.4194 4.51991L13.5241 7.41527C12.5864 6.86157 11.4136 6.86157 10.4759 7.41527L7.58059 4.51991C7.19006 4.12939 6.5569 4.12939 6.16637 4.51991L4.04505 6.64123ZM5.10571 12.2981C3.83651 11.0289 3.83651 8.9711 5.10571 7.70189L6.87348 5.93413L9.70191 8.76255C10.1056 9.16622 10.6991 9.12 11.0641 8.82749C11.6091 8.39083 12.3909 8.39082 12.9359 8.82749C13.301 9.12 13.8944 9.16622 14.2981 8.76255L17.1265 5.93413L18.8943 7.70189C20.1635 8.9711 20.1635 11.0289 18.8943 12.2981L12 19.1924L5.10571 12.2981Z"\n fill="#0F1015" />\n <path\n d="M10.0333 3.28075C9.63566 3.39679 9.40739 3.8132 9.52343 4.21083C9.63947 4.60846 10.0559 4.83673 10.4535 4.72069C11.4618 4.42644 12.5383 4.42644 13.5466 4.72069C13.9442 4.83673 14.3606 4.60846 14.4766 4.21083C14.5927 3.81321 14.3644 3.39679 13.9668 3.28075C12.6841 2.90642 11.316 2.90642 10.0333 3.28075Z"\n fill="#0F1015" />\n</svg>'}),t("zonos-text",null,f)):t(s,null,t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis",content:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>\n<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",null,m)),t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Tax de minimis",content:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",null,g))),null==u?void 0:u.map((o=>t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Additional information for buying goods from selected country",content:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",{innerHTML:o})))))),y.map((o=>t("zonos-custom-message",{icon:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n',message:o.message})))))),t("zonos-hello-dialog-footer",{key:"540006185ce1d28d610052801dcf9281773c5504",appearanceSettings:this.appearanceSettings,setShowCountrySelect:o=>this.setShowCountrySelect(o),setShowLanguageSelect:o=>this.setShowLanguageSelect(o)})),this.showCountrySelect&&t("div",{key:"886c371fdfa8c9c15188ef9d6cbb637162fb0d27"},t("zonos-country-select",{key:"1365bee67831b64637e5c481f239c557f2649694",handleOnClose:()=>this.setShowCountrySelect(!1)})),this.showLanguageSelect&&t("div",{key:"44929f0c23627970b1706f6e8c76e51022201379"},t("zonos-language-select",{key:"86b9f68c84da77f9e1af51dcb7d512eb6b289a27",handleOnClose:()=>this.setShowLanguageSelect(!1)}))))}static get assetsDirs(){return["assets"]}static get watchers(){return{isOpen:["isOpenHandler"]}}};m.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--zonos-elements-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--zonos-elements-radius-12);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:1001}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:calc(100% - 32px);top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:8px;top:8px;width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--zonos-elements-hover-color);border-radius:var(--zonos-elements-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:16px}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:12px}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}@media (max-height: 600px){:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{max-height:80vh}}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px) and (max-height: 600px){:host .zonos--hello-dialog{max-height:80vh}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";export{m as zonos_hello_dialog}
@@ -0,0 +1 @@
1
+ var __awaiter=this&&this.__awaiter||function(t,n,e,i){function o(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function u(t){try{a(i.next(t))}catch(t){r(t)}}function s(t){try{a(i["throw"](t))}catch(t){r(t)}}function a(t){t.done?e(t.value):o(t.value).then(u,s)}a((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return a([t,n])}}function a(s){if(i)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(e=0)),e)try{if(i=1,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;o=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=n.call(t,e)}catch(t){s=[6,t];o=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-8f7773b0.system.js","./p-8e8defdc.system.js","./p-a74a7afa.system.js","./p-29814fd7.system.js","./p-e97793ce.system.js"],(function(t){"use strict";var n,e,i,o,r,u,s,a,c,f,d,h,l,v,w;return{setters:[function(t){n=t.r;e=t.c;i=t.h;o=t.H},function(t){r=t.w;u=t.j;s=t.x;a=t.d;c=t.a},function(t){f=t.z;d=t.b;h=t.d},function(t){l=t.h;v=t.a;w=t.l},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,e,i;return __generator(this,(function(o){switch(o.label){case 0:return[4,l("/api/zonos-elements/zonos-settings")];case 1:t=o.sent(),n=t.errors,e=t.json,i=t.zonosMode;if(n.length){v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null,zonosMode:i}]}return[2,{errors:[],json:e,zonosMode:i}]}}))}))};var p=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var g=function(t){if(!t.placeOrderButtonSelector&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!r(t.placeOrderButtonSelector)){v('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}p()};var y=function(t){var n=document.querySelector(t);var e=document.querySelector("zonos-hello");if(!e&&n){var i=document.createElement("zonos-hello");n.appendChild(i);return true}return false};var b=function(t){var n=t.position,e=n===void 0?"bottom-right":n;var i=".zonos--hello-mobile-wrapper";var o=document.querySelector(i);if(o){return i}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(e==="top-right"){r.style.top="72px";r.style.right="24px"}if(e==="top-left"){r.style.top="72px";r.style.left="24px"}if(e==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(e==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483007";document.body.appendChild(r);return i};var z=function(t){return __awaiter(m,void 0,void 0,(function(){var n,e,i,o,u;return __generator(this,(function(s){n=t.anchorElementSelector;e=n;if(!t.anchorElementSelector&&t.desktopLocation){i=b({position:"bottom-right"});e=i}if(!e||!r(e)){v('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}w("Hello init complete");o=y(e);if(!o){u=new MutationObserver((function(){var t=y(e);if(t){u.disconnect()}}));u.observe(document.body,{childList:true,subtree:true});setTimeout((function(){y(e)}),1e3)}return[2]}))}))};var j=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var I=j;var k=t("zonos_controller",function(){function t(t){n(this,t);this.paypalInitEvent=e(this,"paypalInitEvent",7);this.stripeInitEvent=e(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){w("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}u.stripe=t;void g(f.checkoutSettings);w("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e,i,o,r,u,s,a;return __generator(this,(function(c){switch(c.label){case 0:i=t||h();if(i==="Inter"){if(!t){return[2]}w("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t})}o=new URLSearchParams;o.set("family",i);return[4,l("/api/zonos-elements/get-font-detail?".concat(o.toString()))];case 1:r=c.sent(),u=r.errors,s=r.json;if(u.length>0||!(s===null||s===void 0?void 0:s.fontUrl)){w("Failed to load font ".concat(i),"warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:"Inter"});return[2]}a=s.fontUrl;(e=(n=window.Zonos).injectSupportGoogleFont)===null||e===void 0?void 0:e.call(n,a);if(!t){return[2]}w("[FONT] ".concat(t," font override applied"));f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void z(f.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();f.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,i,o,r,u,a;return __generator(this,(function(c){switch(c.label){case 0:return[4,_()];case 1:e=c.sent(),i=e.errors,o=e.json,r=e.zonosMode;if(((t=i[0])===null||t===void 0?void 0:t.type.toString())==="403"){w("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();u=Object.assign(Object.assign({},this.config),{checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:undefined}):undefined});d({overrideSettings:u,zonosSettings:o});f.zonosMode=r;void this.setupGoogleFont();if(f.helloSettings.visibilityStatus==="DISABLED"){w("=== Hello is disabled by store owner ===","warn")}if(f.helloSettings&&f.helloSettings.visibilityStatus==="ENABLED"){w("Initializing hello");void z(f.helloSettings)}return[4,s()];case 2:c.sent();a=((n=o===null||o===void 0?void 0:o.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!a||!this.stripeInitEvent){w("Checkout failed to load -- missing publishable key","warn");return[2]}if(f.checkoutSettings.subscriptionStatus==="INACTIVE"){w('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");w("zonos controller loaded");return[2]}if(f.checkoutSettings.visibilityStatus==="DISABLED"){w("=== Checkout is disabled by store owner ===","warn");w("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:a.token});return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){n=document.querySelector("zonos-notification");if(!n){w("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){a.checkoutSessionId=null;u.clientSecret=null;return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){w("Override country code to ".concat(t));void c(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,f.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){f.organizationName=t;return[2]}))}))};t.prototype.render=function(){return i(o,{key:"4d7d784a50ebcb61ee4658198f3dcf756daf8d70",class:"zonos--elements"})};return t}());k.style=I}}}));