@zonos/elements 1.3.258 → 1.3.260

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 (177) hide show
  1. package/dist/cjs/{cart-c618fd5b.js → cart-d08c87e2.js} +1 -1
  2. package/dist/cjs/{hasInclusivePrice-58a9f15d.js → hasInclusivePrice-c781c336.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{invoice-c9cb6683.js → invoice-e64f97c6.js} +2 -2
  5. package/dist/cjs/{isCollectMobileTablet-93a5194a.js → isCollectMobileTablet-9675485f.js} +2 -2
  6. package/dist/cjs/{localization-5994d4de.js → localization-a7fac4b4.js} +3 -0
  7. package/dist/cjs/{paypal-091e089e.js → paypal-73a542cb.js} +2 -2
  8. package/dist/cjs/{placeTestOrder-b07f8edb.js → placeTestOrder-aefd31e8.js} +2 -2
  9. package/dist/cjs/{renderCheckoutCurrency-7876a1d4.js → renderCheckoutCurrency-a374741a.js} +2 -2
  10. package/dist/cjs/zonos-address-display_8.cjs.entry.js +2 -2
  11. package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
  13. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +6 -6
  14. package/dist/cjs/zonos-checkout.cjs.entry.js +442 -17
  15. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
  16. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
  17. package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
  18. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  19. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  20. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  21. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +8 -8
  22. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
  24. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +6 -6
  25. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
  26. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  27. package/dist/cjs/zonos-store-credit.cjs.entry.js +3 -3
  28. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +72 -0
  29. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +6 -6
  30. package/dist/collection/components/store/hello/localization.js +3 -0
  31. package/dist/collection/components/utils/checkout/bigcommerceStorefrontApi.js +6 -0
  32. package/dist/collection/components/utils/checkout/buildBigcommerceLoginUrl.js +65 -0
  33. package/dist/collection/components/utils/checkout/checkBigCommerceBypassCustomerGroup.js +12 -7
  34. package/dist/collection/components/utils/checkout/checkBigCommerceForceLogin.js +116 -0
  35. package/dist/collection/components/utils/checkout/fetchBigCommerceCheckoutSettings.js +92 -0
  36. package/dist/collection/components/utils/checkout/fixBigCommerceLoginCreateAccountLink.js +53 -0
  37. package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +40 -7
  38. package/dist/collection/types/checkout/api/BigCommerceCheckoutSettings.js +1 -0
  39. package/dist/collection/types/generated/graphql.frontend.types.js +2 -0
  40. package/dist/collection/types/generated/graphql.internal.types.js +39 -0
  41. package/dist/collection/types/index.js +1 -0
  42. package/dist/esm/{cart-76fb528f.js → cart-c490d252.js} +1 -1
  43. package/dist/esm/{hasInclusivePrice-275b1048.js → hasInclusivePrice-7a0ce66a.js} +1 -1
  44. package/dist/esm/index.js +7 -7
  45. package/dist/esm/{invoice-9efcb941.js → invoice-3ea5715b.js} +2 -2
  46. package/dist/esm/{isCollectMobileTablet-a7e5b909.js → isCollectMobileTablet-0dcbd45a.js} +2 -2
  47. package/dist/esm/{localization-76ce3e29.js → localization-542dbe20.js} +3 -0
  48. package/dist/esm/{paypal-75c5c66d.js → paypal-38ca5d21.js} +2 -2
  49. package/dist/esm/{placeTestOrder-22633bf2.js → placeTestOrder-d7001709.js} +2 -2
  50. package/dist/esm/{renderCheckoutCurrency-d27b0082.js → renderCheckoutCurrency-75f1bba3.js} +2 -2
  51. package/dist/esm/zonos-address-display_8.entry.js +2 -2
  52. package/dist/esm/zonos-address_4.entry.js +2 -2
  53. package/dist/esm/zonos-card_5.entry.js +3 -3
  54. package/dist/esm/zonos-cart-items_12.entry.js +6 -6
  55. package/dist/esm/zonos-checkout.entry.js +443 -18
  56. package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
  57. package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
  58. package/dist/esm/zonos-collect.entry.js +4 -4
  59. package/dist/esm/zonos-controller.entry.js +2 -2
  60. package/dist/esm/zonos-country-flag.entry.js +1 -1
  61. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  62. package/dist/esm/zonos-hello-dialog.entry.js +8 -8
  63. package/dist/esm/zonos-hello.entry.js +1 -1
  64. package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
  65. package/dist/esm/zonos-invoice-finish_5.entry.js +6 -6
  66. package/dist/esm/zonos-invoice.entry.js +4 -4
  67. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  68. package/dist/esm/zonos-store-credit.entry.js +3 -3
  69. package/dist/esm-es5/{cart-76fb528f.js → cart-c490d252.js} +1 -1
  70. package/dist/esm-es5/{hasInclusivePrice-275b1048.js → hasInclusivePrice-7a0ce66a.js} +1 -1
  71. package/dist/esm-es5/index.js +1 -1
  72. package/dist/esm-es5/{invoice-9efcb941.js → invoice-3ea5715b.js} +1 -1
  73. package/dist/esm-es5/{isCollectMobileTablet-a7e5b909.js → isCollectMobileTablet-0dcbd45a.js} +1 -1
  74. package/dist/esm-es5/{localization-76ce3e29.js → localization-542dbe20.js} +1 -1
  75. package/dist/esm-es5/{paypal-75c5c66d.js → paypal-38ca5d21.js} +2 -2
  76. package/dist/esm-es5/{placeTestOrder-22633bf2.js → placeTestOrder-d7001709.js} +1 -1
  77. package/dist/esm-es5/{renderCheckoutCurrency-d27b0082.js → renderCheckoutCurrency-75f1bba3.js} +1 -1
  78. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  79. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  80. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  81. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  82. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  83. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  84. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  85. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  86. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  87. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  88. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  89. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  90. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  91. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  92. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  93. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  94. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  95. package/dist/esm-es5/zonos-store-credit.entry.js +1 -1
  96. package/dist/scripts/index.d.ts +21 -5
  97. package/dist/scripts/index.js +1 -1
  98. package/dist/scripts/loadZonos.js +1 -1
  99. package/dist/scripts/zonos.js +1 -1
  100. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +16 -0
  101. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  102. package/dist/types/components/utils/checkout/bigcommerceStorefrontApi.d.ts +6 -0
  103. package/dist/types/components/utils/checkout/buildBigcommerceLoginUrl.d.ts +27 -0
  104. package/dist/types/components/utils/checkout/checkBigCommerceBypassCustomerGroup.d.ts +12 -0
  105. package/dist/types/components/utils/checkout/checkBigCommerceForceLogin.d.ts +50 -0
  106. package/dist/types/components/utils/checkout/fetchBigCommerceCheckoutSettings.d.ts +18 -0
  107. package/dist/types/components/utils/checkout/fixBigCommerceLoginCreateAccountLink.d.ts +17 -0
  108. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +6 -5
  109. package/dist/types/types/checkout/CheckoutConfig.d.ts +9 -0
  110. package/dist/types/types/checkout/api/BigCommerceCheckoutSettings.d.ts +12 -0
  111. package/dist/types/types/generated/graphql.frontend.types.d.ts +3 -1
  112. package/dist/types/types/generated/graphql.frontend.types.ts +3 -1
  113. package/dist/types/types/generated/graphql.internal.types.d.ts +58 -9
  114. package/dist/types/types/generated/graphql.internal.types.ts +69 -9
  115. package/dist/types/types/index.d.ts +1 -0
  116. package/dist/zonos-elements/index.esm.js +1 -1
  117. package/dist/zonos-elements/{p-6d36b307.system.js → p-0699931c.system.js} +1 -1
  118. package/dist/zonos-elements/{p-29d16ad0.entry.js → p-0ad75f38.entry.js} +1 -1
  119. package/dist/zonos-elements/{p-e6168c82.system.js → p-0ec4e307.system.js} +1 -1
  120. package/dist/zonos-elements/p-0f89fc76.system.entry.js +1 -0
  121. package/dist/zonos-elements/{p-4b138a6e.system.entry.js → p-0fc5a2cc.system.entry.js} +1 -1
  122. package/dist/zonos-elements/{p-2ec799e4.system.js → p-196423ad.system.js} +1 -1
  123. package/dist/zonos-elements/{p-567abb43.system.js → p-20263609.system.js} +1 -1
  124. package/dist/zonos-elements/{p-a89096d6.system.entry.js → p-20842d8c.system.entry.js} +1 -1
  125. package/dist/zonos-elements/{p-bdb3f7a2.js → p-24407504.js} +2 -2
  126. package/dist/zonos-elements/{p-1523f6a8.system.js → p-248bdea2.system.js} +1 -1
  127. package/dist/zonos-elements/{p-a4b6865d.system.entry.js → p-266a86d4.system.entry.js} +1 -1
  128. package/dist/zonos-elements/{p-bba9af4c.entry.js → p-27f01d76.entry.js} +1 -1
  129. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  130. package/dist/zonos-elements/{p-b34f1336.system.entry.js → p-2ac0fcb8.system.entry.js} +1 -1
  131. package/dist/zonos-elements/{p-5fa3d1c8.system.entry.js → p-2c9714e8.system.entry.js} +1 -1
  132. package/dist/zonos-elements/{p-edb0306c.system.entry.js → p-365d4481.system.entry.js} +1 -1
  133. package/dist/zonos-elements/{p-7157a5a3.entry.js → p-3a198386.entry.js} +1 -1
  134. package/dist/zonos-elements/{p-1e9e284e.system.entry.js → p-3e7dbe9c.system.entry.js} +1 -1
  135. package/dist/zonos-elements/{p-99d92a84.entry.js → p-4416fe27.entry.js} +1 -1
  136. package/dist/zonos-elements/{p-e8a68ce7.system.js → p-47bde0ba.system.js} +1 -1
  137. package/dist/zonos-elements/p-4aa5f5db.entry.js +1 -0
  138. package/dist/zonos-elements/{p-afdb4445.entry.js → p-5be87ae0.entry.js} +1 -1
  139. package/dist/zonos-elements/p-6b7beb44.system.js +1 -0
  140. package/dist/zonos-elements/{p-e5f48239.system.entry.js → p-70e2f9f9.system.entry.js} +1 -1
  141. package/dist/zonos-elements/{p-3ee8496e.js → p-7158a18b.js} +1 -1
  142. package/dist/zonos-elements/{p-867d05d7.system.js → p-720ae42c.system.js} +1 -1
  143. package/dist/zonos-elements/p-721fadd5.js +1 -0
  144. package/dist/zonos-elements/{p-24f41959.js → p-72adb40d.js} +1 -1
  145. package/dist/zonos-elements/p-7c5c5318.js +1 -0
  146. package/dist/zonos-elements/{p-9c97671b.system.entry.js → p-874ccf1c.system.entry.js} +1 -1
  147. package/dist/zonos-elements/{p-0a9741f7.entry.js → p-87eef44c.entry.js} +1 -1
  148. package/dist/zonos-elements/{p-6cf8fe49.system.entry.js → p-8d0bca3a.system.entry.js} +1 -1
  149. package/dist/zonos-elements/{p-9a9c9441.system.entry.js → p-8d52ac69.system.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-791e13e7.entry.js → p-8dae0f0b.entry.js} +1 -1
  151. package/dist/zonos-elements/{p-6e50f6f5.entry.js → p-8df3c6a0.entry.js} +1 -1
  152. package/dist/zonos-elements/{p-5182e492.entry.js → p-9dc671f4.entry.js} +1 -1
  153. package/dist/zonos-elements/{p-2d854a75.entry.js → p-a3020bc9.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-a18adf27.js → p-a75b8ad7.js} +1 -1
  155. package/dist/zonos-elements/{p-bd938f80.js → p-a8bb461c.js} +1 -1
  156. package/dist/zonos-elements/{p-2b2b1c8c.system.entry.js → p-b21cf539.system.entry.js} +1 -1
  157. package/dist/zonos-elements/{p-1ebb59a3.js → p-b5223840.js} +1 -1
  158. package/dist/zonos-elements/{p-10da499b.system.entry.js → p-bf4d2299.system.entry.js} +1 -1
  159. package/dist/zonos-elements/{p-425f747b.entry.js → p-c09540bc.entry.js} +1 -1
  160. package/dist/zonos-elements/{p-1661f938.entry.js → p-c308c5bc.entry.js} +1 -1
  161. package/dist/zonos-elements/{p-9460919d.entry.js → p-cdf99051.entry.js} +1 -1
  162. package/dist/zonos-elements/{p-788c6839.entry.js → p-d12fa775.entry.js} +1 -1
  163. package/dist/zonos-elements/{p-055c8d6c.system.entry.js → p-d2ef0416.system.entry.js} +1 -1
  164. package/dist/zonos-elements/{p-afca19b0.system.entry.js → p-d4f9e464.system.entry.js} +1 -1
  165. package/dist/zonos-elements/{p-3600280d.system.js → p-d7a9be55.system.js} +1 -1
  166. package/dist/zonos-elements/{p-5262f6e8.entry.js → p-da5a35a6.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-8585c761.system.entry.js → p-df240101.system.entry.js} +1 -1
  168. package/dist/zonos-elements/{p-14d35979.system.entry.js → p-df578aa9.system.entry.js} +1 -1
  169. package/dist/zonos-elements/{p-9cff66a7.entry.js → p-e684e68f.entry.js} +1 -1
  170. package/dist/zonos-elements/{p-a0f6910c.entry.js → p-f2a74e43.entry.js} +1 -1
  171. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  172. package/package.json +1 -1
  173. package/dist/zonos-elements/p-50b32476.system.entry.js +0 -1
  174. package/dist/zonos-elements/p-733f118d.entry.js +0 -1
  175. package/dist/zonos-elements/p-868a8667.js +0 -1
  176. package/dist/zonos-elements/p-c85e988d.system.js +0 -1
  177. package/dist/zonos-elements/p-ed03b7fd.js +0 -1
@@ -147,24 +147,25 @@ export declare const setupCartDataWithSettings: (cartId: string) => Promise<{
147
147
  includedCountries: Array<import("../..").CountryCode>;
148
148
  };
149
149
  };
