@zonos/elements 1.2.4-alpha.8 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/README.md +80 -1
  2. package/dist/cjs/{cart-90f7c8c0.js → cart-cfa5d5fd.js} +4 -4
  3. package/dist/cjs/{getBorderRadius-bf4a4276.js → getBorderRadius-c3c63ee6.js} +1 -1
  4. package/dist/cjs/index.cjs.js +5 -5
  5. package/dist/cjs/{isDarkColor-ff6ff183.js → isDarkColor-fc8c294a.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{localization-9caf3397.js → localization-4746acf7.js} +2 -2
  8. package/dist/cjs/{submitGtag-b141b45d.js → submitGtag-ca175427.js} +2 -2
  9. package/dist/cjs/zonos-address_2.cjs.entry.js +5 -5
  10. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  12. package/dist/cjs/zonos-button_2.cjs.entry.js +3 -3
  13. package/dist/cjs/zonos-card_2.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-cart-items_10.cjs.entry.js +9 -15
  15. package/dist/cjs/zonos-checkout.cjs.entry.js +6 -6
  16. package/dist/cjs/zonos-controller.cjs.entry.js +14 -8
  17. package/dist/cjs/zonos-country-flag_4.cjs.entry.js +3 -3
  18. package/dist/cjs/zonos-elements.cjs.js +1 -1
  19. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  20. package/dist/cjs/zonos-hello.cjs.entry.js +8 -5
  21. package/dist/cjs/zonos-icon.cjs.entry.js +1 -1
  22. package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-payment.cjs.entry.js +5 -5
  24. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  26. package/dist/cjs/{zonosStore-b43ef5db.js → zonosStore-10d1d6ff.js} +0 -8
  27. package/dist/collection/__tests__/build-utils/urlCheckOne.js +4 -1
  28. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -10
  29. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +6 -3
  30. package/dist/collection/components/main/zonos-controller.js +35 -8
  31. package/dist/collection/components/store/zonosStore.js +0 -8
  32. package/dist/collection/components/utils/api/{getZonosSetting.js → getZonosSettings.js} +2 -2
  33. package/dist/collection/components/utils/handleFetch.js +1 -1
  34. package/dist/collection/environment.js +14 -3
  35. package/dist/collection/scripts/{zonos.js → zonosBase.js} +7 -19
  36. package/dist/collection/types/generated/graphql.customer.types.js +31 -0
  37. package/dist/collection/types/generated/graphql.frontend.types.js +9 -0
  38. package/dist/components/localization.js +1 -1
  39. package/dist/components/zonos-checkout-finish2.js +5 -10
  40. package/dist/components/zonos-controller.js +11 -4
  41. package/dist/components/zonos-hello.js +6 -3
  42. package/dist/components/zonosStore.js +0 -8
  43. package/dist/esm/{cart-b439be00.js → cart-d81b92ea.js} +4 -4
  44. package/dist/esm/{getBorderRadius-178a0a05.js → getBorderRadius-77e97943.js} +1 -1
  45. package/dist/esm/index.js +5 -5
  46. package/dist/esm/{isDarkColor-416d6047.js → isDarkColor-69090b29.js} +1 -1
  47. package/dist/esm/loader.js +1 -1
  48. package/dist/esm/{localization-a51ccbc2.js → localization-0c5b29fd.js} +2 -2
  49. package/dist/esm/{submitGtag-521826a2.js → submitGtag-8a0fbd41.js} +2 -2
  50. package/dist/esm/zonos-address_2.entry.js +5 -5
  51. package/dist/esm/zonos-badge.entry.js +1 -1
  52. package/dist/esm/zonos-banner.entry.js +1 -1
  53. package/dist/esm/zonos-button_2.entry.js +3 -3
  54. package/dist/esm/zonos-card_2.entry.js +1 -1
  55. package/dist/esm/zonos-cart-items_10.entry.js +9 -15
  56. package/dist/esm/zonos-checkout.entry.js +6 -6
  57. package/dist/esm/zonos-controller.entry.js +14 -8
  58. package/dist/esm/zonos-country-flag_4.entry.js +3 -3
  59. package/dist/esm/zonos-elements.js +1 -1
  60. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  61. package/dist/esm/zonos-hello.entry.js +8 -5
  62. package/dist/esm/zonos-icon.entry.js +1 -1
  63. package/dist/esm/zonos-notification.entry.js +1 -1
  64. package/dist/esm/zonos-payment.entry.js +5 -5
  65. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  66. package/dist/esm/zonos-text.entry.js +1 -1
  67. package/dist/esm/{zonosStore-61e74f58.js → zonosStore-34f07ee8.js} +0 -8
  68. package/dist/esm-es5/{cart-b439be00.js → cart-d81b92ea.js} +1 -1
  69. package/dist/esm-es5/{getBorderRadius-178a0a05.js → getBorderRadius-77e97943.js} +1 -1
  70. package/dist/esm-es5/index.js +1 -1
  71. package/dist/esm-es5/{isDarkColor-416d6047.js → isDarkColor-69090b29.js} +1 -1
  72. package/dist/esm-es5/loader.js +1 -1
  73. package/dist/esm-es5/{localization-a51ccbc2.js → localization-0c5b29fd.js} +1 -1
  74. package/dist/esm-es5/{submitGtag-521826a2.js → submitGtag-8a0fbd41.js} +1 -1
  75. package/dist/esm-es5/zonos-address_2.entry.js +1 -1
  76. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  77. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  78. package/dist/esm-es5/zonos-button_2.entry.js +1 -1
  79. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  80. package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
  81. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  82. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  83. package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -1
  84. package/dist/esm-es5/zonos-elements.js +1 -1
  85. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  86. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  87. package/dist/esm-es5/zonos-icon.entry.js +1 -1
  88. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  89. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  90. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  91. package/dist/esm-es5/zonos-text.entry.js +1 -1
  92. package/dist/esm-es5/{zonosStore-61e74f58.js → zonosStore-34f07ee8.js} +1 -1
  93. package/dist/scripts/extractZonosQaUrl.js +1 -30
  94. package/dist/scripts/loadStripe.js +1 -118
  95. package/dist/scripts/loadZonos.js +1 -565
  96. package/dist/scripts/stripe.js +1 -126
  97. package/dist/scripts/zonos.js +1 -565
  98. package/dist/scripts/zonosBase.js +1 -0
  99. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +2 -3
  100. package/dist/types/components/main/zonos-controller.d.ts +5 -1
  101. package/dist/types/components/store/zonosStore.d.ts +1 -3
  102. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  103. package/dist/types/components/utils/api/{getZonosSetting.d.ts → getZonosSettings.d.ts} +1 -1
  104. package/dist/types/components.d.ts +6 -2
  105. package/dist/types/scripts/{zonos.d.ts → zonosBase.d.ts} +6 -3
  106. package/dist/types/types/checkout/CheckoutConfig.d.ts +3 -2
  107. package/dist/types/types/generated/graphql.customer.types.d.ts +35 -0
  108. package/dist/types/types/generated/graphql.customer.types.ts +44 -0
  109. package/dist/types/types/generated/graphql.frontend.types.d.ts +34 -1
  110. package/dist/types/types/generated/graphql.frontend.types.ts +69 -1
  111. package/dist/types/types/global.d.ts +10 -2
  112. package/dist/types/types/hello/HelloConfig.d.ts +0 -1
  113. package/dist/zonos-elements/index.esm.js +1 -1
  114. package/dist/zonos-elements/{p-1685c8df.js → p-06a332cd.js} +1 -1
  115. package/dist/zonos-elements/{p-4ed71bd7.entry.js → p-124857ae.entry.js} +1 -1
  116. package/dist/zonos-elements/{p-e98be2d0.system.entry.js → p-1f494581.system.entry.js} +1 -1
  117. package/dist/zonos-elements/p-24fbe845.system.js +1 -1
  118. package/dist/zonos-elements/{p-4846796a.js → p-2b41549a.js} +1 -1
  119. package/dist/zonos-elements/p-2e1e9074.js +1 -0
  120. package/dist/zonos-elements/{p-2801d868.entry.js → p-3509ffaa.entry.js} +1 -1
  121. package/dist/zonos-elements/{p-1d4a970b.entry.js → p-3c8763a7.entry.js} +1 -1
  122. package/dist/zonos-elements/{p-49f09b91.entry.js → p-3e7444c6.entry.js} +1 -1
  123. package/dist/zonos-elements/p-436faf98.system.entry.js +1 -0
  124. package/dist/zonos-elements/{p-55f49f1e.js → p-4b3baf99.js} +1 -1
  125. package/dist/zonos-elements/{p-a504f64f.system.js → p-5066955b.system.js} +1 -1
  126. package/dist/zonos-elements/{p-e5ae22a9.system.entry.js → p-53ea93c2.system.entry.js} +1 -1
  127. package/dist/zonos-elements/{p-f367f2fe.system.entry.js → p-5bada106.system.entry.js} +1 -1
  128. package/dist/zonos-elements/p-5e87609f.entry.js +1 -0
  129. package/dist/zonos-elements/{p-b85be1ab.system.js → p-7730250d.system.js} +1 -1
  130. package/dist/zonos-elements/{p-089ba905.js → p-86f22026.js} +1 -1
  131. package/dist/zonos-elements/{p-a0e36ed3.entry.js → p-88600956.entry.js} +1 -1
  132. package/dist/zonos-elements/{p-89c210d6.entry.js → p-8b1cb8a4.entry.js} +1 -1
  133. package/dist/zonos-elements/p-8bd04aaa.entry.js +1 -0
  134. package/dist/zonos-elements/{p-47390db7.system.entry.js → p-935fa685.system.entry.js} +1 -1
  135. package/dist/zonos-elements/{p-639396bb.entry.js → p-9c1f19b6.entry.js} +1 -1
  136. package/dist/zonos-elements/{p-4d93275c.entry.js → p-a063c4b7.entry.js} +1 -1
  137. package/dist/zonos-elements/p-a174d834.system.js +1 -0
  138. package/dist/zonos-elements/{p-3c6988d7.js → p-a244579e.js} +1 -1
  139. package/dist/zonos-elements/{p-24eed2a8.system.js → p-a54d8db3.system.js} +1 -1
  140. package/dist/zonos-elements/{p-e1f6ab97.entry.js → p-ab00288a.entry.js} +1 -1
  141. package/dist/zonos-elements/{p-b51de536.system.js → p-ab179c88.system.js} +1 -1
  142. package/dist/zonos-elements/{p-afe26069.entry.js → p-ad2b4bda.entry.js} +1 -1
  143. package/dist/zonos-elements/{p-4bee0bff.system.entry.js → p-b3a71ae4.system.entry.js} +1 -1
  144. package/dist/zonos-elements/{p-d856a200.system.entry.js → p-b3e034bb.system.entry.js} +1 -1
  145. package/dist/zonos-elements/p-b7e061e7.entry.js +1 -0
  146. package/dist/zonos-elements/{p-3cea383b.system.entry.js → p-bb7de2c4.system.entry.js} +1 -1
  147. package/dist/zonos-elements/{p-da060b1c.system.js → p-c1665c4f.system.js} +1 -1
  148. package/dist/zonos-elements/{p-2f43da39.system.entry.js → p-c1e298d5.system.entry.js} +1 -1
  149. package/dist/zonos-elements/{p-8c5595d9.system.entry.js → p-c520d819.system.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-c9348bb0.system.entry.js → p-ca875e60.system.entry.js} +1 -1
  151. package/dist/zonos-elements/{p-b4601210.system.entry.js → p-ccd1794a.system.entry.js} +1 -1
  152. package/dist/zonos-elements/{p-f141519c.system.entry.js → p-daa10b8c.system.entry.js} +1 -1
  153. package/dist/zonos-elements/{p-b6148206.entry.js → p-e3bca405.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-a376a37f.entry.js → p-e58cc024.entry.js} +1 -1
  155. package/dist/zonos-elements/{p-938803f4.entry.js → p-e6556b0d.entry.js} +1 -1
  156. package/dist/zonos-elements/{p-d2217f09.system.js → p-ed074fbf.system.js} +1 -1
  157. package/dist/zonos-elements/{p-560aa686.system.entry.js → p-f1e9b431.system.entry.js} +1 -1
  158. package/dist/zonos-elements/p-f7b07128.system.entry.js +1 -0
  159. package/dist/zonos-elements/{p-4a15c5c7.system.entry.js → p-fbc09dae.system.entry.js} +1 -1
  160. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  161. package/package.json +9 -6
  162. package/dist/collection/types/online-store/OnlineStoreConfig.js +0 -1
  163. package/dist/types/types/online-store/OnlineStoreConfig.d.ts +0 -3
  164. package/dist/zonos-elements/p-06fb9d1f.system.entry.js +0 -1
  165. package/dist/zonos-elements/p-19942abb.system.entry.js +0 -1
  166. package/dist/zonos-elements/p-494c77a7.entry.js +0 -1
  167. package/dist/zonos-elements/p-8c48b75e.system.js +0 -1
  168. package/dist/zonos-elements/p-a3a8b5e7.entry.js +0 -1
  169. package/dist/zonos-elements/p-e9b832c5.entry.js +0 -1
  170. package/dist/zonos-elements/p-ff95f098.js +0 -1
@@ -2529,7 +2529,6 @@ const { reset, state: zonosStore } = createStore(() => ({
2529
2529
  zonosAttribution: 'DISABLED',
2530
2530
  },
2531
2531
  checkoutSettings: {
2532
- allowedDomains: [],
2533
2532
  analyticsProviders: [],
2534
2533
  orderNotifications: {
2535
2534
  abandonedCart: {
@@ -2563,7 +2562,6 @@ const { reset, state: zonosStore } = createStore(() => ({
2563
2562
  },
2564
2563
  currentHelloPage: '',
2565
2564
  helloSettings: {
2566
- allowedDomains: [],
2567
2565
  anchorElementSelector: '',
2568
2566
  cartUrlPattern: '',
2569
2567
  currencyBehavior: 'ENABLED',
@@ -2585,9 +2583,6 @@ const { reset, state: zonosStore } = createStore(() => ({
2585
2583
  restrictionBehavior: 'DISABLED',
2586
2584
  },
2587
2585
  loadedConfig: false,
2588
- onlineStoreSettings: {
2589
- allowedDomains: [],
2590
- },
2591
2586
  organizationName: '',
2592
2587
  sourceCurrency: 'USD',
2593
2588
  storeId: null,
@@ -2613,9 +2608,6 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
2613
2608
  (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.checkoutSettings) ||
2614
2609
  null, overrideSettings.checkoutSettings);
2615
2610
  zonosStore.helloSettings = mergeConfig(zonosStore.helloSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.helloSettings) || (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.helloSettings) || null, overrideSettings.helloSettings);
2616
- zonosStore.onlineStoreSettings = mergeConfig(zonosStore.onlineStoreSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.onlineStoreSettings) ||
2617
- (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.onlineStoreSettings) ||
2618
- null, overrideSettings.onlineStoreSettings);
2619
2611
  // set flag to true to indicate that config is ready
2620
2612
  zonosStore.loadedConfig = true;
2621
2613
  zonosStore.organizationName = ((_a = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _a === void 0 ? void 0 : _a.name) || '';
@@ -15,9 +15,12 @@ export const urlCheckOne = async ({ branch, filePath, packageVersion, }) => {
15
15
  // no need to check for debug.js.zonos.com since it will not be versioned and be used only for live QA
16
16
  'debug.js.zonos.com',
17
17
  ];
18
+ // these files are load file, no need to check version url here
19
+ const excludeFiles = ['zonosBase', 'zonos', 'loadZonos'];
18
20
  result.forEach(([fullUrl]) => {
19
21
  if (fullUrl.includes('.js.zonos.com') &&
20
- !excludeDomainPattern.includes(fullUrl)) {
22
+ !excludeDomainPattern.includes(fullUrl) &&
23
+ !excludeFiles.some(file => filePath.includes(file))) {
21
24
  // match: v1.2.3-alpha.0.qa.js.zonos.com | v1.2.3.qa.js.zonos.com | v1.qa.js.zonos.com
22
25
  const versioned = /(v(?<major>\d+)(?<patch>\.\d+(\-alpha\.\d+)*)*)\.*(.*?js\.zonos\.com)/g.exec(fullUrl);
23
26
  if (!versioned) {
@@ -1,9 +1,9 @@
1
1
  import { Fragment, h, Host, } from "@stencil/core";
2
2
  import { stripeStore, stripeStoreReset, stripeStoreRetrievePayment, } from "../../../store/checkout/stripe";
3
3
  import { translate } from "../../../store/translationStore";
4
+ import { zonosStore } from "../../../store/zonosStore";
4
5
  import { getBorderRadius } from "../../../utils/getBorderRadius";
5
6
  import { handleFetch } from "../../../utils/handleFetch";
6
- import { logError } from "../../../utils/logging/logError";
7
7
  import { submitGtag } from "../../../utils/submitGtag";
8
8
  import { cartStore } from "../../../../types/index";
9
9
  // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
@@ -21,17 +21,11 @@ export class ZonosCheckoutFinish {
21
21
  if (errors.length || !(json === null || json === void 0 ? void 0 : json.id)) {
22
22
  return null;
23
23
  }
24
- // TODO: This method of triggering /success for BigCommerce is for MVP. Remove when eventRegistry is fixed to handle by webhooks
25
- if (window.Zonos.isBigCommerce) {
26
- const orderId = json === null || json === void 0 ? void 0 : json.id;
27
- 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;
28
- if (!orderId || !storeHash) {
29
- return logError('Unable to trigger BigCommerce /success: Missing orderId or storeHash');
30
- }
31
- void handleFetch(`${baseUrl}/api/bigcommerce/success?orderId=${orderId}&storeHash=${storeHash}`);
32
- }
24
+ // onOrderSuccess callback may be provided on Zonos.init
25
+ await ((_b = (_a = zonosStore.checkoutSettings).onOrderSuccess) === null || _b === void 0 ? void 0 : _b.call(_a, json));
33
26
  return json;
34
27
  };
28
+ // TODO: This method of pulling orders is temporary. Once we have a working event registry system, we will rely on that to tell us when the order is ready to trigger onOrderSuccess
35
29
  this.getPullOrder = async (attempts = 0) => {
36
30
  const order = await this.pullOrder();
37
31
  if (order) {
@@ -20,7 +20,7 @@ const PEEK_MESSAGE_CLOSE_DELAY_MS = 3000;
20
20
  const RESIZE_DEBOUNCE_DELAY_MS = 500;
21
21
  export class ZonosHello {
22
22
  constructor() {
23
- this.getHelloPeekMessage = () => {
23
+ this.getHelloPeekMessage = (organizationName) => {
24
24
  const isRestrictionPage = zonosStore.currentHelloPage === 'productDetail' ||
25
25
  zonosStore.currentHelloPage === 'productList';
26
26
  if (isRestrictionPage && this.allRestrictedItems.length) {
@@ -37,7 +37,7 @@ export class ZonosHello {
37
37
  case 'productDetail':
38
38
  return translate(`See duty and tax thresholds`);
39
39
  default:
40
- return `${translate('Welcome to')} ${zonosStore.organizationName}`;
40
+ return `${translate('Welcome to')} ${organizationName}`;
41
41
  }
42
42
  };
43
43
  this.enableShowPeekMessage = () => {
@@ -57,7 +57,7 @@ export class ZonosHello {
57
57
  return newRestrictions;
58
58
  };
59
59
  this.triggerShowPeekMessage = () => {
60
- this.peekMessage = this.getHelloPeekMessage();
60
+ this.peekMessage = this.getHelloPeekMessage(zonosStore.organizationName);
61
61
  const { peekMessageBehavior, peekMessageDelay } = zonosStore.helloSettings;
62
62
  // peek message delay is passed in seconds, but setTimeout expects milliseconds
63
63
  const peekMessageDelayToUse = peekMessageDelay * 1000;
@@ -253,6 +253,9 @@ export class ZonosHello {
253
253
  const appearanceSettings = mergeConfig(zonosStore.appearance, this.appearanceSettingsOverride);
254
254
  const { theme } = appearanceSettings;
255
255
  const restrictedItemsOnPage = (_b = this.allRestrictedItems) === null || _b === void 0 ? void 0 : _b.filter(product => this.productsOnPage.some(restriction => restriction.description === product.itemDescription));
256
+ // The organization name can be changed after init with the updateOrganizationName method.
257
+ // This will cause the element to rerender with the new org name when it changes. (used for preview on dashboard)
258
+ this.peekMessage = this.getHelloPeekMessage(zonosStore.organizationName);
256
259
  const showHello = this.isShippableCountry() && !!selectedCountryCode;
257
260
  return (h(Host, { class: "zonos--hello zonos--elements", "data-theme": theme }, showHello && (h("div", { class: "zonos--hello-wrapper" }, h("button", { class: classes([
258
261
  'zonos--hello-widget',
@@ -2,7 +2,7 @@ import { h, Host, } from "@stencil/core";
2
2
  import { stripeStore } from "../store/checkout/stripe";
3
3
  import { initLocalizationStore, localizationStoreUpdateSelectedCountryCode, } from "../store/hello/localization";
4
4
  import { zonosStore, zonosStoreFontFamily, zonosStoreInitSetting, } from "../store/zonosStore";
5
- import { getZonosSetting } from "../utils/api/getZonosSetting";
5
+ import { getZonosSettings } from "../utils/api/getZonosSettings";
6
6
  import { initCheckout } from "../utils/checkout/initCheckout";
7
7
  import { handleFetch } from "../utils/handleFetch";
8
8
  import { initHello } from "../utils/hello/initHello";
@@ -113,7 +113,7 @@ export class ZonosController {
113
113
  // running with scope async function to avoid blocking the main thread
114
114
  (async () => {
115
115
  var _a, _b;
116
- const { errors, json } = await getZonosSetting();
116
+ const { errors, json } = await getZonosSettings();
117
117
  if (((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.type.toString()) === '403') {
118
118
  log('Failed to load zonos settings. This domain may not have access', 'warn');
119
119
  return;
@@ -192,6 +192,12 @@ export class ZonosController {
192
192
  async getAppearanceSetting() {
193
193
  return zonosStore.appearance;
194
194
  }
195
+ /**
196
+ * Update the organizationName
197
+ */
198
+ async updateOrganizationName(organizationName) {
199
+ zonosStore.organizationName = organizationName;
200
+ }
195
201
  render() {
196
202
  return h(Host, { class: "zonos--elements" });
197
203
  }
@@ -214,12 +220,12 @@ export class ZonosController {
214
220
  "mutable": false,
215
221
  "complexType": {
216
222
  "original": "LoadZonosParamsConfig",
217
- "resolved": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined; onlineStoreSettings?: Partial<OnlineStoreConfig> | undefined; }",
223
+ "resolved": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined; }",
218
224
  "references": {
219
225
  "LoadZonosParamsConfig": {
220
226
  "location": "import",
221
- "path": "src/scripts/zonos",
222
- "id": "src/scripts/zonos.ts::LoadZonosParamsConfig"
227
+ "path": "src/scripts/zonosBase",
228
+ "id": "src/scripts/zonosBase.ts::LoadZonosParamsConfig"
223
229
  }
224
230
  }
225
231
  },
@@ -347,7 +353,7 @@ export class ZonosController {
347
353
  "signature": "(config: LoadZonosParamsConfig) => Promise<void>",
348
354
  "parameters": [{
349
355
  "name": "config",
350
- "type": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined; onlineStoreSettings?: Partial<OnlineStoreConfig> | undefined; }",
356
+ "type": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined; }",
351
357
  "docs": "config that need to override the default setting"
352
358
  }],
353
359
  "references": {
@@ -357,8 +363,8 @@ export class ZonosController {
357
363
  },
358
364
  "LoadZonosParamsConfig": {
359
365
  "location": "import",
360
- "path": "src/scripts/zonos",
361
- "id": "src/scripts/zonos.ts::LoadZonosParamsConfig"
366
+ "path": "src/scripts/zonosBase",
367
+ "id": "src/scripts/zonosBase.ts::LoadZonosParamsConfig"
362
368
  }
363
369
  },
364
370
  "return": "Promise<void>"
@@ -418,6 +424,27 @@ export class ZonosController {
418
424
  "text": "Get appearance from setting",
419
425
  "tags": []
420
426
  }
427
+ },
428
+ "updateOrganizationName": {
429
+ "complexType": {
430
+ "signature": "(organizationName: string) => Promise<void>",
431
+ "parameters": [{
432
+ "name": "organizationName",
433
+ "type": "string",
434
+ "docs": ""
435
+ }],
436
+ "references": {
437
+ "Promise": {
438
+ "location": "global",
439
+ "id": "global::Promise"
440
+ }
441
+ },
442
+ "return": "Promise<void>"
443
+ },
444
+ "docs": {
445
+ "text": "Update the organizationName",
446
+ "tags": []
447
+ }
421
448
  }
422
449
  };
423
450
  }
@@ -10,7 +10,6 @@ const { reset, state: zonosStore } = createStore(() => ({
10
10
  zonosAttribution: 'DISABLED',
11
11
  },
12
12
  checkoutSettings: {
13
- allowedDomains: [],
14
13
  analyticsProviders: [],
15
14
  orderNotifications: {
16
15
  abandonedCart: {
@@ -44,7 +43,6 @@ const { reset, state: zonosStore } = createStore(() => ({
44
43
  },
45
44
  currentHelloPage: '',
46
45
  helloSettings: {
47
- allowedDomains: [],
48
46
  anchorElementSelector: '',
49
47
  cartUrlPattern: '',
50
48
  currencyBehavior: 'ENABLED',
@@ -66,9 +64,6 @@ const { reset, state: zonosStore } = createStore(() => ({
66
64
  restrictionBehavior: 'DISABLED',
67
65
  },
68
66
  loadedConfig: false,
69
- onlineStoreSettings: {
70
- allowedDomains: [],
71
- },
72
67
  organizationName: '',
73
68
  sourceCurrency: 'USD',
74
69
  storeId: null,
@@ -94,9 +89,6 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
94
89
  (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.checkoutSettings) ||
95
90
  null, overrideSettings.checkoutSettings);
96
91
  zonosStore.helloSettings = mergeConfig(zonosStore.helloSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.helloSettings) || (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.helloSettings) || null, overrideSettings.helloSettings);
97
- zonosStore.onlineStoreSettings = mergeConfig(zonosStore.onlineStoreSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.onlineStoreSettings) ||
98
- (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.onlineStoreSettings) ||
99
- null, overrideSettings.onlineStoreSettings);
100
92
  // set flag to true to indicate that config is ready
101
93
  zonosStore.loadedConfig = true;
102
94
  zonosStore.organizationName = ((_a = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _a === void 0 ? void 0 : _a.name) || '';
@@ -1,10 +1,10 @@
1
1
  import { handleFetch } from "../handleFetch";
2
2
  import { logError } from "../logging/logError";
3
- export const getZonosSetting = async () => {
3
+ export const getZonosSettings = async () => {
4
4
  const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/zonos-settings`;
5
5
  const { errors, json } = await handleFetch(url);
6
6
  if (errors.length) {
7
- logError(`Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting`);
7
+ logError(`Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings`);
8
8
  return { errors, json: null };
9
9
  }
10
10
  return { errors: [], json };
@@ -107,7 +107,7 @@ export const handleFetch = async (url, _opts) => {
107
107
  const opts = __rest(_opts || {}, []);
108
108
  const body = opts.body ? JSON.stringify(opts.body) : undefined;
109
109
  const method = opts.method || 'GET';
110
- // adding credentialtoken to the url so that the request will be cached differently for each store
110
+ // adding random encoded token to the url so that the request will be cached differently for each store
111
111
  const modifiedUrl = new URL(url);
112
112
  modifiedUrl.searchParams.set('zToken', encodeString(window.location.hostname));
113
113
  // headers content type
@@ -80,10 +80,21 @@ export const formattedUrl = ({ branchName, inCI: _inCI, inVercel: _inVercel, isV
80
80
  }
81
81
  const version = type === 'major' ? `${_packageVersion === null || _packageVersion === void 0 ? void 0 : _packageVersion.split('.')[0]}` : _packageVersion;
82
82
  const isVersionedUrl = domainOnlyUrl === null || domainOnlyUrl === void 0 ? void 0 : domainOnlyUrl.startsWith('v');
83
+ const shouldAddVersion = (isProdBranch || _inCI) && !isVersionedUrl;
84
+ /**
85
+ * Trimming the `qa` from the domain url only when we add version prefix
86
+ * @reason We've now introduced alpha versioning for the QA branch deployment.
87
+ * However, we've generated the domain as `v1.2.4-alpha.1.js.zonos.com`, while the
88
+ * current CDN URL env uses `qa.js.zonos.com` on qa branch. This discrepancy causes
89
+ * this function to return an invalid alpha domain (v1.2.4-alpha.1.qa.js.zonos.com).
90
+ */
91
+ const trimmedQaUrl = shouldAddVersion
92
+ ? domainOnlyUrl === null || domainOnlyUrl === void 0 ? void 0 : domainOnlyUrl.replace('qa.js.zonos.com', 'js.zonos.com')
93
+ : domainOnlyUrl;
83
94
  // only set version for the url once
84
- return (isProdBranch || _inCI) && !isVersionedUrl
85
- ? `https://v${version}.${domainOnlyUrl}`
86
- : `https://${domainOnlyUrl}`;
95
+ return shouldAddVersion
96
+ ? `https://v${version}.${trimmedQaUrl}`
97
+ : `https://${trimmedQaUrl}`;
87
98
  };
88
99
  if (typeof window === 'undefined') {
89
100
  // storybook can't access to any "node" modules
@@ -51,7 +51,7 @@ Zonos.version = `v${process.env.NEXT_PUBLIC_ZONOS_PACKAGE_VERSION}`;
51
51
  Zonos.modeAlerted = false;
52
52
  Zonos.getCurrentTimestamp = () => new Date().getTime();
53
53
  Zonos.zonosController = null;
54
- Zonos.init = async ({ appearance, checkoutSettings, currencyConverter, helloSettings, zonosApiKey, }) => {
54
+ Zonos.init = async ({ appearance, checkoutSettings, currencyConverter, helloSettings, storeId, zonosApiKey, }) => {
55
55
  if (_a.doneInit) {
56
56
  // do nothing if zonos is already initializeds
57
57
  return;
@@ -62,6 +62,7 @@ Zonos.init = async ({ appearance, checkoutSettings, currencyConverter, helloSett
62
62
  return;
63
63
  }
64
64
  _a.zonosApiKey = zonosApiKey;
65
+ _a.storeId = storeId;
65
66
  log('init zonos');
66
67
  // add sentry to the project
67
68
  _a.injectSentryScript();
@@ -93,6 +94,10 @@ Zonos.showNotification = (notification) => {
93
94
  var _b;
94
95
  void ((_b = _a.zonosController) === null || _b === void 0 ? void 0 : _b.showNotification(notification));
95
96
  };
97
+ Zonos.updateOrganizationName = (organizationName) => {
98
+ var _b;
99
+ void ((_b = _a.zonosController) === null || _b === void 0 ? void 0 : _b.updateOrganizationName(organizationName));
100
+ };
96
101
  Zonos.disablePlaceOrderButtons = ({ autoEnable = true, disable, placeOrderButtonSelector, }) => {
97
102
  // if placeOrderAnchor is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
98
103
  if (placeOrderButtonSelector) {
@@ -188,24 +193,7 @@ Zonos.injectSentryScript = () => {
188
193
  script.onload = () => {
189
194
  var _b;
190
195
  (_b = window.Sentry) === null || _b === void 0 ? void 0 : _b.init({
191
- denyUrls: [
192
- // Facebook flakiness
193
- /graph\.facebook\.com/i,
194
- // Facebook blocked
195
- /connect\.facebook\.net\/en_US\/all\.js/i,
196
- // Woopra flakiness
197
- /eatdifferent\.com\.woopra-ns\.com/i,
198
- /static\.woopra\.com\/js\/woopra\.js/i,
199
- // Chrome extensions
200
- /extensions\//i,
201
- /^chrome:\/\//i,
202
- /^chrome-extension:\/\//i,
203
- // Other plugins
204
- /webappstoolbarba\.texthelp\.com\//i,
205
- /metrics\.itunes\.apple\.com\.edgesuite\.net\//i,
206
- /dev.elements.zonos.com/i,
207
- /js.zonos.com/,
208
- ],
196
+ allowUrls: [/js.zonos.com/],
209
197
  dsn: 'https://19168bd05af0e2e0e7520ad58953e4f2@o446983.ingest.sentry.io/4506400622837760',
210
198
  release: `zonos-elements@${_a.version}`,
211
199
  });
@@ -51,10 +51,18 @@ export const carrierAccountApiUsage = {
51
51
  Label: 'LABEL',
52
52
  Rating: 'RATING',
53
53
  };
54
+ export const carrierAccountIntegrationType = {
55
+ Rest: 'REST',
56
+ Soap: 'SOAP',
57
+ };
54
58
  export const carrierAccountRateType = {
55
59
  Negotiated: 'NEGOTIATED',
56
60
  Retail: 'RETAIL',
57
61
  };
62
+ export const carrierAccountRegistrationType = {
63
+ Other: 'OTHER',
64
+ Zonos: 'ZONOS',
65
+ };
58
66
  export const carrierAccountUsageCategoryCode = {
59
67
  Shipping: 'SHIPPING',
60
68
  };
@@ -1024,6 +1032,12 @@ export const exchangeRateType = {
1024
1032
  Guaranteed: 'GUARANTEED',
1025
1033
  MidMarket: 'MID_MARKET',
1026
1034
  };
1035
+ export const exportJobStatus = {
1036
+ Completed: 'COMPLETED',
1037
+ Error: 'ERROR',
1038
+ Initialized: 'INITIALIZED',
1039
+ Processing: 'PROCESSING',
1040
+ };
1027
1041
  export const externalServiceTokenType = {
1028
1042
  StripePublishableToken: 'STRIPE_PUBLISHABLE_TOKEN',
1029
1043
  };
@@ -1244,6 +1258,12 @@ export const landedCostAdjustmentType = {
1244
1258
  Item: 'ITEM',
1245
1259
  Shipping: 'SHIPPING',
1246
1260
  };
1261
+ export const landedCostBillingPartyType = {
1262
+ Customer: 'CUSTOMER',
1263
+ Merchant: 'MERCHANT',
1264
+ ThirdParty: 'THIRD_PARTY',
1265
+ Zonos: 'ZONOS',
1266
+ };
1247
1267
  export const landedCostCalculationMethod = {
1248
1268
  Dap: 'DAP',
1249
1269
  Ddp: 'DDP',
@@ -1271,6 +1291,7 @@ export const landedCostFeeType = {
1271
1291
  Item: 'ITEM',
1272
1292
  Other: 'OTHER',
1273
1293
  Shipping: 'SHIPPING',
1294
+ Tax: 'TAX',
1274
1295
  ZonosLandedCostGuarantee: 'ZONOS_LANDED_COST_GUARANTEE',
1275
1296
  };
1276
1297
  export const landedCostGuaranteeCode = {
@@ -1758,9 +1779,19 @@ export const wcoVersion = {
1758
1779
  Wco_1997: 'WCO_1997',
1759
1780
  Wco_2002: 'WCO_2002',
1760
1781
  Wco_2007: 'WCO_2007',
1782
+ Wco_2012: 'WCO_2012',
1761
1783
  Wco_2017: 'WCO_2017',
1762
1784
  Wco_2022: 'WCO_2022',
1763
1785
  Wco_2027: 'WCO_2027',
1786
+ Wco_2032: 'WCO_2032',
1787
+ Wco_2037: 'WCO_2037',
1788
+ Wco_2042: 'WCO_2042',
1789
+ Wco_2047: 'WCO_2047',
1790
+ Wco_2052: 'WCO_2052',
1791
+ Wco_2057: 'WCO_2057',
1792
+ Wco_2062: 'WCO_2062',
1793
+ Wco_2067: 'WCO_2067',
1794
+ Wco_2072: 'WCO_2072',
1764
1795
  };
1765
1796
  export const weightUnitCode = {
1766
1797
  Gram: 'GRAM',
@@ -459,11 +459,20 @@ export function getSdk(client, withWrapper = defaultWrapper) {
459
459
  LocaleCountryMessages(variables, requestHeaders) {
460
460
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'LocaleCountryMessages', 'query');
461
461
  },
462
+ UpdateCacheStoreVersion(variables, requestHeaders) {
463
+ return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'UpdateCacheStoreVersion', 'mutation');
464
+ },
462
465
  UpdateReserveOrder(variables, requestHeaders) {
463
466
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'UpdateReserveOrder', 'mutation');
464
467
  },
465
468
  UpsertBigCommerceSettings(variables, requestHeaders) {
466
469
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'UpsertBigCommerceSettings', 'mutation');
467
470
  },
471
+ cleanupTestZonosElementSetting(variables, requestHeaders) {
472
+ return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'cleanupTestZonosElementSetting', 'mutation');
473
+ },
474
+ zonosElementsSetting(variables, requestHeaders) {
475
+ return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'zonosElementsSetting', 'query');
476
+ },
468
477
  };
469
478
  }
@@ -3180,7 +3180,7 @@ const handleFetch = async (url, _opts) => {
3180
3180
  const opts = __rest(_opts || {}, []);
3181
3181
  const body = opts.body ? JSON.stringify(opts.body) : undefined;
3182
3182
  const method = opts.method || 'GET';
3183
- // adding credentialtoken to the url so that the request will be cached differently for each store
3183
+ // adding random encoded token to the url so that the request will be cached differently for each store
3184
3184
  const modifiedUrl = new URL(url);
3185
3185
  modifiedUrl.searchParams.set('zToken', encodeString(window.location.hostname));
3186
3186
  // headers content type
@@ -1,6 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host, Fragment } from '@stencil/core/internal/client';
2
2
  import { s as stripeStore, p as stripeStoreRetrievePayment, o as stripeStoreReset, c as cartStore } from './cart.js';
3
- import { h as handleFetch, l as logError, t as translate } from './localization.js';
3
+ import { h as handleFetch, t as translate } from './localization.js';
4
+ import { z as zonosStore } from './zonosStore.js';
4
5
  import { g as getBorderRadius } from './getBorderRadius.js';
5
6
  import { s as submitGtag } from './submitGtag.js';
6
7
  import { d as defineCustomElement$4 } from './zonos-button2.js';
@@ -28,17 +29,11 @@ const ZonosCheckoutFinish = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout
28
29
  if (errors.length || !(json === null || json === void 0 ? void 0 : json.id)) {
29
30
  return null;
30
31
  }
31
- // TODO: This method of triggering /success for BigCommerce is for MVP. Remove when eventRegistry is fixed to handle by webhooks
32
- if (window.Zonos.isBigCommerce) {
33
- const orderId = json === null || json === void 0 ? void 0 : json.id;
34
- 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;
35
- if (!orderId || !storeHash) {
36
- return logError('Unable to trigger BigCommerce /success: Missing orderId or storeHash');
37
- }
38
- void handleFetch(`${baseUrl}/api/bigcommerce/success?orderId=${orderId}&storeHash=${storeHash}`);
39
- }
32
+ // onOrderSuccess callback may be provided on Zonos.init
33
+ await ((_b = (_a = zonosStore.checkoutSettings).onOrderSuccess) === null || _b === void 0 ? void 0 : _b.call(_a, json));
40
34
  return json;
41
35
  };
36
+ // TODO: This method of pulling orders is temporary. Once we have a working event registry system, we will rely on that to tell us when the order is ready to trigger onOrderSuccess
42
37
  this.getPullOrder = async (attempts = 0) => {
43
38
  const order = await this.pullOrder();
44
39
  if (order) {
@@ -5,11 +5,11 @@ import { z as zonosStore, e as zonosStoreInitSetting, d as zonosStoreFontFamily
5
5
  import { d as defineCustomElement$3 } from './zonos-notification2.js';
6
6
  import { d as defineCustomElement$2 } from './zonos-text2.js';
7
7
 
8
- const getZonosSetting = async () => {
8
+ const getZonosSettings = async () => {
9
9
  const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-settings`;
10
10
  const { errors, json } = await handleFetch(url);
11
11
  if (errors.length) {
12
- logError(`Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting`);
12
+ logError(`Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings`);
13
13
  return { errors, json: null };
14
14
  }
15
15
  return { errors: [], json };
@@ -168,7 +168,7 @@ const ZonosController$1 = /*@__PURE__*/ proxyCustomElement(class ZonosController
168
168
  // running with scope async function to avoid blocking the main thread
169
169
  (async () => {
170
170
  var _a, _b;
171
- const { errors, json } = await getZonosSetting();
171
+ const { errors, json } = await getZonosSettings();
172
172
  if (((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.type.toString()) === '403') {
173
173
  log('Failed to load zonos settings. This domain may not have access', 'warn');
174
174
  return;
@@ -247,6 +247,12 @@ const ZonosController$1 = /*@__PURE__*/ proxyCustomElement(class ZonosController
247
247
  async getAppearanceSetting() {
248
248
  return zonosStore.appearance;
249
249
  }
250
+ /**
251
+ * Update the organizationName
252
+ */
253
+ async updateOrganizationName(organizationName) {
254
+ zonosStore.organizationName = organizationName;
255
+ }
250
256
  render() {
251
257
  return h(Host, { class: "zonos--elements" });
252
258
  }
@@ -259,7 +265,8 @@ const ZonosController$1 = /*@__PURE__*/ proxyCustomElement(class ZonosController
259
265
  "showNotification": [64],
260
266
  "overrideConfig": [64],
261
267
  "overrideCountry": [64],
262
- "getAppearanceSetting": [64]
268
+ "getAppearanceSetting": [64],
269
+ "updateOrganizationName": [64]
263
270
  }]);
264
271
  function defineCustomElement$1() {
265
272
  if (typeof customElements === "undefined") {
@@ -468,7 +468,7 @@ const ZonosHello$1 = /*@__PURE__*/ proxyCustomElement(class ZonosHello extends H
468
468
  super();
469
469
  this.__registerHost();
470
470
  this.__attachShadow();
471
- this.getHelloPeekMessage = () => {
471
+ this.getHelloPeekMessage = (organizationName) => {
472
472
  const isRestrictionPage = zonosStore.currentHelloPage === 'productDetail' ||
473
473
  zonosStore.currentHelloPage === 'productList';
474
474
  if (isRestrictionPage && this.allRestrictedItems.length) {
@@ -485,7 +485,7 @@ const ZonosHello$1 = /*@__PURE__*/ proxyCustomElement(class ZonosHello extends H
485
485
  case 'productDetail':
486
486
  return translate(`See duty and tax thresholds`);
487
487
  default:
488
- return `${translate('Welcome to')} ${zonosStore.organizationName}`;
488
+ return `${translate('Welcome to')} ${organizationName}`;
489
489
  }
490
490
  };
491
491
  this.enableShowPeekMessage = () => {
@@ -505,7 +505,7 @@ const ZonosHello$1 = /*@__PURE__*/ proxyCustomElement(class ZonosHello extends H
505
505
  return newRestrictions;
506
506
  };
507
507
  this.triggerShowPeekMessage = () => {
508
- this.peekMessage = this.getHelloPeekMessage();
508
+ this.peekMessage = this.getHelloPeekMessage(zonosStore.organizationName);
509
509
  const { peekMessageBehavior, peekMessageDelay } = zonosStore.helloSettings;
510
510
  // peek message delay is passed in seconds, but setTimeout expects milliseconds
511
511
  const peekMessageDelayToUse = peekMessageDelay * 1000;
@@ -701,6 +701,9 @@ const ZonosHello$1 = /*@__PURE__*/ proxyCustomElement(class ZonosHello extends H
701
701
  const appearanceSettings = mergeConfig(zonosStore.appearance, this.appearanceSettingsOverride);
702
702
  const { theme } = appearanceSettings;
703
703
  const restrictedItemsOnPage = (_b = this.allRestrictedItems) === null || _b === void 0 ? void 0 : _b.filter(product => this.productsOnPage.some(restriction => restriction.description === product.itemDescription));
704
+ // The organization name can be changed after init with the updateOrganizationName method.
705
+ // This will cause the element to rerender with the new org name when it changes. (used for preview on dashboard)
706
+ this.peekMessage = this.getHelloPeekMessage(zonosStore.organizationName);
704
707
  const showHello = this.isShippableCountry() && !!selectedCountryCode;
705
708
  return (h(Host, { class: "zonos--hello zonos--elements", "data-theme": theme }, showHello && (h("div", { class: "zonos--hello-wrapper" }, h("button", { class: classes([
706
709
  'zonos--hello-widget',
@@ -2527,7 +2527,6 @@ const { reset, state: zonosStore } = createStore(() => ({
2527
2527
  zonosAttribution: 'DISABLED',
2528
2528
  },
2529
2529
  checkoutSettings: {
2530
- allowedDomains: [],
2531
2530
  analyticsProviders: [],
2532
2531
  orderNotifications: {
2533
2532
  abandonedCart: {
@@ -2561,7 +2560,6 @@ const { reset, state: zonosStore } = createStore(() => ({
2561
2560
  },
2562
2561
  currentHelloPage: '',
2563
2562
  helloSettings: {
2564
- allowedDomains: [],
2565
2563
  anchorElementSelector: '',
2566
2564
  cartUrlPattern: '',
2567
2565
  currencyBehavior: 'ENABLED',
@@ -2583,9 +2581,6 @@ const { reset, state: zonosStore } = createStore(() => ({
2583
2581
  restrictionBehavior: 'DISABLED',
2584
2582
  },
2585
2583
  loadedConfig: false,
2586
- onlineStoreSettings: {
2587
- allowedDomains: [],
2588
- },
2589
2584
  organizationName: '',
2590
2585
  sourceCurrency: 'USD',
2591
2586
  storeId: null,
@@ -2611,9 +2606,6 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
2611
2606
  (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.checkoutSettings) ||
2612
2607
  null, overrideSettings.checkoutSettings);
2613
2608
  zonosStore.helloSettings = mergeConfig(zonosStore.helloSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.helloSettings) || (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.helloSettings) || null, overrideSettings.helloSettings);
2614
- zonosStore.onlineStoreSettings = mergeConfig(zonosStore.onlineStoreSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.onlineStoreSettings) ||
2615
- (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.onlineStoreSettings) ||
2616
- null, overrideSettings.onlineStoreSettings);
2617
2609
  // set flag to true to indicate that config is ready
2618
2610
  zonosStore.loadedConfig = true;
2619
2611
  zonosStore.organizationName = ((_a = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _a === void 0 ? void 0 : _a.name) || '';
@@ -1,7 +1,7 @@
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';
1
+ import { z as zonosStore, c as createStore } from './zonosStore-34f07ee8.js';
2
+ import { h as handleFetch, l as log, a as localizationStore, b as logError, t as translate } from './localization-0c5b29fd.js';
3
+ import { i as isDarkColor } from './isDarkColor-69090b29.js';
4
+ import { g as getBorderRadius } from './getBorderRadius-77e97943.js';
5
5
 
6
6
  const prepCalculateLandedCost = () => {
7
7
  // maybe we don't need email now for prefetch the landed cost
@@ -1,4 +1,4 @@
1
- import { z as zonosStore } from './zonosStore-61e74f58.js';
1
+ import { z as zonosStore } from './zonosStore-34f07ee8.js';
2
2
 
3
3
  /**
4
4
  * Get the border radius for the elements based on the style