@zonos/elements 1.2.4-alpha.8 → 1.3.3-alpha.0

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 (175) 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 +45 -16
  15. package/dist/cjs/zonos-checkout.cjs.entry.js +14 -9
  16. package/dist/cjs/zonos-controller.cjs.entry.js +14 -54
  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 +43 -10
  29. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +8 -3
  30. package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +4 -4
  31. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +6 -3
  32. package/dist/collection/components/main/zonos-controller.js +35 -54
  33. package/dist/collection/components/store/zonosStore.js +0 -8
  34. package/dist/collection/components/utils/api/{getZonosSetting.js → getZonosSettings.js} +2 -2
  35. package/dist/collection/components/utils/handleFetch.js +1 -1
  36. package/dist/collection/environment.js +14 -3
  37. package/dist/collection/scripts/{zonos.js → zonosBase.js} +23 -19
  38. package/dist/collection/types/generated/graphql.customer.types.js +65 -0
  39. package/dist/collection/types/generated/graphql.frontend.types.js +9 -0
  40. package/dist/components/localization.js +1 -1
  41. package/dist/components/zonos-checkout-finish2.js +40 -10
  42. package/dist/components/zonos-checkout.js +8 -3
  43. package/dist/components/zonos-controller.js +11 -50
  44. package/dist/components/zonos-dialog2.js +1 -1
  45. package/dist/components/zonos-hello.js +6 -3
  46. package/dist/components/zonosStore.js +0 -8
  47. package/dist/esm/{cart-b439be00.js → cart-d81b92ea.js} +4 -4
  48. package/dist/esm/{getBorderRadius-178a0a05.js → getBorderRadius-77e97943.js} +1 -1
  49. package/dist/esm/index.js +5 -5
  50. package/dist/esm/{isDarkColor-416d6047.js → isDarkColor-69090b29.js} +1 -1
  51. package/dist/esm/loader.js +1 -1
  52. package/dist/esm/{localization-a51ccbc2.js → localization-0c5b29fd.js} +2 -2
  53. package/dist/esm/{submitGtag-521826a2.js → submitGtag-8a0fbd41.js} +2 -2
  54. package/dist/esm/zonos-address_2.entry.js +5 -5
  55. package/dist/esm/zonos-badge.entry.js +1 -1
  56. package/dist/esm/zonos-banner.entry.js +1 -1
  57. package/dist/esm/zonos-button_2.entry.js +3 -3
  58. package/dist/esm/zonos-card_2.entry.js +1 -1
  59. package/dist/esm/zonos-cart-items_10.entry.js +45 -16
  60. package/dist/esm/zonos-checkout.entry.js +14 -9
  61. package/dist/esm/zonos-controller.entry.js +14 -54
  62. package/dist/esm/zonos-country-flag_4.entry.js +3 -3
  63. package/dist/esm/zonos-elements.js +1 -1
  64. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  65. package/dist/esm/zonos-hello.entry.js +8 -5
  66. package/dist/esm/zonos-icon.entry.js +1 -1
  67. package/dist/esm/zonos-notification.entry.js +1 -1
  68. package/dist/esm/zonos-payment.entry.js +5 -5
  69. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  70. package/dist/esm/zonos-text.entry.js +1 -1
  71. package/dist/esm/{zonosStore-61e74f58.js → zonosStore-34f07ee8.js} +0 -8
  72. package/dist/esm-es5/{cart-b439be00.js → cart-d81b92ea.js} +1 -1
  73. package/dist/esm-es5/{getBorderRadius-178a0a05.js → getBorderRadius-77e97943.js} +1 -1
  74. package/dist/esm-es5/index.js +1 -1
  75. package/dist/esm-es5/{isDarkColor-416d6047.js → isDarkColor-69090b29.js} +1 -1
  76. package/dist/esm-es5/loader.js +1 -1
  77. package/dist/esm-es5/{localization-a51ccbc2.js → localization-0c5b29fd.js} +1 -1
  78. package/dist/esm-es5/{submitGtag-521826a2.js → submitGtag-8a0fbd41.js} +1 -1
  79. package/dist/esm-es5/zonos-address_2.entry.js +1 -1
  80. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  81. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  82. package/dist/esm-es5/zonos-button_2.entry.js +1 -1
  83. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  84. package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
  85. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  86. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  87. package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -1
  88. package/dist/esm-es5/zonos-elements.js +1 -1
  89. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  90. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  91. package/dist/esm-es5/zonos-icon.entry.js +1 -1
  92. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  93. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  94. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  95. package/dist/esm-es5/zonos-text.entry.js +1 -1
  96. package/dist/esm-es5/{zonosStore-61e74f58.js → zonosStore-34f07ee8.js} +1 -1
  97. package/dist/scripts/extractZonosQaUrl.js +1 -30
  98. package/dist/scripts/loadStripe.js +1 -118
  99. package/dist/scripts/loadZonos.js +1 -565
  100. package/dist/scripts/stripe.js +1 -126
  101. package/dist/scripts/zonos.js +1 -565
  102. package/dist/scripts/zonosBase.js +1 -0
  103. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +3 -3
  104. package/dist/types/components/main/zonos-controller.d.ts +5 -2
  105. package/dist/types/components/store/zonosStore.d.ts +1 -3
  106. package/dist/types/components/utils/api/{getZonosSetting.d.ts → getZonosSettings.d.ts} +1 -1
  107. package/dist/types/components.d.ts +6 -2
  108. package/dist/types/scripts/{zonos.d.ts → zonosBase.d.ts} +6 -3
  109. package/dist/types/types/LogErrorRequestBody.d.ts +5 -0
  110. package/dist/types/types/checkout/CheckoutConfig.d.ts +3 -2
  111. package/dist/types/types/generated/graphql.customer.types.d.ts +80 -0
  112. package/dist/types/types/generated/graphql.customer.types.ts +114 -0
  113. package/dist/types/types/generated/graphql.frontend.types.d.ts +33 -0
  114. package/dist/types/types/generated/graphql.frontend.types.ts +68 -0
  115. package/dist/types/types/global.d.ts +10 -2
  116. package/dist/types/types/hello/HelloConfig.d.ts +0 -1
  117. package/dist/zonos-elements/index.esm.js +1 -1
  118. package/dist/zonos-elements/p-02175f85.entry.js +1 -0
  119. package/dist/zonos-elements/{p-1685c8df.js → p-06a332cd.js} +1 -1
  120. package/dist/zonos-elements/{p-4ed71bd7.entry.js → p-124857ae.entry.js} +1 -1
  121. package/dist/zonos-elements/p-17ef815f.entry.js +1 -0
  122. package/dist/zonos-elements/{p-e98be2d0.system.entry.js → p-1f494581.system.entry.js} +1 -1
  123. package/dist/zonos-elements/p-24fbe845.system.js +1 -1
  124. package/dist/zonos-elements/{p-4846796a.js → p-2b41549a.js} +1 -1
  125. package/dist/zonos-elements/p-2e1e9074.js +1 -0
  126. package/dist/zonos-elements/{p-2801d868.entry.js → p-3509ffaa.entry.js} +1 -1
  127. package/dist/zonos-elements/{p-1d4a970b.entry.js → p-3c8763a7.entry.js} +1 -1
  128. package/dist/zonos-elements/{p-49f09b91.entry.js → p-3e7444c6.entry.js} +1 -1
  129. package/dist/zonos-elements/{p-55f49f1e.js → p-4b3baf99.js} +1 -1
  130. package/dist/zonos-elements/{p-a504f64f.system.js → p-5066955b.system.js} +1 -1
  131. package/dist/zonos-elements/{p-e5ae22a9.system.entry.js → p-53ea93c2.system.entry.js} +1 -1
  132. package/dist/zonos-elements/{p-f367f2fe.system.entry.js → p-5bada106.system.entry.js} +1 -1
  133. package/dist/zonos-elements/{p-f141519c.system.entry.js → p-72cfaee2.system.entry.js} +1 -1
  134. package/dist/zonos-elements/{p-b85be1ab.system.js → p-7730250d.system.js} +1 -1
  135. package/dist/zonos-elements/p-80748529.system.entry.js +1 -0
  136. package/dist/zonos-elements/{p-089ba905.js → p-86f22026.js} +1 -1
  137. package/dist/zonos-elements/{p-a0e36ed3.entry.js → p-88600956.entry.js} +1 -1
  138. package/dist/zonos-elements/{p-89c210d6.entry.js → p-8b1cb8a4.entry.js} +1 -1
  139. package/dist/zonos-elements/p-8bd04aaa.entry.js +1 -0
  140. package/dist/zonos-elements/{p-47390db7.system.entry.js → p-935fa685.system.entry.js} +1 -1
  141. package/dist/zonos-elements/{p-639396bb.entry.js → p-9c1f19b6.entry.js} +1 -1
  142. package/dist/zonos-elements/{p-4d93275c.entry.js → p-a063c4b7.entry.js} +1 -1
  143. package/dist/zonos-elements/p-a174d834.system.js +1 -0
  144. package/dist/zonos-elements/{p-3c6988d7.js → p-a244579e.js} +1 -1
  145. package/dist/zonos-elements/{p-24eed2a8.system.js → p-a54d8db3.system.js} +1 -1
  146. package/dist/zonos-elements/{p-e1f6ab97.entry.js → p-ab00288a.entry.js} +1 -1
  147. package/dist/zonos-elements/{p-b51de536.system.js → p-ab179c88.system.js} +1 -1
  148. package/dist/zonos-elements/{p-4bee0bff.system.entry.js → p-b3a71ae4.system.entry.js} +1 -1
  149. package/dist/zonos-elements/{p-d856a200.system.entry.js → p-b3e034bb.system.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-3cea383b.system.entry.js → p-bb7de2c4.system.entry.js} +1 -1
  151. package/dist/zonos-elements/p-c0494ed6.entry.js +1 -0
  152. package/dist/zonos-elements/{p-da060b1c.system.js → p-c1665c4f.system.js} +1 -1
  153. package/dist/zonos-elements/{p-2f43da39.system.entry.js → p-c1e298d5.system.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-8c5595d9.system.entry.js → p-c520d819.system.entry.js} +1 -1
  155. package/dist/zonos-elements/{p-c9348bb0.system.entry.js → p-ca875e60.system.entry.js} +1 -1
  156. package/dist/zonos-elements/{p-b4601210.system.entry.js → p-ccd1794a.system.entry.js} +1 -1
  157. package/dist/zonos-elements/p-e2c7adaa.system.entry.js +1 -0
  158. package/dist/zonos-elements/{p-b6148206.entry.js → p-e3bca405.entry.js} +1 -1
  159. package/dist/zonos-elements/{p-a376a37f.entry.js → p-e58cc024.entry.js} +1 -1
  160. package/dist/zonos-elements/{p-938803f4.entry.js → p-e6556b0d.entry.js} +1 -1
  161. package/dist/zonos-elements/{p-d2217f09.system.js → p-ed074fbf.system.js} +1 -1
  162. package/dist/zonos-elements/{p-560aa686.system.entry.js → p-f1e9b431.system.entry.js} +1 -1
  163. package/dist/zonos-elements/{p-4a15c5c7.system.entry.js → p-fbc09dae.system.entry.js} +1 -1
  164. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  165. package/package.json +9 -6
  166. package/dist/types/types/online-store/OnlineStoreConfig.d.ts +0 -3
  167. package/dist/zonos-elements/p-06fb9d1f.system.entry.js +0 -1
  168. package/dist/zonos-elements/p-19942abb.system.entry.js +0 -1
  169. package/dist/zonos-elements/p-494c77a7.entry.js +0 -1
  170. package/dist/zonos-elements/p-8c48b75e.system.js +0 -1
  171. package/dist/zonos-elements/p-a3a8b5e7.entry.js +0 -1
  172. package/dist/zonos-elements/p-afe26069.entry.js +0 -1
  173. package/dist/zonos-elements/p-e9b832c5.entry.js +0 -1
  174. package/dist/zonos-elements/p-ff95f098.js +0 -1
  175. /package/dist/collection/types/{online-store/OnlineStoreConfig.js → LogErrorRequestBody.js} +0 -0
