@commercelayer/react-components 2.49.8 → 2.50.3

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 (372) hide show
  1. package/lib/cjs/components/AddToCartButton.d.ts +1 -1
  2. package/lib/cjs/components/AddToCartButton.js +1 -1
  3. package/lib/cjs/components/Address.js +1 -1
  4. package/lib/cjs/components/AddressCountrySelector.js +1 -1
  5. package/lib/cjs/components/AddressField.js +1 -1
  6. package/lib/cjs/components/AddressInput.js +1 -1
  7. package/lib/cjs/components/AddressStateSelector.js +1 -1
  8. package/lib/cjs/components/AddressesContainer.js +1 -1
  9. package/lib/cjs/components/AdyenPayment.js +1 -1
  10. package/lib/cjs/components/AvailabilityContainer.js +1 -1
  11. package/lib/cjs/components/AvailabilityTemplate.js +1 -1
  12. package/lib/cjs/components/BillingAddressContainer.js +1 -1
  13. package/lib/cjs/components/BillingAddressForm.js +1 -1
  14. package/lib/cjs/components/BraintreePayment.js +1 -1
  15. package/lib/cjs/components/CheckoutLink.js +1 -1
  16. package/lib/cjs/components/CommerceLayer.js +1 -1
  17. package/lib/cjs/components/CustomerContainer.js +1 -1
  18. package/lib/cjs/components/CustomerInput.js +1 -1
  19. package/lib/cjs/components/DeliveryLeadTime.js +1 -1
  20. package/lib/cjs/components/DiscountAmount.js +1 -1
  21. package/lib/cjs/components/Errors.js +1 -1
  22. package/lib/cjs/components/ExternalFunction.js +1 -1
  23. package/lib/cjs/components/GiftCard.js +1 -1
  24. package/lib/cjs/components/GiftCardAmount.js +1 -1
  25. package/lib/cjs/components/GiftCardContainer.js +1 -1
  26. package/lib/cjs/components/GiftCardCurrencySelector.js +1 -1
  27. package/lib/cjs/components/GiftCardInput.js +1 -1
  28. package/lib/cjs/components/GiftCardOrCouponCode.js +1 -1
  29. package/lib/cjs/components/GiftCardOrCouponForm.js +1 -1
  30. package/lib/cjs/components/GiftCardOrCouponInput.js +1 -1
  31. package/lib/cjs/components/GiftCardOrCouponRemoveButton.js +1 -1
  32. package/lib/cjs/components/GiftCardOrCouponSubmit.js +1 -1
  33. package/lib/cjs/components/ItemContainer.js +1 -1
  34. package/lib/cjs/components/LineItem.js +1 -1
  35. package/lib/cjs/components/LineItemAmount.js +1 -1
  36. package/lib/cjs/components/LineItemCode.d.ts +6 -2
  37. package/lib/cjs/components/LineItemCode.js +1 -1
  38. package/lib/cjs/components/LineItemImage.d.ts +4 -2
  39. package/lib/cjs/components/LineItemImage.js +1 -1
  40. package/lib/cjs/components/LineItemName.d.ts +4 -2
  41. package/lib/cjs/components/LineItemName.js +1 -1
  42. package/lib/cjs/components/LineItemOption.js +1 -1
  43. package/lib/cjs/components/LineItemOptions.js +1 -1
  44. package/lib/cjs/components/LineItemQuantity.js +1 -1
  45. package/lib/cjs/components/LineItemRemoveLink.js +1 -1
  46. package/lib/cjs/components/LineItemsContainer.js +1 -1
  47. package/lib/cjs/components/LineItemsCount.js +1 -1
  48. package/lib/cjs/components/MetadataInput.js +1 -1
  49. package/lib/cjs/components/OrderContainer.js +1 -1
  50. package/lib/cjs/components/OrderNumber.js +1 -1
  51. package/lib/cjs/components/OrderStorage.js +1 -1
  52. package/lib/cjs/components/PaymentGateway.js +1 -1
  53. package/lib/cjs/components/PaymentMethod.js +1 -1
  54. package/lib/cjs/components/PaymentMethodAmount.js +1 -1
  55. package/lib/cjs/components/PaymentMethodName.js +1 -1
  56. package/lib/cjs/components/PaymentMethodPrice.js +1 -1
  57. package/lib/cjs/components/PaymentMethodRadioButton.js +1 -1
  58. package/lib/cjs/components/PaymentMethodsContainer.js +1 -1
  59. package/lib/cjs/components/PaymentSource.js +1 -1
  60. package/lib/cjs/components/PaymentSourceBrandIcon.js +1 -1
  61. package/lib/cjs/components/PaymentSourceBrandName.js +1 -1
  62. package/lib/cjs/components/PaymentSourceDetail.js +1 -1
  63. package/lib/cjs/components/PaymentSourceEditButton.js +1 -1
  64. package/lib/cjs/components/PaypalPayment.js +1 -1
  65. package/lib/cjs/components/PlaceOrderButton.js +1 -1
  66. package/lib/cjs/components/PlaceOrderContainer.js +1 -1
  67. package/lib/cjs/components/Price.js +1 -1
  68. package/lib/cjs/components/PricesContainer.js +1 -1
  69. package/lib/cjs/components/PrivacyAndTermsCheckbox.js +1 -1
  70. package/lib/cjs/components/QuantitySelector.js +1 -1
  71. package/lib/cjs/components/SaveAddressesButton.js +1 -1
  72. package/lib/cjs/components/SaveCustomerButton.js +1 -1
  73. package/lib/cjs/components/Shipment.js +1 -1
  74. package/lib/cjs/components/ShipmentField.js +1 -1
  75. package/lib/cjs/components/ShipmentsContainer.js +1 -1
  76. package/lib/cjs/components/ShippingAddressContainer.js +1 -1
  77. package/lib/cjs/components/ShippingAddressForm.js +1 -1
  78. package/lib/cjs/components/ShippingAmount.js +1 -1
  79. package/lib/cjs/components/ShippingMethod.js +1 -1
  80. package/lib/cjs/components/ShippingMethodName.js +1 -1
  81. package/lib/cjs/components/ShippingMethodPrice.js +1 -1
  82. package/lib/cjs/components/ShippingMethodRadioButton.d.ts +8 -4
  83. package/lib/cjs/components/ShippingMethodRadioButton.js +1 -1
  84. package/lib/cjs/components/SkuList.js +1 -1
  85. package/lib/cjs/components/SkuListsContainer.js +1 -1
  86. package/lib/cjs/components/SkuOption.js +1 -1
  87. package/lib/cjs/components/SkuOptionInput.js +1 -1
  88. package/lib/cjs/components/SkuOptionsContainer.js +1 -1
  89. package/lib/cjs/components/StockTransfer.js +1 -1
  90. package/lib/cjs/components/StockTransferField.js +1 -1
  91. package/lib/cjs/components/StripePayment.js +1 -1
  92. package/lib/cjs/components/SubTotalAmount.js +1 -1
  93. package/lib/cjs/components/SubmitButton.js +1 -1
  94. package/lib/cjs/components/TaxesAmount.js +1 -1
  95. package/lib/cjs/components/TotalAmount.js +1 -1
  96. package/lib/cjs/components/VariantSelector.js +1 -1
  97. package/lib/cjs/components/VariantsContainer.js +1 -1
  98. package/lib/cjs/components/WireTransferPayment.js +1 -1
  99. package/lib/cjs/components/gateways/AdyenGateway.js +1 -1
  100. package/lib/cjs/components/gateways/BraintreeGateway.js +1 -1
  101. package/lib/cjs/components/gateways/PaypalGateway.js +1 -1
  102. package/lib/cjs/components/gateways/StripeGateway.js +1 -1
  103. package/lib/cjs/components/gateways/WireTransferGateway.js +1 -1
  104. package/lib/cjs/components/utils/AddressCardsTemplate.d.ts +1 -1
  105. package/lib/cjs/components/utils/AddressCardsTemplate.js +1 -1
  106. package/lib/cjs/components/utils/BaseField.js +1 -1
  107. package/lib/cjs/components/utils/BaseInput.js +1 -1
  108. package/lib/cjs/components/utils/BaseOrderPrice.js +1 -1
  109. package/lib/cjs/components/utils/BaseSelect.js +1 -1
  110. package/lib/cjs/components/utils/Parent.js +1 -1
  111. package/lib/cjs/components/utils/PaymentCardsTemplate.d.ts +1 -1
  112. package/lib/cjs/components/utils/PaymentCardsTemplate.js +1 -1
  113. package/lib/cjs/components/utils/PriceTemplate.js +1 -1
  114. package/lib/cjs/components/utils/VariantTemplate.js +1 -1
  115. package/lib/cjs/components/utils/getAllErrors.js +1 -1
  116. package/lib/cjs/config/components.js +1 -1
  117. package/lib/cjs/config/currency.js +1 -1
  118. package/lib/cjs/context/AddressChildrenContext.js +1 -1
  119. package/lib/cjs/context/AddressContext.js +1 -1
  120. package/lib/cjs/context/AvailabilityContext.js +1 -1
  121. package/lib/cjs/context/BillingAddressContext.js +1 -1
  122. package/lib/cjs/context/BillingAddressFormContext.js +1 -1
  123. package/lib/cjs/context/CommerceLayerContext.js +1 -1
  124. package/lib/cjs/context/CouponAndGiftCardFormContext.js +1 -1
  125. package/lib/cjs/context/CustomerContext.js +1 -1
  126. package/lib/cjs/context/ExternalFunctionContext.js +1 -1
  127. package/lib/cjs/context/GiftCardContext.js +1 -1
  128. package/lib/cjs/context/ItemContext.js +1 -1
  129. package/lib/cjs/context/LineItemChildrenContext.js +1 -1
  130. package/lib/cjs/context/LineItemContext.js +1 -1
  131. package/lib/cjs/context/LineItemOptionChildrenContext.js +1 -1
  132. package/lib/cjs/context/OrderContext.js +1 -1
  133. package/lib/cjs/context/OrderStorageContext.js +1 -1
  134. package/lib/cjs/context/PaymentMethodChildrenContext.js +1 -1
  135. package/lib/cjs/context/PaymentMethodContext.js +1 -1
  136. package/lib/cjs/context/PaymentSourceContext.js +1 -1
  137. package/lib/cjs/context/PlaceOrderContext.js +1 -1
  138. package/lib/cjs/context/PricesContext.js +1 -1
  139. package/lib/cjs/context/ShipmentChildrenContext.js +1 -1
  140. package/lib/cjs/context/ShipmentContext.js +1 -1
  141. package/lib/cjs/context/ShippingAddressContext.js +1 -1
  142. package/lib/cjs/context/ShippingAddressFormContext.js +1 -1
  143. package/lib/cjs/context/ShippingMethodChildrenContext.js +1 -1
  144. package/lib/cjs/context/SkuListsContext.js +1 -1
  145. package/lib/cjs/context/SkuOptionChildrenContext.js +1 -1
  146. package/lib/cjs/context/SkuOptionsContext.js +1 -1
  147. package/lib/cjs/context/StockTransferChildrenContext.js +1 -1
  148. package/lib/cjs/context/VariantsContext.js +1 -1
  149. package/lib/cjs/index.d.ts +7 -3
  150. package/lib/cjs/index.js +1 -1
  151. package/lib/cjs/reducers/AddressReducer.js +1 -1
  152. package/lib/cjs/reducers/AvailabilityReducer.js +1 -1
  153. package/lib/cjs/reducers/BillingAddressReducer.js +1 -1
  154. package/lib/cjs/reducers/CustomerReducer.js +1 -1
  155. package/lib/cjs/reducers/GiftCardReducer.js +1 -1
  156. package/lib/cjs/reducers/ItemReducer.js +1 -1
  157. package/lib/cjs/reducers/LineItemReducer.js +1 -1
  158. package/lib/cjs/reducers/OrderReducer.js +1 -1
  159. package/lib/cjs/reducers/PaymentMethodReducer.js +1 -1
  160. package/lib/cjs/reducers/PlaceOrderReducer.js +1 -1
  161. package/lib/cjs/reducers/PriceReducer.js +1 -1
  162. package/lib/cjs/reducers/ShipmentReducer.js +1 -1
  163. package/lib/cjs/reducers/ShippingAddressReducer.js +1 -1
  164. package/lib/cjs/reducers/SkuListsReducer.js +1 -1
  165. package/lib/cjs/reducers/SkuOptionsReducer.js +1 -1
  166. package/lib/cjs/reducers/VariantReducer.js +1 -1
  167. package/lib/cjs/typings/errors.js +1 -1
  168. package/lib/cjs/typings/index.js +1 -1
  169. package/lib/cjs/utils/PropsType.js +1 -1
  170. package/lib/cjs/utils/addressesManager.js +1 -1
  171. package/lib/cjs/utils/baseReducer.js +1 -1
  172. package/lib/cjs/utils/browserInfo.js +1 -1
  173. package/lib/cjs/utils/childrenTypes.js +1 -1
  174. package/lib/cjs/utils/countryStateCity.js +1 -1
  175. package/lib/cjs/utils/customMessages.js +1 -1
  176. package/lib/cjs/utils/customerOrderOptions.js +1 -1
  177. package/lib/cjs/utils/getAmount.js +1 -1
  178. package/lib/cjs/utils/getCurrentItemKey.js +1 -1
  179. package/lib/cjs/utils/getErrors.js +1 -1
  180. package/lib/cjs/utils/getLineItemsCount.js +1 -1
  181. package/lib/cjs/utils/getLoaderComponent.js +1 -1
  182. package/lib/cjs/utils/getPrices.js +1 -1
  183. package/lib/cjs/utils/getSdk.js +1 -1
  184. package/lib/cjs/utils/getSkus.js +1 -1
  185. package/lib/cjs/utils/isEmptyStates.js +1 -1
  186. package/lib/cjs/utils/isJSON.js +1 -1
  187. package/lib/cjs/utils/jwt.js +1 -1
  188. package/lib/cjs/utils/localStorage.js +1 -1
  189. package/lib/cjs/utils/organization.js +1 -1
  190. package/lib/cjs/utils/paypalPayment.js +1 -1
  191. package/lib/cjs/utils/promisify.js +1 -1
  192. package/lib/cjs/utils/shipments.js +1 -1
  193. package/lib/cjs/utils/validateFormFields.js +1 -1
  194. package/lib/esm/components/AddToCartButton.d.ts +1 -1
  195. package/lib/esm/components/AddToCartButton.js +1 -1
  196. package/lib/esm/components/Address.js +1 -1
  197. package/lib/esm/components/AddressCountrySelector.js +1 -1
  198. package/lib/esm/components/AddressField.js +1 -1
  199. package/lib/esm/components/AddressInput.js +1 -1
  200. package/lib/esm/components/AddressStateSelector.js +1 -1
  201. package/lib/esm/components/AddressesContainer.js +1 -1
  202. package/lib/esm/components/AdyenPayment.js +1 -1
  203. package/lib/esm/components/AvailabilityContainer.js +1 -1
  204. package/lib/esm/components/AvailabilityTemplate.js +1 -1
  205. package/lib/esm/components/BillingAddressContainer.js +1 -1
  206. package/lib/esm/components/BillingAddressForm.js +1 -1
  207. package/lib/esm/components/BraintreePayment.js +1 -1
  208. package/lib/esm/components/CheckoutLink.js +1 -1
  209. package/lib/esm/components/CommerceLayer.js +1 -1
  210. package/lib/esm/components/CustomerContainer.js +1 -1
  211. package/lib/esm/components/CustomerInput.js +1 -1
  212. package/lib/esm/components/DeliveryLeadTime.js +1 -1
  213. package/lib/esm/components/DiscountAmount.js +1 -1
  214. package/lib/esm/components/Errors.js +1 -1
  215. package/lib/esm/components/ExternalFunction.js +1 -1
  216. package/lib/esm/components/GiftCard.js +1 -1
  217. package/lib/esm/components/GiftCardAmount.js +1 -1
  218. package/lib/esm/components/GiftCardContainer.js +1 -1
  219. package/lib/esm/components/GiftCardCurrencySelector.js +1 -1
  220. package/lib/esm/components/GiftCardInput.js +1 -1
  221. package/lib/esm/components/GiftCardOrCouponCode.js +1 -1
  222. package/lib/esm/components/GiftCardOrCouponForm.js +1 -1
  223. package/lib/esm/components/GiftCardOrCouponInput.js +1 -1
  224. package/lib/esm/components/GiftCardOrCouponRemoveButton.js +1 -1
  225. package/lib/esm/components/GiftCardOrCouponSubmit.js +1 -1
  226. package/lib/esm/components/ItemContainer.js +1 -1
  227. package/lib/esm/components/LineItem.js +1 -1
  228. package/lib/esm/components/LineItemAmount.js +1 -1
  229. package/lib/esm/components/LineItemCode.d.ts +6 -2
  230. package/lib/esm/components/LineItemCode.js +1 -1
  231. package/lib/esm/components/LineItemImage.d.ts +4 -2
  232. package/lib/esm/components/LineItemImage.js +1 -1
  233. package/lib/esm/components/LineItemName.d.ts +4 -2
  234. package/lib/esm/components/LineItemName.js +1 -1
  235. package/lib/esm/components/LineItemOption.js +1 -1
  236. package/lib/esm/components/LineItemOptions.js +1 -1
  237. package/lib/esm/components/LineItemQuantity.js +1 -1
  238. package/lib/esm/components/LineItemRemoveLink.js +1 -1
  239. package/lib/esm/components/LineItemsContainer.js +1 -1
  240. package/lib/esm/components/LineItemsCount.js +1 -1
  241. package/lib/esm/components/MetadataInput.js +1 -1
  242. package/lib/esm/components/OrderContainer.js +1 -1
  243. package/lib/esm/components/OrderNumber.js +1 -1
  244. package/lib/esm/components/OrderStorage.js +1 -1
  245. package/lib/esm/components/PaymentGateway.js +1 -1
  246. package/lib/esm/components/PaymentMethod.js +1 -1
  247. package/lib/esm/components/PaymentMethodAmount.js +1 -1
  248. package/lib/esm/components/PaymentMethodName.js +1 -1
  249. package/lib/esm/components/PaymentMethodPrice.js +1 -1
  250. package/lib/esm/components/PaymentMethodRadioButton.js +1 -1
  251. package/lib/esm/components/PaymentMethodsContainer.js +1 -1
  252. package/lib/esm/components/PaymentSource.js +1 -1
  253. package/lib/esm/components/PaymentSourceBrandIcon.js +1 -1
  254. package/lib/esm/components/PaymentSourceBrandName.js +1 -1
  255. package/lib/esm/components/PaymentSourceDetail.js +1 -1
  256. package/lib/esm/components/PaymentSourceEditButton.js +1 -1
  257. package/lib/esm/components/PaypalPayment.js +1 -1
  258. package/lib/esm/components/PlaceOrderButton.js +1 -1
  259. package/lib/esm/components/PlaceOrderContainer.js +1 -1
  260. package/lib/esm/components/Price.js +1 -1
  261. package/lib/esm/components/PricesContainer.js +1 -1
  262. package/lib/esm/components/PrivacyAndTermsCheckbox.js +1 -1
  263. package/lib/esm/components/QuantitySelector.js +1 -1
  264. package/lib/esm/components/SaveAddressesButton.js +1 -1
  265. package/lib/esm/components/SaveCustomerButton.js +1 -1
  266. package/lib/esm/components/Shipment.js +1 -1
  267. package/lib/esm/components/ShipmentField.js +1 -1
  268. package/lib/esm/components/ShipmentsContainer.js +1 -1
  269. package/lib/esm/components/ShippingAddressContainer.js +1 -1
  270. package/lib/esm/components/ShippingAddressForm.js +1 -1
  271. package/lib/esm/components/ShippingAmount.js +1 -1
  272. package/lib/esm/components/ShippingMethod.js +1 -1
  273. package/lib/esm/components/ShippingMethodName.js +1 -1
  274. package/lib/esm/components/ShippingMethodPrice.js +1 -1
  275. package/lib/esm/components/ShippingMethodRadioButton.d.ts +8 -4
  276. package/lib/esm/components/ShippingMethodRadioButton.js +1 -1
  277. package/lib/esm/components/SkuList.js +1 -1
  278. package/lib/esm/components/SkuListsContainer.js +1 -1
  279. package/lib/esm/components/SkuOption.js +1 -1
  280. package/lib/esm/components/SkuOptionInput.js +1 -1
  281. package/lib/esm/components/SkuOptionsContainer.js +1 -1
  282. package/lib/esm/components/StockTransfer.js +1 -1
  283. package/lib/esm/components/StockTransferField.js +1 -1
  284. package/lib/esm/components/StripePayment.js +1 -1
  285. package/lib/esm/components/SubTotalAmount.js +1 -1
  286. package/lib/esm/components/SubmitButton.js +1 -1
  287. package/lib/esm/components/TaxesAmount.js +1 -1
  288. package/lib/esm/components/TotalAmount.js +1 -1
  289. package/lib/esm/components/VariantSelector.js +1 -1
  290. package/lib/esm/components/VariantsContainer.js +1 -1
  291. package/lib/esm/components/WireTransferPayment.js +1 -1
  292. package/lib/esm/components/gateways/AdyenGateway.js +1 -1
  293. package/lib/esm/components/gateways/BraintreeGateway.js +1 -1
  294. package/lib/esm/components/gateways/PaypalGateway.js +1 -1
  295. package/lib/esm/components/gateways/StripeGateway.js +1 -1
  296. package/lib/esm/components/gateways/WireTransferGateway.js +1 -1
  297. package/lib/esm/components/utils/AddressCardsTemplate.d.ts +1 -1
  298. package/lib/esm/components/utils/AddressCardsTemplate.js +1 -1
  299. package/lib/esm/components/utils/BaseField.js +1 -1
  300. package/lib/esm/components/utils/BaseInput.js +1 -1
  301. package/lib/esm/components/utils/BaseOrderPrice.js +1 -1
  302. package/lib/esm/components/utils/BaseSelect.js +1 -1
  303. package/lib/esm/components/utils/Parent.js +1 -1
  304. package/lib/esm/components/utils/PaymentCardsTemplate.d.ts +1 -1
  305. package/lib/esm/components/utils/PaymentCardsTemplate.js +1 -1
  306. package/lib/esm/components/utils/PriceTemplate.js +1 -1
  307. package/lib/esm/components/utils/VariantTemplate.js +1 -1
  308. package/lib/esm/components/utils/getAllErrors.js +1 -1
  309. package/lib/esm/config/components.js +1 -1
  310. package/lib/esm/context/AddressChildrenContext.js +1 -1
  311. package/lib/esm/context/AddressContext.js +1 -1
  312. package/lib/esm/context/CommerceLayerContext.js +1 -1
  313. package/lib/esm/context/CustomerContext.js +1 -1
  314. package/lib/esm/context/ExternalFunctionContext.js +1 -1
  315. package/lib/esm/context/LineItemChildrenContext.js +1 -1
  316. package/lib/esm/context/LineItemContext.js +1 -1
  317. package/lib/esm/context/LineItemOptionChildrenContext.js +1 -1
  318. package/lib/esm/context/OrderContext.js +1 -1
  319. package/lib/esm/context/OrderStorageContext.js +1 -1
  320. package/lib/esm/context/PaymentMethodChildrenContext.js +1 -1
  321. package/lib/esm/context/PaymentMethodContext.js +1 -1
  322. package/lib/esm/context/PlaceOrderContext.js +1 -1
  323. package/lib/esm/context/ShipmentChildrenContext.js +1 -1
  324. package/lib/esm/context/ShipmentContext.js +1 -1
  325. package/lib/esm/context/ShippingMethodChildrenContext.js +1 -1
  326. package/lib/esm/context/SkuOptionChildrenContext.js +1 -1
  327. package/lib/esm/context/StockTransferChildrenContext.js +1 -1
  328. package/lib/esm/index.d.ts +7 -3
  329. package/lib/esm/reducers/AddressReducer.js +1 -1
  330. package/lib/esm/reducers/AvailabilityReducer.js +1 -1
  331. package/lib/esm/reducers/BillingAddressReducer.js +1 -1
  332. package/lib/esm/reducers/CustomerReducer.js +1 -1
  333. package/lib/esm/reducers/GiftCardReducer.js +1 -1
  334. package/lib/esm/reducers/ItemReducer.js +1 -1
  335. package/lib/esm/reducers/LineItemReducer.js +1 -1
  336. package/lib/esm/reducers/OrderReducer.js +1 -1
  337. package/lib/esm/reducers/PaymentMethodReducer.js +1 -1
  338. package/lib/esm/reducers/PlaceOrderReducer.js +1 -1
  339. package/lib/esm/reducers/PriceReducer.js +1 -1
  340. package/lib/esm/reducers/ShipmentReducer.js +1 -1
  341. package/lib/esm/reducers/ShippingAddressReducer.js +1 -1
  342. package/lib/esm/reducers/SkuListsReducer.js +1 -1
  343. package/lib/esm/reducers/SkuOptionsReducer.js +1 -1
  344. package/lib/esm/reducers/VariantReducer.js +1 -1
  345. package/lib/esm/typings/errors.js +1 -1
  346. package/lib/esm/typings/index.js +1 -1
  347. package/lib/esm/utils/addressesManager.js +1 -1
  348. package/lib/esm/utils/baseReducer.js +1 -1
  349. package/lib/esm/utils/browserInfo.js +1 -1
  350. package/lib/esm/utils/childrenTypes.js +1 -1
  351. package/lib/esm/utils/countryStateCity.js +1 -1
  352. package/lib/esm/utils/customMessages.js +1 -1
  353. package/lib/esm/utils/getAmount.js +1 -1
  354. package/lib/esm/utils/getCurrentItemKey.js +1 -1
  355. package/lib/esm/utils/getErrors.js +1 -1
  356. package/lib/esm/utils/getLineItemsCount.js +1 -1
  357. package/lib/esm/utils/getLoaderComponent.js +1 -1
  358. package/lib/esm/utils/getPrices.js +1 -1
  359. package/lib/esm/utils/getSdk.js +1 -1
  360. package/lib/esm/utils/getSkus.js +1 -1
  361. package/lib/esm/utils/isEmptyStates.js +1 -1
  362. package/lib/esm/utils/isJSON.js +1 -1
  363. package/lib/esm/utils/jwt.js +1 -1
  364. package/lib/esm/utils/localStorage.js +1 -1
  365. package/lib/esm/utils/organization.js +1 -1
  366. package/lib/esm/utils/paypalPayment.js +1 -1
  367. package/lib/esm/utils/promisify.js +1 -1
  368. package/lib/esm/utils/shipments.js +1 -1
  369. package/lib/esm/utils/validateFormFields.js +1 -1
  370. package/lib/tsconfig.prod.esm.tsbuildinfo +1 -1
  371. package/lib/tsconfig.prod.tsbuildinfo +1 -1
  372. package/package.json +18 -18
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.ShippingMethodName.propTypes;const displayName=components.ShippingMethodName.displayName;const ShippingMethodName=e=>{const{shippingMethod:i,deliveryLeadTimeForShipment:o,shipmentId:t}=useContext(ShippingMethodChildrenContext);const n=`shipment-${t}-${i===null||i===void 0?void 0:i.id}`||"";const p=i===null||i===void 0?void 0:i["name"];const s=Object.assign({shippingMethod:i,deliveryLeadTimeForShipment:o,label:p,htmlFor:n},e);return e.children?_jsx(Parent,Object.assign({},s,{children:e.children}),void 0):_jsx("label",Object.assign({htmlFor:n},e,{children:p}),void 0)};ShippingMethodName.propTypes=propTypes;ShippingMethodName.displayName=displayName;export default ShippingMethodName;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.ShippingMethodName.propTypes,displayName=components.ShippingMethodName.displayName,ShippingMethodName=props=>{const{shippingMethod,deliveryLeadTimeForShipment,shipmentId}=useContext(ShippingMethodChildrenContext),htmlFor=`shipment-${shipmentId}-${shippingMethod==null?void 0:shippingMethod.id}`||"",labelName=shippingMethod==null?void 0:shippingMethod.name,parentProps=Object.assign({shippingMethod,deliveryLeadTimeForShipment,label:labelName,htmlFor},props);return props.children?_jsx(Parent,Object.assign({},parentProps,{children:props.children}),void 0):_jsx("label",Object.assign({htmlFor},props,{children:labelName}),void 0)};ShippingMethodName.propTypes=propTypes,ShippingMethodName.displayName=displayName;export default ShippingMethodName;
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useState,useEffect,useContext}from"react";import getAmount from"../utils/getAmount";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";import OrderContext from"../context/OrderContext";import{isNumber}from"lodash";const propTypes=components.ShippingMethodPrice.propTypes;const displayName=components.ShippingMethodPrice.displayName;const ShippingMethodPrice=e=>{const{format:t="formatted",type:o="amount",base:r="price",labelFreeOver:n="Free"}=e,i=__rest(e,["format","type","base","labelFreeOver"]);const{shippingMethod:s}=useContext(ShippingMethodChildrenContext);const{order:p}=useContext(OrderContext);const[m,c]=useState("");const[a,d]=useState(0);useEffect((()=>{if(s){const e=getAmount({base:r,type:o,format:t,obj:s});c(e);const n=getAmount({base:"freeOver",type:o,format:"cents",obj:s});d(n)}return()=>{c("");d(0)}}),[s]);const h=Object.assign({price:m},i);return e.children?_jsx(Parent,Object.assign({},h,{children:e.children}),void 0):_jsx("span",Object.assign({},i,{children:(p===null||p===void 0?void 0:p.total_amount_cents)&&isNumber(a)&&a<p.total_amount_cents?n:m}),void 0)};ShippingMethodPrice.propTypes=propTypes;ShippingMethodPrice.displayName=displayName;export default ShippingMethodPrice;
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useState,useEffect,useContext}from"react";import getAmount from"../utils/getAmount";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";import OrderContext from"../context/OrderContext";import{isNumber}from"lodash";const propTypes=components.ShippingMethodPrice.propTypes,displayName=components.ShippingMethodPrice.displayName,ShippingMethodPrice=props=>{const{format="formatted",type="amount",base="price",labelFreeOver="Free"}=props,p=__rest(props,["format","type","base","labelFreeOver"]),{shippingMethod}=useContext(ShippingMethodChildrenContext),{order}=useContext(OrderContext),[price,setPrice]=useState(""),[freeOverAmountCents,setFreeOverAmountCents]=useState(0);useEffect(()=>{if(shippingMethod){const p2=getAmount({base,type,format,obj:shippingMethod});setPrice(p2);const c=getAmount({base:"freeOver",type,format:"cents",obj:shippingMethod});setFreeOverAmountCents(c)}return()=>{setPrice(""),setFreeOverAmountCents(0)}},[shippingMethod]);const parentProps=Object.assign({price},p);return props.children?_jsx(Parent,Object.assign({},parentProps,{children:props.children}),void 0):_jsx("span",Object.assign({},p,{children:(order==null?void 0:order.total_amount_cents)&&isNumber(freeOverAmountCents)&&freeOverAmountCents<order.total_amount_cents?labelFreeOver:price}),void 0)};ShippingMethodPrice.propTypes=propTypes,ShippingMethodPrice.displayName=displayName;export default ShippingMethodPrice;
@@ -1,9 +1,13 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
2
  import { ShippingMethod } from '@commercelayer/sdk';
