@zonos/elements 1.3.222 → 1.3.224

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 (265) hide show
  1. package/dist/cjs/VarianceTest-bec00ea8.js +91 -0
  2. package/dist/cjs/{cart-3a2a062c.js → cart-af017ac3.js} +41 -40
  3. package/dist/cjs/{debounce-465a4328.js → debounce-2c9f3f1e.js} +1 -1
  4. package/dist/cjs/{getBorderRadius-1b5e33cf.js → getBorderRadius-c7d9f676.js} +1 -1
  5. package/dist/cjs/{handleFetch-45f35cac.js → handleFetch-954f30e1.js} +5 -82
  6. package/dist/cjs/index.cjs.js +40 -37
  7. package/dist/cjs/{isDarkColor-428965f4.js → isDarkColor-994c38e4.js} +1 -1
  8. package/dist/cjs/{localization-12e7e934.js → localization-21030292.js} +82 -24
  9. package/dist/cjs/{paypal-a1377508.js → paypal-2b22f0f5.js} +17 -16
  10. package/dist/cjs/{placeTestOrder-6fcce33e.js → placeTestOrder-9cde1ca4.js} +3 -3
  11. package/dist/cjs/{renderFallback-39ba034b.js → renderFallback-9300dbaf.js} +8 -7
  12. package/dist/cjs/{translationStore-951ed4b4.js → translationStore-ce2c700d.js} +1 -1
  13. package/dist/cjs/{updateCheckoutSessionAttributes-c0853fdd.js → updateCheckoutSessionAttributes-a4899e90.js} +2 -2
  14. package/dist/cjs/zonos-address_11.cjs.entry.js +16 -16
  15. package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
  16. package/dist/cjs/zonos-banner_2.cjs.entry.js +3 -3
  17. package/dist/cjs/zonos-button_3.cjs.entry.js +4 -4
  18. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +25 -25
  19. package/dist/cjs/zonos-checkout.cjs.entry.js +68 -67
  20. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  21. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +8 -8
  22. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +19 -19
  23. package/dist/cjs/zonos-collect.cjs.entry.js +21 -21
  24. package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +4 -4
  25. package/dist/cjs/zonos-controller.cjs.entry.js +40 -39
  26. package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
  27. package/dist/cjs/zonos-country-select_4.cjs.entry.js +6 -6
  28. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +14 -14
  29. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
  30. package/dist/cjs/zonos-hello.cjs.entry.js +12 -12
  31. package/dist/cjs/zonos-input.cjs.entry.js +3 -3
  32. package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -5
  33. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  34. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
  35. package/dist/cjs/zonos-stripe-input.cjs.entry.js +5 -5
  36. package/dist/cjs/zonos-text.cjs.entry.js +2 -2
  37. package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
  38. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  39. package/dist/cjs/{zonosStore-f8ee56aa.js → zonosStore-5d489c65.js} +8 -2
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +4 -0
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -0
  42. package/dist/collection/components/checkout/zonos-collect/zonos-collect.css +3 -1
  43. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.css +1 -0
  44. package/dist/collection/components/main/zonos-controller.js +1 -1
  45. package/dist/collection/components/store/hello/localization.js +12 -9
  46. package/dist/collection/components/store/zonosStore.js +8 -1
  47. package/dist/collection/components/utils/api/getZonosSettings.js +2 -0
  48. package/dist/collection/components/utils/hello/currencyConversion/currencyDisplay.js +2 -0
  49. package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +5 -0
  50. package/dist/collection/components/utils/logging/sendLoadCheckoutFacadeLog.js +1 -1
  51. package/dist/collection/components/utils/logging/sendLoadNativeCheckoutLog.js +1 -1
  52. package/dist/collection/scripts/_zonosBase.js +3 -0
  53. package/dist/collection/types/generated/graphql.internal.types.js +3 -0
  54. package/dist/collection/utils/performBlurCurrency.js +50 -0
  55. package/dist/esm/VarianceTest-572cecf5.js +86 -0
  56. package/dist/esm/{cart-7f06662c.js → cart-11b87221.js} +7 -6
  57. package/dist/esm/{debounce-c34d1270.js → debounce-f081e4d8.js} +1 -1
  58. package/dist/esm/{getBorderRadius-87593ff4.js → getBorderRadius-6281d902.js} +1 -1
  59. package/dist/esm/{handleFetch-99218189.js → handleFetch-a844cac1.js} +2 -76
  60. package/dist/esm/index.js +13 -9
  61. package/dist/esm/{isDarkColor-1f58b6be.js → isDarkColor-83e0c27e.js} +1 -1
  62. package/dist/esm/{localization-192886e4.js → localization-9320a65d.js} +71 -13
  63. package/dist/esm/{paypal-53f1b4a1.js → paypal-338a4350.js} +7 -6
  64. package/dist/esm/{placeTestOrder-95cbb623.js → placeTestOrder-d28f33c2.js} +3 -3
  65. package/dist/esm/{renderFallback-6352363c.js → renderFallback-28ef3364.js} +5 -4
  66. package/dist/esm/{translationStore-fb98a08d.js → translationStore-7eebaa41.js} +1 -1
  67. package/dist/esm/{updateCheckoutSessionAttributes-92f42882.js → updateCheckoutSessionAttributes-160720f6.js} +2 -2
  68. package/dist/esm/zonos-address_11.entry.js +9 -9
  69. package/dist/esm/zonos-badge.entry.js +2 -2
  70. package/dist/esm/zonos-banner_2.entry.js +3 -3
  71. package/dist/esm/zonos-button_3.entry.js +4 -4
  72. package/dist/esm/zonos-cart-items_12.entry.js +12 -12
  73. package/dist/esm/zonos-checkout.entry.js +15 -14
  74. package/dist/esm/zonos-collapse.entry.js +2 -2
  75. package/dist/esm/zonos-collect-cart-items_3.entry.js +8 -8
  76. package/dist/esm/zonos-collect-finish_6.entry.js +11 -11
  77. package/dist/esm/zonos-collect.entry.js +11 -11
  78. package/dist/esm/zonos-confirm-dialog_2.entry.js +4 -4
  79. package/dist/esm/zonos-controller.entry.js +10 -9
  80. package/dist/esm/zonos-country-flag.entry.js +5 -5
  81. package/dist/esm/zonos-country-select_4.entry.js +6 -6
  82. package/dist/esm/zonos-empty-state-payment_4.entry.js +9 -9
  83. package/dist/esm/zonos-hello-dialog.entry.js +5 -5
  84. package/dist/esm/zonos-hello.entry.js +6 -6
  85. package/dist/esm/zonos-input.entry.js +3 -3
  86. package/dist/esm/zonos-language-select_2.entry.js +5 -5
  87. package/dist/esm/zonos-logo.entry.js +2 -2
  88. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
  89. package/dist/esm/zonos-stripe-input.entry.js +5 -5
  90. package/dist/esm/zonos-text.entry.js +2 -2
  91. package/dist/esm/zonos-toggle.entry.js +2 -2
  92. package/dist/esm/zonos-v-stack.entry.js +2 -2
  93. package/dist/esm/{zonosStore-c456b933.js → zonosStore-e3d0493a.js} +8 -2
  94. package/dist/esm-es5/VarianceTest-572cecf5.js +1 -0
  95. package/dist/esm-es5/cart-11b87221.js +1 -0
  96. package/dist/esm-es5/{debounce-c34d1270.js → debounce-f081e4d8.js} +1 -1
  97. package/dist/esm-es5/{getBorderRadius-87593ff4.js → getBorderRadius-6281d902.js} +1 -1
  98. package/dist/esm-es5/handleFetch-a844cac1.js +1 -0
  99. package/dist/esm-es5/index.js +1 -1
  100. package/dist/esm-es5/{isDarkColor-1f58b6be.js → isDarkColor-83e0c27e.js} +1 -1
  101. package/dist/esm-es5/localization-9320a65d.js +1 -0
  102. package/dist/esm-es5/{paypal-53f1b4a1.js → paypal-338a4350.js} +2 -2
  103. package/dist/esm-es5/{placeTestOrder-95cbb623.js → placeTestOrder-d28f33c2.js} +1 -1
  104. package/dist/esm-es5/renderFallback-28ef3364.js +1 -0
  105. package/dist/esm-es5/{translationStore-fb98a08d.js → translationStore-7eebaa41.js} +1 -1
  106. package/dist/esm-es5/{updateCheckoutSessionAttributes-92f42882.js → updateCheckoutSessionAttributes-160720f6.js} +1 -1
  107. package/dist/esm-es5/zonos-address_11.entry.js +1 -1
  108. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  109. package/dist/esm-es5/zonos-banner_2.entry.js +1 -1
  110. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  111. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  112. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  113. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  114. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  115. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  116. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  117. package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +1 -1
  118. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  119. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  120. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  121. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  122. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  123. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  124. package/dist/esm-es5/zonos-input.entry.js +1 -1
  125. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  126. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  127. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  128. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  129. package/dist/esm-es5/zonos-text.entry.js +1 -1
  130. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  131. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  132. package/dist/esm-es5/zonosStore-e3d0493a.js +1 -0
  133. package/dist/scripts/blurCurrencyOnInit.js +1 -0
  134. package/dist/scripts/index.d.ts +38 -6
  135. package/dist/scripts/index.js +1 -1
  136. package/dist/scripts/loadZonos.js +1 -1
  137. package/dist/scripts/zonos.js +1 -1
  138. package/dist/types/scripts/_zonosBase.d.ts +8 -3
  139. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +7 -3
  140. package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +2 -2
  141. package/dist/types/types/generated/graphql.internal.types.d.ts +13 -2
  142. package/dist/types/types/generated/graphql.internal.types.ts +13 -2
  143. package/dist/types/types/global.d.ts +8 -0
  144. package/dist/types/types/utils/ZonosSettings.d.ts +8 -2
  145. package/dist/types/utils/performBlurCurrency.d.ts +2 -0
  146. package/dist/zonos-elements/base.css +1 -0
  147. package/dist/zonos-elements/index.esm.js +1 -1
  148. package/dist/zonos-elements/p-01174496.system.js +1 -0
  149. package/dist/zonos-elements/p-0260fd13.js +1 -0
  150. package/dist/zonos-elements/{p-e970f2aa.system.entry.js → p-04c1dc63.system.entry.js} +1 -1
  151. package/dist/zonos-elements/p-0a377722.js +1 -0
  152. package/dist/zonos-elements/p-0a92e3fd.entry.js +1 -0
  153. package/dist/zonos-elements/{p-8350937d.system.entry.js → p-0b6a3a09.system.entry.js} +1 -1
  154. package/dist/zonos-elements/p-0d82e1fd.entry.js +1 -0
  155. package/dist/zonos-elements/{p-a7485913.system.js → p-0ec82d78.system.js} +2 -2
  156. package/dist/zonos-elements/{p-2b9c124d.js → p-0ffd710e.js} +1 -1
  157. package/dist/zonos-elements/p-112c6453.system.js +1 -0
  158. package/dist/zonos-elements/{p-62fa680d.system.js → p-182da73f.system.js} +1 -1
  159. package/dist/zonos-elements/p-1868a283.entry.js +1 -0
  160. package/dist/zonos-elements/{p-ba18c5f5.system.entry.js → p-1a67ae71.system.entry.js} +1 -1
  161. package/dist/zonos-elements/{p-520bd291.system.entry.js → p-1b9cc0e2.system.entry.js} +1 -1
  162. package/dist/zonos-elements/p-1c5ba523.js +1 -0
  163. package/dist/zonos-elements/p-1ef793d0.entry.js +1 -0
  164. package/dist/zonos-elements/{p-0ed63ce0.system.js → p-23c46dfa.system.js} +1 -1
  165. package/dist/zonos-elements/{p-e7f8595f.system.js → p-24e26a2c.system.js} +1 -1
  166. package/dist/zonos-elements/p-252fa1da.entry.js +1 -0
  167. package/dist/zonos-elements/{p-53b46925.entry.js → p-2616ba72.entry.js} +1 -1
  168. package/dist/zonos-elements/p-2657f099.system.entry.js +1 -0
  169. package/dist/zonos-elements/{p-7d2d2c94.entry.js → p-2dc38ef3.entry.js} +1 -1
  170. package/dist/zonos-elements/{p-12ce9746.system.entry.js → p-360d7101.system.entry.js} +1 -1
  171. package/dist/zonos-elements/{p-19f25feb.system.entry.js → p-375994d1.system.entry.js} +1 -1
  172. package/dist/zonos-elements/{p-ee6f8c02.system.entry.js → p-38f42f10.system.entry.js} +1 -1
  173. package/dist/zonos-elements/{p-4637f365.system.entry.js → p-4004c838.system.entry.js} +1 -1
  174. package/dist/zonos-elements/p-41dd1cb8.js +1 -0
  175. package/dist/zonos-elements/{p-e63b8b24.system.js → p-433d76b4.system.js} +1 -1
  176. package/dist/zonos-elements/{p-a77ed1b9.entry.js → p-4523b982.entry.js} +1 -1
  177. package/dist/zonos-elements/{p-fc27467b.entry.js → p-4ce3489a.entry.js} +1 -1
  178. package/dist/zonos-elements/{p-a61a9b65.system.entry.js → p-4da7b6a8.system.entry.js} +1 -1
  179. package/dist/zonos-elements/{p-7b56e345.js → p-4dfe97ad.js} +2 -2
  180. package/dist/zonos-elements/{p-cd1ebef9.system.js → p-57413c34.system.js} +1 -1
  181. package/dist/zonos-elements/{p-4d9ad3b1.system.entry.js → p-576d76fa.system.entry.js} +1 -1
  182. package/dist/zonos-elements/p-5c43ecdf.system.entry.js +1 -0
  183. package/dist/zonos-elements/{p-9fdd3264.system.entry.js → p-5f7a9b69.system.entry.js} +1 -1
  184. package/dist/zonos-elements/p-6092af05.entry.js +1 -0
  185. package/dist/zonos-elements/{p-9b062dfb.entry.js → p-67787bd4.entry.js} +1 -1
  186. package/dist/zonos-elements/{p-7c4e7651.entry.js → p-6bab9096.entry.js} +1 -1
  187. package/dist/zonos-elements/p-6d423364.entry.js +1 -0
  188. package/dist/zonos-elements/p-725605f6.system.js +1 -0
  189. package/dist/zonos-elements/p-7af39c98.js +1 -0
  190. package/dist/zonos-elements/{p-7f7abdf2.system.entry.js → p-7cee0e68.system.entry.js} +1 -1
  191. package/dist/zonos-elements/p-7eb8e2d4.js +1 -0
  192. package/dist/zonos-elements/p-81b357f7.system.js +1 -1
  193. package/dist/zonos-elements/p-820ad058.js +1 -0
  194. package/dist/zonos-elements/{p-5e3d2bd2.system.entry.js → p-873b6185.system.entry.js} +1 -1
  195. package/dist/zonos-elements/p-89c5164b.system.js +1 -0
  196. package/dist/zonos-elements/p-91f32c73.system.js +1 -0
  197. package/dist/zonos-elements/{p-245f6ad4.system.entry.js → p-9e03a145.system.entry.js} +1 -1
  198. package/dist/zonos-elements/{p-0ae53ff0.js → p-a199bb13.js} +1 -1
  199. package/dist/zonos-elements/p-ae3e4f2b.entry.js +1 -0
  200. package/dist/zonos-elements/{p-567f7de7.entry.js → p-b4bf2f03.entry.js} +1 -1
  201. package/dist/zonos-elements/p-b5b3f908.system.js +1 -0
  202. package/dist/zonos-elements/{p-a5b0a636.entry.js → p-b658c28a.entry.js} +1 -1
  203. package/dist/zonos-elements/{p-de626806.system.entry.js → p-b6ef4a5e.system.entry.js} +1 -1
  204. package/dist/zonos-elements/{p-4f8563ad.system.entry.js → p-b91df44b.system.entry.js} +1 -1
  205. package/dist/zonos-elements/p-ba334962.system.entry.js +1 -0
  206. package/dist/zonos-elements/p-bccd49d7.system.entry.js +1 -0
  207. package/dist/zonos-elements/p-bdeb20cb.js +1 -0
  208. package/dist/zonos-elements/{p-a95d2034.system.entry.js → p-bfc0fc85.system.entry.js} +1 -1
  209. package/dist/zonos-elements/{p-c4b3c878.entry.js → p-c81f6387.entry.js} +1 -1
  210. package/dist/zonos-elements/{p-efa6203f.entry.js → p-c998e4ed.entry.js} +1 -1
  211. package/dist/zonos-elements/{p-9396059b.entry.js → p-cb0e6468.entry.js} +1 -1
  212. package/dist/zonos-elements/{p-421dfb66.system.entry.js → p-cb11d11b.system.entry.js} +1 -1
  213. package/dist/zonos-elements/p-cc599cd9.entry.js +1 -0
  214. package/dist/zonos-elements/p-ce4c6ae0.entry.js +1 -0
  215. package/dist/zonos-elements/{p-14f9bc8c.entry.js → p-d2f7ea09.entry.js} +1 -1
  216. package/dist/zonos-elements/{p-0c0fda23.js → p-d42b5113.js} +1 -1
  217. package/dist/zonos-elements/{p-00423fa0.system.js → p-d531b524.system.js} +1 -1
  218. package/dist/zonos-elements/p-d938f42f.system.js +1 -0
  219. package/dist/zonos-elements/{p-f4fa8720.entry.js → p-d96545ae.entry.js} +1 -1
  220. package/dist/zonos-elements/{p-eb6a35ce.system.entry.js → p-dc56b469.system.entry.js} +1 -1
  221. package/dist/zonos-elements/{p-45d288d0.system.entry.js → p-e00e5d64.system.entry.js} +1 -1
  222. package/dist/zonos-elements/{p-8194fcd8.entry.js → p-e60b988c.entry.js} +1 -1
  223. package/dist/zonos-elements/{p-56e0ed65.js → p-e688e493.js} +1 -1
  224. package/dist/zonos-elements/{p-295d9c07.system.entry.js → p-f548807d.system.entry.js} +1 -1
  225. package/dist/zonos-elements/{p-e7b05da2.entry.js → p-f912e9c3.entry.js} +1 -1
  226. package/dist/zonos-elements/zonos-elements.css +1 -1
  227. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  228. package/package.json +4 -3
  229. package/dist/cjs/VarianceTest-0cb1e118.js +0 -12
  230. package/dist/esm/VarianceTest-fef2d958.js +0 -10
  231. package/dist/esm-es5/VarianceTest-fef2d958.js +0 -1
  232. package/dist/esm-es5/cart-7f06662c.js +0 -1
  233. package/dist/esm-es5/handleFetch-99218189.js +0 -1
  234. package/dist/esm-es5/localization-192886e4.js +0 -1
  235. package/dist/esm-es5/renderFallback-6352363c.js +0 -1
  236. package/dist/esm-es5/zonosStore-c456b933.js +0 -1
  237. package/dist/zonos-elements/p-04a01cb1.js +0 -1
  238. package/dist/zonos-elements/p-062430f9.system.js +0 -1
  239. package/dist/zonos-elements/p-0e28207a.js +0 -1
  240. package/dist/zonos-elements/p-1cd1da90.system.js +0 -1
  241. package/dist/zonos-elements/p-2131fa8b.entry.js +0 -1
  242. package/dist/zonos-elements/p-30432622.system.entry.js +0 -1
  243. package/dist/zonos-elements/p-366ea017.entry.js +0 -1
  244. package/dist/zonos-elements/p-3a15f2fb.system.entry.js +0 -1
  245. package/dist/zonos-elements/p-3f3c92db.system.entry.js +0 -1
  246. package/dist/zonos-elements/p-4a3abbf2.js +0 -1
  247. package/dist/zonos-elements/p-4dcbbd60.js +0 -1
  248. package/dist/zonos-elements/p-5a2dd041.system.js +0 -1
  249. package/dist/zonos-elements/p-640a6898.system.js +0 -1
  250. package/dist/zonos-elements/p-6afbbe66.entry.js +0 -1
  251. package/dist/zonos-elements/p-6f6573a5.system.js +0 -1
  252. package/dist/zonos-elements/p-7ce093aa.js +0 -1
  253. package/dist/zonos-elements/p-81b94b8f.system.js +0 -1
  254. package/dist/zonos-elements/p-838e448f.entry.js +0 -1
  255. package/dist/zonos-elements/p-9d863a3b.system.js +0 -1
  256. package/dist/zonos-elements/p-a435931e.system.entry.js +0 -1
  257. package/dist/zonos-elements/p-a8a312b2.js +0 -1
  258. package/dist/zonos-elements/p-a9b3cfe1.entry.js +0 -1
  259. package/dist/zonos-elements/p-abcefd25.entry.js +0 -1
  260. package/dist/zonos-elements/p-b76db2ac.js +0 -1
  261. package/dist/zonos-elements/p-bbf48b31.entry.js +0 -1
  262. package/dist/zonos-elements/p-bdf183a3.entry.js +0 -1
  263. package/dist/zonos-elements/p-d1b415cd.entry.js +0 -1
  264. package/dist/zonos-elements/p-d2098bef.entry.js +0 -1
  265. package/dist/zonos-elements/p-df0cbde4.js +0 -1