package/README.md CHANGED
@@ -19,4 +19,83 @@
19
19
  - `tsconfig`: will include all folders to have all of the intellisense throughout the project.
20
20
  - `tsconfig.build`: stencil building process
21
21
  - `tsconfig.demo-script`: script for demo script
22
- - `tsconfig.scripts`: rollup bundling for loading script.
22
+ - `tsconfig.scripts`: rollup bundling for loading script.
23
+
24
+ ## Developing/Release process
25
+ **IMPORTANT: Be careful when updating the API. Changes, such as modifications to the API path or parameter requirements (like field name changes or making parameters optional or mandatory), could disrupt older versions of zonos-elements. To prevent this, consider keeping the existing endpoint and introducing a new one with the updates. This approach applies to both endpoint path changes and parameter updates. Gradually phase out the old endpoint once all lower CDN versions have migrated.**
26
+
27
+ ### Deprecating APIs Guide
28
+ In our `demo-app`, we treat the API as version-less because it relies on other components (like the customer-graph and front-end graph), and GraphQL does not offer a straightforward method to version queries and mutations. Given this, versioning our API currently seems unnecessary. However, we've devised a strategy for deprecating APIs, acknowledging that it might not be the optimal solution available:
29
+ 1. Changing Endpoint Paths:
30
+ - When an endpoint's path changes, we recommend a structured approach to mark the old endpoint as deprecated:
31
+ - Create a `(deprecated)` folder next to the updated endpoint's directory.
32
+ - Within `(deprecated)`, create a subfolder named after the current version on the main branch.
33
+ - Move the original endpoint's directory to this new version-named folder.
34
+ Ex: If we update the endpoint from `/api/zonos-elements/calculate-landed-cost` to `/api/zonos-elements/calculate-super-landed-cost`, the directory structure would look like this:
35
+ ```
36
+ └── zonos-elements
37
+ ├── (deprecated)
38
+ │ └── (v1.2.3)
39
+ │ └── calculate-landed-cost
40
+ │ ├── CalculateLandedCost.graphql.customer.ts
41
+ │ ├── FulfillmentCenters.graphql.customer.ts
42
+ │ └── route.ts
43
+ ├── calculate-super-landed-cost
44
+ │ ├── CalculateLandedCost.graphql.customer.ts
45
+ │ ├── FulfillmentCenters.graphql.customer.ts
46
+ │ └── route.ts
47
+ ```
48
+ - This folder can be removed once no stores are using a version at or below the deprecated version.
49
+ 1. Parameter requirement changes (optional, mandatory and removal) and API response structure changes
50
+ - For changes in parameter requirements (whether making them optional, mandatory, or removing them), follow these steps:
51
+ - Create a new markdown file named after the `current version on the main branch` within the endpoint's directory.
52
+ - In this markdown file, detail the changes required, such as fields becoming optional, mandatory, or being removed.
53
+ **Note: When updating endpoint responses, it is okay to add new return fields, but removing fields (update mutation/query returns) may cause issues if an old version is expecting and using that old field from the response**
54
+ Ex:
55
+ ```
56
+ └── zonos-elements
57
+ ├── calculate-super-landed-cost
58
+ │ ├── CalculateLandedCost.graphql.customer.ts
59
+ │ ├── FulfillmentCenters.graphql.customer.ts
60
+ │ ├── v1.2.3.md
61
+ │ └── route.ts
62
+ ```
63
+ In `v1.2.3.md`, you might have:
64
+ ```
65
+ ---
66
+ + Keep and make `storeId` optional, and add `zonosStoreId` (Change field name `storeId` to `zonosStoreId`)
67
+ + Make the `storeId` to accept both type `string` and `number` (Change field type of `storeId` from `string` to `number`)
68
+ + Make the field `storeSetting` optional (Remove `storeSetting` field)
69
+ ```
70
+ - Update the current (non-deprecated) endpoint based on the notes in the `.md` file when all stores have moved past the deprecated version and remove that file when all are done.
71
+ Ex:
72
+ - For file changes, if the changes made were:
73
+ - Change field type `storeId` from `string` to `number` ==> take `string` off of the union type (string | number), just leave `number`.
74
+ - Change field name `storeId` to `zonosStoreId` ==> delete `storeId` field.
75
+ - Remove `storeSetting` ==> remove the optional field `storeSetting`.
76
+
77
+ ### Merging strategy
78
+ The github action would bump the version conditionally on qa and main branch merged event.
79
+ + qa branch merge flow: Only bump, publish version and create CDN when the version has alpha word.
80
+ + main branch merge flow: Create a branch against qa and run pnpm version:[patch|major|minor], have it merged to qa, it would not trigger the publish version and create CDN until the changes on qa get merged to main.
81
+
82
+ ### Steps
83
+ 1. Each PR against qa will need to be prerelease pumped by running pnpm version:alpha.
84
+ 2. PR get merged to qa will trigger the github action to publish to npm with alpha tag and create a cdn domain alpha.js.zonos.com - alpha cdn doesn’t need to be versioned, so that when rolling back, the changes will be affected right away.
85
+ 3. The release process would happen on qa. If we want to release, a new branch named build/v1.x.x will need to be checkout from qa. Bump the version (major, minor or patch), and then merge to qa.
86
+ 4. Create a new branch with the same name build/v1.x.xoff of main, pull from qa and just create PR and merge to main.
87
+ 5. PR get merged to `main` will trigger the github action to publish to npm with major, minor or patch tag and create a cdn domain v1.2.3.js.zonos.com.
88
+
89
+ ### Bumping version rule of thumbs
90
+ Below is scenario when to bump version:
91
+ - Alpha:
92
+ - If you need to have types change in zonos-elements and want to use that types in the dashboard (for example: add a new function into instance Zonos). Bump alpha would result pushing new version to npm, then dashboard can install and use it.
93
+ - If we want to have a domain with pinned version to use (v1.2.3-alpha.1.js.zonos.com) and not gonna be used directly with major pin domain (v1.js.zonos.com)
94
+ **Note: If you merge changes with alpha version to main, new release domain will not be generated.**
95
+ - Patch:
96
+ - Any bug fix and small api changes
97
+ - Minor:
98
+ - Architecture changes but doesn't take too much effort to move store to newer version
99
+ - Big API refactor
100
+ - Major:
101
+ - A lot of stores are using zonos-elements stably and have new breaking changes would lead to breaking chain for all stores
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-b43ef5db.js');
4
- const localization = require('./localization-9caf3397.js');
5
- const isDarkColor = require('./isDarkColor-ff6ff183.js');
6
- const getBorderRadius = require('./getBorderRadius-bf4a4276.js');
3
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
4
+ const localization = require('./localization-4746acf7.js');
5
+ const isDarkColor = require('./isDarkColor-fc8c294a.js');
6
+ const getBorderRadius = require('./getBorderRadius-c3c63ee6.js');
7
7
 