3
- declare type ShippingMethodRadioButtonChildrenProps = Omit<ShippingMethodRadioButtonProps, 'children'>;
3
+ export declare type ShippingMethodRadioButtonType = Omit<ShippingMethodRadioButtonProps, 'children'> & {
4
+ shippingMethod: ShippingMethod;
5
+ shipmentId: string;
6
+ };
7
+ export declare type ShippingMethodRadioButtonOnChangeType = (shippingMethod: ShippingMethod, shipmentId: string) => void;
4
8
  declare type ShippingMethodRadioButtonProps = {
5
- children?: (props: ShippingMethodRadioButtonChildrenProps) => ReactNode;
6
- onChange?: (shippingMethod: ShippingMethod) => void;
7
- } & JSX.IntrinsicElements['input'];
9
+ children?: (props: ShippingMethodRadioButtonType) => ReactNode;
10
+ onChange?: ShippingMethodRadioButtonOnChangeType;
11
+ } & Omit<JSX.IntrinsicElements['input'], 'onChange'>;
8
12
  declare const ShippingMethodRadioButton: FunctionComponent<ShippingMethodRadioButtonProps>;
9
13
  export default ShippingMethodRadioButton;
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";import ShipmentContext from"../context/ShipmentContext";const propTypes=components.ShippingMethodRadioButton.propTypes;const displayName=components.ShippingMethodRadioButton.displayName;const ShippingMethodRadioButton=t=>{const{onChange:n}=t,o=__rest(t,["onChange"]);const{shippingMethod:e,currentShippingMethodId:i,shipmentId:p}=useContext(ShippingMethodChildrenContext);const{setShippingMethod:s}=useContext(ShipmentContext);const d=e===null||e===void 0?void 0:e.id;const h=`shipment-${p}`;const r=`${h}-${d}`;const a=d===i;const c=async()=>{if(p&&d)await s(p,d);if(e&&n)n(e)};const m=Object.assign({handleOnChange:c,name:h,id:r},t);return t.children?_jsx(Parent,Object.assign({},m,{children:t.children}),void 0):_jsx("input",Object.assign({type:"radio",name:h,id:r,onChange:c,defaultChecked:a},o),void 0)};ShippingMethodRadioButton.propTypes=propTypes;ShippingMethodRadioButton.displayName=displayName;export default ShippingMethodRadioButton;
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import ShippingMethodChildrenContext from"../context/ShippingMethodChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";import ShipmentContext from"../context/ShipmentContext";const propTypes=components.ShippingMethodRadioButton.propTypes,displayName=components.ShippingMethodRadioButton.displayName,ShippingMethodRadioButton=props=>{const{onChange}=props,p=__rest(props,["onChange"]),{shippingMethod,currentShippingMethodId,shipmentId}=useContext(ShippingMethodChildrenContext),{setShippingMethod}=useContext(ShipmentContext),shippingMethodId=shippingMethod==null?void 0:shippingMethod.id,name=`shipment-${shipmentId}`,id=`${name}-${shippingMethodId}`,checked=shippingMethodId===currentShippingMethodId,handleOnChange=async()=>{shipmentId&&(shippingMethodId&&await setShippingMethod(shipmentId,shippingMethodId),shippingMethod&&onChange&&onChange(shippingMethod,shipmentId))},parentProps=Object.assign({shippingMethod,shipmentId,handleOnChange,name,id},props);return props.children?_jsx(Parent,Object.assign({},parentProps,{children:props.children}),void 0):_jsx("input",Object.assign({type:"radio",name,id,onChange:handleOnChange,defaultChecked:checked},p),void 0)};ShippingMethodRadioButton.propTypes=propTypes,ShippingMethodRadioButton.displayName=displayName;export default ShippingMethodRadioButton;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect,Fragment}from"react";import SkuListsContext from"../context/SkuListsContext";import components from"../config/components";const propTypes=components.SkuList.propTypes;const displayName=components.SkuList.displayName;const SkuList=t=>{const{id:s,children:e}=t;const{listIds:o}=useContext(SkuListsContext);useEffect((()=>{if(o&&!o.includes(s)){o.push(s)}}),[]);return _jsx(Fragment,{children:e},void 0)};SkuList.propTypes=propTypes;SkuList.displayName=displayName;export default SkuList;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext,useEffect,Fragment}from"react";import SkuListsContext from"../context/SkuListsContext";import components from"../config/components";const propTypes=components.SkuList.propTypes,displayName=components.SkuList.displayName,SkuList=props=>{const{id,children}=props,{listIds}=useContext(SkuListsContext);return useEffect(()=>{listIds&&!listIds.includes(id)&&listIds.push(id)},[]),_jsx(Fragment,{children},void 0)};SkuList.propTypes=propTypes,SkuList.displayName=displayName;export default SkuList;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{useReducer,useContext,useEffect}from"react";import SkuListsContext from"../context/SkuListsContext";import CommerceLayerContext from"../context/CommerceLayerContext";import skuListsReducer,{skuListsInitialState,getSkuList}from"../reducers/SkuListsReducer";import components from"../config/components";const propTypes=components.SkuListsContainer.propTypes;const displayName=components.SkuListsContainer.displayName;const SkuListsContainer=t=>{const{children:s}=t;const[e,o]=useReducer(skuListsReducer,skuListsInitialState);const i=useContext(CommerceLayerContext);useEffect((()=>{if(e.listIds&&e.listIds.length>0&&i.accessToken){getSkuList({listIds:e.listIds,dispatch:o,config:i,state:e})}}),[i.accessToken]);return _jsx(SkuListsContext.Provider,Object.assign({value:e},{children:s}),void 0)};SkuListsContainer.propTypes=propTypes;SkuListsContainer.displayName=displayName;export default SkuListsContainer;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useReducer,useContext,useEffect}from"react";import SkuListsContext from"../context/SkuListsContext";import CommerceLayerContext from"../context/CommerceLayerContext";import skuListsReducer,{skuListsInitialState,getSkuList}from"../reducers/SkuListsReducer";import components from"../config/components";const propTypes=components.SkuListsContainer.propTypes,displayName=components.SkuListsContainer.displayName,SkuListsContainer=props=>{const{children}=props,[state,dispatch]=useReducer(skuListsReducer,skuListsInitialState),config=useContext(CommerceLayerContext);return useEffect(()=>{state.listIds&&state.listIds.length>0&&config.accessToken&&getSkuList({listIds:state.listIds,dispatch,config,state})},[config.accessToken]),_jsx(SkuListsContext.Provider,Object.assign({value:state},{children}),void 0)};SkuListsContainer.propTypes=propTypes,SkuListsContainer.displayName=displayName;export default SkuListsContainer;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext}from"react";import SkuOptionChildrenContext from"../context/SkuOptionChildrenContext";import SkuOptionsContext from"../context/SkuOptionsContext";import components from"../config/components";const propTypes=components.SkuOption.propTypes;const displayName=components.SkuOption.displayName;const SkuOption=t=>{const{id:o}=t;const{skuOptions:n,skuCode:e}=useContext(SkuOptionsContext);const p=n&&n.filter((t=>t.id===o)).map(((o,n)=>_jsx(SkuOptionChildrenContext.Provider,Object.assign({value:{skuOption:o,skuCode:e}},{children:t.children}),n)));return _jsx(Fragment,{children:p},void 0)};SkuOption.propTypes=propTypes;SkuOption.displayName=displayName;export default SkuOption;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext}from"react";import SkuOptionChildrenContext from"../context/SkuOptionChildrenContext";import SkuOptionsContext from"../context/SkuOptionsContext";import components from"../config/components";const propTypes=components.SkuOption.propTypes,displayName=components.SkuOption.displayName,SkuOption=props=>{const{id}=props,{skuOptions,skuCode}=useContext(SkuOptionsContext),items=skuOptions&&skuOptions.filter(l=>l.id===id).map((skuOption,k)=>_jsx(SkuOptionChildrenContext.Provider,Object.assign({value:{skuOption,skuCode}},{children:props.children}),k));return _jsx(Fragment,{children:items},void 0)};SkuOption.propTypes=propTypes,SkuOption.displayName=displayName;export default SkuOption;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import BaseInput from"./utils/BaseInput";import ItemContext from"../context/ItemContext";import SkuOptionChildrenContext from"../context/SkuOptionChildrenContext";import{has}from"lodash";import components from"../config/components";const propTypes=components.SkuOptionInput.propTypes;const displayName=components.SkuOptionInput.displayName;const SkuOptionInput=t=>{const{name:o}=t;const{option:n,setOption:s}=useContext(ItemContext);const{skuOption:e,skuCode:p}=useContext(SkuOptionChildrenContext);const i=t=>{const i=t.target.value;const u=has(n,`${p}.${e===null||e===void 0?void 0:e.id}`)?n[p][`${e===null||e===void 0?void 0:e.id}`]["options"]:{};const r={[p]:Object.assign(Object.assign({},n[p]),{[`${e===null||e===void 0?void 0:e.id}`]:{skuOptionId:e===null||e===void 0?void 0:e.id,options:Object.assign(Object.assign({},u),{[o]:i})}})};s&&s(r)};return _jsx(BaseInput,Object.assign({onChange:i},t),void 0)};SkuOptionInput.propTypes=propTypes;SkuOptionInput.displayName=displayName;export default SkuOptionInput;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import BaseInput from"./utils/BaseInput";import ItemContext from"../context/ItemContext";import SkuOptionChildrenContext from"../context/SkuOptionChildrenContext";import{has}from"lodash";import components from"../config/components";const propTypes=components.SkuOptionInput.propTypes,displayName=components.SkuOptionInput.displayName,SkuOptionInput=props=>{const{name}=props,{option,setOption}=useContext(ItemContext),{skuOption,skuCode}=useContext(SkuOptionChildrenContext);return _jsx(BaseInput,Object.assign({onChange:event=>{const val=event.target.value,options=has(option,`${skuCode}.${skuOption==null?void 0:skuOption.id}`)?option[skuCode][`${skuOption==null?void 0:skuOption.id}`].options:{},o={[skuCode]:Object.assign(Object.assign({},option[skuCode]),{[`${skuOption==null?void 0:skuOption.id}`]:{skuOptionId:skuOption==null?void 0:skuOption.id,options:Object.assign(Object.assign({},options),{[name]:val})}})};setOption&&setOption(o)}},props),void 0)};SkuOptionInput.propTypes=propTypes,SkuOptionInput.displayName=displayName;export default SkuOptionInput;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{useReducer,useContext,useEffect}from"react";import SkuOptionsContext from"../context/SkuOptionsContext";import skuOptionsReducer,{skuOptionsInitialState}from"../reducers/SkuOptionsReducer";import CommerceLayerContext from"../context/CommerceLayerContext";import{isEmpty}from"lodash";import getCurrentItemKey from"../utils/getCurrentItemKey";import ItemContext from"../context/ItemContext";import{getSkuOptions}from"../reducers/SkuOptionsReducer";import components from"../config/components";const propTypes=components.SkuOptionsContainer.propTypes;const displayName=components.SkuOptionsContainer.displayName;const SkuOptionsContainer=t=>{var e;const{skuCode:o,children:n}=t;const[s,i]=useReducer(skuOptionsReducer,skuOptionsInitialState);const r=useContext(CommerceLayerContext);const{item:p,items:u}=useContext(ItemContext);const m=!isEmpty(u)&&o?(e=u[o])===null||e===void 0?void 0:e.code:o||getCurrentItemKey(p);const c=Object.assign(Object.assign({},s),{skuCode:m});useEffect((()=>{if(m&&p[m].sku_options){getSkuOptions({skuOptions:p[m].sku_options,dispatch:i})}return()=>{if(isEmpty(m)){i({type:"setSkuOptions",payload:{skuOptions:[]}})}}}),[r,m]);return _jsx(SkuOptionsContext.Provider,Object.assign({value:c},{children:n}),void 0)};SkuOptionsContainer.propTypes=propTypes;SkuOptionsContainer.displayName=displayName;export default SkuOptionsContainer;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useReducer,useContext,useEffect}from"react";import SkuOptionsContext from"../context/SkuOptionsContext";import skuOptionsReducer,{skuOptionsInitialState}from"../reducers/SkuOptionsReducer";import CommerceLayerContext from"../context/CommerceLayerContext";import{isEmpty}from"lodash";import getCurrentItemKey from"../utils/getCurrentItemKey";import ItemContext from"../context/ItemContext";import{getSkuOptions}from"../reducers/SkuOptionsReducer";import components from"../config/components";const propTypes=components.SkuOptionsContainer.propTypes,displayName=components.SkuOptionsContainer.displayName,SkuOptionsContainer=props=>{var _a;const{skuCode,children}=props,[state,dispatch]=useReducer(skuOptionsReducer,skuOptionsInitialState),config=useContext(CommerceLayerContext),{item,items}=useContext(ItemContext),sCode=!isEmpty(items)&&skuCode?(_a=items[skuCode])===null||_a===void 0?void 0:_a.code:skuCode||getCurrentItemKey(item),skuOptionsValue=Object.assign(Object.assign({},state),{skuCode:sCode});return useEffect(()=>(sCode&&item[sCode].sku_options&&getSkuOptions({skuOptions:item[sCode].sku_options,dispatch}),()=>{isEmpty(sCode)&&dispatch({type:"setSkuOptions",payload:{skuOptions:[]}})}),[config,sCode]),_jsx(SkuOptionsContext.Provider,Object.assign({value:skuOptionsValue},{children}),void 0)};SkuOptionsContainer.propTypes=propTypes,SkuOptionsContainer.displayName=displayName;export default SkuOptionsContainer;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{useContext,Fragment}from"react";import LineItemChildrenContext from"../context/LineItemChildrenContext";import components from"../config/components";import ShipmentChildrenContext from"../context/ShipmentChildrenContext";import StockTransferChildrenContext from"../context/StockTransferChildrenContext";const propTypes=components.StockTransfer.propTypes;const displayName=components.StockTransfer.displayName;const StockTransfer=e=>{const{children:t}=e;const{lineItem:n}=useContext(LineItemChildrenContext);const{stockTransfers:o}=useContext(ShipmentChildrenContext);const r=o===null||o===void 0?void 0:o.filter((e=>e.sku_code===(n===null||n===void 0?void 0:n.sku_code))).map(((e,n)=>{const o={stockTransfer:e};return _jsx(StockTransferChildrenContext.Provider,Object.assign({value:o},{children:t}),n)}));return _jsx(Fragment,{children:r},void 0)};StockTransfer.propTypes=propTypes;StockTransfer.displayName=displayName;export default StockTransfer;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext,Fragment}from"react";import LineItemChildrenContext from"../context/LineItemChildrenContext";import components from"../config/components";import ShipmentChildrenContext from"../context/ShipmentChildrenContext";import StockTransferChildrenContext from"../context/StockTransferChildrenContext";const propTypes=components.StockTransfer.propTypes,displayName=components.StockTransfer.displayName,StockTransfer=props=>{const{children}=props,{lineItem}=useContext(LineItemChildrenContext),{stockTransfers}=useContext(ShipmentChildrenContext),components2=stockTransfers==null?void 0:stockTransfers.filter(stock=>stock.sku_code===(lineItem==null?void 0:lineItem.sku_code)).map((stockTransfer,k)=>{const stockTransferProps={stockTransfer};return _jsx(StockTransferChildrenContext.Provider,Object.assign({value:stockTransferProps},{children}),k)});return _jsx(Fragment,{children:components2},void 0)};StockTransfer.propTypes=propTypes,StockTransfer.displayName=displayName;export default StockTransfer;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import StockTransferChildrenContext from"../context/StockTransferChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.StockTransferField.propTypes;const displayName=components.StockTransferField.displayName;const StockTransferField=e=>{const{type:t}=e;const{stockTransfer:r}=useContext(StockTransferChildrenContext);const o=r?r[t]:"";const n=Object.assign({},e);return e.children?_jsx(Parent,Object.assign({},n,{children:e.children}),void 0):_jsx("p",Object.assign({},e,{children:o}),void 0)};StockTransferField.propTypes=propTypes;StockTransferField.displayName=displayName;export default StockTransferField;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useContext}from"react";import StockTransferChildrenContext from"../context/StockTransferChildrenContext";import Parent from"./utils/Parent";import components from"../config/components";const propTypes=components.StockTransferField.propTypes,displayName=components.StockTransferField.displayName,StockTransferField=props=>{const{type}=props,{stockTransfer}=useContext(StockTransferChildrenContext),text=stockTransfer?stockTransfer[type]:"",parentProps=Object.assign({},props);return props.children?_jsx(Parent,Object.assign({},parentProps,{children:props.children}),void 0):_jsx("p",Object.assign({},props,{children:text}),void 0)};StockTransferField.propTypes=propTypes,StockTransferField.displayName=displayName;export default StockTransferField;
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import PaymentMethodContext from"../context/PaymentMethodContext";import{CardElement,Elements,useElements,useStripe}from"@stripe/react-stripe-js";import Parent from"./utils/Parent";import OrderContext from"../context/OrderContext";import{setCustomerOrderParam}from"../utils/localStorage";const defaultOptions={style:{base:{fontSize:"16px",color:"#424770","::placeholder":{color:"#aab7c4"}},invalid:{color:"#9e2146"}},hidePostalCode:true};const StripePaymentForm=({options:e=defaultOptions,templateCustomerSaveToWallet:t})=>{const o=useRef(null);const{setPaymentSource:s,paymentSource:n,currentPaymentMethodType:r,setPaymentMethodErrors:a,setPaymentRef:i}=useContext(PaymentMethodContext);const{order:l}=useContext(OrderContext);const c=useStripe();const u=useElements();useEffect((()=>{if(o.current&&c&&u){o.current.onsubmit=()=>d(o.current,c,u);i({ref:o})}return()=>{i({ref:{current:null}})}}),[o,c,u]);const d=async(e,t,o)=>{var i,c;if(!t)return false;const u=(c=(i=e===null||e===void 0?void 0:e.elements)===null||i===void 0?void 0:i["save_payment_source_to_customer_wallet"])===null||c===void 0?void 0:c.checked;if(u)setCustomerOrderParam("_save_payment_source_to_customer_wallet",u);const d=o&&o.getElement(CardElement);if(d){const e=l===null||l===void 0?void 0:l.billing_address;const o=l===null||l===void 0?void 0:l.customer_email;const i={name:e===null||e===void 0?void 0:e.full_name,email:o,phone:e===null||e===void 0?void 0:e.phone,address:{city:e===null||e===void 0?void 0:e.city,country:e===null||e===void 0?void 0:e.country_code,line1:e===null||e===void 0?void 0:e.line_1,postal_code:e===null||e===void 0?void 0:e.zip_code,state:e===null||e===void 0?void 0:e.state_code}};const{paymentMethod:c}=await t.createPaymentMethod({type:"card",card:d,billing_details:i});if(n===null||n===void 0?void 0:n.client_secret){const{error:e,paymentIntent:o}=await t.confirmCardPayment(n.client_secret,{payment_method:{card:d,billing_details:i}});if(e){console.error(e);a([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:r,message:e.message}])}else{if(o&&c&&n&&r){try{await s({paymentSourceId:n.id,paymentResource:r,attributes:{options:Object.assign(Object.assign({},c),{setup_future_usage:"off_session"})}});return true}catch(e){return false}}}}}return false};return _jsxs("form",Object.assign({ref:o,onSubmit:e=>d(e,c,u)},{children:[_jsx(CardElement,{options:Object.assign(Object.assign({},defaultOptions),e)},void 0),t&&_jsx(Parent,Object.assign({},{name:"save_payment_source_to_customer_wallet"},{children:t}),void 0)]}),void 0)};const StripePayment=e=>{var{publishableKey:t,show:o,options:s,locale:n="auto"}=e,r=__rest(e,["publishableKey","show","options","locale"]);const[a,i]=useState(false);const[l,c]=useState(null);const{containerClassName:u,templateCustomerSaveToWallet:d,fonts:m=[]}=r,p=__rest(r,["containerClassName","templateCustomerSaveToWallet","fonts"]);useEffect((()=>{if(o&&t){const{loadStripe:e}=require("@stripe/stripe-js");const o=async()=>{const o=await e(t,{locale:n});c(o);i(true)};o()}return()=>{i(false)}}),[o,t]);return a&&l?_jsx("div",Object.assign({className:u},p,{children:_jsx(Elements,Object.assign({stripe:l,options:{fonts:m}},{children:_jsx(StripePaymentForm,{options:s,templateCustomerSaveToWallet:d},void 0)}),void 0)}),void 0):null};export default StripePayment;
1
+ import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{useContext,useEffect,useRef,useState}from"react";import PaymentMethodContext from"../context/PaymentMethodContext";import{CardElement,Elements,useElements,useStripe}from"@stripe/react-stripe-js";import Parent from"./utils/Parent";import OrderContext from"../context/OrderContext";import{setCustomerOrderParam}from"../utils/localStorage";const defaultOptions={style:{base:{fontSize:"16px",color:"#424770","::placeholder":{color:"#aab7c4"}},invalid:{color:"#9e2146"}},hidePostalCode:!0},StripePaymentForm=({options=defaultOptions,templateCustomerSaveToWallet})=>{const ref=useRef(null),{setPaymentSource,paymentSource,currentPaymentMethodType,setPaymentMethodErrors,setPaymentRef}=useContext(PaymentMethodContext),{order}=useContext(OrderContext),stripe=useStripe(),elements=useElements();useEffect(()=>(ref.current&&stripe&&elements&&(ref.current.onsubmit=()=>onSubmit(ref.current,stripe,elements),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,stripe,elements]);const onSubmit=async(event,stripe2,elements2)=>{var _a,_b;if(!stripe2)return!1;const savePaymentSourceToCustomerWallet=(_b=(_a=event==null?void 0:event.elements)===null||_a===void 0?void 0:_a.save_payment_source_to_customer_wallet)===null||_b===void 0?void 0:_b.checked;savePaymentSourceToCustomerWallet&&setCustomerOrderParam("_save_payment_source_to_customer_wallet",savePaymentSourceToCustomerWallet);const cardElement=elements2&&elements2.getElement(CardElement);if(cardElement){const billingInfo=order==null?void 0:order.billing_address,email=order==null?void 0:order.customer_email,billing_details={name:billingInfo==null?void 0:billingInfo.full_name,email,phone:billingInfo==null?void 0:billingInfo.phone,address:{city:billingInfo==null?void 0:billingInfo.city,country:billingInfo==null?void 0:billingInfo.country_code,line1:billingInfo==null?void 0:billingInfo.line_1,postal_code:billingInfo==null?void 0:billingInfo.zip_code,state:billingInfo==null?void 0:billingInfo.state_code}},{paymentMethod}=await stripe2.createPaymentMethod({type:"card",card:cardElement,billing_details});if(paymentSource==null?void 0:paymentSource.client_secret){const{error,paymentIntent}=await stripe2.confirmCardPayment(paymentSource.client_secret,{payment_method:{card:cardElement,billing_details}});if(error)console.error(error),setPaymentMethodErrors([{code:"PAYMENT_INTENT_AUTHENTICATION_FAILURE",resource:"payment_methods",field:currentPaymentMethodType,message:error.message}]);else if(paymentIntent&&paymentMethod&&paymentSource&&currentPaymentMethodType)try{return await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{options:Object.assign(Object.assign({},paymentMethod),{setup_future_usage:"off_session"})}}),!0}catch{return!1}}}return!1};return _jsxs("form",Object.assign({ref,onSubmit:e=>onSubmit(e,stripe,elements)},{children:[_jsx(CardElement,{options:Object.assign(Object.assign({},defaultOptions),options)},void 0),templateCustomerSaveToWallet&&_jsx(Parent,Object.assign({},{name:"save_payment_source_to_customer_wallet"},{children:templateCustomerSaveToWallet}),void 0)]}),void 0)},StripePayment=_a=>{var{publishableKey,show,options,locale="auto"}=_a,p=__rest(_a,["publishableKey","show","options","locale"]);const[isLoaded,setIsLoaded]=useState(!1),[stripe,setStripe]=useState(null),{containerClassName,templateCustomerSaveToWallet,fonts=[]}=p,divProps=__rest(p,["containerClassName","templateCustomerSaveToWallet","fonts"]);return useEffect(()=>{if(show&&publishableKey){const{loadStripe}=require("@stripe/stripe-js");(async()=>{const res=await loadStripe(publishableKey,{locale});setStripe(res),setIsLoaded(!0)})()}return()=>{setIsLoaded(!1)}},[show,publishableKey]),isLoaded&&stripe?_jsx("div",Object.assign({className:containerClassName},divProps,{children:_jsx(Elements,Object.assign({stripe,options:{fonts}},{children:_jsx(StripePaymentForm,{options,templateCustomerSaveToWallet},void 0)}),void 0)}),void 0):null};export default StripePayment;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.SubTotalAmount.propTypes;const defaultProps=components.SubTotalAmount.defaultProps;const displayName=components.SubTotalAmount.displayName;const SubTotalAmount=o=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"subtotal"},o),void 0);SubTotalAmount.propTypes=propTypes;SubTotalAmount.defaultProps=defaultProps;SubTotalAmount.displayName=displayName;export default SubTotalAmount;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.SubTotalAmount.propTypes,defaultProps=components.SubTotalAmount.defaultProps,displayName=components.SubTotalAmount.displayName,SubTotalAmount=props=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"subtotal"},props),void 0);SubTotalAmount.propTypes=propTypes,SubTotalAmount.defaultProps=defaultProps,SubTotalAmount.displayName=displayName;export default SubTotalAmount;
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import Parent from"./utils/Parent";import components from"../config/components";import isFunction from"lodash/isFunction";const propTypes=components.SubmitButton.propTypes;const defaultProps=components.SubmitButton.defaultProps;const displayName=components.SubmitButton.displayName;const SubmitButton=t=>{const{children:o,label:s="Submit"}=t,n=__rest(t,["children","label"]);const e=Object.assign(Object.assign({},n),{label:s});return o?_jsx(Parent,Object.assign({},e,{children:o}),void 0):_jsx("button",Object.assign({type:"submit"},n,{children:isFunction(s)?s():s}),void 0)};SubmitButton.propTypes=propTypes;SubmitButton.defaultProps=defaultProps;SubmitButton.displayName=displayName;export default SubmitButton;
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import Parent from"./utils/Parent";import components from"../config/components";import isFunction from"lodash/isFunction";const propTypes=components.SubmitButton.propTypes,defaultProps=components.SubmitButton.defaultProps,displayName=components.SubmitButton.displayName,SubmitButton=props=>{const{children,label="Submit"}=props,p=__rest(props,["children","label"]),parentProps=Object.assign(Object.assign({},p),{label});return children?_jsx(Parent,Object.assign({},parentProps,{children}),void 0):_jsx("button",Object.assign({type:"submit"},p,{children:isFunction(label)?label():label}),void 0)};SubmitButton.propTypes=propTypes,SubmitButton.defaultProps=defaultProps,SubmitButton.displayName=displayName;export default SubmitButton;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.TaxesAmount.propTypes;const defaultProps=components.TaxesAmount.defaultProps;const displayName=components.TaxesAmount.displayName;const TaxesAmount=e=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"total_tax"},e),void 0);TaxesAmount.propTypes=propTypes;TaxesAmount.defaultProps=defaultProps;TaxesAmount.displayName=displayName;export default TaxesAmount;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.TaxesAmount.propTypes,defaultProps=components.TaxesAmount.defaultProps,displayName=components.TaxesAmount.displayName,TaxesAmount=props=>_jsx(BaseOrderPrice,Object.assign({base:"amount",type:"total_tax"},props),void 0);TaxesAmount.propTypes=propTypes,TaxesAmount.defaultProps=defaultProps,TaxesAmount.displayName=displayName;export default TaxesAmount;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.TotalAmount.propTypes;const defaultProps=components.TotalAmount.defaultProps;const displayName=components.TotalAmount.displayName;const TotalAmount=o=>_jsx(BaseOrderPrice,Object.assign({base:"total_amount",type:"with_taxes"},o),void 0);TotalAmount.propTypes=propTypes;TotalAmount.defaultProps=defaultProps;TotalAmount.displayName=displayName;export default TotalAmount;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import BaseOrderPrice from"./utils/BaseOrderPrice";import components from"../config/components";const propTypes=components.TotalAmount.propTypes,defaultProps=components.TotalAmount.defaultProps,displayName=components.TotalAmount.displayName,TotalAmount=props=>_jsx(BaseOrderPrice,Object.assign({base:"total_amount",type:"with_taxes"},props),void 0);TotalAmount.propTypes=propTypes,TotalAmount.defaultProps=defaultProps,TotalAmount.displayName=displayName;export default TotalAmount;
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext,useEffect}from"react";import VariantTemplate from"./utils/VariantTemplate";import Parent from"./utils/Parent";import VariantsContext from"../context/VariantsContext";import components from"../config/components";const propTypes=components.VariantSelector.propTypes;const defaultProps=components.VariantSelector.defaultProps;const displayName=components.VariantSelector.displayName;const VariantSelector=e=>{const{children:t,type:o,placeholder:a,skuCode:n,name:r,options:s}=e,i=__rest(e,["children","type","placeholder","skuCode","name","options"]);const{setSkuCode:p,skuCode:c,loading:l,variants:d,setSkuCodes:m}=useContext(VariantsContext);useEffect((()=>{m&&m(s);return()=>{m&&m([])}}),[s]);const u=c||n||"";const f=()=>l?_jsx(Fragment,{children:e.loader||"Loading..."},void 0):_jsx(VariantTemplate,Object.assign({variants:d,type:o,placeholder:a,skuCode:u,options:s,handleChange:p,name:r},i),void 0);const x=Object.assign({variants:d,loading:!!l,handleSelect:p,skuCode:u},e);return t?_jsx(Parent,Object.assign({},x,{children:t}),void 0):_jsx(Fragment,{children:_jsx(f,{},void 0)},void 0)};VariantSelector.propTypes=propTypes;VariantSelector.defaultProps=defaultProps;VariantSelector.displayName=displayName;export default VariantSelector;
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment,useContext,useEffect}from"react";import VariantTemplate from"./utils/VariantTemplate";import Parent from"./utils/Parent";import VariantsContext from"../context/VariantsContext";import components from"../config/components";const propTypes=components.VariantSelector.propTypes,defaultProps=components.VariantSelector.defaultProps,displayName=components.VariantSelector.displayName,VariantSelector=props=>{const{children,type,placeholder,skuCode,name,options}=props,prs=__rest(props,["children","type","placeholder","skuCode","name","options"]),{setSkuCode,skuCode:variantSkuCode,loading,variants,setSkuCodes}=useContext(VariantsContext);useEffect(()=>(setSkuCodes&&setSkuCodes(options),()=>{setSkuCodes&&setSkuCodes([])}),[options]);const sCode=variantSkuCode||skuCode||"",DefaultTemplate=()=>loading?_jsx(Fragment,{children:props.loader||"Loading..."},void 0):_jsx(VariantTemplate,Object.assign({variants,type,placeholder,skuCode:sCode,options,handleChange:setSkuCode,name},prs),void 0),parentProps=Object.assign({variants,loading:!!loading,handleSelect:setSkuCode,skuCode:sCode},props);return children?_jsx(Parent,Object.assign({},parentProps,{children}),void 0):_jsx(Fragment,{children:_jsx(DefaultTemplate,{},void 0)},void 0)};VariantSelector.propTypes=propTypes,VariantSelector.defaultProps=defaultProps,VariantSelector.displayName=displayName;export default VariantSelector;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import{useEffect,useReducer,useContext}from"react";import variantReducer,{variantInitialState,unsetVariantState,setSkuCode,getVariants}from"../reducers/VariantReducer";import CommerceLayerContext from"../context/CommerceLayerContext";import VariantsContext from"../context/VariantsContext";import{setVariantSkuCodes}from"../reducers/VariantReducer";import{isEmpty,isEqual}from"lodash";import getCurrentItemKey from"../utils/getCurrentItemKey";import ItemContext from"../context/ItemContext";import components from"../config/components";const propTypes=components.VariantsContainer.propTypes;const defaultProps=components.VariantsContainer.defaultProps;const displayName=components.VariantsContainer.displayName;const VariantsContainer=t=>{const{children:e,skuCode:s="",filters:n={}}=t;const a=useContext(CommerceLayerContext);const{setItem:o,setItems:r,items:i,item:m,setCustomLineItems:c,skuCode:u}=useContext(ItemContext);const[p,d]=useReducer(variantReducer,variantInitialState);const C=getCurrentItemKey(m)||s||p.skuCode||u||"";useEffect((()=>{if(!isEmpty(i)&&!isEmpty(p.variants)){if(!isEqual(i,p.variants)){const t=Object.assign(Object.assign({},i),p.variants);r&&r(t)}}if(p.skuCodes.length>=1&&a.accessToken){d({type:"setLoading",payload:{loading:true}});getVariants({config:a,state:p,dispatch:d,setItem:o,skuCode:C,filters:n})}return()=>unsetVariantState(d)}),[a]);const f=Object.assign(Object.assign({},p),{skuCode:C,setSkuCode:(t,e,s={})=>{if(!isEmpty(s)){c&&c({[t]:s})}setSkuCode({code:t,id:e,config:a,setItem:o,dispatch:d})},setSkuCodes:t=>setVariantSkuCodes({skuCodes:t,dispatch:d,setCustomLineItems:c})});return _jsx(VariantsContext.Provider,Object.assign({value:f},{children:e}),void 0)};VariantsContainer.propTypes=propTypes;VariantsContainer.defaultProps=defaultProps;VariantsContainer.displayName=displayName;export default VariantsContainer;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import{useEffect,useReducer,useContext,useMemo}from"react";import variantReducer,{variantInitialState,unsetVariantState,setSkuCode,getVariants}from"../reducers/VariantReducer";import CommerceLayerContext from"../context/CommerceLayerContext";import VariantsContext from"../context/VariantsContext";import{setVariantSkuCodes}from"../reducers/VariantReducer";import{isEmpty,isEqual}from"lodash";import getCurrentItemKey from"../utils/getCurrentItemKey";import ItemContext from"../context/ItemContext";import components from"../config/components";const propTypes=components.VariantsContainer.propTypes,defaultProps=components.VariantsContainer.defaultProps,displayName=components.VariantsContainer.displayName,VariantsContainer=props=>{const{children,skuCode="",filters={}}=props,config=useContext(CommerceLayerContext),{setItem,setItems,items,item:currentItem,setCustomLineItems,skuCode:itemSkuCode}=useContext(ItemContext),[state,dispatch]=useReducer(variantReducer,variantInitialState),sCode=getCurrentItemKey(currentItem)||skuCode||state.skuCode||itemSkuCode||"";useEffect(()=>{if(!isEmpty(items)&&!isEmpty(state.variants)&&!isEqual(items,state.variants)){const mergeItems=Object.assign(Object.assign({},items),state.variants);setItems&&setItems(mergeItems)}return state.skuCodes.length>=1&&config.accessToken&&(dispatch({type:"setLoading",payload:{loading:!0}}),getVariants({config,state,dispatch,setItem,skuCode:sCode,filters})),()=>unsetVariantState(dispatch)},[config.accessToken]);const variantValue=useMemo(()=>Object.assign(Object.assign({},state),{skuCode:sCode,setSkuCode:(code,id,lineItem={})=>{isEmpty(lineItem)||setCustomLineItems&&setCustomLineItems({[code]:lineItem}),setSkuCode({code,id,config,setItem,dispatch})},setSkuCodes:skuCodes=>setVariantSkuCodes({skuCodes,dispatch,setCustomLineItems})}),[state]);return _jsx(VariantsContext.Provider,Object.assign({value:variantValue},{children}),void 0)};VariantsContainer.propTypes=propTypes,VariantsContainer.defaultProps=defaultProps,VariantsContainer.displayName=displayName;export default VariantsContainer;
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaymentMethodContext from"../context/PaymentMethodContext";import isFunction from"lodash/isFunction";import{useContext,useEffect,useRef}from"react";const defaultMessage="after placing the order, you will need to manually complete the payment with your bank";const WireTransferPayment=e=>{var{infoMessage:t}=e,n=__rest(e,["infoMessage"]);const r=useRef(null);const{setPaymentSource:s,paymentSource:o,currentPaymentMethodType:a,setPaymentRef:i}=useContext(PaymentMethodContext);useEffect((()=>{if(r.current&&o&&a){r.current.onsubmit=()=>u();i({ref:r})}return()=>{i({ref:{current:null}})}}),[r,o,a]);const u=async()=>{if(o&&a){try{await s({paymentSourceId:o.id,paymentResource:a,attributes:{metadata:{card:{id:o.id,brand:"wire-transfer",last4:""}}}});return true}catch(e){return false}}return false};return _jsx("form",Object.assign({ref:r},{children:_jsx("div",Object.assign({},n,{children:_jsx("span",Object.assign({className:t===null||t===void 0?void 0:t.className},{children:isFunction(t===null||t===void 0?void 0:t.text)?t===null||t===void 0?void 0:t.text():(t===null||t===void 0?void 0:t.text)||defaultMessage}),void 0)}),void 0)}),void 0)};export default WireTransferPayment;
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaymentMethodContext from"../context/PaymentMethodContext";import isFunction from"lodash/isFunction";import{useContext,useEffect,useRef}from"react";const defaultMessage="after placing the order, you will need to manually complete the payment with your bank",WireTransferPayment=_a=>{var{infoMessage}=_a,p=__rest(_a,["infoMessage"]);const ref=useRef(null),{setPaymentSource,paymentSource,currentPaymentMethodType,setPaymentRef}=useContext(PaymentMethodContext);useEffect(()=>(ref.current&&paymentSource&&currentPaymentMethodType&&(ref.current.onsubmit=()=>handleClick(),setPaymentRef({ref})),()=>{setPaymentRef({ref:{current:null}})}),[ref,paymentSource,currentPaymentMethodType]);const handleClick=async()=>{if(paymentSource&&currentPaymentMethodType)try{return await setPaymentSource({paymentSourceId:paymentSource.id,paymentResource:currentPaymentMethodType,attributes:{metadata:{card:{id:paymentSource.id,brand:"wire-transfer",last4:""}}}}),!0}catch{return!1}return!1};return _jsx("form",Object.assign({ref},{children:_jsx("div",Object.assign({},p,{children:_jsx("span",Object.assign({className:infoMessage==null?void 0:infoMessage.className},{children:isFunction(infoMessage==null?void 0:infoMessage.text)?infoMessage==null?void 0:infoMessage.text():(infoMessage==null?void 0:infoMessage.text)||defaultMessage}),void 0)}),void 0)}),void 0)};export default WireTransferPayment;
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import CommerceLayerContext from"../../context/CommerceLayerContext";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import AdyenPayment from"../AdyenPayment";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import jwt from"../../utils/jwt";export default function AdyenGateway(e){var t;const{readonly:o,showCard:n,handleEditClick:r,children:m,templateCustomerCards:a,show:s,loading:i,onClickCustomerCards:d,loaderComponent:l,templateCustomerSaveToWallet:c}=e,C=__rest(e,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]);const{order:y}=useContext(OrderContext);const{accessToken:u}=useContext(CommerceLayerContext);const{payment:p}=useContext(PaymentMethodChildrenContext);const{payments:x,isGuest:v}=useContext(CustomerContext);const{currentPaymentMethodId:h,config:f,paymentSource:P}=useContext(PaymentMethodContext);const _="adyen_payments";const j=y===null||y===void 0?void 0:y.language_code;if(!o&&(p===null||p===void 0?void 0:p.id)!==h)return null;const g=P===null||P===void 0?void 0:P.public_key;const w=jwt(u).test?"test":"live";const E=f?getPaymentConfig(_,f):{};const M=!isEmpty(x)&&x?x.filter((e=>{var t;return((t=e.payment_source)===null||t===void 0?void 0:t.type)==="adyen_payments"})):[];if(o||n){const e=(t=P===null||P===void 0?void 0:P.payment_request_data)===null||t===void 0?void 0:t.payment_method;const a=Object.assign(Object.assign({},e),{showCard:n,handleEditClick:r,readonly:o});return isEmpty(e)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value:a},{children:m}),void 0)}if(!v&&a){return g&&!i&&(P===null||P===void 0?void 0:P.payment_methods)?_jsxs(Fragment,{children:[isEmpty(M)?null:_jsx("div",Object.assign({className:C.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource:_,customerPayments:M},{children:a}),void 0)}),void 0),_jsx(AdyenPayment,{templateCustomerSaveToWallet:c,clientKey:g,locale:j,environment:w,config:E},void 0)]},void 0):l}return g&&!i&&(P===null||P===void 0?void 0:P.payment_methods)?_jsx(AdyenPayment,{clientKey:g,locale:j,config:E},void 0):l}
1
+ import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import CommerceLayerContext from"../../context/CommerceLayerContext";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import AdyenPayment from"../AdyenPayment";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";import jwt from"../../utils/jwt";export default function AdyenGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{accessToken}=useContext(CommerceLayerContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="adyen_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const clientKey=paymentSource==null?void 0:paymentSource.public_key,environment=jwt(accessToken).test?"test":"live",adyenConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="adyen_payments"}):[];if(readonly||showCard){const card=(_a=paymentSource==null?void 0:paymentSource.payment_request_data)===null||_a===void 0?void 0:_a.payment_method,value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}),void 0)}return!isGuest&&templateCustomerCards?clientKey&&!loading&&(paymentSource==null?void 0:paymentSource.payment_methods)?_jsxs(Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}),void 0)}),void 0),_jsx(AdyenPayment,{templateCustomerSaveToWallet,clientKey,locale,environment,config:adyenConfig},void 0)]},void 0):loaderComponent:clientKey&&!loading&&(paymentSource==null?void 0:paymentSource.payment_methods)?_jsx(AdyenPayment,{clientKey,locale,config:adyenConfig},void 0):loaderComponent}
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import BraintreePayment from"../BraintreePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function BraintreeGateway(t){var e;const{readonly:o,showCard:n,handleEditClick:r,children:a,templateCustomerCards:s,show:i,loading:m,onClickCustomerCards:d,loaderComponent:l,templateCustomerSaveToWallet:c}=t,C=__rest(t,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]);const{order:u}=useContext(OrderContext);const{payment:y}=useContext(PaymentMethodChildrenContext);const{payments:p,isGuest:x}=useContext(CustomerContext);const{currentPaymentMethodId:h,config:v,paymentSource:f}=useContext(PaymentMethodContext);const P="braintree_payments";const g=u===null||u===void 0?void 0:u.language_code;if(!o&&(y===null||y===void 0?void 0:y.id)!==h)return null;const _=f===null||f===void 0?void 0:f.client_token;const j=v?getPaymentConfig(P,v):{};const b=!isEmpty(p)&&p?p.filter((t=>{var e;return((e=t.payment_source)===null||e===void 0?void 0:e.type)==="braintree_payments"})):[];if(o||n){const t=(e=f===null||f===void 0?void 0:f.options)===null||e===void 0?void 0:e.card;const s=Object.assign(Object.assign({},t),{showCard:n,handleEditClick:r,readonly:o});return isEmpty(t)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value:s},{children:a}),void 0)}if(!x&&s){return _&&!m?_jsxs(Fragment,{children:[isEmpty(b)?null:_jsx("div",Object.assign({className:C.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource:P,customerPayments:b},{children:s}),void 0)}),void 0),_jsx(BraintreePayment,{templateCustomerSaveToWallet:c,authorization:_,locale:g,config:j},void 0)]},void 0):l}return _&&!m?_jsx(BraintreePayment,{locale:g,authorization:_,config:j},void 0):l}
1
+ import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import BraintreePayment from"../BraintreePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function BraintreeGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="braintree_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const authorization=paymentSource==null?void 0:paymentSource.client_token,braintreeConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="braintree_payments"}):[];if(readonly||showCard){const card=(_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card,value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}),void 0)}return!isGuest&&templateCustomerCards?authorization&&!loading?_jsxs(Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}),void 0)}),void 0),_jsx(BraintreePayment,{templateCustomerSaveToWallet,authorization,locale,config:braintreeConfig},void 0)]},void 0):loaderComponent:authorization&&!loading?_jsx(BraintreePayment,{locale,authorization,config:braintreeConfig},void 0):loaderComponent}
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaypalPayment from"../PaypalPayment";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export default function PaypalGateway(t){var e,o;const{readonly:n,showCard:a,handleEditClick:r,children:i,templateCustomerCards:d,show:l,loading:m,onClickCustomerCards:s,loaderComponent:C,templateCustomerSaveToWallet:c}=t,u=__rest(t,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]);const{payment:y}=useContext(PaymentMethodChildrenContext);const{currentPaymentMethodId:p,config:h,paymentSource:x}=useContext(PaymentMethodContext);const P="paypal_payments";if(!n&&(y===null||y===void 0?void 0:y.id)!==p)return null;if(n||a){const t=((e=x===null||x===void 0?void 0:x.options)===null||e===void 0?void 0:e.card)||((o=x===null||x===void 0?void 0:x.metadata)===null||o===void 0?void 0:o.card);const d=Object.assign(Object.assign({},t),{showCard:a,handleEditClick:r,readonly:n});return isEmpty(t)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value:d},{children:i}),void 0)}const v=h&&getPaymentConfig(P,h);return _jsx(PaypalPayment,Object.assign({},u,{infoMessage:v===null||v===void 0?void 0:v.infoMessage}),void 0)}
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import PaypalPayment from"../PaypalPayment";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export default function PaypalGateway(props){var _a,_b;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{payment}=useContext(PaymentMethodChildrenContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="paypal_payments";if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;if(readonly||showCard){const card=((_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card)||((_b=paymentSource==null?void 0:paymentSource.metadata)===null||_b===void 0?void 0:_b.card),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}),void 0)}const paypalConfig=config&&getPaymentConfig(paymentResource,config);return _jsx(PaypalPayment,Object.assign({},p,{infoMessage:paypalConfig==null?void 0:paypalConfig.infoMessage}),void 0)}
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import StripePayment from"../StripePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function StripeGateway(t){var e;const{readonly:o,showCard:n,handleEditClick:r,children:s,templateCustomerCards:a,show:i,loading:m,onClickCustomerCards:l,loaderComponent:d,templateCustomerSaveToWallet:c}=t,C=__rest(t,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]);const{order:u}=useContext(OrderContext);const{payment:p}=useContext(PaymentMethodChildrenContext);const{payments:y,isGuest:x}=useContext(CustomerContext);const{currentPaymentMethodId:h,config:v,paymentSource:P}=useContext(PaymentMethodContext);const f="stripe_payments";const g=u===null||u===void 0?void 0:u.language_code;if(!o&&(p===null||p===void 0?void 0:p.id)!==h)return null;const j=P===null||P===void 0?void 0:P.publishable_key;const _=v?getPaymentConfig(f,v):{};const b=!isEmpty(y)&&y?y.filter((t=>{var e;return((e=t.payment_source)===null||e===void 0?void 0:e.type)==="stripe_payments"})):[];if(o||n){const t=(e=P===null||P===void 0?void 0:P.options)===null||e===void 0?void 0:e.card;const a=Object.assign(Object.assign({},t),{showCard:n,handleEditClick:r,readonly:o});return isEmpty(t)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value:a},{children:s}),void 0)}if(!x&&a){return _jsxs(Fragment,{children:[isEmpty(b)?null:_jsx("div",Object.assign({className:C.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource:f,customerPayments:b},{children:a}),void 0)}),void 0),_jsx(StripePayment,Object.assign({show:i,templateCustomerSaveToWallet:c,publishableKey:j,locale:g},_),void 0)]},void 0)}return j&&!m?_jsx(StripePayment,Object.assign({show:i,publishableKey:j,locale:g},_),void 0):d}
1
+ import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import StripePayment from"../StripePayment";import CustomerContext from"../../context/CustomerContext";import OrderContext from"../../context/OrderContext";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{Fragment,useContext}from"react";import PaymentCardsTemplate from"../utils/PaymentCardsTemplate";export default function StripeGateway(props){var _a;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{order}=useContext(OrderContext),{payment}=useContext(PaymentMethodChildrenContext),{payments,isGuest}=useContext(CustomerContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="stripe_payments",locale=order==null?void 0:order.language_code;if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;const publishableKey=paymentSource==null?void 0:paymentSource.publishable_key,stripeConfig=config?getPaymentConfig(paymentResource,config):{},customerPayments=!isEmpty(payments)&&payments?payments.filter(customerPayment=>{var _a2;return((_a2=customerPayment.payment_source)===null||_a2===void 0?void 0:_a2.type)==="stripe_payments"}):[];if(readonly||showCard){const card=(_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card,value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}),void 0)}return!isGuest&&templateCustomerCards?_jsxs(Fragment,{children:[isEmpty(customerPayments)?null:_jsx("div",Object.assign({className:p.className},{children:_jsx(PaymentCardsTemplate,Object.assign({},{paymentResource,customerPayments},{children:templateCustomerCards}),void 0)}),void 0),_jsx(StripePayment,Object.assign({show,templateCustomerSaveToWallet,publishableKey,locale},stripeConfig),void 0)]},void 0):publishableKey&&!loading?_jsx(StripePayment,Object.assign({show,publishableKey,locale},stripeConfig),void 0):loaderComponent}
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import WireTransferPayment from"../WireTransferPayment";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export default function WireTransferGateway(t){var e,o;const{readonly:n,showCard:r,handleEditClick:a,children:i,templateCustomerCards:d,show:s,loading:m,onClickCustomerCards:l,loaderComponent:C,templateCustomerSaveToWallet:c}=t,u=__rest(t,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]);const{payment:y}=useContext(PaymentMethodChildrenContext);const{currentPaymentMethodId:h,config:p,paymentSource:f}=useContext(PaymentMethodContext);const x="wire_transfers";if(!n&&(y===null||y===void 0?void 0:y.id)!==h)return null;if(n||r){const t=((e=f===null||f===void 0?void 0:f.options)===null||e===void 0?void 0:e.card)||((o=f===null||f===void 0?void 0:f.metadata)===null||o===void 0?void 0:o.card);const d=Object.assign(Object.assign({},t),{showCard:r,handleEditClick:a,readonly:n});return isEmpty(t)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value:d},{children:i}),void 0)}const v=p&&x?getPaymentConfig(x,p):{};return _jsx(WireTransferPayment,Object.assign({},u,v),void 0)}
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import WireTransferPayment from"../WireTransferPayment";import PaymentMethodChildrenContext from"../../context/PaymentMethodChildrenContext";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";import{getPaymentConfig}from"../../reducers/PaymentMethodReducer";import isEmpty from"lodash/isEmpty";import{useContext}from"react";export default function WireTransferGateway(props){var _a,_b;const{readonly,showCard,handleEditClick,children,templateCustomerCards,show,loading,onClickCustomerCards,loaderComponent,templateCustomerSaveToWallet}=props,p=__rest(props,["readonly","showCard","handleEditClick","children","templateCustomerCards","show","loading","onClickCustomerCards","loaderComponent","templateCustomerSaveToWallet"]),{payment}=useContext(PaymentMethodChildrenContext),{currentPaymentMethodId,config,paymentSource}=useContext(PaymentMethodContext),paymentResource="wire_transfers";if(!readonly&&(payment==null?void 0:payment.id)!==currentPaymentMethodId)return null;if(readonly||showCard){const card=((_a=paymentSource==null?void 0:paymentSource.options)===null||_a===void 0?void 0:_a.card)||((_b=paymentSource==null?void 0:paymentSource.metadata)===null||_b===void 0?void 0:_b.card),value=Object.assign(Object.assign({},card),{showCard,handleEditClick,readonly});return isEmpty(card)?null:_jsx(PaymentSourceContext.Provider,Object.assign({value},{children}),void 0)}const wireTransferConfig=config&&paymentResource?getPaymentConfig(paymentResource,config):{};return _jsx(WireTransferPayment,Object.assign({},p,wireTransferConfig),void 0)}
@@ -10,7 +10,7 @@ export declare type CustomerAddress = Address & {
10
10
  handleSelect?: () => void;
11
11
  };
