@dropins/storefront-checkout 0.1.0-alpha45 → 0.1.0-alpha47

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 (220) hide show
  1. package/__generated__/types.d.ts +22 -20
  2. package/api/errors/index.d.ts +16 -0
  3. package/api/estimateShippingMethods/graphql/estimateShippingMethods.graphql.d.ts +16 -0
  4. package/api/estimateShippingMethods/graphql/index.d.ts +16 -0
  5. package/api/estimateShippingMethods/index.d.ts +16 -0
  6. package/api/fetch-graphql/fetch-graphql.d.ts +16 -0
  7. package/api/fetch-graphql/index.d.ts +16 -0
  8. package/api/fetchAddressFormFields/fetchAddressFormFields.d.ts +16 -0
  9. package/api/fetchAddressFormFields/graphql/fetchAddressFormFields.graphql.d.ts +16 -0
  10. package/api/fetchAddressFormFields/index.d.ts +16 -0
  11. package/api/getCart/getCart.d.ts +16 -0
  12. package/api/getCart/graphql/getCart.graphql.d.ts +16 -0
  13. package/api/getCart/graphql/index.d.ts +16 -0
  14. package/api/getCart/index.d.ts +16 -0
  15. package/api/getCheckoutData/getCheckoutData.d.ts +16 -0
  16. package/api/getCheckoutData/index.d.ts +16 -0
  17. package/api/getCountries/getCountries.d.ts +16 -0
  18. package/api/getCountries/graphql/getCountries.graphql.d.ts +16 -0
  19. package/api/getCountries/index.d.ts +16 -0
  20. package/api/getCustomer/graphql/getCustomer.graphql.d.ts +16 -0
  21. package/api/getCustomer/graphql/index.d.ts +16 -0
  22. package/api/getCustomer/index.d.ts +16 -0
  23. package/api/getRegions/graphql/getRegions.graphql.d.ts +16 -0
  24. package/api/getRegions/index.d.ts +16 -0
  25. package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +16 -0
  26. package/api/getStoreConfig/index.d.ts +16 -0
  27. package/api/index.d.ts +16 -0
  28. package/api/initialize/index.d.ts +16 -0
  29. package/api/initialize/listeners.d.ts +16 -0
  30. package/api/initializeCheckout/index.d.ts +16 -0
  31. package/api/initializeCheckout/initializeCheckout.d.ts +16 -0
  32. package/api/isEmailAvailable/graphql/isEmailAvailable.graphql.d.ts +16 -0
  33. package/api/isEmailAvailable/index.d.ts +16 -0
  34. package/api/placeOrder/graphql/index.d.ts +16 -0
  35. package/api/placeOrder/graphql/placeOrder.graphql.d.ts +17 -1
  36. package/api/placeOrder/index.d.ts +16 -0
  37. package/api/placeOrder/placeOrder.d.ts +16 -0
  38. package/api/redirect/index.d.ts +16 -0
  39. package/api/redirect/redirect.d.ts +16 -0
  40. package/api/resetCheckout/index.d.ts +16 -0
  41. package/api/resetCheckout/resetCheckout.d.ts +16 -0
  42. package/api/resetCustomer/index.d.ts +16 -0
  43. package/api/resetCustomer/resetCustomer.d.ts +16 -0
  44. package/api/setBillingAddress/graphql/setBillingAddress.graphql.d.ts +16 -0
  45. package/api/setBillingAddress/index.d.ts +16 -0
  46. package/api/setGuestEmailOnCart/graphql/setGuestEmailOnCart.graphql.d.ts +16 -0
  47. package/api/setGuestEmailOnCart/index.d.ts +16 -0
  48. package/api/setGuestEmailOnCart/setGuestEmailOnCart.d.ts +16 -0
  49. package/api/setPaymentMethod/graphql/setPaymentMethod.graphql.d.ts +16 -0
  50. package/api/setPaymentMethod/index.d.ts +16 -0
  51. package/api/setPaymentMethod/setPaymentMethod.d.ts +16 -0
  52. package/api/setShippingAddress/graphql/setShippingAddress.graphql.d.ts +16 -0
  53. package/api/setShippingAddress/index.d.ts +16 -0
  54. package/api/setShippingAddress/setShippingAddress.d.ts +17 -1
  55. package/api/setShippingMethods/graphql/setShippingMethodsOnCart.graphql.d.ts +16 -0
  56. package/api/setShippingMethods/index.d.ts +16 -0
  57. package/api/setShippingMethods/setShippingMethods.d.ts +16 -0
  58. package/api/utils/enqueueRequest.d.ts +16 -0
  59. package/api.js +1 -1
  60. package/chunks/BillToShippingAddress.js +1 -1
  61. package/chunks/OrderError.js +1 -0
  62. package/chunks/ShippingMethods.js +1 -1
  63. package/chunks/fixtures.js +15 -0
  64. package/chunks/getCart.graphql.js +6 -20
  65. package/chunks/getCustomer.js +1 -1
  66. package/chunks/getMultilineValues.js +43 -0
  67. package/chunks/placeOrder.js +6 -2
  68. package/chunks/resetCustomer.js +1 -1
  69. package/chunks/setBillingAddress.js +3 -3
  70. package/chunks/setGuestEmailOnCart.js +17 -0
  71. package/chunks/setPaymentMethod.js +13 -0
  72. package/chunks/setShippingAddress.js +16 -0
  73. package/chunks/setShippingMethods.js +3 -85
  74. package/chunks/transform-shipping-methods.js +1 -0
  75. package/chunks/withConditionalRendering.js +1 -0
  76. package/components/AddressForm/constants.d.ts +16 -0
  77. package/components/AddressForm/index.d.ts +16 -0
  78. package/components/BillToShippingAddress/index.d.ts +16 -0
  79. package/components/EstimateShipping/index.d.ts +16 -0
  80. package/components/FieldsForm/index.d.ts +16 -0
  81. package/components/Heading/index.d.ts +16 -0
  82. package/components/LoginForm/index.d.ts +16 -0
  83. package/components/OutOfStock/index.d.ts +16 -0
  84. package/components/OverlayLoader/index.d.ts +16 -0
  85. package/components/PaymentMethods/index.d.ts +16 -0
  86. package/components/PlaceOrder/PlaceOrder.d.ts +1 -1
  87. package/components/PlaceOrder/index.d.ts +16 -0
  88. package/components/ServerError/index.d.ts +16 -0
  89. package/components/ShippingMethods/index.d.ts +16 -0
  90. package/components/ToggleButton/assets/icons/index.d.ts +16 -0
  91. package/components/ToggleButton/assets/images/index.d.ts +16 -0
  92. package/components/ToggleButton/index.d.ts +16 -0
  93. package/components/index.d.ts +16 -2
  94. package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +1 -1
  95. package/containers/BillToShippingAddress/constants.d.ts +16 -0
  96. package/containers/BillToShippingAddress/index.d.ts +16 -0
  97. package/containers/BillToShippingAddress.js +1 -1
  98. package/containers/BillingForm/BillingForm.d.ts +1 -1
  99. package/containers/BillingForm/constants.d.ts +16 -0
  100. package/containers/BillingForm/index.d.ts +16 -0
  101. package/containers/BillingForm.js +1 -1
  102. package/containers/ErrorBanner/index.d.ts +16 -0
  103. package/containers/ErrorBanner.js +1 -1
  104. package/containers/EstimateShipping/index.d.ts +16 -0
  105. package/containers/EstimateShipping.js +1 -1
  106. package/containers/LoginForm/LoginForm.d.ts +1 -1
  107. package/containers/LoginForm/constants.d.ts +16 -0
  108. package/containers/LoginForm/index.d.ts +16 -0
  109. package/containers/LoginForm.js +1 -1
  110. package/containers/MergedCartBanner/index.d.ts +16 -0
  111. package/containers/MergedCartBanner.js +1 -1
  112. package/containers/OutOfStock/index.d.ts +16 -0
  113. package/containers/OutOfStock.js +1 -1
  114. package/containers/PaymentMethods/PaymentMethods.d.ts +10 -11
  115. package/containers/PaymentMethods/defaultHandlers.d.ts +2 -9
  116. package/containers/PaymentMethods/index.d.ts +16 -0
  117. package/containers/PaymentMethods.js +1 -1
  118. package/containers/PlaceOrder/PlaceOrder.d.ts +10 -3
  119. package/containers/PlaceOrder/index.d.ts +16 -0
  120. package/containers/PlaceOrder.js +1 -1
  121. package/containers/ServerError/ServerError.d.ts +8 -0
  122. package/containers/ServerError/index.d.ts +19 -0
  123. package/containers/ServerError.d.ts +3 -0
  124. package/containers/ServerError.js +1 -0
  125. package/containers/ShippingForm/ShippingForm.d.ts +1 -1
  126. package/containers/ShippingForm/constants.d.ts +16 -0
  127. package/containers/ShippingForm/index.d.ts +17 -1
  128. package/containers/ShippingForm.js +1 -1
  129. package/containers/ShippingMethods/ShippingMethods.d.ts +7 -3
  130. package/containers/ShippingMethods/hooks/useShippingEstimateEventEmitter.d.ts +16 -0
  131. package/containers/ShippingMethods/index.d.ts +16 -0
  132. package/containers/ShippingMethods.js +1 -1
  133. package/containers/index.d.ts +17 -2
  134. package/data/models/acdl.d.ts +16 -0
  135. package/data/models/country.d.ts +16 -0
  136. package/data/models/custom-attribute.d.ts +16 -0
  137. package/data/models/email-availability.d.ts +16 -0
  138. package/data/models/index.d.ts +16 -0
  139. package/data/models/payment-method.d.ts +16 -0
  140. package/data/models/price.d.ts +16 -0
  141. package/data/models/region.d.ts +16 -0
  142. package/data/models/store-config.d.ts +16 -0
  143. package/data/transforms/index.d.ts +16 -0
  144. package/hocs/index.d.ts +16 -0
  145. package/hocs/withConditionalRendering.d.ts +1 -1
  146. package/hooks/index.d.ts +16 -0
  147. package/hooks/useBreakpoint/index.d.ts +16 -0
  148. package/hooks/useBreakpoint/useBreakpoint.d.ts +16 -0
  149. package/hooks/useLockScroll/index.d.ts +16 -0
  150. package/hooks/useLockScroll/useLockScroll.d.ts +16 -0
  151. package/hooks/useValidity/index.d.ts +16 -0
  152. package/hooks/useValidity/useValidity.d.ts +16 -0
  153. package/i18n/en_US.json.d.ts +0 -8
  154. package/lib/backup-data.d.ts +16 -0
  155. package/lib/fetch-error.d.ts +16 -0
  156. package/lib/index.d.ts +16 -0
  157. package/lib/network-error.d.ts +16 -0
  158. package/lib/redirect.d.ts +16 -0
  159. package/lib/state.d.ts +16 -0
  160. package/msw/browser.d.ts +16 -0
  161. package/msw/fixtures/fragments/billing-address.d.ts +16 -0
  162. package/msw/fixtures/fragments/cart.d.ts +16 -0
  163. package/msw/fixtures/fragments/index.d.ts +16 -0
  164. package/msw/fixtures/fragments/shipping-address.d.ts +16 -0
  165. package/msw/fixtures/index.d.ts +16 -0
  166. package/msw/fixtures/mutations/index.d.ts +16 -0
  167. package/msw/fixtures/queries/index.d.ts +16 -0
  168. package/msw/server.d.ts +16 -0
  169. package/package.json +1 -1
  170. package/render/index.d.ts +16 -0
  171. package/render.js +4 -3
  172. package/signals/IsBillToShippingSignal.d.ts +16 -0
  173. package/signals/ServerErrorSignal.d.ts +18 -0
  174. package/signals/index.d.ts +17 -0
  175. package/tests/constants.d.ts +16 -0
  176. package/tests/integration/utils/index.d.ts +16 -0
  177. package/tests/integration/utils/setup.d.ts +6 -4
  178. package/tests/integration/utils/user-actions.d.ts +16 -0
  179. package/tests/mocks/svg.d.ts +16 -0
  180. package/tests/utils/expectError.d.ts +16 -0
  181. package/tests/utils/index.d.ts +16 -0
  182. package/tests/utils/mockEvents.d.ts +16 -0
  183. package/utils/autocompleteFieldCodes/autocompleteFieldCodes.d.ts +16 -0
  184. package/utils/autocompleteFieldCodes/index.d.ts +16 -0
  185. package/utils/getDisplayName/index.d.ts +16 -0
  186. package/utils/getMultilineValues/getMultilineValues.d.ts +16 -0
  187. package/utils/getMultilineValues/index.d.ts +16 -0
  188. package/utils/index.d.ts +19 -0
  189. package/utils/isEmpty/index.d.ts +16 -0
  190. package/utils/isEmpty/isEmpty.d.ts +16 -0
  191. package/utils/isNullish/index.d.ts +16 -0
  192. package/utils/isNullish/isNullish.d.ts +16 -0
  193. package/utils/isUnexpectedError/index.d.ts +18 -0
  194. package/utils/isUnexpectedError/isUnexpectedError.d.ts +18 -0
  195. package/utils/parseRegionId/index.d.ts +16 -0
  196. package/utils/parseRegionId/parseRegionId.d.ts +16 -0
  197. package/utils/processFormFields/index.d.ts +16 -0
  198. package/utils/refetchEstimatedShippingMethods/index.d.ts +16 -0
  199. package/utils/scrollToElement/index.d.ts +18 -0
  200. package/utils/scrollToElement/scrollToElement.d.ts +18 -0
  201. package/utils/shippingMethods/index.d.ts +16 -0
  202. package/utils/validateForms/index.d.ts +18 -0
  203. package/utils/validateForms/validateForms.d.ts +18 -0
  204. package/chunks/EmptyCart.js +0 -1
  205. package/chunks/ErrorBanner.js +0 -1
  206. package/chunks/MergedCartBanner.js +0 -1
  207. package/chunks/OutOfStock.js +0 -1
  208. package/components/Checkout/Checkout.d.ts +0 -28
  209. package/components/Checkout/index.d.ts +0 -3
  210. package/components/EmptyCart/EmptyCart.d.ts +0 -9
  211. package/components/EmptyCart/index.d.ts +0 -3
  212. package/containers/Checkout/Checkout.d.ts +0 -35
  213. package/containers/Checkout/constants.d.ts +0 -2
  214. package/containers/Checkout/index.d.ts +0 -4
  215. package/containers/Checkout.d.ts +0 -3
  216. package/containers/Checkout.js +0 -1
  217. package/containers/EmptyCart/EmptyCart.d.ts +0 -8
  218. package/containers/EmptyCart/index.d.ts +0 -3
  219. package/containers/EmptyCart.d.ts +0 -3
  220. package/containers/EmptyCart.js +0 -1
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export * from './initializeCheckout';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const initializeCheckout: () => Promise<[import('../../data/models/store-config').StoreConfig | undefined, import('../../data/models/country').Country[] | undefined, import('../../data/models/address-form-fields').AddressFormField[] | undefined]>;
2
18
  //# sourceMappingURL=initializeCheckout.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const isEmailAvailableQuery = "\n query isEmailAvailable($email: String!) {\n isEmailAvailable(email: $email) {\n is_email_available\n }\n }\n";
