@zonos/elements 1.3.167 → 1.3.169

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 (198) hide show
  1. package/dist/cjs/{CheckoutConfig-626b48e5.js → CheckoutConfig-f5e68e14.js} +1 -1
  2. package/dist/cjs/{cart-dbeee1e9.js → cart-36799bbe.js} +4 -4
  3. package/dist/cjs/{getBorderRadius-d184b623.js → getBorderRadius-94ef609c.js} +1 -1
  4. package/dist/cjs/{handleFetch-3673a0c2.js → handleFetch-7b7f9f7c.js} +79 -1
  5. package/dist/cjs/index.cjs.js +46 -9
  6. package/dist/cjs/{isDarkColor-08d92ed7.js → isDarkColor-ec4a4e7d.js} +1 -1
  7. package/dist/cjs/{paypal-38ab2263.js → paypal-3eae38bd.js} +14 -6
  8. package/dist/cjs/zonos-address_7.cjs.entry.js +5 -5
  9. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  12. package/dist/cjs/zonos-card.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +6 -6
  14. package/dist/cjs/zonos-checkout.cjs.entry.js +32 -42
  15. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  16. package/dist/cjs/zonos-controller.cjs.entry.js +8 -6
  17. package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
  18. package/dist/cjs/zonos-country-select_4.cjs.entry.js +5 -5
  19. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +6 -6
  20. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
  21. package/dist/cjs/zonos-hello.cjs.entry.js +5 -5
  22. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  23. package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -5
  24. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  25. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
  26. package/dist/cjs/zonos-stripe-input.cjs.entry.js +3 -3
  27. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  28. package/dist/cjs/zonos-toggle.cjs.entry.js +1 -1
  29. package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
  30. package/dist/cjs/{zonosStore-7975e4b6.js → zonosStore-3812b318.js} +3 -0
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +8 -0
  32. package/dist/collection/components/main/zonos-controller.js +3 -1
  33. package/dist/collection/components/store/checkout/paypal.js +8 -0
  34. package/dist/collection/components/store/zonosStore.js +3 -0
  35. package/dist/collection/components/utils/api/paypalCreateOrder.js +2 -2
  36. package/dist/collection/components/utils/handleFetch.js +14 -1
  37. package/dist/collection/components/utils/logging/getAdditionalLogMetadata.js +19 -0
  38. package/dist/collection/components/utils/logging/prepLoadTimeApiLog.js +29 -0
  39. package/dist/collection/components/utils/logging/sendBulkLoadTimeApiLog.js +30 -0
  40. package/dist/collection/components/utils/logging/sendLoadCheckoutFacadeLog.js +1 -1
  41. package/dist/collection/components/utils/logging/sendLoadNativeCheckoutLog.js +23 -0
  42. package/dist/collection/components/utils/logging/sendLoadScriptLog.js +1 -17
  43. package/dist/collection/scripts/_zonosBase.js +9 -0
  44. package/dist/collection/types/generated/graphql.frontend.types.js +3 -0
  45. package/dist/collection/types/generated/graphql.internal.types.js +35 -0
  46. package/dist/esm/{CheckoutConfig-646aae20.js → CheckoutConfig-2994efd9.js} +1 -1
  47. package/dist/esm/{cart-f2f5f13f.js → cart-b2e57589.js} +4 -4
  48. package/dist/esm/{getBorderRadius-740610fb.js → getBorderRadius-ada3ccad.js} +1 -1
  49. package/dist/esm/{handleFetch-b4633675.js → handleFetch-8d72c8cd.js} +79 -2
  50. package/dist/esm/index.js +47 -10
  51. package/dist/esm/{isDarkColor-2f59d721.js → isDarkColor-446fccb7.js} +1 -1
  52. package/dist/esm/{paypal-7d253663.js → paypal-38da5d52.js} +14 -6
  53. package/dist/esm/zonos-address_7.entry.js +5 -5
  54. package/dist/esm/zonos-badge.entry.js +1 -1
  55. package/dist/esm/zonos-banner.entry.js +1 -1
  56. package/dist/esm/zonos-button_3.entry.js +3 -3
  57. package/dist/esm/zonos-card.entry.js +2 -2
  58. package/dist/esm/zonos-cart-items_13.entry.js +6 -6
  59. package/dist/esm/zonos-checkout.entry.js +31 -41
  60. package/dist/esm/zonos-collapse.entry.js +1 -1
  61. package/dist/esm/zonos-controller.entry.js +8 -6
  62. package/dist/esm/zonos-country-flag.entry.js +5 -5
  63. package/dist/esm/zonos-country-select_4.entry.js +5 -5
  64. package/dist/esm/zonos-empty-state-payment_4.entry.js +6 -6
  65. package/dist/esm/zonos-hello-dialog.entry.js +5 -5
  66. package/dist/esm/zonos-hello.entry.js +5 -5
  67. package/dist/esm/zonos-input.entry.js +2 -2
  68. package/dist/esm/zonos-language-select_2.entry.js +5 -5
  69. package/dist/esm/zonos-logo.entry.js +1 -1
  70. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  71. package/dist/esm/zonos-stripe-input.entry.js +3 -3
  72. package/dist/esm/zonos-text.entry.js +1 -1
  73. package/dist/esm/zonos-toggle.entry.js +1 -1
  74. package/dist/esm/zonos-v-stack.entry.js +1 -1
  75. package/dist/esm/{zonosStore-71d7e02f.js → zonosStore-d3c5a0a5.js} +3 -0
  76. package/dist/esm-es5/{CheckoutConfig-646aae20.js → CheckoutConfig-2994efd9.js} +1 -1
  77. package/dist/esm-es5/{cart-f2f5f13f.js → cart-b2e57589.js} +1 -1
  78. package/dist/esm-es5/{getBorderRadius-740610fb.js → getBorderRadius-ada3ccad.js} +1 -1
  79. package/dist/esm-es5/handleFetch-8d72c8cd.js +1 -0
  80. package/dist/esm-es5/index.js +1 -1
  81. package/dist/esm-es5/{isDarkColor-2f59d721.js → isDarkColor-446fccb7.js} +1 -1
  82. package/dist/esm-es5/paypal-38da5d52.js +17 -0
  83. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  84. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  85. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  86. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  87. package/dist/esm-es5/zonos-card.entry.js +1 -1
  88. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  89. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  90. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  91. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  92. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  93. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  94. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  95. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  96. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  97. package/dist/esm-es5/zonos-input.entry.js +1 -1
  98. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  99. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  100. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  101. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  102. package/dist/esm-es5/zonos-text.entry.js +1 -1
  103. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  104. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  105. package/dist/esm-es5/{zonosStore-71d7e02f.js → zonosStore-d3c5a0a5.js} +1 -1
  106. package/dist/scripts/index.d.ts +24 -0
  107. package/dist/scripts/index.js +1 -1
  108. package/dist/scripts/loadZonos.js +1 -1
  109. package/dist/scripts/zonos.js +1 -1
  110. package/dist/types/components/store/checkout/paypal.d.ts +2 -0
  111. package/dist/types/components/utils/api/paypalCreateOrder.d.ts +1 -1
  112. package/dist/types/components/utils/logging/getAdditionalLogMetadata.d.ts +15 -0
  113. package/dist/types/components/utils/logging/prepLoadTimeApiLog.d.ts +23 -0
  114. package/dist/types/components/utils/logging/sendBulkLoadTimeApiLog.d.ts +1 -0
  115. package/dist/types/components/utils/logging/sendLoadNativeCheckoutLog.d.ts +3 -0
  116. package/dist/types/components/utils/logging/sendLoadScriptLog.d.ts +0 -12
  117. package/dist/types/scripts/_getNextFallbackUrl.d.ts +1 -1
  118. package/dist/types/scripts/_zonosBase.d.ts +5 -0
  119. package/dist/types/types/LogLoadScript.d.ts +1 -0
  120. package/dist/types/types/checkout/CheckoutConfig.d.ts +4 -0
  121. package/dist/types/types/checkout/api/Paypal.d.ts +3 -1
  122. package/dist/types/types/generated/graphql.frontend.types.d.ts +11 -0
  123. package/dist/types/types/generated/graphql.frontend.types.ts +21 -0
  124. package/dist/types/types/generated/graphql.internal.types.d.ts +51 -5
  125. package/dist/types/types/generated/graphql.internal.types.ts +68 -5
  126. package/dist/zonos-elements/index.esm.js +1 -1
  127. package/dist/zonos-elements/{p-68584880.entry.js → p-00ad3c73.entry.js} +1 -1
  128. package/dist/zonos-elements/{p-25ad92dc.system.entry.js → p-0bfca3a9.system.entry.js} +1 -1
  129. package/dist/zonos-elements/{p-82a0fcb7.system.entry.js → p-0def1397.system.entry.js} +1 -1
  130. package/dist/zonos-elements/{p-09e4f412.system.entry.js → p-0e63259c.system.entry.js} +1 -1
  131. package/dist/zonos-elements/{p-466de014.system.entry.js → p-1a20922f.system.entry.js} +1 -1
  132. package/dist/zonos-elements/{p-16413274.system.entry.js → p-1edbfb1f.system.entry.js} +1 -1
  133. package/dist/zonos-elements/{p-c7219337.system.entry.js → p-236f32c8.system.entry.js} +1 -1
  134. package/dist/zonos-elements/{p-dd999b44.js → p-30fdcbee.js} +1 -1
  135. package/dist/zonos-elements/{p-acabfba5.entry.js → p-3731e7f5.entry.js} +1 -1
  136. package/dist/zonos-elements/{p-6549915d.entry.js → p-3eac4b10.entry.js} +1 -1
  137. package/dist/zonos-elements/{p-7c028742.entry.js → p-41dfc828.entry.js} +1 -1
  138. package/dist/zonos-elements/{p-163425d9.entry.js → p-461ca324.entry.js} +1 -1
  139. package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
  140. package/dist/zonos-elements/{p-c9035262.js → p-47f79a6d.js} +1 -1
  141. package/dist/zonos-elements/p-48173901.js +17 -0
  142. package/dist/zonos-elements/{p-a9a95fae.system.js → p-5187ba8f.system.js} +1 -1
  143. package/dist/zonos-elements/{p-669a7b5d.system.entry.js → p-53cb8867.system.entry.js} +1 -1
  144. package/dist/zonos-elements/{p-8654b135.system.entry.js → p-56758218.system.entry.js} +1 -1
  145. package/dist/zonos-elements/{p-3edccfff.system.entry.js → p-56a8b1f6.system.entry.js} +1 -1
  146. package/dist/zonos-elements/{p-0febd074.system.entry.js → p-58f660d4.system.entry.js} +1 -1
  147. package/dist/zonos-elements/p-5ac76fa9.system.entry.js +1 -0
  148. package/dist/zonos-elements/p-677e7b4b.entry.js +1 -0
  149. package/dist/zonos-elements/{p-b6fdbbf4.system.js → p-69255ed2.system.js} +1 -1
  150. package/dist/zonos-elements/{p-57281d6c.system.entry.js → p-6c0c8722.system.entry.js} +1 -1
  151. package/dist/zonos-elements/p-71539c8a.js +1 -0
  152. package/dist/zonos-elements/{p-ed74742d.system.entry.js → p-739014f8.system.entry.js} +1 -1
  153. package/dist/zonos-elements/{p-073bc210.entry.js → p-8048932d.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-77581c1c.entry.js → p-829f6a40.entry.js} +1 -1
  155. package/dist/zonos-elements/{p-7011d8e2.entry.js → p-864c7c7d.entry.js} +1 -1
  156. package/dist/zonos-elements/{p-73e9a8f5.entry.js → p-90633d63.entry.js} +1 -1
  157. package/dist/zonos-elements/p-9261869c.system.js +1 -0
  158. package/dist/zonos-elements/{p-672707ce.js → p-98aa88b1.js} +1 -1
  159. package/dist/zonos-elements/{p-e4a52de7.entry.js → p-9f9e4f74.entry.js} +1 -1
  160. package/dist/zonos-elements/{p-98e9c9cf.js → p-a1cfbd0a.js} +1 -1
  161. package/dist/zonos-elements/{p-3bff5a9f.system.js → p-a3888f1d.system.js} +1 -1
  162. package/dist/zonos-elements/{p-405f70b1.entry.js → p-b0c39400.entry.js} +1 -1
  163. package/dist/zonos-elements/{p-72319b4d.entry.js → p-b5b9aa6c.entry.js} +1 -1
  164. package/dist/zonos-elements/{p-20ca31fd.system.entry.js → p-be9e1818.system.entry.js} +1 -1
  165. package/dist/zonos-elements/p-bf113a46.system.js +17 -0
  166. package/dist/zonos-elements/{p-0150bb1e.entry.js → p-bfa028a2.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-85235fa0.system.entry.js → p-c4fa8524.system.entry.js} +1 -1
  168. package/dist/zonos-elements/{p-73a3e5bb.system.js → p-c5c2976f.system.js} +1 -1
  169. package/dist/zonos-elements/{p-41688151.system.entry.js → p-c82f488b.system.entry.js} +1 -1
  170. package/dist/zonos-elements/{p-ab699c84.entry.js → p-cb52cfdf.entry.js} +1 -1
  171. package/dist/zonos-elements/{p-75a8e67d.entry.js → p-cc6d9f7d.entry.js} +1 -1
  172. package/dist/zonos-elements/{p-82166888.system.entry.js → p-ce853f8f.system.entry.js} +1 -1
  173. package/dist/zonos-elements/{p-15971b78.entry.js → p-cedf08f0.entry.js} +1 -1
  174. package/dist/zonos-elements/{p-e174b37b.system.entry.js → p-d0944cc8.system.entry.js} +1 -1
  175. package/dist/zonos-elements/{p-eb5835d1.system.entry.js → p-d49c6a3e.system.entry.js} +1 -1
  176. package/dist/zonos-elements/{p-c556ff98.js → p-dd0259f4.js} +1 -1
  177. package/dist/zonos-elements/{p-20802055.entry.js → p-e09cea9c.entry.js} +1 -1
  178. package/dist/zonos-elements/p-e4f8114a.system.js +1 -0
  179. package/dist/zonos-elements/{p-c371558a.system.entry.js → p-e99e75dd.system.entry.js} +1 -1
  180. package/dist/zonos-elements/{p-83645bb4.entry.js → p-eb294265.entry.js} +1 -1
  181. package/dist/zonos-elements/p-ef4bad3a.system.js +1 -0
  182. package/dist/zonos-elements/{p-8addb07b.system.entry.js → p-f378b4d3.system.entry.js} +1 -1
  183. package/dist/zonos-elements/{p-718c9603.system.entry.js → p-fd352222.system.entry.js} +1 -1
  184. package/dist/zonos-elements/{p-fa15b9b5.entry.js → p-fe2c27c4.entry.js} +1 -1
  185. package/dist/zonos-elements/{p-607a6750.entry.js → p-febb90e0.entry.js} +1 -1
  186. package/dist/zonos-elements/{p-93499c9b.entry.js → p-ff1c6d9a.entry.js} +1 -1
  187. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  188. package/package.json +1 -1
  189. package/dist/esm-es5/handleFetch-b4633675.js +0 -1
  190. package/dist/esm-es5/paypal-7d253663.js +0 -17
  191. package/dist/zonos-elements/p-18e5b741.system.js +0 -1
  192. package/dist/zonos-elements/p-4508c22b.entry.js +0 -1
  193. package/dist/zonos-elements/p-4a0d1e3c.system.js +0 -17
  194. package/dist/zonos-elements/p-6658cc02.system.js +0 -1
  195. package/dist/zonos-elements/p-d0adc1b5.system.entry.js +0 -1
  196. package/dist/zonos-elements/p-d9b0094e.system.js +0 -1
  197. package/dist/zonos-elements/p-e97f9606.js +0 -17
  198. package/dist/zonos-elements/p-f0c8150e.js +0 -1
