@zonos/elements 1.3.168 → 1.3.170

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 (185) 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 +11 -9
  6. package/dist/cjs/{isDarkColor-08d92ed7.js → isDarkColor-ec4a4e7d.js} +1 -1
  7. package/dist/cjs/{paypal-ea1693b0.js → paypal-3eae38bd.js} +4 -4
  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 +65 -40
  15. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  16. package/dist/cjs/zonos-controller.cjs.entry.js +5 -5
  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 +15 -0
  32. package/dist/collection/components/store/zonosStore.js +3 -0
  33. package/dist/collection/components/utils/handleFetch.js +14 -1
  34. package/dist/collection/components/utils/logging/getAdditionalLogMetadata.js +19 -0
  35. package/dist/collection/components/utils/logging/prepLoadTimeApiLog.js +29 -0
  36. package/dist/collection/components/utils/logging/sendBulkLoadTimeApiLog.js +30 -0
  37. package/dist/collection/components/utils/logging/sendLoadCheckoutFacadeLog.js +1 -1
  38. package/dist/collection/components/utils/logging/sendLoadNativeCheckoutLog.js +23 -0
  39. package/dist/collection/components/utils/logging/sendLoadScriptLog.js +1 -17
  40. package/dist/collection/scripts/_zonosBase.js +2 -0
  41. package/dist/collection/types/generated/graphql.frontend.types.js +3 -0
  42. package/dist/esm/{CheckoutConfig-646aae20.js → CheckoutConfig-2994efd9.js} +1 -1
  43. package/dist/esm/{cart-f2f5f13f.js → cart-b2e57589.js} +4 -4
  44. package/dist/esm/{getBorderRadius-740610fb.js → getBorderRadius-ada3ccad.js} +1 -1
  45. package/dist/esm/{handleFetch-b4633675.js → handleFetch-8d72c8cd.js} +79 -2
  46. package/dist/esm/index.js +12 -10
  47. package/dist/esm/{isDarkColor-2f59d721.js → isDarkColor-446fccb7.js} +1 -1
  48. package/dist/esm/{paypal-a4f2a79c.js → paypal-38da5d52.js} +4 -4
  49. package/dist/esm/zonos-address_7.entry.js +5 -5
  50. package/dist/esm/zonos-badge.entry.js +1 -1
  51. package/dist/esm/zonos-banner.entry.js +1 -1
  52. package/dist/esm/zonos-button_3.entry.js +3 -3
  53. package/dist/esm/zonos-card.entry.js +2 -2
  54. package/dist/esm/zonos-cart-items_13.entry.js +6 -6
  55. package/dist/esm/zonos-checkout.entry.js +64 -39
  56. package/dist/esm/zonos-collapse.entry.js +1 -1
  57. package/dist/esm/zonos-controller.entry.js +5 -5
  58. package/dist/esm/zonos-country-flag.entry.js +5 -5
  59. package/dist/esm/zonos-country-select_4.entry.js +5 -5
  60. package/dist/esm/zonos-empty-state-payment_4.entry.js +6 -6
  61. package/dist/esm/zonos-hello-dialog.entry.js +5 -5
  62. package/dist/esm/zonos-hello.entry.js +5 -5
  63. package/dist/esm/zonos-input.entry.js +2 -2
  64. package/dist/esm/zonos-language-select_2.entry.js +5 -5
  65. package/dist/esm/zonos-logo.entry.js +1 -1
  66. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  67. package/dist/esm/zonos-stripe-input.entry.js +3 -3
  68. package/dist/esm/zonos-text.entry.js +1 -1
  69. package/dist/esm/zonos-toggle.entry.js +1 -1
  70. package/dist/esm/zonos-v-stack.entry.js +1 -1
  71. package/dist/esm/{zonosStore-71d7e02f.js → zonosStore-d3c5a0a5.js} +3 -0
  72. package/dist/esm-es5/{CheckoutConfig-646aae20.js → CheckoutConfig-2994efd9.js} +1 -1
  73. package/dist/esm-es5/{cart-f2f5f13f.js → cart-b2e57589.js} +1 -1
  74. package/dist/esm-es5/{getBorderRadius-740610fb.js → getBorderRadius-ada3ccad.js} +1 -1
  75. package/dist/esm-es5/handleFetch-8d72c8cd.js +1 -0
  76. package/dist/esm-es5/index.js +1 -1
  77. package/dist/esm-es5/{isDarkColor-2f59d721.js → isDarkColor-446fccb7.js} +1 -1
  78. package/dist/esm-es5/{paypal-a4f2a79c.js → paypal-38da5d52.js} +1 -1
  79. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  80. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  81. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  82. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  83. package/dist/esm-es5/zonos-card.entry.js +1 -1
  84. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  85. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  86. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  87. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  88. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  89. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  90. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  91. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  92. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  93. package/dist/esm-es5/zonos-input.entry.js +1 -1
  94. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  95. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  96. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  97. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  98. package/dist/esm-es5/zonos-text.entry.js +1 -1
  99. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  100. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  101. package/dist/esm-es5/{zonosStore-71d7e02f.js → zonosStore-d3c5a0a5.js} +1 -1
  102. package/dist/scripts/index.d.ts +20 -0
  103. package/dist/scripts/index.js +1 -1
  104. package/dist/scripts/loadZonos.js +1 -1
  105. package/dist/scripts/zonos.js +1 -1
  106. package/dist/types/components/utils/logging/getAdditionalLogMetadata.d.ts +15 -0
  107. package/dist/types/components/utils/logging/prepLoadTimeApiLog.d.ts +23 -0
  108. package/dist/types/components/utils/logging/sendBulkLoadTimeApiLog.d.ts +1 -0
  109. package/dist/types/components/utils/logging/sendLoadNativeCheckoutLog.d.ts +3 -0
  110. package/dist/types/components/utils/logging/sendLoadScriptLog.d.ts +0 -12
  111. package/dist/types/scripts/_getNextFallbackUrl.d.ts +1 -1
  112. package/dist/types/scripts/_zonosBase.d.ts +5 -0
  113. package/dist/types/types/LogLoadScript.d.ts +1 -0
  114. package/dist/types/types/generated/graphql.frontend.types.d.ts +11 -0
  115. package/dist/types/types/generated/graphql.frontend.types.ts +21 -0
  116. package/dist/zonos-elements/index.esm.js +1 -1
  117. package/dist/zonos-elements/{p-af107510.entry.js → p-00ad3c73.entry.js} +1 -1
  118. package/dist/zonos-elements/{p-25ad92dc.system.entry.js → p-0bfca3a9.system.entry.js} +1 -1
  119. package/dist/zonos-elements/p-0dc78be4.system.entry.js +1 -0
  120. package/dist/zonos-elements/{p-18af4af9.system.entry.js → p-0def1397.system.entry.js} +1 -1
  121. package/dist/zonos-elements/{p-09e4f412.system.entry.js → p-0e63259c.system.entry.js} +1 -1
  122. package/dist/zonos-elements/{p-466de014.system.entry.js → p-1a20922f.system.entry.js} +1 -1
  123. package/dist/zonos-elements/{p-16413274.system.entry.js → p-1edbfb1f.system.entry.js} +1 -1
  124. package/dist/zonos-elements/{p-c7219337.system.entry.js → p-236f32c8.system.entry.js} +1 -1
  125. package/dist/zonos-elements/{p-dd999b44.js → p-30fdcbee.js} +1 -1
  126. package/dist/zonos-elements/{p-acabfba5.entry.js → p-3731e7f5.entry.js} +1 -1
  127. package/dist/zonos-elements/{p-6549915d.entry.js → p-3eac4b10.entry.js} +1 -1
  128. package/dist/zonos-elements/{p-7c028742.entry.js → p-41dfc828.entry.js} +1 -1
  129. package/dist/zonos-elements/{p-163425d9.entry.js → p-461ca324.entry.js} +1 -1
  130. package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
  131. package/dist/zonos-elements/{p-c9035262.js → p-47f79a6d.js} +1 -1
  132. package/dist/zonos-elements/{p-b21c0d7f.js → p-48173901.js} +2 -2
  133. package/dist/zonos-elements/{p-a9a95fae.system.js → p-5187ba8f.system.js} +1 -1
  134. package/dist/zonos-elements/{p-e427c0d6.system.entry.js → p-53cb8867.system.entry.js} +1 -1
  135. package/dist/zonos-elements/{p-75b8db34.system.entry.js → p-56758218.system.entry.js} +1 -1
  136. package/dist/zonos-elements/{p-3edccfff.system.entry.js → p-56a8b1f6.system.entry.js} +1 -1
  137. package/dist/zonos-elements/{p-0febd074.system.entry.js → p-58f660d4.system.entry.js} +1 -1
  138. package/dist/zonos-elements/{p-b6fdbbf4.system.js → p-69255ed2.system.js} +1 -1
  139. package/dist/zonos-elements/{p-57281d6c.system.entry.js → p-6c0c8722.system.entry.js} +1 -1
  140. package/dist/zonos-elements/p-71539c8a.js +1 -0
  141. package/dist/zonos-elements/{p-ed74742d.system.entry.js → p-739014f8.system.entry.js} +1 -1
  142. package/dist/zonos-elements/{p-073bc210.entry.js → p-8048932d.entry.js} +1 -1
  143. package/dist/zonos-elements/{p-77581c1c.entry.js → p-829f6a40.entry.js} +1 -1
  144. package/dist/zonos-elements/{p-7011d8e2.entry.js → p-864c7c7d.entry.js} +1 -1
  145. package/dist/zonos-elements/p-8b179fdc.entry.js +1 -0
  146. package/dist/zonos-elements/{p-73e9a8f5.entry.js → p-90633d63.entry.js} +1 -1
  147. package/dist/zonos-elements/p-9261869c.system.js +1 -0
  148. package/dist/zonos-elements/{p-672707ce.js → p-98aa88b1.js} +1 -1
  149. package/dist/zonos-elements/{p-e4a52de7.entry.js → p-9f9e4f74.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-98e9c9cf.js → p-a1cfbd0a.js} +1 -1
  151. package/dist/zonos-elements/{p-3bff5a9f.system.js → p-a3888f1d.system.js} +1 -1
  152. package/dist/zonos-elements/{p-405f70b1.entry.js → p-b0c39400.entry.js} +1 -1
  153. package/dist/zonos-elements/{p-72319b4d.entry.js → p-b5b9aa6c.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-20ca31fd.system.entry.js → p-be9e1818.system.entry.js} +1 -1
  155. package/dist/zonos-elements/{p-7f69ad17.system.js → p-bf113a46.system.js} +1 -1
  156. package/dist/zonos-elements/{p-0e524fae.entry.js → p-bfa028a2.entry.js} +1 -1
  157. package/dist/zonos-elements/{p-85235fa0.system.entry.js → p-c4fa8524.system.entry.js} +1 -1
  158. package/dist/zonos-elements/{p-73a3e5bb.system.js → p-c5c2976f.system.js} +1 -1
  159. package/dist/zonos-elements/{p-41688151.system.entry.js → p-c82f488b.system.entry.js} +1 -1
  160. package/dist/zonos-elements/{p-ab699c84.entry.js → p-cb52cfdf.entry.js} +1 -1
  161. package/dist/zonos-elements/{p-75a8e67d.entry.js → p-cc6d9f7d.entry.js} +1 -1
  162. package/dist/zonos-elements/{p-82166888.system.entry.js → p-ce853f8f.system.entry.js} +1 -1
  163. package/dist/zonos-elements/{p-15971b78.entry.js → p-cedf08f0.entry.js} +1 -1
  164. package/dist/zonos-elements/{p-e174b37b.system.entry.js → p-d0944cc8.system.entry.js} +1 -1
  165. package/dist/zonos-elements/p-d24e0b90.system.js +1 -0
  166. package/dist/zonos-elements/{p-eb5835d1.system.entry.js → p-d49c6a3e.system.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-c556ff98.js → p-dd0259f4.js} +1 -1
  168. package/dist/zonos-elements/{p-a7246199.entry.js → p-e09cea9c.entry.js} +1 -1
  169. package/dist/zonos-elements/p-e4f8114a.system.js +1 -0
  170. package/dist/zonos-elements/{p-c371558a.system.entry.js → p-e99e75dd.system.entry.js} +1 -1
  171. package/dist/zonos-elements/{p-83645bb4.entry.js → p-eb294265.entry.js} +1 -1
  172. package/dist/zonos-elements/{p-8addb07b.system.entry.js → p-f378b4d3.system.entry.js} +1 -1
  173. package/dist/zonos-elements/{p-718c9603.system.entry.js → p-fd352222.system.entry.js} +1 -1
  174. package/dist/zonos-elements/{p-fa15b9b5.entry.js → p-fe2c27c4.entry.js} +1 -1
  175. package/dist/zonos-elements/{p-607a6750.entry.js → p-febb90e0.entry.js} +1 -1
  176. package/dist/zonos-elements/{p-93499c9b.entry.js → p-ff1c6d9a.entry.js} +1 -1
  177. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  178. package/package.json +1 -1
  179. package/dist/esm-es5/handleFetch-b4633675.js +0 -1
  180. package/dist/zonos-elements/p-18e5b741.system.js +0 -1
  181. package/dist/zonos-elements/p-5af56bda.system.js +0 -1
  182. package/dist/zonos-elements/p-6658cc02.system.js +0 -1
  183. package/dist/zonos-elements/p-a9425cb3.system.entry.js +0 -1
  184. package/dist/zonos-elements/p-bcfb4e10.entry.js +0 -1
  185. package/dist/zonos-elements/p-f0c8150e.js +0 -1
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-2f90486e.js');
6
- const zonosStore = require('./zonosStore-7975e4b6.js');
6
+ const zonosStore = require('./zonosStore-3812b318.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const getBorderRadius = require('./getBorderRadius-d184b623.js');
8
+ const getBorderRadius = require('./getBorderRadius-94ef609c.js');
9
9
 
10
10
  const zonosInputCss = ":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{margin:1px;}:host .zonos--label-wrapper{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:100%;width:100%;background:var(--zonos-elements-input-background);border-radius:var(--zonos--border-radius);border:var(--zonos-elements-border)}:host .zonos--label-wrapper:hover{border:1px solid var(--zonos-elements-gray-300)}:host .zonos--floated-input{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;padding:0 16px;outline:none;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);width:100%;border-radius:var(--zonos--border-radius);background:var(--zonos-elements-input-background);border:0;-ms-flex-order:2;order:2;font-weight:500}:host .zonos--floated-input :-internal-autofill-selected{border-radius:var(--zonos-elements-radius-6) 0 0 var(--zonos-elements-radius-6)}:host .zonos--floated-input :-internal-autofill-selected+label+div{background-color:#e8f0fe}:host .zonos--floated-input.has-label{padding:16px 4px 8px 16px}:host .zonos--floated-input.has-label.has-input-prefix{padding-left:0}:host .zonos--floated-input.has-label.has-input-prefix+.zonos--floated-label::before{margin-left:0}:host .zonos--floated-input:not(.has-label)::-webkit-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label)::-moz-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label):-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label)::-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label)::placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input::-webkit-input-placeholder{-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input::-moz-placeholder{-moz-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input:-ms-input-placeholder{-ms-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input::-ms-input-placeholder{-ms-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input::placeholder{-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input:focus{outline:none}:host .zonos--floated-input:focus+.zonos--floated-label::after{-webkit-box-shadow:var(--zonos-elements-glow-blue);box-shadow:var(--zonos-elements-glow-blue)}:host .zonos--floated-input.has-error+.zonos--floated-label::after{-webkit-box-shadow:var(--zonos-elements-glow-error);box-shadow:var(--zonos-elements-glow-error)}:host .zonos--floated-input.has-content::-webkit-input-placeholder,:host .zonos--floated-input:focus::-webkit-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content::-moz-placeholder,:host .zonos--floated-input:focus::-moz-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content:-ms-input-placeholder,:host .zonos--floated-input:focus:-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content::-ms-input-placeholder,:host .zonos--floated-input:focus::-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content::placeholder,:host .zonos--floated-input:focus::placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content+.zonos--floated-label::before,:host .zonos--floated-input:focus+.zonos--floated-label::before{top:11px;-webkit-transform:scale(0.8);transform:scale(0.8)}:host .zonos--floated-input:-webkit-autofill,:host .zonos--floated-input:-moz-autofill{background-color:var(--zonos-elements-input-background);color:var(--zonos-elements-text-color)}:host .zonos--floated-label{display:block;max-height:0;pointer-events:none;-ms-flex-order:1;order:1}:host .zonos--floated-label::before{content:attr(data-label);color:var(--zonos-elements-gray-800);position:absolute;font-size:var(--zonos-elements-font-size-base);line-height:var(--zonos-elements-font-size-base);display:inline-block;-webkit-filter:blur(0);filter:blur(0);-webkit-transform-origin:left top;transform-origin:left top;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);margin-left:16px;top:calc(50% - var(--zonos-elements-font-size-base) / 2);z-index:1}:host .zonos--floated-label::after{content:\"\";position:absolute;left:0;right:0;top:0;bottom:0;border-radius:var(--zonos--border-radius)}:host .disabled .zonos--floated-label{pointer-events:inherit}:host .disabled .zonos--floated-label::after{cursor:not-allowed;z-index:1}:host(.sm){height:calc(var(--zonos-elements-size-sm) - 2px)}:host(.sm) .zonos--floated-input.has-label{padding-top:13px;padding-bottom:0}:host(.sm) .zonos--floated-input.has-label:focus+.zonos--floated-label::before,:host(.sm) .zonos--floated-input.has-label.has-content+.zonos--floated-label::before{top:2px}:host(.md){height:calc(var(--zonos-elements-size-md) - 2px)}:host(.md) .zonos--floated-input.has-label{padding-top:20px}:host(.md) .zonos--floated-input.has-label:focus+.zonos--floated-label::before,:host(.md) .zonos--floated-input.has-label.has-content+.zonos--floated-label::before{top:6px}:host(.lg){height:calc(var(--zonos-elements-size-lg) - 2px)}:host(.lg) .zonos--floated-input.has-label:focus+.zonos--floated-label::before,:host(.lg) .zonos--floated-input.has-label.has-content+.zonos--floated-label::before{top:10px}:host(.xl){height:calc(var(--zonos-elements-size-xl) - 2px)}:host(.xl) .zonos--floated-input.has-label{padding-bottom:2px}";
11
11
  const ZonosInputStyle0 = zonosInputCss;
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-2f90486e.js');
6
- const cart = require('./cart-dbeee1e9.js');
7
- const zonosStore = require('./zonosStore-7975e4b6.js');
6
+ const cart = require('./cart-36799bbe.js');
7
+ const zonosStore = require('./zonosStore-3812b318.js');
8
8
  const ILanguage = require('./ILanguage-98b04442.js');
9
- require('./handleFetch-3673a0c2.js');
10
- require('./isDarkColor-08d92ed7.js');
11
- require('./getBorderRadius-d184b623.js');
9
+ require('./handleFetch-7b7f9f7c.js');
10
+ require('./isDarkColor-ec4a4e7d.js');
11
+ require('./getBorderRadius-94ef609c.js');
12
12
 
13
13
  const GreenCheckDuotoneIcon = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
14
14
  <path d="M7.99996 2.6665C5.05444 2.6665 2.66663 5.05432 2.66663 7.99984C2.66663 10.9454 5.05444 13.3332 7.99996 13.3332C10.9455 13.3332 13.3333 10.9454 13.3333 7.99984C13.3333 5.05432 10.9455 2.6665 7.99996 2.6665Z" fill="#AFF8C3"/>
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-2f90486e.js');
6
- const zonosStore = require('./zonosStore-7975e4b6.js');
6
+ const zonosStore = require('./zonosStore-3812b318.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
 
9
9
  const zonosLogoCss = ":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 img{-webkit-filter:var(--zonos--filter-color);filter:var(--zonos--filter-color);width:var(--zonos--width)}";
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-2f90486e.js');
6
- const zonosStore = require('./zonosStore-7975e4b6.js');
6
+ const zonosStore = require('./zonosStore-3812b318.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const getBorderRadius = require('./getBorderRadius-d184b623.js');
8
+ const getBorderRadius = require('./getBorderRadius-94ef609c.js');
9
9
  const isColorVariable = require('./isColorVariable-525dbfa7.js');
10
10
 
11
11
  const zonosShippingRichRadioCss = ":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-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host input{margin:0;accent-color:var(--zonos--selected-border-color, var(--zonos-elements-blue-600))}:host .zonos--shipping-rich-radio-item{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;padding:16px;-ms-flex-align:center;align-items:center;gap:16px;cursor:pointer;border:1px solid var(--zonos-elements-gray-200)}:host .zonos--shipping-rich-radio-item:first-child{border-top-left-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));border-top-right-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--shipping-rich-radio-item:last-child{border-bottom-right-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));border-bottom-left-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--shipping-rich-radio-item:not(:last-child){border-bottom:none}:host .zonos--shipping-rich-radio-item.selected{outline:1px solid var(--zonos--selected-border-color, var(--zonos-elements-blue-600));outline-offset:-1px}:host .zonos--shipping-info{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}:host .zonos--shipping-detail{-ms-flex:1;flex:1}:host .zonos--sub-detail{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap}";
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-2f90486e.js');
6
- const zonosStore = require('./zonosStore-7975e4b6.js');
6
+ const zonosStore = require('./zonosStore-3812b318.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const getBorderRadius = require('./getBorderRadius-d184b623.js');
9
- const isDarkColor = require('./isDarkColor-08d92ed7.js');
8
+ const getBorderRadius = require('./getBorderRadius-94ef609c.js');
9
+ const isDarkColor = require('./isDarkColor-ec4a4e7d.js');
10
10
 
11
11
  const zonosStripeInputCss = ":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{--zonos--background-color:#f1f1f1;--zonos--local-glowing-color:0 0 0 3px hsla(0, 0%, 100%, 25%),\n 0 0 0 1px var(--zonos--primary-color);--zonos--border:1px solid #e8e8e8}:host(.dark){color-scheme:dark;--zonos--background-color:#30313d;--zonos--local-glowing-color:0px 2px 4px rgba(0, 0, 0, 0.5),\n 0px 1px 6px rgba(0, 0, 0, 0.25), 0 0 0 3px hsla(0, 0%, 100%, 25%),\n 0 1px 1px 0 rgba(255, 255, 255, 0.12);--zonos--border:1px solid var(--zonos--primary-color)}:host{margin:1px;height:calc(var(--zonos-elements-size-xl) - 2px);}:host .zonos--label-wrapper{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:100%;width:100%;background:var(--zonos--background-color);border-radius:var(--zonos--border-radius);border:var(--zonos--border);outline-offset:0;outline-width:2px}:host .zonos--floated-input{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;padding:0 16px;outline:none;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);width:100%;border-radius:var(--zonos--border-radius);background:var(--zonos--background-color);border:var(--zonos--border);-ms-flex-order:2;order:2;font-weight:400;font-size:var(--zonos--font-size)}:host .zonos--floated-input :-internal-autofill-selected{border-radius:var(--zonos-elements-radius-6) 0 0 var(--zonos-elements-radius-6)}:host .zonos--floated-input :-internal-autofill-selected+label+div{background-color:#e8f0fe}:host .zonos--floated-input.has-label{padding:24px 4px 2px 16px}:host .zonos--floated-input.has-label.has-input-prefix{padding-left:0}:host .zonos--floated-input.has-label.has-input-prefix~.zonos--floated-label label{margin-left:0}:host .zonos--floated-input:not(.has-label)::-webkit-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label)::-moz-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label):-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label)::-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label)::placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input::-webkit-input-placeholder{-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input::-moz-placeholder{-moz-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input:-ms-input-placeholder{-ms-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input::-ms-input-placeholder{-ms-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input::placeholder{-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input:focus{outline:none;border:var(--zonos--border)}:host .zonos--floated-input:focus~.zonos--floated-label::after{-webkit-box-shadow:var(--zonos--glowing-color, var(--zonos--local-glowing-color));box-shadow:var(--zonos--glowing-color, var(--zonos--local-glowing-color))}:host .zonos--floated-input.has-error+.zonos--floated-label::after{-webkit-box-shadow:0 0 0 2px #df1b41;box-shadow:0 0 0 2px #df1b41}:host .zonos--floated-input.has-content::-webkit-input-placeholder,:host .zonos--floated-input:focus::-webkit-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content::-moz-placeholder,:host .zonos--floated-input:focus::-moz-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content:-ms-input-placeholder,:host .zonos--floated-input:focus:-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content::-ms-input-placeholder,:host .zonos--floated-input:focus::-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content::placeholder,:host .zonos--floated-input:focus::placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content~.zonos--floated-label label,:host .zonos--floated-input:focus~.zonos--floated-label label{top:11px;-webkit-transform:scale(0.8);transform:scale(0.8)}:host .zonos--floated-input:-webkit-autofill,:host .zonos--floated-input:-moz-autofill{background-color:var(--zonos-elements-input-background);color:var(--zonos-elements-text-color)}:host .zonos--floated-label{display:block;max-height:0;pointer-events:none;-ms-flex-order:1;order:1}:host .zonos--floated-label label{color:var(--zonos-elements-gray-800);position:absolute;font-size:16px;line-height:16px;display:inline-block;-webkit-filter:blur(0);filter:blur(0);-webkit-transform-origin:left top;transform-origin:left top;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);margin-left:16px;top:calc(50% - 8px);z-index:1}:host .zonos--floated-label::after{content:\"\";position:absolute;left:0;right:0;top:0;bottom:0;border-radius:var(--zonos--border-radius)}:host .disabled .zonos--floated-label{pointer-events:inherit}:host .disabled .zonos--floated-label::after{cursor:not-allowed;z-index:1}:host(.dark) .zonos--label-wrapper{background:#30313d}";
12
12
  const ZonosStripeInputStyle0 = zonosStripeInputCss;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-2f90486e.js');
6
- const zonosStore = require('./zonosStore-7975e4b6.js');
6
+ const zonosStore = require('./zonosStore-3812b318.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
  const isColorVariable = require('./isColorVariable-525dbfa7.js');
9
9
  const styles = require('./styles-d1e64fb9.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-2f90486e.js');
6
- const zonosStore = require('./zonosStore-7975e4b6.js');
6
+ const zonosStore = require('./zonosStore-3812b318.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
 
9
9
  const zonosToggleCss = ":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 .wrapper{position:relative;border-radius:6px;background-color:var(--zonos-elements-gray-50);display:-ms-flexbox;display:flex}:host .zonos--toggle-selected-slider{z-index:1;position:absolute;background-color:var(--zonos-elements-raised-surface-color);height:100%;-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard);border-radius:6px;-webkit-animation:translate 0.3s ease-in-out;animation:translate 0.3s ease-in-out}:host .zonos--option{background:transparent;border:0;z-index:2;cursor:pointer;padding:4px 12px;border-radius:6px;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);font-size:var(--zonos-elements-font-size-base);font-weight:500;color:var(--zonos-elements-text-color-secondary)}:host .zonos--option:focus{outline:none}:host .zonos--option:hover:not(.selected){color:var(--zonos-elements-text-color)}:host .zonos--option.selected{color:var(--zonos-elements-text-color);background-color:var(--zonos-elements-raised-surface-color);height:100%;-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard);border-radius:6px;-webkit-animation:translate 0.3s ease-in-out;animation:translate 0.3s ease-in-out}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-2f90486e.js');
6
- const zonosStore = require('./zonosStore-7975e4b6.js');
6
+ const zonosStore = require('./zonosStore-3812b318.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
 
9
9
  const zonosVStackCss = ":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 .vstack{display:grid;grid-auto-columns:minmax(0, 1fr);grid-row-gap:var(--spacing, 24px);grid-auto-flow:row}";
@@ -2901,6 +2901,9 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
2901
2901
  zonosStore.currencyConverter = overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.currencyConverter;
2902
2902
  zonosStore.onCountryChange = overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.onCountryChange;
2903
2903
  zonosStore.overrideCurrencyFormat = overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.overrideCurrencyFormat;
2904
+ if (zonosStore.storeId) {
2905
+ window.Zonos.storeId = zonosStore.storeId;
2906
+ }
2904
2907
  };
2905
2908
  const zonosStoreFontFamily = () => {
2906
2909
  const fontFamily = zonosStore.appearance.fontFamily || 'Inter';
@@ -24,8 +24,10 @@ import { isDarkColor } from "../../utils/isDarkColor";
24
24
  import { jsonParse } from "../../utils/jsonParse";
25
25
  import { allLogs, log } from "../../utils/logging/log";
26
26
  import { logError } from "../../utils/logging/logError";
27
+ import { sendBulkLoadTimeApiLog } from "../../utils/logging/sendBulkLoadTimeApiLog";
27
28
  import { sendErrorLog } from "../../utils/logging/sendErrorLog";
28
29
  import { sendLoadCheckoutFacadeLog } from "../../utils/logging/sendLoadCheckoutFacadeLog";
30
+ import { sendLoadNativeCheckoutLog } from "../../utils/logging/sendLoadNativeCheckoutLog";
29
31
  import { mergeConfig } from "../../utils/mergeConfig";
30
32
  import { styles } from "../../utils/styles";
31
33
  import { submitGtag } from "../../utils/submitGtag";
@@ -424,6 +426,14 @@ export class ZonosCheckout {
424
426
  });
425
427
  button.addEventListener('click', async (e) => {
426
428
  var _a;
429
+ if (!window.Zonos.logIntervalId) {
430
+ // log the load time of all API calls every 2 seconds. This is to track the load time of all API calls for checkout user
431
+ window.Zonos.logIntervalId = setInterval(() => {
432
+ void sendBulkLoadTimeApiLog();
433
+ }, 2000);
434
+ }
435
+ // Start tracking load time
436
+ const startTime = performance.now();
427
437
  // Allow no country set for legacy facades. Otherwise enforce it being a shippable country and not disabled.
428
438
  if (!window.Zonos.isLegacyCheckout &&
429
439
  (!isShippableCountry() || isDisabledCountry())) {
@@ -472,6 +482,11 @@ export class ZonosCheckout {
472
482
  if (window.Zonos.isLegacyCheckout) {
473
483
  void sendLoadCheckoutFacadeLog();
474
484
  }
485
+ else {
486
+ const endTime = performance.now();
487
+ const loadTime = endTime - startTime;
488
+ void sendLoadNativeCheckoutLog({ loadTime });
489
+ }
475
490
  }
476
491
  catch (err) {
477
492
  // stop loading
@@ -142,6 +142,9 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
142
142
  zonosStore.currencyConverter = overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.currencyConverter;
143
143
  zonosStore.onCountryChange = overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.onCountryChange;
144
144
  zonosStore.overrideCurrencyFormat = overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.overrideCurrencyFormat;
145
+ if (zonosStore.storeId) {
146
+ window.Zonos.storeId = zonosStore.storeId;
147
+ }
145
148
  };
146
149
  const zonosStoreFontFamily = () => {
147
150
  const fontFamily = zonosStore.appearance.fontFamily || 'Inter';
@@ -15,6 +15,7 @@ import { getIsTestMode } from "./checkout/getIsTestMode";
15
15
  import { fallbackApiList, getNextFallbackApiType, MAIN_BASE_API_TYPE, } from "./getNextFallbackApi";
16
16
  import { jsonParse } from "./jsonParse";
17
17
  import { log } from "./logging/log";
18
+ import { prepLoadTimeApiLog } from "./logging/prepLoadTimeApiLog";
18
19
  import { sendErrorLog } from "./logging/sendErrorLog";
19
20
  const getResponseBody = async ({ response, shouldLog = true, shouldThrow = false, }) => {
20
21
  try {
@@ -152,11 +153,24 @@ const handleRequestWithFallback = async ({ basePathType: _basePathType, options,
152
153
  const basePathType = isBigcommerceEndpoint
153
154
  ? 'vercel'
154
155
  : _basePathType;
156
+ const startTime = performance.now();
155
157
  const _c = await handleRequest({
156
158
  basePathType,
157
159
  options,
158
160
  path,
159
161
  }), { errors, response } = _c, rest = __rest(_c, ["errors", "response"]);
162
+ const endTime = performance.now();
163
+ const duration = endTime - startTime;
164
+ // Send the load time api log
165
+ log(`${path} (${duration.toFixed(2)}ms)`, 'info');
166
+ // No need to send the load time api log for the log-script-load endpoint
167
+ const internalDuration = response === null || response === void 0 ? void 0 : response.headers.get('Zonos-Duration');
168
+ prepLoadTimeApiLog({
169
+ apiPath: path,
170
+ apiType: basePathType,
171
+ loadTimeInternal: internalDuration ? Number(internalDuration) : 0,
172
+ loadTimeTotal: duration,
173
+ });
160
174
  const nextFallbackApiType = getNextFallbackApiType(basePathType);
161
175
  const unknownError = errors.find(({ type }) => type === 'unknown');
162
176
  const isUnknownError = !!unknownError || (response === null || response === void 0 ? void 0 : response.status) === 404;
@@ -208,7 +222,6 @@ export const handleFetch = async (path, _opts) => {
208
222
  method });
209
223
  // This is for testing fallback API, set fallback API type to start with
210
224
  const useFallbackApi = new URLSearchParams(window.location.search).get('useFallbackApi');
211
- log(path, 'info');
212
225
  return handleRequestWithFallback({
213
226
  basePathType: useFallbackApi || MAIN_BASE_API_TYPE,
214
227
  options,
@@ -0,0 +1,19 @@
1
+ import { getNavigatorConnection } from "./getNavigatorConnection";
2
+ export const getAdditionalLogMetadata = () => {
3
+ const userAgentData = 'userAgentData' in window.navigator
4
+ ? // userAgentData is not yet supported in all browsers
5
+ window.navigator.userAgentData
6
+ : null;
7
+ const baseConnection = getNavigatorConnection();
8
+ return {
9
+ connectionDownlink: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.downlink,
10
+ connectionEffectiveType: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.effectiveType,
11
+ connectionRtt: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.rtt,
12
+ connectionSaveData: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.saveData,
13
+ screenHeight: window.screen.height,
14
+ screenWidth: window.screen.width,
15
+ userAgent: userAgentData && userAgentData.brands.length > 0
16
+ ? userAgentData
17
+ : window.navigator.userAgent,
18
+ };
19
+ };
@@ -0,0 +1,29 @@
1
+ import { getAdditionalLogMetadata } from "./getAdditionalLogMetadata";
2
+ const blackListPaths = [
3
+ '/api/zonos-elements/log-script-load',
4
+ '/api/zonos-elements/log-bulk-load',
5
+ ];
6
+ /**
7
+ * Prepares the load time api log for the given API call to send to the server later
8
+ * This function is used to prepare the load time api log for the given API call.
9
+ * It adds the load time api log to the loadTimeApiInfoList.
10
+ */
11
+ export const prepLoadTimeApiLog = ({ apiPath, apiType, loadTimeInternal, loadTimeTotal, }) => {
12
+ if (blackListPaths.includes(apiPath)) {
13
+ return;
14
+ }
15
+ const apiPathWithoutParams = apiPath.split('?')[0] || apiPath;
16
+ const scriptLoadLogBody = {
17
+ cache: 'miss',
18
+ cdnLoadTime: loadTimeTotal - loadTimeInternal,
19
+ eventName: 'jsdelivr',
20
+ flag: 'LOG_LOAD_TIME_API',
21
+ href: apiPathWithoutParams,
22
+ loadTime: loadTimeInternal,
23
+ metadata: Object.assign(Object.assign({ apiType }, getAdditionalLogMetadata()), { loadTimeClientMiddleware: loadTimeTotal - loadTimeInternal, loadTimeInternal,
24
+ loadTimeTotal }),
25
+ scriptLoadUrl: apiType,
26
+ storeId: window.Zonos.storeId,
27
+ };
28
+ window.Zonos.loadTimeApiInfoList.push(scriptLoadLogBody);
29
+ };
@@ -0,0 +1,30 @@
1
+ import { handleFetch } from "../handleFetch";
2
+ import { log } from "./log";
3
+ let numberOfFailures = 0;
4
+ export const sendBulkLoadTimeApiLog = async () => {
5
+ // Don't send the log if there are no API calls to send
6
+ if (window.Zonos.loadTimeApiInfoList.length === 0) {
7
+ return;
8
+ }
9
+ log('Sending bulk load time api log', 'info', {
10
+ loadTimeApiInfoList: window.Zonos.loadTimeApiInfoList,
11
+ });
12
+ // Clone the list so we can clear it after sending the log
13
+ const loadTimeApiInfoListArray = [...window.Zonos.loadTimeApiInfoList];
14
+ // Clear the list after sending the log successfully
15
+ window.Zonos.loadTimeApiInfoList.length = 0;
16
+ // Clear the list after sending the log successfully
17
+ const { errors } = await handleFetch('/api/zonos-elements/log-bulk-load', {
18
+ body: loadTimeApiInfoListArray,
19
+ method: 'POST',
20
+ });
21
+ if (errors.length) {
22
+ // If there are errors, add the logs back to the list so we can try again later
23
+ window.Zonos.loadTimeApiInfoList.push(...loadTimeApiInfoListArray);
24
+ numberOfFailures++;
25
+ if (numberOfFailures > 5 && window.Zonos.logIntervalId) {
26
+ // If there are more than 3 failures, stop the interval
27
+ clearInterval(window.Zonos.logIntervalId);
28
+ }
29
+ }
30
+ };
@@ -1,6 +1,6 @@
1
1
  import { handleFetch } from "../handleFetch";
2
+ import { getAdditionalLogMetadata } from "./getAdditionalLogMetadata";
2
3
  import { allLogs, getElapsedTime } from "./log";
3
- import { getAdditionalLogMetadata } from "./sendLoadScriptLog";
4
4
  const disabled = false;
5
5
  export const sendLoadCheckoutFacadeLog = async () => {
6
6
  if (disabled) {
@@ -0,0 +1,23 @@
1
+ import { handleFetch } from "../handleFetch";
2
+ import { getAdditionalLogMetadata } from "./getAdditionalLogMetadata";
3
+ import { allLogs } from "./log";
4
+ const disabled = false;
5
+ export const sendLoadNativeCheckoutLog = async ({ loadTime, }) => {
6
+ if (disabled) {
7
+ return;
8
+ }
9
+ const scriptLoadLogBody = {
10
+ cache: 'miss',
11
+ eventName: 'jsdelivr',
12
+ flag: 'LOG_NATIVE_CHECKOUT_LOAD',
13
+ href: window.location.href,
14
+ loadTime,
15
+ metadata: Object.assign({ allLogs }, getAdditionalLogMetadata()),
16
+ scriptLoadUrl: 'nativeCheckout',
17
+ storeId: window.Zonos.storeId,
18
+ };
19
+ void handleFetch('/api/zonos-elements/log-script-load', {
20
+ body: scriptLoadLogBody,
21
+ method: 'POST',
22
+ });
23
+ };
@@ -1,21 +1,5 @@
1
1
  import { handleFetch } from "../handleFetch";
2
- import { getNavigatorConnection } from "./getNavigatorConnection";
3
- export const getAdditionalLogMetadata = () => {
4
- const userAgentData = 'userAgentData' in window.navigator
5
- ? // userAgentData is not yet supported in all browsers
6
- window.navigator.userAgentData
7
- : null;
8
- const baseConnection = getNavigatorConnection();
9
- return {
10
- connectionDownlink: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.downlink,
11
- connectionEffectiveType: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.effectiveType,
12
- connectionRtt: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.rtt,
13
- connectionSaveData: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.saveData,
14
- userAgent: userAgentData && userAgentData.brands.length > 0
15
- ? userAgentData
16
- : window.navigator.userAgent,
17
- };
18
- };
2
+ import { getAdditionalLogMetadata } from "./getAdditionalLogMetadata";
19
3
  const disabled = true;
20
4
  export const sendLoadScriptLog = async (params) => {
21
5
  // turn off for now
@@ -64,6 +64,8 @@ Zonos.cartData = null;
64
64
  Zonos.paypal = null;
65
65
  Zonos.getCurrentTimestamp = () => new Date().getTime();
66
66
  Zonos.zonosController = null;
67
+ Zonos.loadTimeApiInfoList = [];
68
+ Zonos.logIntervalId = null;
67
69
  Zonos.init = async (params) => {
68
70
  const { appearance, checkoutSettings, currencyConverter, helloSettings, onCountryChange, overrideCurrencyFormat, storeId, zonosApiKey, } = params;
69
71
  _a.cartId = getCartIdFromQueryParam();
@@ -468,6 +468,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
468
468
  cleanupTestZonosElementSetting(variables, requestHeaders) {
469
469
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'cleanupTestZonosElementSetting', 'mutation');
470
470
  },
471
+ createBulkLoadEvent(variables, requestHeaders) {
472
+ return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'createBulkLoadEvent', 'mutation');
473
+ },
471
474
  createErrorEvent(variables, requestHeaders) {
472
475
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'createErrorEvent', 'mutation');
473
476
  },
@@ -1,4 +1,4 @@
1
- import { g as getIsTestMode, h as handleFetch, l as log, b as logError } from './handleFetch-b4633675.js';
1
+ import { g as getIsTestMode, h as handleFetch, l as log, b as logError } from './handleFetch-8d72c8cd.js';
2
2
 
3
3
  const getTempCartById = async ({ cartId, retries, }) => {
4
4
  const isTestMode = getIsTestMode();
@@ -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,6 +1,6 @@
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 { g as getIsTestMode, a as getIsStagingMode, l as log, h as handleFetch, 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
6
  /**
@@ -126,7 +126,7 @@ const getZonosQaUrl = () => {
126
126
  return null;
127
127
  }
128
128
  const qaUrl = extractZonosQaUrl(window.location.href);
129
- const cdnUrl = "https://v1.3.168.js.zonos.com";
129
+ const cdnUrl = "https://v1.3.170.js.zonos.com";
130
130
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
131
131
  if (!qaUrl &&
132
132
  (cdnUrl.includes('test.') ||
@@ -310,10 +310,10 @@ const zonosLoadUrl = (() => {
310
310
  }
311
311
  return null;
312
312
  })();
313
- const ZONOS_URL = "https://v1.3.168.js.zonos.com";
314
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.168";
315
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.168";
316
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.168";
313
+ const ZONOS_URL = "https://v1.3.170.js.zonos.com";
314
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.170";
315
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.170";
316
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.170";
317
317
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
318
318
  const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
319
319
  class Zonos {
@@ -327,7 +327,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
327
327
  !!window.location.search.match(/\?.*(&*)zonosConversionTest/);
328
328
  Zonos._paypalMockResponse = null;
329
329
  Zonos.isBigCommerce = false;
330
- Zonos.releaseDate = "1741638596050";
330
+ Zonos.releaseDate = "1741970849426";
331
331
  Zonos.isLegacyCheckout = false;
332
332
  Zonos.domain = typeof window !== 'undefined'
333
333
  ? // domain that embeds the iframe
@@ -343,12 +343,14 @@ Zonos.showBaseForeign = typeof window !== 'undefined' &&
343
343
  Zonos.isNpm = true;
344
344
  Zonos.zonosQaUrl = null;
345
345
  Zonos.zonosQaUrlApi = null;
346
- Zonos.version = `v${"1.3.168"}`;
346
+ Zonos.version = `v${"1.3.170"}`;
347
347
  Zonos.modeAlerted = false;
348
348
  Zonos.cartData = null;
349
349
  Zonos.paypal = null;
350
350
  Zonos.getCurrentTimestamp = () => new Date().getTime();
351
351
  Zonos.zonosController = null;
352
+ Zonos.loadTimeApiInfoList = [];
353
+ Zonos.logIntervalId = null;
352
354
  Zonos.init = async (params) => {
353
355
  const { appearance, checkoutSettings, currencyConverter, helloSettings, onCountryChange, overrideCurrencyFormat, storeId, zonosApiKey, } = params;
354
356
  _a.cartId = getCartIdFromQueryParam();
@@ -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)