2
18
  //# sourceMappingURL=isEmailAvailable.graphql.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export * from './isEmailAvailable';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export * from './placeOrder.graphql';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,18 @@
1
- export declare const placeOrderMutation = "\n mutation placeOrder($cartId: String!) {\n placeOrder(input: { cart_id: $cartId }) {\n orderV2 {\n number\n status\n token\n is_virtual\n applied_coupons {\n code\n }\n email\n id\n total {\n grand_total {\n currency\n value\n }\n subtotal {\n currency\n value\n }\n total_shipping {\n currency\n value\n }\n total_tax {\n currency\n value\n }\n }\n shipping_method\n payment_methods {\n name\n type\n }\n billing_address {\n firstname\n middlename\n lastname\n street\n city\n postcode\n telephone\n country_code\n region\n region_id\n company\n custom_attributesV2 {\n code\n ... on AttributeValue {\n value\n }\n }\n }\n shipping_address {\n firstname\n middlename\n lastname\n street\n city\n postcode\n telephone\n country_code\n region\n region_id\n company\n custom_attributesV2 {\n code\n ... on AttributeValue {\n value\n }\n }\n }\n items {\n __typename\n id\n discounts {\n amount {\n value\n }\n }\n product {\n __typename\n canonical_url\n image {\n url\n }\n thumbnail {\n label\n url\n }\n name\n sku\n uid\n price_range {\n maximum_price {\n regular_price {\n currency\n value\n }\n }\n }\n }\n selected_options {\n label\n value\n }\n product_sale_price {\n value\n currency\n }\n quantity_ordered\n ... on GiftCardOrderItem {\n gift_card {\n recipient_name\n recipient_email\n sender_name\n sender_email\n message\n }\n }\n }\n }\n }\n }\n";
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
17
+ export declare const placeOrderMutation = "\n mutation placeOrder($cartId: String!) {\n placeOrder(input: { cart_id: $cartId }) {\n errors {\n code\n message\n }\n orderV2 {\n number\n status\n token\n is_virtual\n applied_coupons {\n code\n }\n email\n id\n total {\n grand_total {\n currency\n value\n }\n subtotal {\n currency\n value\n }\n total_shipping {\n currency\n value\n }\n total_tax {\n currency\n value\n }\n }\n shipping_method\n payment_methods {\n name\n type\n }\n billing_address {\n firstname\n middlename\n lastname\n street\n city\n postcode\n telephone\n country_code\n region\n region_id\n company\n custom_attributesV2 {\n code\n ... on AttributeValue {\n value\n }\n }\n }\n shipping_address {\n firstname\n middlename\n lastname\n street\n city\n postcode\n telephone\n country_code\n region\n region_id\n company\n custom_attributesV2 {\n code\n ... on AttributeValue {\n value\n }\n }\n }\n items {\n __typename\n id\n discounts {\n amount {\n value\n }\n }\n product {\n __typename\n canonical_url\n image {\n url\n }\n thumbnail {\n label\n url\n }\n name\n sku\n uid\n price_range {\n maximum_price {\n regular_price {\n currency\n value\n }\n }\n }\n }\n selected_options {\n label\n value\n }\n product_sale_price {\n value\n currency\n }\n quantity_ordered\n ... on GiftCardOrderItem {\n gift_card {\n recipient_name\n recipient_email\n sender_name\n sender_email\n message\n }\n }\n }\n }\n }\n }\n";
2
18
  //# sourceMappingURL=placeOrder.graphql.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export * from './placeOrder';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const placeOrder: () => Promise<import('../../data/models/order').Order>;
