@dropins/storefront-checkout 0.1.0-alpha4 → 0.1.0-alpha40

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 (357) hide show
  1. package/__generated__/types.d.ts +15363 -0
  2. package/api/errors/errors.d.ts +27 -0
  3. package/api/errors/index.d.ts +2 -0
  4. package/api/estimateShippingMethods/estimateShippingMethods.d.ts +13 -0
  5. package/api/estimateShippingMethods/fixtures.d.ts +8 -0
  6. package/api/estimateShippingMethods/graphql/estimateShippingMethods.graphql.d.ts +2 -0
  7. package/api/estimateShippingMethods/graphql/index.d.ts +2 -0
  8. package/api/estimateShippingMethods/index.d.ts +2 -0
  9. package/api/fetch-graphql/fetch-graphql.d.ts +9 -0
  10. package/api/fetch-graphql/index.d.ts +2 -0
  11. package/api/fetchAddressFormFields/fetchAddressFormFields.d.ts +2 -0
  12. package/api/fetchAddressFormFields/fixtures.d.ts +5 -0
  13. package/api/fetchAddressFormFields/graphql/fetchAddressFormFields.graphql.d.ts +2 -0
  14. package/api/fetchAddressFormFields/index.d.ts +3 -0
  15. package/api/getCart/fixtures.d.ts +12 -0
  16. package/api/getCart/getCart.d.ts +2 -0
  17. package/api/getCart/graphql/getCart.graphql.d.ts +4 -0
  18. package/api/getCart/graphql/index.d.ts +2 -0
  19. package/api/getCart/index.d.ts +2 -0
  20. package/api/getCheckoutData/getCheckoutData.d.ts +2 -0
  21. package/api/getCheckoutData/index.d.ts +2 -0
  22. package/api/getCountries/fixtures.d.ts +6 -0
  23. package/api/getCountries/getCountries.d.ts +2 -0
  24. package/api/getCountries/graphql/getCountries.graphql.d.ts +2 -0
  25. package/api/getCountries/index.d.ts +2 -0
  26. package/api/getCustomer/fixtures.d.ts +5 -0
  27. package/api/getCustomer/getCustomer.d.ts +4 -0
  28. package/api/getCustomer/graphql/getCustomer.graphql.d.ts +2 -0
  29. package/api/getCustomer/graphql/index.d.ts +2 -0
  30. package/api/getCustomer/index.d.ts +2 -0
  31. package/api/getRegions/fixtures.d.ts +5 -0
  32. package/api/getRegions/getRegions.d.ts +5 -0
  33. package/api/getRegions/graphql/getRegions.graphql.d.ts +2 -0
  34. package/api/getRegions/index.d.ts +2 -0
  35. package/api/getStoreConfig/getStoreConfig.d.ts +6 -0
  36. package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +2 -0
  37. package/api/getStoreConfig/index.d.ts +2 -0
  38. package/api/index.d.ts +23 -0
  39. package/api/initialize/index.d.ts +2 -0
  40. package/api/initialize/initialize.d.ts +10 -0
  41. package/api/initialize/listeners.d.ts +4 -0
  42. package/api/initializeCheckout/index.d.ts +2 -0
  43. package/api/initializeCheckout/initializeCheckout.d.ts +2 -0
  44. package/api/isEmailAvailable/graphql/isEmailAvailable.graphql.d.ts +2 -0
  45. package/api/isEmailAvailable/index.d.ts +2 -0
  46. package/api/isEmailAvailable/isEmailAvailable.d.ts +4 -0
  47. package/api/placeOrder/fixtures.d.ts +6 -0
  48. package/api/placeOrder/graphql/index.d.ts +2 -0
  49. package/api/placeOrder/graphql/placeOrder.graphql.d.ts +2 -0
  50. package/api/placeOrder/index.d.ts +2 -0
  51. package/api/placeOrder/placeOrder.d.ts +2 -0
  52. package/api/redirect/index.d.ts +2 -0
  53. package/api/redirect/redirect.d.ts +2 -0
  54. package/api/resetCheckout/index.d.ts +2 -0
  55. package/api/resetCheckout/resetCheckout.d.ts +2 -0
  56. package/api/resetCustomer/index.d.ts +2 -0
  57. package/api/resetCustomer/resetCustomer.d.ts +2 -0
  58. package/api/setBillingAddress/graphql/setBillingAddress.graphql.d.ts +2 -0
  59. package/api/setBillingAddress/index.d.ts +2 -0
  60. package/api/setBillingAddress/setBillingAddress.d.ts +13 -0
  61. package/api/setGuestEmailOnCart/graphql/setGuestEmailOnCart.graphql.d.ts +2 -0
  62. package/api/setGuestEmailOnCart/index.d.ts +2 -0
  63. package/api/setGuestEmailOnCart/setGuestEmailOnCart.d.ts +2 -0
  64. package/api/setPaymentMethod/graphql/setPaymentMethod.graphql.d.ts +2 -0
  65. package/api/setPaymentMethod/index.d.ts +2 -0
  66. package/api/setPaymentMethod/setPaymentMethod.d.ts +2 -0
  67. package/api/setShippingAddress/graphql/setShippingAddress.graphql.d.ts +2 -0
  68. package/api/setShippingAddress/index.d.ts +2 -0
  69. package/api/setShippingAddress/setShippingAddress.d.ts +30 -0
  70. package/api/setShippingMethods/graphql/setShippingMethodsOnCart.graphql.d.ts +2 -0
  71. package/api/setShippingMethods/index.d.ts +2 -0
  72. package/api/setShippingMethods/setShippingMethods.d.ts +2 -0
  73. package/api/utils/dispatchApiCall.d.ts +54 -0
  74. package/api/utils/enqueueRequest.d.ts +2 -0
  75. package/api/utils/filterControlledErrors.d.ts +18 -0
  76. package/api.d.ts +1 -0
  77. package/api.js +1 -2
  78. package/chunks/BillToShippingAddress2.js +1 -0
  79. package/chunks/BillingForm.js +1 -0
  80. package/chunks/ErrorBanner.js +1 -0
  81. package/chunks/LoginForm.js +1 -0
  82. package/chunks/MergedCartBanner.js +1 -0
  83. package/chunks/OutOfStock.js +1 -0
  84. package/chunks/PlaceOrder.js +1 -0
  85. package/chunks/ShippingForm.js +1 -0
  86. package/chunks/ShippingMethods.js +1 -0
  87. package/chunks/ToggleButton.js +1 -0
  88. package/chunks/ToggleButton2.js +1 -0
  89. package/chunks/constants.js +1 -0
  90. package/chunks/constants2.js +1 -0
  91. package/chunks/constants3.js +1 -0
  92. package/chunks/fixtures.js +15 -0
  93. package/chunks/getCart.graphql.js +119 -0
  94. package/chunks/getCustomer.js +34 -0
  95. package/chunks/getMultilineValues.js +43 -0
  96. package/chunks/placeOrder2.js +127 -0
  97. package/chunks/resetCustomer.js +36 -0
  98. package/chunks/setBillingAddress.js +13 -0
  99. package/chunks/setGuestEmailOnCart.js +17 -0
  100. package/chunks/setPaymentMethod.js +13 -0
  101. package/chunks/setShippingAddress.js +13 -0
  102. package/chunks/setShippingMethods.js +16 -0
  103. package/components/AddressForm/AddressForm.d.ts +22 -0
  104. package/components/AddressForm/constants.d.ts +4 -0
  105. package/components/AddressForm/index.d.ts +7 -0
  106. package/components/AddressForm/useAddressBackup.d.ts +8 -0
  107. package/components/AddressForm/useAddressForm.d.ts +39 -0
  108. package/components/AddressForm/useCheckoutAddressEventEmitter.d.ts +9 -0
  109. package/components/AddressForm/usePreselectedFields.d.ts +9 -0
  110. package/components/AddressForm/utils.d.ts +13 -0
  111. package/components/BillToShippingAddress/BillToShippingAddress.d.ts +8 -0
  112. package/components/BillToShippingAddress/BillToShippingAddressSkeleton.d.ts +4 -0
  113. package/components/BillToShippingAddress/index.d.ts +4 -0
  114. package/components/Checkout/Checkout.d.ts +32 -0
  115. package/components/Checkout/index.d.ts +3 -0
  116. package/components/EmptyCart/EmptyCart.d.ts +9 -0
  117. package/components/EmptyCart/index.d.ts +3 -0
  118. package/components/EstimateShipping/EstimateShipping.d.ts +12 -0
  119. package/components/EstimateShipping/EstimateShippingSkeleton.d.ts +4 -0
  120. package/components/EstimateShipping/index.d.ts +4 -0
  121. package/components/FieldsForm/FieldsForm.d.ts +13 -0
  122. package/components/FieldsForm/FieldsFormSkeleton.d.ts +4 -0
  123. package/components/FieldsForm/fieldFactory.d.ts +9 -0
  124. package/components/FieldsForm/fixtures.d.ts +5 -0
  125. package/components/FieldsForm/index.d.ts +6 -0
  126. package/components/FieldsForm/validation.d.ts +18 -0
  127. package/components/Heading/Heading.d.ts +8 -0
  128. package/components/Heading/index.d.ts +3 -0
  129. package/components/LoginForm/Email.d.ts +13 -0
  130. package/components/LoginForm/LoginForm.d.ts +16 -0
  131. package/components/LoginForm/LoginFormSkeleton.d.ts +4 -0
  132. package/components/LoginForm/SignIn.d.ts +9 -0
  133. package/components/LoginForm/SignOut.d.ts +8 -0
  134. package/components/LoginForm/index.d.ts +6 -0
  135. package/components/OutOfStock/OutOfStock.d.ts +11 -0
  136. package/components/OutOfStock/index.d.ts +3 -0
  137. package/components/OverlayLoader/OverlayLoader.d.ts +6 -0
  138. package/components/OverlayLoader/index.d.ts +2 -0
  139. package/components/PaymentMethods/PaymentMethods.d.ts +13 -0
  140. package/components/PaymentMethods/PaymentMethodsSkeleton.d.ts +4 -0
  141. package/components/PaymentMethods/index.d.ts +4 -0
  142. package/components/PlaceOrder/PlaceOrder.d.ts +9 -0
  143. package/components/PlaceOrder/PlaceOrderSkeleton.d.ts +4 -0
  144. package/components/PlaceOrder/index.d.ts +3 -0
  145. package/components/ServerError/ServerError.d.ts +10 -0
  146. package/components/ServerError/index.d.ts +3 -0
  147. package/components/ShippingMethods/ShippingMethods.d.ts +12 -0
  148. package/components/ShippingMethods/ShippingMethodsSkeleton.d.ts +4 -0
  149. package/components/ShippingMethods/index.d.ts +4 -0
  150. package/components/ToggleButton/ToggleButton.d.ts +14 -0
  151. package/components/ToggleButton/assets/icons/index.d.ts +2 -0
  152. package/components/ToggleButton/assets/images/index.d.ts +2 -0
  153. package/components/ToggleButton/index.d.ts +3 -0
  154. package/components/index.d.ts +16 -0
  155. package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +10 -0
  156. package/containers/BillToShippingAddress/constants.d.ts +2 -0
  157. package/containers/BillToShippingAddress/index.d.ts +4 -0
  158. package/containers/BillToShippingAddress.d.ts +3 -0
  159. package/containers/BillToShippingAddress.js +1 -1
  160. package/containers/BillingForm/BillingForm.d.ts +7 -0
  161. package/containers/BillingForm/constants.d.ts +2 -0
  162. package/containers/BillingForm/index.d.ts +4 -0
  163. package/containers/BillingForm.d.ts +3 -0
  164. package/containers/BillingForm.js +1 -2
  165. package/containers/Checkout/Checkout.d.ts +39 -0
  166. package/containers/Checkout/constants.d.ts +2 -0
  167. package/containers/Checkout/index.d.ts +4 -0
  168. package/containers/Checkout.d.ts +3 -0
  169. package/containers/Checkout.js +1 -1
  170. package/containers/ErrorBanner/ErrorBanner.d.ts +5 -0
  171. package/containers/ErrorBanner/index.d.ts +3 -0
  172. package/containers/ErrorBanner.d.ts +3 -0
  173. package/containers/ErrorBanner.js +1 -0
  174. package/containers/EstimateShipping/EstimateShipping.d.ts +4 -0
  175. package/containers/EstimateShipping/index.d.ts +3 -0
  176. package/containers/EstimateShipping.d.ts +3 -0
  177. package/containers/EstimateShipping.js +1 -0
  178. package/containers/LoginForm/LoginForm.d.ts +10 -0
  179. package/containers/LoginForm/constants.d.ts +2 -0
  180. package/containers/LoginForm/index.d.ts +4 -0
  181. package/containers/LoginForm.d.ts +3 -0
  182. package/containers/LoginForm.js +1 -1
  183. package/containers/MergedCartBanner/MergedCartBanner.d.ts +5 -0
  184. package/containers/MergedCartBanner/index.d.ts +3 -0
  185. package/containers/MergedCartBanner.d.ts +3 -0
  186. package/containers/MergedCartBanner.js +1 -0
  187. package/containers/OutOfStock/OutOfStock.d.ts +13 -0
  188. package/containers/OutOfStock/index.d.ts +3 -0
  189. package/containers/OutOfStock.d.ts +3 -0
  190. package/containers/OutOfStock.js +1 -0
  191. package/containers/PaymentMethods/PaymentMethods.d.ts +23 -0
  192. package/containers/PaymentMethods/defaultHandlers.d.ts +11 -0
  193. package/containers/PaymentMethods/index.d.ts +3 -0
  194. package/containers/PaymentMethods.d.ts +3 -0
  195. package/containers/PaymentMethods.js +1 -1
  196. package/containers/PlaceOrder/PlaceOrder.d.ts +9 -0
  197. package/containers/PlaceOrder/index.d.ts +3 -0
  198. package/containers/PlaceOrder.d.ts +3 -0
  199. package/containers/PlaceOrder.js +1 -1
  200. package/containers/ShippingForm/ShippingForm.d.ts +10 -0
  201. package/containers/ShippingForm/constants.d.ts +2 -0
  202. package/containers/ShippingForm/index.d.ts +4 -0
  203. package/containers/ShippingForm.d.ts +3 -0
  204. package/containers/ShippingForm.js +1 -1
  205. package/containers/ShippingMethods/ShippingMethods.d.ts +10 -0
  206. package/containers/ShippingMethods/hooks/useShippingEstimateEventEmitter.d.ts +3 -0
  207. package/containers/ShippingMethods/index.d.ts +3 -0
  208. package/containers/ShippingMethods.d.ts +3 -0
  209. package/containers/ShippingMethods.js +1 -1
  210. package/containers/index.d.ts +13 -0
  211. package/data/models/acdl.d.ts +99 -0
  212. package/data/models/address-form-fields.d.ts +52 -0
  213. package/data/models/address.d.ts +21 -0
  214. package/data/models/cart.d.ts +14 -0
  215. package/data/models/country.d.ts +5 -0
  216. package/data/models/custom-attribute.d.ts +5 -0
  217. package/data/models/customer.d.ts +25 -0
  218. package/data/models/email-availability.d.ts +2 -0
  219. package/data/models/index.d.ts +14 -0
  220. package/data/models/order.d.ts +81 -0
  221. package/data/models/payment-method.d.ts +5 -0
  222. package/data/models/price.d.ts +5 -0
  223. package/data/models/region.d.ts +6 -0
  224. package/data/models/shipping-estimate.d.ts +17 -0
  225. package/data/models/shipping-method.d.ts +19 -0
  226. package/data/models/store-config.d.ts +17 -0
  227. package/data/transforms/index.d.ts +12 -0
  228. package/data/transforms/transform-acdl.d.ts +6 -0
  229. package/data/transforms/transform-address-form-fields.d.ts +66 -0
  230. package/data/transforms/transform-address.d.ts +89 -0
  231. package/data/transforms/transform-cart.d.ts +7 -0
  232. package/data/transforms/transform-countries.d.ts +5 -0
  233. package/data/transforms/transform-customer.d.ts +14 -0
  234. package/data/transforms/transform-email-availability.d.ts +6 -0
  235. package/data/transforms/transform-order.d.ts +7 -0
  236. package/data/transforms/transform-payment-methods.d.ts +9 -0
  237. package/data/transforms/transform-regions.d.ts +8 -0
  238. package/data/transforms/transform-shipping-estimate.d.ts +5 -0
  239. package/data/transforms/transform-shipping-methods.d.ts +14 -0
  240. package/data/transforms/transform-store-config.d.ts +6 -0
  241. package/hooks/index.d.ts +4 -0
  242. package/hooks/useBreakpoint/index.d.ts +2 -0
  243. package/hooks/useBreakpoint/useBreakpoint.d.ts +2 -0
  244. package/hooks/useLockScroll/index.d.ts +2 -0
  245. package/hooks/useLockScroll/useLockScroll.d.ts +5 -0
  246. package/hooks/useValidity/index.d.ts +2 -0
  247. package/hooks/useValidity/useValidity.d.ts +19 -0
  248. package/i18n/en_US.json.d.ts +97 -0
  249. package/lib/acdl.d.ts +18 -0
  250. package/lib/backup-data.d.ts +4 -0
  251. package/lib/fetch-error.d.ts +7 -0
  252. package/lib/index.d.ts +3 -0
  253. package/lib/network-error.d.ts +6 -0
  254. package/lib/redirect.d.ts +2 -0
  255. package/lib/state.d.ts +7 -0
  256. package/msw/browser.d.ts +2 -0
  257. package/msw/fixtures/fragments/american-regions.d.ts +4 -0
  258. package/msw/fixtures/fragments/available-shipping-methods.d.ts +23 -0
  259. package/msw/fixtures/fragments/billing-address.d.ts +36 -0
  260. package/msw/fixtures/fragments/cart.d.ts +122 -0
  261. package/msw/fixtures/fragments/countries.d.ts +4 -0
  262. package/msw/fixtures/fragments/form-fields.d.ts +4 -0
  263. package/msw/fixtures/fragments/index.d.ts +8 -0
  264. package/msw/fixtures/fragments/shipping-address.d.ts +42 -0
  265. package/msw/fixtures/index.d.ts +4 -0
  266. package/msw/fixtures/mutations/estimate-shipping-methods.d.ts +4 -0
  267. package/msw/fixtures/mutations/index.d.ts +8 -0
  268. package/msw/fixtures/mutations/place-order.d.ts +4 -0
  269. package/msw/fixtures/mutations/set-billing-address.d.ts +5 -0
  270. package/msw/fixtures/mutations/set-guest-email.d.ts +4 -0
  271. package/msw/fixtures/mutations/set-payment-method.d.ts +4 -0
  272. package/msw/fixtures/mutations/set-shipping-address.d.ts +4 -0
  273. package/msw/fixtures/mutations/set-shipping-methods.d.ts +4 -0
  274. package/msw/fixtures/queries/fetch-address-form-fields.d.ts +4 -0
  275. package/msw/fixtures/queries/get-cart.d.ts +4 -0
  276. package/msw/fixtures/queries/get-countries.d.ts +4 -0
  277. package/msw/fixtures/queries/get-customer-cart-stock-status.d.ts +4 -0
  278. package/msw/fixtures/queries/get-customer.d.ts +5 -0
  279. package/msw/fixtures/queries/get-regions.d.ts +4 -0
  280. package/msw/fixtures/queries/get-stock-status.d.ts +4 -0
  281. package/msw/fixtures/queries/get-store-config.d.ts +4 -0
  282. package/msw/fixtures/queries/index.d.ts +10 -0
  283. package/msw/fixtures/queries/is-email-available.d.ts +4 -0
  284. package/msw/handlers.d.ts +4 -0
  285. package/msw/server.d.ts +2 -0
  286. package/package.json +1 -1
  287. package/render/Provider.d.ts +8 -0
  288. package/render/index.d.ts +2 -0
  289. package/render/render.d.ts +6 -0
  290. package/render.d.ts +1 -0
  291. package/render.js +3 -1
  292. package/signals/AddressFormFieldsSignal.d.ts +7 -0
  293. package/signals/CartSignal.d.ts +7 -0
  294. package/signals/CountryListSignal.d.ts +7 -0
  295. package/signals/CustomerSignal.d.ts +7 -0
  296. package/signals/EstimateShippingMethodsSignal.d.ts +7 -0
  297. package/signals/IsBillToShippingSignal.d.ts +6 -0
  298. package/signals/RegionsSignal.d.ts +12 -0
  299. package/signals/SelectedShippingMethodSignal.d.ts +4 -0
  300. package/signals/StoreConfigSignal.d.ts +7 -0
  301. package/signals/index.d.ts +10 -0
  302. package/tests/constants.d.ts +3 -0
  303. package/tests/integration/utils/index.d.ts +3 -0
  304. package/tests/integration/utils/setup.d.ts +6 -0
  305. package/tests/integration/utils/user-actions.d.ts +2 -0
  306. package/tests/mocks/svg.d.ts +4 -0
  307. package/tests/utils/expectError.d.ts +9 -0
  308. package/tests/utils/index.d.ts +3 -0
  309. package/tests/utils/mockEvents.d.ts +5 -0
  310. package/utils/autocompleteFieldCodes/autocompleteFieldCodes.d.ts +18 -0
  311. package/utils/autocompleteFieldCodes/index.d.ts +2 -0
  312. package/utils/getMultilineValues/getMultilineValues.d.ts +3 -0
  313. package/utils/getMultilineValues/index.d.ts +2 -0
  314. package/utils/index.d.ts +7 -0
  315. package/utils/isEmpty/index.d.ts +2 -0
  316. package/utils/isEmpty/isEmpty.d.ts +2 -0
  317. package/utils/isNullish/index.d.ts +2 -0
  318. package/utils/isNullish/isNullish.d.ts +2 -0
  319. package/utils/parseRegionId/index.d.ts +2 -0
  320. package/utils/parseRegionId/parseRegionId.d.ts +2 -0
  321. package/utils/processFormFields/index.d.ts +2 -0
  322. package/utils/processFormFields/processFormFields.d.ts +21 -0
  323. package/utils/refetchEstimatedShippingMethods/index.d.ts +2 -0
  324. package/utils/refetchEstimatedShippingMethods/refetchEstimatedShippingMethods.d.ts +4 -0
  325. package/utils/shippingMethods/index.d.ts +2 -0
  326. package/utils/shippingMethods/isEqual.d.ts +4 -0
  327. package/181.js +0 -1
  328. package/212.js +0 -2
  329. package/212.js.LICENSE.txt +0 -1
  330. package/261.js +0 -2
  331. package/261.js.LICENSE.txt +0 -1
  332. package/299.js +0 -2
  333. package/299.js.LICENSE.txt +0 -1
  334. package/325.js +0 -2
  335. package/325.js.LICENSE.txt +0 -1
  336. package/350.js +0 -2
  337. package/350.js.LICENSE.txt +0 -1
  338. package/494.js +0 -2
  339. package/494.js.LICENSE.txt +0 -1
  340. package/548.js +0 -1
  341. package/549.js +0 -2
  342. package/549.js.LICENSE.txt +0 -1
  343. package/60.js +0 -2
  344. package/60.js.LICENSE.txt +0 -1
  345. package/627.js +0 -1
  346. package/645.js +0 -1
  347. package/757.js +0 -1
  348. package/805.js +0 -2
  349. package/805.js.LICENSE.txt +0 -1
  350. package/985.js +0 -2
  351. package/985.js.LICENSE.txt +0 -1
  352. package/994.js +0 -1
  353. package/api.js.LICENSE.txt +0 -1
  354. package/containers/AddressForm.js +0 -1
  355. package/containers/BillingForm.js.LICENSE.txt +0 -1
  356. package/containers/OrderSummary.js +0 -1
  357. package/runtime.js +0 -1
