@zonos/elements 1.2.4-alpha.5 → 1.2.4-alpha.7

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 (189) hide show
  1. package/dist/cjs/{cart-3ff38a09.js → cart-90f7c8c0.js} +36 -8
  2. package/dist/cjs/{getBorderRadius-a97a5f75.js → getBorderRadius-bf4a4276.js} +1 -1
  3. package/dist/cjs/{index-20cb112f.js → index-0dcccc22.js} +27 -16
  4. package/dist/cjs/index.cjs.js +6 -6
  5. package/dist/cjs/{isDarkColor-261fcf3d.js → isDarkColor-ff6ff183.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +2 -2
  7. package/dist/cjs/{localization-dcd11e9d.js → localization-9caf3397.js} +27 -7
  8. package/dist/cjs/{submitGtag-08527ddb.js → submitGtag-b141b45d.js} +2 -2
  9. package/dist/cjs/zonos-address_2.cjs.entry.js +6 -6
  10. package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
  11. package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-button_2.cjs.entry.js +4 -4
  13. package/dist/cjs/zonos-card_2.cjs.entry.js +2 -2
  14. package/dist/cjs/zonos-cart-items_10.cjs.entry.js +50 -8
  15. package/dist/cjs/zonos-checkout.cjs.entry.js +9 -7
  16. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  17. package/dist/cjs/zonos-controller.cjs.entry.js +8 -8
  18. package/dist/cjs/zonos-country-flag_4.cjs.entry.js +4 -4
  19. package/dist/cjs/zonos-elements.cjs.js +3 -3
  20. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
  21. package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
  22. package/dist/cjs/zonos-icon.cjs.entry.js +2 -2
  23. package/dist/cjs/zonos-notification.cjs.entry.js +2 -2
  24. package/dist/cjs/zonos-payment.cjs.entry.js +6 -6
  25. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
  26. package/dist/cjs/zonos-text.cjs.entry.js +2 -2
  27. package/dist/cjs/{zonosStore-a0fa5b77.js → zonosStore-b43ef5db.js} +1 -1
  28. package/dist/collection/collection-manifest.json +1 -1
  29. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +48 -2
  30. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +5 -2
  31. package/dist/collection/components/common/zonos-notification/zonos-notification.js +3 -2
  32. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +9 -6
  33. package/dist/collection/components/main/zonos-controller.js +16 -14
  34. package/dist/collection/components/store/checkout/cart.js +1 -1
  35. package/dist/collection/components/store/checkout/stripe.js +3 -2
  36. package/dist/collection/components/utils/api/calculateLandedCost.js +9 -1
  37. package/dist/collection/components/utils/api/checkItemRestrictions.js +1 -1
  38. package/dist/collection/components/utils/api/getCountries.js +1 -1
  39. package/dist/collection/components/utils/api/getCountryLandedCost.js +1 -1
  40. package/dist/collection/components/utils/api/getExchangeRate.js +1 -1
  41. package/dist/collection/components/utils/api/getLocaleMessages.js +1 -1
  42. package/dist/collection/components/utils/api/getLocalization.js +1 -1
  43. package/dist/collection/components/utils/api/getShippingZones.js +1 -1
  44. package/dist/collection/components/utils/api/getZonosSetting.js +1 -1
  45. package/dist/collection/components/utils/api/triggerBuildLandedCost.js +22 -0
  46. package/dist/collection/components/utils/logging/log.js +20 -0
  47. package/dist/collection/types/generated/graphql.customer.types.js +72 -0
  48. package/dist/collection/types/generated/graphql.frontend.types.js +83 -6
  49. package/dist/components/cart.js +33 -5
  50. package/dist/components/localization.js +26 -6
  51. package/dist/components/zonos-checkout-finish2.js +47 -4
  52. package/dist/components/zonos-checkout.js +2 -0
  53. package/dist/components/zonos-controller.js +2 -2
  54. package/dist/components/zonos-hello.js +1 -1
  55. package/dist/esm/{cart-54eab7ab.js → cart-b439be00.js} +36 -8
  56. package/dist/esm/{getBorderRadius-35e8acce.js → getBorderRadius-178a0a05.js} +1 -1
  57. package/dist/esm/{index-3617e24c.js → index-36ff6342.js} +27 -16
  58. package/dist/esm/index.js +6 -6
  59. package/dist/esm/{isDarkColor-44e9e451.js → isDarkColor-416d6047.js} +1 -1
  60. package/dist/esm/loader.js +3 -3
  61. package/dist/esm/{localization-9c80f0f5.js → localization-a51ccbc2.js} +27 -7
  62. package/dist/esm/{submitGtag-7affec95.js → submitGtag-521826a2.js} +2 -2
  63. package/dist/esm/zonos-address_2.entry.js +6 -6
  64. package/dist/esm/zonos-badge.entry.js +2 -2
  65. package/dist/esm/zonos-banner.entry.js +2 -2
  66. package/dist/esm/zonos-button_2.entry.js +4 -4
  67. package/dist/esm/zonos-card_2.entry.js +2 -2
  68. package/dist/esm/zonos-cart-items_10.entry.js +50 -8
  69. package/dist/esm/zonos-checkout.entry.js +9 -7
  70. package/dist/esm/zonos-component.entry.js +1 -1
  71. package/dist/esm/zonos-controller.entry.js +8 -8
  72. package/dist/esm/zonos-country-flag_4.entry.js +4 -4
  73. package/dist/esm/zonos-elements.js +4 -4
  74. package/dist/esm/zonos-hello-dialog.entry.js +3 -3
  75. package/dist/esm/zonos-hello.entry.js +4 -4
  76. package/dist/esm/zonos-icon.entry.js +2 -2
  77. package/dist/esm/zonos-notification.entry.js +2 -2
  78. package/dist/esm/zonos-payment.entry.js +6 -6
  79. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
  80. package/dist/esm/zonos-text.entry.js +2 -2
  81. package/dist/esm/{zonosStore-e0b7a5cf.js → zonosStore-61e74f58.js} +1 -1
  82. package/dist/esm-es5/cart-b439be00.js +1 -0
  83. package/dist/esm-es5/{getBorderRadius-35e8acce.js → getBorderRadius-178a0a05.js} +1 -1
  84. package/dist/esm-es5/index-36ff6342.js +2 -0
  85. package/dist/esm-es5/index.js +1 -1
  86. package/dist/esm-es5/{isDarkColor-44e9e451.js → isDarkColor-416d6047.js} +1 -1
  87. package/dist/esm-es5/loader.js +1 -1
  88. package/dist/esm-es5/{localization-9c80f0f5.js → localization-a51ccbc2.js} +1 -1
  89. package/dist/esm-es5/{submitGtag-7affec95.js → submitGtag-521826a2.js} +1 -1
  90. package/dist/esm-es5/zonos-address_2.entry.js +1 -1
  91. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  92. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  93. package/dist/esm-es5/zonos-button_2.entry.js +1 -1
  94. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  95. package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
  96. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  97. package/dist/esm-es5/zonos-component.entry.js +1 -1
  98. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  99. package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -1
  100. package/dist/esm-es5/zonos-elements.js +1 -1
  101. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  102. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  103. package/dist/esm-es5/zonos-icon.entry.js +1 -1
  104. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  105. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  106. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  107. package/dist/esm-es5/zonos-text.entry.js +1 -1
  108. package/dist/esm-es5/{zonosStore-e0b7a5cf.js → zonosStore-61e74f58.js} +1 -1
  109. package/dist/scripts/loadZonos.js +23 -3
  110. package/dist/scripts/zonos.js +23 -3
  111. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +5 -1
  112. package/dist/types/components/store/checkout/stripe.d.ts +1 -0
  113. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  114. package/dist/types/components/utils/api/triggerBuildLandedCost.d.ts +5 -0
  115. package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
  116. package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
  117. package/dist/types/types/checkout/CheckoutConfig.d.ts +3 -1
  118. package/dist/types/types/generated/graphql.customer.types.d.ts +230 -7
  119. package/dist/types/types/generated/graphql.customer.types.ts +281 -7
  120. package/dist/types/types/generated/graphql.frontend.types.d.ts +222 -11
  121. package/dist/types/types/generated/graphql.frontend.types.ts +377 -11
  122. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  123. package/dist/zonos-elements/index.esm.js +1 -1
  124. package/dist/zonos-elements/{p-426a5999.system.entry.js → p-06fb9d1f.system.entry.js} +1 -1
  125. package/dist/zonos-elements/{p-77a7929b.js → p-089ba905.js} +1 -1
  126. package/dist/zonos-elements/{p-17bc1266.js → p-1685c8df.js} +1 -1
  127. package/dist/zonos-elements/p-18904b7c.system.js +2 -0
  128. package/dist/zonos-elements/{p-b8d11094.entry.js → p-1d4a970b.entry.js} +1 -1
  129. package/dist/zonos-elements/{p-80ba24a8.system.js → p-24eed2a8.system.js} +1 -1
  130. package/dist/zonos-elements/{p-bec21999.system.js → p-24fbe845.system.js} +1 -1
  131. package/dist/zonos-elements/{p-55f1da18.entry.js → p-2801d868.entry.js} +1 -1
  132. package/dist/zonos-elements/{p-1dbaf24b.system.entry.js → p-2f43da39.system.entry.js} +1 -1
  133. package/dist/zonos-elements/p-33137e7d.system.entry.js +1 -0
  134. package/dist/zonos-elements/{p-e3c617a4.js → p-3c6988d7.js} +1 -1
  135. package/dist/zonos-elements/p-3cea383b.system.entry.js +1 -0
  136. package/dist/zonos-elements/{p-86580e70.system.entry.js → p-47390db7.system.entry.js} +1 -1
  137. package/dist/zonos-elements/p-4846796a.js +1 -0
  138. package/dist/zonos-elements/p-494c77a7.entry.js +1 -0
  139. package/dist/zonos-elements/{p-00c99619.entry.js → p-49f09b91.entry.js} +1 -1
  140. package/dist/zonos-elements/{p-7c3ea8c6.system.entry.js → p-4a15c5c7.system.entry.js} +1 -1
  141. package/dist/zonos-elements/{p-c8fcaddc.system.entry.js → p-4bee0bff.system.entry.js} +1 -1
  142. package/dist/zonos-elements/{p-3eb33ba6.entry.js → p-4d93275c.entry.js} +1 -1
  143. package/dist/zonos-elements/{p-472c97b6.entry.js → p-4ed71bd7.entry.js} +1 -1
  144. package/dist/zonos-elements/{p-8bbad467.js → p-55f49f1e.js} +1 -1
  145. package/dist/zonos-elements/{p-114d8a14.system.entry.js → p-560aa686.system.entry.js} +1 -1
  146. package/dist/zonos-elements/{p-0362c416.entry.js → p-639396bb.entry.js} +1 -1
  147. package/dist/zonos-elements/{p-3c64448f.system.entry.js → p-67154df2.system.entry.js} +1 -1
  148. package/dist/zonos-elements/{p-9dbbacd9.entry.js → p-684ed483.entry.js} +1 -1
  149. package/dist/zonos-elements/{p-c743e43f.entry.js → p-89c210d6.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-9232db22.system.js → p-8c48b75e.system.js} +1 -1
  151. package/dist/zonos-elements/{p-40e68452.system.entry.js → p-8c5595d9.system.entry.js} +1 -1
  152. package/dist/zonos-elements/{p-263c1639.entry.js → p-938803f4.entry.js} +1 -1
  153. package/dist/zonos-elements/p-956efa27.js +2 -0
  154. package/dist/zonos-elements/{p-8858537d.entry.js → p-a0e36ed3.entry.js} +1 -1
  155. package/dist/zonos-elements/{p-b5bc4851.entry.js → p-a376a37f.entry.js} +1 -1
  156. package/dist/zonos-elements/{p-1d4b6d59.system.js → p-a504f64f.system.js} +1 -1
  157. package/dist/zonos-elements/p-afe26069.entry.js +1 -0
  158. package/dist/zonos-elements/{p-81da740f.system.entry.js → p-b4601210.system.entry.js} +1 -1
  159. package/dist/zonos-elements/{p-46d935ea.system.js → p-b51de536.system.js} +1 -1
  160. package/dist/zonos-elements/{p-84447396.entry.js → p-b6148206.entry.js} +1 -1
  161. package/dist/zonos-elements/{p-643eeb24.system.js → p-b85be1ab.system.js} +1 -1
  162. package/dist/zonos-elements/{p-06ec9556.system.entry.js → p-c9348bb0.system.entry.js} +1 -1
  163. package/dist/zonos-elements/p-d2217f09.system.js +1 -0
  164. package/dist/zonos-elements/{p-7bd0ab43.system.entry.js → p-d856a200.system.entry.js} +1 -1
  165. package/dist/zonos-elements/{p-754bdfdb.system.js → p-da060b1c.system.js} +1 -1
  166. package/dist/zonos-elements/{p-6f6d24da.entry.js → p-e1f6ab97.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-3a7546f0.system.entry.js → p-e5ae22a9.system.entry.js} +1 -1
  168. package/dist/zonos-elements/{p-4c0f4461.system.entry.js → p-e98be2d0.system.entry.js} +1 -1
  169. package/dist/zonos-elements/p-e9b832c5.entry.js +1 -0
  170. package/dist/zonos-elements/p-eb392924.entry.js +1 -0
  171. package/dist/zonos-elements/{p-de3db699.system.entry.js → p-f141519c.system.entry.js} +1 -1
  172. package/dist/zonos-elements/{p-39ae023c.system.entry.js → p-f367f2fe.system.entry.js} +1 -1
  173. package/dist/zonos-elements/p-ff95f098.js +1 -0
  174. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  175. package/dist/zonos-elements/zonos-elements.js +1 -1
  176. package/package.json +7 -6
  177. package/dist/esm-es5/cart-54eab7ab.js +0 -1
  178. package/dist/esm-es5/index-3617e24c.js +0 -2
  179. package/dist/zonos-elements/p-07c900e2.entry.js +0 -1
  180. package/dist/zonos-elements/p-197e4528.entry.js +0 -1
  181. package/dist/zonos-elements/p-3379ee13.js +0 -1
  182. package/dist/zonos-elements/p-35035961.entry.js +0 -1
  183. package/dist/zonos-elements/p-3ab985c6.entry.js +0 -1
  184. package/dist/zonos-elements/p-7aab4cf0.system.js +0 -1
  185. package/dist/zonos-elements/p-887e2f9a.system.entry.js +0 -1
  186. package/dist/zonos-elements/p-bec05c21.system.js +0 -2
  187. package/dist/zonos-elements/p-c1f4349c.system.entry.js +0 -1
  188. package/dist/zonos-elements/p-cf8aaa17.js +0 -2
  189. package/dist/zonos-elements/p-e1de2a1f.js +0 -1
@@ -1,7 +1,7 @@
1
- import { c as createStore, z as zonosStore } from './zonosStore-e0b7a5cf.js';
2
- import { h as handleFetch, l as log, a as localizationStore, b as logError, t as translate } from './localization-9c80f0f5.js';
3
- import { i as isDarkColor } from './isDarkColor-44e9e451.js';
4
- import { g as getBorderRadius } from './getBorderRadius-35e8acce.js';
1
+ import { z as zonosStore, c as createStore } from './zonosStore-61e74f58.js';
2
+ import { h as handleFetch, l as log, a as localizationStore, b as logError, t as translate } from './localization-a51ccbc2.js';
3
+ import { i as isDarkColor } from './isDarkColor-416d6047.js';
4
+ import { g as getBorderRadius } from './getBorderRadius-178a0a05.js';
5
5
 
6
6
  const prepCalculateLandedCost = () => {
7
7
  // maybe we don't need email now for prefetch the landed cost
@@ -32,9 +32,36 @@ const prepCalculateLandedCost = () => {
32
32
  };
33
33
  };
34
34
 
35
+ const triggerBuildLandedCost = async (buildLandedCost) => {
36
+ var _a;
37
+ const data = prepCalculateLandedCost();
38
+ const landedCost = await buildLandedCost(data.checkoutSessionId, data.contact, data.shippingAddress);
39
+ if (!landedCost) {
40
+ throw new Error('Failed to build landed cost');
41
+ }
42
+ // Validate the landed cost object to make sure the returned value from buildLandedCost has a valid schema
43
+ const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/validate-landed-cost`, {
44
+ body: landedCost,
45
+ headers: {
46
+ 'Content-Type': 'application/json',
47
+ },
48
+ method: 'POST',
49
+ });
50
+ if (!json || errors.length) {
51
+ throw new Error(`Invalid landed cost object: ${((_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message) || 'Unknown error'}`);
52
+ }
53
+ return landedCost;
54
+ };
55
+
35
56
  const calculateLandedCost = async (abortController) => {
57
+ // If buildLandedCost callback is supplied, use that instead of our regular request to '/calculate-landed-cost'
58
+ const buildLandedCost = zonosStore.checkoutSettings.buildLandedCost;
59
+ if (buildLandedCost) {
60
+ const json = await triggerBuildLandedCost(buildLandedCost);
61
+ return json;
62
+ }
36
63
  // request to get landed cost info
37
- const url = `${"https://v1.route.js.zonos.com"}/api/calculate-landed-cost`;
64
+ const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/calculate-landed-cost`;
38
65
  const { errors, json } = await handleFetch(url, {
39
66
  body: prepCalculateLandedCost(),
40
67
  method: 'POST',
@@ -89,6 +116,7 @@ const { onChange: onChange$1, reset: reset$1, state: stripeStore, } = createStor
89
116
  stripeAddressElement: null,
90
117
  stripeAddressEventData: null,
91
118
  stripeAddressUsedWhenFetchingLC: null,
119
+ stripeBillingAddressElement: null,
92
120
  stripeElements: null,
93
121
  stripeElementsOptions: null,
94
122
  stripeLinkElement: null,
@@ -334,7 +362,7 @@ const stripeStoreInitCheckoutSession = async () => {
334
362
  return false;
335
363
  }
336
364
  stripeStore.isFetchingSession = true;
337
- const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/create-checkout-session`, {
365
+ const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/create-checkout-session`, {
338
366
  body: {
339
367
  currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
340
368
  itemsAmount: total,
@@ -362,7 +390,7 @@ const stripeStoreInitCheckoutSession = async () => {
362
390
  const stripeStoreUpdateCheckoutSession = async ({ currency, id, itemsAmount, landedCostId, presentmentCountryCode, }) => {
363
391
  // No need to set loading state here because this function will be called under the hood to update
364
392
  // landed cost id for the section.
365
- const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/update-checkout-session`, {
393
+ const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/update-checkout-session`, {
366
394
  body: {
367
395
  currency,
368
396
  id,
@@ -474,7 +502,7 @@ const cartStoreReCalculateTotal = async ({ currency, itemsAmount, landedCostId,
474
502
  }
475
503
  // update checkout session
476
504
  if (!cartStore.checkoutSessionId) {
477
- logError('Could update cart total without checkout session id');
505
+ logError('Could not update cart total without checkout session id');
478
506
  return false;
479
507
  }
480
508
  const { json } = await stripeStoreUpdateCheckoutSession({
@@ -1,4 +1,4 @@
1
- import { z as zonosStore } from './zonosStore-e0b7a5cf.js';
1
+ import { z as zonosStore } from './zonosStore-61e74f58.js';
2
2
 
3
3
  /**
4
4
  * Get the border radius for the elements based on the style
@@ -633,6 +633,9 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
633
633
  }
634
634
  }
635
635
  }
636
+ // This needs to always happen so we can hide nodes that are projected
637
+ // to another component but don't end up in a slot
638
+ elm['s-hn'] = hostTagName;
636
639
  return elm;
637
640
  };
638
641
  /**
@@ -757,8 +760,9 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
757
760
  * @param oldCh the old children of the parent node
758
761
  * @param newVNode the new VNode which will replace the parent
759
762
  * @param newCh the new children of the parent node
763
+ * @param isInitialRender whether or not this is the first render of the vdom
760
764
  */
761
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
765
+ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
762
766
  let oldStartIdx = 0;
763
767
  let newStartIdx = 0;
764
768
  let idxInOld = 0;
@@ -785,25 +789,25 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
785
789
  else if (newEndVnode == null) {
786
790
  newEndVnode = newCh[--newEndIdx];
787
791
  }
788
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
792
+ else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
789
793
  // if the start nodes are the same then we should patch the new VNode
790
794
  // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
791
795
  // indices to reflect that. We don't need to move any DOM Nodes around
792
796
  // since things are matched up in order.
793
- patch(oldStartVnode, newStartVnode);
797
+ patch(oldStartVnode, newStartVnode, isInitialRender);
794
798
  oldStartVnode = oldCh[++oldStartIdx];
795
799
  newStartVnode = newCh[++newStartIdx];
796
800
  }
797
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
801
+ else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
798
802
  // likewise, if the end nodes are the same we patch new onto old and
799
803
  // decrement our end indices, and also likewise in this case we don't
800
804
  // need to move any DOM Nodes.
801
- patch(oldEndVnode, newEndVnode);
805
+ patch(oldEndVnode, newEndVnode, isInitialRender);
802
806
  oldEndVnode = oldCh[--oldEndIdx];
803
807
  newEndVnode = newCh[--newEndIdx];
804
808
  }
805
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
806
- patch(oldStartVnode, newEndVnode);
809
+ else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
810
+ patch(oldStartVnode, newEndVnode, isInitialRender);
807
811
  // We need to move the element for `oldStartVnode` into a position which
808
812
  // will be appropriate for `newEndVnode`. For this we can use
809
813
  // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
@@ -825,8 +829,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
825
829
  oldStartVnode = oldCh[++oldStartIdx];
826
830
  newEndVnode = newCh[--newEndIdx];
827
831
  }
828
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
829
- patch(oldEndVnode, newStartVnode);
832
+ else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
833
+ patch(oldEndVnode, newStartVnode, isInitialRender);
830
834
  // We've already checked above if `oldStartVnode` and `newStartVnode` are
831
835
  // the same node, so since we're here we know that they are not. Thus we
832
836
  // can move the element for `oldEndVnode` _before_ the element for
@@ -863,7 +867,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
863
867
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
864
868
  }
865
869
  else {
866
- patch(elmToMove, newStartVnode);
870
+ patch(elmToMove, newStartVnode, isInitialRender);
867
871
  // invalidate the matching old node so that we won't try to update it
868
872
  // again later on
869
873
  oldCh[idxInOld] = undefined;
@@ -914,16 +918,22 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
914
918
  *
915
919
  * @param leftVNode the first VNode to check
916
920
  * @param rightVNode the second VNode to check
921
+ * @param isInitialRender whether or not this is the first render of the vdom
917
922
  * @returns whether they're equal or not
918
923
  */
919
- const isSameVnode = (leftVNode, rightVNode) => {
924
+ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
920
925
  // compare if two vnode to see if they're "technically" the same
921
926
  // need to have the same element tag, and same key to be the same
922
927
  if (leftVNode.$tag$ === rightVNode.$tag$) {
923
- // this will be set if components in the build have `key` attrs set on them
924
- {
928
+ // this will be set if JSX tags in the build have `key` attrs set on them
929
+ // we only want to check this if we're not on the first render since on
930
+ // first render `leftVNode.$key$` will always be `null`, so we can be led
931
+ // astray and, for instance, accidentally delete a DOM node that we want to
932
+ // keep around.
933
+ if (!isInitialRender) {
925
934
  return leftVNode.$key$ === rightVNode.$key$;
926
935
  }
936
+ return true;
927
937
  }
928
938
  return false;
929
939
  };
@@ -934,8 +944,9 @@ const isSameVnode = (leftVNode, rightVNode) => {
934
944
  *
935
945
  * @param oldVNode an old VNode whose DOM element and children we want to update
936
946
  * @param newVNode a new VNode representing an updated version of the old one
947
+ * @param isInitialRender whether or not this is the first render of the vdom
937
948
  */
938
- const patch = (oldVNode, newVNode) => {
949
+ const patch = (oldVNode, newVNode, isInitialRender = false) => {
939
950
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
940
951
  const oldChildren = oldVNode.$children$;
941
952
  const newChildren = newVNode.$children$;
@@ -960,7 +971,7 @@ const patch = (oldVNode, newVNode) => {
960
971
  if (oldChildren !== null && newChildren !== null) {
961
972
  // looks like there's child vnodes for both the old and new vnodes
962
973
  // so we need to call `updateChildren` to reconcile them
963
- updateChildren(elm, oldChildren, newVNode, newChildren);
974
+ updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
964
975
  }
965
976
  else if (newChildren !== null) {
966
977
  // no old child vnodes, but there are new child vnodes to add
@@ -1050,7 +1061,7 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1050
1061
  scopeId = hostElm['s-sc'];
1051
1062
  }
1052
1063
  // synchronous patch
1053
- patch(oldVNode, rootVnode);
1064
+ patch(oldVNode, rootVnode, isInitialLoad);
1054
1065
  };
1055
1066
  const attachToAncestor = (hostRef, ancestorComponent) => {
1056
1067
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export { c as cartStore, a as cartStoreApplySubtotals, b as cartStoreGetShippingTransitInfo, d as cartStoreNextStep, e as cartStorePreviousStep, f as cartStoreReCalculateTotal, g as cartStoreReset, h as cartStoreUpdateItems, i as cartStoreUpdateSelectedShippingOption, j as cartStoreUpdateToErrorState } from './cart-54eab7ab.js';
2
- import './zonosStore-e0b7a5cf.js';
3
- import './index-3617e24c.js';
4
- import './localization-9c80f0f5.js';
5
- import './isDarkColor-44e9e451.js';
6
- import './getBorderRadius-35e8acce.js';
1
+ export { c as cartStore, a as cartStoreApplySubtotals, b as cartStoreGetShippingTransitInfo, d as cartStoreNextStep, e as cartStorePreviousStep, f as cartStoreReCalculateTotal, g as cartStoreReset, h as cartStoreUpdateItems, i as cartStoreUpdateSelectedShippingOption, j as cartStoreUpdateToErrorState } from './cart-b439be00.js';
2
+ import './zonosStore-61e74f58.js';
3
+ import './index-36ff6342.js';
4
+ import './localization-a51ccbc2.js';
5
+ import './isDarkColor-416d6047.js';
6
+ import './getBorderRadius-178a0a05.js';
@@ -1,4 +1,4 @@
1
- import { a as createCommonjsModule, b as commonjsGlobal } from './zonosStore-e0b7a5cf.js';
1
+ import { a as createCommonjsModule, b as commonjsGlobal } from './zonosStore-61e74f58.js';
2
2
 
3
3
  var tinycolor = createCommonjsModule(function (module, exports) {
4
4
  // This file is autogenerated. It's used to publish CJS to npm.
@@ -1,9 +1,9 @@
1
- import { b as bootstrapLazy } from './index-3617e24c.js';
2
- export { s as setNonce } from './index-3617e24c.js';
1
+ import { b as bootstrapLazy } from './index-36ff6342.js';
2
+ export { s as setNonce } from './index-36ff6342.js';
3
3
 
4
4
  const defineCustomElements = (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
6
- return bootstrapLazy([["zonos-text",[[1,"zonos-text",{"class":[1],"color":[1],"size":[1],"type":[1],"weight":[2],"content":[1],"ready":[32]}]]],["zonos-checkout",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"paymentError":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged"],"mobile":["handleMobileChange"]}]]],["zonos-hello",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64]},[[9,"resize","handleResize"]]]]],["zonos-controller",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64]}]]],["zonos-component",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-country-flag_4",[[1,"zonos-country-select",{"closeCountrySelect":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[1,"zonos-country-flag",{"class":[1],"countryCode":[1,"country-code"],"size":[2]}]]],["zonos-hello-dialog",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["zonos-notification",[[1,"zonos-notification",{"class":[1],"notificationArray":[32],"showNotification":[64]}]]],["zonos-badge",[[1,"zonos-badge",{"bold":[4],"color":[1],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"class":[1]}]]],["zonos-payment",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}]]],["zonos-shipping-rich-radio",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[32]}]]],["zonos-address_2",[[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}]]],["zonos-banner",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"class":[1],"hasContent":[32]}]]],["zonos-card_2",[[1,"zonos-card",{"actions":[16],"class":[1],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}],[1,"zonos-v-stack",{"spacing":[2],"class":[1]}]]],["zonos-icon",[[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"color":[1],"content":[1],"size":[2]}]]],["zonos-button_2",[[1,"zonos-button",{"class":[1],"color":[1],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"color":[1]}]]],["zonos-cart-items_10",[[2,"zonos-checkout-payment",{"paymentError":[4,"payment-error"],"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"defaultAddress":[16],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32]}],[1,"zonos-cart-subtotal"],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"footerRightAction":[16],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32]}],[1,"zonos-logo",{"theme":[1],"width":[1],"class":[1]}]]]], options);
6
+ return bootstrapLazy([["zonos-text",[[1,"zonos-text",{"class":[1],"color":[1],"size":[1],"type":[1],"weight":[2],"content":[1],"ready":[32]}]]],["zonos-checkout",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"paymentError":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged"],"mobile":["handleMobileChange"]}]]],["zonos-hello",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64]},[[9,"resize","handleResize"]]]]],["zonos-controller",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64]}]]],["zonos-component",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-country-flag_4",[[1,"zonos-country-select",{"closeCountrySelect":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[1,"zonos-country-flag",{"class":[1],"countryCode":[1,"country-code"],"size":[2]}]]],["zonos-hello-dialog",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["zonos-notification",[[1,"zonos-notification",{"class":[1],"notificationArray":[32],"showNotification":[64]}]]],["zonos-badge",[[1,"zonos-badge",{"bold":[4],"color":[1],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"class":[1]}]]],["zonos-payment",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}]]],["zonos-shipping-rich-radio",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[32]}]]],["zonos-address_2",[[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}]]],["zonos-banner",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"class":[1],"hasContent":[32]}]]],["zonos-card_2",[[1,"zonos-card",{"actions":[16],"class":[1],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}],[1,"zonos-v-stack",{"spacing":[2],"class":[1]}]]],["zonos-icon",[[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"color":[1],"content":[1],"size":[2]}]]],["zonos-button_2",[[1,"zonos-button",{"class":[1],"color":[1],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"color":[1]}]]],["zonos-cart-items_10",[[2,"zonos-checkout-payment",{"paymentError":[4,"payment-error"],"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"defaultAddress":[16],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"disabled":[32]},null,{"disabled":["watchFormComplete"]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"order":[32]}],[1,"zonos-cart-subtotal"],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"footerRightAction":[16],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32]}],[1,"zonos-logo",{"theme":[1],"width":[1],"class":[1]}]]]], options);
7
7
  };
8
8
 
9
9
  export { defineCustomElements };
@@ -1,4 +1,4 @@
1
- import { c as createStore, z as zonosStore } from './zonosStore-e0b7a5cf.js';
1
+ import { c as createStore, z as zonosStore } from './zonosStore-61e74f58.js';
2
2
 
3
3
  const stringsArabic = {
4
4
  'Above de minimis threshold for': {
@@ -3192,7 +3192,7 @@ const handleFetch = async (url, _opts) => {
3192
3192
 
3193
3193
  const getCountries = async () => {
3194
3194
  try {
3195
- const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/get-countries`, {
3195
+ const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/get-countries`, {
3196
3196
  method: 'GET',
3197
3197
  });
3198
3198
  if (errors.length || !json) {
@@ -3215,7 +3215,7 @@ const getCountryLandedCost = async (countryCode) => {
3215
3215
  if (!countryCode) {
3216
3216
  return null;
3217
3217
  }
3218
- const url = `${"https://v1.route.js.zonos.com"}/api/country-landed-cost/${countryCode}`;
3218
+ const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/country-landed-cost/${countryCode}`;
3219
3219
  const { errors, json } = await handleFetch(url);
3220
3220
  if (errors.length || !json) {
3221
3221
  logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
@@ -3230,7 +3230,7 @@ const getExchangeRate = async ({ country, isGuaranteed, sourceCurrency, targetCu
3230
3230
  if (sourceCurrency === targetCurrency && !isGuaranteed) {
3231
3231
  return { exchangeRate: null, maxAge: null };
3232
3232
  }
3233
- const url = `${"https://v1.route.js.zonos.com"}/api/exchange-rates?sourceCurrency=${sourceCurrency}&targetCurrency=${targetCurrency}&isGuaranteed=${isGuaranteed}&country=${country}}`;
3233
+ const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/exchange-rates?sourceCurrency=${sourceCurrency}&targetCurrency=${targetCurrency}&isGuaranteed=${isGuaranteed}&country=${country}`;
3234
3234
  const { errors, json } = await handleFetch(url);
3235
3235
  if (errors.length || !json) {
3236
3236
  logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
@@ -3247,7 +3247,7 @@ const getExchangeRate = async ({ country, isGuaranteed, sourceCurrency, targetCu
3247
3247
 
3248
3248
  const getLocaleMessages = async ({ countryCode, localeTo, storeId, }) => {
3249
3249
  var _a;
3250
- const url = `${"https://v1.route.js.zonos.com"}/api/locale-messages?countryCode=${countryCode}&storeId=${storeId}&localeTo=${localeTo}`;
3250
+ const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/locale-messages?countryCode=${countryCode}&storeId=${storeId}&localeTo=${localeTo}`;
3251
3251
  const { errors, json } = await handleFetch(url);
3252
3252
  if (errors.length || !json) {
3253
3253
  // eslint-disable-next-line no-console
@@ -3269,7 +3269,7 @@ const getLocalization = async () => {
3269
3269
  // load and use country from session storage when zCountry query param is not present
3270
3270
  const countryLoadedSession = window.sessionStorage.getItem('zonos--country');
3271
3271
  const zCountry = getZCountryUrlParam(currentUrl.searchParams) || countryLoadedSession;
3272
- const localizationUrl = new URL(`${"https://v1.route.js.zonos.com"}/api/localization`);
3272
+ const localizationUrl = new URL(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/localization`);
3273
3273
  if (zCountry) {
3274
3274
  localizationUrl.searchParams.set('zCountry', zCountry);
3275
3275
  }
@@ -3292,7 +3292,7 @@ const getLocalization = async () => {
3292
3292
 
3293
3293
  const getShippingZones = async () => {
3294
3294
  var _a, _b;
3295
- const url = `${"https://v1.route.js.zonos.com"}/api/shipping-zones`;
3295
+ const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/shipping-zones`;
3296
3296
  const { errors, json } = await handleFetch(url);
3297
3297
  if (errors.length || !json) {
3298
3298
  logError(`Error fetching shipping zones: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
@@ -3370,10 +3370,30 @@ const isValidSelector = (selector) => {
3370
3370
  };
3371
3371
 
3372
3372
  const log = (message, type, ...additionalInfo) => {
3373
+ var _a;
3373
3374
  // if type is error and debug is false, do not log
3374
3375
  if (!window.Zonos.debug) {
3375
3376
  return;
3376
3377
  }
3378
+ let loggingIframe = document.querySelector('iframe#zonos---debug-logging-iframe');
3379
+ if (!loggingIframe) {
3380
+ // add a hidden iframe
3381
+ loggingIframe = document.createElement('iframe');
3382
+ loggingIframe.id = 'zonos---debug-logging-iframe';
3383
+ loggingIframe.style.display = 'none';
3384
+ loggingIframe.style.opacity = '0';
3385
+ loggingIframe.style.position = 'absolute';
3386
+ loggingIframe.style.top = '-9999px';
3387
+ loggingIframe.style.left = '-9999px';
3388
+ loggingIframe.style.width = '1px';
3389
+ loggingIframe.style.height = '1px';
3390
+ loggingIframe.style.border = 'none';
3391
+ loggingIframe.style.overflow = 'hidden';
3392
+ loggingIframe.style.visibility = 'hidden';
3393
+ document.body.appendChild(loggingIframe);
3394
+ }
3395
+ // use the logging iframe's console to log just in case the console is disabled (overriden) by the site owner
3396
+ const console = ((_a = loggingIframe.contentWindow) === null || _a === void 0 ? void 0 : _a.window.console) || window.console;
3377
3397
  switch (type) {
3378
3398
  case 'warn':
3379
3399
  // eslint-disable-next-line no-console
@@ -1,5 +1,5 @@
1
- import { z as zonosStore } from './zonosStore-e0b7a5cf.js';
2
- import { l as log } from './localization-9c80f0f5.js';
1
+ import { z as zonosStore } from './zonosStore-61e74f58.js';
2
+ import { l as log } from './localization-a51ccbc2.js';
3
3
 
4
4
  const checkoutBreakpoint = 890;
5
5
  const isCheckoutMobile = (isMobile) => {
@@ -1,9 +1,9 @@
1
- import { r as registerInstance, h, H as Host, d as getElement } from './index-3617e24c.js';
2
- import { s as stripeStore, m as stripeStorePrefetchLandedCost } from './cart-54eab7ab.js';
3
- import { b as logError, a as localizationStore } from './localization-9c80f0f5.js';
4
- import './zonosStore-e0b7a5cf.js';
5
- import './isDarkColor-44e9e451.js';
6
- import './getBorderRadius-35e8acce.js';
1
+ import { r as registerInstance, h, H as Host, d as getElement } from './index-36ff6342.js';
2
+ import { s as stripeStore, m as stripeStorePrefetchLandedCost } from './cart-b439be00.js';
3
+ import { b as logError, a as localizationStore } from './localization-a51ccbc2.js';
4
+ import './zonosStore-61e74f58.js';
5
+ import './isDarkColor-416d6047.js';
6
+ import './getBorderRadius-178a0a05.js';
7
7
 
8
8
  const zonosAddressCss = ".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:var(--amino-space-16)}";
9
9
 
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, h, H as Host } from './index-3617e24c.js';
2
- import { e as zonosStoreFontFamily } from './zonosStore-e0b7a5cf.js';
1
+ import { r as registerInstance, h, H as Host } from './index-36ff6342.js';
2
+ import { e as zonosStoreFontFamily } from './zonosStore-61e74f58.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
4
 
5
5
  const zonosBadgeCss = ":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{display:-ms-inline-flexbox;display:inline-flex}:host .zonos--badge-content{display:-ms-flexbox;display:flex;gap:var(--amino-space-8);font-size:var(--amino-font-size-s);padding:4px 8px;text-align:center;border-radius:var(--amino-radius-6);background-color:var(--amino-gray-100);color:var(--amino-gray-800);-ms-flex-align:center;align-items:center}:host p{font-weight:600;line-height:16px}:host .icon-right svg{-ms-flex-order:2;order:2}:host .small{padding:2px 8px}:host .rounded{border-radius:20px}:host .bold{background-color:var(--amino-gray-600);color:var(--amino-gray-100)}:host .blue{background-color:var(--amino-blue-100);color:var(--amino-blue-800)}:host .blue.bold{background-color:var(--amino-blue-600);color:var(--amino-blue-100)}:host .green{background-color:var(--amino-green-100);color:var(--amino-green-800)}:host .green.bold{background-color:var(--amino-green-600);color:var(--amino-green-100)}:host .red{background-color:var(--amino-red-100);color:var(--amino-red-800)}:host .red.bold{background-color:var(--amino-red-600);color:var(--amino-red-100)}:host .orange{background-color:var(--amino-orange-100);color:var(--amino-orange-800)}:host .orange.bold{background-color:var(--amino-orange-600);color:var(--amino-orange-100)}:host .purple{background-color:var(--amino-purple-100);color:var(--amino-purple-800)}:host .purple.bold{background-color:var(--amino-purple-600);color:var(--amino-purple-100)}:host .cyan{background-color:var(--amino-cyan-100);color:var(--amino-cyan-800)}:host .cyan.bold{background-color:var(--amino-cyan-600);color:var(--amino-cyan-100)}";
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, h, H as Host } from './index-3617e24c.js';
2
- import { e as zonosStoreFontFamily } from './zonosStore-e0b7a5cf.js';
1
+ import { r as registerInstance, h, H as Host } from './index-36ff6342.js';
2
+ import { e as zonosStoreFontFamily } from './zonosStore-61e74f58.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
4
 
5
5
  const zonosBannerCss = ":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{border-radius:var(--amino-radius-10);padding:var(--amino-space-16);background:var(--amino-gray-100)}:host .zonos--container{display:grid;-ms-flex-align:center;align-items:center;grid-template-areas:\"icon header\" \". content\";grid-template-columns:32px auto 0}:host .zonos--icon-wrapper{grid-area:icon;display:-ms-flexbox;display:flex;justify-self:start}:host .zonos--header-wrapper{margin-top:var(--amino-space-0);grid-area:header}:host .zonos--content-wrapper{grid-area:content;margin-top:var(--amino-space-4)}:host(.info){background-color:var(--amino-blue-100);border:1px solid var(--amino-blue-200)}:host(.success){background-color:var(--amino-green-100);border:1px solid var(--amino-green-200)}:host(.error){background-color:var(--amino-red-100);border:1px solid var(--amino-red-200)}:host(.warning){background-color:var(--amino-orange-100);border:1px solid var(--amino-orange-200)}";
@@ -1,9 +1,9 @@
1
- import { r as registerInstance, h, H as Host, d as getElement } from './index-3617e24c.js';
2
- import { z as zonosStore, e as zonosStoreFontFamily } from './zonosStore-e0b7a5cf.js';
1
+ import { r as registerInstance, h, H as Host, d as getElement } from './index-36ff6342.js';
2
+ import { z as zonosStore, e as zonosStoreFontFamily } from './zonosStore-61e74f58.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { g as getBorderRadius } from './getBorderRadius-35e8acce.js';
4
+ import { g as getBorderRadius } from './getBorderRadius-178a0a05.js';
5
5
  import { i as isColorVariable } from './isColorVariable-91c33804.js';
6
- import { i as isDarkColor } from './isDarkColor-44e9e451.js';
6
+ import { i as isDarkColor } from './isDarkColor-416d6047.js';
7
7
 
8
8
  /**
9
9
  * Get theme for button text based on background color
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, h, H as Host } from './index-3617e24c.js';
2
- import { e as zonosStoreFontFamily } from './zonosStore-e0b7a5cf.js';
1
+ import { r as registerInstance, h, H as Host } from './index-36ff6342.js';
2
+ import { e as zonosStoreFontFamily } from './zonosStore-61e74f58.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
4
 
5
5
  const zonosCardCss = ":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 .styled-card{border:var(--amino-border);border-radius:var(--amino-radius-6);padding:var(--spacing, var(--amino-space-24));text-align:left}:host .styled-card hr{margin-left:calc(var(--spacing, var(--amino-space-24)) * -1);margin-right:calc(var(--spacing, var(--amino-space-24)) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, var(--amino-space-24)) * -1);padding:var(--spacing, var(--amino-space-24));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, var(--amino-space-24));border-bottom:var(--amino-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, var(--amino-space-24)) * -1);padding:var(--spacing, var(--amino-space-24));border-top:var(--amino-border);background:var(--amino-surface-color-secondary);margin-top:var(--spacing, var(--amino-space-24));border-bottom-left-radius:var(--amino-radius-8);border-bottom-right-radius:var(--amino-radius-8);height:var(--footerHeight)}";
@@ -1,11 +1,11 @@
1
- import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-3617e24c.js';
2
- import { c as cartStore, s as stripeStore, p as stripeStoreRetrievePayment, o as stripeStoreReset, i as cartStoreUpdateSelectedShippingOption, b as cartStoreGetShippingTransitInfo } from './cart-54eab7ab.js';
3
- import { t as translate } from './localization-9c80f0f5.js';
4
- import { g as getBorderRadius } from './getBorderRadius-35e8acce.js';
5
- import { s as submitGtag, i as isCheckoutMobile } from './submitGtag-7affec95.js';
6
- import { e as zonosStoreFontFamily, z as zonosStore } from './zonosStore-e0b7a5cf.js';
1
+ import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-36ff6342.js';
2
+ import { c as cartStore, s as stripeStore, p as stripeStoreRetrievePayment, o as stripeStoreReset, i as cartStoreUpdateSelectedShippingOption, b as cartStoreGetShippingTransitInfo } from './cart-b439be00.js';
3
+ import { t as translate, h as handleFetch, b as logError } from './localization-a51ccbc2.js';
4
+ import { g as getBorderRadius } from './getBorderRadius-178a0a05.js';
5
+ import { s as submitGtag, i as isCheckoutMobile } from './submitGtag-521826a2.js';
6
+ import { e as zonosStoreFontFamily, z as zonosStore } from './zonosStore-61e74f58.js';
7
7
  import { c as classes } from './classes-0d95c529.js';
8
- import './isDarkColor-44e9e451.js';
8
+ import './isDarkColor-416d6047.js';
9
9
 
10
10
  const formatCurrency = ({ amount, currency, showCurrencyText, }) => showCurrencyText
11
11
  ? `${new Intl.NumberFormat('en-US', {
@@ -101,6 +101,36 @@ const ZonosCheckoutFinish = class {
101
101
  constructor(hostRef) {
102
102
  registerInstance(this, hostRef);
103
103
  this.closeClick = createEvent(this, "closeClick", 7);
104
+ this.pullOrder = async () => {
105
+ var _a, _b;
106
+ const baseUrl = "https://v1.route.js.zonos.com";
107
+ const checkoutSessionId = cartStore.checkoutSessionId;
108
+ const { errors, json } = await handleFetch(`${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}`);
109
+ if (errors.length || !(json === null || json === void 0 ? void 0 : json.id)) {
110
+ return null;
111
+ }
112
+ // TODO: This method of triggering /success for BigCommerce is for MVP. Remove when eventRegistry is fixed to handle by webhooks
113
+ if (window.Zonos.isBigCommerce) {
114
+ const orderId = json === null || json === void 0 ? void 0 : json.id;
115
+ const storeHash = (_b = (_a = json === null || json === void 0 ? void 0 : json.metadata) === null || _a === void 0 ? void 0 : _a.find(x => (x === null || x === void 0 ? void 0 : x.key) === 'storeHash')) === null || _b === void 0 ? void 0 : _b.value;
116
+ if (!orderId || !storeHash) {
117
+ return logError('Unable to trigger BigCommerce /success: Missing orderId or storeHash');
118
+ }
119
+ void handleFetch(`${baseUrl}/api/bigcommerce/success?orderId=${orderId}&storeHash=${storeHash}`);
120
+ }
121
+ return json;
122
+ };
123
+ this.getPullOrder = async (attempts = 0) => {
124
+ const order = await this.pullOrder();
125
+ if (order) {
126
+ this.order = order;
127
+ }
128
+ else if (!order && attempts < 5) {
129
+ // Wait for 1 second before the next attempt
130
+ await new Promise(resolve => setTimeout(resolve, 1000));
131
+ await this.getPullOrder(attempts + 1);
132
+ }
133
+ };
104
134
  this.checkPaymentStatus = async () => {
105
135
  this.isLoading = true;
106
136
  const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || stripeStore.clientSecret;
@@ -126,6 +156,10 @@ const ZonosCheckoutFinish = class {
126
156
  });
127
157
  document.dispatchEvent(successEvent);
128
158
  }
159
+ // Attempt to pull the order details from the graph every second on 5 attempts
160
+ if (this.notificationType === 'success') {
161
+ void this.getPullOrder();
162
+ }
129
163
  }
130
164
  stripeStoreReset();
131
165
  this.isLoading = false;
@@ -140,6 +174,7 @@ const ZonosCheckoutFinish = class {
140
174
  this.notificationType = 'success';
141
175
  this.notificationTitle = '';
142
176
  this.notificationMessages = [];
177
+ this.order = null;
143
178
  }
144
179
  componentDidLoad() {
145
180
  if (this.overrideNotification) {
@@ -153,9 +188,16 @@ const ZonosCheckoutFinish = class {
153
188
  void this.checkPaymentStatus();
154
189
  }
155
190
  render() {
191
+ // TODO: Keeping this code for when we have a UI for order details
192
+ // const orderTotal = this.order?.amountSubtotals
193
+ // ? Object.values(this.order.amountSubtotals).reduce((a, b) => a + b, 0)
194
+ // : 0;
195
+ // const totalItems = this.order?.items?.reduce((acc, item) => {
196
+ // return acc + item.quantity;
197
+ // }, 0);
156
198
  return (h(Host, { class: "zonos--checkout-finish zonos--elements", style: {
157
199
  '--border-radius': getBorderRadius(this.borderRadius),
158
- } }, this.isLoading && (h("div", { class: "loading-wrapper" }, h("zonos-spinner", null))), !this.isLoading && (h("div", { class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { color: 'blue-800', content: SuccessIcon, size: 50 })) : (h("zonos-icon", { color: 'red-800', content: RemoveIcon$1, size: 50 })), h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", null, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, translate('Keep shopping'))))));
200
+ } }, this.isLoading && (h("div", { class: "loading-wrapper" }, h("zonos-spinner", null))), !this.isLoading && (h(Fragment, null, h("div", { class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { color: 'blue-800', content: SuccessIcon, size: 50 })) : (h("zonos-icon", { color: 'red-800', content: RemoveIcon$1, size: 50 })), h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", null, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, translate('Keep shopping')))))));
159
201
  }
160
202
  static get assetsDirs() { return ["assets"]; }
161
203
  };
@@ -1,11 +1,11 @@
1
- import { r as registerInstance, h, F as Fragment, H as Host } from './index-3617e24c.js';
2
- import { k as initStripeElements, c as cartStore, h as cartStoreUpdateItems, g as cartStoreReset, s as stripeStore, l as stripeStoreInitCheckoutSession, j as cartStoreUpdateToErrorState, m as stripeStorePrefetchLandedCost, d as cartStoreNextStep, n as stripeStoreConfirmPayment, o as stripeStoreReset, e as cartStorePreviousStep } from './cart-54eab7ab.js';
3
- import { a as localizationStore, l as log, t as translate } from './localization-9c80f0f5.js';
4
- import { z as zonosStore, m as mergeConfig } from './zonosStore-e0b7a5cf.js';
5
- import { s as submitGtag, i as isCheckoutMobile } from './submitGtag-7affec95.js';
1
+ import { r as registerInstance, h, F as Fragment, H as Host } from './index-36ff6342.js';
2
+ import { k as initStripeElements, c as cartStore, h as cartStoreUpdateItems, g as cartStoreReset, s as stripeStore, l as stripeStoreInitCheckoutSession, j as cartStoreUpdateToErrorState, m as stripeStorePrefetchLandedCost, d as cartStoreNextStep, n as stripeStoreConfirmPayment, o as stripeStoreReset, e as cartStorePreviousStep } from './cart-b439be00.js';
3
+ import { a as localizationStore, l as log, t as translate } from './localization-a51ccbc2.js';
4
+ import { z as zonosStore, m as mergeConfig } from './zonosStore-61e74f58.js';
5
+ import { s as submitGtag, i as isCheckoutMobile } from './submitGtag-521826a2.js';
6
6
  import { c as classes } from './classes-0d95c529.js';
7
- import { g as getBorderRadius } from './getBorderRadius-35e8acce.js';
8
- import { i as isDarkColor } from './isDarkColor-44e9e451.js';
7
+ import { g as getBorderRadius } from './getBorderRadius-178a0a05.js';
8
+ import { i as isDarkColor } from './isDarkColor-416d6047.js';
9
9
 
10
10
  const LeftArrow = `<svg color="var(--amino-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M9.707 16.707a1 1 0 0 1-1.414 0l-3.647-3.646a1.5 1.5 0 0 1 0-2.122l3.647-3.646a1 1 0 0 1 1.414 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l2.293 2.293a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
11
11
 
@@ -291,6 +291,8 @@ const ZonosCheckout = class {
291
291
  // Update the URL without query parameters
292
292
  window.history.replaceState({}, document.title, cleanUrl);
293
293
  this.open = false;
294
+ // Reload the page
295
+ window.location.reload();
294
296
  }
295
297
  async handleBackClick() {
296
298
  // close the modal if back button is clicked on customer info step
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-3617e24c.js';
1
+ import { r as registerInstance, h } from './index-36ff6342.js';
2
2
 
3
3
  function format(first, middle, last) {
4
4
  return ((first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : ''));
@@ -1,12 +1,12 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-3617e24c.js';
2
- import { s as stripeStore } from './cart-54eab7ab.js';
3
- import { h as handleFetch, b as logError, i as isValidSelector, l as log, c as initLocalizationStore, d as localizationStoreUpdateSelectedCountryCode } from './localization-9c80f0f5.js';
4
- import { z as zonosStore, d as zonosStoreInitSetting, e as zonosStoreFontFamily } from './zonosStore-e0b7a5cf.js';
5
- import './isDarkColor-44e9e451.js';
6
- import './getBorderRadius-35e8acce.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-36ff6342.js';
2
+ import { s as stripeStore } from './cart-b439be00.js';
3
+ import { h as handleFetch, b as logError, i as isValidSelector, l as log, c as initLocalizationStore, d as localizationStoreUpdateSelectedCountryCode } from './localization-a51ccbc2.js';
4
+ import { z as zonosStore, d as zonosStoreInitSetting, e as zonosStoreFontFamily } from './zonosStore-61e74f58.js';
5
+ import './isDarkColor-416d6047.js';
6
+ import './getBorderRadius-178a0a05.js';
7
7
 
8
8
  const getZonosSetting = async () => {
9
- const url = `${"https://v1.route.js.zonos.com"}/api/zonos-setting`;
9
+ const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-setting`;
10
10
  const { errors, json } = await handleFetch(url);
11
11
  if (errors.length) {
12
12
  logError(`Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting`);
@@ -147,7 +147,7 @@ const ZonosController = class {
147
147
  zonosStore.appearance = Object.assign(Object.assign({}, zonosStore.appearance), { fontFamily: overrideFont });
148
148
  }
149
149
  const routeUrl = "https://v1.route.js.zonos.com";
150
- const { errors, json } = await handleFetch(`${routeUrl}/api/get-font-detail?family=${fontSelected}`);
150
+ const { errors, json } = await handleFetch(`${routeUrl}/api/zonos-elements/get-font-detail?family=${fontSelected}`);
151
151
  if (errors.length > 0 || !json) {
152
152
  log(`Failed to load font ${fontSelected}`, 'warn');
153
153
  return;