@zonos/elements 1.3.207 → 1.3.209

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 (239) hide show
  1. package/dist/cjs/{CheckoutConfig-4afc683b.js → CheckoutConfig-27c82f94.js} +19 -0
  2. package/dist/cjs/{cart-3d961c6e.js → cart-2ec8cac2.js} +285 -64
  3. package/dist/cjs/{debounce-0b9c0f8a.js → debounce-465a4328.js} +1 -1
  4. package/dist/cjs/{getBorderRadius-c424eb05.js → getBorderRadius-1b5e33cf.js} +1 -1
  5. package/dist/cjs/{handleFetch-969d05d8.js → handleFetch-05227713.js} +2 -6
  6. package/dist/cjs/index.cjs.js +29 -9
  7. package/dist/cjs/{isDarkColor-35e8daec.js → isDarkColor-428965f4.js} +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{localization-ff33875b.js → localization-9b43376c.js} +3 -2
  10. package/dist/cjs/{paypal-dee5c109.js → paypal-6449314e.js} +5 -5
  11. package/dist/cjs/updateCheckoutSessionAttributes-a31bb681.js +50 -0
  12. package/dist/cjs/zonos-address_11.cjs.entry.js +104 -84
  13. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  15. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  16. package/dist/cjs/zonos-card.cjs.entry.js +2 -2
  17. package/dist/cjs/zonos-cart-items_14.cjs.entry.js +98 -49
  18. package/dist/cjs/zonos-checkout.cjs.entry.js +87 -31
  19. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  20. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  21. package/dist/cjs/zonos-country-flag.cjs.entry.js +3 -3
  22. package/dist/cjs/zonos-country-select_4.cjs.entry.js +13 -9
  23. package/dist/cjs/zonos-elements.cjs.js +1 -1
  24. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +7 -7
  25. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
  26. package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
  27. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  28. package/dist/cjs/zonos-language-select_2.cjs.entry.js +3 -3
  29. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  30. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
  31. package/dist/cjs/zonos-stripe-input.cjs.entry.js +3 -3
  32. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  33. package/dist/cjs/zonos-toggle.cjs.entry.js +1 -1
  34. package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
  35. package/dist/cjs/{zonosStore-7c1e1bc1.js → zonosStore-f8ee56aa.js} +1 -0
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +79 -24
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +71 -36
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +33 -11
  39. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +2 -2
  40. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +9 -5
  41. package/dist/collection/components/store/checkout/cart.js +9 -2
  42. package/dist/collection/components/store/checkout/stripe.js +266 -55
  43. package/dist/collection/components/store/hello/localization.js +1 -0
  44. package/dist/collection/components/stripe/zonos-address/zonos-address.css +2 -1
  45. package/dist/collection/components/stripe/zonos-address/zonos-address.js +24 -3
  46. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.css +2 -1
  47. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +7 -5
  48. package/dist/collection/components/utils/api/cartCalculateLandedCost.js +3 -2
  49. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +2 -2
  50. package/dist/collection/components/utils/api/updateCheckoutSessionAttributes.js +46 -0
  51. package/dist/collection/components/utils/checkout/getAbandonedCartRenewTokenValue.js +17 -0
  52. package/dist/collection/components/utils/handleFetch.js +2 -1
  53. package/dist/collection/components/utils/logging/log.js +0 -5
  54. package/dist/collection/scripts/_getCartInfoById.js +3 -0
  55. package/dist/collection/types/checkout/api/CheckoutSession.js +14 -1
  56. package/dist/collection/types/checkout/api/CreateParty.js +1 -0
  57. package/dist/collection/types/generated/graphql.frontend.types.js +2 -0
  58. package/dist/collection/types/generated/graphql.internal.types.js +15 -0
  59. package/dist/collection/types/index.js +1 -0
  60. package/dist/esm/{CheckoutConfig-eb7d6954.js → CheckoutConfig-724d7bae.js} +19 -1
  61. package/dist/esm/{cart-5835676d.js → cart-2f84f632.js} +284 -65
  62. package/dist/esm/{debounce-eaee3a94.js → debounce-0e42da22.js} +1 -1
  63. package/dist/esm/{getBorderRadius-b18c924f.js → getBorderRadius-71b3b8ab.js} +1 -1
  64. package/dist/esm/{handleFetch-621e45bc.js → handleFetch-7dd4622b.js} +2 -6
  65. package/dist/esm/index.js +28 -11
  66. package/dist/esm/{isDarkColor-d8bb8659.js → isDarkColor-3a9d6108.js} +1 -1
  67. package/dist/esm/loader.js +1 -1
  68. package/dist/esm/{localization-4c7f64e8.js → localization-e17c211b.js} +3 -2
  69. package/dist/esm/{paypal-b4f106be.js → paypal-1cf701aa.js} +6 -6
  70. package/dist/esm/updateCheckoutSessionAttributes-5097e715.js +48 -0
  71. package/dist/esm/zonos-address_11.entry.js +104 -84
  72. package/dist/esm/zonos-badge.entry.js +1 -1
  73. package/dist/esm/zonos-banner.entry.js +1 -1
  74. package/dist/esm/zonos-button_3.entry.js +3 -3
  75. package/dist/esm/zonos-card.entry.js +2 -2
  76. package/dist/esm/zonos-cart-items_14.entry.js +98 -49
  77. package/dist/esm/zonos-checkout.entry.js +87 -31
  78. package/dist/esm/zonos-collapse.entry.js +1 -1
  79. package/dist/esm/zonos-controller.entry.js +6 -6
  80. package/dist/esm/zonos-country-flag.entry.js +3 -3
  81. package/dist/esm/zonos-country-select_4.entry.js +13 -9
  82. package/dist/esm/zonos-elements.js +1 -1
  83. package/dist/esm/zonos-empty-state-payment_4.entry.js +7 -7
  84. package/dist/esm/zonos-hello-dialog.entry.js +3 -3
  85. package/dist/esm/zonos-hello.entry.js +4 -4
  86. package/dist/esm/zonos-input.entry.js +2 -2
  87. package/dist/esm/zonos-language-select_2.entry.js +3 -3
  88. package/dist/esm/zonos-logo.entry.js +1 -1
  89. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  90. package/dist/esm/zonos-stripe-input.entry.js +3 -3
  91. package/dist/esm/zonos-text.entry.js +1 -1
  92. package/dist/esm/zonos-toggle.entry.js +1 -1
  93. package/dist/esm/zonos-v-stack.entry.js +1 -1
  94. package/dist/esm/{zonosStore-1e015fa5.js → zonosStore-00975763.js} +1 -1
  95. package/dist/esm-es5/CheckoutConfig-724d7bae.js +1 -0
  96. package/dist/esm-es5/cart-2f84f632.js +1 -0
  97. package/dist/esm-es5/{debounce-eaee3a94.js → debounce-0e42da22.js} +1 -1
  98. package/dist/esm-es5/{getBorderRadius-b18c924f.js → getBorderRadius-71b3b8ab.js} +1 -1
  99. package/dist/esm-es5/handleFetch-7dd4622b.js +1 -0
  100. package/dist/esm-es5/index.js +1 -1
  101. package/dist/esm-es5/{isDarkColor-d8bb8659.js → isDarkColor-3a9d6108.js} +1 -1
  102. package/dist/esm-es5/loader.js +1 -1
  103. package/dist/esm-es5/{localization-4c7f64e8.js → localization-e17c211b.js} +1 -1
  104. package/dist/esm-es5/{paypal-b4f106be.js → paypal-1cf701aa.js} +2 -2
  105. package/dist/esm-es5/updateCheckoutSessionAttributes-5097e715.js +1 -0
  106. package/dist/esm-es5/zonos-address_11.entry.js +1 -1
  107. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  108. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  109. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  110. package/dist/esm-es5/zonos-card.entry.js +1 -1
  111. package/dist/esm-es5/zonos-cart-items_14.entry.js +1 -1
  112. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  113. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  114. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  115. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  116. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  117. package/dist/esm-es5/zonos-elements.js +1 -1
  118. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  119. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  120. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  121. package/dist/esm-es5/zonos-input.entry.js +1 -1
  122. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  123. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  124. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  125. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  126. package/dist/esm-es5/zonos-text.entry.js +1 -1
  127. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  128. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  129. package/dist/esm-es5/{zonosStore-1e015fa5.js → zonosStore-00975763.js} +1 -1
  130. package/dist/scripts/index.d.ts +10 -0
  131. package/dist/scripts/index.js +1 -1
  132. package/dist/scripts/loadZonos.js +1 -1
  133. package/dist/scripts/zonos.js +1 -1
  134. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +2 -0
  135. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +8 -4
  136. package/dist/types/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.d.ts +3 -0
  137. package/dist/types/components/common/zonos-country-select/zonos-country-select.d.ts +1 -0
  138. package/dist/types/components/store/checkout/cart.d.ts +6 -2
  139. package/dist/types/components/store/checkout/stripe.d.ts +33 -6
  140. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +6 -0
  141. package/dist/types/components/utils/api/updateCheckoutSessionAttributes.d.ts +7 -0
  142. package/dist/types/components/utils/checkout/getAbandonedCartRenewTokenValue.d.ts +1 -0
  143. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +1 -0
  144. package/dist/types/types/checkout/api/CheckoutSession.d.ts +16 -0
  145. package/dist/types/types/checkout/api/CreateParty.d.ts +34 -0
  146. package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +2 -0
  147. package/dist/types/types/generated/graphql.frontend.types.d.ts +2 -0
  148. package/dist/types/types/generated/graphql.frontend.types.ts +2 -0
  149. package/dist/types/types/generated/graphql.internal.types.d.ts +61 -5
  150. package/dist/types/types/generated/graphql.internal.types.ts +105 -3
  151. package/dist/types/types/index.d.ts +1 -0
  152. package/dist/types/types/utils/ZonosSettings.d.ts +6 -0
  153. package/dist/zonos-elements/index.esm.js +1 -1
  154. package/dist/zonos-elements/{p-4e9c8f9e.system.js → p-0751b878.system.js} +1 -1
  155. package/dist/zonos-elements/{p-abe218ab.system.entry.js → p-08b29f73.system.entry.js} +1 -1
  156. package/dist/zonos-elements/{p-74bcb5cc.entry.js → p-0ca1d6dd.entry.js} +1 -1
  157. package/dist/zonos-elements/{p-12cd9d3a.entry.js → p-144b5006.entry.js} +1 -1
  158. package/dist/zonos-elements/{p-9e9ac7a2.system.js → p-19182dc7.system.js} +1 -1
  159. package/dist/zonos-elements/{p-eca09508.system.entry.js → p-1dc78af3.system.entry.js} +1 -1
  160. package/dist/zonos-elements/{p-e337fa88.js → p-207bd04a.js} +1 -1
  161. package/dist/zonos-elements/p-20839c46.js +1 -0
  162. package/dist/zonos-elements/{p-1aa24297.system.entry.js → p-2122d2cc.system.entry.js} +1 -1
  163. package/dist/zonos-elements/{p-4fb88ebc.system.entry.js → p-239695e8.system.entry.js} +1 -1
  164. package/dist/zonos-elements/{p-3196bf98.entry.js → p-23fe7661.entry.js} +1 -1
  165. package/dist/zonos-elements/p-2652198d.js +1 -0
  166. package/dist/zonos-elements/p-30a9f802.system.entry.js +1 -0
  167. package/dist/zonos-elements/{p-c666d557.system.js → p-3633a952.system.js} +1 -1
  168. package/dist/zonos-elements/{p-9b8a5372.entry.js → p-36b686b6.entry.js} +1 -1
  169. package/dist/zonos-elements/{p-658936c9.js → p-371d91d1.js} +2 -2
  170. package/dist/zonos-elements/{p-019f8637.entry.js → p-3934b38a.entry.js} +1 -1
  171. package/dist/zonos-elements/p-3c752420.system.js +1 -0
  172. package/dist/zonos-elements/p-3ee44728.system.js +1 -1
  173. package/dist/zonos-elements/p-40a4c8a2.system.js +1 -0
  174. package/dist/zonos-elements/{p-91c996d3.system.js → p-44c0a584.system.js} +2 -2
  175. package/dist/zonos-elements/{p-eb2560b6.system.entry.js → p-45a2f9b1.system.entry.js} +1 -1
  176. package/dist/zonos-elements/{p-1327b935.system.js → p-4a1b4a2d.system.js} +1 -1
  177. package/dist/zonos-elements/p-4c70fd75.entry.js +1 -0
  178. package/dist/zonos-elements/{p-bab19e2a.entry.js → p-4d62f3de.entry.js} +1 -1
  179. package/dist/zonos-elements/{p-848e08e8.entry.js → p-4dbaa2c2.entry.js} +1 -1
  180. package/dist/zonos-elements/p-4ed73ff8.entry.js +1 -0
  181. package/dist/zonos-elements/{p-47e2cd31.entry.js → p-4f5513dc.entry.js} +1 -1
  182. package/dist/zonos-elements/p-542acc2c.js +1 -0
  183. package/dist/zonos-elements/p-5711e187.system.js +1 -0
  184. package/dist/zonos-elements/{p-41c1d7c4.entry.js → p-5956a9e0.entry.js} +1 -1
  185. package/dist/zonos-elements/{p-5616b304.entry.js → p-5b7686f8.entry.js} +1 -1
  186. package/dist/zonos-elements/{p-0c4c8d63.entry.js → p-63a4dac5.entry.js} +1 -1
  187. package/dist/zonos-elements/{p-f4d741de.system.entry.js → p-695bf400.system.entry.js} +1 -1
  188. package/dist/zonos-elements/{p-9fa17353.js → p-6aa728f2.js} +1 -1
  189. package/dist/zonos-elements/{p-ed20f2f7.js → p-71c6bdc3.js} +1 -1
  190. package/dist/zonos-elements/p-738a49c0.system.js +1 -0
  191. package/dist/zonos-elements/{p-469ccc66.system.entry.js → p-74276b82.system.entry.js} +1 -1
  192. package/dist/zonos-elements/{p-e0587eeb.entry.js → p-77e22be4.entry.js} +1 -1
  193. package/dist/zonos-elements/{p-3afc27ef.entry.js → p-78dd1c53.entry.js} +1 -1
  194. package/dist/zonos-elements/{p-620deb03.system.entry.js → p-7f9bbbb3.system.entry.js} +1 -1
  195. package/dist/zonos-elements/p-896f2358.system.entry.js +1 -0
  196. package/dist/zonos-elements/{p-719e14a8.system.entry.js → p-8f41d864.system.entry.js} +1 -1
  197. package/dist/zonos-elements/{p-4cb8b87f.system.entry.js → p-964e2587.system.entry.js} +1 -1
  198. package/dist/zonos-elements/{p-93aeba62.system.entry.js → p-97831744.system.entry.js} +1 -1
  199. package/dist/zonos-elements/{p-2866fd29.system.entry.js → p-9d95c896.system.entry.js} +1 -1
  200. package/dist/zonos-elements/{p-abc83d01.entry.js → p-a24870af.entry.js} +1 -1
  201. package/dist/zonos-elements/p-a411ce2a.system.js +1 -0
  202. package/dist/zonos-elements/{p-1bc09abe.system.entry.js → p-a4686344.system.entry.js} +1 -1
  203. package/dist/zonos-elements/{p-edcfb3a3.js → p-a6f77d44.js} +1 -1
  204. package/dist/zonos-elements/{p-b21b0330.entry.js → p-a8f421ac.entry.js} +1 -1
  205. package/dist/zonos-elements/{p-18149db1.entry.js → p-aa40d402.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-536f69eb.entry.js → p-ad1e1dbc.entry.js} +1 -1
  207. package/dist/zonos-elements/p-b1bfeec9.system.entry.js +1 -0
  208. package/dist/zonos-elements/p-b2d81c98.js +1 -0
  209. package/dist/zonos-elements/{p-7777d85f.system.entry.js → p-baa88176.system.entry.js} +1 -1
  210. package/dist/zonos-elements/{p-1ad099ec.system.entry.js → p-bf9cb85f.system.entry.js} +1 -1
  211. package/dist/zonos-elements/p-bfdb4e7a.entry.js +1 -0
  212. package/dist/zonos-elements/{p-858b7908.system.entry.js → p-c345b306.system.entry.js} +1 -1
  213. package/dist/zonos-elements/{p-22cb6880.system.entry.js → p-d1697144.system.entry.js} +1 -1
  214. package/dist/zonos-elements/p-d1c0bf92.entry.js +1 -0
  215. package/dist/zonos-elements/{p-16678764.js → p-d6a53ea6.js} +1 -1
  216. package/dist/zonos-elements/{p-265af369.system.entry.js → p-db424e02.system.entry.js} +1 -1
  217. package/dist/zonos-elements/p-eb77c0bf.system.js +1 -0
  218. package/dist/zonos-elements/{p-30778fde.system.entry.js → p-ef1ccec6.system.entry.js} +1 -1
  219. package/dist/zonos-elements/{p-42a9557f.entry.js → p-fdf5b8f4.entry.js} +1 -1
  220. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  221. package/package.json +1 -1
  222. package/dist/esm-es5/CheckoutConfig-eb7d6954.js +0 -1
  223. package/dist/esm-es5/cart-5835676d.js +0 -1
  224. package/dist/esm-es5/handleFetch-621e45bc.js +0 -1
  225. package/dist/zonos-elements/p-0de2c731.system.js +0 -1
  226. package/dist/zonos-elements/p-0fc02cde.js +0 -1
  227. package/dist/zonos-elements/p-1b75aa35.system.js +0 -1
  228. package/dist/zonos-elements/p-3a50124e.entry.js +0 -1
  229. package/dist/zonos-elements/p-3f1a2d31.js +0 -1
  230. package/dist/zonos-elements/p-5e1b2654.system.js +0 -1
  231. package/dist/zonos-elements/p-666164d9.system.js +0 -1
  232. package/dist/zonos-elements/p-9f78b79e.entry.js +0 -1
  233. package/dist/zonos-elements/p-a2b55d11.entry.js +0 -1
  234. package/dist/zonos-elements/p-aafcd40f.system.entry.js +0 -1
  235. package/dist/zonos-elements/p-b922c441.system.js +0 -1
  236. package/dist/zonos-elements/p-ba027b70.system.entry.js +0 -1
  237. package/dist/zonos-elements/p-c4e0f49a.system.entry.js +0 -1
  238. package/dist/zonos-elements/p-dbd23bea.entry.js +0 -1
  239. package/dist/zonos-elements/p-f9664811.js +0 -1