150
+ countryOverrideBehavior: import("../../types/generated/graphql.internal.types").HelloCountryOverrideBehavior;
150
151
  createdAt: string;
151
- organization: string;
152
+ createdBy: string;
152
153
  currencyBehavior: import("../../types/generated/graphql.internal.types").HelloCurrencyBehavior;
153
154
  currencyElementSelector: string;
154
155
  desktopLocation: import("../../types/generated/graphql.internal.types").HelloDesktopLocation;
155
156
  dutyTaxEstimationBehavior: import("../../types/generated/graphql.internal.types").HelloEstimateBehavior;
156
157
  excludedUrlPatterns: Array<string>;
157
- homepageUrlPattern: string | null;
158
+ organization: string;
158
159
  id: string;
159
160
  mobileLocation: import("../..").HelloMobileLocation;
160
161
  mode: import("../../types/generated/graphql.internal.types").Mode;
161
- productTitleElementSelector: string | null;
162
+ homepageUrlPattern: string | null;
162
163
  peekMessageBehavior: import("../../types/generated/graphql.internal.types").HelloPeekMessageBehavior;
163
164
  peekMessageDelay: number;
164
- productAddToCartElementSelector: string | null;
165
165
  productListUrlPattern: string | null;
166
+ productAddToCartElementSelector: string | null;
166
167
  productDetailUrlPattern: string | null;