@@ -0,0 +1,127 @@
1
+ import{o as T,M as w,g as A,v as k,n as D,F as L,U as R}from"./fixtures.js";import{events as f}from"@dropins/tools/event-bus.js";const V=n=>({id:T.cartId,totalQuantity:n.totalQuantity,possibleOnepageCheckout:!0,items:n.items.map(a=>{var t;return{canApplyMsrp:!0,formattedPrice:"",id:a.id,quantity:a.totalQuantity,product:{canonicalUrl:a.product.canonicalUrl||"",mainImageUrl:a.product.image||"",name:a.product.name,productId:0,productType:a.product.productType,sku:a.product.sku},prices:{price:{value:a.price.value,currency:a.price.currency}},configurableOptions:((t=a.selectedOptions)==null?void 0:t.map(i=>({optionLabel:i.label,valueLabel:i.value})))||[]}})}),q=n=>{var i,c,l;const a=n.coupons[0],t=(i=n.payments)==null?void 0:i[0];return{appliedCouponCode:(a==null?void 0:a.code)||"",email:n.email,grandTotal:n.total,orderId:n.number,orderType:"checkout",otherTax:0,salesTax:n.totalTax,shipping:{shippingMethod:((c=n.shipping)==null?void 0:c.code)||"",shippingAmount:((l=n.shipping)==null?void 0:l.amount)||0},subtotalExcludingTax:n.subtotal,subtotalIncludingTax:0,payments:t?[{paymentMethodCode:(t==null?void 0:t.code)||"",paymentMethodName:(t==null?void 0:t.name)||"",total:n.total}]:[]}},Q=n=>n||0,S=n=>{var a;return{canonicalUrl:(n==null?void 0:n.canonical_url)||"",id:(n==null?void 0:n.uid)||"",name:(n==null?void 0:n.name)||"",sku:(n==null?void 0:n.sku)||"",image:((a=n==null?void 0:n.image)==null?void 0:a.url)||"",productType:(n==null?void 0:n.__typename)||""}};function M(n){if(!n||!("selected_options"in n))return;const a={};for(const t of n.selected_options)a[t.label]=t.value;return a}const P=n=>n?n.map(a=>{var t,i,c,l,u,s,e,p,_,o,y,g,h,v;return{type:a==null?void 0:a.__typename,id:a==null?void 0:a.id,discounted:(a==null?void 0:a.product.price_range.maximum_price.regular_price.value)*(a==null?void 0:a.quantity_ordered)!==(a==null?void 0:a.product_sale_price.value)*(a==null?void 0:a.quantity_ordered),total:{value:(a==null?void 0:a.product_sale_price.value)*(a==null?void 0:a.quantity_ordered),currency:a==null?void 0:a.product_sale_price.currency},totalInclTax:{value:(a==null?void 0:a.product_sale_price.value)*(a==null?void 0:a.quantity_ordered),currency:a==null?void 0:a.product_sale_price.currency},price:{value:a==null?void 0:a.product_sale_price.value,currency:a==null?void 0:a.product_sale_price.currency},priceInclTax:{value:a==null?void 0:a.product_sale_price.value,currency:a==null?void 0:a.product_sale_price.currency},totalQuantity:Q(a==null?void 0:a.quantity_ordered),regularPrice:{value:(c=(i=(t=a==null?void 0:a.product)==null?void 0:t.price_range)==null?void 0:i.maximum_price)==null?void 0:c.regular_price.value,currency:(s=(u=(l=a==null?void 0:a.product)==null?void 0:l.price_range)==null?void 0:u.maximum_price)==null?void 0:s.regular_price.currency},product:S(a==null?void 0:a.product),thumbnail:{label:((p=(e=a==null?void 0:a.product)==null?void 0:e.thumbnail)==null?void 0:p.label)||"",url:((o=(_=a==null?void 0:a.product)==null?void 0:_.thumbnail)==null?void 0:o.url)||""},giftCard:(a==null?void 0:a.__typename)==="GiftCardOrderItem"?{senderName:((y=a.gift_card)==null?void 0:y.sender_name)||"",senderEmail:((g=a.gift_card)==null?void 0:g.sender_email)||"",recipientEmail:((h=a.gift_card)==null?void 0:h.recipient_email)||"",recipientName:((v=a.gift_card)==null?void 0:v.recipient_name)||""}:void 0,configurableOptions:M(a)}}):[];function U(n){return n!==null&&n.value!==void 0}const C=n=>n?{city:n.city,company:n.company||"",country:n.country_code||"",firstName:n.firstname,middleName:n.middlename||"",lastName:n.lastname,postCode:n.postcode||"",regionId:n.region_id||"",region:n.region||"",street:n.street.filter(a=>a!==null),telephone:n.telephone||"",customAttributes:n.custom_attributesV2.filter(U).map(a=>({code:a.code,value:a.value}))}:null,G=n=>{var u,s,e,p,_,o,y,g,h,v;const a=(u=n.payment_methods)==null?void 0:u[0],t=(a==null?void 0:a.type)??"",i=(a==null?void 0:a.name)??"",c=P(n.items),l=c.reduce((b,N)=>b+N.totalQuantity,0);return{status:n.status,isVirtual:n.is_virtual,coupons:((s=n==null?void 0:n.applied_coupons)==null?void 0:s.map(b=>({code:(b==null?void 0:b.code)??""})))||[],email:n.email??"",items:c,number:n.number,token:n.token,grandTotal:{value:((e=n.total)==null?void 0:e.grand_total.value)??0,currency:((p=n.total)==null?void 0:p.grand_total.currency)||""},totalQuantity:l,totalTax:{value:((_=n.total)==null?void 0:_.total_tax.value)??0,currency:((o=n.total)==null?void 0:o.total_tax.currency)||""},subtotal:{value:((y=n.total)==null?void 0:y.subtotal.value)??0,currency:((g=n.total)==null?void 0:g.subtotal.currency)||""},shipping:{amount:((h=n.total)==null?void 0:h.total_shipping.value)??0,currency:((v=n.total)==null?void 0:v.total_shipping.currency)||"",code:n.shipping_method??""},payments:[{code:t,name:i}],shippingAddress:C(n.shipping_address),billingAddress:C(n.billing_address)}},F=`
2
+ mutation placeOrder($cartId: String!) {
3
+ placeOrder(input: { cart_id: $cartId }) {
4
+ orderV2 {
5
+ number
6
+ status
7
+ token
8
+ is_virtual
9
+ applied_coupons {
10
+ code
11
+ }
12
+ email
13
+ id
14
+ total {
15
+ grand_total {
16
+ currency
17
+ value
18
+ }
19
+ subtotal {
20
+ currency
21
+ value
22
+ }
23
+ total_shipping {
24
+ currency
25
+ value
26
+ }
27
+ total_tax {
28
+ currency
29
+ value
30
+ }
31
+ }
32
+ shipping_method
33
+ payment_methods {
34
+ name
35
+ type
36
+ }
37
+ billing_address {
38
+ firstname
39
+ middlename
40
+ lastname
41
+ street
42
+ city
43
+ postcode
44
+ telephone
45
+ country_code
46
+ region
47
+ region_id
48
+ company
49
+ custom_attributesV2 {
50
+ code
51
+ ... on AttributeValue {
52
+ value
53
+ }
54
+ }
55
+ }
56
+ shipping_address {
57
+ firstname
58
+ middlename
59
+ lastname
60
+ street
61
+ city
62
+ postcode
63
+ telephone
64
+ country_code
65
+ region
66
+ region_id
67
+ company
68
+ custom_attributesV2 {
69
+ code
70
+ ... on AttributeValue {
71
+ value
72
+ }
73
+ }
74
+ }
75
+ items {
76
+ __typename
77
+ id
78
+ discounts {
79
+ amount {
80
+ value
81
+ }
82
+ }
83
+ product {
84
+ __typename
85
+ canonical_url
86
+ image {
87
+ url
88
+ }
89
+ thumbnail {
90
+ label
91
+ url
92
+ }
93
+ name
94
+ sku
95
+ uid
96
+ price_range {
97
+ maximum_price {
98
+ regular_price {
99
+ currency
100
+ value
101
+ }
102
+ }
103
+ }
104
+ }
105
+ selected_options {
106
+ label
107
+ value
108
+ }
109
+ product_sale_price {
110
+ value
111
+ currency
112
+ }
113
+ quantity_ordered
114
+ ... on GiftCardOrderItem {
115
+ gift_card {
116
+ recipient_name
117
+ recipient_email
118
+ sender_name
119
+ sender_email
120
+ message
121
+ }
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ `,x={SHOPPING_CART_CONTEXT:"shoppingCartContext",ORDER_CONTEXT:"orderContext"},X={PLACE_ORDER:"place-order"};function E(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function O(n,a){const t=E();t.push({[n]:null}),t.push({[n]:a})}function $(n,a){E().push(i=>{const c=i.getState?i.getState():{};i.push({event:n,eventInfo:{...c,...a}})})}function H(n){const a=V(n),t=q(n);console.debug({shoppingCartContext:a,orderContext:t}),O(x.SHOPPING_CART_CONTEXT,{...a}),O(x.ORDER_CONTEXT,{...t}),$(X.PLACE_ORDER)}function j(n){throw n.every(t=>{var i;return(i=t.extensions)==null?void 0:i.category})?new L(n):new R(n[0].message)}const J=async()=>{const n=T.cartId;if(!n)throw new w;const{data:a,errors:t}=await A(F,{variables:{cartId:n}}).catch(k);t&&j(t);const i=G(a.placeOrder.orderV2);return H(i),f.emit("checkout/order",i),D.value={pending:!1,data:null},f.emit("cart/reset",void 0),i};export{J as p};
@@ -0,0 +1,36 @@
1
+ import{events as n}from"@dropins/tools/event-bus.js";import{p as l,o as a,j as d,n as c,m as f}from"./fixtures.js";import{Initializer as m}from"@dropins/tools/lib.js";import{a as i}from"./getCustomer.js";const _=e=>e?e.filter(Boolean).filter(r=>(r==null?void 0:r.label)&&(r==null?void 0:r.value)).map(r=>({text:r.label,value:r.value})):[],g=e=>e?e.filter(Boolean).filter(t=>(t==null?void 0:t.name)&&(t==null?void 0:t.value)):[],v=e=>e?e.filter(Boolean).map(r=>({code:r.code,defaultValue:r.default_value||void 0,frontendInput:r.frontend_input||void 0,isDisabled:!1,isRequired:r.is_required,label:r.label||void 0,multilineCount:r.multiline_count||void 0,options:_(r.options),sortOrder:r.sort_order||void 0,validateRules:g(r.validate_rules)})):[],p=e=>{if(e)return e.filter(t=>!!t).filter(t=>{const{two_letter_abbreviation:r,full_name_locale:s}=t;return!!r&&!!s}).map(t=>{const{two_letter_abbreviation:r,full_name_locale:s}=t;return{value:r,label:s}})},y=`
2
+ query fetchAddressFormFields {
3
+ attributesForm(formCode: "customer_register_address") {
4
+ items {
5
+ frontend_input
6
+ code
7
+ label
8
+ default_value
9
+ is_required
10
+ options {
11
+ label
12
+ value
13
+ is_default
14
+ }
15
+ ... on CustomerAttributeMetadata {
16
+ multiline_count
17
+ sort_order
18
+ validate_rules {
19
+ name
20
+ value
21
+ }
22
+ }
23
+ }
24
+ errors {
25
+ message
26
+ type
27
+ }
28
+ }
29
+ }
30
+ `,b=async()=>await l({type:"query",query:y,options:{method:"GET",cache:"no-cache"},path:"attributesForm.items",signalType:"addressFormFields",transformer:v,defaultValueOnFail:[]}),h=`
31
+ query getCountries {
32
+ countries {
33
+ two_letter_abbreviation
34
+ full_name_locale
35
+ }
36
+ }`,C=async()=>await l({type:"query",query:h,options:{method:"GET",cache:"no-cache"},path:"countries",signalType:"countryList",transformer:p,defaultValueOnFail:[]}),F=()=>[n.on("cart/initialized",e=>{const t=(e==null?void 0:e.id)||null;a.cartId=t,t?i():o()},{eager:!0}),n.on("cart/data",e=>{const t=(e==null?void 0:e.id)||null;t!==a.cartId&&(a.cartId=t,t?i():o())},{eager:!0}),n.on("authenticated",e=>{a.authenticated=e,e||I()},{eager:!0})],u=new m({init:async e=>{const t={guestViewCookieExpirationDays:30,...e};u.config.setConfig(t),q()},listeners:F}),V=u.config,q=async()=>Promise.all([d(),C(),b()]),o=()=>{a.cartId=null,c.value={pending:!1,data:null}},I=()=>{a.authenticated=!1,f.value={pending:!1,data:null}};export{q as a,I as b,V as c,b as f,C as g,u as i,o as r};
@@ -0,0 +1,13 @@
1
+ import{o as n,M as e,c as d,p as l}from"./fixtures.js";import{C as o,t as c}from"./getCart.graphql.js";const p=`
2
+ mutation setBillingAddress($cartId: String!, $input: BillingAddressInput!) {
3
+ setBillingAddressOnCart(
4
+ input: { cart_id: $cartId, billing_address: $input }
5
+ ) {
6
+ cart {
7
+ id
8
+ ...CheckoutData
9
+ }
10
+ }
11
+ }
12
+ ${o}
13
+ `,m=async({signal:a,input:s})=>{const t=n.cartId,{address:i,same_as_shipping:r}=s;if(!t)throw new e;if(!r&&!i)throw new d;return await l({type:"mutation",query:p,options:{signal:a,variables:{cartId:t,input:s}},path:"setBillingAddressOnCart.cart",signalType:"cart",transformer:c})};export{m as s};
@@ -0,0 +1,17 @@
1
+ import{a as r,g as s,v as e,o as l,M as n,p as o}from"./fixtures.js";import"@dropins/tools/event-bus.js";import{C as m,t as c}from"./getCart.graphql.js";const E=a=>!!(a!=null&&a.is_email_available),u=`
2
+ query isEmailAvailable($email: String!) {
3
+ isEmailAvailable(email: $email) {
4
+ is_email_available
5
+ }
6
+ }
7
+ `,h=a=>{if(!(!a||a.length===0))throw Error(a.map(t=>t.message).join(" "))},A=async a=>{if(!a)throw new r;const{data:t,errors:i}=await s(u,{method:"GET",cache:"no-cache",variables:{email:a}}).catch(e);return i&&h(i),E(t.isEmailAvailable)},p=`
8
+ mutation setGuestEmail($cartId: String!, $email: String!) {
9
+ setGuestEmailOnCart(input: { cart_id: $cartId, email: $email }) {
10
+ cart {
11
+ id
12
+ ...CheckoutData
13
+ }
14
+ }
15
+ }
16
+ ${m}
17
+ `,C=async a=>{const t=l.cartId;if(!t)throw new n;return await o({type:"mutation",query:p,options:{variables:{cartId:t,email:a}},path:"setGuestEmailOnCart.cart",signalType:"cart",transformer:c})};export{A as i,C as s};
@@ -0,0 +1,13 @@
1
+ import{o as e,M as r,b as n,p as o}from"./fixtures.js";import{C as s,t as i}from"./getCart.graphql.js";const m=`
2
+ mutation setPaymentMethod($cartId: String!, $paymentMethod: String!) {
3
+ setPaymentMethodOnCart(
4
+ input: { cart_id: $cartId, payment_method: { code: $paymentMethod } }
5
+ ) {
6
+ cart {
7
+ id
8
+ ...CheckoutData
9
+ }
10
+ }
11
+ }
12
+ ${s}
13
+ `,h=async t=>{const a=e.cartId;if(!a)throw new r;if(!t)throw new n;return await o({type:"mutation",query:m,options:{variables:{cartId:a,paymentMethod:t}},path:"setPaymentMethodOnCart.cart",signalType:"cart",transformer:i})};export{h as s};
@@ -0,0 +1,13 @@
1
+ import{a as s,b as p,M as u,c as _}from"./getMultilineValues.js";import{o as I,M as g,p as C}from"./fixtures.js";import{C as h,t as A}from"./getCart.graphql.js";import"@dropins/tools/event-bus.js";const T=/^\d+$/,l=t=>{if(T.test(t))return parseInt(t,10)},m=`
2
+ mutation setShippingAddress($cartId: String!, $address: CartAddressInput!) {
3
+ setShippingAddressesOnCart(
4
+ input: { cart_id: $cartId, shipping_addresses: [{ address: $address }] }
5
+ ) {
6
+ cart {
7
+ id
8
+ ...CheckoutData
9
+ }
10
+ }
11
+ }
12
+ ${h}
13
+ `,y=["city","company","country_code","firstname","lastname","postcode","region","region_id","save_in_address_book","street","telephone","vat_id"],v=t=>{const a={city:t[s.City],company:t[s.Company],country_code:t[s.Country],firstname:t[s.FirstName],lastname:t[s.LastName],postcode:t[s.PostCode],save_in_address_book:!0,street:p(s.Street,t),telephone:t[s.Telephone],vat_id:t[s.Vat]},r=t[s.Region],d=l(r);d?a.region_id=d:a.region=r;const c=Object.keys(t).filter(e=>!e.startsWith("street")).filter(e=>!y.includes(e)).filter(e=>e!=="country_id").map(e=>{const[n,i]=e.split(u);if(!i)return{attribute_code:n,value:t[e]};const o=p(n,t).join(_);return{attribute_code:n,value:o}}).filter((e,n,i)=>n===i.findIndex(o=>o.attribute_code===e.attribute_code));return c.length>0&&(a.custom_attributes=c),a},N=async({signal:t,address:a})=>{const r=I.cartId;if(!r)throw new g;return await C({type:"mutation",query:m,options:{signal:t,variables:{cartId:r,address:a}},path:"setShippingAddressesOnCart.cart",signalType:"cart",transformer:A})};export{y as S,v as p,N as s};
@@ -0,0 +1,16 @@
1
+ import{o as a,M as s,p}from"./fixtures.js";import{C as r,t as n}from"./getCart.graphql.js";import"@dropins/tools/event-bus.js";const o=`
2
+ mutation setShippingMethods(
3
+ $cartId: String!
4
+ $shippingMethods: [ShippingMethodInput]!
5
+ ) {
6
+ setShippingMethodsOnCart(
7
+ input: { cart_id: $cartId, shipping_methods: $shippingMethods }
8
+ ) {
9
+ cart {
10
+ id
11
+ ...CheckoutData
12
+ }
13
+ }
14
+ }
15
+ ${r}
16
+ `,c=async i=>{const t=a.cartId;if(!t)throw new s;return await p({type:"mutation",query:o,options:{variables:{cartId:t,shippingMethods:i}},path:"setShippingMethodsOnCart.cart",signalType:"cart",transformer:n})};export{c as s};
@@ -0,0 +1,22 @@
1
+ import { SaveAddressCommand } from '.';
2
+ import { PreselectedAddressFields } from '../../containers';
3
+ import { AddressFormType } from '../../data/models';
4
+ import { cartSignal } from '../../signals';
5
+ import { HTMLAttributes } from 'preact/compat';
6
+
7
+ export interface AddressFormProps extends HTMLAttributes<HTMLDivElement> {
8
+ addressType: AddressFormType;
9
+ autoFill?: boolean;
10
+ headingId: string;
11
+ name: string;
12
+ onCheckoutDataUpdate?: () => Promise<void>;
13
+ preselectedFields?: PreselectedAddressFields;
14
+ saveAddressHandler: (command: SaveAddressCommand) => Promise<typeof cartSignal.value.data>;
15
+ }
16
+ export type AddressFormHandle = {
17
+ triggerSaveAddress: (signal: AbortSignal) => Promise<typeof cartSignal.value.data> | undefined;
18
+ };
19
+ export declare const AddressForm: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<AddressFormProps> & {
20
+ ref?: import('preact').Ref<AddressFormHandle> | undefined;
21
+ }>;
22
+ //# sourceMappingURL=AddressForm.d.ts.map
@@ -0,0 +1,4 @@
1
+ export declare const MULTILINE_SUFFIX = "-";
2
+ export declare const MULTILINE_CUSTOM_ATTR_SPLIT = "\n";
3
+ export declare const DEBOUNCE_TIME = 2000;
4
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,7 @@
1
+ export * from './AddressForm';
2
+ export * from './constants';
3
+ export * from './useAddressForm';
4
+ export * from './usePreselectedFields';
5
+ export * from './utils';
6
+ export { AddressForm as default } from './AddressForm';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { AddressFormType, AddressFormValues } from '../../data/models/address-form-fields';
2
+
3
+ export declare function useAddressBackup(addressType: AddressFormType): {
4
+ addressBackup: AddressFormValues | null;
5
+ backupAddress: (address: AddressFormValues) => NodeJS.Timeout;
6
+ removeAddressBackup: () => void;
7
+ };
8
+ //# sourceMappingURL=useAddressBackup.d.ts.map
@@ -0,0 +1,39 @@
1
+ import { AddressFormErrors, AddressFormType, AddressFormValues } from '../../data/models';
2
+ import { cartSignal } from '../../signals';
3
+ import { RefObject } from 'preact';
4
+
5
+ export type DefaultValues = {
6
+ country_id?: string;
7
+ };
8
+ export type AddressFormState = {
9
+ address: AddressFormValues;
10
+ errors: AddressFormErrors;
11
+ };
12
+ export type SaveAddressCommand = {
13
+ signal?: AbortSignal;
14
+ address: AddressFormValues;
15
+ };
16
+ export type LoadAutoFillProps = {
17
+ values: AddressFormValues;
18
+ triggerAutoSave: boolean;
19
+ };
20
+ export type UseAddressFormProps = {
21
+ defaultValues?: DefaultValues;
22
+ formRef: RefObject<HTMLFormElement>;
23
+ onCheckoutDataUpdate?: () => Promise<void>;
24
+ preselection?: AddressFormValues;
25
+ saveAddressHandler: (command: SaveAddressCommand) => Promise<typeof cartSignal.value.data>;
26
+ type: AddressFormType;
27
+ };
28
+ export declare const useAddressForm: ({ defaultValues, formRef, onCheckoutDataUpdate, preselection, saveAddressHandler, type, }: UseAddressFormProps) => {
29
+ address: AddressFormValues;
30
+ errors: Record<string, string>;
31
+ loadAutoFill: ({ values, triggerAutoSave, }: LoadAutoFillProps) => void;
32
+ dismissError: (code: string) => void;
33
+ onChange: (event: Event) => void;
34
+ onSelection: (event: Event) => void;
35
+ onBlur: (event: Event) => void;
36
+ onInvalid: (event: Event) => void;
37
+ setAddress: import('preact/hooks').Dispatch<import('preact/hooks').StateUpdater<AddressFormValues>>;
38
+ };
39
+ //# sourceMappingURL=useAddressForm.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { AddressFormType, AddressFormValues } from '../../data/models';
2
+
3
+ type useCheckoutAddressEventEmitterProps = {
4
+ address: AddressFormValues;
5
+ type: AddressFormType;
6
+ };
7
+ declare function useCheckoutAddressEventEmitter({ address, type, }: useCheckoutAddressEventEmitterProps): void;
8
+ export default useCheckoutAddressEventEmitter;
9
+ //# sourceMappingURL=useCheckoutAddressEventEmitter.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { PreselectedAddressFields } from '../../containers';
2
+ import { AddressFormField, AddressFormValues } from '../../data/models/address-form-fields';
3
+
4
+ export type UsePreselectedFieldsProps = {
5
+ fields?: AddressFormField[];
6
+ preselectedFields?: PreselectedAddressFields;
7
+ };
8
+ export declare function usePreselectedFields({ fields, preselectedFields, }: UsePreselectedFieldsProps): AddressFormValues;
9
+ //# sourceMappingURL=usePreselectedFields.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { AddressFormType } from '../../data/models';
2
+ import { Cart } from '../../data/models/cart';
3
+ import { Customer } from '../../data/models/customer';
4
+
5
+ export declare const getCustomerAddress: ({ addressType, customer, }: {
6
+ addressType: AddressFormType;
7
+ customer: Customer;
8
+ }) => import('../../data/models').CustomerAddress | undefined;
9
+ export declare const getCartAddress: ({ addressType, cart, }: {
10
+ addressType: AddressFormType;
11
+ cart: Cart;
12
+ }) => import('../../data/models/address').Address | undefined;
13
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { CheckboxProps } from '@dropins/tools/types/elsie/src/components';
3
+
4
+ export interface BillToShippingAddressProps extends Omit<CheckboxProps, 'name' | 'label'> {
5
+ isInitialized?: boolean;
6
+ }
7
+ export declare const BillToShippingAddress: FunctionComponent<BillToShippingAddressProps>;
8
+ //# sourceMappingURL=BillToShippingAddress.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'preact';
2
+
3
+ export declare const BillToShippingAddressSkeleton: FunctionComponent;
4
+ //# sourceMappingURL=BillToShippingAddressSkeleton.d.ts.map
@@ -0,0 +1,4 @@
1
+ export * from './BillToShippingAddress';
2
+ export * from './BillToShippingAddressSkeleton';
3
+ export { BillToShippingAddress as default } from './BillToShippingAddress';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,32 @@
1
+ import { FunctionComponent, VNode } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ export type AsideSections = {
5
+ orderSummary?: VNode;
6
+ };
7
+ declare const Aside: FunctionComponent<{
8
+ sections: AsideSections;
9
+ }>;
10
+ export type MainSections = {
11
+ billingAddress: VNode;
12
+ billToShippingAddress?: VNode;
13
+ login: VNode;
14
+ outOfStock: VNode;
15
+ paymentMethods: VNode;
16
+ placeOrder: VNode;
17
+ shippingAddress?: VNode;
18
+ shippingMethods?: VNode;
19
+ };
20
+ declare const Main: FunctionComponent<{
21
+ sections?: MainSections;
22
+ }>;
23
+ export interface CheckoutProps extends HTMLAttributes<HTMLDivElement> {
24
+ isLoading?: boolean;
25
+ }
26
+ interface CheckoutComponent extends FunctionComponent<CheckoutProps> {
27
+ Main: typeof Main;
28
+ Aside: typeof Aside;
29
+ }
30
+ export declare const Checkout: CheckoutComponent;
31
+ export {};
32
+ //# sourceMappingURL=Checkout.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './Checkout';
2
+ export { Checkout as default } from './Checkout';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ export interface EmptyCartProps extends HTMLAttributes<HTMLDivElement> {
5
+ title?: string;
6
+ routeHome?: () => string;
7
+ }
8
+ export declare const EmptyCart: FunctionComponent<EmptyCartProps>;
9
+ //# sourceMappingURL=EmptyCart.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './EmptyCart';
2
+ export { EmptyCart as default } from './EmptyCart';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { FunctionComponent, VNode } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ export interface EstimateShippingProps {
5
+ estimated?: boolean;
6
+ price: VNode<HTMLAttributes<HTMLSpanElement>>;
7
+ priceExclTax?: VNode<HTMLAttributes<HTMLSpanElement>>;
8
+ taxExcluded?: boolean;
9
+ taxIncluded?: boolean;
10
+ }
11
+ export declare const EstimateShipping: FunctionComponent<EstimateShippingProps>;
12
+ //# sourceMappingURL=EstimateShipping.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'preact';
2
+
3
+ export declare const EstimateShippingSkeleton: FunctionComponent;
4
+ //# sourceMappingURL=EstimateShippingSkeleton.d.ts.map
@@ -0,0 +1,4 @@
1
+ export * from './EstimateShipping';
2
+ export { EstimateShipping as default } from './EstimateShipping';
3
+ export * from './EstimateShippingSkeleton';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { AddressFormElement, AddressFormType } from '../../data/models/address-form-fields';
2
+ import { FunctionComponent, Ref } from 'preact';
3
+ import { HTMLAttributes } from 'preact/compat';
4
+
5
+ export interface FieldsFormProps extends HTMLAttributes<HTMLDivElement> {
6
+ addressType: AddressFormType;
7
+ fields: AddressFormElement[];
8
+ formRef: Ref<HTMLFormElement>;
9
+ headingId: string;
10
+ name: string;
11
+ }
12
+ export declare const FieldsForm: FunctionComponent<FieldsFormProps>;
13
+ //# sourceMappingURL=FieldsForm.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'preact';
2
+
3
+ export declare const FieldsFormSkeleton: FunctionComponent;
4
+ //# sourceMappingURL=FieldsFormSkeleton.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { AddressFormElement, AddressFormType } from '../../data/models';
2
+
3
+ type FieldFactoryProps = {
4
+ addressType: AddressFormType;
5
+ element: AddressFormElement;
6
+ };
7
+ export declare const createField: ({ addressType, element }: FieldFactoryProps) => import("preact").JSX.Element | null;
8
+ export {};
9
+ //# sourceMappingURL=fieldFactory.d.ts.map
@@ -0,0 +1,5 @@
1
+ import { AddressFormElement } from '../../data/models/address-form-fields';
2
+
3
+ declare const defaultFormElements: AddressFormElement[];
4
+ export { defaultFormElements };
5
+ //# sourceMappingURL=fixtures.d.ts.map
@@ -0,0 +1,6 @@
1
+ export * from './fieldFactory';
2
+ export * from './validation';
3
+ export * from './FieldsForm';
4
+ export * from './FieldsFormSkeleton';
5
+ export { FieldsForm as default } from './FieldsForm';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { AddressFormField } from '../../data/models/address-form-fields';
2
+
3
+ export type ValidityProps = {
4
+ accept?: string;
5
+ max?: string | number;
6
+ maxLength?: number;
7
+ min?: string | number;
8
+ minLength?: number;
9
+ pattern?: string;
10
+ required?: boolean;
11
+ };
12
+ export type InputValidation = 'alphanumeric' | 'alphanumeric-w-space' | 'alphanum-with-spaces' | 'alpha' | 'url' | 'numeric' | 'email';
13
+ export declare const validityProps: (rules: AddressFormField['validateRules']) => ValidityProps;
14
+ export type Patterns = {
15
+ [key in InputValidation]: RegExp;
16
+ };
17
+ export declare const patterns: Patterns;
18
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ export interface HeadingProps extends Omit<HTMLAttributes<HTMLHeadingElement>, 'level'> {
5
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
6
+ }
7
+ export declare const Heading: FunctionComponent<HeadingProps>;
8
+ //# sourceMappingURL=Heading.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './Heading';
2
+ export { Heading as default } from './Heading';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { HTMLAttributes } from 'preact/compat';
2
+ import { FunctionComponent } from 'preact';
3
+
4
+ export interface LoginEmailProps extends HTMLAttributes<HTMLFormElement> {
5
+ value?: string;
6
+ error?: string;
7
+ hint?: string;
8
+ onChange: (e: any) => void;
9
+ onBlur: (e: any) => void;
10
+ onInvalid: (e: any) => void;
11
+ }
12
+ export declare const Email: FunctionComponent<LoginEmailProps>;
13
+ //# sourceMappingURL=Email.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { Customer } from '../../data/models';
2
+ import { FunctionComponent, HTMLAttributes } from 'preact/compat';
3
+
4
+ export interface LoginFormProps extends HTMLAttributes<HTMLDivElement> {
5
+ currentEmail: string | null;
6
+ hint?: string;
7
+ error?: string | null;
8
+ onEmailChange: (e: any) => void;
9
+ onEmailBlur: (e: any) => void;
10
+ onEmailInvalid: (e: any) => void;
11
+ onSignInClick?: (email: string | null) => void;
12
+ onSignOutClick?: () => void;
13
+ customer?: Customer | null;
14
+ }
15
+ export declare const LoginForm: FunctionComponent<LoginFormProps>;
16
+ //# sourceMappingURL=LoginForm.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { FunctionComponent } from 'preact';
2
+
3
+ export declare const LoginFormSkeleton: FunctionComponent;
4
+ //# sourceMappingURL=LoginFormSkeleton.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { FunctionComponent } from 'preact';
2
+
3
+ type SignInProps = {
4
+ onSignInClick?: (email: string | null) => void;
5
+ email: string | null;
6
+ };
7
+ export declare const SignIn: FunctionComponent<SignInProps>;
8
+ export {};
9
+ //# sourceMappingURL=SignIn.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { FunctionComponent } from 'preact';
2
+
3
+ type SignOutProps = {
4
+ onSignOutClick?: () => void;
5
+ };
6
+ export declare const SignOut: FunctionComponent<SignOutProps>;
7
+ export {};
8
+ //# sourceMappingURL=SignOut.d.ts.map
@@ -0,0 +1,6 @@
1
+ export * from './Email';
2
+ export * from './SignIn';
3
+ export * from './LoginForm';
4
+ export * from './LoginFormSkeleton';
5
+ export * from './SignOut';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { Item as CartItem } from '../../types/cart';
2
+ import { FunctionComponent } from 'preact';
3
+ import { HTMLAttributes } from 'preact/compat';
4
+
5
+ export interface OutOfStockProps extends HTMLAttributes<HTMLDivElement> {
6
+ items: CartItem[];
7
+ onRemoveOutOfStock?: (event: Event) => void;
8
+ routeCart?: string;
9
+ }
10
+ export declare const OutOfStock: FunctionComponent<OutOfStockProps>;
11
+ //# sourceMappingURL=OutOfStock.d.ts.map