2
18
  //# sourceMappingURL=placeOrder.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export * from './redirect';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const redirect: (url: string) => void;
2
18
  //# sourceMappingURL=redirect.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export * from './resetCheckout';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const resetCheckout: () => void;
2
18
  //# sourceMappingURL=resetCheckout.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export * from './resetCustomer';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const resetCustomer: () => void;
2
18
  //# sourceMappingURL=resetCustomer.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const setBillingAddressMutation: string;
2
18
  //# sourceMappingURL=setBillingAddress.graphql.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export * from './setBillingAddress';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const setGuestEmailMutation: string;
2
18
  //# sourceMappingURL=setGuestEmailOnCart.graphql.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export * from './setGuestEmailOnCart';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const setGuestEmailOnCart: (email: string) => Promise<import('../../data/models/cart').Cart | null | undefined>;
2
18
  //# sourceMappingURL=setGuestEmailOnCart.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const setPaymentMethodMutation: string;
2
18
  //# sourceMappingURL=setPaymentMethod.graphql.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export * from './setPaymentMethod';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const setPaymentMethod: (paymentMethod: string) => Promise<import('../../data/models/cart').Cart | null | undefined>;
2
18
  //# sourceMappingURL=setPaymentMethod.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const setShippingAddressMutation: string;
2
18
  //# sourceMappingURL=setShippingAddress.graphql.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export * from './setShippingAddress';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,19 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const STANDARD_ATTRIBUTES: string[];