@@ -4244,11 +4244,12 @@ export type CartCalculateLandedCostMutation = {
4244
4244
  note: string;
4245
4245
  type: DeMinimisType;
4246
4246
  }>;
4247
- remittance: Array<{ amount: number; description: string }>;
4248
- fees: Array<{ amount: number; currencyCode: CurrencyCode }>;
4247
+ rootId: string;
4249
4248
  id: string;
4249
+ fees: Array<{ amount: number; currencyCode: CurrencyCode }>;
4250
4250
  landedCostGuaranteeCode: LandedCostGuaranteeCode;
4251
4251
  method: IncotermCode;
4252
+ remittance: Array<{ amount: number; description: string }>;
4252
4253
  duties: Array<{ amount: number; currencyCode: CurrencyCode }>;
4253
4254
  shipmentRating: { id: string };
4254
4255
  taxes: Array<{ amount: number; currencyCode: CurrencyCode }>;
@@ -4345,6 +4346,7 @@ export type CalculateLandedCostMutation = {
4345
4346
  landedCostGuaranteeCode: LandedCostGuaranteeCode;
4346
4347
  method: IncotermCode;
4347
4348
  remittance: Array<{ amount: number; description: string }>;
4349
+ rootId: string;
4348
4350
  shipmentRating: { id: string };
4349
4351
  taxes: Array<{ amount: number; currencyCode: CurrencyCode }>;
4350
4352
  } | null> | null;