8
8
  const prepCalculateLandedCost = () => {
9
9
  // maybe we don't need email now for prefetch the landed cost
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-b43ef5db.js');
3
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
4
4
 
5
5
  /**
6
6
  * Get the border radius for the elements based on the style
@@ -2,12 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const cart = require('./cart-90f7c8c0.js');
6
- require('./zonosStore-b43ef5db.js');
5
+ const cart = require('./cart-cfa5d5fd.js');
6
+ require('./zonosStore-10d1d6ff.js');
7
7
  require('./index-0dcccc22.js');
8
- require('./localization-9caf3397.js');
9
- require('./isDarkColor-ff6ff183.js');
10
- require('./getBorderRadius-bf4a4276.js');
8
+ require('./localization-4746acf7.js');
9
+ require('./isDarkColor-fc8c294a.js');
10
+ require('./getBorderRadius-c3c63ee6.js');
11
11
 
12
12
 
13
13
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-b43ef5db.js');
3
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
4
4
 
5
5
  var tinycolor = zonosStore.createCommonjsModule(function (module, exports) {
6
6
  // This file is autogenerated. It's used to publish CJS to npm.
@@ -6,7 +6,7 @@ const index = require('./index-0dcccc22.js');
6
6
 
7
7
  const defineCustomElements = (win, options) => {
8
8
  if (typeof window === 'undefined') return undefined;
9
- return index.bootstrapLazy([["zonos-text.cjs",[[1,"zonos-text",{"class":[1],"color":[1],"size":[1],"type":[1],"weight":[2],"content":[1],"ready":[32]}]]],["zonos-checkout.cjs",[[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.cjs",[[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.cjs",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64]}]]],["zonos-component.cjs",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-country-flag_4.cjs",[[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.cjs",[[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.cjs",[[1,"zonos-notification",{"class":[1],"notificationArray":[32],"showNotification":[64]}]]],["zonos-badge.cjs",[[1,"zonos-badge",{"bold":[4],"color":[1],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"class":[1]}]]],["zonos-payment.cjs",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}]]],["zonos-shipping-rich-radio.cjs",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[32]}]]],["zonos-address_2.cjs",[[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.cjs",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"class":[1],"hasContent":[32]}]]],["zonos-card_2.cjs",[[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.cjs",[[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"color":[1],"content":[1],"size":[2]}]]],["zonos-button_2.cjs",[[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.cjs",[[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);
9
+ return index.bootstrapLazy([["zonos-text.cjs",[[1,"zonos-text",{"class":[1],"color":[1],"size":[1],"type":[1],"weight":[2],"content":[1],"ready":[32]}]]],["zonos-checkout.cjs",[[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.cjs",[[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.cjs",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]}]]],["zonos-component.cjs",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-country-flag_4.cjs",[[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.cjs",[[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.cjs",[[1,"zonos-notification",{"class":[1],"notificationArray":[32],"showNotification":[64]}]]],["zonos-badge.cjs",[[1,"zonos-badge",{"bold":[4],"color":[1],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"class":[1]}]]],["zonos-payment.cjs",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}]]],["zonos-shipping-rich-radio.cjs",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[32]}]]],["zonos-address_2.cjs",[[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.cjs",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"class":[1],"hasContent":[32]}]]],["zonos-card_2.cjs",[[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.cjs",[[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"color":[1],"content":[1],"size":[2]}]]],["zonos-button_2.cjs",[[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.cjs",[[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);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-b43ef5db.js');
3
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
4
4
 
5
5
  const stringsArabic = {
6
6
  'Above de minimis threshold for': {
@@ -3182,7 +3182,7 @@ const handleFetch = async (url, _opts) => {
3182
3182
  const opts = __rest(_opts || {}, []);
3183
3183
  const body = opts.body ? JSON.stringify(opts.body) : undefined;
3184
3184
  const method = opts.method || 'GET';
3185
- // adding credentialtoken to the url so that the request will be cached differently for each store
3185
+ // adding random encoded token to the url so that the request will be cached differently for each store
3186
3186
  const modifiedUrl = new URL(url);
3187
3187
  modifiedUrl.searchParams.set('zToken', encodeString(window.location.hostname));
3188
3188
  // headers content type
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-b43ef5db.js');
4
- const localization = require('./localization-9caf3397.js');
3
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
4
+ const localization = require('./localization-4746acf7.js');
5
5
 
6
6
  const checkoutBreakpoint = 890;
7
7
  const isCheckoutMobile = (isMobile) => {
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0dcccc22.js');
6
- const cart = require('./cart-90f7c8c0.js');
7
- const localization = require('./localization-9caf3397.js');
8
- require('./zonosStore-b43ef5db.js');
9
- require('./isDarkColor-ff6ff183.js');
10
- require('./getBorderRadius-bf4a4276.js');
6
+ const cart = require('./cart-cfa5d5fd.js');
7
+ const localization = require('./localization-4746acf7.js');
8
+ require('./zonosStore-10d1d6ff.js');
9
+ require('./isDarkColor-fc8c294a.js');
10
+ require('./getBorderRadius-c3c63ee6.js');
11
11
 
12
12
  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)}";
13
13
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0dcccc22.js');
6
- const zonosStore = require('./zonosStore-b43ef5db.js');
6
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
 
9
9
  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)}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0dcccc22.js');
6
- const zonosStore = require('./zonosStore-b43ef5db.js');
6
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
 
9
9
  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)}";
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0dcccc22.js');
6
- const zonosStore = require('./zonosStore-b43ef5db.js');
6
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const getBorderRadius = require('./getBorderRadius-bf4a4276.js');
8
+ const getBorderRadius = require('./getBorderRadius-c3c63ee6.js');
9
9
  const isColorVariable = require('./isColorVariable-41cacd82.js');
10
- const isDarkColor = require('./isDarkColor-ff6ff183.js');
10
+ const isDarkColor = require('./isDarkColor-fc8c294a.js');
11
11
 
12
12
  /**
13
13
  * Get theme for button text based on background color
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0dcccc22.js');
6
- const zonosStore = require('./zonosStore-b43ef5db.js');
6
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
 
9
9
  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)}";
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0dcccc22.js');
6
- const cart = require('./cart-90f7c8c0.js');
7
- const localization = require('./localization-9caf3397.js');
8
- const getBorderRadius = require('./getBorderRadius-bf4a4276.js');
9
- const submitGtag = require('./submitGtag-b141b45d.js');
10
- const zonosStore = require('./zonosStore-b43ef5db.js');
6
+ const cart = require('./cart-cfa5d5fd.js');
7
+ const localization = require('./localization-4746acf7.js');
8
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
9
+ const getBorderRadius = require('./getBorderRadius-c3c63ee6.js');
10
+ const submitGtag = require('./submitGtag-ca175427.js');
11
11
  const classes = require('./classes-b7918f56.js');
12
- require('./isDarkColor-ff6ff183.js');
12
+ require('./isDarkColor-fc8c294a.js');
13
13
 
14
14
  const formatCurrency = ({ amount, currency, showCurrencyText, }) => showCurrencyText
15
15
  ? `${new Intl.NumberFormat('en-US', {
@@ -113,27 +113,55 @@ const ZonosCheckoutFinish = class {
113
113
  if (errors.length || !(json === null || json === void 0 ? void 0 : json.id)) {
114
114
  return null;
115
115
  }
116
- // TODO: This method of triggering /success for BigCommerce is for MVP. Remove when eventRegistry is fixed to handle by webhooks
117
- if (window.Zonos.isBigCommerce) {
118
- const orderId = json === null || json === void 0 ? void 0 : json.id;
119
- 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;
120
- if (!orderId || !storeHash) {
121
- return localization.logError('Unable to trigger BigCommerce /success: Missing orderId or storeHash');
122
- }
123
- void localization.handleFetch(`${baseUrl}/api/bigcommerce/success?orderId=${orderId}&storeHash=${storeHash}`);
124
- }
116
+ // onOrderSuccess callback may be provided on Zonos.init
117
+ await ((_b = (_a = zonosStore.zonosStore.checkoutSettings).onOrderSuccess) === null || _b === void 0 ? void 0 : _b.call(_a, json));
125
118
  return json;
126
119
  };
120
+ this.handleSuccessBehavior = (orderId) => {
121
+ const { successBehavior } = zonosStore.zonosStore.checkoutSettings;
122
+ switch (successBehavior) {
123
+ case 'REDIRECT_TO_SUCCESS_PAGE':
124
+ const redirectUrl = zonosStore.zonosStore.checkoutSettings.successRedirectUrl;
125
+ if (redirectUrl) {
126
+ window.location.href = `${redirectUrl}?zOrderNumber=${orderId}`;
127
+ }
128
+ // If no redirect URL, break and display Zonos success page
129
+ break;
130
+ case 'CLOSE_MODAL':
131
+ this.closeClickHandler();
132
+ break;
133
+ }
134
+ };
135
+ // 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
127
136
  this.getPullOrder = async (attempts = 0) => {
128
137
  const order = await this.pullOrder();
129
138
  if (order) {
130
139
  this.order = order;
140
+ this.handleSuccessBehavior(order.id);
141
+ this.isLoading = false;
131
142
  }
132
143
  else if (!order && attempts < 5) {
133
144
  // Wait for 1 second before the next attempt
134
145
  await new Promise(resolve => setTimeout(resolve, 1000));
135
146
  await this.getPullOrder(attempts + 1);
136
147
  }
148
+ else {
149
+ // Set loading to false to display generic success page and log error
150
+ this.isLoading = false;
151
+ const errorObject = {
152
+ endpoint: `${"https://v1.route.js.zonos.com"}/api/zonos-elements/get-order`,
153
+ errors: ['Order not found after multiple attempts'],
154
+ metadata: {
155
+ checkoutSessionId: cart.cartStore.checkoutSessionId || '',
156
+ domain: window.location.hostname,
157
+ storeId: zonosStore.zonosStore.storeId,
158
+ },
159
+ };
160
+ void localization.handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/log-error`, {
161
+ body: errorObject,
162
+ method: 'POST',
163
+ });
164
+ }
137
165
  };
138
166
  this.checkPaymentStatus = async () => {
139
167
  this.isLoading = true;
@@ -162,6 +190,7 @@ const ZonosCheckoutFinish = class {
162
190
  }
163
191
  // Attempt to pull the order details from the graph every second on 5 attempts
164
192
  if (this.notificationType === 'success') {
193
+ this.isLoading = true;
165
194
  void this.getPullOrder();
166
195
  }
167
196
  }
@@ -329,7 +358,7 @@ ZonosCustomerInfo.style = zonosCustomerInfoCss;
329
358
 
330
359
  const RemoveIcon = `<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>`;
331
360
 
332
- const zonosDialogCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0px;top:0px;background:var(--amino-backdrop-color);z-index:-999;opacity:0;visibility:hidden;position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:1002;background:white}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--amino-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:1001;background:var(--amino-gray-0);max-width:90vw;max-height:90vh;min-height:500px;height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--amino-radius-10));outline:none;-webkit-box-shadow:var(--amino-v3-shadow-xxl);box-shadow:var(--amino-v3-shadow-xxl);border:var(--amino-border);overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-16) var(--amino-space-24)}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--amino-size-md);height:var(--amino-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--amino-radius-10)}:host .zonos--header .zonos--close-button:hover{background:var(--amino-hover-color)}:host .zonos--body{padding:var(--amino-space-8) var(--amino-space-24);max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:var(--amino-space-16) var(--amino-space-24)}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:1001;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:1002;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";
361
+ const zonosDialogCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0px;top:0px;background:var(--amino-backdrop-color);z-index:-999;opacity:0;visibility:hidden;position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:10002;background:white}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--amino-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:10001;background:var(--amino-gray-0);max-width:90vw;max-height:90vh;min-height:500px;height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--amino-radius-10));outline:none;-webkit-box-shadow:var(--amino-v3-shadow-xxl);box-shadow:var(--amino-v3-shadow-xxl);border:var(--amino-border);overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-16) var(--amino-space-24)}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--amino-size-md);height:var(--amino-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--amino-radius-10)}:host .zonos--header .zonos--close-button:hover{background:var(--amino-hover-color)}:host .zonos--body{padding:var(--amino-space-8) var(--amino-space-24);max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:var(--amino-space-16) var(--amino-space-24)}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:10001;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:10002;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";
333
362
 
334
363
  const ZonosDialog = class {
335
364
  constructor(hostRef) {
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0dcccc22.js');
6
- const cart = require('./cart-90f7c8c0.js');
7
- const localization = require('./localization-9caf3397.js');
8
- const zonosStore = require('./zonosStore-b43ef5db.js');
9
- const submitGtag = require('./submitGtag-b141b45d.js');
6
+ const cart = require('./cart-cfa5d5fd.js');
7
+ const localization = require('./localization-4746acf7.js');
8
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
9
+ const submitGtag = require('./submitGtag-ca175427.js');
10
10
  const classes = require('./classes-b7918f56.js');
11
- const getBorderRadius = require('./getBorderRadius-bf4a4276.js');
12
- const isDarkColor = require('./isDarkColor-ff6ff183.js');
11
+ const getBorderRadius = require('./getBorderRadius-c3c63ee6.js');
12
+ const isDarkColor = require('./isDarkColor-fc8c294a.js');
13
13
 
14
14
  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>`;
15
15
 
@@ -157,6 +157,7 @@ const ZonosCheckout = class {
157
157
  });
158
158
  }
159
159
  });
160
+ button.removeAttribute('disabled');
160
161
  button.setAttribute('data-zonos-checkout-attached', 'true');
161
162
  });
162
163
  }
@@ -220,10 +221,14 @@ const ZonosCheckout = class {
220
221
  }
221
222
  else {
222
223
  this.attachCheckout();
223
- // keep checking for checkout selector every 50ms just in case the selector is not loaded in the DOM yet
224
- setInterval(() => {
224
+ // create a mutation observer to see if any new elements that match our selector is added to the DOM
225
+ const observer = new MutationObserver(() => {
225
226
  this.attachCheckout();
226
- }, 50);
227
+ });
228
+ observer.observe(document.body, {
229
+ childList: true,
230
+ subtree: true,
231
+ });
227
232
  }
228
233
  clearInterval(interval);
229
234
  }, 50);
@@ -3,17 +3,17 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0dcccc22.js');
6
- const cart = require('./cart-90f7c8c0.js');
7
- const localization = require('./localization-9caf3397.js');
8
- const zonosStore = require('./zonosStore-b43ef5db.js');
9
- require('./isDarkColor-ff6ff183.js');
10
- require('./getBorderRadius-bf4a4276.js');
6
+ const cart = require('./cart-cfa5d5fd.js');
7
+ const localization = require('./localization-4746acf7.js');
8
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
9
+ require('./isDarkColor-fc8c294a.js');
10
+ require('./getBorderRadius-c3c63ee6.js');
11
11
 
12
- const getZonosSetting = async () => {
12
+ const getZonosSettings = async () => {
13
13
  const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-settings`;
14
14
  const { errors, json } = await localization.handleFetch(url);
15
15
  if (errors.length) {
16
- localization.logError(`Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting`);
16
+ localization.logError(`Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings`);
17
17
  return { errors, json: null };
18
18
  }
19
19
  return { errors: [], json };
@@ -66,44 +66,6 @@ const ZonosController = class {
66
66
  constructor(hostRef) {
67
67
  index.registerInstance(this, hostRef);
68
68
  this.stripeInitEvent = index.createEvent(this, "stripeInitEvent", 7);
69
- this.disablePlaceOrderButtons = ({ disable }) => {
70
- const placeOrderButtonSelector = zonosStore.zonosStore.checkoutSettings.placeOrderButtonSelector;
71
- if (!placeOrderButtonSelector) {
72
- return;
73
- }
74
- const disableEvent = (e) => {
75
- const target = e.target;
76
- // prevent default and propagation when the item has disabled attribute
77
- if (target.getAttribute('disabled')) {
78
- e.preventDefault();
79
- e.stopPropagation();
80
- }
81
- };
82
- const placeOrderButton = document.querySelectorAll(placeOrderButtonSelector);
83
- placeOrderButton.forEach(button => {
84
- if (disable) {
85
- button.setAttribute('disabled', 'true');
86
- // prevent the selector to perform default action when it's disabled
87
- button.addEventListener('click', disableEvent);
88
- }
89
- else {
90
- button.removeAttribute('disabled');
91
- // clean up the event listener
92
- button.removeEventListener('click', disableEvent);
93
- }
94
- });
95
- // only auto enable if autoEnable is true and the state is enable
96
- if (disable) {
97
- setTimeout(() => {
98
- // release it if zonos is not initialized after 5 seconds (this is to prevent the place order button from being disabled forever due to api)
99
- placeOrderButton.forEach(button => {
100
- button.removeAttribute('disabled');
101
- // clean up the event listener if exists
102
- button.removeEventListener('click', disableEvent);
103
- });
104
- }, 5000);
105
- }
106
- };
107
69
  this.config = undefined;
108
70
  this.zonosApiKey = undefined;
109
71
  }
@@ -119,10 +81,6 @@ const ZonosController = class {
119
81
  cart.stripeStore.stripe = stripe;
120
82
  void initCheckout(zonosStore.zonosStore.checkoutSettings);
121
83
  localization.log('init checkout element');
122
- // enable place order button after checkout is loaded
123
- this.disablePlaceOrderButtons({
124
- disable: false,
125
- });
126
84
  }
127
85
  /**
128
86
  * Init zonos notification
@@ -170,15 +128,11 @@ const ZonosController = class {
170
128
  // running with scope async function to avoid blocking the main thread
171
129
  (async () => {
172
130
  var _a, _b;
173
- const { errors, json } = await getZonosSetting();
131
+ const { errors, json } = await getZonosSettings();
174
132
  if (((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.type.toString()) === '403') {
175
133
  localization.log('Failed to load zonos settings. This domain may not have access', 'warn');
176
134
  return;
177
135
  }
178
- // disable place order button until checkout is loaded
179
- this.disablePlaceOrderButtons({
180
- disable: true,
181
- });
182
136
  // init zonos notification
183
137
  this.initZonosNotification();
184
138
  // load default setting if fail to load user setting
@@ -249,6 +203,12 @@ const ZonosController = class {
249
203
  async getAppearanceSetting() {
250
204
  return zonosStore.zonosStore.appearance;
251
205
  }
206
+ /**
207
+ * Update the organizationName
208
+ */
209
+ async updateOrganizationName(organizationName) {
210
+ zonosStore.zonosStore.organizationName = organizationName;
211
+ }
252
212
  render() {
253
213
  return index.h(index.Host, { class: "zonos--elements" });
254
214
  }
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0dcccc22.js');
6
- const localization = require('./localization-9caf3397.js');
7
- const zonosStore = require('./zonosStore-b43ef5db.js');
6
+ const localization = require('./localization-4746acf7.js');
7
+ const zonosStore = require('./zonosStore-10d1d6ff.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
- const isDarkColor = require('./isDarkColor-ff6ff183.js');
9
+ const isDarkColor = require('./isDarkColor-fc8c294a.js');
10
10
 
11
11
  const zonosCountryFlagCss = ":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 .flag-container{position:relative;overflow:hidden;width:100%;height:100%}:host .flag-icon{position:absolute;top:0;left:0;width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover}";
12
12