12
12
  export declare type AddressCardsTemplateChildren = FunctionChildren<ChildrenProps>;
13
- export declare type AddressCardsTemplate = ChildrenProps;
13
+ export declare type AddressCardsType = ChildrenProps;
14
14
  declare type HandleSelect = (k: number, addressId: string, customerAddressId: string, disabled: boolean) => void;
15
15
  declare type Props = {
16
16
  customerAddresses: CustomerAddress[];
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import{useContext}from"react";import AddressChildrenContext from"../../context/AddressChildrenContext";import ShippingAddressContext from"../../context/ShippingAddressContext";export default function AddressCardsTemplate({customerAddresses:e,children:s,deselect:t,countryLock:r,selected:n,selectedClassName:o,className:d,disabledClassName:c,handleSelect:i}){const{setShippingAddress:a}=useContext(ShippingAddressContext);const l=e.map(((e,s)=>{const l=e;const m=a&&r&&r!==e.country_code||false;const p=t?"":o;const x=n===s?`${d} ${p}`:d;const C=m?`${d} ${c}`:x;const u=(e===null||e===void 0?void 0:e.reference)||"";const A=()=>i(s,e.id,u,m);return Object.assign(Object.assign({},l),{className:C,onClick:A})}));const m={customerAddresses:l,AddressProvider:AddressChildrenContext.Provider};return _jsx(Parent,Object.assign({},m,{children:s}),void 0)}
1
+ import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import{useContext}from"react";import AddressChildrenContext from"../../context/AddressChildrenContext";import ShippingAddressContext from"../../context/ShippingAddressContext";export default function AddressCardsTemplate({customerAddresses,children,deselect,countryLock,selected,selectedClassName,className,disabledClassName,handleSelect}){const{setShippingAddress}=useContext(ShippingAddressContext),value={customerAddresses:customerAddresses.map((address,k)=>{const attributes=address,disabled=setShippingAddress&&countryLock&&countryLock!==address.country_code||!1,addressSelectedClass=selected===k?`${className} ${deselect?"":selectedClassName}`:className,finalClassName=disabled?`${className} ${disabledClassName}`:addressSelectedClass,customerAddressId=(address==null?void 0:address.reference)||"",onClick=()=>handleSelect(k,address.id,customerAddressId,disabled);return Object.assign(Object.assign({},attributes),{className:finalClassName,onClick})}),AddressProvider:AddressChildrenContext.Provider};return _jsx(Parent,Object.assign({},value,{children}),void 0)}
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import OrderContext from"../../context/OrderContext";import{useContext,useEffect,useState}from"react";import Parent from"./Parent";const BaseField=t=>{var{children:e,attribute:r}=t,s=__rest(t,["children","attribute"]);const{order:n}=useContext(OrderContext);const[o,i]=useState("");useEffect((()=>{if(n&&r in n)i(n[r]);return()=>{i("")}}),[n]);const a=Object.assign({attribute:o},s);return e?_jsx(Parent,Object.assign({},a,{children:e}),void 0):_jsx("span",Object.assign({},s,{children:o}),void 0)};export default BaseField;
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import OrderContext from"../../context/OrderContext";import{useContext,useEffect,useState}from"react";import Parent from"./Parent";const BaseField=_a=>{var{children,attribute}=_a,p=__rest(_a,["children","attribute"]);const{order}=useContext(OrderContext),[field,setField]=useState("");useEffect(()=>(order&&attribute in order&&setField(order[attribute]),()=>{setField("")}),[order]);const parentProps=Object.assign({attribute:field},p);return children?_jsx(Parent,Object.assign({},parentProps,{children}),void 0):_jsx("span",Object.assign({},p,{children:field}),void 0)};export default BaseField;
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import React from"react";import Parent from"./Parent";const BaseInput=(t,e)=>{const{children:r}=t,s=__rest(t,["children"]);const a=t.type==="textarea"?_jsx("textarea",Object.assign({ref:e},s),void 0):_jsx("input",Object.assign({ref:e},s),void 0);return r?_jsx(Parent,Object.assign({},s,{children:r}),void 0):a};export default React.forwardRef(BaseInput);
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import React from"react";import Parent from"./Parent";const BaseInput=(props,ref)=>{const{children}=props,p=__rest(props,["children"]),input=props.type==="textarea"?_jsx("textarea",Object.assign({ref},p),void 0):_jsx("input",Object.assign({ref},p),void 0);return children?_jsx(Parent,Object.assign({},p,{children}),void 0):input};export default React.forwardRef(BaseInput);
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import OrderContext from"../../context/OrderContext";import getAmount from"../../utils/getAmount";import Parent from"./Parent";import{useState,useEffect,useContext}from"react";import{baseOrderPricePropTypes}from"../../typings/index";import{isEmpty}from"lodash";const BaseOrderPrice=e=>{const{format:t="formatted",base:r,type:s,children:o}=e,n=__rest(e,["format","base","type","children"]);const{order:i}=useContext(OrderContext);const[a,c]=useState("");const[m,p]=useState(0);useEffect((()=>{const e=getAmount({base:r,type:s,format:t,obj:i||{}});const o=getAmount({base:r,type:s,format:"cents",obj:i||{}});c(e);p(o);return()=>{if(isEmpty(i)){c("")}}}),[i]);const d=Object.assign({priceCents:m,price:a},n);return o?_jsx(Parent,Object.assign({},d,{children:o}),void 0):_jsx("span",Object.assign({},n,{children:a}),void 0)};BaseOrderPrice.propTypes=baseOrderPricePropTypes;export default BaseOrderPrice;
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import OrderContext from"../../context/OrderContext";import getAmount from"../../utils/getAmount";import Parent from"./Parent";import{useState,useEffect,useContext}from"react";import{baseOrderPricePropTypes}from"../../typings/index";import{isEmpty}from"lodash";const BaseOrderPrice=props=>{const{format="formatted",base,type,children}=props,p=__rest(props,["format","base","type","children"]),{order}=useContext(OrderContext),[price,setPrice]=useState(""),[cents,setCents]=useState(0);useEffect(()=>{const p2=getAmount({base,type,format,obj:order||{}}),c=getAmount({base,type,format:"cents",obj:order||{}});return setPrice(p2),setCents(c),()=>{isEmpty(order)&&setPrice("")}},[order]);const parentProps=Object.assign({priceCents:cents,price},p);return children?_jsx(Parent,Object.assign({},parentProps,{children}),void 0):_jsx("span",Object.assign({},p,{children:price}),void 0)};BaseOrderPrice.propTypes=baseOrderPricePropTypes;export default BaseOrderPrice;
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import React from"react";import Parent from"./Parent";import{findIndex}from"lodash";const BaseSelect=(e,t)=>{const{options:r=[],children:s,placeholder:o={label:"Select an option",value:""},value:n=""}=e,a=__rest(e,["options","children","placeholder","value"]);if(findIndex(r,o)===-1){r.unshift(o)}else{r[0]=o}const l=r.map(((e,t)=>{const{label:r}=e,s=__rest(e,["label"]);return _jsx("option",Object.assign({},s,{children:r}),t)}));const i=Object.assign({options:r,ref:t},a);return s?_jsx(Parent,Object.assign({},i,{children:s}),void 0):_jsx("select",Object.assign({ref:t,defaultValue:n},a,{children:l}),void 0)};export default React.forwardRef(BaseSelect);
1
+ import{__rest}from"tslib";import{jsx as _jsx}from"react/jsx-runtime";import React from"react";import Parent from"./Parent";import{findIndex}from"lodash";const BaseSelect=(props,ref)=>{const{options=[],children,placeholder={label:"Select an option",value:""},value=""}=props,p=__rest(props,["options","children","placeholder","value"]);findIndex(options,placeholder)===-1?options.unshift(placeholder):options[0]=placeholder;const Options=options.map((o,k)=>{const{label}=o,option=__rest(o,["label"]);return _jsx("option",Object.assign({},option,{children:label}),k)}),parentProps=Object.assign({options,ref},p);return children?_jsx(Parent,Object.assign({},parentProps,{children}),void 0):_jsx("select",Object.assign({ref,defaultValue:value},p,{children:Options}),void 0)};export default React.forwardRef(BaseSelect);
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import PropTypes from"prop-types";const PProps={children:PropTypes.func};const Parent=r=>{const s=r.children;return s?_jsx(s,Object.assign({},r),void 0):null};Parent.propTypes=PProps;export default Parent;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import PropTypes from"prop-types";const PProps={children:PropTypes.func},Parent=props=>{const Child=props.children;return Child?_jsx(Child,Object.assign({},props),void 0):null};Parent.propTypes=PProps;export default Parent;
@@ -13,7 +13,7 @@ declare type CustomerPayment = PaymentSourceType & {
13
13
  handleClick?: () => void;
14
14
  };
15
15
  export declare type CustomerCardsTemplateChildren = FunctionChildren<ChildrenProps>;
16
- export declare type CustomerCardsTemplate = ChildrenProps;
16
+ export declare type CustomerCardsType = ChildrenProps;
17
17
  declare type Props = {
18
18
  customerPayments: CustomerPayment[];
19
19
  children: CustomerCardsTemplateChildren;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import{useContext}from"react";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";export default function PaymentCardsTemplate({customerPayments:t,children:e,paymentResource:o}){const{setPaymentSource:n}=useContext(PaymentMethodContext);const r=t.map((t=>{var e,r,a,i,m;const s=t;const c=((e=t===null||t===void 0?void 0:t.payment_source.options)===null||e===void 0?void 0:e.card)||((a=(r=t===null||t===void 0?void 0:t.payment_source)===null||r===void 0?void 0:r.payment_request_data)===null||a===void 0?void 0:a.paymentMethod)||((m=(i=t===null||t===void 0?void 0:t.payment_source)===null||i===void 0?void 0:i.metadata)===null||m===void 0?void 0:m.card);const d=async e=>{e.stopPropagation();await n({paymentResource:o,customerPaymentSourceId:t.id})};return Object.assign(Object.assign({},s),{card:c,handleClick:d})}));const a={customerPayments:r,PaymentSourceProvider:PaymentSourceContext.Provider};return _jsx(Parent,Object.assign({},a,{children:e}),void 0)}
1
+ import{jsx as _jsx}from"react/jsx-runtime";import Parent from"../utils/Parent";import{useContext}from"react";import PaymentMethodContext from"../../context/PaymentMethodContext";import PaymentSourceContext from"../../context/PaymentSourceContext";export default function PaymentCardsTemplate({customerPayments,children,paymentResource}){const{setPaymentSource}=useContext(PaymentMethodContext),value={customerPayments:customerPayments.map(customerPayment=>{var _a,_b,_c,_d,_e,_f,_g;const attributes=customerPayment,card=((_a=customerPayment==null?void 0:customerPayment.payment_source.options)===null||_a===void 0?void 0:_a.card)||((_c=(_b=customerPayment==null?void 0:customerPayment.payment_source)===null||_b===void 0?void 0:_b.payment_request_data)===null||_c===void 0?void 0:_c.paymentMethod)||((_e=(_d=customerPayment==null?void 0:customerPayment.payment_source)===null||_d===void 0?void 0:_d.payment_method)===null||_e===void 0?void 0:_e.card)||((_g=(_f=customerPayment==null?void 0:customerPayment.payment_source)===null||_f===void 0?void 0:_f.metadata)===null||_g===void 0?void 0:_g.card),handleClick=async e=>{e.stopPropagation(),await setPaymentSource({paymentResource,customerPaymentSourceId:customerPayment.id})};return Object.assign(Object.assign({},attributes),{card,handleClick})}),PaymentSourceProvider:PaymentSourceContext.Provider};return _jsx(Parent,Object.assign({},value,{children}),void 0)}
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Fragment}from"react";import PropTypes from"prop-types";const propTypes={formattedAmount:PropTypes.string,formattedCompare:PropTypes.string};const defaultProps={formattedAmount:"",formattedCompare:""};const PriceTemplate=e=>{const{showCompare:s,formattedCompare:r,compareClassName:t,className:o,formattedAmount:a,skuCode:m}=e,p=__rest(e,["showCompare","formattedCompare","compareClassName","className","formattedAmount","skuCode"]);return _jsxs(Fragment,{children:[_jsx("span",Object.assign({className:o},p,{children:a}),void 0),s&&_jsx("span",Object.assign({className:t||""},p,{children:r}),void 0)]},void 0)};PriceTemplate.propTypes=propTypes;PriceTemplate.defaultProps=defaultProps;export default PriceTemplate;
1
+ import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Fragment}from"react";import PropTypes from"prop-types";const propTypes={formattedAmount:PropTypes.string,formattedCompare:PropTypes.string},defaultProps={formattedAmount:"",formattedCompare:""},PriceTemplate=props=>{const{showCompare,formattedCompare,compareClassName,className,formattedAmount,skuCode}=props,p=__rest(props,["showCompare","formattedCompare","compareClassName","className","formattedAmount","skuCode"]);return _jsxs(Fragment,{children:[_jsx("span",Object.assign({className},p,{children:formattedAmount}),void 0),showCompare&&_jsx("span",Object.assign({className:compareClassName||""},p,{children:formattedCompare}),void 0)]},void 0)};PriceTemplate.propTypes=propTypes,PriceTemplate.defaultProps=defaultProps;export default PriceTemplate;
@@ -1 +1 @@
1
- import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Fragment}from"react";import{keys}from"lodash";import PropTypes from"prop-types";export const propTypes={variants:PropTypes.any.isRequired,onChange:PropTypes.func,options:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string.isRequired,code:PropTypes.string.isRequired,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}).isRequired).isRequired,name:PropTypes.string,children:PropTypes.func,type:PropTypes.oneOf(["select","radio"]),loader:PropTypes.element,placeholder:PropTypes.string,skuCode:PropTypes.string};const VariantTemplate=e=>{const{id:s,variants:t,type:r,placeholder:a,options:o,skuCode:n,handleChange:p,handleCallback:i}=e,l=__rest(e,["id","variants","type","placeholder","options","skuCode","handleChange","handleCallback"]);const d=keys(t).map(((e,a)=>{const d=n===e;const c=o.length>0?o[a].label:t[e].name;return r==="select"?_jsx("option",Object.assign({"data-sku-id":t[e].id,"data-label":c,value:t[e].code},{children:c}),t[e].id):_jsxs(Fragment,{children:[_jsx("input",Object.assign({id:s&&`${s}-${a}`,defaultChecked:d,type:"radio",value:t[e].code,onChange:s=>{const r=s.target.value;p&&p(r,t[e].id);i&&i({code:r,label:c})}},l),void 0),c]},t[e].id)}));if(r==="select"){return _jsxs("select",Object.assign({id:s,title:"Variant selector",onChange:e=>{const s=e.target.value;const t=e.target.selectedIndex;const r=e.target[t].dataset.skuId;const a=e.target[t].dataset.label;p&&p(s,r);i&&i({code:s,label:a})},value:n||""},l,{children:[_jsx("option",Object.assign({disabled:!!n},{children:a}),void 0),d]}),void 0)}return _jsx(Fragment,{children:d},void 0)};VariantTemplate.propTypes=propTypes;export default VariantTemplate;
1
+ import{__rest}from"tslib";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Fragment}from"react";import{keys}from"lodash";import PropTypes from"prop-types";export const propTypes={variants:PropTypes.any.isRequired,onChange:PropTypes.func,options:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string.isRequired,code:PropTypes.string.isRequired,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}).isRequired).isRequired,name:PropTypes.string,children:PropTypes.func,type:PropTypes.oneOf(["select","radio"]),loader:PropTypes.element,placeholder:PropTypes.string,skuCode:PropTypes.string};const VariantTemplate=props=>{const{id,variants,type,placeholder,options,skuCode,handleChange,handleCallback}=props,prs=__rest(props,["id","variants","type","placeholder","options","skuCode","handleChange","handleCallback"]),vars=keys(variants).map((v,k)=>{const checked=skuCode===v,label=options.length>0?options[k].label:variants[v].name;return type==="select"?_jsx("option",Object.assign({"data-sku-id":variants[v].id,"data-label":label,value:variants[v].code},{children:label}),variants[v].id):_jsxs(Fragment,{children:[_jsx("input",Object.assign({id:id&&`${id}-${k}`,defaultChecked:checked,type:"radio",value:variants[v].code,onChange:e=>{const code=e.target.value;handleChange&&handleChange(code,variants[v].id),handleCallback&&handleCallback({code,label})}},prs),void 0),label]},variants[v].id)});return type==="select"?_jsxs("select",Object.assign({id,title:"Variant selector",onChange:e=>{const v=e.target.value,i=e.target.selectedIndex,id2=e.target[i].dataset.skuId,label=e.target[i].dataset.label;handleChange&&handleChange(v,id2),handleCallback&&handleCallback({code:v,label})},value:skuCode||""},prs,{children:[_jsx("option",Object.assign({disabled:!!skuCode},{children:placeholder}),void 0),vars]}),void 0):_jsx(Fragment,{children:vars},void 0)};VariantTemplate.propTypes=propTypes;export default VariantTemplate;
@@ -1 +1 @@
1
- import{jsx as _jsx}from"react/jsx-runtime";import customMessages from"../../utils/customMessages";const getAllErrors=s=>{const{allErrors:e,messages:r,field:t,props:i,lineItem:n,resource:o,returnHtml:l=true}=s;return e.map(((s,e)=>{const a=customMessages(r,s);const c=(a===null||a===void 0?void 0:a.message)||s.message||`${s.title} - ${s.detail}`;if(t){if(s.resource==="line_items"){if(n&&s.id===n["id"]){return l?_jsx("span",Object.assign({},i,{children:c}),e):c}}if(t===s.field&&o===s.resource){return l?_jsx("span",Object.assign({},i,{children:c}),e):c}}if(o===s.resource&&!t){return l?_jsx("span",Object.assign({},i,{children:c}),e):c}}))};export default getAllErrors;
1
+ import{jsx as _jsx}from"react/jsx-runtime";import customMessages from"../../utils/customMessages";const getAllErrors=params=>{const{allErrors,messages,field,props,lineItem,resource,returnHtml=!0}=params;return allErrors.map((v,k)=>{const objMsg=customMessages(messages,v),text=(objMsg==null?void 0:objMsg.message)||v.message||`${v.title} - ${v.detail}`;if(field){if(v.resource==="line_items"&&lineItem&&v.id===lineItem.id)return returnHtml?_jsx("span",Object.assign({},props,{children:text}),k):text;if(field===v.field&&resource===v.resource)return returnHtml?_jsx("span",Object.assign({},props,{children:text}),k):text}if(resource===v.resource&&!field)return returnHtml?_jsx("span",Object.assign({},props,{children:text}),k):text})};export default getAllErrors;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import childrenTypes from"../utils/childrenTypes";import{baseOrderComponentPricePropTypes,PTLoader,BMObject}from"../typings/index";import{ErrorPropTypes}from"../typings/errors";import{BaseInputComponentPropTypes}from"../typings/index";const components={Address:{permittedChildren:["AddressField","ReactNode"],displayName:"Address",propTypes:{children:childrenTypes.isRequired}},AddressCountrySelector:{displayName:"AddressCountrySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_country_code","shipping_address_country_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:true}},AddressStateSelector:{displayName:"AddressStateSelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_state_code","shipping_address_state_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:true}},AddressField:{displayName:"AddressField",propTypes:{children:PropTypes.func}},AddressInput:{displayName:"AddressInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["billing_address_city","billing_address_company","billing_address_email","billing_address_first_name","billing_address_last_name","billing_address_line_1","billing_address_line_2","billing_address_phone","billing_address_state_code","billing_address_zip_code","billing_address_billing_info","billing_address_save_to_customer_book","shipping_address_city","shipping_address_company","shipping_address_email","shipping_address_first_name","shipping_address_last_name","shipping_address_line_1","shipping_address_line_2","shipping_address_phone","shipping_address_state_code","shipping_address_zip_code","shipping_address_save_to_customer_book"]).isRequired,type:PropTypes.oneOf(["checkbox","date","email","number","tel","text","textarea"]).isRequired,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool},defaultProps:{required:true}},AddToCartButton:{displayName:"AddToCartButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),skuCode:PropTypes.string,disabled:PropTypes.bool,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})},defaultProps:{label:"Add to cart"}},AddressesContainer:{displayName:"AddressesContainer",permittedChildren:["BillingAddressForm","BillingAddressContainer","ShippingAddressForm","ShippingAddressContainer","SaveAddressesButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,shipToDifferentAddress:PropTypes.bool}},AvailabilityContainer:{displayName:"AvailabilityContainer",permittedChildren:["AvailabilityTemplate","ReactNode"],propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},AvailabilityTemplate:{displayName:"AvailabilityTemplate",propTypes:{timeFormat:PropTypes.oneOf(["days","hours"]),showShippingMethodName:PropTypes.bool,children:PropTypes.func},defaultProps:{timeFormat:"days",showShippingMethodName:false}},BillingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},BillingAddressForm:{permittedChildren:["AddressInput","ReactNode"],propTypes:{children:childrenTypes.isRequired}},CheckoutLink:{displayName:"CheckoutLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Checkout"}},CommerceLayer:{permittedChildren:["OrderContainer","OrderStorage","PricesContainer","GiftCardContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,accessToken:PropTypes.string.isRequired,endpoint:PropTypes.string.isRequired}},CustomerContainer:{displayName:"CustomerContainer",permittedChildren:["CustomerInput","SaveCustomerButton","AddressesContainer","PaymentMethodsContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,isGuest:PropTypes.bool}},CustomerInput:{displayName:"CustomerInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["customerEmail"]),type:PropTypes.oneOf(["email"]),placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool,saveOnBlur:PropTypes.bool},defaultProps:{required:true}},DeliveryLeadTime:{displayName:"DeliveryLeadTime",propTypes:{type:PropTypes.oneOf(["max_days","max_hours","min_days","min_hours"]).isRequired,children:PropTypes.func}},DiscountAmount:{displayName:"DiscountAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},Errors:{displayName:"Errors",propTypes:ErrorPropTypes,defaultProps:{messages:[],field:"base"}},ExternalFunction:{displayName:"ExternalFunction",permittedChildren:["AddToCartButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,url:PropTypes.string.isRequired}},GiftCard:{permittedChildren:["GiftCardCurrencySelector","GiftCardInput","Errors","MetadataInput","SubmitButton","ReactNode"],displayName:"GiftCard",propTypes:{children:childrenTypes.isRequired,onSubmit:PropTypes.func},defaultProps:{onSubmit:undefined}},GiftCardAmount:{displayName:"GiftCardAmount",propTypes:baseOrderComponentPricePropTypes},GiftCardContainer:{permittedChildren:["GiftCard","Errors","ReactNode"],displayName:"GiftCardContainer",propTypes:{children:childrenTypes.isRequired}},GiftCardCurrencySelector:{displayName:"GiftCardCurrencySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired,label:PropTypes.string.isRequired}),value:PropTypes.string,required:PropTypes.bool},defaultProps:{required:true}},GiftCardInput:{displayName:"GiftCardInput",propTypes:{type:PropTypes.oneOf(["text","email","number","date","checkbox"]).isRequired,name:PropTypes.oneOf(["balanceCents","balanceMaxCents","singleUse","rechargeable","imageUrl","expiresAt","referenceOrigin","email","firstName","lastName","reference"]).isRequired,children:PropTypes.func,placeholder:PropTypes.string}},GiftCardOrCouponForm:{permittedChildren:["GiftCardOrCouponInput","GiftCardOrCouponSubmit","ReactNode"],propTypes:{children:childrenTypes.isRequired}},GiftCardOrCouponInput:{displayName:"GiftCardOrCouponInput",propTypes:{children:PropTypes.func,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool}},GiftCardOrCouponSubmit:{displayName:"GiftCardOrCouponSubmit",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},GiftCardOrCouponCode:{displayName:"GiftCardOrCouponCode",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"])}},GiftCardOrCouponRemoveButton:{displayName:"GiftCardOrCouponRemoveButton",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"]),label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},ItemContainer:{permittedChildren:["PricesContainer","VariantsContainer","SkuOptionContainer","QuantitySelector","AddToCartButton","AvailabilityContainer","SkuListsContainer","ReactNode"],displayName:"ItemContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}},LineItem:{permittedChildren:["AvailabilityContainer","LineItemImage","LineItemName","LineItemOptions","LineItemQuantity","LineItemAmount","LineItemRemoveLink","StockTransfer","Errors","ReactNode"],displayName:"LineItem",propTypes:{children:childrenTypes.isRequired,type:PropTypes.oneOf(["skus","gift_cards","shipments","payment_methods","promotions","adjustments","bundles"])},defaultProps:{type:"skus"}},LineItemAmount:{displayName:"LineItemAmount",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["total","unit","option"])}),defaultProps:{format:"formatted",type:"total"}},LineItemImage:{displayName:"LineItemImage",propTypes:{width:PropTypes.number,children:PropTypes.func}},LineItemName:{displayName:"LineItemName",propTypes:{children:PropTypes.func}},LineItemCode:{displayName:"LineItemCode",propTypes:{children:PropTypes.func}},LineItemOption:{displayName:"LineItemOption",propTypes:{name:PropTypes.string,children:PropTypes.func,valueClassName:PropTypes.string,className:PropTypes.string,id:PropTypes.string,style:PropTypes.object}},LineItemOptions:{permittedChildren:["LineItemOption","ReactNode"],displayName:"LineItemOptions",propTypes:{children:childrenTypes.isRequired,title:PropTypes.string,showName:PropTypes.bool,skuOptionId:PropTypes.string}},LineItemQuantity:{displayName:"LineItemQuantity",propTypes:{children:PropTypes.func,max:PropTypes.number,disabled:PropTypes.bool,readonly:PropTypes.bool},defaultProps:{max:50}},LineItemRemoveLink:{displayName:"LineItemRemoveLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Remove"}},LineItemsContainer:{permittedChildren:["LineItemsCount","LineItem","ReactNode"],displayName:"LineItemsContainer",propTypes:{children:childrenTypes.isRequired,filters:PropTypes.object,loader:PTLoader},defaultProps:{filters:{},loader:"Loading..."}},LineItemsCount:{displayName:"LineItemsCount",propTypes:{children:PropTypes.func,id:PropTypes.string,className:PropTypes.string,name:PropTypes.string,style:PropTypes.object}},MetadataInput:{displayName:"MetadataInput",propTypes:BaseInputComponentPropTypes},OrderContainer:{permittedChildren:["AddressesContainer","CustomerContainer","ItemContainer","LineItemsContainer","SubTotalAmount","DiscountAmount","ShippingAmount","TaxesAmount","GiftCardAmount","TotalAmount","CheckoutLink","GiftCardContainer","ShipmentsContainer","PaymentMethodsContainer","PaymentMethodAmount","GiftCardOrCouponForm","GiftCardOrCouponCode","GiftCardOrCouponRemoveButton","Errors","OrderNumber","ReactNode"],displayName:"OrderContainer",propTypes:{children:childrenTypes.isRequired,orderId:PropTypes.string,metadata:BMObject,attributes:PropTypes.object},defaultProps:{metadata:{}}},OrderNumber:{displayName:"OrderNumber",propTypes:{className:PropTypes.string},defaultProps:{format:"formatted"}},OrderStorage:{permittedChildren:["OrderContainer","ReactNode"],displayName:"OrderStorage",propTypes:{children:childrenTypes.isRequired,clearWhenPlaced:PropTypes.bool,persistKey:PropTypes.string.isRequired}},PaymentMethod:{permittedChildren:["PaymentMethodName","PaymentMethodRadioButton","PaymentMethodPrice","PaymentSource","ReactNode","Errors"],displayName:"PaymentMethod",propTypes:{children:childrenTypes.isRequired}},PaymentMethodAmount:{displayName:"PaymentMethodAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},PaymentMethodName:{displayName:"PaymentMethodName",propTypes:{children:PropTypes.func}},PaymentMethodPrice:{displayName:"PaymentMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])})},PaymentMethodRadioButton:{displayName:"PaymentMethodRadioButton",propTypes:{children:PropTypes.func}},PaymentMethodsContainer:{displayName:"PaymentMethodsContainer",permittedChildren:["PaymentSource","ReactNode","PlaceOrderContainer"],propTypes:{children:childrenTypes.isRequired}},PaymentSource:{displayName:"PaymentSource",permittedChildren:["PaymentSourceBrandIcon","PaymentSourceBrandName","PaymentSourceEditButton","PaymentSourceDetail","ReactNode"],propTypes:{children:childrenTypes,readonly:PropTypes.bool}},PaymentSourceBrandIcon:{displayName:"PaymentSourceBrandIcon",propTypes:{children:PropTypes.func,width:PropTypes.number,height:PropTypes.number,src:PropTypes.string,className:PropTypes.string}},PaymentSourceBrandName:{displayName:"PaymentSourceBrandName",propTypes:{children:PropTypes.func,label:PropTypes.string}},PaymentSourceEditButton:{displayName:"PaymentSourceEditButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])}},PaymentSourceDetail:{displayName:"PaymentSourceDetail",propTypes:{type:PropTypes.oneOf(["last4","expYear","expMonth"]).isRequired}},PlaceOrderButton:{displayName:"PlaceOrderButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Place order"}},PlaceOrderContainer:{displayName:"PlaceOrderContainer",permittedChildren:["PaymentMethod","PlaceOrderButton","PrivacyAndTermsCheckbox","ReactNode"],propTypes:{children:childrenTypes.isRequired}},Price:{displayName:"Price",propTypes:{children:PropTypes.func,compareClassName:PropTypes.string,skuCode:PropTypes.string,showCompare:PropTypes.bool},defaultProps:{skuCode:""}},PricesContainer:{permittedChildren:["Price","ReactNode"],displayName:"PricesContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,loader:PTLoader,perPage:PropTypes.number,filters:PropTypes.object},defaultProps:{perPage:10,filters:{},loader:"Loading...",skuCode:""}},PrivacyAndTermsCheckbox:{displayName:"PrivacyAndTermsCheckbox",propTypes:{children:PropTypes.func}},QuantitySelector:{displayName:"QuantitySelector",propTypes:{children:PropTypes.func,min:PropTypes.number,max:PropTypes.number,value:PropTypes.string,skuCode:PropTypes.string,disabled:PropTypes.bool},defaultProps:{min:1}},SaveAddressesButton:{displayName:"SaveAddressesButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func,disabled:PropTypes.bool},defaultProps:{label:"Continue to delivery"}},Shipment:{permittedChildren:["LineItemsContainer","LineItem","ShippingMethod","ReactNode"],displayName:"Shipment",propTypes:{children:childrenTypes.isRequired}},ShipmentField:{displayName:"ShipmentField",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["cost_amount_cents","cost_amount_float","currency_code","formatted_cost_amount","number","status","key_number"]).isRequired}},ShipmentsContainer:{displayName:"ShipmentsContainer",permittedChildren:["Shipment","ReactNode"],propTypes:{children:childrenTypes.isRequired}},ShippingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},SaveCustomerButton:{displayName:"SaveCustomerButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func},defaultProps:{label:"Save"}},ShippingAddressForm:{permittedChildren:["AddressInput","ReactNode"],propTypes:{children:childrenTypes.isRequired}},ShippingAmount:{displayName:"ShippingAmount",propTypes:baseOrderComponentPricePropTypes},ShippingMethod:{permittedChildren:["ShippingMethodName","ShippingMethodPrice","ShippingMethodRadioButton","DeliveryLeadTime","ReactNode"],displayName:"ShippingMethod",propTypes:{children:childrenTypes.isRequired,readonly:PropTypes.bool}},ShippingMethodName:{displayName:"ShippingMethodName",propTypes:{children:PropTypes.func}},ShippingMethodRadioButton:{displayName:"ShippingMethodRadioButton",propTypes:{children:PropTypes.func}},ShippingMethodPrice:{displayName:"ShippingMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])}),defaultProps:{format:"formatted",type:"amount"}},SkuList:{permittedChildren:["AddToCartButton","QuantitySelector","ReactNode"],displayName:"SkuList",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuListsContainer:{permittedChildren:["SkuList","ReactNode"],displayName:"SkuListsContainer",propTypes:{children:childrenTypes.isRequired}},SkuOption:{permittedChildren:["SkuOptionInput","ReactNode"],displayName:"SkuOption",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuOptionInput:{displayName:"SkuOptionInput",propTypes:BaseInputComponentPropTypes},SkuOptionsContainer:{permittedChildren:["SkuOption","ReactNode"],displayName:"SkuOptionsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},StockTransfer:{permittedChildren:["StockTransferField","ReactNode"],displayName:"StockTransfer",propTypes:{children:childrenTypes.isRequired}},StockTransferField:{displayName:"StockTransferField",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["quantity","sku_code"]).isRequired}},SubmitButton:{displayName:"SubmitButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Submit"}},SubTotalAmount:{displayName:"SubTotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TaxesAmount:{displayName:"TaxesAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TotalAmount:{displayName:"TotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},VariantsContainer:{permittedChildren:["VariantSelector","ReactNode"],displayName:"VariantsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,filters:PropTypes.object},defaultProps:{skuCode:"",filters:{}}},VariantSelector:{displayName:"VariantSelector",propTypes:{options:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string.isRequired,code:PropTypes.string.isRequired,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}).isRequired).isRequired,name:PropTypes.string,children:PropTypes.func,type:PropTypes.oneOf(["select","radio"]),loader:PropTypes.element,placeholder:PropTypes.string,skuCode:PropTypes.string},defaultProps:{placeholder:"Select a variant",type:"select"}}};export default components;
1
+ import PropTypes from"prop-types";import childrenTypes from"../utils/childrenTypes";import{baseOrderComponentPricePropTypes,PTLoader,BMObject}from"../typings/index";import{ErrorPropTypes}from"../typings/errors";import{BaseInputComponentPropTypes}from"../typings/index";const components={Address:{permittedChildren:["AddressField","ReactNode"],displayName:"Address",propTypes:{children:childrenTypes.isRequired}},AddressCountrySelector:{displayName:"AddressCountrySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_country_code","shipping_address_country_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:!0}},AddressStateSelector:{displayName:"AddressStateSelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({label:PropTypes.string.isRequired,value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired}),value:PropTypes.string,name:PropTypes.oneOf(["billing_address_state_code","shipping_address_state_code"]).isRequired,required:PropTypes.bool},defaultProps:{required:!0}},AddressField:{displayName:"AddressField",propTypes:{children:PropTypes.func}},AddressInput:{displayName:"AddressInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["billing_address_city","billing_address_company","billing_address_email","billing_address_first_name","billing_address_last_name","billing_address_line_1","billing_address_line_2","billing_address_phone","billing_address_state_code","billing_address_zip_code","billing_address_billing_info","billing_address_save_to_customer_book","shipping_address_city","shipping_address_company","shipping_address_email","shipping_address_first_name","shipping_address_last_name","shipping_address_line_1","shipping_address_line_2","shipping_address_phone","shipping_address_state_code","shipping_address_zip_code","shipping_address_save_to_customer_book"]).isRequired,type:PropTypes.oneOf(["checkbox","date","email","number","tel","text","textarea"]).isRequired,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool},defaultProps:{required:!0}},AddToCartButton:{displayName:"AddToCartButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),skuCode:PropTypes.string,disabled:PropTypes.bool,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})},defaultProps:{label:"Add to cart"}},AddressesContainer:{displayName:"AddressesContainer",permittedChildren:["BillingAddressForm","BillingAddressContainer","ShippingAddressForm","ShippingAddressContainer","SaveAddressesButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,shipToDifferentAddress:PropTypes.bool}},AvailabilityContainer:{displayName:"AvailabilityContainer",permittedChildren:["AvailabilityTemplate","ReactNode"],propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},AvailabilityTemplate:{displayName:"AvailabilityTemplate",propTypes:{timeFormat:PropTypes.oneOf(["days","hours"]),showShippingMethodName:PropTypes.bool,children:PropTypes.func},defaultProps:{timeFormat:"days",showShippingMethodName:!1}},BillingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},BillingAddressForm:{permittedChildren:["AddressInput","ReactNode"],propTypes:{children:childrenTypes.isRequired}},CheckoutLink:{displayName:"CheckoutLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Checkout"}},CommerceLayer:{permittedChildren:["OrderContainer","OrderStorage","PricesContainer","GiftCardContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,accessToken:PropTypes.string.isRequired,endpoint:PropTypes.string.isRequired}},CustomerContainer:{displayName:"CustomerContainer",permittedChildren:["CustomerInput","SaveCustomerButton","AddressesContainer","PaymentMethodsContainer","ShipmentsContainer","ReactNode"],propTypes:{children:childrenTypes.isRequired,isGuest:PropTypes.bool}},CustomerInput:{displayName:"CustomerInput",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["customerEmail"]),type:PropTypes.oneOf(["email"]),placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool,saveOnBlur:PropTypes.bool},defaultProps:{required:!0}},DeliveryLeadTime:{displayName:"DeliveryLeadTime",propTypes:{type:PropTypes.oneOf(["max_days","max_hours","min_days","min_hours"]).isRequired,children:PropTypes.func}},DiscountAmount:{displayName:"DiscountAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},Errors:{displayName:"Errors",propTypes:ErrorPropTypes,defaultProps:{messages:[],field:"base"}},ExternalFunction:{displayName:"ExternalFunction",permittedChildren:["AddToCartButton","ReactNode"],propTypes:{children:childrenTypes.isRequired,url:PropTypes.string.isRequired}},GiftCard:{permittedChildren:["GiftCardCurrencySelector","GiftCardInput","Errors","MetadataInput","SubmitButton","ReactNode"],displayName:"GiftCard",propTypes:{children:childrenTypes.isRequired,onSubmit:PropTypes.func},defaultProps:{onSubmit:void 0}},GiftCardAmount:{displayName:"GiftCardAmount",propTypes:baseOrderComponentPricePropTypes},GiftCardContainer:{permittedChildren:["GiftCard","Errors","ReactNode"],displayName:"GiftCardContainer",propTypes:{children:childrenTypes.isRequired}},GiftCardCurrencySelector:{displayName:"GiftCardCurrencySelector",propTypes:{children:PropTypes.func,placeholder:PropTypes.shape({value:PropTypes.oneOfType([PropTypes.string,PropTypes.number]).isRequired,label:PropTypes.string.isRequired}),value:PropTypes.string,required:PropTypes.bool},defaultProps:{required:!0}},GiftCardInput:{displayName:"GiftCardInput",propTypes:{type:PropTypes.oneOf(["text","email","number","date","checkbox"]).isRequired,name:PropTypes.oneOf(["balanceCents","balanceMaxCents","singleUse","rechargeable","imageUrl","expiresAt","referenceOrigin","email","firstName","lastName","reference"]).isRequired,children:PropTypes.func,placeholder:PropTypes.string}},GiftCardOrCouponForm:{permittedChildren:["GiftCardOrCouponInput","GiftCardOrCouponSubmit","ReactNode"],propTypes:{children:childrenTypes.isRequired}},GiftCardOrCouponInput:{displayName:"GiftCardOrCouponInput",propTypes:{children:PropTypes.func,placeholder:PropTypes.string,disabled:PropTypes.bool,required:PropTypes.bool}},GiftCardOrCouponSubmit:{displayName:"GiftCardOrCouponSubmit",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},GiftCardOrCouponCode:{displayName:"GiftCardOrCouponCode",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"])}},GiftCardOrCouponRemoveButton:{displayName:"GiftCardOrCouponRemoveButton",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["coupon","gift_card"]),label:PropTypes.oneOfType([PropTypes.string,PropTypes.object])}},ItemContainer:{permittedChildren:["PricesContainer","VariantsContainer","SkuOptionContainer","QuantitySelector","AddToCartButton","AvailabilityContainer","SkuListsContainer","ReactNode"],displayName:"ItemContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}},LineItem:{permittedChildren:["AvailabilityContainer","LineItemImage","LineItemName","LineItemOptions","LineItemQuantity","LineItemAmount","LineItemRemoveLink","StockTransfer","Errors","ReactNode"],displayName:"LineItem",propTypes:{children:childrenTypes.isRequired,type:PropTypes.oneOf(["skus","gift_cards","shipments","payment_methods","promotions","adjustments","bundles"])},defaultProps:{type:"skus"}},LineItemAmount:{displayName:"LineItemAmount",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["total","unit","option"])}),defaultProps:{format:"formatted",type:"total"}},LineItemImage:{displayName:"LineItemImage",propTypes:{width:PropTypes.number,children:PropTypes.func}},LineItemName:{displayName:"LineItemName",propTypes:{children:PropTypes.func}},LineItemCode:{displayName:"LineItemCode",propTypes:{children:PropTypes.func}},LineItemOption:{displayName:"LineItemOption",propTypes:{name:PropTypes.string,children:PropTypes.func,valueClassName:PropTypes.string,className:PropTypes.string,id:PropTypes.string,style:PropTypes.object}},LineItemOptions:{permittedChildren:["LineItemOption","ReactNode"],displayName:"LineItemOptions",propTypes:{children:childrenTypes.isRequired,title:PropTypes.string,showName:PropTypes.bool,skuOptionId:PropTypes.string}},LineItemQuantity:{displayName:"LineItemQuantity",propTypes:{children:PropTypes.func,max:PropTypes.number,disabled:PropTypes.bool,readonly:PropTypes.bool},defaultProps:{max:50}},LineItemRemoveLink:{displayName:"LineItemRemoveLink",propTypes:{children:PropTypes.func,label:PropTypes.string},defaultProps:{label:"Remove"}},LineItemsContainer:{permittedChildren:["LineItemsCount","LineItem","ReactNode"],displayName:"LineItemsContainer",propTypes:{children:childrenTypes.isRequired,filters:PropTypes.object,loader:PTLoader},defaultProps:{filters:{},loader:"Loading..."}},LineItemsCount:{displayName:"LineItemsCount",propTypes:{children:PropTypes.func,id:PropTypes.string,className:PropTypes.string,name:PropTypes.string,style:PropTypes.object}},MetadataInput:{displayName:"MetadataInput",propTypes:BaseInputComponentPropTypes},OrderContainer:{permittedChildren:["AddressesContainer","CustomerContainer","ItemContainer","LineItemsContainer","SubTotalAmount","DiscountAmount","ShippingAmount","TaxesAmount","GiftCardAmount","TotalAmount","CheckoutLink","GiftCardContainer","ShipmentsContainer","PaymentMethodsContainer","PaymentMethodAmount","GiftCardOrCouponForm","GiftCardOrCouponCode","GiftCardOrCouponRemoveButton","Errors","OrderNumber","ReactNode"],displayName:"OrderContainer",propTypes:{children:childrenTypes.isRequired,orderId:PropTypes.string,metadata:BMObject,attributes:PropTypes.object},defaultProps:{metadata:{}}},OrderNumber:{displayName:"OrderNumber",propTypes:{className:PropTypes.string},defaultProps:{format:"formatted"}},OrderStorage:{permittedChildren:["OrderContainer","ReactNode"],displayName:"OrderStorage",propTypes:{children:childrenTypes.isRequired,clearWhenPlaced:PropTypes.bool,persistKey:PropTypes.string.isRequired}},PaymentMethod:{permittedChildren:["PaymentMethodName","PaymentMethodRadioButton","PaymentMethodPrice","PaymentSource","ReactNode","Errors"],displayName:"PaymentMethod",propTypes:{children:childrenTypes.isRequired}},PaymentMethodAmount:{displayName:"PaymentMethodAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},PaymentMethodName:{displayName:"PaymentMethodName",propTypes:{children:PropTypes.func}},PaymentMethodPrice:{displayName:"PaymentMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])})},PaymentMethodRadioButton:{displayName:"PaymentMethodRadioButton",propTypes:{children:PropTypes.func}},PaymentMethodsContainer:{displayName:"PaymentMethodsContainer",permittedChildren:["PaymentSource","ReactNode","PlaceOrderContainer"],propTypes:{children:childrenTypes.isRequired}},PaymentSource:{displayName:"PaymentSource",permittedChildren:["PaymentSourceBrandIcon","PaymentSourceBrandName","PaymentSourceEditButton","PaymentSourceDetail","ReactNode"],propTypes:{children:childrenTypes,readonly:PropTypes.bool}},PaymentSourceBrandIcon:{displayName:"PaymentSourceBrandIcon",propTypes:{children:PropTypes.func,width:PropTypes.number,height:PropTypes.number,src:PropTypes.string,className:PropTypes.string}},PaymentSourceBrandName:{displayName:"PaymentSourceBrandName",propTypes:{children:PropTypes.func,label:PropTypes.string}},PaymentSourceEditButton:{displayName:"PaymentSourceEditButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])}},PaymentSourceDetail:{displayName:"PaymentSourceDetail",propTypes:{type:PropTypes.oneOf(["last4","expYear","expMonth"]).isRequired}},PlaceOrderButton:{displayName:"PlaceOrderButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Place order"}},PlaceOrderContainer:{displayName:"PlaceOrderContainer",permittedChildren:["PaymentMethod","PlaceOrderButton","PrivacyAndTermsCheckbox","ReactNode"],propTypes:{children:childrenTypes.isRequired}},Price:{displayName:"Price",propTypes:{children:PropTypes.func,compareClassName:PropTypes.string,skuCode:PropTypes.string,showCompare:PropTypes.bool},defaultProps:{skuCode:""}},PricesContainer:{permittedChildren:["Price","ReactNode"],displayName:"PricesContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,loader:PTLoader,perPage:PropTypes.number,filters:PropTypes.object},defaultProps:{perPage:10,filters:{},loader:"Loading...",skuCode:""}},PrivacyAndTermsCheckbox:{displayName:"PrivacyAndTermsCheckbox",propTypes:{children:PropTypes.func}},QuantitySelector:{displayName:"QuantitySelector",propTypes:{children:PropTypes.func,min:PropTypes.number,max:PropTypes.number,value:PropTypes.string,skuCode:PropTypes.string,disabled:PropTypes.bool},defaultProps:{min:1}},SaveAddressesButton:{displayName:"SaveAddressesButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func,disabled:PropTypes.bool},defaultProps:{label:"Continue to delivery"}},Shipment:{permittedChildren:["LineItemsContainer","LineItem","ShippingMethod","ReactNode"],displayName:"Shipment",propTypes:{children:childrenTypes.isRequired}},ShipmentField:{displayName:"ShipmentField",propTypes:{children:PropTypes.func,name:PropTypes.oneOf(["cost_amount_cents","cost_amount_float","currency_code","formatted_cost_amount","number","status","key_number"]).isRequired}},ShipmentsContainer:{displayName:"ShipmentsContainer",permittedChildren:["Shipment","ReactNode"],propTypes:{children:childrenTypes.isRequired}},ShippingAddressContainer:{permittedChildren:["Address","ReactNode"],propTypes:{children:childrenTypes.isRequired}},SaveCustomerButton:{displayName:"SaveCustomerButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element]),onClick:PropTypes.func},defaultProps:{label:"Save"}},ShippingAddressForm:{permittedChildren:["AddressInput","ReactNode"],propTypes:{children:childrenTypes.isRequired}},ShippingAmount:{displayName:"ShippingAmount",propTypes:baseOrderComponentPricePropTypes},ShippingMethod:{permittedChildren:["ShippingMethodName","ShippingMethodPrice","ShippingMethodRadioButton","DeliveryLeadTime","ReactNode"],displayName:"ShippingMethod",propTypes:{children:childrenTypes.isRequired,readonly:PropTypes.bool}},ShippingMethodName:{displayName:"ShippingMethodName",propTypes:{children:PropTypes.func}},ShippingMethodRadioButton:{displayName:"ShippingMethodRadioButton",propTypes:{children:PropTypes.func}},ShippingMethodPrice:{displayName:"ShippingMethodPrice",propTypes:Object.assign(Object.assign({},baseOrderComponentPricePropTypes),{type:PropTypes.oneOf(["amount"])}),defaultProps:{format:"formatted",type:"amount"}},SkuList:{permittedChildren:["AddToCartButton","QuantitySelector","ReactNode"],displayName:"SkuList",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuListsContainer:{permittedChildren:["SkuList","ReactNode"],displayName:"SkuListsContainer",propTypes:{children:childrenTypes.isRequired}},SkuOption:{permittedChildren:["SkuOptionInput","ReactNode"],displayName:"SkuOption",propTypes:{children:childrenTypes.isRequired,id:PropTypes.string.isRequired}},SkuOptionInput:{displayName:"SkuOptionInput",propTypes:BaseInputComponentPropTypes},SkuOptionsContainer:{permittedChildren:["SkuOption","ReactNode"],displayName:"SkuOptionsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string}},StockTransfer:{permittedChildren:["StockTransferField","ReactNode"],displayName:"StockTransfer",propTypes:{children:childrenTypes.isRequired}},StockTransferField:{displayName:"StockTransferField",propTypes:{children:PropTypes.func,type:PropTypes.oneOf(["quantity","sku_code"]).isRequired}},SubmitButton:{displayName:"SubmitButton",propTypes:{children:PropTypes.func,label:PropTypes.oneOfType([PropTypes.string,PropTypes.element])},defaultProps:{label:"Submit"}},SubTotalAmount:{displayName:"SubTotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TaxesAmount:{displayName:"TaxesAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},TotalAmount:{displayName:"TotalAmount",propTypes:baseOrderComponentPricePropTypes,defaultProps:{format:"formatted"}},VariantsContainer:{permittedChildren:["VariantSelector","ReactNode"],displayName:"VariantsContainer",propTypes:{children:childrenTypes.isRequired,skuCode:PropTypes.string,filters:PropTypes.object},defaultProps:{skuCode:"",filters:{}}},VariantSelector:{displayName:"VariantSelector",propTypes:{options:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.string.isRequired,code:PropTypes.string.isRequired,lineItem:PropTypes.shape({name:PropTypes.string.isRequired,imageUrl:PropTypes.string})}).isRequired).isRequired,name:PropTypes.string,children:PropTypes.func,type:PropTypes.oneOf(["select","radio"]),loader:PropTypes.element,placeholder:PropTypes.string,skuCode:PropTypes.string},defaultProps:{placeholder:"Select a variant",type:"select"}}};export default components;
@@ -1 +1 @@
1
- import{createContext}from"react";const initial={address:{}};const AddressChildrenContext=createContext(initial);export default AddressChildrenContext;
1
+ import{createContext}from"react";const initial={address:{}},AddressChildrenContext=createContext(initial);export default AddressChildrenContext;
@@ -1 +1 @@
1
- import{createContext}from"react";import{setAddress}from"../reducers/AddressReducer";export const defaultAddressContext={saveAddresses:()=>{},setCloneAddress:()=>{},setAddress:setAddress,setAddressErrors:()=>{}};const AddressesContext=createContext(defaultAddressContext);export default AddressesContext;
1
+ import{createContext}from"react";import{setAddress}from"../reducers/AddressReducer";export const defaultAddressContext={saveAddresses:()=>{},setCloneAddress:()=>{},setAddress,setAddressErrors:()=>{}};const AddressesContext=createContext(defaultAddressContext);export default AddressesContext;
@@ -1 +1 @@
1
- import{createContext}from"react";const initial={accessToken:"",endpoint:""};const CommerceLayerContext=createContext(initial);export default CommerceLayerContext;
1
+ import{createContext}from"react";const initial={accessToken:"",endpoint:""},CommerceLayerContext=createContext(initial);export default CommerceLayerContext;
@@ -1 +1 @@
1
- import{setCustomerErrors,setCustomerEmail}from"../reducers/CustomerReducer";import{createContext}from"react";export const defaultCustomerContext={saveCustomerUser:async()=>{},getCustomerPaymentSources:async()=>{},setCustomerErrors:setCustomerErrors,setCustomerEmail:setCustomerEmail};const CustomerContext=createContext(defaultCustomerContext);export default CustomerContext;
1
+ import{setCustomerErrors,setCustomerEmail}from"../reducers/CustomerReducer";import{createContext}from"react";export const defaultCustomerContext={saveCustomerUser:async()=>{},getCustomerPaymentSources:async()=>{},setCustomerErrors,setCustomerEmail};const CustomerContext=createContext(defaultCustomerContext);export default CustomerContext;
@@ -1 +1 @@
1
- import{createContext}from"react";import axios from"axios";export const callExternalFunction=async({url:t,data:n})=>axios.post(t,n);const ExternalFunctionContext=createContext({url:null,callExternalFunction:callExternalFunction});export default ExternalFunctionContext;
1
+ import{createContext}from"react";import axios from"axios";export const callExternalFunction=async({url,data})=>axios.post(url,data);const ExternalFunctionContext=createContext({url:null,callExternalFunction});export default ExternalFunctionContext;
@@ -1 +1 @@
1
- import{createContext}from"react";const initial={};const LineItemChildrenContext=createContext(initial);export default LineItemChildrenContext;
1
+ import{createContext}from"react";const initial={},LineItemChildrenContext=createContext(initial);export default LineItemChildrenContext;