2
18
  export interface AddressInput {
3
19
  city: string;
@@ -26,5 +42,5 @@ export interface setShippingAddressParams {
26
42
  signal?: AbortSignal;
27
43
  }
28
44
  export declare const prepareAddress: (formFields: Record<string, any>) => AddressInput;
29
- export declare const setShippingAddress: ({ signal, address, }: setShippingAddressParams) => Promise<import('../../data/models').Cart | null | undefined>;
45
+ export declare const setShippingAddress: ({ signal, ...variables }: setShippingAddressParams) => Promise<import('../../data/models').Cart | null | undefined>;
30
46
  //# sourceMappingURL=setShippingAddress.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const setShippingMethodsMutation: string;
2
18
  //# sourceMappingURL=setShippingMethodsOnCart.graphql.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export * from './setShippingMethods';
2
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare const setShippingMethodsOnCart: (shippingMethods: import('../../__generated__/types').InputMaybe<import('../../__generated__/types').ShippingMethodInput>[]) => Promise<import('../../data/models/cart').Cart | null | undefined>;
2
18
  //# sourceMappingURL=setShippingMethods.d.ts.map
@@ -1,2 +1,18 @@
1
+ /********************************************************************
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ *
5
+ * Copyright 2024 Adobe
6
+ * All Rights Reserved.
7
+ *
8
+ * NOTICE: All information contained herein is, and remains
9
+ * the property of Adobe and its suppliers, if any. The intellectual
10
+ * and technical concepts contained herein are proprietary to Adobe
11
+ * and its suppliers and are protected by all applicable intellectual
12
+ * property laws, including trade secret and copyright laws.
13
+ * Dissemination of this information or reproduction of this material
14
+ * is strictly forbidden unless prior written permission is obtained
15
+ * from Adobe.
16
+ *******************************************************************/
1
17
  export declare function enqueueRequest<T>(requestFn: () => Promise<T>): Promise<T>;
2
18
  //# sourceMappingURL=enqueueRequest.d.ts.map
package/api.js CHANGED
@@ -1 +1 @@
1
- import{D as d,F as g,I as m,c as h,M as l,d as c,a as C,b as f,S as A,U as F,i as u,g as E,h as M,j as S,r as x,s as T,e as D,f as G}from"./chunks/getCart.graphql.js";import{S as U,e as b,g as R,i as I,p as Q,s as _,a as k,b as v,c as y}from"./chunks/setShippingMethods.js";import{c as H,f as N,g as w,i as z,a as L,r as P,b as j}from"./chunks/resetCustomer.js";import{g as q,a as J,b as K}from"./chunks/getCustomer.js";import{p as W}from"./chunks/placeOrder.js";import{s as Z}from"./chunks/setBillingAddress.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/lib.js";const o=e=>{var s;(s=window==null?void 0:window.location)==null||s.assign(e)};export{d as DEFAULT_COUNTRY,g as FetchError,m as InvalidArgument,h as MissingBillingAddress,l as MissingCart,c as MissingCountry,C as MissingEmail,f as MissingPaymentMethod,U as STANDARD_ATTRIBUTES,A as STORE_CONFIG_DEFAULTS,F as UnexpectedError,H as config,u as defaultFormFields,b as estimateShippingMethods,N as fetchAddressFormFields,E as fetchGraphQl,q as getCart,J as getCheckoutData,M as getConfig,w as getCountries,K as getCustomer,R as getRegions,S as getStoreConfig,z as initialize,L as initializeCheckout,I as isEmailAvailable,W as placeOrder,Q as prepareAddress,o as redirect,x as removeFetchGraphQlHeader,P as resetCheckout,j as resetCustomer,Z as setBillingAddress,T as setEndpoint,D as setFetchGraphQlHeader,G as setFetchGraphQlHeaders,_ as setGuestEmailOnCart,k as setPaymentMethod,v as setShippingAddress,y as setShippingMethodsOnCart};
1
+ import{D as g,F as h,I as l,c as f,M as c,d as C,a as x,b as A,S as F,U as u,i as E,g as M,h as S,j as T,r as D,s as G,e as O,f as U}from"./chunks/fixtures.js";import{e as b,g as I}from"./chunks/getMultilineValues.js";import{c as _,f as k,g as v,i as y,a as B,r as H,b as N}from"./chunks/resetCustomer.js";import{g as z,a as L,b as P}from"./chunks/getCustomer.js";import{i as Y,s as q}from"./chunks/setGuestEmailOnCart.js";import{p as K}from"./chunks/placeOrder.js";import{s as W}from"./chunks/setBillingAddress.js";import{s as Z}from"./chunks/setPaymentMethod.js";import{S as ss,p as es,s as as}from"./chunks/setShippingAddress.js";import{s as rs}from"./chunks/setShippingMethods.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/transform-shipping-methods.js";import"@dropins/tools/lib.js";import"./chunks/getCart.graphql.js";const n=e=>{var s;(s=window==null?void 0:window.location)==null||s.assign(e)};export{g as DEFAULT_COUNTRY,h as FetchError,l as InvalidArgument,f as MissingBillingAddress,c as MissingCart,C as MissingCountry,x as MissingEmail,A as MissingPaymentMethod,ss as STANDARD_ATTRIBUTES,F as STORE_CONFIG_DEFAULTS,u as UnexpectedError,_ as config,E as defaultFormFields,b as estimateShippingMethods,k as fetchAddressFormFields,M as fetchGraphQl,z as getCart,L as getCheckoutData,S as getConfig,v as getCountries,P as getCustomer,I as getRegions,T as getStoreConfig,y as initialize,B as initializeCheckout,Y as isEmailAvailable,K as placeOrder,es as prepareAddress,n as redirect,D as removeFetchGraphQlHeader,H as resetCheckout,N as resetCustomer,W as setBillingAddress,G as setEndpoint,O as setFetchGraphQlHeader,U as setFetchGraphQlHeaders,q as setGuestEmailOnCart,Z as setPaymentMethod,as as setShippingAddress,rs as setShippingMethodsOnCart};
@@ -1 +1 @@
1
- import{jsx as l}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/event-bus.js";import{n as g,v as h,w as k}from"./getCart.graphql.js";import{s as S}from"./setBillingAddress.js";import{classes as b}from"@dropins/tools/lib.js";import{Checkbox as v,Skeleton as C,SkeletonRow as _}from"@dropins/tools/components.js";import{useText as y}from"@dropins/tools/i18n.js";import{useState as A,useEffect as f}from"@dropins/tools/preact-compat.js";function B(t){return t.displayName||t.name||"Component"}const I=({className:t,isInitialized:s=!0,checked:i=!0,...n})=>{const e=y({title:"Checkout.BillToShippingAddress.title"});return s?l("div",{className:b(["checkout-bill-to-shipping-address",t]),children:l(v,{"data-testid":"bill-to-shipping-checkbox",className:"checkout-bill-to-shipping-address__checkbox",checked:i,name:"checkout-bill-to-shipping-address__checkbox",label:e.title,...n})}):l(N,{})},N=()=>l(C,{className:"bill-to-shipping-address__skeleton",children:l(_,{variant:"row",size:"small"})}),m="is_bill_to_shipping_address",x=t=>{const s=B(t),i=({hideOnEmptyCart:n=!0,hideOnVirtualCart:e=!1,...c})=>{const r=g.value.data,a=r!==void 0&&(r===null||r.isEmpty),o=!!(r!=null&&r.isVirtual);return n&&a||e&&o?null:l(t,{...c})};return i.displayName=`Conditional(${s})`,i};function T(t,s,i){const n=t[i],e=s[i];return n===void 0&&e===void 0||n===null&&e===null?!0:typeof n=="object"&&typeof e=="object"?JSON.stringify(n)===JSON.stringify(e):n===e}function w(t,s,i){return!s&&!i?!0:!s||!i?!1:t.every(n=>{const e=n.code;return T(s,i,e)})}const z=({isBillToShipping:t})=>{var u;const[s,i]=A(!1),n=k.value.data,e=g.value.data,c=(e==null?void 0:e.id)||"",r=!!e,a=e==null?void 0:e.billingAddress,o=(u=e==null?void 0:e.shippingAddresses)==null?void 0:u[0],d=!!o;return f(()=>{if(s)return;const p=localStorage.getItem(m);p&&(i(!0),t.value={checked:p==="true",setByUser:!1})},[s,t]),f(()=>{if(s||!n||!r)return;i(!0);const p=w(n,a,o);t.value={checked:a?p:t.value.checked,setByUser:!1}},[a,n,r,t,s,o]),{cartId:c,isInitialized:s,hasShippingAddress:d}},E=({children:t,...s})=>{const i=h.value.checked,{hasShippingAddress:n,isInitialized:e}=z({isBillToShipping:h});return l(I,{...s,checked:i,isInitialized:e,onChange:r=>{const o=r.target.checked;if(h.value={checked:o,setByUser:!0},localStorage.setItem(m,o.toString()),!e||!o||!n)return;const d=new AbortController;return S({signal:d.signal,input:{same_as_shipping:!0}}).catch(u=>{console.error(u)}),()=>{d.abort()}},disabled:g.value.pending})},P=x(E);export{P as B,m as a,w as c,x as w};
1
+ import{jsx as o}from"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/event-bus.js";import{m as p,q as f,o as k}from"./fixtures.js";import{s as S}from"./setBillingAddress.js";import{classes as b}from"@dropins/tools/lib.js";import{Checkbox as _,Skeleton as v,SkeletonRow as A}from"@dropins/tools/components.js";/* empty css */import{useText as B}from"@dropins/tools/i18n.js";import{w as C}from"./withConditionalRendering.js";import{useState as I,useEffect as g}from"@dropins/tools/preact-compat.js";const x=({className:n,isInitialized:s=!0,checked:i=!0,...t})=>{const e=B({title:"Checkout.BillToShippingAddress.title"});return s?o("div",{className:b(["checkout-bill-to-shipping-address",n]),children:o(_,{"data-testid":"bill-to-shipping-checkbox",className:"checkout-bill-to-shipping-address__checkbox",checked:i,name:"checkout-bill-to-shipping-address__checkbox",label:e.title,...t})}):o(y,{})},y=()=>o(v,{className:"bill-to-shipping-address__skeleton",children:o(A,{variant:"row",size:"small"})}),m="is_bill_to_shipping_address";function T(n,s,i){const t=n[i],e=s[i];return t===void 0&&e===void 0||t===null&&e===null?!0:typeof t=="object"&&typeof e=="object"?JSON.stringify(t)===JSON.stringify(e):t===e}function N(n,s,i){return!s&&!i?!0:!s||!i?!1:n.every(t=>{const e=t.code;return T(s,i,e)})}const w=({isBillToShipping:n})=>{var d;const[s,i]=I(!1),t=k.value.data,e=f.value.data,h=(e==null?void 0:e.id)||"",l=!!e,a=e==null?void 0:e.billingAddress,r=(d=e==null?void 0:e.shippingAddresses)==null?void 0:d[0],c=!!r;return g(()=>{if(s)return;const u=localStorage.getItem(m);u&&(i(!0),n.value={checked:u==="true",setByUser:!1})},[s,n]),g(()=>{if(s||!t||!l)return;i(!0);const u=N(t,a,r);n.value={checked:a?u:n.value.checked,setByUser:!1}},[a,t,l,n,s,r]),{cartId:h,isInitialized:s,hasShippingAddress:c}},z=({children:n,...s})=>{const i=p.value.checked,{hasShippingAddress:t,isInitialized:e}=w({isBillToShipping:p});return o("div",{children:o(x,{...s,checked:i,isInitialized:e,onChange:l=>{const r=l.target.checked;if(p.value={checked:r,setByUser:!0},localStorage.setItem(m,r.toString()),!e||!r||!t)return;const c=new AbortController;return S({signal:c.signal,input:{same_as_shipping:!0}}).catch(d=>{console.error(d)}),()=>{c.abort()}},disabled:f.value.pending})})},V=C(z);export{V as B,m as a,N as c};
@@ -0,0 +1 @@
1
+ import*as e from"@dropins/tools/preact-compat.js";const t=r=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},e.createElement("g",{clipPath:"url(#clip0_4797_15331)"},e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.25 20.91L1.5 17.55V6.51996L10.25 9.92996V20.91Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.24023 4.64001L14.9902 8.06001V11.42",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{className:"error-icon",vectorEffect:"non-scaling-stroke",d:"M19 13.31L15.5 19.37H22.5L19 13.31Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{className:"error-icon",vectorEffect:"non-scaling-stroke",d:"M19.0202 17.11H18.9802L18.9502 15.56H19.0502L19.0202 17.11ZM18.9602 18.29V18.06H19.0502V18.29H18.9602Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19 12.16V6.51996L10.25 9.92996V20.91L14.27 19.37L14.4 19.32",stroke:"currentColor",strokeLinejoin:"round"}),e.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.51999L10.25 3.04999L19 6.51999L10.25 9.92999L1.5 6.51999Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),e.createElement("defs",null,e.createElement("clipPath",{id:"clip0_4797_15331"},e.createElement("rect",{width:22,height:18.86,fill:"white",transform:"translate(1 2.54999)"}))));export{t as S};