@@ -0,0 +1,91 @@
1
+ 'use strict';
2
+
3
+ const startTime = performance.now();
4
+ const allLogs = [];
5
+ const getElapsedTime = () => {
6
+ const elapsedTime = performance.now() - startTime;
7
+ const elapsedTimePretty =
8
+ // format the time to seconds if over 1 second
9
+ elapsedTime > 1000
10
+ ? `${(elapsedTime / 1000).toFixed(2)}s`
11
+ : `${elapsedTime.toFixed(2)}ms`;
12
+ return { elapsedTime, elapsedTimePretty };
13
+ };
14
+ const prepInfo = (info) => {
15
+ if (typeof info === 'string') {
16
+ return info;
17
+ }
18
+ try {
19
+ const infoToJson = JSON.stringify(info);
20
+ return infoToJson;
21
+ }
22
+ catch (_a) {
23
+ if (info && typeof info.toString === 'function') {
24
+ const infoToString = info.toString();
25
+ return infoToString;
26
+ }
27
+ return 'Unable to stringify info';
28
+ }
29
+ };
30
+ const log = (message, type, ..._additionalInfo) => {
31
+ var _a, _b;
32
+ const { elapsedTimePretty } = getElapsedTime();
33
+ const additionalInfo = [`(${elapsedTimePretty})`, ..._additionalInfo];
34
+ const preppedInfo = additionalInfo.map(prepInfo).join(' ');
35
+ allLogs.push([type, message, preppedInfo].filter(Boolean).join(' '));
36
+ const isDebug = !!((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.debug) ||
37
+ !!window.location.search.match(/\?.*(&*)zonosDebug=1/);
38
+ // if debug is false, do not log
39
+ if (!isDebug) {
40
+ return;
41
+ }
42
+ let loggingIframe = document.querySelector('iframe#zonos---debug-logging-iframe');
43
+ if (!loggingIframe) {
44
+ // add a hidden iframe
45
+ loggingIframe = document.createElement('iframe');
46
+ loggingIframe.id = 'zonos---debug-logging-iframe';
47
+ loggingIframe.style.display = 'none';
48
+ loggingIframe.style.opacity = '0';
49
+ loggingIframe.style.position = 'absolute';
50
+ loggingIframe.style.top = '-9999px';
51
+ loggingIframe.style.left = '-9999px';
52
+ loggingIframe.style.width = '1px';
53
+ loggingIframe.style.height = '1px';
54
+ loggingIframe.style.border = 'none';
55
+ loggingIframe.style.overflow = 'hidden';
56
+ loggingIframe.style.visibility = 'hidden';
57
+ document.body.appendChild(loggingIframe);
58
+ }
59
+ // use the logging iframe's console to log just in case the console is disabled (overridden) by the site owner
60
+ const zConsole = ((_b = loggingIframe.contentWindow) === null || _b === void 0 ? void 0 : _b.window.console) || window.console;
61
+ switch (type) {
62
+ case 'warn':
63
+ zConsole.warn(message, ...additionalInfo);
64
+ break;
65
+ case 'info':
66
+ zConsole.info(message, ...additionalInfo);
67
+ break;
68
+ case 'error':
69
+ zConsole.error(message, ...additionalInfo);
70
+ break;
71
+ default:
72
+ zConsole.groupCollapsed(message, ...additionalInfo);
73
+ zConsole.trace();
74
+ zConsole.groupEnd();
75
+ break;
76
+ }
77
+ };
78
+
79
+ const availableTestKeys = {
80
+ hosted_vs_native: {
81
+ availableVariants: ['hosted', 'native'],
82
+ },
83
+ test_A_B: {
84
+ availableVariants: ['A', 'B'],
85
+ },
86
+ };
87
+
88
+ exports.allLogs = allLogs;
89
+ exports.availableTestKeys = availableTestKeys;
90
+ exports.getElapsedTime = getElapsedTime;
91
+ exports.log = log;
@@ -1,11 +1,12 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-f8ee56aa.js');
4
- const localization = require('./localization-12e7e934.js');
5
- const translationStore = require('./translationStore-951ed4b4.js');
6
- const handleFetch = require('./handleFetch-45f35cac.js');
7
- const isDarkColor = require('./isDarkColor-428965f4.js');
8
- const getBorderRadius = require('./getBorderRadius-1b5e33cf.js');
3
+ const zonosStore = require('./zonosStore-5d489c65.js');
4
+ const localization = require('./localization-21030292.js');
5
+ const translationStore = require('./translationStore-ce2c700d.js');
6
+ const handleFetch = require('./handleFetch-954f30e1.js');
7
+ const VarianceTest = require('./VarianceTest-bec00ea8.js');
8
+ const isDarkColor = require('./isDarkColor-994c38e4.js');
9
+ const getBorderRadius = require('./getBorderRadius-c7d9f676.js');
9
10
 
10
11
  /**
11
12
  * Extract first name and last name from the name string
@@ -134,7 +135,7 @@ const prepCalculateLandedCost = () => {
134
135
  const stripeBillingAddressData = stripeStore.stripeShippingSameAsBilling
135
136
  ? stripeStore.stripeAddressEventData
136
137
  : stripeStore.stripeBillingAddressEventData;
137
- handleFetch.log({ stripeAddressData, stripeBillingAddressData }, 'info');
138
+ VarianceTest.log({ stripeAddressData, stripeBillingAddressData }, 'info');
138
139
  if (!stripeAddressData || !stripeBillingAddressData) {
139
140
  throw new Error('Missing stripe address data');
140
141
  }
@@ -354,7 +355,7 @@ const trackConversionEvent = async ({ checkoutSessionId, eventName, metadata, })
354
355
  endpoint: 'trackConversionEventMetric',
355
356
  errors: [`Event "${eventName}" - No checkout session id found`],
356
357
  metadata: {
357
- allLogs: handleFetch.allLogs,
358
+ allLogs: VarianceTest.allLogs,
358
359
  checkoutSessionId,
359
360
  eventName,
360
361
  metadata,
@@ -370,7 +371,7 @@ const trackConversionEvent = async ({ checkoutSessionId, eventName, metadata, })
370
371
  endpoint: 'trackConversionEventMetric',
371
372
  errors: [`Event "${eventName}" - No organization id found`],
372
373
  metadata: {
373
- allLogs: handleFetch.allLogs,
374
+ allLogs: VarianceTest.allLogs,
374
375
  checkoutSessionId,
375
376
  eventName,
376
377
  metadata,
@@ -530,7 +531,7 @@ const validateCheckoutSession = async () => {
530
531
  void handleFetch.sendErrorLog({
531
532
  endpoint: 'validateCheckoutSession',
532
533
  errors: errors.map(error => error.message),
533
- metadata: { allLogs: handleFetch.allLogs },
534
+ metadata: { allLogs: VarianceTest.allLogs },
534
535
  });
535
536
  return {
536
537
  errorMessage: translationStore.translate('Unable to retrieve the checkout session at the moment. Please try again or contact our support team.'),
@@ -543,7 +544,7 @@ const validateCheckoutSession = async () => {
543
544
  void handleFetch.sendErrorLog({
544
545
  endpoint: 'validateCheckoutSession',
545
546
  errors: ['No landed cost found before confirming payment'],
546
- metadata: { allLogs: handleFetch.allLogs },
547
+ metadata: { allLogs: VarianceTest.allLogs },
547
548
  });
548
549
  return {
549
550
  errorMessage: translationStore.translate('No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.'),
@@ -740,7 +741,7 @@ const initStripeElements = async (props) => {
740
741
  var _a, _b;
741
742
  const clientSecret = stripeStore.clientSecret;
742
743
  if (!stripeStore.stripe) {
743
- handleFetch.log('Skip. Stripe is not initialized');
744
+ VarianceTest.log('Skip. Stripe is not initialized');
744
745
  return;
745
746
  }
746
747
  const stripeOptions = getStripeOptions({
@@ -759,12 +760,12 @@ const initStripeElements = async (props) => {
759
760
  // init stripe elements for billing address
760
761
  stripeStore.stripeElementsForBillingAddress =
761
762
  (_a = stripeStore.stripe) === null || _a === void 0 ? void 0 : _a.elements(stripeOptions);
762
- handleFetch.log('Stripe elements for billing address initialized');
763
+ VarianceTest.log('Stripe elements for billing address initialized');
763
764
  // init stripe elements if it doesn't exist
764
765
  stripeStore.stripeElements = (_b = stripeStore.stripe) === null || _b === void 0 ? void 0 : _b.elements(stripeOptions);
765
766
  // save stripe elements options for later comparison
766
767
  stripeStore.stripeElementsOptions = stripeOptions;
767
- handleFetch.log('Stripe elements initialized');
768
+ VarianceTest.log('Stripe elements initialized');
768
769
  return;
769
770
  }
770
771
  if (!isSameOptions) {
@@ -776,7 +777,7 @@ const initStripeElements = async (props) => {
776
777
  stripeStore.stripeElementsOptions = stripeOptions;
777
778
  void stripeStore.stripeElements.fetchUpdates();
778
779
  }
779
- handleFetch.log('Stripe elements updated');
780
+ VarianceTest.log('Stripe elements updated');
780
781
  };
781
782
  const stripeStoreReset = () => {
782
783
  // clean clientSecret so that we can start the new one.
@@ -821,7 +822,7 @@ const stripeStoreBuildAddressForPartyCreate = ({ address, firstName, lastName, n
821
822
  endpoint: 'PARTY_CREATE_NO_NAME_FOUND',
822
823
  errors: ['No name found'],
823
824
  metadata: {
824
- allLogs: handleFetch.allLogs,
825
+ allLogs: VarianceTest.allLogs,
825
826
  cartId: window.Zonos.cartId,
826
827
  checkoutSessionId: localization.storageStore.checkoutSessionId,
827
828
  firstName,
@@ -835,7 +836,7 @@ const stripeStoreBuildAddressForPartyCreate = ({ address, firstName, lastName, n
835
836
  endpoint: 'PARTY_CREATE_NO_PHONE_FOUND',
836
837
  errors: ['No phone found'],
837
838
  metadata: {
838
- allLogs: handleFetch.allLogs,
839
+ allLogs: VarianceTest.allLogs,
839
840
  cartId: window.Zonos.cartId,
840
841
  checkoutSessionId: localization.storageStore.checkoutSessionId,
841
842
  phone,
@@ -877,7 +878,7 @@ const stripeStoreAsyncAddressUpdate = async () => {
877
878
  endpoint: 'PF_NO_SELECTED_LANDED_COST',
878
879
  errors: ['No selected landed cost'],
879
880
  metadata: {
880
- allLogs: handleFetch.allLogs,
881
+ allLogs: VarianceTest.allLogs,
881
882
  cartId: window.Zonos.cartId,
882
883
  checkoutSessionId: localization.storageStore.checkoutSessionId,
883
884
  },
@@ -927,7 +928,7 @@ const stripeStoreAsyncAddressUpdate = async () => {
927
928
  endpoint: 'PF_PARTY_CREATE_FAILED',
928
929
  errors: ['Failed to create parties'],
929
930
  metadata: {
930
- allLogs: handleFetch.allLogs,
931
+ allLogs: VarianceTest.allLogs,
931
932
  cartId: window.Zonos.cartId,
932
933
  checkoutSessionId: localization.storageStore.checkoutSessionId,
933
934
  errors,
@@ -982,7 +983,7 @@ const isPrefetchInfoOutdated = () => {
982
983
  ((_a = cartStore.landedCostData.find(Boolean)) === null || _a === void 0 ? void 0 : _a.subtotals.items) !==
983
984
  cartStore.subtotal;
984
985
  const isAddressOutdated = checkIsAddressOutdatedForLCPrefetch();
985
- handleFetch.log('isPrefetchInfoOutdated', 'info', {
986
+ VarianceTest.log('isPrefetchInfoOutdated', 'info', {
986
987
  isAddressOutdated,
987
988
  });
988
989
  return (
@@ -1426,7 +1427,7 @@ const stripeStoreConfirmPayment = async (props) => {
1426
1427
  elements: stripeElements,
1427
1428
  redirect: 'if_required',
1428
1429
  });
1429
- handleFetch.log('Payment intent confirmed', 'info', { error, paymentIntent });
1430
+ VarianceTest.log('Payment intent confirmed', 'info', { error, paymentIntent });
1430
1431
  if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === 'requires_action') {
1431
1432
  throw new Error(translationStore.translate('Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.'));
1432
1433
  }
@@ -1480,7 +1481,7 @@ const stripeStoreGetPaymentIntent = async () => {
1480
1481
  endpoint: 'Error creating payment intent',
1481
1482
  errors: ['No checkout session id found when retrieving payment intent'],
1482
1483
  metadata: {
1483
- allLogs: handleFetch.allLogs,
1484
+ allLogs: VarianceTest.allLogs,
1484
1485
  cartId: window.Zonos.cartId,
1485
1486
  },
1486
1487
  });
@@ -1506,7 +1507,7 @@ const stripeStoreGetPaymentIntent = async () => {
1506
1507
  endpoint: 'Error creating payment intent',
1507
1508
  errors: errors.map(error => error.message),
1508
1509
  metadata: {
1509
- allLogs: handleFetch.allLogs,
1510
+ allLogs: VarianceTest.allLogs,
1510
1511
  cartId: window.Zonos.cartId,
1511
1512
  checkoutSessionId: localization.storageStore.checkoutSessionId,
1512
1513
  clientSecret,
@@ -1535,7 +1536,7 @@ const stripeStoreInitCheckoutSession = async () => {
1535
1536
  }
1536
1537
  stripeStore.isFetchingSession = true;
1537
1538
  const body = getCheckoutSessionBody();
1538
- handleFetch.log('Checkout session body', 'info', body);
1539
+ VarianceTest.log('Checkout session body', 'info', body);
1539
1540
  const { errors, json } = await handleFetch.handleFetch('/api/zonos-elements/create-checkout-session', {
1540
1541
  body,
1541
1542
  method: 'POST',
@@ -1558,8 +1559,8 @@ const stripeStoreInitCheckoutSession = async () => {
1558
1559
  method: ((_b = result.landedCost) === null || _b === void 0 ? void 0 : _b.method) || 'DDP',
1559
1560
  subtotals: result.subtotals,
1560
1561
  });
1561
- handleFetch.log('Exchange rate updated for cart items (checkout session create)', 'info', cartStore.exchangeRate);
1562
- handleFetch.log('done-init-checkout-session');
1562
+ VarianceTest.log('Exchange rate updated for cart items (checkout session create)', 'info', cartStore.exchangeRate);
1563
+ VarianceTest.log('done-init-checkout-session');
1563
1564
  return true;
1564
1565
  };
1565
1566
  const stripeStoreUpdateCheckoutSessionBaseCurrency = async () => {
@@ -1571,7 +1572,7 @@ const stripeStoreUpdateCheckoutSessionBaseCurrency = async () => {
1571
1572
  }
1572
1573
  // Only update checkout session currency if setting is enabled
1573
1574
  if (zonosStore.zonosStore.checkoutSettings.allowedSettlementCurrencies === 'LOCAL') {
1574
- handleFetch.log('allowedSettlementCurrencies: "LOCAL". Skip updating checkout session base currency');
1575
+ VarianceTest.log('allowedSettlementCurrencies: "LOCAL". Skip updating checkout session base currency');
1575
1576
  return true;
1576
1577
  }
1577
1578
  const { json } = await handleFetch.handleFetch('/api/zonos-elements/update-checkout-session-base-currency', {
@@ -1588,7 +1589,7 @@ const stripeStoreUpdateCheckoutSessionBaseCurrency = async () => {
1588
1589
  handleFetch.logError('Failed to update checkout session base currency');
1589
1590
  return false;
1590
1591
  }
1591
- handleFetch.log(`Updated checkout session to settlement currency "${settlementCurrencyCode}".`);
1592
+ VarianceTest.log(`Updated checkout session to settlement currency "${settlementCurrencyCode}".`);
1592
1593
  return true;
1593
1594
  };
1594
1595
  /**
@@ -1862,7 +1863,7 @@ const getMatchItem = ({ item1, item2, }) => {
1862
1863
  * Check and set restricted items in cart
1863
1864
  */
1864
1865
  const cartStoreCheckItemRestrictions = (itemsWorkflow) => {
1865
- handleFetch.log('Checking item restrictions');
1866
+ VarianceTest.log('Checking item restrictions');
1866
1867
  const mappedRestrictedItems = itemsWorkflow
1867
1868
  .map(item => {
1868
1869
  if (!item.restriction) {
@@ -1930,7 +1931,7 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
1930
1931
  endpoint: 'cartStoreSetCheckoutSession',
1931
1932
  errors: ['Missing checkout session id in checkout session'],
1932
1933
  metadata: {
1933
- allLogs: handleFetch.allLogs,
1934
+ allLogs: VarianceTest.allLogs,
1934
1935
  checkoutSession,
1935
1936
  },
1936
1937
  });
@@ -1949,7 +1950,7 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
1949
1950
  (_e = (_d = window.Zonos.cartData) === null || _d === void 0 ? void 0 : _d.metadata.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'externalConfirmationPageURL')) === null || _e === void 0 ? void 0 : _e.value) ||
1950
1951
  null;
1951
1952
  if (externalConfirmationPageURL) {
1952
- handleFetch.log(`Found externalConfirmationPageURL: ${externalConfirmationPageURL}`);
1953
+ VarianceTest.log(`Found externalConfirmationPageURL: ${externalConfirmationPageURL}`);
1953
1954
  cartStore.externalConfirmationPageURL = externalConfirmationPageURL;
1954
1955
  }
1955
1956
  };