167
- createdBy: string;
168
+ productTitleElementSelector: string | null;
168
169
  productPriceElementSelector: string | null;
169
170
  productDescriptionElementSelector: string | null;
170
171
  restrictionBehavior: import("../../types/generated/graphql.internal.types").HelloRestrictionBehavior;
@@ -62,6 +62,15 @@ export type CheckoutConfig = {
62
62
  status: AnalyticsProviderStatus;
63
63
  type: AnalyticsProviderType;
64
64
  }>;
65
+ /**
66
+ * BigCommerce-specific identifiers forwarded by the Zonos loader script.
67
+ * Consumed by runtime code that needs to hit the demo-app proxy on behalf
68
+ * of a specific BigCommerce store (e.g. the `/checkouts/settings`
69
+ * force-login check).
70
+ */
71
+ bigCommerceConfig?: {
72
+ storeHash: string;
73
+ };
65
74
  /**
66
75
  * Time that payment will be captured after the order is placed. Can't be overridden in Zonos.init
67
76
  */
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Value surfaced by BigCommerce's `/v3/checkouts/settings` endpoint for the
3
+ * `guest_checkout_type` field. `no_guest_checkout` is the signal Zonos uses
4
+ * to require login before opening the international checkout.
5
+ */
6
+ export type BcGuestCheckoutType = 'allow_guest' | 'guest_checkout' | 'no_guest_checkout' | (string & {});
7
+ export type BigCommerceCheckoutSettingsPayload = {
8
+ storeHash: string;
9
+ };
10
+ export type BigCommerceCheckoutSettingsResponse = {
11
+ guestCheckoutType: BcGuestCheckoutType | null;
12
+ };
@@ -106,6 +106,7 @@ export declare const featureAspectKeyEnum: {
106
106
  readonly NewCheckoutBeta: "new_checkout_beta";
107
107
  readonly NewPayoutReport: "new_payout_report";
108
108
  readonly NewRefundsUx: "new_refunds_ux";
109
+ readonly OnboardingBeta: "onboarding_beta";
109
110
  readonly PageAuditor: "page_auditor";
110
111
  readonly PromptExplorer: "prompt_explorer";
111
112
  readonly RulesUiCreate: "rules_ui_create";
@@ -139,6 +140,7 @@ export declare const featureAudienceNameEnum: {
139
140
  readonly NewPayoutReportMerchant: "new_payout_report_merchant";
140
141
  readonly NewRefundsUxMerchant: "new_refunds_ux_merchant";
141
142
  readonly Onboarding: "onboarding";
143
+ readonly OnboardingBetaMerchant: "onboarding_beta_merchant";
142
144
  readonly PrincipalEngineer: "principal_engineer";
143
145
  readonly ProServeHead: "pro_serve_head";
144
146
  readonly ProductManager: "product_manager";
@@ -727,7 +729,7 @@ export type FailToGetQuoteErrorsQuery = {
727
729
  };
728
730
  export type LocaleCountryMessagesQuery = {
729
731
  locale_countryCodesPage: Array<{
730
- countryCodes: Array<string>;
732
+ countryCodes: Array<string> | null;
731
733
  countryCodesPageMessageLinks: Array<{
732
734
  id: number;
733
735
  message: {
@@ -85,6 +85,7 @@ export const featureAspectKeyEnum = {
85
85
  NewCheckoutBeta: 'new_checkout_beta',
86
86
  NewPayoutReport: 'new_payout_report',
87
87
  NewRefundsUx: 'new_refunds_ux',
88
+ OnboardingBeta: 'onboarding_beta',
88
89
  PageAuditor: 'page_auditor',
89
90
  PromptExplorer: 'prompt_explorer',
90
91
  RulesUiCreate: 'rules_ui_create',
@@ -123,6 +124,7 @@ export const featureAudienceNameEnum = {
123
124
  NewPayoutReportMerchant: 'new_payout_report_merchant',
124
125
  NewRefundsUxMerchant: 'new_refunds_ux_merchant',
125
126
  Onboarding: 'onboarding',
127
+ OnboardingBetaMerchant: 'onboarding_beta_merchant',
126
128
  PrincipalEngineer: 'principal_engineer',
127
129
  ProServeHead: 'pro_serve_head',
128
130
  ProductManager: 'product_manager',
@@ -684,7 +686,7 @@ export type FailToGetQuoteErrorsQuery = {
684
686
 
685
687
  export type LocaleCountryMessagesQuery = {
686
688
  locale_countryCodesPage: Array<{
687
- countryCodes: Array<string>;
689
+ countryCodes: Array<string> | null;
688
690
  countryCodesPageMessageLinks: Array<{
689
691
  id: number;
690
692
  message: {
@@ -1906,6 +1906,20 @@ export declare const customsDocumentType: {
1906
1906
  readonly UsmcaCertificate: "USMCA_CERTIFICATE";
1907
1907
  };
1908
1908
  export type CustomsDocumentType = (typeof customsDocumentType)[keyof typeof customsDocumentType];
1909
+ export declare const customsHoldReason: {
1910
+ readonly Abandonment: "ABANDONMENT";
1911
+ readonly Confiscated: "CONFISCATED";
1912
+ readonly DutyNonpayment: "DUTY_NONPAYMENT";
1913
+ readonly Examination: "EXAMINATION";
1914
+ readonly GoodsNotCompliant: "GOODS_NOT_COMPLIANT";
1915
+ readonly GovernmentHold: "GOVERNMENT_HOLD";
1916
+ readonly MissingData: "MISSING_DATA";
1917
+ readonly MissingDocs: "MISSING_DOCS";
1918
+ readonly RefusedEntry: "REFUSED_ENTRY";
1919
+ readonly SecurityFail: "SECURITY_FAIL";
1920
+ readonly Unknown: "UNKNOWN";
1921
+ };
1922
+ export type CustomsHoldReason = (typeof customsHoldReason)[keyof typeof customsHoldReason];
1909
1923
  export declare const customsIntelBucketGranularity: {
1910
1924
  readonly Day: "DAY";
1911
1925
  readonly Hour: "HOUR";
@@ -1982,6 +1996,14 @@ export declare const customsSpecSourceType: {
1982
1996
  readonly OrganizationSetting: "ORGANIZATION_SETTING";
1983
1997
  };
1984
1998
  export type CustomsSpecSourceType = (typeof customsSpecSourceType)[keyof typeof customsSpecSourceType];
1999
+ export declare const customsStage: {
2000
+ readonly CustomsCleared: "CUSTOMS_CLEARED";
2001
+ readonly CustomsFailed: "CUSTOMS_FAILED";
2002
+ readonly CustomsHold: "CUSTOMS_HOLD";
2003
+ readonly InCustoms: "IN_CUSTOMS";
2004
+ readonly PreCustoms: "PRE_CUSTOMS";
2005
+ };
2006
+ export type CustomsStage = (typeof customsStage)[keyof typeof customsStage];
1985
2007
  export declare const dashboardUnit: {
1986
2008
  readonly Imperial: "IMPERIAL";
1987
2009
  readonly Metric: "METRIC";
@@ -2281,6 +2303,7 @@ export declare const entryStatus: {
2281
2303
  readonly Archived: "ARCHIVED";
2282
2304
  readonly Draft: "DRAFT";
2283
2305
  readonly Error: "ERROR";
2306
+ readonly Filed: "FILED";
2284
2307
  readonly Rejected: "REJECTED";
2285
2308
  readonly Submitted: "SUBMITTED";
2286
2309
  };
@@ -2296,6 +2319,7 @@ export declare const errorDetail: {
2296
2319
  readonly TcpFailure: "TCP_FAILURE";
2297
2320
  readonly ThrottledConcurrency: "THROTTLED_CONCURRENCY";
2298
2321
  readonly ThrottledCpu: "THROTTLED_CPU";
2322
+ readonly TooManyRequests: "TOO_MANY_REQUESTS";
2299
2323
  readonly Unimplemented: "UNIMPLEMENTED";
2300
2324
  readonly Unknown: "UNKNOWN";
2301
2325
  };
@@ -2399,6 +2423,11 @@ export declare const helloCountryDisplayBehavior: {
2399
2423
  readonly OnlyShippable: "ONLY_SHIPPABLE";
2400
2424
  };
2401
2425
  export type HelloCountryDisplayBehavior = (typeof helloCountryDisplayBehavior)[keyof typeof helloCountryDisplayBehavior];
2426
+ export declare const helloCountryOverrideBehavior: {
2427
+ readonly Session: "SESSION";
2428
+ readonly UrlParam: "URL_PARAM";
2429
+ };
2430
+ export type HelloCountryOverrideBehavior = (typeof helloCountryOverrideBehavior)[keyof typeof helloCountryOverrideBehavior];
2402
2431
  export declare const helloCurrencyBehavior: {
2403
2432
  readonly Disabled: "DISABLED";
2404
2433
  readonly Enabled: "ENABLED";
@@ -4966,6 +4995,12 @@ export declare const reverseAmountType: {
4966
4995
  readonly TaxFee: "TAX_FEE";
4967
4996
  };
4968
4997
  export type ReverseAmountType = (typeof reverseAmountType)[keyof typeof reverseAmountType];
4998
+ export declare const riskLevel: {
4999
+ readonly High: "HIGH";
5000
+ readonly Low: "LOW";
5001
+ readonly Medium: "MEDIUM";
5002
+ };
5003
+ export type RiskLevel = (typeof riskLevel)[keyof typeof riskLevel];
4969
5004
  export declare const roundingMethod: {
4970
5005
  readonly Custom: "CUSTOM";
4971
5006
  readonly Hundredth: "HUNDREDTH";
@@ -5184,6 +5219,10 @@ export declare const shipmentPackagingTypeCode: {
5184
5219
  readonly YourPackaging: "YOUR_PACKAGING";
5185
5220
  };
5186
5221
  export type ShipmentPackagingTypeCode = (typeof shipmentPackagingTypeCode)[keyof typeof shipmentPackagingTypeCode];
5222
+ export declare const shipmentRatingAdjustmentType: {
5223
+ readonly CartTotal: "CART_TOTAL";
5224
+ };
5225
+ export type ShipmentRatingAdjustmentType = (typeof shipmentRatingAdjustmentType)[keyof typeof shipmentRatingAdjustmentType];
5187
5226
  export declare const shipmentRatingAmountTargetType: {
5188
5227
  readonly BillingCompany: "BILLING_COMPANY";
5189
5228
  readonly MerchantBase: "MERCHANT_BASE";
@@ -5758,6 +5797,12 @@ export declare const volumeUnitCode: {
5758
5797
  readonly QuartUsDry: "QUART_US_DRY";
5759
5798
  };
5760
5799
  export type VolumeUnitCode = (typeof volumeUnitCode)[keyof typeof volumeUnitCode];
5800
+ export declare const watchStatus: {
5801
+ readonly Active: "ACTIVE";
5802
+ readonly Completed: "COMPLETED";
5803
+ readonly Expired: "EXPIRED";
5804
+ };
5805
+ export type WatchStatus = (typeof watchStatus)[keyof typeof watchStatus];
5761
5806
  export declare const wcoVersion: {
5762
5807
  readonly Wco_1997: "WCO_1997";
5763
5808
  readonly Wco_2002: "WCO_2002";
@@ -7176,24 +7221,25 @@ export type CartCheckoutWorkflowQuery = {
7176
7221
  includedCountries: Array<CountryCode>;
7177
7222
  };
7178
7223
  };
7224
+ countryOverrideBehavior: HelloCountryOverrideBehavior;
7179
7225
  createdAt: string;
7180
- organization: string;
7226
+ createdBy: string;
7181
7227
  currencyBehavior: HelloCurrencyBehavior;
7182
7228
  currencyElementSelector: string;
7183
7229
  desktopLocation: HelloDesktopLocation;
7184
7230
  dutyTaxEstimationBehavior: HelloEstimateBehavior;
7185
7231
  excludedUrlPatterns: Array<string>;
7186
- homepageUrlPattern: string | null;
7232
+ organization: string;
7187
7233
  id: string;
7188
7234
  mobileLocation: HelloMobileLocation;
7189
7235
  mode: Mode;
7190
- productTitleElementSelector: string | null;
7236
+ homepageUrlPattern: string | null;
7191
7237
  peekMessageBehavior: HelloPeekMessageBehavior;
7192
7238
  peekMessageDelay: number;
7193
- productAddToCartElementSelector: string | null;
7194
7239
  productListUrlPattern: string | null;
7240
+ productAddToCartElementSelector: string | null;
7195
7241
  productDetailUrlPattern: string | null;
7196
- createdBy: string;
7242
+ productTitleElementSelector: string | null;
7197
7243
  productPriceElementSelector: string | null;
7198
7244
  productDescriptionElementSelector: string | null;
7199
7245
  restrictionBehavior: HelloRestrictionBehavior;
@@ -7876,8 +7922,9 @@ export type ZonosSettingsQuery = {
7876
7922
  includedCountries: Array<CountryCode>;
7877
7923
  };
7878
7924
  };
7925
+ countryOverrideBehavior: HelloCountryOverrideBehavior;
7879
7926
  createdAt: string;
7880
- productTitleElementSelector: string | null;
7927
+ createdBy: string;
7881
7928
  currencyBehavior: HelloCurrencyBehavior;
7882
7929
  currencyElementSelector: string;
7883
7930
  desktopLocation: HelloDesktopLocation;
@@ -7891,11 +7938,11 @@ export type ZonosSettingsQuery = {
7891
7938
  peekMessageBehavior: HelloPeekMessageBehavior;
7892
7939
  peekMessageDelay: number;
7893
7940
  productAddToCartElementSelector: string | null;
7894
- createdBy: string;
7895
- productDetailUrlPattern: string | null;
7896
7941
  productListUrlPattern: string | null;
7897
- productPriceElementSelector: string | null;
7942
+ productDetailUrlPattern: string | null;
7898
7943
  productDescriptionElementSelector: string | null;
7944
+ productPriceElementSelector: string | null;
7945
+ productTitleElementSelector: string | null;
7899
7946
  restrictionBehavior: HelloRestrictionBehavior;
7900
7947
  updatedAt: string;
7901
7948
  updatedBy: string;
@@ -7930,6 +7977,7 @@ export type HelloSettingsQuery = {
7930
7977
  includedCountries: Array<CountryCode>;
7931
7978
  };
7932
7979
  };
7980
+ countryOverrideBehavior: HelloCountryOverrideBehavior;
7933
7981
  createdAt: string;
7934
7982
  createdBy: string;
7935
7983
  currencyBehavior: HelloCurrencyBehavior;
@@ -8108,6 +8156,7 @@ export type HelloSettingFragment = {
8108
8156
  includedCountries: Array<CountryCode>;
8109
8157
  };
8110
8158
  };
8159
+ countryOverrideBehavior: HelloCountryOverrideBehavior;
8111
8160
  createdAt: string;
8112
8161
  createdBy: string;
8113
8162
  currencyBehavior: HelloCurrencyBehavior;
@@ -2221,6 +2221,23 @@ export const customsDocumentType = {
2221
2221
  export type CustomsDocumentType =
2222
2222
  (typeof customsDocumentType)[keyof typeof customsDocumentType];
2223
2223
 
2224
+ export const customsHoldReason = {
2225
+ Abandonment: 'ABANDONMENT',
2226
+ Confiscated: 'CONFISCATED',
2227
+ DutyNonpayment: 'DUTY_NONPAYMENT',
2228
+ Examination: 'EXAMINATION',
2229
+ GoodsNotCompliant: 'GOODS_NOT_COMPLIANT',
2230
+ GovernmentHold: 'GOVERNMENT_HOLD',
2231
+ MissingData: 'MISSING_DATA',
2232
+ MissingDocs: 'MISSING_DOCS',
2233
+ RefusedEntry: 'REFUSED_ENTRY',
2234
+ SecurityFail: 'SECURITY_FAIL',
2235
+ Unknown: 'UNKNOWN',
2236
+ } as const;
2237
+
2238
+ export type CustomsHoldReason =
2239
+ (typeof customsHoldReason)[keyof typeof customsHoldReason];
2240
+
2224
2241
  export const customsIntelBucketGranularity = {
2225
2242
  Day: 'DAY',
2226
2243
  Hour: 'HOUR',
@@ -2322,6 +2339,15 @@ export const customsSpecSourceType = {
2322
2339
  export type CustomsSpecSourceType =
2323
2340
  (typeof customsSpecSourceType)[keyof typeof customsSpecSourceType];
2324
2341
 
2342
+ export const customsStage = {
2343
+ CustomsCleared: 'CUSTOMS_CLEARED',
2344
+ CustomsFailed: 'CUSTOMS_FAILED',
2345
+ CustomsHold: 'CUSTOMS_HOLD',
2346
+ InCustoms: 'IN_CUSTOMS',
2347
+ PreCustoms: 'PRE_CUSTOMS',
2348
+ } as const;
2349
+
2350
+ export type CustomsStage = (typeof customsStage)[keyof typeof customsStage];
2325
2351
  export const dashboardUnit = {
2326
2352
  Imperial: 'IMPERIAL',
2327
2353
  Metric: 'METRIC',
@@ -2698,6 +2724,7 @@ export const entryStatus = {
2698
2724
  Archived: 'ARCHIVED',
2699
2725
  Draft: 'DRAFT',
2700
2726
  Error: 'ERROR',
2727
+ Filed: 'FILED',
2701
2728
  Rejected: 'REJECTED',
2702
2729
  Submitted: 'SUBMITTED',
2703
2730
  } as const;
@@ -2714,6 +2741,7 @@ export const errorDetail = {
2714
2741
  TcpFailure: 'TCP_FAILURE',
2715
2742
  ThrottledConcurrency: 'THROTTLED_CONCURRENCY',
2716
2743
  ThrottledCpu: 'THROTTLED_CPU',
2744
+ TooManyRequests: 'TOO_MANY_REQUESTS',
2717
2745
  Unimplemented: 'UNIMPLEMENTED',
2718
2746
  Unknown: 'UNKNOWN',
2719
2747
  } as const;
@@ -2858,6 +2886,13 @@ export const helloCountryDisplayBehavior = {
2858
2886
  export type HelloCountryDisplayBehavior =
2859
2887
  (typeof helloCountryDisplayBehavior)[keyof typeof helloCountryDisplayBehavior];
2860
2888
 
2889
+ export const helloCountryOverrideBehavior = {
2890
+ Session: 'SESSION',
2891
+ UrlParam: 'URL_PARAM',
2892
+ } as const;
2893
+
2894
+ export type HelloCountryOverrideBehavior =
2895
+ (typeof helloCountryOverrideBehavior)[keyof typeof helloCountryOverrideBehavior];
2861
2896
  export const helloCurrencyBehavior = {
2862
2897
  Disabled: 'DISABLED',
2863
2898
  Enabled: 'ENABLED',
@@ -5298,6 +5333,7 @@ export const pickupCategory = {
5298
5333
 
5299
5334
  export type PickupCategory =
5300
5335
  (typeof pickupCategory)[keyof typeof pickupCategory];
5336
+
5301
5337
  export const platformType = {
5302
5338
  Bigcommerce: 'BIGCOMMERCE',
5303
5339
  CustomApi: 'CUSTOM_API',
@@ -5955,6 +5991,13 @@ export const reverseAmountType = {
5955
5991
 
5956
5992
  export type ReverseAmountType =
5957
5993
  (typeof reverseAmountType)[keyof typeof reverseAmountType];
5994
+ export const riskLevel = {
5995
+ High: 'HIGH',
5996
+ Low: 'LOW',
5997
+ Medium: 'MEDIUM',
5998
+ } as const;
5999
+
6000
+ export type RiskLevel = (typeof riskLevel)[keyof typeof riskLevel];
5958
6001
 
5959
6002
  export const roundingMethod = {
5960
6003
  Custom: 'CUSTOM',
@@ -6227,6 +6270,12 @@ export const shipmentPackagingTypeCode = {
6227
6270
  export type ShipmentPackagingTypeCode =
6228
6271
  (typeof shipmentPackagingTypeCode)[keyof typeof shipmentPackagingTypeCode];
6229
6272
 
6273
+ export const shipmentRatingAdjustmentType = {
6274
+ CartTotal: 'CART_TOTAL',
6275
+ } as const;
6276
+
6277
+ export type ShipmentRatingAdjustmentType =
6278
+ (typeof shipmentRatingAdjustmentType)[keyof typeof shipmentRatingAdjustmentType];
6230
6279
  export const shipmentRatingAmountTargetType = {
6231
6280
  BillingCompany: 'BILLING_COMPANY',
6232
6281
  MerchantBase: 'MERCHANT_BASE',
@@ -6955,6 +7004,13 @@ export const volumeUnitCode = {
6955
7004
 
6956
7005
  export type VolumeUnitCode =
6957
7006
  (typeof volumeUnitCode)[keyof typeof volumeUnitCode];
7007
+ export const watchStatus = {
7008
+ Active: 'ACTIVE',
7009
+ Completed: 'COMPLETED',
7010
+ Expired: 'EXPIRED',
7011
+ } as const;
7012
+
7013
+ export type WatchStatus = (typeof watchStatus)[keyof typeof watchStatus];
6958
7014
  export const wcoVersion = {
6959
7015
  Wco_1997: 'WCO_1997',
6960
7016
  Wco_2002: 'WCO_2002',
@@ -8236,24 +8292,25 @@ export type CartCheckoutWorkflowQuery = {
8236
8292
  includedCountries: Array<CountryCode>;
8237
8293
  };
8238
8294
  };
8295
+ countryOverrideBehavior: HelloCountryOverrideBehavior;
8239
8296
  createdAt: string;
8240
- organization: string;
8297
+ createdBy: string;
8241
8298
  currencyBehavior: HelloCurrencyBehavior;
8242
8299
  currencyElementSelector: string;
8243
8300
  desktopLocation: HelloDesktopLocation;
8244
8301
  dutyTaxEstimationBehavior: HelloEstimateBehavior;
8245
8302
  excludedUrlPatterns: Array<string>;
8246
- homepageUrlPattern: string | null;
8303
+ organization: string;
8247
8304
  id: string;
8248
8305
  mobileLocation: HelloMobileLocation;
8249
8306
  mode: Mode;
8250
- productTitleElementSelector: string | null;
8307
+ homepageUrlPattern: string | null;
8251
8308
  peekMessageBehavior: HelloPeekMessageBehavior;
8252
8309
  peekMessageDelay: number;
8253
- productAddToCartElementSelector: string | null;
8254
8310
  productListUrlPattern: string | null;
8311
+ productAddToCartElementSelector: string | null;
8255
8312
  productDetailUrlPattern: string | null;
8256
- createdBy: string;
8313
+ productTitleElementSelector: string | null;
8257
8314
  productPriceElementSelector: string | null;
8258
8315
  productDescriptionElementSelector: string | null;
8259
8316
  restrictionBehavior: HelloRestrictionBehavior;
@@ -8836,8 +8893,9 @@ export type ZonosSettingsQuery = {
8836
8893
  includedCountries: Array<CountryCode>;
8837
8894
  };
8838
8895
  };
8896
+ countryOverrideBehavior: HelloCountryOverrideBehavior;
8839
8897
  createdAt: string;
8840
- productTitleElementSelector: string | null;
8898
+ createdBy: string;
8841
8899
  currencyBehavior: HelloCurrencyBehavior;
8842
8900
  currencyElementSelector: string;
8843
8901
  desktopLocation: HelloDesktopLocation;
@@ -8851,11 +8909,11 @@ export type ZonosSettingsQuery = {
8851
8909
  peekMessageBehavior: HelloPeekMessageBehavior;
8852
8910
  peekMessageDelay: number;
8853
8911
  productAddToCartElementSelector: string | null;
8854
- createdBy: string;
8855
- productDetailUrlPattern: string | null;
8856
8912
  productListUrlPattern: string | null;
8857
- productPriceElementSelector: string | null;
8913
+ productDetailUrlPattern: string | null;
8858
8914
  productDescriptionElementSelector: string | null;
8915
+ productPriceElementSelector: string | null;
8916
+ productTitleElementSelector: string | null;
8859
8917
  restrictionBehavior: HelloRestrictionBehavior;
8860
8918
  updatedAt: string;
8861
8919
  updatedBy: string;
@@ -8886,6 +8944,7 @@ export type HelloSettingsQuery = {
8886
8944
  includedCountries: Array<CountryCode>;
8887
8945
  };
8888
8946
  };
8947
+ countryOverrideBehavior: HelloCountryOverrideBehavior;
8889
8948
  createdAt: string;
8890
8949
  createdBy: string;
8891
8950
  currencyBehavior: HelloCurrencyBehavior;
@@ -9059,6 +9118,7 @@ export type HelloSettingFragment = {
9059
9118
  includedCountries: Array<CountryCode>;
9060
9119
  };
9061
9120
  };
9121
+ countryOverrideBehavior: HelloCountryOverrideBehavior;
9062
9122
  createdAt: string;
9063
9123
  createdBy: string;
9064
9124
  currencyBehavior: HelloCurrencyBehavior;
@@ -2,6 +2,7 @@ import './global.d';
2
2
  export * from '../components.d';
3
3
  export type { CartItem, ItemMeasurement, } from '../components/store/checkout/cart';
4
4
  export type { CountryLandedCost } from '../components/utils/api/getCountryLandedCost';
5
+ export * from './checkout/api/BigCommerceCheckoutSettings';
5
6
  export * from './checkout/api/CalculateLandedCost';
6
7
  export * from './checkout/api/CheckoutSession';
7
8
  export * from './checkout/api/CreateParty';
@@ -1 +1 @@
1
- import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{l as r}from"./p-0a377722.js";export{a as availableTestKeys}from"./p-0a377722.js";import{g as i,a as l,h as u,l as m}from"./p-41dd1cb8.js";import{g as p,_ as w,c as f,a as h}from"./p-b2d81c98.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-b2d81c98.js";export{c as countryRequireShortAddressCode}from"./p-1d42cd20.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const y=["jsdelivr","cdnjs","unpkg","vercel"],v="jsdelivr",O=e=>{const n=y.indexOf(e);return y[n+1]||null},S=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.258.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return r(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},g="https://js.stripe.com/v3",j=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,z="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let b=null;const N=Promise.resolve().then((()=>{return e=null,null!==b||(b=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(z),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${g}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&j.test(o.src))return o}return null})();t&&e?console.warn(z):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${g}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),b;var e}));let I=!1;N.catch((e=>{I||console.warn(e)}));const k=async({cartId:e,retries:n})=>{const t=i(),s=o(),c=p()||void 0,d=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&d.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:l,json:a,zonosMode:m}=await u(`/api/zonos-elements/get-cart?${d.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:c,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),w=!a||l.length;return w&&n?(r("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),k({cartId:e,retries:n-1})):w?null:Object.assign(Object.assign({},a),{zonosMode:m})};var R;const T=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),$=Date.now(),Z="https://v1.3.258.js.zonos.com",A=T||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.258",L="https://fonts.googleapis.com",U=/^https:\/\/fonts\.googleapis\.com/;class C{}R=C,C.doneInit=!1,C.cartSettings=null,C.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),C.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),C._paypalMockResponse=null,C.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,C.isBigCommerce=!1,C.releaseDate="1776786532180",C.isLegacyCheckout=!1,C.googleAnalyticId=null,C.googleAnalyticReady=!1,C.startLoadTime=$,C.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",C.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),C.overrideUseCustomAddressForm=!1,C.isCollect=!1,C.isInvoice=!1,C.isNpm=!0,C.zonosQaUrl=null,C.zonosQaUrlApi=null,C.trackEventLogs=[],C.version="v1.3.258",C.modeAlerted=!1,C.cartData=null,C.paypal=null,C.zonosMode=null,C.IframeService=t,C.getCurrentTimestamp=()=>(new Date).getTime(),C.zonosController=null,C.loadTimeApiInfoList=[],C.logIntervalId=null,C.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d,storeId:a,zonosApiKey:p}=e;if(R.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),R.doneInit)return;if(r(`====== ZONOS DEBUG MODE: on (${R.version}) ======`),R.zonosApiKey=p,R.storeId=a,"undefined"!=typeof window&&window.parent===window&&(R.googleAnalyticReady=!0),R.isNpm){r("====== ZONOS LOADING FROM NPM ======");const n=S();if(n&&!window.isZonosPreview){r(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=R.isNpm,window.Zonos.isBigCommerce=R.isBigCommerce,window.Zonos.isLegacyCheckout=R.isLegacyCheckout,window.Zonos.zonosMode=R.zonosMode,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!p&&!R.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!R.cartData&&R.cartId){r("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=w(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await k({cartId:e,retries:5});return r("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(R.cartId);if(!e)return void m("Failed to get cart data");R.cartData=e.cartData,R.zonosApiKey=e.zonosApiKey,R.cartSettings=e.settings}const o=await(async()=>{const e=i(),n=l();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(r("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return r("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(r(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(R.zonosApiKey=o)}const h=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(R.cartId&&R.cartData||h){r("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${f}`,document.body.appendChild(e)}r("init zonos"),R.restoreNativeBrowserFunctions(),R.injectCustomScriptForHostedCheckout(),R.injectZonosCdn(),R.injectZonosCss(),R.injectFonts(),R.injectCheckoutInternationalButton(),R.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d}}),R.doneInit=!0},C.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${h}`)){const e=document.createElement("button");e.id=h,e.style.display="none",document.body.appendChild(e)}},C.injectCustomScriptForHostedCheckout=()=>{const e=R.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){r("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){r("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else r("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},C.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},C.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${h}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},C.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},C.showNotification=e=>{var n;null===(n=R.zonosController)||void 0===n||n.showNotification(e)},C.updateOrganizationName=e=>{var n;null===(n=R.zonosController)||void 0===n||n.updateOrganizationName(e)},C.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},C.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},C.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=R.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;r("loading Stripe");const o=await(async(...e)=>{I=!0;const n=Date.now();return N.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(n.publishableKey);o?(window.Zonos.stripe=o,window.Zonos.isCollect?t.initCollectElement(o):window.Zonos.isInvoice?t.initInvoiceElement(o):t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),R.zonosController=t,r("Zonos controller injected!")},C.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${R.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void r(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,i=document.createElement("script");n?i.type="module":i.noModule=!0,i.src=t,i.crossOrigin="anonymous",i.onerror=()=>{m(`Failed to load ${i.src}`);const t=O(e);t&&R.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(i)},C.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return A;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.258";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.258";case"vercel":return Z}};return R.isNpm&&S()||n()},C.injectZonosCdn=()=>{R.injectScript({cdnType:v,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),R.injectScript({cdnType:v,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),r("Zonos cdn script injected!")},C.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=R.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${Z}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=O(e);o&&R.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},C.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?r("Zonos style links already injected","warn"):(R.injectStylesheet({cdnType:v,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),r("Zonos style css injected!"))},C.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void r("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!U.test(o.href))return o}return null})())return void r("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=L,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${L}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),r("Zonos font injected!")},C.setupGoogleFont=e=>{var n;null===(n=R.zonosController)||void 0===n||n.setupGoogleFont(e)},C.injectSupportGoogleFont=e=>{var n;r(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${L}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=L,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void r(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),r(`[FONT] ${o} font injected!`)};const E=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],P=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],F=[...E,...P];export{C as Zonos,F as checkoutSessionAttributeKeys,P as checkoutSessionImmutableAttributeKeys,E as checkoutSessionMutableAttributeKeys}
1
+ import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{l as r}from"./p-0a377722.js";export{a as availableTestKeys}from"./p-0a377722.js";import{g as i,a as l,h as u,l as m}from"./p-41dd1cb8.js";import{g as p,_ as w,c as f,a as h}from"./p-b2d81c98.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-b2d81c98.js";export{c as countryRequireShortAddressCode}from"./p-1d42cd20.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const y=["jsdelivr","cdnjs","unpkg","vercel"],v="jsdelivr",O=e=>{const n=y.indexOf(e);return y[n+1]||null},S=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.260.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return r(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},g="https://js.stripe.com/v3",j=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,z="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let b=null;const N=Promise.resolve().then((()=>{return e=null,null!==b||(b=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(z),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${g}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&j.test(o.src))return o}return null})();t&&e?console.warn(z):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${g}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),b;var e}));let I=!1;N.catch((e=>{I||console.warn(e)}));const k=async({cartId:e,retries:n})=>{const t=i(),s=o(),c=p()||void 0,d=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&d.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:l,json:a,zonosMode:m}=await u(`/api/zonos-elements/get-cart?${d.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:c,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),w=!a||l.length;return w&&n?(r("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),k({cartId:e,retries:n-1})):w?null:Object.assign(Object.assign({},a),{zonosMode:m})};var R;const T=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),$=Date.now(),Z="https://v1.3.260.js.zonos.com",A=T||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.260",L="https://fonts.googleapis.com",U=/^https:\/\/fonts\.googleapis\.com/;class C{}R=C,C.doneInit=!1,C.cartSettings=null,C.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),C.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),C._paypalMockResponse=null,C.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,C.isBigCommerce=!1,C.releaseDate="1776892835210",C.isLegacyCheckout=!1,C.googleAnalyticId=null,C.googleAnalyticReady=!1,C.startLoadTime=$,C.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",C.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),C.overrideUseCustomAddressForm=!1,C.isCollect=!1,C.isInvoice=!1,C.isNpm=!0,C.zonosQaUrl=null,C.zonosQaUrlApi=null,C.trackEventLogs=[],C.version="v1.3.260",C.modeAlerted=!1,C.cartData=null,C.paypal=null,C.zonosMode=null,C.IframeService=t,C.getCurrentTimestamp=()=>(new Date).getTime(),C.zonosController=null,C.loadTimeApiInfoList=[],C.logIntervalId=null,C.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d,storeId:a,zonosApiKey:p}=e;if(R.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),R.doneInit)return;if(r(`====== ZONOS DEBUG MODE: on (${R.version}) ======`),R.zonosApiKey=p,R.storeId=a,"undefined"!=typeof window&&window.parent===window&&(R.googleAnalyticReady=!0),R.isNpm){r("====== ZONOS LOADING FROM NPM ======");const n=S();if(n&&!window.isZonosPreview){r(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=R.isNpm,window.Zonos.isBigCommerce=R.isBigCommerce,window.Zonos.isLegacyCheckout=R.isLegacyCheckout,window.Zonos.zonosMode=R.zonosMode,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!p&&!R.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!R.cartData&&R.cartId){r("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=w(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await k({cartId:e,retries:5});return r("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(R.cartId);if(!e)return void m("Failed to get cart data");R.cartData=e.cartData,R.zonosApiKey=e.zonosApiKey,R.cartSettings=e.settings}const o=await(async()=>{const e=i(),n=l();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(r("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return r("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(r(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(R.zonosApiKey=o)}const h=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(R.cartId&&R.cartData||h){r("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${f}`,document.body.appendChild(e)}r("init zonos"),R.restoreNativeBrowserFunctions(),R.injectCustomScriptForHostedCheckout(),R.injectZonosCdn(),R.injectZonosCss(),R.injectFonts(),R.injectCheckoutInternationalButton(),R.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d}}),R.doneInit=!0},C.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${h}`)){const e=document.createElement("button");e.id=h,e.style.display="none",document.body.appendChild(e)}},C.injectCustomScriptForHostedCheckout=()=>{const e=R.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){r("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){r("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else r("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},C.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},C.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${h}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},C.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},C.showNotification=e=>{var n;null===(n=R.zonosController)||void 0===n||n.showNotification(e)},C.updateOrganizationName=e=>{var n;null===(n=R.zonosController)||void 0===n||n.updateOrganizationName(e)},C.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},C.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},C.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=R.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;r("loading Stripe");const o=await(async(...e)=>{I=!0;const n=Date.now();return N.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(n.publishableKey);o?(window.Zonos.stripe=o,window.Zonos.isCollect?t.initCollectElement(o):window.Zonos.isInvoice?t.initInvoiceElement(o):t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),R.zonosController=t,r("Zonos controller injected!")},C.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${R.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void r(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,i=document.createElement("script");n?i.type="module":i.noModule=!0,i.src=t,i.crossOrigin="anonymous",i.onerror=()=>{m(`Failed to load ${i.src}`);const t=O(e);t&&R.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(i)},C.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return A;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.260";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.260";case"vercel":return Z}};return R.isNpm&&S()||n()},C.injectZonosCdn=()=>{R.injectScript({cdnType:v,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),R.injectScript({cdnType:v,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),r("Zonos cdn script injected!")},C.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=R.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${Z}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=O(e);o&&R.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},C.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?r("Zonos style links already injected","warn"):(R.injectStylesheet({cdnType:v,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),r("Zonos style css injected!"))},C.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void r("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!U.test(o.href))return o}return null})())return void r("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=L,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${L}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),r("Zonos font injected!")},C.setupGoogleFont=e=>{var n;null===(n=R.zonosController)||void 0===n||n.setupGoogleFont(e)},C.injectSupportGoogleFont=e=>{var n;r(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${L}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=L,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void r(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),r(`[FONT] ${o} font injected!`)};const E=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],P=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],F=[...E,...P];export{C as Zonos,F as checkoutSessionAttributeKeys,P as checkoutSessionImmutableAttributeKeys,E as checkoutSessionMutableAttributeKeys}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(n,t,r,e){function i(n){return n instanceof r?n:new r((function(t){t(n)}))}return new(r||(r=Promise))((function(r,o){function u(n){try{c(e.next(n))}catch(n){o(n)}}function s(n){try{c(e["throw"](n))}catch(n){o(n)}}function c(n){n.done?r(n.value):i(n.value).then(u,s)}c((e=e.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},e,i,o,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(n){return function(t){return c([n,t])}}function c(s){if(e)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(r=0)),r)try{if(e=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(n,r)}catch(n){s=[6,n];i=0}finally{e=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-2ec799e4.system.js","./p-1523f6a8.system.js","./p-01174496.system.js"],(function(n){"use strict";var t,r,e,i;return{setters:[function(n){t=n.d},function(n){r=n.s},function(n){e=n.l;i=n.h}],execute:function(){var o=this;var u=n("p",(function(){return __awaiter(o,void 0,void 0,(function(){var n,o,u,s,c,a,f,l,d;return __generator(this,(function(h){switch(h.label){case 0:u=(n=t.partiesData.find((function(n){return n.type==="DESTINATION"})))===null||n===void 0?void 0:n.id;s=(o=t.partiesData.find((function(n){return n.type==="PAYOR"})))===null||o===void 0?void 0:o.id;c=r.checkoutSessionId;if(!c||!s||!u){e("Missing required data",{billToPartyId:s,checkoutSessionId:c,shipToPartyId:u});return[2,{errors:["Missing required data"],json:null}]}a={billToPartyId:s,checkoutSessionId:c,shipToPartyId:u};return[4,i("/api/zonos-elements/place-test-order",{body:a,method:"POST"})];case 1:f=h.sent(),l=f.errors,d=f.json;if(l.length||!d){e("Error occurs when placing test order",l);return[2,{errors:l.map((function(n){return n.message})),json:null}]}return[2,{errors:[],json:d}]}}))}))}))}}}));
1
+ var __awaiter=this&&this.__awaiter||function(n,t,r,e){function i(n){return n instanceof r?n:new r((function(t){t(n)}))}return new(r||(r=Promise))((function(r,o){function u(n){try{c(e.next(n))}catch(n){o(n)}}function s(n){try{c(e["throw"](n))}catch(n){o(n)}}function c(n){n.done?r(n.value):i(n.value).then(u,s)}c((e=e.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},e,i,o,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(n){return function(t){return c([n,t])}}function c(s){if(e)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(r=0)),r)try{if(e=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(n,r)}catch(n){s=[6,n];i=0}finally{e=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-196423ad.system.js","./p-248bdea2.system.js","./p-01174496.system.js"],(function(n){"use strict";var t,r,e,i;return{setters:[function(n){t=n.d},function(n){r=n.s},function(n){e=n.l;i=n.h}],execute:function(){var o=this;var u=n("p",(function(){return __awaiter(o,void 0,void 0,(function(){var n,o,u,s,c,a,f,d,l;return __generator(this,(function(h){switch(h.label){case 0:u=(n=t.partiesData.find((function(n){return n.type==="DESTINATION"})))===null||n===void 0?void 0:n.id;s=(o=t.partiesData.find((function(n){return n.type==="PAYOR"})))===null||o===void 0?void 0:o.id;c=r.checkoutSessionId;if(!c||!s||!u){e("Missing required data",{billToPartyId:s,checkoutSessionId:c,shipToPartyId:u});return[2,{errors:["Missing required data"],json:null}]}a={billToPartyId:s,checkoutSessionId:c,shipToPartyId:u};return[4,i("/api/zonos-elements/place-test-order",{body:a,method:"POST"})];case 1:f=h.sent(),d=f.errors,l=f.json;if(d.length||!l){e("Error occurs when placing test order",d);return[2,{errors:d.map((function(n){return n.message})),json:null}]}return[2,{errors:[],json:l}]}}))}))}))}}}));