@@ -4430,6 +4432,7 @@ export type LandedCostFragment = {
4430
4432
  landedCostGuaranteeCode: LandedCostGuaranteeCode;
4431
4433
  method: IncotermCode;
4432
4434
  remittance: Array<{ amount: number; description: string }>;
4435
+ rootId: string;
4433
4436
  shipmentRating: { id: string };
4434
4437
  taxes: Array<{ amount: number; currencyCode: CurrencyCode }>;
4435
4438
  };
@@ -4547,6 +4550,12 @@ export type GetTaxIdByCountryQuery = {
4547
4550
  } | null> | null;
4548
4551
  };
4549
4552
 
4553
+ export type LandedCostSettingsQuery = {
4554
+ landedCostSettings: {
4555
+ landedCostGuarantee: LandedCostGuaranteeType | null;
4556
+ } | null;
4557
+ };
4558
+
4550
4559
  export type CheckoutSessionCreateMutation = {
4551
4560
  checkoutSessionCreate: {
4552
4561
  cartId: string | null;
@@ -4610,6 +4619,8 @@ export type CheckoutSessionCreateMutation = {
4610
4619
  };
4611
4620
  };
4612
4621
 
4622
+ export type PartyCreateMutation = { partyCreate: { id: string } };
4623
+
4613
4624
  export type CheckoutSessionPaymentIntentCreateMutation = {
4614
4625
  checkoutSessionPaymentIntentCreate: {
4615
4626
  cartId: string | null;
@@ -4721,6 +4732,7 @@ export type CartCheckoutWorkflowQuery = {
4721
4732
  type: CartAdjustmentType;
4722
4733
  }>;
4723
4734
  createdAt: string;
4735
+ expiresAt: string | null;
4724
4736
  id: string;
4725
4737
  items: Array<{
4726
4738
  amount: number;
@@ -4843,13 +4855,20 @@ export type CartCheckoutWorkflowQuery = {
4843
4855
  };
4844
4856
  };
4845
4857
 
4858
+ export type RenewCartExpirationTokenMutation = {
4859
+ cartUpdate: { expiresAt: string | null };
4860
+ };
4861
+
4846
4862
  export type GetCheckoutSessionQuery = {
4847
4863
  checkoutSession: {
4848
4864
  landedCost: {
4849
4865
  id: string;
4850
4866
  root: { parties: Array<{ id: string } | null> | null } | null;
4851
4867
  } | null;
4852
- order: { id: string } | null;
4868
+ order: {
4869
+ id: string;
4870
+ parties: Array<{ id: string; type: PartyType | null }> | null;
4871
+ } | null;
4853
4872
  subtotals: { presentmentCurrencyCode: CurrencyCode };
4854
4873
  };
4855
4874
  };
@@ -4899,6 +4918,17 @@ export type ShippingZonesQuery = {
4899
4918
  } | null> | null;
4900
4919
  };
4901
4920
 
4921
+ export type GetCheckoutSessionAttributesQuery = {
4922
+ checkoutSession: { attributes: Array<{ key: string; value: string }> };
4923
+ };
4924
+
4925
+ export type CheckoutSessionUpdateAttributesMutation = {
4926
+ checkoutSessionUpdate: {
4927
+ attributes: Array<{ key: string; value: string }>;
4928
+ id: string;
4929
+ };
4930
+ };
4931
+
4902
4932
  export type CheckoutSessionBaseCurrencyUpdateMutation = {
4903
4933
  checkoutSessionBaseCurrencyUpdate: {
4904
4934
  subtotals: { presentmentCurrencyCode: CurrencyCode; total: number };
@@ -5425,6 +5455,7 @@ export type GetOrderQuery = {
5425
5455
  metadata: Array<{ key: string; value: string } | null> | null;
5426
5456
  mode: Mode;
5427
5457
  parties: Array<{
5458
+ id: string;
5428
5459
  location: {
5429
5460
  administrativeArea: string | null;
5430
5461
  administrativeAreaCode: string | null;
@@ -5856,6 +5887,21 @@ export function getSdk(
5856
5887
  'mutation',
5857
5888
  );
5858
5889
  },
5890
+ checkoutSessionUpdateAttributes(
5891
+ variables?: { [x: string]: never },
5892
+ requestHeaders?: GraphQLClientRequestHeaders,
5893
+ ): Promise<CheckoutSessionUpdateAttributesMutation> {
5894
+ return withWrapper(
5895
+ wrappedRequestHeaders =>
5896
+ client.request<CheckoutSessionUpdateAttributesMutation>(
5897
+ '',
5898
+ variables,
5899
+ { ...requestHeaders, ...wrappedRequestHeaders },
5900
+ ),
5901
+ 'checkoutSessionUpdateAttributes',
5902
+ 'mutation',
5903
+ );
5904
+ },
5859
5905
  checkoutSessionUpdateMetadata(
5860
5906
  variables?: { [x: string]: never },
5861
5907
  requestHeaders?: GraphQLClientRequestHeaders,
@@ -5983,6 +6029,20 @@ export function getSdk(
5983
6029
  'query',
5984
6030
  );
5985
6031
  },
6032
+ getCheckoutSessionAttributes(
6033
+ variables?: { [x: string]: never },
6034
+ requestHeaders?: GraphQLClientRequestHeaders,
6035
+ ): Promise<GetCheckoutSessionAttributesQuery> {
6036
+ return withWrapper(
6037
+ wrappedRequestHeaders =>
6038
+ client.request<GetCheckoutSessionAttributesQuery>('', variables, {
6039
+ ...requestHeaders,
6040
+ ...wrappedRequestHeaders,
6041
+ }),
6042
+ 'getCheckoutSessionAttributes',
6043
+ 'query',
6044
+ );
6045
+ },
5986
6046
  getInclusivePriceSettingByCountry(
5987
6047
  variables?: { [x: string]: never },
5988
6048
  requestHeaders?: GraphQLClientRequestHeaders,
@@ -6068,6 +6128,20 @@ export function getSdk(
6068
6128
  'query',
6069
6129
  );
6070
6130
  },
6131
+ landedCostSettings(
6132
+ variables?: { [x: string]: never },
6133
+ requestHeaders?: GraphQLClientRequestHeaders,
6134
+ ): Promise<LandedCostSettingsQuery> {
6135
+ return withWrapper(
6136
+ wrappedRequestHeaders =>
6137
+ client.request<LandedCostSettingsQuery>('', variables, {
6138
+ ...requestHeaders,
6139
+ ...wrappedRequestHeaders,
6140
+ }),
6141
+ 'landedCostSettings',
6142
+ 'query',
6143
+ );
6144
+ },
6071
6145
  onlineStoreSettings(
6072
6146
  variables?: { [x: string]: never },
6073
6147
  requestHeaders?: GraphQLClientRequestHeaders,
@@ -6138,6 +6212,20 @@ export function getSdk(
6138
6212
  'query',
6139
6213
  );
6140
6214
  },
6215
+ partyCreate(
6216
+ variables?: { [x: string]: never },
6217
+ requestHeaders?: GraphQLClientRequestHeaders,
6218
+ ): Promise<PartyCreateMutation> {
6219
+ return withWrapper(
6220
+ wrappedRequestHeaders =>
6221
+ client.request<PartyCreateMutation>('', variables, {
6222
+ ...requestHeaders,
6223
+ ...wrappedRequestHeaders,
6224
+ }),
6225
+ 'partyCreate',
6226
+ 'mutation',
6227
+ );
6228
+ },
6141
6229
  partyInfo(
6142
6230
  variables?: { [x: string]: never },
6143
6231
  requestHeaders?: GraphQLClientRequestHeaders,
@@ -6208,6 +6296,20 @@ export function getSdk(
6208
6296
  'mutation',
6209
6297
  );
6210
6298
  },
6299
+ renewCartExpirationToken(
6300
+ variables?: { [x: string]: never },
6301
+ requestHeaders?: GraphQLClientRequestHeaders,
6302
+ ): Promise<RenewCartExpirationTokenMutation> {
6303
+ return withWrapper(
6304
+ wrappedRequestHeaders =>
6305
+ client.request<RenewCartExpirationTokenMutation>('', variables, {
6306
+ ...requestHeaders,
6307
+ ...wrappedRequestHeaders,
6308
+ }),
6309
+ 'renewCartExpirationToken',
6310
+ 'mutation',
6311
+ );
6312
+ },
6211
6313
  selectCheckoutVarianceTest(
6212
6314
  variables?: { [x: string]: never },
6213
6315
  requestHeaders?: GraphQLClientRequestHeaders,
@@ -4,6 +4,7 @@ export type { CartItem, ItemMeasurement, } from '../components/store/checkout/ca
4
4
  export type { CountryLandedCost } from '../components/utils/api/getCountryLandedCost';
5
5
  export * from './checkout/api/CalculateLandedCost';
6
6
  export * from './checkout/api/CheckoutSession';
7
+ export * from './checkout/api/CreateParty';
7
8
  export * from './checkout/api/legacy/InventoryCheck';
8
9
  export * from './checkout/api/NormalizedTempCart';
9
10
  export * from './checkout/api/Paypal';
@@ -21,6 +21,12 @@ export type GenericZonosSettings = {
21
21
  * Signed token for Google Places API iframe access.
22
22
  */
23
23
  signedTokenGooglePlaces?: string;
24
+ stripeCountryFieldLabels?: {
25
+ [_key in CountryCode]?: {
26
+ stateRequired: boolean;
27
+ zipRequired: boolean;
28
+ };
29
+ };
24
30
  /**
25
31
  * List of countries that are allowed to use USD denominated cards for settlement.
26
32
  */
@@ -1 +1 @@
1
- import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{g as r,a as i,l,h as u,b as m}from"./p-0fc02cde.js";import{_ as p,c as w,a as f}from"./p-3f1a2d31.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-3f1a2d31.js";export{a as availableTestKeys}from"./p-04a01cb1.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const h=["jsdelivr","cdnjs","unpkg","vercel"],y="jsdelivr",v=e=>{const n=h.indexOf(e);return h[n+1]||null},g=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.207.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return l(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},S="https://js.stripe.com/v3",z=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,j="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let O=null;const b=Promise.resolve().then((()=>{return e=null,null!==O||(O=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(j),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${S}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&z.test(o.src))return o}return null})();t&&e?console.warn(j):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${S}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),O;var e}));let k=!1;b.catch((e=>{k||console.warn(e)}));const $=async({cartId:e,retries:n})=>{const t=r(),s=o(),i=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&i.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:c,json:d,zonosMode:a}=await u(`/api/zonos-elements/get-cart?${i.toString()}`,{body:{isTestMode:t,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),m=!d||c.length;return m&&n?(l("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),$({cartId:e,retries:n-1})):m?null:Object.assign(Object.assign({},d),{zonosMode:a})};var I;const Z=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),L="https://v1.3.207.js.zonos.com",N=Z||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.207",U="https://fonts.googleapis.com",R=/^https:\/\/fonts\.googleapis\.com/;class T{}I=T,T.doneInit=!1,T.cartSettings=null,T.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),T.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),T._paypalMockResponse=null,T.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,T.isBigCommerce=!1,T.releaseDate="1748539024950",T.isLegacyCheckout=!1,T.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",T.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),T.overrideUseCustomAddressForm=!1,T.isNpm=!0,T.zonosQaUrl=null,T.zonosQaUrlApi=null,T.trackEventLogs=[],T.version="v1.3.207",T.modeAlerted=!1,T.cartData=null,T.paypal=null,T.zonosMode=null,T.IframeService=t,T.getCurrentTimestamp=()=>(new Date).getTime(),T.zonosController=null,T.loadTimeApiInfoList=[],T.logIntervalId=null,T.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d,storeId:a,zonosApiKey:f}=e;if(I.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),I.doneInit)return;if(l(`====== ZONOS DEBUG MODE: on (${I.version}) ======`),I.zonosApiKey=f,I.storeId=a,I.isNpm){l("====== ZONOS LOADING FROM NPM ======");const n=g();if(n&&!window.isZonosPreview){l(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=I.isNpm,window.Zonos.isBigCommerce=I.isBigCommerce,window.Zonos.isLegacyCheckout=I.isLegacyCheckout,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!f&&!I.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!I.cartData&&I.cartId){l("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=p(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await $({cartId:e,retries:5});return l("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(I.cartId);if(!e)return void m("Failed to get cart data");I.cartData=e.cartData,I.zonosApiKey=e.zonosApiKey,I.cartSettings=e.settings}const o=await(async()=>{const e=r(),n=i();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(l("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return l("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(l(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(I.zonosApiKey=o)}const h=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(I.cartId&&I.cartData||h){l("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${w}`,document.body.appendChild(e)}l("init zonos"),I.restoreNativeBrowserFunctions(),I.injectCustomScriptForHostedCheckout(),I.injectZonosCdn(),I.injectZonosCss(),I.injectFonts(),I.injectCheckoutInternationalButton(),I.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d}}),I.doneInit=!0},T.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${f}`)){const e=document.createElement("button");e.id=f,e.style.display="none",document.body.appendChild(e)}},T.injectCustomScriptForHostedCheckout=()=>{const e=I.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){l("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){l("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else l("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},T.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},T.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${f}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},T.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},T.showNotification=e=>{var n;null===(n=I.zonosController)||void 0===n||n.showNotification(e)},T.updateOrganizationName=e=>{var n;null===(n=I.zonosController)||void 0===n||n.updateOrganizationName(e)},T.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},T.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},T.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;I.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{I.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;I.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{I.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=I.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;l("loading Stripe");const o=await(async(...e)=>{k=!0;const n=Date.now();return b.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(n.publishableKey);o?(window.Zonos.stripe=o,t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),I.zonosController=t,l("Zonos controller injected!")},T.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${I.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void l(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,r=document.createElement("script");n?r.type="module":r.noModule=!0,r.src=t,r.crossOrigin="anonymous",r.onerror=()=>{m(`Failed to load ${r.src}`);const t=v(e);t&&I.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(r)},T.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return N;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.207";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.207";case"vercel":return L}};return I.isNpm&&g()||n()},T.injectZonosCdn=()=>{I.injectScript({cdnType:y,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),I.injectScript({cdnType:y,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),l("Zonos cdn script injected!")},T.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=I.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${L}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=v(e);o&&I.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},T.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?l("Zonos style links already injected","warn"):(I.injectStylesheet({cdnType:y,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),l("Zonos style css injected!"))},T.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void l("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${U}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!R.test(o.href))return o}return null})())return void l("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=U,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${U}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),l("Zonos font injected!")},T.setupGoogleFont=e=>{var n;null===(n=I.zonosController)||void 0===n||n.setupGoogleFont(e)},T.injectSupportGoogleFont=e=>{var n;l(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${U}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=U,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void l(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),l(`[FONT] ${o} font injected!`)};export{T as Zonos}
1
+ import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{g as r,a as i,l,h as u,b as m}from"./p-20839c46.js";import{g as p,_ as w,c as f,a as h}from"./p-b2d81c98.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-b2d81c98.js";export{a as availableTestKeys}from"./p-04a01cb1.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const y=["jsdelivr","cdnjs","unpkg","vercel"],v="jsdelivr",O=e=>{const n=y.indexOf(e);return y[n+1]||null},S=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.209.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return l(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},g="https://js.stripe.com/v3",z=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,j="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let b=null;const N=Promise.resolve().then((()=>{return e=null,null!==b||(b=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(j),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${g}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&z.test(o.src))return o}return null})();t&&e?console.warn(j):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${g}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),b;var e}));let I=!1;N.catch((e=>{I||console.warn(e)}));const k=async({cartId:e,retries:n})=>{const t=r(),s=o(),i=p()||void 0,c=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&c.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:d,json:a,zonosMode:m}=await u(`/api/zonos-elements/get-cart?${c.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:i,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),w=!a||d.length;return w&&n?(l("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),k({cartId:e,retries:n-1})):w?null:Object.assign(Object.assign({},a),{zonosMode:m})};var T;const R=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),$="https://v1.3.209.js.zonos.com",Z=R||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.209",L="https://fonts.googleapis.com",U=/^https:\/\/fonts\.googleapis\.com/;class A{}T=A,A.doneInit=!1,A.cartSettings=null,A.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),A.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),A._paypalMockResponse=null,A.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,A.isBigCommerce=!1,A.releaseDate="1749049121169",A.isLegacyCheckout=!1,A.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",A.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),A.overrideUseCustomAddressForm=!1,A.isNpm=!0,A.zonosQaUrl=null,A.zonosQaUrlApi=null,A.trackEventLogs=[],A.version="v1.3.209",A.modeAlerted=!1,A.cartData=null,A.paypal=null,A.zonosMode=null,A.IframeService=t,A.getCurrentTimestamp=()=>(new Date).getTime(),A.zonosController=null,A.loadTimeApiInfoList=[],A.logIntervalId=null,A.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d,storeId:a,zonosApiKey:p}=e;if(T.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),T.doneInit)return;if(l(`====== ZONOS DEBUG MODE: on (${T.version}) ======`),T.zonosApiKey=p,T.storeId=a,T.isNpm){l("====== ZONOS LOADING FROM NPM ======");const n=S();if(n&&!window.isZonosPreview){l(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=T.isNpm,window.Zonos.isBigCommerce=T.isBigCommerce,window.Zonos.isLegacyCheckout=T.isLegacyCheckout,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!p&&!T.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!T.cartData&&T.cartId){l("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=w(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await k({cartId:e,retries:5});return l("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(T.cartId);if(!e)return void m("Failed to get cart data");T.cartData=e.cartData,T.zonosApiKey=e.zonosApiKey,T.cartSettings=e.settings}const o=await(async()=>{const e=r(),n=i();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(l("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return l("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(l(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(T.zonosApiKey=o)}const h=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(T.cartId&&T.cartData||h){l("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${f}`,document.body.appendChild(e)}l("init zonos"),T.restoreNativeBrowserFunctions(),T.injectCustomScriptForHostedCheckout(),T.injectZonosCdn(),T.injectZonosCss(),T.injectFonts(),T.injectCheckoutInternationalButton(),T.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d}}),T.doneInit=!0},A.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${h}`)){const e=document.createElement("button");e.id=h,e.style.display="none",document.body.appendChild(e)}},A.injectCustomScriptForHostedCheckout=()=>{const e=T.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){l("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){l("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else l("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},A.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},A.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${h}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},A.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},A.showNotification=e=>{var n;null===(n=T.zonosController)||void 0===n||n.showNotification(e)},A.updateOrganizationName=e=>{var n;null===(n=T.zonosController)||void 0===n||n.updateOrganizationName(e)},A.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},A.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},A.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{T.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=T.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;l("loading Stripe");const o=await(async(...e)=>{I=!0;const n=Date.now();return N.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(n.publishableKey);o?(window.Zonos.stripe=o,t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),T.zonosController=t,l("Zonos controller injected!")},A.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${T.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void l(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,r=document.createElement("script");n?r.type="module":r.noModule=!0,r.src=t,r.crossOrigin="anonymous",r.onerror=()=>{m(`Failed to load ${r.src}`);const t=O(e);t&&T.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(r)},A.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return Z;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.209";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.209";case"vercel":return $}};return T.isNpm&&S()||n()},A.injectZonosCdn=()=>{T.injectScript({cdnType:v,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),T.injectScript({cdnType:v,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),l("Zonos cdn script injected!")},A.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=T.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${$}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=O(e);o&&T.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},A.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?l("Zonos style links already injected","warn"):(T.injectStylesheet({cdnType:v,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),l("Zonos style css injected!"))},A.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void l("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!U.test(o.href))return o}return null})())return void l("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=L,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${L}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),l("Zonos font injected!")},A.setupGoogleFont=e=>{var n;null===(n=T.zonosController)||void 0===n||n.setupGoogleFont(e)},A.injectSupportGoogleFont=e=>{var n;l(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${L}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=L,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void l(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),l(`[FONT] ${o} font injected!`)};const C=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],E=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],P=[...C,...E];export{A as Zonos,P as checkoutSessionAttributeKeys,E as checkoutSessionImmutableAttributeKeys,C as checkoutSessionMutableAttributeKeys}