@@ -1,7 +1,7 @@
1
- import { c as createStore, z as zonosStore } from './zonosStore-71d7e02f.js';
2
- import { h as handleFetch, b as logError, l as log, f as fallbackApiList, s as sendErrorLog, d as allLogs, j as jsonParse, a as getIsStagingMode } from './handleFetch-b4633675.js';
3
- import { i as isDarkColor } from './isDarkColor-2f59d721.js';
4
- import { g as getBorderRadius } from './getBorderRadius-740610fb.js';
1
+ import { c as createStore, z as zonosStore } from './zonosStore-d3c5a0a5.js';
2
+ import { h as handleFetch, b as logError, l as log, f as fallbackApiList, s as sendErrorLog, d as allLogs, j as jsonParse, a as getIsStagingMode } from './handleFetch-8d72c8cd.js';
3
+ import { i as isDarkColor } from './isDarkColor-446fccb7.js';
4
+ import { g as getBorderRadius } from './getBorderRadius-ada3ccad.js';
5
5
 
6
6
  const stringsArabic = {
7
7
  ' (Duties due at door)': {
@@ -1,4 +1,4 @@
1
- import { z as zonosStore } from './zonosStore-71d7e02f.js';
1
+ import { z as zonosStore } from './zonosStore-d3c5a0a5.js';
2
2
 
3
3
  /**
4
4
  * Get the border radius for the elements based on the style
@@ -124,6 +124,71 @@ const jsonParse = (_data) => {
124
124
  return null;
125
125
  };
126
126
 
127
+ const getNavigatorConnection = () => {
128
+ const connection = 'connection' in window.navigator
129
+ ? // connection is not yet supported in all browsers
130
+ window.navigator.connection
131
+ : null;
132
+ const mozConnection = 'mozConnection' in window.navigator
133
+ ? // mozConnection is not yet supported in all browsers
134
+ window.navigator.mozConnection
135
+ : null;
136
+ const webkitConnection = 'webkitConnection' in window.navigator
137
+ ? // webkitConnection is not yet supported in all browsers
138
+ window.navigator.webkitConnection
139
+ : null;
140
+ const baseConnection = connection || mozConnection || webkitConnection;
141
+ return baseConnection;
142
+ };
143
+
144
+ const getAdditionalLogMetadata = () => {
145
+ const userAgentData = 'userAgentData' in window.navigator
146
+ ? // userAgentData is not yet supported in all browsers
147
+ window.navigator.userAgentData
148
+ : null;
149
+ const baseConnection = getNavigatorConnection();
150
+ return {
151
+ connectionDownlink: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.downlink,
152
+ connectionEffectiveType: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.effectiveType,
153
+ connectionRtt: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.rtt,
154
+ connectionSaveData: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.saveData,
155
+ screenHeight: window.screen.height,
156
+ screenWidth: window.screen.width,
157
+ userAgent: userAgentData && userAgentData.brands.length > 0
158
+ ? userAgentData
159
+ : window.navigator.userAgent,
160
+ };
161
+ };
162
+
163
+ const blackListPaths = [
164
+ '/api/zonos-elements/log-script-load',
165
+ '/api/zonos-elements/log-bulk-load',
166
+ ];
167
+ /**
168
+ * Prepares the load time api log for the given API call to send to the server later
169
+ * This function is used to prepare the load time api log for the given API call.
170
+ * It adds the load time api log to the loadTimeApiInfoList.
171
+ */
172
+ const prepLoadTimeApiLog = ({ apiPath, apiType, loadTimeInternal, loadTimeTotal, }) => {
173
+ if (blackListPaths.includes(apiPath)) {
174
+ return;
175
+ }
176
+ const apiPathWithoutParams = apiPath.split('?')[0] || apiPath;
177
+ const scriptLoadLogBody = {
178
+ cache: 'miss',
179
+ cdnLoadTime: loadTimeTotal - loadTimeInternal,
180
+ eventName: 'jsdelivr',
181
+ flag: 'LOG_LOAD_TIME_API',
182
+ href: apiPathWithoutParams,
183
+ loadTime: loadTimeInternal,
184
+ metadata: Object.assign(Object.assign({ apiType }, getAdditionalLogMetadata()), { loadTimeClientMiddleware: loadTimeTotal - loadTimeInternal, loadTimeInternal,
185
+ loadTimeTotal }),
186
+ scriptLoadUrl: apiType,
187
+ storeId: window.Zonos.storeId,
188
+ };
189
+ window.Zonos.loadTimeApiInfoList.push(scriptLoadLogBody);
190
+ };
191
+
127
192
  /**
128
193
  * This is the time in milliseconds after release time that we will start sending error logs to the new API
129
194
  * @default 1 hour
@@ -321,11 +386,24 @@ const handleRequestWithFallback = async ({ basePathType: _basePathType, options,
321
386
  const basePathType = isBigcommerceEndpoint
322
387
  ? 'vercel'
323
388
  : _basePathType;
389
+ const startTime = performance.now();
324
390
  const _c = await handleRequest({
325
391
  basePathType,
326
392
  options,
327
393
  path,
328
394
  }), { errors, response } = _c, rest = __rest(_c, ["errors", "response"]);
395
+ const endTime = performance.now();
396
+ const duration = endTime - startTime;
397
+ // Send the load time api log
398
+ log(`${path} (${duration.toFixed(2)}ms)`, 'info');
399
+ // No need to send the load time api log for the log-script-load endpoint
400
+ const internalDuration = response === null || response === void 0 ? void 0 : response.headers.get('Zonos-Duration');
401
+ prepLoadTimeApiLog({
402
+ apiPath: path,
403
+ apiType: basePathType,
404
+ loadTimeInternal: internalDuration ? Number(internalDuration) : 0,
405
+ loadTimeTotal: duration,
406
+ });
329
407
  const nextFallbackApiType = getNextFallbackApiType(basePathType);
330
408
  const unknownError = errors.find(({ type }) => type === 'unknown');
331
409
  const isUnknownError = !!unknownError || (response === null || response === void 0 ? void 0 : response.status) === 404;
@@ -377,7 +455,6 @@ const handleFetch = async (path, _opts) => {
377
455
  method });
378
456
  // This is for testing fallback API, set fallback API type to start with
379
457
  const useFallbackApi = new URLSearchParams(window.location.search).get('useFallbackApi');
380
- log(path, 'info');
381
458
  return handleRequestWithFallback({
382
459
  basePathType: useFallbackApi || MAIN_BASE_API_TYPE,
383
460
  options,
@@ -385,4 +462,4 @@ const handleFetch = async (path, _opts) => {
385
462
  });
386
463
  };
387
464
 
388
- export { getIsStagingMode as a, logError as b, getElapsedTime as c, allLogs as d, fallbackApiList as f, getIsTestMode as g, handleFetch as h, jsonParse as j, log as l, sendErrorLog as s };
465
+ export { getIsStagingMode as a, logError as b, getElapsedTime as c, allLogs as d, getAdditionalLogMetadata as e, fallbackApiList as f, getIsTestMode as g, handleFetch as h, jsonParse as j, log as l, sendErrorLog as s };
package/dist/esm/index.js CHANGED
@@ -1,8 +1,37 @@
1
- import { g as getIsTestMode, a as getIsStagingMode, l as log, h as handleFetch, b as logError } from './handleFetch-b4633675.js';
2
- import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-646aae20.js';
3
- export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-646aae20.js';
1
+ import { l as log, h as handleFetch, g as getIsTestMode, a as getIsStagingMode, b as logError } from './handleFetch-8d72c8cd.js';
2
+ import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-2994efd9.js';
3
+ export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-2994efd9.js';
4
4
  export { c as countryRequireTaxId, s as shipToTaxIdLabels } from './TaxId-915ef042.js';
5
5
 
6
+ let numberOfFailures = 0;
7
+ const sendBulkLoadTimeApiLog = async () => {
8
+ // Don't send the log if there are no API calls to send
9
+ if (window.Zonos.loadTimeApiInfoList.length === 0) {
10
+ return;
11
+ }
12
+ log('Sending bulk load time api log', 'info', {
13
+ loadTimeApiInfoList: window.Zonos.loadTimeApiInfoList,
14
+ });
15
+ // Clone the list so we can clear it after sending the log
16
+ const loadTimeApiInfoListArray = [...window.Zonos.loadTimeApiInfoList];
17
+ // Clear the list after sending the log successfully
18
+ window.Zonos.loadTimeApiInfoList.length = 0;
19
+ // Clear the list after sending the log successfully
20
+ const { errors } = await handleFetch('/api/zonos-elements/log-bulk-load', {
21
+ body: loadTimeApiInfoListArray,
22
+ method: 'POST',
23
+ });
24
+ if (errors.length) {
25
+ // If there are errors, add the logs back to the list so we can try again later
26
+ window.Zonos.loadTimeApiInfoList.push(...loadTimeApiInfoListArray);
27
+ numberOfFailures++;
28
+ if (numberOfFailures > 5 && window.Zonos.logIntervalId) {
29
+ // If there are more than 3 failures, stop the interval
30
+ clearInterval(window.Zonos.logIntervalId);
31
+ }
32
+ }
33
+ };
34
+
6
35
  /**
7
36
  * Get the load version and url based on the loadScriptSrc and version
8
37
  * @returns
@@ -126,7 +155,7 @@ const getZonosQaUrl = () => {
126
155
  return null;
127
156
  }
128
157
  const qaUrl = extractZonosQaUrl(window.location.href);
129
- const cdnUrl = "https://v1.3.167.js.zonos.com";
158
+ const cdnUrl = "https://v1.3.169.js.zonos.com";
130
159
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
131
160
  if (!qaUrl &&
132
161
  (cdnUrl.includes('test.') ||
@@ -310,10 +339,10 @@ const zonosLoadUrl = (() => {
310
339
  }
311
340
  return null;
312
341
  })();
313
- const ZONOS_URL = "https://v1.3.167.js.zonos.com";
314
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.167";
315
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.167";
316
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.167";
342
+ const ZONOS_URL = "https://v1.3.169.js.zonos.com";
343
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.169";
344
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.169";
345
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.169";
317
346
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
318
347
  const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
319
348
  class Zonos {
@@ -327,7 +356,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
327
356
  !!window.location.search.match(/\?.*(&*)zonosConversionTest/);
328
357
  Zonos._paypalMockResponse = null;
329
358
  Zonos.isBigCommerce = false;
330
- Zonos.releaseDate = "1741302018777";
359
+ Zonos.releaseDate = "1741966456733";
331
360
  Zonos.isLegacyCheckout = false;
332
361
  Zonos.domain = typeof window !== 'undefined'
333
362
  ? // domain that embeds the iframe
@@ -343,12 +372,14 @@ Zonos.showBaseForeign = typeof window !== 'undefined' &&
343
372
  Zonos.isNpm = true;
344
373
  Zonos.zonosQaUrl = null;
345
374
  Zonos.zonosQaUrlApi = null;
346
- Zonos.version = `v${"1.3.167"}`;
375
+ Zonos.version = `v${"1.3.169"}`;
347
376
  Zonos.modeAlerted = false;
348
377
  Zonos.cartData = null;
349
378
  Zonos.paypal = null;
350
379
  Zonos.getCurrentTimestamp = () => new Date().getTime();
351
380
  Zonos.zonosController = null;
381
+ Zonos.loadTimeApiInfoList = [];
382
+ Zonos.logIntervalId = null;
352
383
  Zonos.init = async (params) => {
353
384
  const { appearance, checkoutSettings, currencyConverter, helloSettings, onCountryChange, overrideCurrencyFormat, storeId, zonosApiKey, } = params;
354
385
  _a.cartId = getCartIdFromQueryParam();
@@ -441,6 +472,12 @@ Zonos.init = async (params) => {
441
472
  },
442
473
  });
443
474
  _a.doneInit = true;
475
+ if (!_a.logIntervalId) {
476
+ // log the load time of all API calls every 2 seconds
477
+ _a.logIntervalId = setInterval(() => {
478
+ void sendBulkLoadTimeApiLog();
479
+ }, 2000);
480
+ }
444
481
  };
445
482
  Zonos.injectCustomScriptForHostedCheckout = () => {
446
483
  const cartData = _a.cartData;
@@ -1,4 +1,4 @@
1
- import { a as commonjsGlobal } from './zonosStore-71d7e02f.js';
1
+ import { a as commonjsGlobal } from './zonosStore-d3c5a0a5.js';
2
2
 
3
3
  var tinycolor$1 = {exports: {}};
4
4
 
@@ -1,7 +1,7 @@
1
- import { z as zonosStore, c as createStore } from './zonosStore-71d7e02f.js';
2
- import { F as validateCheckoutSession, f as stripeStore, e as cartStore, z as stripeStoreHandleInventoryCheck, r as translate, x as cartStoreNextStep, k as cartStoreClearCheckoutInterval } from './cart-f2f5f13f.js';
3
- import { h as handleFetch, l as log, b as logError, j as jsonParse } from './handleFetch-b4633675.js';
4
- import { t as tinycolor } from './isDarkColor-2f59d721.js';
1
+ import { z as zonosStore, c as createStore } from './zonosStore-d3c5a0a5.js';
2
+ import { F as validateCheckoutSession, f as stripeStore, e as cartStore, z as stripeStoreHandleInventoryCheck, r as translate, x as cartStoreNextStep, k as cartStoreClearCheckoutInterval } from './cart-b2e57589.js';
3
+ import { h as handleFetch, l as log, b as logError, j as jsonParse } from './handleFetch-8d72c8cd.js';
4
+ import { t as tinycolor } from './isDarkColor-446fccb7.js';
5
5
 
6
6
  /*!
7
7
  * paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
@@ -214,9 +214,9 @@ const paypalCaptureOrder = async ({ checkoutSessionId, paypalMockResponse, }) =>
214
214
  return { errors, json };
215
215
  };
216
216
 
217
- const paypalCreateOrder = async ({ checkoutSessionId, }) => {
217
+ const paypalCreateOrder = async ({ checkoutSessionId, intent, }) => {
218
218
  const { errors, json } = await handleFetch('/api/zonos-elements/create-paypal-order', {
219
- body: { checkoutSessionId },
219
+ body: { checkoutSessionId, intent },
220
220
  method: 'POST',
221
221
  });
222
222
  return { errors, json };
@@ -245,6 +245,7 @@ const submitGtag = (event) => {
245
245
  };
246
246
 
247
247
  const { reset: paypalStoreReset, state: paypalStore } = createStore(() => ({
248
+ intent: 'capture',
248
249
  orderIdCreated: null,
249
250
  paypalButtons: [],
250
251
  paypalClientId: '',
@@ -252,8 +253,10 @@ const { reset: paypalStoreReset, state: paypalStore } = createStore(() => ({
252
253
  }));
253
254
  const paypalStoreCreaterOrder = async ({ checkoutSessionId, }) => {
254
255
  var _a, _b;
256
+ const uppercaseIntent = paypalStore.intent.toUpperCase();
255
257
  const { errors, json } = await paypalCreateOrder({
256
258
  checkoutSessionId,
259
+ intent: uppercaseIntent,
257
260
  });
258
261
  const paypalOrderId = (_a = json === null || json === void 0 ? void 0 : json.paypalOrderCreate) === null || _a === void 0 ? void 0 : _a.paypalOrderId;
259
262
  if (errors.length || !paypalOrderId) {
@@ -413,11 +416,16 @@ const paypalInitScript = async ({ currency }) => {
413
416
  zonosStore.checkoutSettings.mode === 'LIVE'
414
417
  ? 'production'
415
418
  : 'sandbox';
419
+ const hasAuthorizeSettingSet = zonosStore.checkoutSettings.captureDelay &&
420
+ zonosStore.checkoutSettings.captureDelay > 0;
421
+ paypalStore.intent = hasAuthorizeSettingSet ? 'authorize' : 'capture';
422
+ log('==== Paypal order intent', 'info', paypalStore.intent);
416
423
  // send paypal publishable key out to load paypal
417
424
  window.Zonos.paypal = await loadScript({
418
425
  clientId: paypalClientId.token,
419
426
  currency,
420
427
  environment,
428
+ intent: paypalStore.intent,
421
429
  });
422
430
  log('==== Paypal script loaded');
423
431
  };
@@ -1,13 +1,13 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-d82f06f2.js';
2
- import { f as stripeStore, V as getFallbackDefaultCountryCode, r as translate, l as localizationStore, e as cartStore } from './cart-f2f5f13f.js';
3
- import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-71d7e02f.js';
2
+ import { f as stripeStore, V as getFallbackDefaultCountryCode, r as translate, l as localizationStore, e as cartStore } from './cart-b2e57589.js';
3
+ import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
4
4
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
5
- import { b as logError, l as log } from './handleFetch-b4633675.js';
5
+ import { b as logError, l as log } from './handleFetch-8d72c8cd.js';
6
6
  import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
7
7
  import { c as classes } from './classes-0d95c529.js';
8
8
  import { R as RemoveIcon$1 } from './RemoveIcon-9dc5dd1a.js';
9
- import { g as getBorderRadius } from './getBorderRadius-740610fb.js';
10
- import { i as isDarkColor } from './isDarkColor-2f59d721.js';
9
+ import { g as getBorderRadius } from './getBorderRadius-ada3ccad.js';
10
+ import { i as isDarkColor } from './isDarkColor-446fccb7.js';
11
11
 
12
12
  const zonosAddressCss = ".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--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:16px}.sc-zonos-address-h .zonos--company-name-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";
13
13
  const ZonosAddressStyle0 = zonosAddressCss;
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-d82f06f2.js';
2
- import { d as zonosStoreFontFamily } from './zonosStore-71d7e02f.js';
2
+ import { d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
4
 
5
5
  const RemoveLineIcon = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-d82f06f2.js';
2
- import { d as zonosStoreFontFamily } from './zonosStore-71d7e02f.js';
2
+ import { d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
4
 
5
5
  const zonosBannerCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--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(--zonos-elements-radius-10);padding:16px;background:var(--zonos-elements-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:0px;grid-area:header}:host .zonos--content-wrapper{grid-area:content;margin-top:4px}:host(.info){background-color:var(--zonos-elements-blue-100);border:1px solid var(--zonos-elements-blue-200)}:host(.success){background-color:var(--zonos-elements-green-100);border:1px solid var(--zonos-elements-green-200)}:host(.error){background-color:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host(.warning){background-color:var(--zonos-elements-orange-100);border:1px solid var(--zonos-elements-orange-200)}";
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-d82f06f2.js';
2
- import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-71d7e02f.js';
2
+ import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { g as getBorderRadius } from './getBorderRadius-740610fb.js';
4
+ import { g as getBorderRadius } from './getBorderRadius-ada3ccad.js';
5
5
  import { i as isColorVariable } from './isColorVariable-0a94004f.js';
6
- import { i as isDarkColor } from './isDarkColor-2f59d721.js';
6
+ import { i as isDarkColor } from './isDarkColor-446fccb7.js';
7
7
  import { s as styles } from './styles-6fc2fad9.js';
8
8
 
9
9
  /**
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-d82f06f2.js';
2
- import { d as zonosStoreFontFamily } from './zonosStore-71d7e02f.js';
2
+ import { d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { g as getBorderRadius } from './getBorderRadius-740610fb.js';
4
+ import { g as getBorderRadius } from './getBorderRadius-ada3ccad.js';
5
5
 
6
6
  const zonosCardCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--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(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));padding:var(--spacing, 24px);text-align:left;background-color:var(--zonos--background-color);overflow:hidden}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-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, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";
7
7
  const ZonosCardStyle0 = zonosCardCss;
@@ -1,14 +1,14 @@
1
1
  import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-d82f06f2.js';
2
- import { e as cartStore, E as currencyFormat, r as translate, M as cartStoreHasOneEligibleItem, N as stripeStoreApplyPromoCode, O as stripeStoreRemovePromoCode, f as stripeStore, C as stripeStoreReset, d as stripeStoreRetrievePayment, t as trackConversionEvent, P as stripeStoreResetPromoCode, Q as stripeStoreMessageBasedOnStatus, l as localizationStore, x as cartStoreNextStep, R as stripeStoreTranslateAddressToLatin, S as cartStoreUpdateSelectedShippingOption, T as cartStoreGetShippingTransitInfo, U as sortServiceLevelOptionsByAmount } from './cart-f2f5f13f.js';
2
+ import { e as cartStore, E as currencyFormat, r as translate, M as cartStoreHasOneEligibleItem, N as stripeStoreApplyPromoCode, O as stripeStoreRemovePromoCode, f as stripeStore, C as stripeStoreReset, d as stripeStoreRetrievePayment, t as trackConversionEvent, P as stripeStoreResetPromoCode, Q as stripeStoreMessageBasedOnStatus, l as localizationStore, x as cartStoreNextStep, R as stripeStoreTranslateAddressToLatin, S as cartStoreUpdateSelectedShippingOption, T as cartStoreGetShippingTransitInfo, U as sortServiceLevelOptionsByAmount } from './cart-b2e57589.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { s as submitGtag, c as paypalStoreReset, b as paypalStore, i as isContrastColor } from './paypal-7d253663.js';
5
- import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-71d7e02f.js';
6
- import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, g as getIsTestMode, d as allLogs, b as logError, a as getIsStagingMode } from './handleFetch-b4633675.js';
4
+ import { s as submitGtag, c as paypalStoreReset, b as paypalStore, i as isContrastColor } from './paypal-38da5d52.js';
5
+ import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
6
+ import { h as handleFetch, l as log, s as sendErrorLog, j as jsonParse, g as getIsTestMode, d as allLogs, b as logError, a as getIsStagingMode } from './handleFetch-8d72c8cd.js';
7
7
  import { c as createCustomEvent } from './createCustomEvent-58159025.js';
8
- import { g as getBorderRadius } from './getBorderRadius-740610fb.js';
8
+ import { g as getBorderRadius } from './getBorderRadius-ada3ccad.js';
9
9
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
10
10
  import { l as languages } from './ILanguage-cd6acb72.js';
11
- import { i as isDarkColor, t as tinycolor } from './isDarkColor-2f59d721.js';
11
+ import { i as isDarkColor, t as tinycolor } from './isDarkColor-446fccb7.js';
12
12
  import { i as isColorVariable } from './isColorVariable-0a94004f.js';
13
13
  import { c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
14
14
  import { c as countryRequireTaxId, s as shipToTaxIdLabels } from './TaxId-915ef042.js';
@@ -1,15 +1,15 @@
1
1
  import { r as registerInstance, h, H as Host, F as Fragment } from './index-d82f06f2.js';
2
- import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as stripeStoreRetrievePayment, e as cartStore, f as stripeStore, g as cartStoreUpdateItems, h as cartStoreReset, j as cartStoreResetTabItems, k as cartStoreClearCheckoutInterval, m as stripeStoreInitCheckoutSession, n as stripeStoreGetPaymentIntent, o as cartStoreStartCheckoutInterval, t as trackConversionEvent, p as getCheckoutSessionBody, q as cartStoreUpdateToErrorState, r as translate, u as getZCountryUrlParam, v as cartStoreSetCheckoutSession, w as stripeStorePrefetchLandedCost, x as cartStoreNextStep, y as stripeStoreUpdateCheckoutSessionBaseCurrency, z as stripeStoreHandleInventoryCheck, A as stripeStoreConfirmPayment, B as stripeStoreHandleInventoryRefund, C as stripeStoreReset, D as localizationStoreOnUpdate, E as currencyFormat } from './cart-f2f5f13f.js';
3
- import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript, b as paypalStore } from './paypal-7d253663.js';
4
- import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-71d7e02f.js';
5
- import { h as handleFetch, l as log, b as logError, s as sendErrorLog, c as getElapsedTime, d as allLogs, g as getIsTestMode, j as jsonParse, a as getIsStagingMode } from './handleFetch-b4633675.js';
2
+ import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as stripeStoreRetrievePayment, e as cartStore, f as stripeStore, g as cartStoreUpdateItems, h as cartStoreReset, j as cartStoreResetTabItems, k as cartStoreClearCheckoutInterval, m as stripeStoreInitCheckoutSession, n as stripeStoreGetPaymentIntent, o as cartStoreStartCheckoutInterval, t as trackConversionEvent, p as getCheckoutSessionBody, q as cartStoreUpdateToErrorState, r as translate, u as getZCountryUrlParam, v as cartStoreSetCheckoutSession, w as stripeStorePrefetchLandedCost, x as cartStoreNextStep, y as stripeStoreUpdateCheckoutSessionBaseCurrency, z as stripeStoreHandleInventoryCheck, A as stripeStoreConfirmPayment, B as stripeStoreHandleInventoryRefund, C as stripeStoreReset, D as localizationStoreOnUpdate, E as currencyFormat } from './cart-b2e57589.js';
3
+ import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript, b as paypalStore } from './paypal-38da5d52.js';
4
+ import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-d3c5a0a5.js';
5
+ import { h as handleFetch, l as log, b as logError, s as sendErrorLog, c as getElapsedTime, d as allLogs, e as getAdditionalLogMetadata, g as getIsTestMode, j as jsonParse, a as getIsStagingMode } from './handleFetch-8d72c8cd.js';
6
6
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
7
7
  import { c as classes } from './classes-0d95c529.js';
8
8
  import { c as createCustomEvent } from './createCustomEvent-58159025.js';
9
- import { g as getBorderRadius } from './getBorderRadius-740610fb.js';
10
- import { i as isDarkColor } from './isDarkColor-2f59d721.js';
9
+ import { g as getBorderRadius } from './getBorderRadius-ada3ccad.js';
10
+ import { i as isDarkColor } from './isDarkColor-446fccb7.js';
11
11
  import { s as styles } from './styles-6fc2fad9.js';
12
- import { c as checkoutHiddenBtnSelector, s as setupCartData, d as domesticRedirectedBtnSelector } from './CheckoutConfig-646aae20.js';
12
+ import { c as checkoutHiddenBtnSelector, s as setupCartData, d as domesticRedirectedBtnSelector } from './CheckoutConfig-2994efd9.js';
13
13
  import { R as RemoveIcon } from './RemoveIcon-9dc5dd1a.js';
14
14
 
15
15
  /**
@@ -180,40 +180,6 @@ const watchBigcommerceDomesticCheckout = ({ domesticRedirectedBtnSelector, onShi
180
180
  });
181
181
  };
182
182
 
183
- const getNavigatorConnection = () => {
184
- const connection = 'connection' in window.navigator
185
- ? // connection is not yet supported in all browsers
186
- window.navigator.connection
187
- : null;
188
- const mozConnection = 'mozConnection' in window.navigator
189
- ? // mozConnection is not yet supported in all browsers
190
- window.navigator.mozConnection
191
- : null;
192
- const webkitConnection = 'webkitConnection' in window.navigator
193
- ? // webkitConnection is not yet supported in all browsers
194
- window.navigator.webkitConnection
195
- : null;
196
- const baseConnection = connection || mozConnection || webkitConnection;
197
- return baseConnection;
198
- };
199
-
200
- const getAdditionalLogMetadata = () => {
201
- const userAgentData = 'userAgentData' in window.navigator
202
- ? // userAgentData is not yet supported in all browsers
203
- window.navigator.userAgentData
204
- : null;
205
- const baseConnection = getNavigatorConnection();
206
- return {
207
- connectionDownlink: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.downlink,
208
- connectionEffectiveType: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.effectiveType,
209
- connectionRtt: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.rtt,
210
- connectionSaveData: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.saveData,
211
- userAgent: userAgentData && userAgentData.brands.length > 0
212
- ? userAgentData
213
- : window.navigator.userAgent,
214
- };
215
- };
216
-
217
183
  const sendLoadCheckoutFacadeLog = async () => {
218
184
  const { elapsedTime } = getElapsedTime();
219
185
  const scriptLoadLogBody = {
@@ -232,6 +198,23 @@ const sendLoadCheckoutFacadeLog = async () => {
232
198
  });
233
199
  };
234
200
 
201
+ const sendLoadNativeCheckoutLog = async ({ loadTime, }) => {
202
+ const scriptLoadLogBody = {
203
+ cache: 'miss',
204
+ eventName: 'jsdelivr',
205
+ flag: 'LOG_NATIVE_CHECKOUT_LOAD',
206
+ href: window.location.href,
207
+ loadTime,
208
+ metadata: Object.assign({ allLogs }, getAdditionalLogMetadata()),
209
+ scriptLoadUrl: 'nativeCheckout',
210
+ storeId: window.Zonos.storeId,
211
+ };
212
+ void handleFetch('/api/zonos-elements/log-script-load', {
213
+ body: scriptLoadLogBody,
214
+ method: 'POST',
215
+ });
216
+ };
217
+
235
218
  const MessageIcon = `<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">
236
219
  <path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>
237
220
  </svg>
@@ -629,6 +612,8 @@ const ZonosCheckout = class {
629
612
  });
630
613
  button.addEventListener('click', async (e) => {
631
614
  var _a;
615
+ // Start tracking load time
616
+ const startTime = performance.now();
632
617
  // Allow no country set for legacy facades. Otherwise enforce it being a shippable country and not disabled.
633
618
  if (!window.Zonos.isLegacyCheckout &&
634
619
  (!isShippableCountry() || isDisabledCountry())) {
@@ -677,6 +662,11 @@ const ZonosCheckout = class {
677
662
  if (window.Zonos.isLegacyCheckout) {
678
663
  void sendLoadCheckoutFacadeLog();
679
664
  }
665
+ else {
666
+ const endTime = performance.now();
667
+ const loadTime = endTime - startTime;
668
+ void sendLoadNativeCheckoutLog({ loadTime });
669
+ }
680
670
  }
681
671
  catch (err) {
682
672
  // stop loading
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-d82f06f2.js';
2
- import { d as zonosStoreFontFamily } from './zonosStore-71d7e02f.js';
2
+ import { d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
3
3
 
4
4
  const zonosCollapseCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--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{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";
5
5
  const ZonosCollapseStyle0 = zonosCollapseCss;
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-d82f06f2.js';
2
- import { G as isValidSelector, f as stripeStore, H as initLocalizationStore, e as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-f2f5f13f.js';
3
- import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-71d7e02f.js';
4
- import { h as handleFetch, b as logError, l as log } from './handleFetch-b4633675.js';
5
- import './isDarkColor-2f59d721.js';
6
- import './getBorderRadius-740610fb.js';
2
+ import { G as isValidSelector, f as stripeStore, H as initLocalizationStore, e as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-b2e57589.js';
3
+ import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
4
+ import { h as handleFetch, b as logError, l as log } from './handleFetch-8d72c8cd.js';
5
+ import './isDarkColor-446fccb7.js';
6
+ import './getBorderRadius-ada3ccad.js';
7
7
 
8
8
  const getZonosSettings = async () => {
9
9
  const { errors, json, zonosMode } = await handleFetch('/api/zonos-elements/zonos-settings');
@@ -296,6 +296,8 @@ const ZonosController = class {
296
296
  ? Object.assign(Object.assign({}, this.config.checkoutSettings), {
297
297
  // Don't allow to override settlement currencies setting. This setting is only configured by Zonos
298
298
  allowedSettlementCurrencies: undefined,
299
+ // Don't allow to override capture delay setting. This setting is only configured by Zonos
300
+ captureDelay: undefined,
299
301
  // Don't allow to override subscription status
300
302
  subscriptionStatus: undefined,
301
303
  // Set success redirect url to store url if it's legacy checkout.
@@ -396,7 +398,7 @@ const ZonosController = class {
396
398
  zonosStore.organizationName = organizationName;
397
399
  }
398
400
  render() {
399
- return h(Host, { key: '14d142f73eae70c229b638ef298e20c9c7c5713d', class: "zonos--elements" });
401
+ return h(Host, { key: 'eed6d0d8b034a43bb4bccf5937b8eccc5d5744c9', class: "zonos--elements" });
400
402
  }
401
403
  };
402
404
  ZonosController.style = ZonosControllerStyle0;
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-d82f06f2.js';
2
- import { l as localizationStore } from './cart-f2f5f13f.js';
3
- import { d as zonosStoreFontFamily } from './zonosStore-71d7e02f.js';
2
+ import { l as localizationStore } from './cart-b2e57589.js';
3
+ import { d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
- import './handleFetch-b4633675.js';
6
- import './isDarkColor-2f59d721.js';
7
- import './getBorderRadius-740610fb.js';
5
+ import './handleFetch-8d72c8cd.js';
6
+ import './isDarkColor-446fccb7.js';
7
+ import './getBorderRadius-ada3ccad.js';
8
8
 
9
9
  const zonosCountryFlagCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--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}";
10
10
  const ZonosCountryFlagStyle0 = zonosCountryFlagCss;
@@ -1,11 +1,11 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-d82f06f2.js';
2
- import { a as localizationStoreUpdateSelectedCountryCode, r as translate, l as localizationStore } from './cart-f2f5f13f.js';
3
- import { d as zonosStoreFontFamily } from './zonosStore-71d7e02f.js';
2
+ import { a as localizationStoreUpdateSelectedCountryCode, r as translate, l as localizationStore } from './cart-b2e57589.js';
3
+ import { d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
4
4
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
5
- import { i as isDarkColor } from './isDarkColor-2f59d721.js';
5
+ import { i as isDarkColor } from './isDarkColor-446fccb7.js';
6
6
  import { l as languages } from './ILanguage-cd6acb72.js';
7
- import './handleFetch-b4633675.js';
8
- import './getBorderRadius-740610fb.js';
7
+ import './handleFetch-8d72c8cd.js';
8
+ import './getBorderRadius-ada3ccad.js';
9
9
 
10
10
  /**
11
11
  * Fuse.js v7.0.0 - Lightweight fuzzy-search (http://fusejs.io)
@@ -1,11 +1,11 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement, c as createEvent } from './index-d82f06f2.js';
2
- import { d as zonosStoreFontFamily } from './zonosStore-71d7e02f.js';
2
+ import { d as zonosStoreFontFamily } from './zonosStore-d3c5a0a5.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { g as getBorderRadius } from './getBorderRadius-740610fb.js';
5
- import { f as stripeStore } from './cart-f2f5f13f.js';
6
- import { b as logError, l as log } from './handleFetch-b4633675.js';
7
- import { d as paypalStoreInitButtons } from './paypal-7d253663.js';
8
- import './isDarkColor-2f59d721.js';
4
+ import { g as getBorderRadius } from './getBorderRadius-ada3ccad.js';
5
+ import { f as stripeStore } from './cart-b2e57589.js';
6
+ import { b as logError, l as log } from './handleFetch-8d72c8cd.js';
7
+ import { d as paypalStoreInitButtons } from './paypal-38da5d52.js';
8
+ import './isDarkColor-446fccb7.js';
9
9
 
10
10
  const PaymentEmptyStateDarkIcon = `<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">
11
11
  <mask id="mask0_3739_19124" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">
@@ -1,12 +1,12 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-d82f06f2.js';
2
- import { r as translate, l as localizationStore, E as currencyFormat } from './cart-f2f5f13f.js';
3
- import { z as zonosStore } from './zonosStore-71d7e02f.js';
2
+ import { r as translate, l as localizationStore, E as currencyFormat } from './cart-b2e57589.js';
3
+ import { z as zonosStore } from './zonosStore-d3c5a0a5.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
5
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
6
6
  import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
7
- import './handleFetch-b4633675.js';
8
- import './isDarkColor-2f59d721.js';
9
- import './getBorderRadius-740610fb.js';
7
+ import './handleFetch-8d72c8cd.js';
8
+ import './isDarkColor-446fccb7.js';
9
+ import './getBorderRadius-ada3ccad.js';
10
10
 
11
11
  const getHasMoreSpaceAbove = (ref) => {
12
12
  const componentRect = ref.getBoundingClientRect();