@@ -1963,11 +1964,11 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
1963
1964
  method: cartStore.landedCostMethod,
1964
1965
  subtotals,
1965
1966
  });
1966
- handleFetch.log('Exchange rate updated for cart items (landed cost subtotal)', 'info', cartStore.exchangeRate);
1967
+ VarianceTest.log('Exchange rate updated for cart items (landed cost subtotal)', 'info', cartStore.exchangeRate);
1967
1968
  }
1968
1969
  // update checkout session
1969
1970
  if (!localization.storageStore.checkoutSessionId) {
1970
- handleFetch.log('Could not update cart total without checkout session id', 'info');
1971
+ VarianceTest.log('Could not update cart total without checkout session id', 'info');
1971
1972
  return false;
1972
1973
  }
1973
1974
  const { errors, json } = await stripeStoreUpdateCheckoutSession({
@@ -1985,9 +1986,9 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
1985
1986
  if (errors.length > 0 || !json) {
1986
1987
  handleFetch.logError('Error occurs when updating checkout session.');
1987
1988
  if (shouldInitSessionOnFailure) {
1988
- handleFetch.log('Initiating checkout session on failure', 'info');
1989
+ VarianceTest.log('Initiating checkout session on failure', 'info');
1989
1990
  const success = await stripeStoreInitCheckoutSession();
1990
- handleFetch.log(`stripeStoreInitCheckoutSession: ${success}`);
1991
+ VarianceTest.log(`stripeStoreInitCheckoutSession: ${success}`);
1991
1992
  if (!success) {
1992
1993
  cartStoreUpdateToErrorState({
1993
1994
  messages: [
@@ -2008,7 +2009,7 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
2008
2009
  method: ((_a = json.checkoutSessionUpdate.landedCost) === null || _a === void 0 ? void 0 : _a.method) || 'DDP',
2009
2010
  subtotals: json.checkoutSessionUpdate.subtotals,
2010
2011
  });
2011
- handleFetch.log('Exchange rate updated for cart items (checkout session update)', 'info', cartStore.exchangeRate);
2012
+ VarianceTest.log('Exchange rate updated for cart items (checkout session update)', 'info', cartStore.exchangeRate);
2012
2013
  }
2013
2014
  cartStoreSetCheckoutSession(json.checkoutSessionUpdate);
2014
2015
  return true;
@@ -2032,7 +2033,7 @@ const cartStoreGetMethod = (landedCost) => {
2032
2033
  };
2033
2034
  const cartStoreUpdateSelectedShippingOption = async ({ applySubtotalsOnly, landedCostId, selectedShippingOption, }) => {
2034
2035
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
2035
- handleFetch.log('Updating selected shipping option', 'info', {
2036
+ VarianceTest.log('Updating selected shipping option', 'info', {
2036
2037
  landedCostId,
2037
2038
  selectedShippingOption,
2038
2039
  });
@@ -2059,7 +2060,7 @@ const cartStoreUpdateSelectedShippingOption = async ({ applySubtotalsOnly, lande
2059
2060
  const exchangeRate = selectedLandedCost.subtotals.exchangeRate.rate;
2060
2061
  const dutiesTaxesFeesEstimate = landedCostAmount * exchangeRate;
2061
2062
  if (dutiesTaxesFeesEstimate) {
2062
- handleFetch.log(`DAP quote, using estimate: ${dutiesTaxesFeesEstimate}`, 'info');
2063
+ VarianceTest.log(`DAP quote, using estimate: ${dutiesTaxesFeesEstimate}`, 'info');
2063
2064
  }
2064
2065
  cartStore.landedCostMethod = cartStoreGetMethod(selectedLandedCost.landedCost);
2065
2066
  // update shipping value and dutiesTaxFees on selectedShippingOption change
@@ -2082,7 +2083,7 @@ const cartStoreUpdateSelectedShippingOption = async ({ applySubtotalsOnly, lande
2082
2083
  method: cartStore.landedCostMethod,
2083
2084
  subtotals,
2084
2085
  });
2085
- handleFetch.log('Exchange rate updated for cart items (landed cost subtotal)', 'info', cartStore.exchangeRate);
2086
+ VarianceTest.log('Exchange rate updated for cart items (landed cost subtotal)', 'info', cartStore.exchangeRate);
2086
2087
  updateCalculateStatus = true;
2087
2088
  }
2088
2089
  else {
@@ -2121,7 +2122,7 @@ const cartStoreStartCheckoutInterval = ({ isPreview, sessionTimeout, }) => {
2121
2122
  timeoutQuery && !isNaN(parseInt(timeoutQuery, 10))
2122
2123
  ? parseInt(timeoutQuery, 10)
2123
2124
  : sessionTimeout;
2124
- handleFetch.log(`==START CHECKOUT TIMEOUT - ${timeout}==`);
2125
+ VarianceTest.log(`==START CHECKOUT TIMEOUT - ${timeout}==`);
2125
2126
  cartStore.checkoutTimeoutInterval = setTimeout(() => {
2126
2127
  cartStore.checkoutSessionTimeoutShow = true;
2127
2128
  }, timeout);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-f8ee56aa.js');
3
+ const zonosStore = require('./zonosStore-5d489c65.js');
4
4
 
5
5
  var root = zonosStore._root;
6
6
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-f8ee56aa.js');
3
+ const zonosStore = require('./zonosStore-5d489c65.js');
4
4
 
5
5
  /**
6
6
  * Get the border radius for the elements based on the style
@@ -1,83 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const startTime = performance.now();
4
- const allLogs = [];
5
- const getElapsedTime = () => {
6
- const elapsedTime = performance.now() - startTime;
7
- const elapsedTimePretty =
8
- // format the time to seconds if over 1 second
9
- elapsedTime > 1000
10
- ? `${(elapsedTime / 1000).toFixed(2)}s`
11
- : `${elapsedTime.toFixed(2)}ms`;
12
- return { elapsedTime, elapsedTimePretty };
13
- };
14
- const prepInfo = (info) => {
15
- if (typeof info === 'string') {
16
- return info;
17
- }
18
- try {
19
- const infoToJson = JSON.stringify(info);
20
- return infoToJson;
21
- }
22
- catch (_a) {
23
- if (info && typeof info.toString === 'function') {
24
- const infoToString = info.toString();
25
- return infoToString;
26
- }
27
- return 'Unable to stringify info';
28
- }
29
- };
30
- const log = (message, type, ..._additionalInfo) => {
31
- var _a, _b;
32
- const { elapsedTimePretty } = getElapsedTime();
33
- const additionalInfo = [`(${elapsedTimePretty})`, ..._additionalInfo];
34
- const preppedInfo = additionalInfo.map(prepInfo).join(' ');
35
- allLogs.push([type, message, preppedInfo].filter(Boolean).join(' '));
36
- const isDebug = !!((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.debug) ||
37
- !!window.location.search.match(/\?.*(&*)zonosDebug=1/);
38
- // if debug is false, do not log
39
- if (!isDebug) {
40
- return;
41
- }
42
- let loggingIframe = document.querySelector('iframe#zonos---debug-logging-iframe');
43
- if (!loggingIframe) {
44
- // add a hidden iframe
45
- loggingIframe = document.createElement('iframe');
46
- loggingIframe.id = 'zonos---debug-logging-iframe';
47
- loggingIframe.style.display = 'none';
48
- loggingIframe.style.opacity = '0';
49
- loggingIframe.style.position = 'absolute';
50
- loggingIframe.style.top = '-9999px';
51
- loggingIframe.style.left = '-9999px';
52
- loggingIframe.style.width = '1px';
53
- loggingIframe.style.height = '1px';
54
- loggingIframe.style.border = 'none';
55
- loggingIframe.style.overflow = 'hidden';
56
- loggingIframe.style.visibility = 'hidden';
57
- document.body.appendChild(loggingIframe);
58
- }
59
- // use the logging iframe's console to log just in case the console is disabled (overridden) by the site owner
60
- const zConsole = ((_b = loggingIframe.contentWindow) === null || _b === void 0 ? void 0 : _b.window.console) || window.console;
61
- switch (type) {
62
- case 'warn':
63
- zConsole.warn(message, ...additionalInfo);
64
- break;
65
- case 'info':
66
- zConsole.info(message, ...additionalInfo);
67
- break;
68
- case 'error':
69
- zConsole.error(message, ...additionalInfo);
70
- break;
71
- default:
72
- zConsole.groupCollapsed(message, ...additionalInfo);
73
- zConsole.trace();
74
- zConsole.groupEnd();
75
- break;
76
- }
77
- };
3
+ const VarianceTest = require('./VarianceTest-bec00ea8.js');
78
4
 
79
5
  const logError = (message, ...rest) => {
80
- log(message, 'error', ...rest);
6
+ VarianceTest.log(message, 'error', ...rest);
81
7
  };
82
8
 
83
9
  const getIsStagingMode = () => window.location.search.includes('zonosStagingMode=1');
@@ -215,7 +141,7 @@ const prepLoadTimeApiLog = ({ apiPath, apiType, loadTimeInternal, loadTimeTotal,
215
141
  */
216
142
  const postReleaseReportingDuration = 1 * 3600 * 1000; // 1 hour
217
143
  const sendErrorLog = async ({ endpoint, errors, metadata, shouldPostReleaseErrorReporting, }) => {
218
- log('sendErrorLog', 'warn', endpoint, metadata, errors);
144
+ VarianceTest.log('sendErrorLog', 'warn', endpoint, metadata, errors);
219
145
  if (shouldPostReleaseErrorReporting) {
220
146
  // We only want to report errors that happened if current time is less than 2 hours after release time
221
147
  const releaseTime = Number(window.Zonos.releaseDate);
@@ -415,7 +341,7 @@ const handleRequestWithFallback = async ({ basePathType: _basePathType, options,
415
341
  const endTime = performance.now();
416
342
  const duration = endTime - startTime;
417
343
  // Send the load time api log
418
- log(`${path} (${duration.toFixed(2)}ms)`, 'info');
344
+ VarianceTest.log(`${path} (${duration.toFixed(2)}ms)`, 'info');
419
345
  // No need to send the load time api log for the log-script-load endpoint
420
346
  const internalDuration = response === null || response === void 0 ? void 0 : response.headers.get('Zonos-Duration');
421
347
  // Only record if the response status is 200, some endpoint will return 200 with error
@@ -456,7 +382,7 @@ const handleRequestWithFallback = async ({ basePathType: _basePathType, options,
456
382
  });
457
383
  }
458
384
  if (shouldCallFallback) {
459
- log(`=== "${path}" failed to fetch, trying next fallback ${nextFallbackApiType}`);
385
+ VarianceTest.log(`=== "${path}" failed to fetch, trying next fallback ${nextFallbackApiType}`);
460
386
  return handleRequestWithFallback({
461
387
  basePathType: nextFallbackApiType,
462
388
  options,
@@ -490,15 +416,12 @@ const handleFetch = async (path, _opts) => {
490
416
  });
491
417
  };
492
418
 
493
- exports.allLogs = allLogs;
494
419
  exports.fallbackApiList = fallbackApiList;
495
420
  exports.getAdditionalLogMetadata = getAdditionalLogMetadata;
496
- exports.getElapsedTime = getElapsedTime;
497
421
  exports.getIsStagingMode = getIsStagingMode;
498
422
  exports.getIsTestMode = getIsTestMode;
499
423
  exports.handleFetch = handleFetch;
500
424
  exports.isCheckoutMobile = isCheckoutMobile;
501
425
  exports.jsonParse = jsonParse;
502
- exports.log = log;
503
426
  exports.logError = logError;
504
427
  exports.sendErrorLog = sendErrorLog;