WooCommerce Gutenberg Products Block - Version 7.0.0

Version Description

  • 2022-02-14 =

Enhancements

  • Add a remove image button to the WooCommerce Feature Category block. (5719)
  • Add support for the global style for the On-Sale Badge block. (5565)
  • Add support for the global style for the Attribute Filter block. (5557)
  • Category List block: Add support for global style. (5516)

Bug Fixes

  • Fix wide appender buttons overlap in Cart & Checkout blocks in the Editor. (5801)
  • Fixed an issue where clear customizations functionality was not working for WooCommerce templates. (5746)
  • Fixed an issue where default block attributes were not being passed to the Checkout block correctly. (5732)
  • Fixed an issue where orders would break if they did not require a payment. (5720)
  • Fixed hover and focus states for button components. (5712)
  • Add to Cart button on Products listing blocks will respect the "Redirect to the cart page after successful addition" setting. (5708)
  • Fixes Twenty Twenty Two issues with sales price and added to cart "View Cart" call out styling in the "Products by Category" block. (5684)
Download this release

Release Info

Developer automattic
Plugin Icon 128x128 WooCommerce Gutenberg Products Block
Version 7.0.0
Comparing to
See all releases

Code changes from version 6.9.0 to 7.0.0

Files changed (289) hide show
  1. assets/css/editor.scss +4 -0
  2. assets/css/style.scss +16 -0
  3. assets/js/atomic/blocks/product-elements/add-to-cart/constants.js +3 -5
  4. assets/js/atomic/blocks/product-elements/add-to-cart/shared/add-to-cart-button.js +2 -7
  5. assets/js/atomic/blocks/product-elements/button/block.js +8 -0
  6. assets/js/atomic/blocks/product-elements/button/constants.js +2 -5
  7. assets/js/atomic/blocks/product-elements/category-list/block.tsx +11 -1
  8. assets/js/atomic/blocks/product-elements/category-list/constants.tsx +2 -5
  9. assets/js/atomic/blocks/product-elements/category-list/edit.tsx +5 -2
  10. assets/js/atomic/blocks/product-elements/category-list/index.ts +19 -1
  11. assets/js/atomic/blocks/product-elements/category-list/save.tsx +21 -0
  12. assets/js/atomic/blocks/product-elements/image/block.js +19 -8
  13. assets/js/atomic/blocks/product-elements/image/constants.js +2 -5
  14. assets/js/atomic/blocks/product-elements/image/edit.js +6 -3
  15. assets/js/atomic/blocks/product-elements/image/editor.scss +5 -0
  16. assets/js/atomic/blocks/product-elements/image/index.js +5 -0
  17. assets/js/atomic/blocks/product-elements/image/save.tsx +21 -0
  18. assets/js/atomic/blocks/product-elements/image/style.scss +3 -0
  19. assets/js/atomic/blocks/product-elements/image/supports.ts +15 -0
  20. assets/js/atomic/blocks/product-elements/image/test/block.test.js +11 -0
  21. assets/js/atomic/blocks/product-elements/price/constants.js +2 -2
  22. assets/js/atomic/blocks/product-elements/rating/constants.js +2 -2
  23. assets/js/atomic/blocks/product-elements/sale-badge/block.js +22 -2
  24. assets/js/atomic/blocks/product-elements/sale-badge/constants.js +2 -5
  25. assets/js/atomic/blocks/product-elements/sale-badge/edit.js +7 -1
  26. assets/js/atomic/blocks/product-elements/sale-badge/index.js +24 -0
  27. assets/js/atomic/blocks/product-elements/sale-badge/save.tsx +21 -0
  28. assets/js/atomic/blocks/product-elements/sale-badge/style.scss +6 -0
  29. assets/js/atomic/blocks/product-elements/shared/config.tsx +2 -2
  30. assets/js/atomic/blocks/product-elements/sku/constants.js +3 -5
  31. assets/js/atomic/blocks/product-elements/stock-indicator/constants.js +2 -5
  32. assets/js/atomic/blocks/product-elements/summary/constants.js +2 -5
  33. assets/js/atomic/blocks/product-elements/tag-list/block.js +10 -1
  34. assets/js/atomic/blocks/product-elements/tag-list/constants.js +2 -5
  35. assets/js/atomic/blocks/product-elements/tag-list/edit.js +4 -2
  36. assets/js/atomic/blocks/product-elements/tag-list/index.js +5 -0
  37. assets/js/atomic/blocks/product-elements/tag-list/save.tsx +21 -0
  38. assets/js/atomic/blocks/product-elements/tag-list/supports.js +17 -0
  39. assets/js/atomic/blocks/product-elements/title/constants.tsx +2 -5
  40. assets/js/atomic/utils/{get-block-map.js → get-block-map.ts} +4 -1
  41. assets/js/base/components/button/index.tsx +30 -2
  42. assets/js/base/components/button/stories/index.js +0 -11
  43. assets/js/base/components/button/stories/index.tsx +49 -0
  44. assets/js/base/components/button/style.scss +50 -8
  45. assets/js/base/components/cart-checkout/payment-method-label/index.tsx +8 -2
  46. assets/js/base/components/cart-checkout/place-order-button/index.tsx +2 -10
  47. assets/js/base/components/cart-checkout/return-to-cart-button/index.tsx +2 -2
  48. assets/js/base/components/cart-checkout/shipping-rates-control-package/index.tsx +8 -7
  49. assets/js/base/components/cart-checkout/shipping-rates-control-package/package-rates.tsx +22 -9
  50. assets/js/base/components/chip/removable-chip.tsx +2 -2
  51. assets/js/base/components/chip/test/__snapshots__/index.js.snap +12 -12
  52. assets/js/base/components/dropdown-selector/index.js +3 -0
  53. assets/js/base/components/dropdown-selector/selected-value.js +2 -2
  54. assets/js/base/components/filter-element-label/{index.js → index.tsx} +9 -2
  55. assets/js/base/components/filter-submit-button/{index.js → index.tsx} +9 -20
  56. assets/js/base/components/form/{index.js → index.tsx} +9 -9
  57. assets/js/base/components/load-more-button/{index.js → index.tsx} +12 -12
  58. assets/js/base/components/loading-mask/{index.js → index.tsx} +8 -9
  59. assets/js/base/components/pagination/{index.js → index.tsx} +42 -47
  60. assets/js/base/components/pagination/test/index.js +1 -1
  61. assets/js/base/components/pagination/{utils.js → utils.ts} +9 -1
  62. assets/js/base/components/product-list/{container.js → container.tsx} +8 -4
  63. assets/js/base/components/product-list/{index.js → index.ts} +0 -0
  64. assets/js/base/components/product-list/{no-matching-products.js → no-matching-products.tsx} +10 -4
  65. assets/js/base/components/product-list/{no-products.js → no-products.tsx} +3 -4
  66. assets/js/base/components/product-list/product-list-item/{index.js → index.tsx} +6 -9
  67. assets/js/base/components/product-list/product-list-item/{utils.js → utils.tsx} +17 -8
  68. assets/js/base/components/product-list/{product-list.js → product-list.tsx} +44 -38
  69. assets/js/base/components/product-list/product-sort-select/{index.js → index.tsx} +5 -18
  70. assets/js/base/components/product-list/types.ts +98 -0
  71. assets/js/base/components/radio-control/index.js +0 -52
  72. assets/js/base/components/radio-control/index.tsx +55 -0
  73. assets/js/base/components/radio-control/option-layout.tsx +3 -4
  74. assets/js/base/components/radio-control/{option.js → option.tsx} +9 -2
  75. assets/js/base/components/radio-control/types.ts +40 -0
  76. assets/js/base/components/sort-select/{index.js → index.tsx} +43 -36
  77. assets/js/base/context/hooks/collections/{use-collection-header.js → use-collection-header.ts} +13 -1
  78. assets/js/base/context/hooks/collections/{use-collection.js → use-collection.ts} +28 -4
  79. assets/js/base/context/hooks/shipping/index.js +0 -1
  80. assets/js/base/context/hooks/shipping/use-select-shipping-rate.ts +43 -54
  81. assets/js/base/context/hooks/shipping/use-select-shipping-rates.ts +0 -55
  82. assets/js/base/context/hooks/{use-store-products.js → use-store-products.ts} +13 -3
  83. assets/js/base/context/providers/add-to-cart-form/form/submit/index.js +2 -0
  84. assets/js/base/context/providers/cart-checkout/shipping/index.js +2 -2
  85. assets/js/blocks-registry/block-components/{get-registered-block-components.js → get-registered-block-components.ts} +7 -2
  86. assets/js/blocks-registry/block-components/registered-block-components-init.js +0 -3
  87. assets/js/blocks-registry/block-components/registered-block-components-init.ts +11 -0
  88. assets/js/blocks/active-filters/index.js +3 -2
  89. assets/js/blocks/attribute-filter/block.js +9 -1
  90. assets/js/blocks/attribute-filter/edit.js +13 -7
  91. assets/js/blocks/attribute-filter/editor.scss +13 -0
  92. assets/js/blocks/attribute-filter/index.js +19 -3
  93. assets/js/blocks/attribute-filter/style.scss +14 -0
  94. assets/js/blocks/cart-checkout/cart/edit.js +4 -3
  95. assets/js/blocks/cart-checkout/cart/editor.scss +9 -0
  96. assets/js/blocks/cart-checkout/cart/index.js +3 -2
  97. assets/js/blocks/cart-checkout/cart/inner-blocks/cart-accepted-payment-methods-block/index.tsx +2 -2
  98. assets/js/blocks/cart-checkout/cart/inner-blocks/cart-express-payment-block/edit.tsx +2 -2
  99. assets/js/blocks/cart-checkout/cart/inner-blocks/cart-express-payment-block/index.tsx +2 -2
  100. assets/js/blocks/cart-checkout/cart/inner-blocks/cart-order-summary-block/index.tsx +3 -2
  101. assets/js/blocks/cart-checkout/cart/inner-blocks/empty-cart-block/index.tsx +3 -2
  102. assets/js/blocks/cart-checkout/cart/inner-blocks/filled-cart-block/index.tsx +3 -2
  103. assets/js/blocks/cart-checkout/mini-cart-contents/edit.tsx +4 -3
  104. assets/js/blocks/cart-checkout/mini-cart-contents/editor.scss +25 -0
  105. assets/js/blocks/cart-checkout/mini-cart-contents/index.tsx +3 -2
  106. assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/block.tsx +0 -5
  107. assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/frontend.tsx +18 -1
  108. assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/index.tsx +3 -2
  109. assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/index.tsx +3 -2
  110. assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/mini-cart-footer-block/block.tsx +1 -0
  111. assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/mini-cart-footer-block/index.tsx +2 -2
  112. assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/mini-cart-items-block/index.tsx +2 -2
  113. assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/mini-cart-products-table-block/block.json +1 -1
  114. assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/mini-cart-products-table-block/index.tsx +2 -5
  115. assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/mini-cart-title-block/index.tsx +2 -2
  116. assets/js/blocks/cart-checkout/mini-cart/block.tsx +2 -5
  117. assets/js/blocks/cart-checkout/mini-cart/index.tsx +3 -2
  118. assets/js/blocks/cart-checkout/mini-cart/quantity-badge/index.tsx +3 -2
  119. assets/js/blocks/cart-checkout/mini-cart/style.scss +6 -4
  120. assets/js/blocks/cart-checkout/payment-methods/no-payment-methods/index.js +2 -2
  121. assets/js/blocks/cart-checkout/shared/use-view-switcher.tsx +3 -4
  122. assets/js/blocks/checkout/checkout-order-error/index.js +3 -3
  123. assets/js/blocks/checkout/empty-cart/index.js +3 -3
  124. assets/js/blocks/checkout/frontend.tsx +2 -1
  125. assets/js/blocks/checkout/index.tsx +3 -2
  126. assets/js/blocks/checkout/inner-blocks/checkout-billing-address-block/index.tsx +2 -2
  127. assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/index.tsx +2 -2
  128. assets/js/blocks/checkout/inner-blocks/checkout-express-payment-block/edit.tsx +2 -2
  129. assets/js/blocks/checkout/inner-blocks/checkout-express-payment-block/index.tsx +2 -2
  130. assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/index.tsx +2 -2
  131. assets/js/blocks/checkout/inner-blocks/checkout-order-summary-block/index.tsx +3 -2
  132. assets/js/blocks/checkout/inner-blocks/checkout-payment-block/index.tsx +2 -2
  133. assets/js/blocks/checkout/inner-blocks/checkout-shipping-address-block/index.tsx +2 -2
  134. assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/index.tsx +2 -2
  135. assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/no-shipping-placeholder/index.js +2 -2
  136. assets/js/blocks/checkout/inner-blocks/checkout-terms-block/index.tsx +2 -2
  137. assets/js/blocks/checkout/styles/editor.scss +6 -0
  138. assets/js/blocks/featured-category/block.js +36 -20
  139. assets/js/blocks/featured-category/index.js +3 -2
  140. assets/js/blocks/featured-category/style.scss +2 -1
  141. assets/js/blocks/featured-product/block.js +14 -36
  142. assets/js/blocks/featured-product/edit.tsx +20 -0
  143. assets/js/blocks/featured-product/editor.scss +2 -0
  144. assets/js/blocks/featured-product/index.js +15 -7
  145. assets/js/blocks/featured-product/style.scss +9 -3
  146. assets/js/blocks/handpicked-products/block.js +2 -2
  147. assets/js/blocks/handpicked-products/index.js +2 -2
  148. assets/js/blocks/price-filter/edit.js +3 -3
  149. assets/js/blocks/price-filter/index.js +2 -2
  150. assets/js/blocks/product-best-sellers/index.js +2 -2
  151. assets/js/blocks/product-categories/block.js +2 -2
  152. assets/js/blocks/product-categories/index.js +2 -2
  153. assets/js/blocks/product-category/block.js +3 -3
  154. assets/js/blocks/product-category/index.js +2 -2
  155. assets/js/blocks/product-new/index.js +3 -3
  156. assets/js/blocks/product-on-sale/block.js +2 -2
  157. assets/js/blocks/product-on-sale/index.js +2 -2
  158. assets/js/blocks/product-search/index.js +2 -2
  159. assets/js/blocks/product-tag/block.js +4 -7
  160. assets/js/blocks/product-tag/index.js +2 -2
  161. assets/js/blocks/product-top-rated/index.js +3 -2
  162. assets/js/blocks/products-by-attribute/block.js +2 -2
  163. assets/js/blocks/products-by-attribute/index.js +2 -2
  164. assets/js/blocks/products/all-products/edit.js +3 -3
  165. assets/js/blocks/products/all-products/index.js +2 -2
  166. assets/js/blocks/products/edit-utils.js +2 -2
  167. assets/js/blocks/reviews/all-reviews/edit.js +2 -2
  168. assets/js/blocks/reviews/all-reviews/index.js +2 -2
  169. assets/js/blocks/reviews/all-reviews/no-reviews-placeholder.js +2 -2
  170. assets/js/blocks/reviews/reviews-by-category/edit.js +3 -3
  171. assets/js/blocks/reviews/reviews-by-category/index.js +2 -2
  172. assets/js/blocks/reviews/reviews-by-category/no-reviews-placeholder.js +2 -2
  173. assets/js/blocks/reviews/reviews-by-product/edit.js +3 -3
  174. assets/js/blocks/reviews/reviews-by-product/index.js +2 -2
  175. assets/js/blocks/reviews/reviews-by-product/no-reviews-placeholder.js +2 -2
  176. assets/js/blocks/single-product/constants.js +2 -2
  177. assets/js/blocks/single-product/edit/layout-editor.js +2 -2
  178. assets/js/blocks/stock-filter/index.js +2 -2
  179. assets/js/editor-components/edit-product-link/index.js +2 -2
  180. assets/js/editor-components/error-placeholder/index.tsx +2 -2
  181. assets/js/editor-components/feedback-prompt/index.js +3 -3
  182. assets/js/editor-components/heading-toolbar/heading-level-icon.js +1 -1
  183. assets/js/icons/icon/index.tsx +0 -29
  184. assets/js/icons/index.js +0 -44
  185. assets/js/icons/library/address.tsx +0 -16
  186. assets/js/icons/library/arrow-back.tsx +0 -18
  187. assets/js/icons/library/arrow-down-alt2.tsx +0 -23
  188. assets/js/icons/library/asterisk.tsx +0 -15
  189. assets/js/icons/library/atom.tsx +0 -12
  190. assets/js/icons/library/bank.tsx +0 -13
  191. assets/js/icons/library/barcode.tsx +1 -1
  192. assets/js/icons/library/bill.tsx +0 -13
  193. assets/js/icons/library/bookmark.tsx +0 -13
  194. assets/js/icons/library/box.tsx +0 -18
  195. assets/js/icons/library/card.tsx +0 -16
  196. assets/js/icons/library/cart.tsx +1 -1
  197. assets/js/icons/library/check-payment.tsx +1 -1
  198. assets/js/icons/library/chevron-down.tsx +0 -12
  199. assets/js/icons/library/chevron-right.tsx +0 -12
  200. assets/js/icons/library/chevron-up.tsx +0 -12
  201. assets/js/icons/library/comment.tsx +0 -13
  202. assets/js/icons/library/contact.tsx +0 -22
  203. assets/js/icons/library/discussion.tsx +0 -13
  204. assets/js/icons/library/done.tsx +0 -13
  205. assets/js/icons/library/exclamation.tsx +0 -13
  206. assets/js/icons/library/external.tsx +0 -27
  207. assets/js/icons/library/eye.tsx +1 -1
  208. assets/js/icons/library/fields.tsx +1 -1
  209. assets/js/icons/library/filled-cart.tsx +1 -1
  210. assets/js/icons/library/folder-starred.tsx +1 -1
  211. assets/js/icons/library/folder.tsx +0 -13
  212. assets/js/icons/library/form-step.tsx +0 -15
  213. assets/js/icons/library/grid.tsx +0 -13
  214. assets/js/icons/library/heading.tsx +0 -12
  215. assets/js/icons/library/image.tsx +0 -13
  216. assets/js/icons/library/list.tsx +0 -13
  217. assets/js/icons/library/mini-cart.tsx +1 -1
  218. assets/js/icons/library/more.tsx +0 -16
  219. assets/js/icons/library/no-alt.tsx +0 -23
  220. assets/js/icons/library/notes.tsx +0 -22
  221. assets/js/icons/library/notice.tsx +0 -12
  222. assets/js/icons/library/radio-selected.tsx +0 -15
  223. assets/js/icons/library/radio-unselected.tsx +0 -15
  224. assets/js/icons/library/reader.tsx +0 -13
  225. assets/js/icons/library/remove-cart.tsx +1 -1
  226. assets/js/icons/library/restore.tsx +0 -13
  227. assets/js/icons/library/review.tsx +0 -13
  228. assets/js/icons/library/search.tsx +0 -13
  229. assets/js/icons/library/server.tsx +0 -13
  230. assets/js/icons/library/star.tsx +0 -13
  231. assets/js/icons/library/stonks.tsx +0 -13
  232. assets/js/icons/library/tag.tsx +0 -15
  233. assets/js/icons/library/tags.tsx +0 -15
  234. assets/js/icons/library/thumb-up.tsx +1 -1
  235. assets/js/icons/library/toggle.tsx +1 -1
  236. assets/js/icons/library/totals.tsx +1 -1
  237. assets/js/icons/library/truck.tsx +0 -16
  238. assets/js/icons/library/widgets.tsx +0 -13
  239. assets/js/icons/library/woo.tsx +1 -1
  240. assets/js/icons/stories/index.tsx +7 -31
  241. assets/js/index.js +4 -3
  242. assets/js/previews/products.js +8 -0
  243. assets/js/types/type-defs/blocks.ts +9 -0
  244. assets/js/types/type-defs/hooks.ts +8 -0
  245. assets/js/types/type-defs/index.ts +2 -0
  246. assets/js/types/type-defs/utils.ts +4 -0
  247. assets/js/types/type-guards/index.ts +4 -0
  248. build/active-filters-frontend.asset.php +1 -1
  249. build/active-filters-frontend.js +6 -6
  250. build/active-filters.asset.php +1 -1
  251. build/active-filters.js +8 -8
  252. build/all-products-frontend.asset.php +1 -1
  253. build/all-products-frontend.js +6 -6
  254. build/all-products.asset.php +1 -1
  255. build/all-products.js +16 -16
  256. build/all-reviews.asset.php +1 -1
  257. build/all-reviews.js +3 -3
  258. build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/catego--ce653f6d.js +1 -0
  259. build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---8f355022.js +0 -1
  260. build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js +2 -2
  261. build/atomic-block-components/add-to-cart--atomic-block-components/button.js +1 -1
  262. build/atomic-block-components/add-to-cart-frontend.js +2 -2
  263. build/atomic-block-components/add-to-cart.js +2 -2
  264. build/atomic-block-components/button-frontend.js +2 -2
  265. build/atomic-block-components/button.js +2 -2
  266. build/atomic-block-components/category-list--atomic-block-components/image--atomic-block-components/sale---5e68150f.js +1 -0
  267. build/atomic-block-components/category-list-frontend.js +1 -1
  268. build/atomic-block-components/category-list.js +1 -1
  269. build/atomic-block-components/image-frontend.js +2 -2
  270. build/atomic-block-components/image.js +2 -2
  271. build/atomic-block-components/price-frontend.js +2 -2
  272. build/atomic-block-components/price.js +2 -2
  273. build/atomic-block-components/rating-frontend.js +1 -1
  274. build/atomic-block-components/rating.js +1 -1
  275. build/atomic-block-components/sale-badge-frontend.js +1 -1
  276. build/atomic-block-components/sale-badge.js +1 -1
  277. build/atomic-block-components/sku-frontend.js +1 -1
  278. build/atomic-block-components/sku.js +1 -1
  279. build/atomic-block-components/stock-indicator--atomic-block-components/summary--atomic-block-components/title.js +0 -1
  280. build/atomic-block-components/stock-indicator-frontend.js +2 -2
  281. build/atomic-block-components/stock-indicator.js +1 -1
  282. build/atomic-block-components/summary-frontend.js +1 -1
  283. build/atomic-block-components/summary.js +1 -1
  284. build/atomic-block-components/tag-list-frontend.js +1 -1
  285. build/atomic-block-components/tag-list.js +1 -1
  286. build/atomic-block-components/title-frontend.js +1 -1
  287. build/atomic-block-components/title.js +1 -1
  288. build/attribute-filter-frontend.asset.php +1 -1
  289. build/attribute-filter-frontend.js +3 -3
assets/css/editor.scss CHANGED
@@ -49,6 +49,10 @@ svg.wc-block-editor-components-block-icon {
49
  color: $studio-woocommerce-purple-50;
50
  }
51
 
 
 
 
 
52
  .block-editor-list-view-leaf.is-selected {
53
  .block-editor-list-view-block-contents {
54
  svg.wc-block-editor-components-block-icon {
49
  color: $studio-woocommerce-purple-50;
50
  }
51
 
52
+ svg.wc-block-editor-components-block-icon--sparkles path {
53
+ fill: currentColor;
54
+ }
55
+
56
  .block-editor-list-view-leaf.is-selected {
57
  .block-editor-list-view-block-contents {
58
  svg.wc-block-editor-components-block-icon {
assets/css/style.scss CHANGED
@@ -321,6 +321,22 @@
321
  }
322
  }
323
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  // Default screen-reader styles. Included as a fallback for themes that don't have support.
325
  .screen-reader-text {
326
  @include visually-hidden();
321
  }
322
  }
323
 
324
+ .theme-twentytwentytwo {
325
+ .wc-block-grid__product-add-to-cart {
326
+ .added_to_cart {
327
+ margin-top: $gap-small;
328
+ display: block;
329
+ }
330
+ }
331
+
332
+ .wc-block-components-product-price,
333
+ .wc-block-grid__product-price {
334
+ ins {
335
+ text-decoration: none;
336
+ }
337
+ }
338
+ }
339
+
340
  // Default screen-reader styles. Included as a fallback for themes that don't have support.
341
  .screen-reader-text {
342
  @include visually-hidden();
assets/js/atomic/blocks/product-elements/add-to-cart/constants.js CHANGED
@@ -2,14 +2,12 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { cart, Icon } from '@woocommerce/icons';
 
6
 
7
  export const BLOCK_TITLE = __( 'Add to Cart', 'woo-gutenberg-products-block' );
8
  export const BLOCK_ICON = (
9
- <Icon
10
- srcElement={ cart }
11
- className="wc-block-editor-components-block-icon"
12
- />
13
  );
14
  export const BLOCK_DESCRIPTION = __(
15
  'Displays an add to cart button. Optionally displays other add to cart form elements.',
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { cart } from '@woocommerce/icons';
6
+ import { Icon } from '@wordpress/icons';
7
 
8
  export const BLOCK_TITLE = __( 'Add to Cart', 'woo-gutenberg-products-block' );
9
  export const BLOCK_ICON = (
10
+ <Icon icon={ cart } className="wc-block-editor-components-block-icon" />
 
 
 
11
  );
12
  export const BLOCK_DESCRIPTION = __(
13
  'Displays an add to cart button. Optionally displays other add to cart form elements.',
assets/js/atomic/blocks/product-elements/add-to-cart/shared/add-to-cart-button.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
5
  import Button from '@woocommerce/base-components/button';
6
- import { Icon, done as doneIcon } from '@woocommerce/icons';
7
  import { useState, useEffect } from '@wordpress/element';
8
  import { useAddToCartFormContext } from '@woocommerce/base-context';
9
  import {
@@ -161,12 +161,7 @@ const ButtonComponent = ( {
161
  quantityInCart
162
  )
163
  : __( 'Add to cart', 'woo-gutenberg-products-block' ) }
164
- { !! isDone && (
165
- <Icon
166
- srcElement={ doneIcon }
167
- alt={ __( 'Done', 'woo-gutenberg-products-block' ) }
168
- />
169
- ) }
170
  </Button>
171
  );
172
  };
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
5
  import Button from '@woocommerce/base-components/button';
6
+ import { Icon, check } from '@wordpress/icons';
7
  import { useState, useEffect } from '@wordpress/element';
8
  import { useAddToCartFormContext } from '@woocommerce/base-context';
9
  import {
161
  quantityInCart
162
  )
163
  : __( 'Add to cart', 'woo-gutenberg-products-block' ) }
164
+ { !! isDone && <Icon icon={ check } /> }
 
 
 
 
 
165
  </Button>
166
  );
167
  };
assets/js/atomic/blocks/product-elements/button/block.js CHANGED
@@ -9,6 +9,8 @@ import {
9
  useStoreAddToCart,
10
  } from '@woocommerce/base-context/hooks';
11
  import { decodeEntities } from '@wordpress/html-entities';
 
 
12
  import {
13
  useInnerBlockLayoutContext,
14
  useProductDataContext,
@@ -101,6 +103,12 @@ const AddToCartButton = ( { product } ) => {
101
  dispatchStoreEvent( 'cart-add-item', {
102
  product,
103
  } );
 
 
 
 
 
 
104
  };
105
  }
106
 
9
  useStoreAddToCart,
10
  } from '@woocommerce/base-context/hooks';
11
  import { decodeEntities } from '@wordpress/html-entities';
12
+ import { CART_URL } from '@woocommerce/block-settings';
13
+ import { getSetting } from '@woocommerce/settings';
14
  import {
15
  useInnerBlockLayoutContext,
16
  useProductDataContext,
103
  dispatchStoreEvent( 'cart-add-item', {
104
  product,
105
  } );
106
+ // redirect to cart if the setting to redirect to the cart page
107
+ // on cart add item is enabled
108
+ const { cartRedirectAfterAdd } = getSetting( 'productsSettings' );
109
+ if ( cartRedirectAfterAdd ) {
110
+ window.location.href = CART_URL;
111
+ }
112
  };
113
  }
114
 
assets/js/atomic/blocks/product-elements/button/constants.js CHANGED
@@ -2,17 +2,14 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { cart, Icon } from '@woocommerce/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Add to Cart Button',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON = (
12
- <Icon
13
- srcElement={ cart }
14
- className="wc-block-editor-components-block-icon"
15
- />
16
  );
17
  export const BLOCK_DESCRIPTION = __(
18
  'Display a call to action button which either adds the product to the cart, or links to the product page.',
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { Icon, button } from '@wordpress/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Add to Cart Button',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON = (
12
+ <Icon icon={ button } className="wc-block-editor-components-block-icon" />
 
 
 
13
  );
14
  export const BLOCK_DESCRIPTION = __(
15
  'Display a call to action button which either adds the product to the cart, or links to the product page.',
assets/js/atomic/blocks/product-elements/category-list/block.tsx CHANGED
@@ -16,6 +16,10 @@ import { HTMLAttributes } from 'react';
16
  */
17
  import './style.scss';
18
  import { Attributes } from './types';
 
 
 
 
19
 
20
  type Props = Attributes & HTMLAttributes< HTMLDivElement >;
21
 
@@ -26,10 +30,14 @@ type Props = Attributes & HTMLAttributes< HTMLDivElement >;
26
  * @param {string} [props.className] CSS Class name for the component.
27
  * @return {*} The component.
28
  */
29
- const Block = ( { className }: Props ): JSX.Element | null => {
 
30
  const { parentClassName } = useInnerBlockLayoutContext();
31
  const { product } = useProductDataContext();
32
 
 
 
 
33
  if ( isEmpty( product.categories ) ) {
34
  return null;
35
  }
@@ -39,10 +47,12 @@ const Block = ( { className }: Props ): JSX.Element | null => {
39
  className={ classnames(
40
  className,
41
  'wc-block-components-product-category-list',
 
42
  {
43
  [ `${ parentClassName }__product-category-list` ]: parentClassName,
44
  }
45
  ) }
 
46
  >
47
  { __( 'Categories:', 'woo-gutenberg-products-block' ) }{ ' ' }
48
  <ul>
16
  */
17
  import './style.scss';
18
  import { Attributes } from './types';
19
+ import {
20
+ useColorProps,
21
+ useTypographyProps,
22
+ } from '../../../../hooks/style-attributes';
23
 
24
  type Props = Attributes & HTMLAttributes< HTMLDivElement >;
25
 
30
  * @param {string} [props.className] CSS Class name for the component.
31
  * @return {*} The component.
32
  */
33
+ const Block = ( props: Props ): JSX.Element | null => {
34
+ const { className } = props;
35
  const { parentClassName } = useInnerBlockLayoutContext();
36
  const { product } = useProductDataContext();
37
 
38
+ const colorProps = useColorProps( props );
39
+ const typographyProps = useTypographyProps( props );
40
+
41
  if ( isEmpty( product.categories ) ) {
42
  return null;
43
  }
47
  className={ classnames(
48
  className,
49
  'wc-block-components-product-category-list',
50
+ colorProps.className,
51
  {
52
  [ `${ parentClassName }__product-category-list` ]: parentClassName,
53
  }
54
  ) }
55
+ style={ { ...colorProps.style, ...typographyProps.style } }
56
  >
57
  { __( 'Categories:', 'woo-gutenberg-products-block' ) }{ ' ' }
58
  <ul>
assets/js/atomic/blocks/product-elements/category-list/constants.tsx CHANGED
@@ -2,17 +2,14 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { folder, Icon } from '@woocommerce/icons';
6
 
7
  export const BLOCK_TITLE: string = __(
8
  'Product Category List',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON: JSX.Element = (
12
- <Icon
13
- srcElement={ folder }
14
- className="wc-block-editor-components-block-icon"
15
- />
16
  );
17
  export const BLOCK_DESCRIPTION: string = __(
18
  'Display a list of categories belonging to a product.',
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { archive, Icon } from '@wordpress/icons';
6
 
7
  export const BLOCK_TITLE: string = __(
8
  'Product Category List',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON: JSX.Element = (
12
+ <Icon icon={ archive } className="wc-block-editor-components-block-icon" />
 
 
 
13
  );
14
  export const BLOCK_DESCRIPTION: string = __(
15
  'Display a list of categories belonging to a product.',
assets/js/atomic/blocks/product-elements/category-list/edit.tsx CHANGED
@@ -4,6 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { Disabled } from '@wordpress/components';
6
  import EditProductLink from '@woocommerce/editor-components/edit-product-link';
 
7
 
8
  /**
9
  * Internal dependencies
@@ -18,13 +19,15 @@ interface Props {
18
  }
19
 
20
  const Edit = ( { attributes }: Props ): JSX.Element => {
 
 
21
  return (
22
- <>
23
  <EditProductLink />
24
  <Disabled>
25
  <Block { ...attributes } />
26
  </Disabled>
27
- </>
28
  );
29
  };
30
 
4
  import { __ } from '@wordpress/i18n';
5
  import { Disabled } from '@wordpress/components';
6
  import EditProductLink from '@woocommerce/editor-components/edit-product-link';
7
+ import { useBlockProps } from '@wordpress/block-editor';
8
 
9
  /**
10
  * Internal dependencies
19
  }
20
 
21
  const Edit = ( { attributes }: Props ): JSX.Element => {
22
+ const blockProps = useBlockProps();
23
+
24
  return (
25
+ <div { ...blockProps }>
26
  <EditProductLink />
27
  <Disabled>
28
  <Block { ...attributes } />
29
  </Disabled>
30
+ </div>
31
  );
32
  };
33
 
assets/js/atomic/blocks/product-elements/category-list/index.ts CHANGED
@@ -1,7 +1,10 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { registerExperimentalBlockType } from '@woocommerce/block-settings';
 
 
 
5
  import { BlockConfiguration } from '@wordpress/blocks';
6
 
7
  /**
@@ -15,13 +18,28 @@ import {
15
  BLOCK_ICON as icon,
16
  BLOCK_DESCRIPTION as description,
17
  } from './constants';
 
18
 
19
  const blockConfig: BlockConfiguration = {
20
  ...sharedConfig,
 
21
  title,
22
  description,
23
  icon: { src: icon },
24
  attributes,
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  edit,
26
  };
27
 
1
  /**
2
  * External dependencies
3
  */
4
+ import {
5
+ isFeaturePluginBuild,
6
+ registerExperimentalBlockType,
7
+ } from '@woocommerce/block-settings';
8
  import { BlockConfiguration } from '@wordpress/blocks';
9
 
10
  /**
18
  BLOCK_ICON as icon,
19
  BLOCK_DESCRIPTION as description,
20
  } from './constants';
21
+ import { Save } from './save';
22
 
23
  const blockConfig: BlockConfiguration = {
24
  ...sharedConfig,
25
+ apiVersion: 2,
26
  title,
27
  description,
28
  icon: { src: icon },
29
  attributes,
30
+ supports: {
31
+ ...( isFeaturePluginBuild() && {
32
+ color: {
33
+ text: true,
34
+ link: true,
35
+ background: false,
36
+ },
37
+ } ),
38
+ typography: {
39
+ fontSize: true,
40
+ },
41
+ },
42
+ save: Save,
43
  edit,
44
  };
45
 
assets/js/atomic/blocks/product-elements/category-list/save.tsx ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import classnames from 'classnames';
5
+ import { useBlockProps } from '@wordpress/block-editor';
6
+
7
+ type Props = {
8
+ attributes: Record< string, unknown > & {
9
+ className: string;
10
+ };
11
+ };
12
+
13
+ export const Save = ( { attributes }: Props ): JSX.Element => {
14
+ return (
15
+ <div
16
+ { ...useBlockProps.save( {
17
+ className: classnames( 'is-loading', attributes.className ),
18
+ } ) }
19
+ />
20
+ );
21
+ };
assets/js/atomic/blocks/product-elements/image/block.js CHANGED
@@ -18,6 +18,10 @@ import { useStoreEvents } from '@woocommerce/base-context/hooks';
18
  */
19
  import ProductSaleBadge from './../sale-badge/block';
20
  import './style.scss';
 
 
 
 
21
 
22
  /**
23
  * Product Image Block Component.
@@ -30,18 +34,23 @@ import './style.scss';
30
  * @param {string} [props.saleBadgeAlign] How should the sale badge be aligned if displayed.
31
  * @return {*} The component.
32
  */
33
- export const Block = ( {
34
- className,
35
- imageSizing = 'full-size',
36
- showProductLink = true,
37
- showSaleBadge,
38
- saleBadgeAlign = 'right',
39
- } ) => {
 
 
40
  const { parentClassName } = useInnerBlockLayoutContext();
41
  const { product } = useProductDataContext();
42
  const [ imageLoaded, setImageLoaded ] = useState( false );
43
  const { dispatchStoreEvent } = useStoreEvents();
44
 
 
 
 
45
  if ( ! product.id ) {
46
  return (
47
  <div
@@ -84,8 +93,10 @@ export const Block = ( {
84
  'wc-block-components-product-image',
85
  {
86
  [ `${ parentClassName }__product-image` ]: parentClassName,
87
- }
 
88
  ) }
 
89
  >
90
  <ParentComponent { ...( showProductLink && anchorProps ) }>
91
  { !! showSaleBadge && (
18
  */
19
  import ProductSaleBadge from './../sale-badge/block';
20
  import './style.scss';
21
+ import {
22
+ useBorderProps,
23
+ useTypographyProps,
24
+ } from '../../../../hooks/style-attributes';
25
 
26
  /**
27
  * Product Image Block Component.
34
  * @param {string} [props.saleBadgeAlign] How should the sale badge be aligned if displayed.
35
  * @return {*} The component.
36
  */
37
+ export const Block = ( props ) => {
38
+ const {
39
+ className,
40
+ imageSizing = 'full-size',
41
+ showProductLink = true,
42
+ showSaleBadge,
43
+ saleBadgeAlign = 'right',
44
+ } = props;
45
+
46
  const { parentClassName } = useInnerBlockLayoutContext();
47
  const { product } = useProductDataContext();
48
  const [ imageLoaded, setImageLoaded ] = useState( false );
49
  const { dispatchStoreEvent } = useStoreEvents();
50
 
51
+ const typographyProps = useTypographyProps( props );
52
+ const borderProps = useBorderProps( props );
53
+
54
  if ( ! product.id ) {
55
  return (
56
  <div
93
  'wc-block-components-product-image',
94
  {
95
  [ `${ parentClassName }__product-image` ]: parentClassName,
96
+ },
97
+ borderProps.className
98
  ) }
99
+ style={ { ...typographyProps.style, ...borderProps.style } }
100
  >
101
  <ParentComponent { ...( showProductLink && anchorProps ) }>
102
  { !! showSaleBadge && (
assets/js/atomic/blocks/product-elements/image/constants.js CHANGED
@@ -2,17 +2,14 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { image, Icon } from '@woocommerce/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Product Image',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON = (
12
- <Icon
13
- srcElement={ image }
14
- className="wc-block-editor-components-block-icon"
15
- />
16
  );
17
  export const BLOCK_DESCRIPTION = __(
18
  'Display the main product image',
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { image, Icon } from '@wordpress/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Product Image',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON = (
12
+ <Icon icon={ image } className="wc-block-editor-components-block-icon" />
 
 
 
13
  );
14
  export const BLOCK_DESCRIPTION = __(
15
  'Display the main product image',
assets/js/atomic/blocks/product-elements/image/edit.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { Disabled, PanelBody, ToggleControl } from '@wordpress/components';
6
- import { InspectorControls } from '@wordpress/block-editor';
7
  import { createInterpolateElement } from '@wordpress/element';
8
  import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';
9
  import { getAdminLink } from '@woocommerce/settings';
@@ -14,6 +14,7 @@ import { getAdminLink } from '@woocommerce/settings';
14
  import Block from './block';
15
  import withProductSelector from '../shared/with-product-selector';
16
  import { BLOCK_TITLE, BLOCK_ICON } from './constants';
 
17
 
18
  const Edit = ( { attributes, setAttributes } ) => {
19
  const {
@@ -23,8 +24,10 @@ const Edit = ( { attributes, setAttributes } ) => {
23
  saleBadgeAlign,
24
  } = attributes;
25
 
 
 
26
  return (
27
- <>
28
  <InspectorControls>
29
  <PanelBody
30
  title={ __( 'Content', 'woo-gutenberg-products-block' ) }
@@ -145,7 +148,7 @@ const Edit = ( { attributes, setAttributes } ) => {
145
  <Disabled>
146
  <Block { ...attributes } />
147
  </Disabled>
148
- </>
149
  );
150
  };
151
 
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { Disabled, PanelBody, ToggleControl } from '@wordpress/components';
6
+ import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
7
  import { createInterpolateElement } from '@wordpress/element';
8
  import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';
9
  import { getAdminLink } from '@woocommerce/settings';
14
  import Block from './block';
15
  import withProductSelector from '../shared/with-product-selector';
16
  import { BLOCK_TITLE, BLOCK_ICON } from './constants';
17
+ import './editor.scss';
18
 
19
  const Edit = ( { attributes, setAttributes } ) => {
20
  const {
24
  saleBadgeAlign,
25
  } = attributes;
26
 
27
+ const blockProps = useBlockProps();
28
+
29
  return (
30
+ <div { ...blockProps }>
31
  <InspectorControls>
32
  <PanelBody
33
  title={ __( 'Content', 'woo-gutenberg-products-block' ) }
148
  <Disabled>
149
  <Block { ...attributes } />
150
  </Disabled>
151
+ </div>
152
  );
153
  };
154
 
assets/js/atomic/blocks/product-elements/image/editor.scss ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ .wp-block-woocommerce-product-image {
2
+ .components-disabled {
3
+ border-radius: inherit;
4
+ }
5
+ }
assets/js/atomic/blocks/product-elements/image/index.js CHANGED
@@ -8,6 +8,8 @@ import { registerBlockType } from '@wordpress/blocks';
8
  */
9
  import sharedConfig from '../shared/config';
10
  import attributes from './attributes';
 
 
11
  import edit from './edit';
12
  import {
13
  BLOCK_TITLE as title,
@@ -16,11 +18,14 @@ import {
16
  } from './constants';
17
 
18
  const blockConfig = {
 
19
  title,
20
  description,
21
  icon: { src: icon },
22
  attributes,
23
  edit,
 
 
24
  };
25
 
26
  registerBlockType( 'woocommerce/product-image', {
8
  */
9
  import sharedConfig from '../shared/config';
10
  import attributes from './attributes';
11
+ import { supports } from './supports';
12
+ import { Save } from './save';
13
  import edit from './edit';
14
  import {
15
  BLOCK_TITLE as title,
18
  } from './constants';
19
 
20
  const blockConfig = {
21
+ apiVersion: 2,
22
  title,
23
  description,
24
  icon: { src: icon },
25
  attributes,
26
  edit,
27
+ supports,
28
+ save: Save,
29
  };
30
 
31
  registerBlockType( 'woocommerce/product-image', {
assets/js/atomic/blocks/product-elements/image/save.tsx ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { useBlockProps } from '@wordpress/block-editor';
5
+ import classnames from 'classnames';
6
+
7
+ type Props = {
8
+ attributes: Record< string, unknown > & {
9
+ className?: string;
10
+ };
11
+ };
12
+
13
+ export const Save = ( { attributes }: Props ): JSX.Element => {
14
+ return (
15
+ <div
16
+ { ...useBlockProps.save( {
17
+ className: classnames( 'is-loading', attributes.className ),
18
+ } ) }
19
+ />
20
+ );
21
+ };
assets/js/atomic/blocks/product-elements/image/style.scss CHANGED
@@ -5,8 +5,10 @@
5
  text-decoration: none;
6
  display: block;
7
  position: relative;
 
8
 
9
  a {
 
10
  text-decoration: none;
11
  border: 0;
12
  outline: 0;
@@ -14,6 +16,7 @@
14
  }
15
 
16
  img {
 
17
  vertical-align: middle;
18
  width: 100%;
19
 
5
  text-decoration: none;
6
  display: block;
7
  position: relative;
8
+ border-radius: inherit;
9
 
10
  a {
11
+ border-radius: inherit;
12
  text-decoration: none;
13
  border: 0;
14
  outline: 0;
16
  }
17
 
18
  img {
19
+ border-radius: inherit;
20
  vertical-align: middle;
21
  width: 100%;
22
 
assets/js/atomic/blocks/product-elements/image/supports.ts ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { isFeaturePluginBuild } from '@woocommerce/block-settings';
5
+
6
+ export const supports = {
7
+ ...( isFeaturePluginBuild() && {
8
+ __experimentalBorder: {
9
+ radius: true,
10
+ },
11
+ } ),
12
+ typography: {
13
+ fontSize: true,
14
+ },
15
+ };
assets/js/atomic/blocks/product-elements/image/test/block.test.js CHANGED
@@ -14,6 +14,17 @@ jest.mock( '@woocommerce/block-settings', () => ( {
14
  PLACEHOLDER_IMG_SRC: 'placeholder.jpg',
15
  } ) );
16
 
 
 
 
 
 
 
 
 
 
 
 
17
  const productWithoutImages = {
18
  name: 'Test product',
19
  id: 1,
14
  PLACEHOLDER_IMG_SRC: 'placeholder.jpg',
15
  } ) );
16
 
17
+ jest.mock( '../../../../../hooks/style-attributes', () => ( {
18
+ __esModule: true,
19
+ useBorderProps: jest.fn( () => ( {
20
+ className: '',
21
+ style: {},
22
+ } ) ),
23
+ useTypographyProps: jest.fn( () => ( {
24
+ style: {},
25
+ } ) ),
26
+ } ) );
27
+
28
  const productWithoutImages = {
29
  name: 'Test product',
30
  id: 1,
assets/js/atomic/blocks/product-elements/price/constants.js CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { bill, Icon } from '@woocommerce/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Product Price',
@@ -10,7 +10,7 @@ export const BLOCK_TITLE = __(
10
  );
11
  export const BLOCK_ICON = (
12
  <Icon
13
- srcElement={ bill }
14
  className="wc-block-editor-components-block-icon"
15
  />
16
  );
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { currencyDollar, Icon } from '@wordpress/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Product Price',
10
  );
11
  export const BLOCK_ICON = (
12
  <Icon
13
+ icon={ currencyDollar }
14
  className="wc-block-editor-components-block-icon"
15
  />
16
  );
assets/js/atomic/blocks/product-elements/rating/constants.js CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { star, Icon } from '@woocommerce/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Product Rating',
@@ -10,7 +10,7 @@ export const BLOCK_TITLE = __(
10
  );
11
  export const BLOCK_ICON = (
12
  <Icon
13
- srcElement={ star }
14
  className="wc-block-editor-components-block-icon"
15
  />
16
  );
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { starEmpty, Icon } from '@wordpress/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Product Rating',
10
  );
11
  export const BLOCK_ICON = (
12
  <Icon
13
+ icon={ starEmpty }
14
  className="wc-block-editor-components-block-icon"
15
  />
16
  );
assets/js/atomic/blocks/product-elements/sale-badge/block.js CHANGED
@@ -15,6 +15,12 @@ import { withProductDataContext } from '@woocommerce/shared-hocs';
15
  * Internal dependencies
16
  */
17
  import './style.scss';
 
 
 
 
 
 
18
 
19
  /**
20
  * Product Sale Badge Block Component.
@@ -24,9 +30,15 @@ import './style.scss';
24
  * @param {string} [props.align] Alignment of the badge.
25
  * @return {*} The component.
26
  */
27
- const Block = ( { className, align } ) => {
 
28
  const { parentClassName } = useInnerBlockLayoutContext();
29
  const { product } = useProductDataContext();
 
 
 
 
 
30
 
31
  if ( ! product.id || ! product.on_sale ) {
32
  return null;
@@ -45,8 +57,16 @@ const Block = ( { className, align } ) => {
45
  alignClass,
46
  {
47
  [ `${ parentClassName }__product-onsale` ]: parentClassName,
48
- }
 
 
49
  ) }
 
 
 
 
 
 
50
  >
51
  <Label
52
  label={ __( 'Sale', 'woo-gutenberg-products-block' ) }
15
  * Internal dependencies
16
  */
17
  import './style.scss';
18
+ import {
19
+ useBorderProps,
20
+ useColorProps,
21
+ useSpacingProps,
22
+ useTypographyProps,
23
+ } from '../../../../hooks/style-attributes';
24
 
25
  /**
26
  * Product Sale Badge Block Component.
30
  * @param {string} [props.align] Alignment of the badge.
31
  * @return {*} The component.
32
  */
33
+ const Block = ( props ) => {
34
+ const { className, align } = props;
35
  const { parentClassName } = useInnerBlockLayoutContext();
36
  const { product } = useProductDataContext();
37
+ const borderProps = useBorderProps( props );
38
+ const colorProps = useColorProps( props );
39
+
40
+ const typographyProps = useTypographyProps( props );
41
+ const spacingProps = useSpacingProps( props );
42
 
43
  if ( ! product.id || ! product.on_sale ) {
44
  return null;
57
  alignClass,
58
  {
59
  [ `${ parentClassName }__product-onsale` ]: parentClassName,
60
+ },
61
+ colorProps.className,
62
+ borderProps.className
63
  ) }
64
+ style={ {
65
+ ...colorProps.style,
66
+ ...borderProps.style,
67
+ ...typographyProps.style,
68
+ ...spacingProps.style,
69
+ } }
70
  >
71
  <Label
72
  label={ __( 'Sale', 'woo-gutenberg-products-block' ) }
assets/js/atomic/blocks/product-elements/sale-badge/constants.js CHANGED
@@ -2,17 +2,14 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { tag, Icon } from '@woocommerce/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'On-Sale Badge',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON = (
12
- <Icon
13
- srcElement={ tag }
14
- className="wc-block-editor-components-block-icon"
15
- />
16
  );
17
  export const BLOCK_DESCRIPTION = __(
18
  'Displays an on-sale badge if the product is on-sale.',
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { percent, Icon } from '@wordpress/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'On-Sale Badge',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON = (
12
+ <Icon icon={ percent } className="wc-block-editor-components-block-icon" />
 
 
 
13
  );
14
  export const BLOCK_DESCRIPTION = __(
15
  'Displays an on-sale badge if the product is on-sale.',
assets/js/atomic/blocks/product-elements/sale-badge/edit.js CHANGED
@@ -2,6 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
 
5
 
6
  /**
7
  * Internal dependencies
@@ -11,7 +12,12 @@ import withProductSelector from '../shared/with-product-selector';
11
  import { BLOCK_TITLE, BLOCK_ICON } from './constants';
12
 
13
  const Edit = ( { attributes } ) => {
14
- return <Block { ...attributes } />;
 
 
 
 
 
15
  };
16
 
17
  export default withProductSelector( {
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { useBlockProps } from '@wordpress/block-editor';
6
 
7
  /**
8
  * Internal dependencies
12
  import { BLOCK_TITLE, BLOCK_ICON } from './constants';
13
 
14
  const Edit = ( { attributes } ) => {
15
+ const blockProps = useBlockProps();
16
+ return (
17
+ <div { ...blockProps }>
18
+ <Block { ...attributes } />
19
+ </div>
20
+ );
21
  };
22
 
23
  export default withProductSelector( {
assets/js/atomic/blocks/product-elements/sale-badge/index.js CHANGED
@@ -14,16 +14,40 @@ import {
14
  BLOCK_ICON as icon,
15
  BLOCK_DESCRIPTION as description,
16
  } from './constants';
 
17
 
18
  const blockConfig = {
19
  title,
20
  description,
21
  icon: { src: icon },
 
22
  supports: {
23
  html: false,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  },
25
  attributes,
26
  edit,
 
27
  };
28
 
29
  registerBlockType( 'woocommerce/product-sale-badge', {
14
  BLOCK_ICON as icon,
15
  BLOCK_DESCRIPTION as description,
16
  } from './constants';
17
+ import { Save } from './save';
18
 
19
  const blockConfig = {
20
  title,
21
  description,
22
  icon: { src: icon },
23
+ apiVersion: 2,
24
  supports: {
25
  html: false,
26
+ color: {
27
+ gradients: true,
28
+ background: true,
29
+ link: false,
30
+ __experimentalSkipSerialization: true,
31
+ },
32
+ typography: {
33
+ fontSize: true,
34
+ __experimentalSkipSerialization: true,
35
+ },
36
+ __experimentalBorder: {
37
+ color: true,
38
+ radius: true,
39
+ width: true,
40
+ __experimentalSkipSerialization: true,
41
+ },
42
+ spacing: {
43
+ padding: true,
44
+ __experimentalSkipSerialization: true,
45
+ },
46
+ __experimentalSelector: '.wc-block-components-product-sale-badge',
47
  },
48
  attributes,
49
  edit,
50
+ save: Save,
51
  };
52
 
53
  registerBlockType( 'woocommerce/product-sale-badge', {
assets/js/atomic/blocks/product-elements/sale-badge/save.tsx ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { useBlockProps } from '@wordpress/block-editor';
5
+ import classnames from 'classnames';
6
+
7
+ type Props = {
8
+ attributes: Record< string, unknown > & {
9
+ className?: string;
10
+ };
11
+ };
12
+
13
+ export const Save = ( { attributes }: Props ): JSX.Element => {
14
+ return (
15
+ <div
16
+ { ...useBlockProps.save( {
17
+ className: classnames( 'is-loading', attributes.className ),
18
+ } ) }
19
+ />
20
+ );
21
+ };
assets/js/atomic/blocks/product-elements/sale-badge/style.scss CHANGED
@@ -13,4 +13,10 @@
13
  font-weight: 600;
14
  z-index: 9;
15
  position: static;
 
 
 
 
 
 
16
  }
13
  font-weight: 600;
14
  z-index: 9;
15
  position: static;
16
+
17
+ span {
18
+ color: inherit;
19
+ background-color: inherit;
20
+ }
21
+
22
  }
assets/js/atomic/blocks/product-elements/shared/config.tsx CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { Icon, grid } from '@woocommerce/icons';
6
  import { isExperimentalBuild } from '@woocommerce/block-settings';
7
  import type { BlockConfiguration } from '@wordpress/blocks';
8
 
@@ -21,7 +21,7 @@ const sharedConfig: Omit< BlockConfiguration, 'attributes' | 'title' > = {
21
  icon: {
22
  src: (
23
  <Icon
24
- srcElement={ grid }
25
  className="wc-block-editor-components-block-icon"
26
  />
27
  ),
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { Icon, grid } from '@wordpress/icons';
6
  import { isExperimentalBuild } from '@woocommerce/block-settings';
7
  import type { BlockConfiguration } from '@wordpress/blocks';
8
 
21
  icon: {
22
  src: (
23
  <Icon
24
+ icon={ grid }
25
  className="wc-block-editor-components-block-icon"
26
  />
27
  ),
assets/js/atomic/blocks/product-elements/sku/constants.js CHANGED
@@ -2,14 +2,12 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { barcode, Icon } from '@woocommerce/icons';
 
6
 
7
  export const BLOCK_TITLE = __( 'Product SKU', 'woo-gutenberg-products-block' );
8
  export const BLOCK_ICON = (
9
- <Icon
10
- srcElement={ barcode }
11
- className="wc-block-editor-components-block-icon"
12
- />
13
  );
14
  export const BLOCK_DESCRIPTION = __(
15
  'Display the SKU of a product.',
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { barcode } from '@woocommerce/icons';
6
+ import { Icon } from '@wordpress/icons';
7
 
8
  export const BLOCK_TITLE = __( 'Product SKU', 'woo-gutenberg-products-block' );
9
  export const BLOCK_ICON = (
10
+ <Icon icon={ barcode } className="wc-block-editor-components-block-icon" />
 
 
 
11
  );
12
  export const BLOCK_DESCRIPTION = __(
13
  'Display the SKU of a product.',
assets/js/atomic/blocks/product-elements/stock-indicator/constants.js CHANGED
@@ -2,17 +2,14 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { box, Icon } from '@woocommerce/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Product Stock Indicator',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON = (
12
- <Icon
13
- srcElement={ box }
14
- className="wc-block-editor-components-block-icon"
15
- />
16
  );
17
  export const BLOCK_DESCRIPTION = __(
18
  'Display product stock status.',
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { box, Icon } from '@wordpress/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Product Stock Indicator',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON = (
12
+ <Icon icon={ box } className="wc-block-editor-components-block-icon" />
 
 
 
13
  );
14
  export const BLOCK_DESCRIPTION = __(
15
  'Display product stock status.',
assets/js/atomic/blocks/product-elements/summary/constants.js CHANGED
@@ -2,17 +2,14 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { notes, Icon } from '@woocommerce/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Product Summary',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON = (
12
- <Icon
13
- srcElement={ notes }
14
- className="wc-block-editor-components-block-icon"
15
- />
16
  );
17
  export const BLOCK_DESCRIPTION = __(
18
  'Display a short description about a product.',
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { page, Icon } from '@wordpress/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Product Summary',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON = (
12
+ <Icon icon={ page } className="wc-block-editor-components-block-icon" />
 
 
 
13
  );
14
  export const BLOCK_DESCRIPTION = __(
15
  'Display a short description about a product.',
assets/js/atomic/blocks/product-elements/tag-list/block.js CHANGED
@@ -15,6 +15,10 @@ import { withProductDataContext } from '@woocommerce/shared-hocs';
15
  * Internal dependencies
16
  */
17
  import './style.scss';
 
 
 
 
18
 
19
  /**
20
  * Product Tag List Block Component.
@@ -23,9 +27,12 @@ import './style.scss';
23
  * @param {string} [props.className] CSS Class name for the component.
24
  * @return {*} The component.
25
  */
26
- const Block = ( { className } ) => {
 
27
  const { parentClassName } = useInnerBlockLayoutContext();
28
  const { product } = useProductDataContext();
 
 
29
 
30
  if ( isEmpty( product.tags ) ) {
31
  return null;
@@ -35,11 +42,13 @@ const Block = ( { className } ) => {
35
  <div
36
  className={ classnames(
37
  className,
 
38
  'wc-block-components-product-tag-list',
39
  {
40
  [ `${ parentClassName }__product-tag-list` ]: parentClassName,
41
  }
42
  ) }
 
43
  >
44
  { __( 'Tags:', 'woo-gutenberg-products-block' ) }{ ' ' }
45
  <ul>
15
  * Internal dependencies
16
  */
17
  import './style.scss';
18
+ import {
19
+ useColorProps,
20
+ useTypographyProps,
21
+ } from '../../../../hooks/style-attributes';
22
 
23
  /**
24
  * Product Tag List Block Component.
27
  * @param {string} [props.className] CSS Class name for the component.
28
  * @return {*} The component.
29
  */
30
+ const Block = ( props ) => {
31
+ const { className } = props;
32
  const { parentClassName } = useInnerBlockLayoutContext();
33
  const { product } = useProductDataContext();
34
+ const colorProps = useColorProps( props );
35
+ const typographyProps = useTypographyProps( props );
36
 
37
  if ( isEmpty( product.tags ) ) {
38
  return null;
42
  <div
43
  className={ classnames(
44
  className,
45
+ colorProps.className,
46
  'wc-block-components-product-tag-list',
47
  {
48
  [ `${ parentClassName }__product-tag-list` ]: parentClassName,
49
  }
50
  ) }
51
+ style={ { ...colorProps.style, ...typographyProps.style } }
52
  >
53
  { __( 'Tags:', 'woo-gutenberg-products-block' ) }{ ' ' }
54
  <ul>
assets/js/atomic/blocks/product-elements/tag-list/constants.js CHANGED
@@ -2,17 +2,14 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { tag, Icon } from '@woocommerce/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Product Tag List',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON = (
12
- <Icon
13
- srcElement={ tag }
14
- className="wc-block-editor-components-block-icon"
15
- />
16
  );
17
  export const BLOCK_DESCRIPTION = __(
18
  'Display a list of tags belonging to a product.',
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { tag, Icon } from '@wordpress/icons';
6
 
7
  export const BLOCK_TITLE = __(
8
  'Product Tag List',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON = (
12
+ <Icon icon={ tag } className="wc-block-editor-components-block-icon" />
 
 
 
13
  );
14
  export const BLOCK_DESCRIPTION = __(
15
  'Display a list of tags belonging to a product.',
assets/js/atomic/blocks/product-elements/tag-list/edit.js CHANGED
@@ -4,6 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { Disabled } from '@wordpress/components';
6
  import EditProductLink from '@woocommerce/editor-components/edit-product-link';
 
7
 
8
  /**
9
  * Internal dependencies
@@ -13,13 +14,14 @@ import withProductSelector from '../shared/with-product-selector';
13
  import { BLOCK_TITLE, BLOCK_ICON } from './constants';
14
 
15
  const Edit = ( { attributes } ) => {
 
16
  return (
17
- <>
18
  <EditProductLink />
19
  <Disabled>
20
  <Block { ...attributes } />
21
  </Disabled>
22
- </>
23
  );
24
  };
25
 
4
  import { __ } from '@wordpress/i18n';
5
  import { Disabled } from '@wordpress/components';
6
  import EditProductLink from '@woocommerce/editor-components/edit-product-link';
7
+ import { useBlockProps } from '@wordpress/block-editor';
8
 
9
  /**
10
  * Internal dependencies
14
  import { BLOCK_TITLE, BLOCK_ICON } from './constants';
15
 
16
  const Edit = ( { attributes } ) => {
17
+ const blockProps = useBlockProps();
18
  return (
19
+ <div { ...blockProps }>
20
  <EditProductLink />
21
  <Disabled>
22
  <Block { ...attributes } />
23
  </Disabled>
24
+ </div>
25
  );
26
  };
27
 
assets/js/atomic/blocks/product-elements/tag-list/index.js CHANGED
@@ -14,13 +14,18 @@ import {
14
  BLOCK_ICON as icon,
15
  BLOCK_DESCRIPTION as description,
16
  } from './constants';
 
 
17
 
18
  const blockConfig = {
 
19
  title,
20
  description,
21
  icon: { src: icon },
22
  attributes,
 
23
  edit,
 
24
  };
25
 
26
  registerExperimentalBlockType( 'woocommerce/product-tag-list', {
14
  BLOCK_ICON as icon,
15
  BLOCK_DESCRIPTION as description,
16
  } from './constants';
17
+ import { Save } from './save';
18
+ import { supports } from './supports';
19
 
20
  const blockConfig = {
21
+ apiVersion: 2,
22
  title,
23
  description,
24
  icon: { src: icon },
25
  attributes,
26
+ supports,
27
  edit,
28
+ save: Save,
29
  };
30
 
31
  registerExperimentalBlockType( 'woocommerce/product-tag-list', {
assets/js/atomic/blocks/product-elements/tag-list/save.tsx ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { useBlockProps } from '@wordpress/block-editor';
5
+ import classnames from 'classnames';
6
+
7
+ type Props = {
8
+ attributes: Record< string, unknown > & {
9
+ className?: string;
10
+ };
11
+ };
12
+
13
+ export const Save = ( { attributes }: Props ): JSX.Element => {
14
+ return (
15
+ <div
16
+ { ...useBlockProps.save( {
17
+ className: classnames( 'is-loading', attributes.className ),
18
+ } ) }
19
+ />
20
+ );
21
+ };
assets/js/atomic/blocks/product-elements/tag-list/supports.js ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { isFeaturePluginBuild } from '@woocommerce/block-settings';
5
+
6
+ export const supports = {
7
+ ...( isFeaturePluginBuild() && {
8
+ color: {
9
+ text: true,
10
+ background: false,
11
+ link: true,
12
+ },
13
+ } ),
14
+ typography: {
15
+ fontSize: true,
16
+ },
17
+ };
assets/js/atomic/blocks/product-elements/title/constants.tsx CHANGED
@@ -2,17 +2,14 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { bookmark, Icon } from '@woocommerce/icons';
6
 
7
  export const BLOCK_TITLE: string = __(
8
  'Product Title',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON: JSX.Element = (
12
- <Icon
13
- srcElement={ bookmark }
14
- className="wc-block-editor-components-block-icon"
15
- />
16
  );
17
  export const BLOCK_DESCRIPTION: string = __(
18
  'Display the title of a product.',
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { heading, Icon } from '@wordpress/icons';
6
 
7
  export const BLOCK_TITLE: string = __(
8
  'Product Title',
9
  'woo-gutenberg-products-block'
10
  );
11
  export const BLOCK_ICON: JSX.Element = (
12
+ <Icon icon={ heading } className="wc-block-editor-components-block-icon" />
 
 
 
13
  );
14
  export const BLOCK_DESCRIPTION: string = __(
15
  'Display the title of a product.',
assets/js/atomic/utils/{get-block-map.js → get-block-map.ts} RENAMED
@@ -2,6 +2,7 @@
2
  * External dependencies
3
  */
4
  import { getRegisteredBlockComponents } from '@woocommerce/blocks-registry';
 
5
 
6
  /**
7
  * Internal dependencies
@@ -13,5 +14,7 @@ import '../blocks/component-init';
13
  *
14
  * @param {string} blockName Name of the parent block.
15
  */
16
- export const getBlockMap = ( blockName ) =>
 
 
17
  getRegisteredBlockComponents( blockName );
2
  * External dependencies
3
  */
4
  import { getRegisteredBlockComponents } from '@woocommerce/blocks-registry';
5
+ import type { RegisteredBlockComponent } from '@woocommerce/types';
6
 
7
  /**
8
  * Internal dependencies
14
  *
15
  * @param {string} blockName Name of the parent block.
16
  */
17
+ export const getBlockMap = (
18
+ blockName: string
19
+ ): Record< string, RegisteredBlockComponent > =>
20
  getRegisteredBlockComponents( blockName );
assets/js/base/components/button/index.tsx CHANGED
@@ -11,13 +11,39 @@ import Spinner from '@woocommerce/base-components/spinner';
11
  */
12
  import './style.scss';
13
 
14
- interface ButtonProps extends WPButton.ButtonProps {
 
 
 
 
 
15
  className?: string;
 
 
 
 
 
16
  showSpinner?: boolean;
 
 
 
17
  children?: ReactNode;
 
 
 
18
  disabled?: boolean;
 
 
 
19
  onClick?: ( e: React.MouseEvent< HTMLButtonElement, MouseEvent > ) => void;
20
- type?: 'input' | 'submit';
 
 
 
 
 
 
 
21
  }
22
 
23
  /**
@@ -28,11 +54,13 @@ const Button = ( {
28
  className,
29
  showSpinner = false,
30
  children,
 
31
  ...props
32
  }: ButtonProps ): JSX.Element => {
33
  const buttonClassName = classNames(
34
  'wc-block-components-button',
35
  className,
 
36
  {
37
  'wc-block-components-button--loading': showSpinner,
38
  }
11
  */
12
  import './style.scss';
13
 
14
+ export interface ButtonProps extends WPButton.ButtonProps {
15
+ /**
16
+ * Component wrapper classname
17
+ *
18
+ * @default 'wc-block-components-button'
19
+ */
20
  className?: string;
21
+ /**
22
+ * Show spinner
23
+ *
24
+ * @default false
25
+ */
26
  showSpinner?: boolean;
27
+ /**
28
+ * Button content
29
+ */
30
  children?: ReactNode;
31
+ /**
32
+ * Button state
33
+ */
34
  disabled?: boolean;
35
+ /**
36
+ * Event handler triggered when the button is clicked
37
+ */
38
  onClick?: ( e: React.MouseEvent< HTMLButtonElement, MouseEvent > ) => void;
39
+ /**
40
+ * Button type
41
+ */
42
+ type?: 'button' | 'input' | 'submit';
43
+ /**
44
+ * Button variant
45
+ */
46
+ variant?: 'text' | 'contained' | 'outlined';
47
  }
48
 
49
  /**
54
  className,
55
  showSpinner = false,
56
  children,
57
+ variant = 'contained',
58
  ...props
59
  }: ButtonProps ): JSX.Element => {
60
  const buttonClassName = classNames(
61
  'wc-block-components-button',
62
  className,
63
+ variant,
64
  {
65
  'wc-block-components-button--loading': showSpinner,
66
  }
assets/js/base/components/button/stories/index.js DELETED
@@ -1,11 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import Button from '../';
5
-
6
- export default {
7
- title: 'WooCommerce Blocks/@base-components/Button',
8
- component: Button,
9
- };
10
-
11
- export const Default = () => <Button>Buy now</Button>;
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/components/button/stories/index.tsx ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { Story, Meta } from '@storybook/react';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import Button, { ButtonProps } from '..';
10
+ const availableTypes = [ 'button', 'input', 'submit' ];
11
+
12
+ export default {
13
+ title: 'WooCommerce Blocks/@base-components/Button',
14
+ argTypes: {
15
+ children: {
16
+ control: 'text',
17
+ },
18
+ type: {
19
+ control: 'radio',
20
+ options: availableTypes,
21
+ },
22
+ },
23
+ component: Button,
24
+ } as Meta< ButtonProps >;
25
+
26
+ const Template: Story< ButtonProps > = ( args ) => {
27
+ return <Button { ...args } />;
28
+ };
29
+
30
+ export const Default = Template.bind( {} );
31
+ Default.args = {
32
+ children: 'Buy Now',
33
+ disabled: false,
34
+ showSpinner: false,
35
+ type: 'button',
36
+ };
37
+
38
+ export const Disabled = Template.bind( {} );
39
+ Disabled.args = {
40
+ ...Default.args,
41
+ disabled: true,
42
+ };
43
+
44
+ export const Loading = Template.bind( {} );
45
+ Loading.args = {
46
+ ...Default.args,
47
+ disabled: true,
48
+ showSpinner: true,
49
+ };
assets/js/base/components/button/style.scss CHANGED
@@ -1,8 +1,6 @@
1
  .wc-block-components-button:not(.is-link) {
2
  @include reset-typography();
3
  align-items: center;
4
- background-color: $gray-900;
5
- color: $white;
6
  display: inline-flex;
7
  font-weight: bold;
8
  min-height: 3em;
@@ -13,13 +11,12 @@
13
  text-decoration: none;
14
  text-transform: none;
15
  position: relative;
 
16
 
17
- &:disabled,
18
- &:hover,
19
- &:focus,
20
- &:active {
21
- background-color: $gray-900;
22
- color: $white;
23
  }
24
 
25
  .wc-block-components-button__text {
@@ -32,4 +29,49 @@
32
  .wc-block-components-spinner + .wc-block-components-button__text {
33
  visibility: hidden;
34
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  }
1
  .wc-block-components-button:not(.is-link) {
2
  @include reset-typography();
3
  align-items: center;
 
 
4
  display: inline-flex;
5
  font-weight: bold;
6
  min-height: 3em;
11
  text-decoration: none;
12
  text-transform: none;
13
  position: relative;
14
+ transition: box-shadow 0.1s linear;
15
 
16
+ &:focus {
17
+ box-shadow: 0 0 0 2px $studio-blue;
18
+ box-shadow: inset 0 0 0 1px $white, 0 0 0 2px $studio-blue;
19
+ outline: 3px solid transparent;
 
 
20
  }
21
 
22
  .wc-block-components-button__text {
29
  .wc-block-components-spinner + .wc-block-components-button__text {
30
  visibility: hidden;
31
  }
32
+
33
+ &.text {
34
+ color: $gray-900;
35
+
36
+ &:hover {
37
+ opacity: 0.9;
38
+ }
39
+ }
40
+
41
+ &.contained {
42
+ background-color: $gray-900;
43
+ color: $white;
44
+
45
+ &:disabled,
46
+ &:hover,
47
+ &:focus,
48
+ &:active {
49
+ background-color: $gray-900;
50
+ color: $white;
51
+ }
52
+
53
+ &:hover {
54
+ opacity: 0.9;
55
+ }
56
+ }
57
+
58
+ &.outlined {
59
+ background-color: transparent;
60
+ box-shadow: inset 0 0 0 1px $gray-900;
61
+ color: $gray-900;
62
+
63
+ &:disabled,
64
+ &:hover,
65
+ &:focus,
66
+ &:active {
67
+ background-color: $gray-900;
68
+ color: $white;
69
+ }
70
+
71
+ &:hover {
72
+ background-color: $gray-900;
73
+ color: $white;
74
+ opacity: 1;
75
+ }
76
+ }
77
  }
assets/js/base/components/cart-checkout/payment-method-label/index.tsx CHANGED
@@ -2,7 +2,13 @@
2
  * External dependencies
3
  */
4
  import classnames from 'classnames';
5
- import { Icon, bank, bill, card, checkPayment } from '@woocommerce/icons';
 
 
 
 
 
 
6
  import { isString, objectHasProp } from '@woocommerce/types';
7
  import { useCallback } from '@wordpress/element';
8
 
@@ -60,7 +66,7 @@ export const PaymentMethodLabel = ( {
60
  return (
61
  <span className={ className }>
62
  { hasNamedIcon( icon ) ? (
63
- <Icon srcElement={ namedIcons[ icon ] } />
64
  ) : (
65
  icon
66
  ) }
2
  * External dependencies
3
  */
4
  import classnames from 'classnames';
5
+ import { checkPayment } from '@woocommerce/icons';
6
+ import {
7
+ Icon,
8
+ institution as bank,
9
+ currencyDollar as bill,
10
+ payment as card,
11
+ } from '@wordpress/icons';
12
  import { isString, objectHasProp } from '@woocommerce/types';
13
  import { useCallback } from '@wordpress/element';
14
 
66
  return (
67
  <span className={ className }>
68
  { hasNamedIcon( icon ) ? (
69
+ <Icon icon={ namedIcons[ icon ] } />
70
  ) : (
71
  icon
72
  ) }
assets/js/base/components/cart-checkout/place-order-button/index.tsx CHANGED
@@ -1,9 +1,8 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { __ } from '@wordpress/i18n';
5
  import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
6
- import { Icon, done } from '@woocommerce/icons';
7
  import Button from '@woocommerce/base-components/button';
8
 
9
  const PlaceOrderButton = (): JSX.Element => {
@@ -28,14 +27,7 @@ const PlaceOrderButton = (): JSX.Element => {
28
  }
29
  showSpinner={ waitingForProcessing }
30
  >
31
- { waitingForRedirect ? (
32
- <Icon
33
- srcElement={ done }
34
- alt={ __( 'Done', 'woo-gutenberg-products-block' ) }
35
- />
36
- ) : (
37
- submitButtonText
38
- ) }
39
  </Button>
40
  );
41
  };
1
  /**
2
  * External dependencies
3
  */
 
4
  import { useCheckoutSubmit } from '@woocommerce/base-context/hooks';
5
+ import { Icon, check } from '@wordpress/icons';
6
  import Button from '@woocommerce/base-components/button';
7
 
8
  const PlaceOrderButton = (): JSX.Element => {
27
  }
28
  showSpinner={ waitingForProcessing }
29
  >
30
+ { waitingForRedirect ? <Icon icon={ check } /> : submitButtonText }
 
 
 
 
 
 
 
31
  </Button>
32
  );
33
  };
assets/js/base/components/cart-checkout/return-to-cart-button/index.tsx CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { CART_URL } from '@woocommerce/block-settings';
6
- import { Icon, arrowBack } from '@woocommerce/icons';
7
 
8
  /**
9
  * Internal dependencies
@@ -22,7 +22,7 @@ const ReturnToCartButton = ( {
22
  href={ link || CART_URL }
23
  className="wc-block-components-checkout-return-to-cart-button"
24
  >
25
- <Icon srcElement={ arrowBack } />
26
  { __( 'Return to Cart', 'woo-gutenberg-products-block' ) }
27
  </a>
28
  );
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { CART_URL } from '@woocommerce/block-settings';
6
+ import { Icon, arrowLeft } from '@wordpress/icons';
7
 
8
  /**
9
  * Internal dependencies
22
  href={ link || CART_URL }
23
  className="wc-block-components-checkout-return-to-cart-button"
24
  >
25
+ <Icon icon={ arrowLeft } />
26
  { __( 'Return to Cart', 'woo-gutenberg-products-block' ) }
27
  </a>
28
  );
assets/js/base/components/cart-checkout/shipping-rates-control-package/index.tsx CHANGED
@@ -57,7 +57,7 @@ interface PackageProps {
57
 
58
  export const ShippingRatesControlPackage = ( {
59
  packageId,
60
- className,
61
  noResultsMessage,
62
  renderOption,
63
  packageData,
@@ -65,10 +65,7 @@ export const ShippingRatesControlPackage = ( {
65
  collapse = false,
66
  showItems = false,
67
  }: PackageProps ): ReactElement => {
68
- const { selectShippingRate, selectedShippingRate } = useSelectShippingRate(
69
- packageId,
70
- packageData.shipping_rates
71
- );
72
 
73
  const header = (
74
  <>
@@ -117,8 +114,12 @@ export const ShippingRatesControlPackage = ( {
117
  className={ className }
118
  noResultsMessage={ noResultsMessage }
119
  rates={ packageData.shipping_rates }
120
- onSelectRate={ selectShippingRate }
121
- selected={ selectedShippingRate }
 
 
 
 
122
  renderOption={ renderOption }
123
  />
124
  );
57
 
58
  export const ShippingRatesControlPackage = ( {
59
  packageId,
60
+ className = '',
61
  noResultsMessage,
62
  renderOption,
63
  packageData,
65
  collapse = false,
66
  showItems = false,
67
  }: PackageProps ): ReactElement => {
68
+ const { selectShippingRate } = useSelectShippingRate();
 
 
 
69
 
70
  const header = (
71
  <>
114
  className={ className }
115
  noResultsMessage={ noResultsMessage }
116
  rates={ packageData.shipping_rates }
117
+ onSelectRate={ ( newShippingRateId ) =>
118
+ selectShippingRate( newShippingRateId, packageId )
119
+ }
120
+ selectedRate={ packageData.shipping_rates.find(
121
+ ( rate ) => rate.selected
122
+ ) }
123
  renderOption={ renderOption }
124
  />
125
  );
assets/js/base/components/cart-checkout/shipping-rates-control-package/package-rates.tsx CHANGED
@@ -1,11 +1,11 @@
1
  /**
2
  * External dependencies
3
  */
 
4
  import RadioControl, {
5
  RadioControlOptionLayout,
6
  } from '@woocommerce/base-components/radio-control';
7
  import type { PackageRateOption } from '@woocommerce/type-defs/shipping';
8
- import type { ReactElement } from 'react';
9
  import type { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart';
10
 
11
  /**
@@ -20,18 +20,30 @@ interface PackageRates {
20
  option: CartShippingPackageShippingRate
21
  ) => PackageRateOption;
22
  className?: string;
23
- noResultsMessage: ReactElement;
24
- selected?: string;
25
  }
26
 
27
  const PackageRates = ( {
28
- className,
29
  noResultsMessage,
30
  onSelectRate,
31
  rates,
32
  renderOption = renderPackageRateOption,
33
- selected,
34
- }: PackageRates ): ReactElement => {
 
 
 
 
 
 
 
 
 
 
 
 
35
  if ( rates.length === 0 ) {
36
  return noResultsMessage;
37
  }
@@ -40,10 +52,11 @@ const PackageRates = ( {
40
  return (
41
  <RadioControl
42
  className={ className }
43
- onChange={ ( selectedRateId: string ) => {
44
- onSelectRate( selectedRateId );
 
45
  } }
46
- selected={ selected }
47
  options={ rates.map( renderOption ) }
48
  />
49
  );
1
  /**
2
  * External dependencies
3
  */
4
+ import { useState, useEffect } from '@wordpress/element';
5
  import RadioControl, {
6
  RadioControlOptionLayout,
7
  } from '@woocommerce/base-components/radio-control';
8
  import type { PackageRateOption } from '@woocommerce/type-defs/shipping';
 
9
  import type { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart';
10
 
11
  /**
20
  option: CartShippingPackageShippingRate
21
  ) => PackageRateOption;
22
  className?: string;
23
+ noResultsMessage: JSX.Element;
24
+ selectedRate: CartShippingPackageShippingRate | undefined;
25
  }
26
 
27
  const PackageRates = ( {
28
+ className = '',
29
  noResultsMessage,
30
  onSelectRate,
31
  rates,
32
  renderOption = renderPackageRateOption,
33
+ selectedRate,
34
+ }: PackageRates ): JSX.Element => {
35
+ const selectedRateId = selectedRate?.rate_id || '';
36
+
37
+ // Store selected rate ID in local state so shipping rates changes are shown in the UI instantly.
38
+ const [ selectedOption, setSelectedOption ] = useState( selectedRateId );
39
+
40
+ // Update the selected option if cart state changes in the data stores.
41
+ useEffect( () => {
42
+ if ( selectedRateId ) {
43
+ setSelectedOption( selectedRateId );
44
+ }
45
+ }, [ selectedRateId ] );
46
+
47
  if ( rates.length === 0 ) {
48
  return noResultsMessage;
49
  }
52
  return (
53
  <RadioControl
54
  className={ className }
55
+ onChange={ ( value: string ) => {
56
+ setSelectedOption( value );
57
+ onSelectRate( value );
58
  } }
59
+ selected={ selectedOption }
60
  options={ rates.map( renderOption ) }
61
  />
62
  );
assets/js/base/components/chip/removable-chip.tsx CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import classNames from 'classnames';
5
  import { __, sprintf } from '@wordpress/i18n';
6
- import { Icon, noAlt } from '@woocommerce/icons';
7
 
8
  /**
9
  * Internal dependencies
@@ -106,7 +106,7 @@ export const RemovableChip = ( {
106
  >
107
  <Icon
108
  className="wc-block-components-chip__remove-icon"
109
- srcElement={ noAlt }
110
  size={ 16 }
111
  />
112
  </RemoveElement>
3
  */
4
  import classNames from 'classnames';
5
  import { __, sprintf } from '@wordpress/i18n';
6
+ import { Icon, closeSmall } from '@wordpress/icons';
7
 
8
  /**
9
  * Internal dependencies
106
  >
107
  <Icon
108
  className="wc-block-components-chip__remove-icon"
109
+ icon={ closeSmall }
110
  size={ 16 }
111
  />
112
  </RemoveElement>
assets/js/base/components/chip/test/__snapshots__/index.js.snap CHANGED
@@ -111,12 +111,12 @@ exports[`RemovableChip should render custom aria label 1`] = `
111
  focusable={false}
112
  height={16}
113
  role="img"
114
- viewBox="0 0 20 20"
115
  width={16}
116
  xmlns="http://www.w3.org/2000/svg"
117
  >
118
  <path
119
- d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
120
  />
121
  </svg>
122
  </button>
@@ -153,12 +153,12 @@ exports[`RemovableChip should render default aria label if text is a node 1`] =
153
  focusable={false}
154
  height={16}
155
  role="img"
156
- viewBox="0 0 20 20"
157
  width={16}
158
  xmlns="http://www.w3.org/2000/svg"
159
  >
160
  <path
161
- d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
162
  />
163
  </svg>
164
  </button>
@@ -193,12 +193,12 @@ exports[`RemovableChip should render screen reader text aria label 1`] = `
193
  focusable={false}
194
  height={16}
195
  role="img"
196
- viewBox="0 0 20 20"
197
  width={16}
198
  xmlns="http://www.w3.org/2000/svg"
199
  >
200
  <path
201
- d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
202
  />
203
  </svg>
204
  </button>
@@ -228,12 +228,12 @@ exports[`RemovableChip should render text and the remove button 1`] = `
228
  focusable={false}
229
  height={16}
230
  role="img"
231
- viewBox="0 0 20 20"
232
  width={16}
233
  xmlns="http://www.w3.org/2000/svg"
234
  >
235
  <path
236
- d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
237
  />
238
  </svg>
239
  </button>
@@ -263,12 +263,12 @@ exports[`RemovableChip should render with disabled remove button 1`] = `
263
  focusable={false}
264
  height={16}
265
  role="img"
266
- viewBox="0 0 20 20"
267
  width={16}
268
  xmlns="http://www.w3.org/2000/svg"
269
  >
270
  <path
271
- d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
272
  />
273
  </svg>
274
  </button>
@@ -299,12 +299,12 @@ exports[`RemovableChip with removeOnAnyClick should be a button when removeOnAny
299
  focusable={false}
300
  height={16}
301
  role="img"
302
- viewBox="0 0 20 20"
303
  width={16}
304
  xmlns="http://www.w3.org/2000/svg"
305
  >
306
  <path
307
- d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"
308
  />
309
  </svg>
310
  </span>
111
  focusable={false}
112
  height={16}
113
  role="img"
114
+ viewBox="0 0 24 24"
115
  width={16}
116
  xmlns="http://www.w3.org/2000/svg"
117
  >
118
  <path
119
+ d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
120
  />
121
  </svg>
122
  </button>
153
  focusable={false}
154
  height={16}
155
  role="img"
156
+ viewBox="0 0 24 24"
157
  width={16}
158
  xmlns="http://www.w3.org/2000/svg"
159
  >
160
  <path
161
+ d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
162
  />
163
  </svg>
164
  </button>
193
  focusable={false}
194
  height={16}
195
  role="img"
196
+ viewBox="0 0 24 24"
197
  width={16}
198
  xmlns="http://www.w3.org/2000/svg"
199
  >
200
  <path
201
+ d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
202
  />
203
  </svg>
204
  </button>
228
  focusable={false}
229
  height={16}
230
  role="img"
231
+ viewBox="0 0 24 24"
232
  width={16}
233
  xmlns="http://www.w3.org/2000/svg"
234
  >
235
  <path
236
+ d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
237
  />
238
  </svg>
239
  </button>
263
  focusable={false}
264
  height={16}
265
  role="img"
266
+ viewBox="0 0 24 24"
267
  width={16}
268
  xmlns="http://www.w3.org/2000/svg"
269
  >
270
  <path
271
+ d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
272
  />
273
  </svg>
274
  </button>
299
  focusable={false}
300
  height={16}
301
  role="img"
302
+ viewBox="0 0 24 24"
303
  width={16}
304
  xmlns="http://www.w3.org/2000/svg"
305
  >
306
  <path
307
+ d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"
308
  />
309
  </svg>
310
  </span>
assets/js/base/components/dropdown-selector/index.js CHANGED
@@ -23,6 +23,7 @@ import './style.scss';
23
  * @param {Object} props Incoming props for the component.
24
  * @param {string} props.attributeLabel Label for the attributes.
25
  * @param {string} props.className CSS class used.
 
26
  * @param {Array} props.checked Which items are checked.
27
  * @param {string} props.inputLabel Label used for the input.
28
  * @param {boolean} props.isDisabled Whether the input is disabled or not.
@@ -34,6 +35,7 @@ import './style.scss';
34
  const DropdownSelector = ( {
35
  attributeLabel = '',
36
  className,
 
37
  checked = [],
38
  inputLabel = '',
39
  isDisabled = false,
@@ -105,6 +107,7 @@ const DropdownSelector = ( {
105
  'has-checked': checked.length > 0,
106
  'is-open': isOpen,
107
  } ) }
 
108
  >
109
  { /* eslint-disable-next-line jsx-a11y/label-has-for */ }
110
  <label
23
  * @param {Object} props Incoming props for the component.
24
  * @param {string} props.attributeLabel Label for the attributes.
25
  * @param {string} props.className CSS class used.
26
+ * @param {import('react').CSSProperties} props.style CSS style object used.
27
  * @param {Array} props.checked Which items are checked.
28
  * @param {string} props.inputLabel Label used for the input.
29
  * @param {boolean} props.isDisabled Whether the input is disabled or not.
35
  const DropdownSelector = ( {
36
  attributeLabel = '',
37
  className,
38
+ style = {},
39
  checked = [],
40
  inputLabel = '',
41
  isDisabled = false,
107
  'has-checked': checked.length > 0,
108
  'is-open': isOpen,
109
  } ) }
110
+ style={ style }
111
  >
112
  { /* eslint-disable-next-line jsx-a11y/label-has-for */ }
113
  <label
assets/js/base/components/dropdown-selector/selected-value.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __, sprintf } from '@wordpress/i18n';
5
  import { useEffect, useRef } from '@wordpress/element';
6
- import { Icon, noAlt } from '@woocommerce/icons';
7
 
8
  const DropdownSelectorSelectedValue = ( { onClick, onRemoveItem, option } ) => {
9
  const labelRef = useRef( null );
@@ -48,7 +48,7 @@ const DropdownSelectorSelectedValue = ( { onClick, onRemoveItem, option } ) => {
48
  option.name
49
  ) }
50
  >
51
- <Icon srcElement={ noAlt } size={ 16 } />
52
  </button>
53
  </div>
54
  );
3
  */
4
  import { __, sprintf } from '@wordpress/i18n';
5
  import { useEffect, useRef } from '@wordpress/element';
6
+ import { Icon, closeSmall } from '@wordpress/icons';
7
 
8
  const DropdownSelectorSelectedValue = ( { onClick, onRemoveItem, option } ) => {
9
  const labelRef = useRef( null );
48
  option.name
49
  ) }
50
  >
51
+ <Icon icon={ closeSmall } size={ 16 } />
52
  </button>
53
  </div>
54
  );
assets/js/base/components/filter-element-label/{index.js → index.tsx} RENAMED
@@ -9,6 +9,10 @@ import Label from '@woocommerce/base-components/label';
9
  */
10
  import './style.scss';
11
 
 
 
 
 
12
  /**
13
  * The label for an filter elements.
14
  *
@@ -16,13 +20,16 @@ import './style.scss';
16
  * @param {string} props.name The name for the label.
17
  * @param {number} props.count The count of products this status is attached to.
18
  */
19
- const FilterElementLabel = ( { name, count } ) => {
 
 
 
20
  return (
21
  <>
22
  { name }
23
  { Number.isFinite( count ) && (
24
  <Label
25
- label={ count }
26
  screenReaderLabel={ sprintf(
27
  /* translators: %s number of products. */
28
  _n(
9
  */
10
  import './style.scss';
11
 
12
+ interface FilterElementLabelProps {
13
+ name: string;
14
+ count: number;
15
+ }
16
  /**
17
  * The label for an filter elements.
18
  *
20
  * @param {string} props.name The name for the label.
21
  * @param {number} props.count The count of products this status is attached to.
22
  */
23
+ const FilterElementLabel = ( {
24
+ name,
25
+ count,
26
+ }: FilterElementLabelProps ): JSX.Element => {
27
  return (
28
  <>
29
  { name }
30
  { Number.isFinite( count ) && (
31
  <Label
32
+ label={ count.toString() }
33
  screenReaderLabel={ sprintf(
34
  /* translators: %s number of products. */
35
  _n(
assets/js/base/components/filter-submit-button/{index.js → index.tsx} RENAMED
@@ -2,7 +2,6 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import PropTypes from 'prop-types';
6
  import classNames from 'classnames';
7
  import Label from '@woocommerce/base-components/label';
8
 
@@ -11,6 +10,14 @@ import Label from '@woocommerce/base-components/label';
11
  */
12
  import './style.scss';
13
 
 
 
 
 
 
 
 
 
14
  const FilterSubmitButton = ( {
15
  className,
16
  disabled,
@@ -18,7 +25,7 @@ const FilterSubmitButton = ( {
18
  label = __( 'Go', 'woo-gutenberg-products-block' ),
19
  onClick,
20
  screenReaderLabel = __( 'Apply filter', 'woo-gutenberg-products-block' ),
21
- } ) => {
22
  return (
23
  <button
24
  type="submit"
@@ -35,22 +42,4 @@ const FilterSubmitButton = ( {
35
  );
36
  };
37
 
38
- FilterSubmitButton.propTypes = {
39
- className: PropTypes.string,
40
- /**
41
- * Is the button disabled?
42
- */
43
- disabled: PropTypes.bool,
44
- /**
45
- * On click callback.
46
- */
47
- onClick: PropTypes.func.isRequired,
48
- label: PropTypes.string,
49
- screenReaderLabel: PropTypes.string,
50
- };
51
-
52
- FilterSubmitButton.defaultProps = {
53
- disabled: false,
54
- };
55
-
56
  export default FilterSubmitButton;
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
 
5
  import classNames from 'classnames';
6
  import Label from '@woocommerce/base-components/label';
7
 
10
  */
11
  import './style.scss';
12
 
13
+ interface FilterSubmitButtonProps {
14
+ className?: string;
15
+ disabled?: boolean;
16
+ label?: string;
17
+ onClick: () => void;
18
+ screenReaderLabel?: string;
19
+ }
20
+
21
  const FilterSubmitButton = ( {
22
  className,
23
  disabled,
25
  label = __( 'Go', 'woo-gutenberg-products-block' ),
26
  onClick,
27
  screenReaderLabel = __( 'Apply filter', 'woo-gutenberg-products-block' ),
28
+ }: FilterSubmitButtonProps ): JSX.Element => {
29
  return (
30
  <button
31
  type="submit"
42
  );
43
  };
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  export default FilterSubmitButton;
assets/js/base/components/form/{index.js → index.tsx} RENAMED
@@ -2,14 +2,20 @@
2
  * External dependencies
3
  */
4
  import classnames from 'classnames';
5
- import PropTypes from 'prop-types';
 
 
 
 
 
 
6
 
7
  const Form = ( {
8
  className,
9
  children,
10
  onSubmit = ( event ) => void event,
11
- } ) => {
12
- const formOnSubmit = ( event ) => {
13
  event.preventDefault();
14
  onSubmit( event );
15
  };
@@ -24,10 +30,4 @@ const Form = ( {
24
  );
25
  };
26
 
27
- Form.propTypes = {
28
- className: PropTypes.string,
29
- children: PropTypes.node,
30
- onSubmit: PropTypes.func,
31
- };
32
-
33
  export default Form;
2
  * External dependencies
3
  */
4
  import classnames from 'classnames';
5
+ import type { FormEvent } from 'react';
6
+
7
+ interface FormProps {
8
+ className: string;
9
+ children?: React.ReactChildren;
10
+ onSubmit: ( event: FormEvent ) => void;
11
+ }
12
 
13
  const Form = ( {
14
  className,
15
  children,
16
  onSubmit = ( event ) => void event,
17
+ }: FormProps ): JSX.Element => {
18
+ const formOnSubmit = ( event: FormEvent ) => {
19
  event.preventDefault();
20
  onSubmit( event );
21
  };
30
  );
31
  };
32
 
 
 
 
 
 
 
33
  export default Form;
assets/js/base/components/load-more-button/{index.js → index.tsx} RENAMED
@@ -2,15 +2,25 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import PropTypes from 'prop-types';
6
  import Label from '@woocommerce/base-components/label';
 
7
 
8
  /**
9
  * Internal dependencies
10
  */
11
  import './style.scss';
12
 
13
- export const LoadMoreButton = ( { onClick, label, screenReaderLabel } ) => {
 
 
 
 
 
 
 
 
 
 
14
  return (
15
  <div className="wp-block-button wc-block-load-more wc-block-components-load-more">
16
  <button className="wp-block-button__link" onClick={ onClick }>
@@ -23,14 +33,4 @@ export const LoadMoreButton = ( { onClick, label, screenReaderLabel } ) => {
23
  );
24
  };
25
 
26
- LoadMoreButton.propTypes = {
27
- label: PropTypes.string,
28
- onClick: PropTypes.func,
29
- screenReaderLabel: PropTypes.string,
30
- };
31
-
32
- LoadMoreButton.defaultProps = {
33
- label: __( 'Load more', 'woo-gutenberg-products-block' ),
34
- };
35
-
36
  export default LoadMoreButton;
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
 
5
  import Label from '@woocommerce/base-components/label';
6
+ import type { MouseEventHandler } from 'react';
7
 
8
  /**
9
  * Internal dependencies
10
  */
11
  import './style.scss';
12
 
13
+ interface LoadMoreButtonProps {
14
+ onClick: MouseEventHandler;
15
+ label?: string;
16
+ screenReaderLabel?: string;
17
+ }
18
+
19
+ export const LoadMoreButton = ( {
20
+ onClick,
21
+ label = __( 'Load more', 'woo-gutenberg-products-block' ),
22
+ screenReaderLabel = __( 'Load more', 'woo-gutenberg-products-block' ),
23
+ }: LoadMoreButtonProps ): JSX.Element => {
24
  return (
25
  <div className="wp-block-button wc-block-load-more wc-block-components-load-more">
26
  <button className="wp-block-button__link" onClick={ onClick }>
33
  );
34
  };
35
 
 
 
 
 
 
 
 
 
 
 
36
  export default LoadMoreButton;
assets/js/base/components/loading-mask/{index.js → index.tsx} RENAMED
@@ -2,7 +2,6 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import PropTypes from 'prop-types';
6
  import classNames from 'classnames';
7
 
8
  /**
@@ -11,6 +10,13 @@ import classNames from 'classnames';
11
  import './style.scss';
12
  import Spinner from '../spinner';
13
 
 
 
 
 
 
 
 
14
  // @todo Find a way to block buttons/form components when LoadingMask isLoading
15
  const LoadingMask = ( {
16
  children,
@@ -18,7 +24,7 @@ const LoadingMask = ( {
18
  screenReaderLabel,
19
  showSpinner = false,
20
  isLoading = true,
21
- } ) => {
22
  return (
23
  <div
24
  className={ classNames( className, {
@@ -44,11 +50,4 @@ const LoadingMask = ( {
44
  );
45
  };
46
 
47
- LoadingMask.propTypes = {
48
- className: PropTypes.string,
49
- screenReaderLabel: PropTypes.string,
50
- showSpinner: PropTypes.bool,
51
- isLoading: PropTypes.bool,
52
- };
53
-
54
  export default LoadingMask;
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
 
5
  import classNames from 'classnames';
6
 
7
  /**
10
  import './style.scss';
11
  import Spinner from '../spinner';
12
 
13
+ interface LoadingMaskProps {
14
+ children?: React.ReactNode | React.ReactNode[];
15
+ className?: string;
16
+ screenReaderLabel?: string;
17
+ showSpinner?: boolean;
18
+ isLoading?: boolean;
19
+ }
20
  // @todo Find a way to block buttons/form components when LoadingMask isLoading
21
  const LoadingMask = ( {
22
  children,
24
  screenReaderLabel,
25
  showSpinner = false,
26
  isLoading = true,
27
+ }: LoadingMaskProps ): JSX.Element => {
28
  return (
29
  <div
30
  className={ classNames( className, {
50
  );
51
  };
52
 
 
 
 
 
 
 
 
53
  export default LoadingMask;
assets/js/base/components/pagination/{index.js → index.tsx} RENAMED
@@ -2,36 +2,66 @@
2
  * External dependencies
3
  */
4
  import { __, sprintf } from '@wordpress/i18n';
5
- import PropTypes from 'prop-types';
6
  import classNames from 'classnames';
7
  import Label from '@woocommerce/base-components/label';
8
 
9
  /**
10
  * Internal dependencies
11
  */
12
- import { getIndexes } from './utils.js';
13
  import './style.scss';
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  const Pagination = ( {
16
  currentPage,
17
- displayFirstAndLastPages,
18
- displayNextAndPreviousArrows,
19
- pagesToDisplay,
20
  onPageChange,
21
  totalPages,
22
- } ) => {
23
  let { minIndex, maxIndex } = getIndexes(
24
  pagesToDisplay,
25
  currentPage,
26
  totalPages
27
  );
 
28
  const showFirstPage = displayFirstAndLastPages && Boolean( minIndex !== 1 );
29
  const showLastPage =
30
  displayFirstAndLastPages && Boolean( maxIndex !== totalPages );
31
  const showFirstPageEllipsis =
32
- displayFirstAndLastPages && Boolean( minIndex > 3 );
33
  const showLastPageEllipsis =
34
- displayFirstAndLastPages && Boolean( maxIndex < totalPages - 2 );
 
35
 
36
  // Handle the cases where there would be an ellipsis replacing one single page
37
  if ( showFirstPage && minIndex === 3 ) {
@@ -91,7 +121,7 @@ const Pagination = ( {
91
  disabled={ currentPage === 1 }
92
  >
93
  <Label
94
- label={ 1 }
95
  screenReaderLabel={ sprintf(
96
  /* translators: %d is the page number (1, 2, 3...). */
97
  __( 'Page %d', 'woo-gutenberg-products-block' ),
@@ -124,13 +154,13 @@ const Pagination = ( {
124
  ) }
125
  onClick={
126
  currentPage === page
127
- ? null
128
  : () => onPageChange( page )
129
  }
130
  disabled={ currentPage === page }
131
  >
132
  <Label
133
- label={ page }
134
  screenReaderLabel={ sprintf(
135
  /* translators: %d is the page number (1, 2, 3...). */
136
  __( 'Page %d', 'woo-gutenberg-products-block' ),
@@ -164,7 +194,7 @@ const Pagination = ( {
164
  disabled={ currentPage === totalPages }
165
  >
166
  <Label
167
- label={ totalPages }
168
  screenReaderLabel={ sprintf(
169
  /* translators: %d is the page number (1, 2, 3...). */
170
  __( 'Page %d', 'woo-gutenberg-products-block' ),
@@ -193,39 +223,4 @@ const Pagination = ( {
193
  );
194
  };
195
 
196
- Pagination.propTypes = {
197
- /**
198
- * Number of the page currently being displayed.
199
- */
200
- currentPage: PropTypes.number.isRequired,
201
- /**
202
- * Total number of pages.
203
- */
204
- totalPages: PropTypes.number.isRequired,
205
- /**
206
- * Displays first and last pages if they are not in the current range of pages displayed.
207
- */
208
- displayFirstAndLastPages: PropTypes.bool,
209
- /**
210
- * Displays arrows to navigate to the previous and next pages.
211
- */
212
- displayNextAndPreviousArrows: PropTypes.bool,
213
- /**
214
- * Callback function called when the user triggers a page change.
215
- */
216
- onPageChange: PropTypes.func,
217
- /**
218
- * Number of pages to display at the same time, including the active page
219
- * and the pages displayed before and after it. It doesn't include the first
220
- * and last pages.
221
- */
222
- pagesToDisplay: PropTypes.number,
223
- };
224
-
225
- Pagination.defaultProps = {
226
- displayFirstAndLastPages: true,
227
- displayNextAndPreviousArrows: true,
228
- pagesToDisplay: 3,
229
- };
230
-
231
  export default Pagination;
2
  * External dependencies
3
  */
4
  import { __, sprintf } from '@wordpress/i18n';
 
5
  import classNames from 'classnames';
6
  import Label from '@woocommerce/base-components/label';
7
 
8
  /**
9
  * Internal dependencies
10
  */
11
+ import { getIndexes } from './utils';
12
  import './style.scss';
13
 
14
+ interface PaginationProps {
15
+ /**
16
+ * Number of the page currently being displayed.
17
+ */
18
+ currentPage: number;
19
+ /**
20
+ * Total number of pages.
21
+ */
22
+ totalPages: number;
23
+ /**
24
+ * Displays first and last pages if they are not in the current range of pages displayed.
25
+ */
26
+ displayFirstAndLastPages?: boolean;
27
+ /**
28
+ * Displays arrows to navigate to the previous and next pages.
29
+ */
30
+ displayNextAndPreviousArrows?: boolean;
31
+ /**
32
+ * Callback function called when the user triggers a page change.
33
+ */
34
+ onPageChange: ( currentPage: number ) => void;
35
+ /**
36
+ * Number of pages to display at the same time, including the active page
37
+ * and the pages displayed before and after it. It doesn't include the first
38
+ * and last pages.
39
+ */
40
+ pagesToDisplay?: number;
41
+ }
42
+
43
  const Pagination = ( {
44
  currentPage,
45
+ displayFirstAndLastPages = true,
46
+ displayNextAndPreviousArrows = true,
47
+ pagesToDisplay = 3,
48
  onPageChange,
49
  totalPages,
50
+ }: PaginationProps ): JSX.Element => {
51
  let { minIndex, maxIndex } = getIndexes(
52
  pagesToDisplay,
53
  currentPage,
54
  totalPages
55
  );
56
+
57
  const showFirstPage = displayFirstAndLastPages && Boolean( minIndex !== 1 );
58
  const showLastPage =
59
  displayFirstAndLastPages && Boolean( maxIndex !== totalPages );
60
  const showFirstPageEllipsis =
61
+ displayFirstAndLastPages && Boolean( minIndex && minIndex > 3 );
62
  const showLastPageEllipsis =
63
+ displayFirstAndLastPages &&
64
+ Boolean( maxIndex && maxIndex < totalPages - 2 );
65
 
66
  // Handle the cases where there would be an ellipsis replacing one single page
67
  if ( showFirstPage && minIndex === 3 ) {
121
  disabled={ currentPage === 1 }
122
  >
123
  <Label
124
+ label={ '1' }
125
  screenReaderLabel={ sprintf(
126
  /* translators: %d is the page number (1, 2, 3...). */
127
  __( 'Page %d', 'woo-gutenberg-products-block' ),
154
  ) }
155
  onClick={
156
  currentPage === page
157
+ ? undefined
158
  : () => onPageChange( page )
159
  }
160
  disabled={ currentPage === page }
161
  >
162
  <Label
163
+ label={ page.toString() }
164
  screenReaderLabel={ sprintf(
165
  /* translators: %d is the page number (1, 2, 3...). */
166
  __( 'Page %d', 'woo-gutenberg-products-block' ),
194
  disabled={ currentPage === totalPages }
195
  >
196
  <Label
197
+ label={ totalPages.toString() }
198
  screenReaderLabel={ sprintf(
199
  /* translators: %d is the page number (1, 2, 3...). */
200
  __( 'Page %d', 'woo-gutenberg-products-block' ),
223
  );
224
  };
225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  export default Pagination;
assets/js/base/components/pagination/test/index.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * Internal dependencies
3
  */
4
- import { getIndexes } from '../utils.js';
5
 
6
  describe( 'getIndexes', () => {
7
  describe( 'when on the first page', () => {
1
  /**
2
  * Internal dependencies
3
  */
4
+ import { getIndexes } from '../utils';
5
 
6
  describe( 'getIndexes', () => {
7
  describe( 'when on the first page', () => {
assets/js/base/components/pagination/{utils.js → utils.ts} RENAMED
@@ -7,7 +7,15 @@
7
  * @param {number} totalPages Total pages available.
8
  * @return {Object} Object containing the min and max index to display in the pagination component.
9
  */
10
- export const getIndexes = ( pagesToDisplay, currentPage, totalPages ) => {
 
 
 
 
 
 
 
 
11
  if ( totalPages <= 2 ) {
12
  return { minIndex: null, maxIndex: null };
13
  }
7
  * @param {number} totalPages Total pages available.
8
  * @return {Object} Object containing the min and max index to display in the pagination component.
9
  */
10
+ type minMaxIndex = {
11
+ minIndex: number | null;
12
+ maxIndex: number | null;
13
+ };
14
+ export const getIndexes = (
15
+ pagesToDisplay: number,
16
+ currentPage: number,
17
+ totalPages: number
18
+ ): minMaxIndex => {
19
  if ( totalPages <= 2 ) {
20
  return { minIndex: null, maxIndex: null };
21
  }
assets/js/base/components/product-list/{container.js → container.tsx} RENAMED
@@ -3,24 +3,28 @@
3
  */
4
  import { useState, useEffect } from '@wordpress/element';
5
  import PropTypes from 'prop-types';
 
6
 
7
  /**
8
  * Internal dependencies
9
  */
10
  import ProductList from './product-list';
 
11
 
12
- const ProductListContainer = ( { attributes } ) => {
 
 
13
  const [ currentPage, setPage ] = useState( 1 );
14
  const [ currentSort, setSort ] = useState( attributes.orderby );
15
  useEffect( () => {
16
  // if default sort is changed in editor
17
  setSort( attributes.orderby );
18
  }, [ attributes.orderby ] );
19
- const onPageChange = ( newPage ) => {
20
  setPage( newPage );
21
  };
22
- const onSortChange = ( event ) => {
23
- const newSortValue = event.target.value;
24
  setSort( newSortValue );
25
  setPage( 1 );
26
  };
3
  */
4
  import { useState, useEffect } from '@wordpress/element';
5
  import PropTypes from 'prop-types';
6
+ import type { HTMLElementEvent } from '@woocommerce/types';
7
 
8
  /**
9
  * Internal dependencies
10
  */
11
  import ProductList from './product-list';
12
+ import { ProductListContainerProps } from './types';
13
 
14
+ const ProductListContainer = ( {
15
+ attributes,
16
+ }: ProductListContainerProps ): JSX.Element => {
17
  const [ currentPage, setPage ] = useState( 1 );
18
  const [ currentSort, setSort ] = useState( attributes.orderby );
19
  useEffect( () => {
20
  // if default sort is changed in editor
21
  setSort( attributes.orderby );
22
  }, [ attributes.orderby ] );
23
+ const onPageChange = ( newPage: number ) => {
24
  setPage( newPage );
25
  };
26
+ const onSortChange = ( event: HTMLElementEvent< HTMLSelectElement > ) => {
27
+ const newSortValue = event?.target?.value;
28
  setSort( newSortValue );
29
  setPage( 1 );
30
  };
assets/js/base/components/product-list/{index.js → index.ts} RENAMED
File without changes
assets/js/base/components/product-list/{no-matching-products.js → no-matching-products.tsx} RENAMED
@@ -3,16 +3,22 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { useInnerBlockLayoutContext } from '@woocommerce/shared-context';
6
- import { Icon, search } from '@woocommerce/icons';
7
 
8
- const NoMatchingProducts = ( { resetCallback = () => {} } ) => {
 
 
 
 
 
 
 
9
  const { parentClassName } = useInnerBlockLayoutContext();
10
  return (
11
  <div className={ `${ parentClassName }__no-products` }>
12
  <Icon
13
  className={ `${ parentClassName }__no-products-image` }
14
- alt=""
15
- srcElement={ search }
16
  size={ 100 }
17
  />
18
  <strong className={ `${ parentClassName }__no-products-title` }>
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { useInnerBlockLayoutContext } from '@woocommerce/shared-context';
6
+ import { Icon, search } from '@wordpress/icons';
7
 
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import { NoMatchingProductsProps } from './types';
12
+
13
+ const NoMatchingProducts = ( {
14
+ resetCallback = () => void 0,
15
+ }: NoMatchingProductsProps ): JSX.Element => {
16
  const { parentClassName } = useInnerBlockLayoutContext();
17
  return (
18
  <div className={ `${ parentClassName }__no-products` }>
19
  <Icon
20
  className={ `${ parentClassName }__no-products-image` }
21
+ icon={ search }
 
22
  size={ 100 }
23
  />
24
  <strong className={ `${ parentClassName }__no-products-title` }>
assets/js/base/components/product-list/{no-products.js → no-products.tsx} RENAMED
@@ -3,16 +3,15 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { useInnerBlockLayoutContext } from '@woocommerce/shared-context';
6
- import { Icon, notice } from '@woocommerce/icons';
7
 
8
- const NoProducts = () => {
9
  const { parentClassName } = useInnerBlockLayoutContext();
10
  return (
11
  <div className={ `${ parentClassName }__no-products` }>
12
  <Icon
13
  className={ `${ parentClassName }__no-products-image` }
14
- alt=""
15
- srcElement={ notice }
16
  size={ 100 }
17
  />
18
  <strong className={ `${ parentClassName }__no-products-title` }>
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { useInnerBlockLayoutContext } from '@woocommerce/shared-context';
6
+ import { Icon, warning } from '@wordpress/icons';
7
 
8
+ const NoProducts = (): JSX.Element => {
9
  const { parentClassName } = useInnerBlockLayoutContext();
10
  return (
11
  <div className={ `${ parentClassName }__no-products` }>
12
  <Icon
13
  className={ `${ parentClassName }__no-products-image` }
14
+ icon={ warning }
 
15
  size={ 100 }
16
  />
17
  <strong className={ `${ parentClassName }__no-products-title` }>
assets/js/base/components/product-list/product-list-item/{index.js → index.tsx} RENAMED
@@ -1,7 +1,6 @@
1
  /**
2
  * External dependencies
3
  */
4
- import PropTypes from 'prop-types';
5
  import classnames from 'classnames';
6
  import { useInnerBlockLayoutContext } from '@woocommerce/shared-context';
7
  import { withInstanceId } from '@wordpress/compose';
@@ -10,8 +9,13 @@ import { withInstanceId } from '@wordpress/compose';
10
  * Internal dependencies
11
  */
12
  import { renderProductLayout } from './utils';
 
13
 
14
- const ProductListItem = ( { product, attributes, instanceId } ) => {
 
 
 
 
15
  const { layoutConfig } = attributes;
16
  const { parentClassName, parentName } = useInnerBlockLayoutContext();
17
  const isLoading = Object.keys( product ).length === 0;
@@ -35,11 +39,4 @@ const ProductListItem = ( { product, attributes, instanceId } ) => {
35
  );
36
  };
37
 
38
- ProductListItem.propTypes = {
39
- attributes: PropTypes.object.isRequired,
40
- product: PropTypes.object,
41
- // from withInstanceId
42
- instanceId: PropTypes.number.isRequired,
43
- };
44
-
45
  export default withInstanceId( ProductListItem );
1
  /**
2
  * External dependencies
3
  */
 
4
  import classnames from 'classnames';
5
  import { useInnerBlockLayoutContext } from '@woocommerce/shared-context';
6
  import { withInstanceId } from '@wordpress/compose';
9
  * Internal dependencies
10
  */
11
  import { renderProductLayout } from './utils';
12
+ import { ProductListItemProps } from '../types';
13
 
14
+ const ProductListItem = ( {
15
+ product = {},
16
+ attributes,
17
+ instanceId,
18
+ }: ProductListItemProps ): JSX.Element => {
19
  const { layoutConfig } = attributes;
20
  const { parentClassName, parentName } = useInnerBlockLayoutContext();
21
  const isLoading = Object.keys( product ).length === 0;
39
  );
40
  };
41
 
 
 
 
 
 
 
 
42
  export default withInstanceId( ProductListItem );
assets/js/base/components/product-list/product-list-item/{utils.js → utils.tsx} RENAMED
@@ -3,6 +3,12 @@
3
  */
4
  import { getBlockMap } from '@woocommerce/atomic-utils';
5
  import { Suspense } from '@wordpress/element';
 
 
 
 
 
 
6
 
7
  /**
8
  * Maps a layout config into atomic components.
@@ -13,21 +19,22 @@ import { Suspense } from '@wordpress/element';
13
  * @param {number} componentId Parent component ID needed for key generation.
14
  */
15
  export const renderProductLayout = (
16
- blockName,
17
- product,
18
- layoutConfig,
19
- componentId
20
- ) => {
21
  if ( ! layoutConfig ) {
22
  return;
23
  }
24
 
25
  const blockMap = getBlockMap( blockName );
26
-
27
  return layoutConfig.map( ( [ name, props = {} ], index ) => {
28
- let children = [];
29
 
30
  if ( !! props.children && props.children.length > 0 ) {
 
 
31
  children = renderProductLayout(
32
  blockName,
33
  product,
@@ -36,7 +43,9 @@ export const renderProductLayout = (
36
  );
37
  }
38
 
39
- const LayoutComponent = blockMap[ name ];
 
 
40
 
41
  if ( ! LayoutComponent ) {
42
  return null;
3
  */
4
  import { getBlockMap } from '@woocommerce/atomic-utils';
5
  import { Suspense } from '@wordpress/element';
6
+ import { ProductResponseItem } from '@woocommerce/type-defs/product-response';
7
+
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import { LayoutConfig } from '../types';
12
 
13
  /**
14
  * Maps a layout config into atomic components.
19
  * @param {number} componentId Parent component ID needed for key generation.
20
  */
21
  export const renderProductLayout = (
22
+ blockName: string,
23
+ product: Partial< ProductResponseItem >,
24
+ layoutConfig: LayoutConfig | undefined,
25
+ componentId: number
26
+ ): ( JSX.Element | null )[] | undefined => {
27
  if ( ! layoutConfig ) {
28
  return;
29
  }
30
 
31
  const blockMap = getBlockMap( blockName );
 
32
  return layoutConfig.map( ( [ name, props = {} ], index ) => {
33
+ let children = [] as ( JSX.Element | null )[] | undefined;
34
 
35
  if ( !! props.children && props.children.length > 0 ) {
36
+ // props.children here refers to the children stored in the block attributes. which
37
+ // has the same shape as `layoutConfig`, not React children, which has a different shape */
38
  children = renderProductLayout(
39
  blockName,
40
  product,
43
  );
44
  }
45
 
46
+ const LayoutComponent = blockMap[ name ] as React.ComponentType< {
47
+ product: Partial< ProductResponseItem >;
48
+ } >;
49
 
50
  if ( ! LayoutComponent ) {
51
  return null;
assets/js/base/components/product-list/{product-list.js → product-list.tsx} RENAMED
@@ -3,7 +3,6 @@
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
5
  import { isEqual } from 'lodash';
6
- import PropTypes from 'prop-types';
7
  import classnames from 'classnames';
8
  import Pagination from '@woocommerce/base-components/pagination';
9
  import { useEffect } from '@wordpress/element';
@@ -25,32 +24,45 @@ import NoProducts from './no-products';
25
  import NoMatchingProducts from './no-matching-products';
26
  import ProductSortSelect from './product-sort-select';
27
  import ProductListItem from './product-list-item';
 
 
 
 
 
 
 
 
28
  import './style.scss';
29
 
30
- const generateQuery = ( { sortValue, currentPage, attributes } ) => {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  const { columns, rows } = attributes;
32
- const getSortArgs = ( orderName ) => {
33
- switch ( orderName ) {
34
- case 'menu_order':
35
- case 'popularity':
36
- case 'rating':
37
- case 'price':
38
- return {
39
- orderby: orderName,
40
- order: 'asc',
41
- };
42
- case 'price-desc':
43
- return {
44
- orderby: 'price',
45
- order: 'desc',
46
- };
47
- case 'date':
48
- return {
49
- orderby: 'date',
50
- order: 'desc',
51
- };
52
- }
53
- };
54
 
55
  return {
56
  ...getSortArgs( sortValue ),
@@ -69,13 +81,13 @@ const generateQuery = ( { sortValue, currentPage, attributes } ) => {
69
  * @return {Object} Same query without pagination and sorting attributes.
70
  */
71
 
72
- const extractPaginationAndSortAttributes = ( query ) => {
73
  /* eslint-disable-next-line no-unused-vars */
74
  const { order, orderby, page, per_page: perPage, ...totalQuery } = query;
75
  return totalQuery || {};
76
  };
77
 
78
- const announceLoadingCompletion = ( totalProducts ) => {
79
  if ( ! Number.isFinite( totalProducts ) ) {
80
  return;
81
  }
@@ -98,7 +110,7 @@ const announceLoadingCompletion = ( totalProducts ) => {
98
  }
99
  };
100
 
101
- const areQueryTotalsDifferent = (
102
  { totalQuery: nextQuery, totalProducts: nextProducts },
103
  { totalQuery: currentQuery } = {}
104
  ) => ! isEqual( nextQuery, currentQuery ) && Number.isFinite( nextProducts );
@@ -110,7 +122,7 @@ const ProductList = ( {
110
  onSortChange,
111
  sortValue,
112
  scrollToTop,
113
- } ) => {
114
  // These are possible filters.
115
  const [ productAttributes, setProductAttributes ] = useQueryStateByKey(
116
  'attributes',
@@ -169,7 +181,7 @@ const ProductList = ( {
169
  totalQuery,
170
  ] );
171
 
172
- const onPaginationChange = ( newPage ) => {
173
  scrollToTop( { focusableSelector: 'a, button' } );
174
  onPageChange( newPage );
175
  };
@@ -195,7 +207,7 @@ const ProductList = ( {
195
  ! Number.isFinite( totalProducts ) &&
196
  Number.isFinite( previousQueryTotals?.totalProducts ) &&
197
  isEqual( totalQuery, previousQueryTotals?.totalQuery )
198
- ? Math.ceil( previousQueryTotals.totalProducts / perPage )
199
  : Math.ceil( totalProducts / perPage );
200
  const listProducts = products.length
201
  ? products
@@ -209,7 +221,7 @@ const ProductList = ( {
209
 
210
  return (
211
  <div className={ getClassnames() }>
212
- { contentVisibility.orderBy && hasProducts && (
213
  <ProductSortSelect
214
  onChange={ onSortChange }
215
  value={ sortValue }
@@ -228,7 +240,7 @@ const ProductList = ( {
228
  { ! hasProducts && ! hasFilters && <NoProducts /> }
229
  { hasProducts && (
230
  <ul className={ `${ parentClassName }__products` }>
231
- { listProducts.map( ( product = {}, i ) => (
232
  <ProductListItem
233
  key={ product.id || i }
234
  attributes={ attributes }
@@ -248,10 +260,4 @@ const ProductList = ( {
248
  );
249
  };
250
 
251
- ProductList.propTypes = {
252
- attributes: PropTypes.object.isRequired,
253
- // From withScrollToTop.
254
- scrollToTop: PropTypes.func,
255
- };
256
-
257
  export default withScrollToTop( ProductList );
3
  */
4
  import { __, _n, sprintf } from '@wordpress/i18n';
5
  import { isEqual } from 'lodash';
 
6
  import classnames from 'classnames';
7
  import Pagination from '@woocommerce/base-components/pagination';
8
  import { useEffect } from '@wordpress/element';
24
  import NoMatchingProducts from './no-matching-products';
25
  import ProductSortSelect from './product-sort-select';
26
  import ProductListItem from './product-list-item';
27
+ import {
28
+ GenerateQuery,
29
+ GetSortArgs,
30
+ Query,
31
+ AreQueryTotalsDifferent,
32
+ ProductListProps,
33
+ TotalQuery,
34
+ } from './types';
35
  import './style.scss';
36
 
37
+ const getSortArgs: GetSortArgs = ( orderName ) => {
38
+ switch ( orderName ) {
39
+ case 'menu_order':
40
+ case 'popularity':
41
+ case 'rating':
42
+ case 'price':
43
+ return {
44
+ orderby: orderName,
45
+ order: 'asc',
46
+ };
47
+ case 'price-desc':
48
+ return {
49
+ orderby: 'price',
50
+ order: 'desc',
51
+ };
52
+ case 'date':
53
+ return {
54
+ orderby: 'date',
55
+ order: 'desc',
56
+ };
57
+ }
58
+ };
59
+
60
+ const generateQuery: GenerateQuery = ( {
61
+ sortValue,
62
+ currentPage,
63
+ attributes,
64
+ } ) => {
65
  const { columns, rows } = attributes;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
  return {
68
  ...getSortArgs( sortValue ),
81
  * @return {Object} Same query without pagination and sorting attributes.
82
  */
83
 
84
+ const extractPaginationAndSortAttributes = ( query: Query ): TotalQuery => {
85
  /* eslint-disable-next-line no-unused-vars */
86
  const { order, orderby, page, per_page: perPage, ...totalQuery } = query;
87
  return totalQuery || {};
88
  };
89
 
90
+ const announceLoadingCompletion = ( totalProducts: number ): void => {
91
  if ( ! Number.isFinite( totalProducts ) ) {
92
  return;
93
  }
110
  }
111
  };
112
 
113
+ const areQueryTotalsDifferent: AreQueryTotalsDifferent = (
114
  { totalQuery: nextQuery, totalProducts: nextProducts },
115
  { totalQuery: currentQuery } = {}
116
  ) => ! isEqual( nextQuery, currentQuery ) && Number.isFinite( nextProducts );
122
  onSortChange,
123
  sortValue,
124
  scrollToTop,
125
+ }: ProductListProps ): JSX.Element => {
126
  // These are possible filters.
127
  const [ productAttributes, setProductAttributes ] = useQueryStateByKey(
128
  'attributes',
181
  totalQuery,
182
  ] );
183
 
184
+ const onPaginationChange = ( newPage: number ) => {
185
  scrollToTop( { focusableSelector: 'a, button' } );
186
  onPageChange( newPage );
187
  };
207
  ! Number.isFinite( totalProducts ) &&
208
  Number.isFinite( previousQueryTotals?.totalProducts ) &&
209
  isEqual( totalQuery, previousQueryTotals?.totalQuery )
210
+ ? Math.ceil( ( previousQueryTotals?.totalProducts || 0 ) / perPage )
211
  : Math.ceil( totalProducts / perPage );
212
  const listProducts = products.length
213
  ? products
221
 
222
  return (
223
  <div className={ getClassnames() }>
224
+ { contentVisibility?.orderBy && hasProducts && (
225
  <ProductSortSelect
226
  onChange={ onSortChange }
227
  value={ sortValue }
240
  { ! hasProducts && ! hasFilters && <NoProducts /> }
241
  { hasProducts && (
242
  <ul className={ `${ parentClassName }__products` }>
243
+ { listProducts.map( ( product = {}, i: number ) => (
244
  <ProductListItem
245
  key={ product.id || i }
246
  attributes={ attributes }
260
  );
261
  };
262
 
 
 
 
 
 
 
263
  export default withScrollToTop( ProductList );
assets/js/base/components/product-list/product-sort-select/{index.js → index.tsx} RENAMED
@@ -2,19 +2,20 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import PropTypes from 'prop-types';
6
  import SortSelect from '@woocommerce/base-components/sort-select';
7
-
8
  /**
9
  * Internal dependencies
10
  */
11
  import './style.scss';
 
12
 
13
- const ProductSortSelect = ( { onChange, readOnly, value } ) => {
 
 
 
14
  return (
15
  <SortSelect
16
  className="wc-block-product-sort-select wc-block-components-product-sort-select"
17
- name="orderby"
18
  onChange={ onChange }
19
  options={ [
20
  {
@@ -54,7 +55,6 @@ const ProductSortSelect = ( { onChange, readOnly, value } ) => {
54
  ),
55
  },
56
  ] }
57
- readOnly={ readOnly }
58
  screenReaderLabel={ __(
59
  'Order products by',
60
  'woo-gutenberg-products-block'
@@ -64,17 +64,4 @@ const ProductSortSelect = ( { onChange, readOnly, value } ) => {
64
  );
65
  };
66
 
67
- ProductSortSelect.propTypes = {
68
- onChange: PropTypes.func,
69
- readOnly: PropTypes.bool,
70
- value: PropTypes.oneOf( [
71
- 'menu_order',
72
- 'popularity',
73
- 'rating',
74
- 'date',
75
- 'price',
76
- 'price-desc',
77
- ] ),
78
- };
79
-
80
  export default ProductSortSelect;
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
 
5
  import SortSelect from '@woocommerce/base-components/sort-select';
 
6
  /**
7
  * Internal dependencies
8
  */
9
  import './style.scss';
10
+ import { ProductSortSelectProps } from '../types';
11
 
12
+ const ProductSortSelect = ( {
13
+ onChange,
14
+ value,
15
+ }: ProductSortSelectProps ): JSX.Element => {
16
  return (
17
  <SortSelect
18
  className="wc-block-product-sort-select wc-block-components-product-sort-select"
 
19
  onChange={ onChange }
20
  options={ [
21
  {
55
  ),
56
  },
57
  ] }
 
58
  screenReaderLabel={ __(
59
  'Order products by',
60
  'woo-gutenberg-products-block'
64
  );
65
  };
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  export default ProductSortSelect;
assets/js/base/components/product-list/types.ts ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { ChangeEventHandler } from 'react';
5
+ import { ProductResponseItem } from '@woocommerce/type-defs/product-response';
6
+
7
+ interface GenerateQueryProps {
8
+ sortValue: string;
9
+ currentPage: number;
10
+ attributes: Attributes;
11
+ }
12
+
13
+ export type LayoutConfig = [ string, { children?: LayoutConfig } ][];
14
+
15
+ export type Attributes = {
16
+ columns: number;
17
+ rows: number;
18
+ alignButtons?: string;
19
+ align?: string;
20
+ contentVisibility?: {
21
+ orderBy: string;
22
+ };
23
+ orderby?: string;
24
+ order?: string;
25
+ layoutConfig?: LayoutConfig;
26
+ };
27
+
28
+ export type Query = {
29
+ catalog_visibility: 'catalog';
30
+ per_page: number;
31
+ page: number;
32
+ orderby?: string;
33
+ order?: string;
34
+ };
35
+
36
+ export type TotalQuery = Pick< Query, 'catalog_visibility' >;
37
+
38
+ export type GenerateQuery = ( props: GenerateQueryProps ) => Query;
39
+
40
+ export type GetSortArgs = (
41
+ orderName: string
42
+ ) =>
43
+ | {
44
+ orderby: string;
45
+ order: string;
46
+ }
47
+ | undefined;
48
+
49
+ export type AreQueryTotalsDifferent = (
50
+ next: {
51
+ totalQuery: TotalQuery;
52
+ totalProducts: number;
53
+ },
54
+ current?: {
55
+ totalQuery?: TotalQuery;
56
+ }
57
+ ) => boolean;
58
+
59
+ export interface ProductListProps {
60
+ attributes: Attributes;
61
+ currentPage: number;
62
+ onPageChange: ( page: number ) => void;
63
+ onSortChange: ChangeEventHandler;
64
+ sortValue:
65
+ | 'menu_order'
66
+ | 'popularity'
67
+ | 'rating'
68
+ | 'date'
69
+ | 'price'
70
+ | 'price-desc';
71
+ scrollToTop: ( opts: { focusableSelector: string } ) => void;
72
+ }
73
+
74
+ export interface ProductSortSelectProps {
75
+ onChange: ChangeEventHandler;
76
+ value: ProductListProps[ 'sortValue' ];
77
+ }
78
+
79
+ export interface ProductListContainerProps {
80
+ attributes: Attributes;
81
+ }
82
+
83
+ export interface NoMatchingProductsProps {
84
+ resetCallback: () => void;
85
+ }
86
+
87
+ export interface ProductListItemProps {
88
+ product?: Partial< ProductResponseItem >;
89
+ attributes: Attributes;
90
+ instanceId: number;
91
+ }
92
+
93
+ export interface RenderProductLayoutProps {
94
+ blockName: string;
95
+ product: Partial< ProductResponseItem >;
96
+ layoutConfig: LayoutConfig;
97
+ componentId: number;
98
+ }
assets/js/base/components/radio-control/index.js DELETED
@@ -1,52 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import classnames from 'classnames';
5
- import { withInstanceId } from '@wordpress/compose';
6
-
7
- /**
8
- * Internal dependencies
9
- */
10
- import RadioControlOption from './option';
11
- import './style.scss';
12
-
13
- const RadioControl = ( {
14
- className = '',
15
- instanceId,
16
- id,
17
- selected,
18
- onChange = () => {},
19
- options = [],
20
- } ) => {
21
- const radioControlId = id || instanceId;
22
-
23
- return (
24
- options.length && (
25
- <div
26
- className={ classnames(
27
- 'wc-block-components-radio-control',
28
- className
29
- ) }
30
- >
31
- { options.map( ( option ) => (
32
- <RadioControlOption
33
- key={ `${ radioControlId }-${ option.value }` }
34
- name={ `radio-control-${ radioControlId }` }
35
- checked={ option.value === selected }
36
- option={ option }
37
- onChange={ ( value ) => {
38
- onChange( value );
39
- if ( typeof option.onChange === 'function' ) {
40
- option.onChange( value );
41
- }
42
- } }
43
- />
44
- ) ) }
45
- </div>
46
- )
47
- );
48
- };
49
-
50
- export default withInstanceId( RadioControl );
51
- export { RadioControlOption };
52
- export { default as RadioControlOptionLayout } from './option-layout';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/components/radio-control/index.tsx ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import classnames from 'classnames';
5
+ import { useInstanceId } from '@wordpress/compose';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import RadioControlOption from './option';
11
+ import type { RadioControlProps } from './types';
12
+ import './style.scss';
13
+
14
+ const RadioControl = ( {
15
+ className = '',
16
+ id,
17
+ selected,
18
+ onChange = () => void 0,
19
+ options = [],
20
+ }: RadioControlProps ): JSX.Element | null => {
21
+ const instanceId = useInstanceId( RadioControl );
22
+ const radioControlId = id || instanceId;
23
+
24
+ if ( ! options.length ) {
25
+ return null;
26
+ }
27
+
28
+ return (
29
+ <div
30
+ className={ classnames(
31
+ 'wc-block-components-radio-control',
32
+ className
33
+ ) }
34
+ >
35
+ { options.map( ( option ) => (
36
+ <RadioControlOption
37
+ key={ `${ radioControlId }-${ option.value }` }
38
+ name={ `radio-control-${ radioControlId }` }
39
+ checked={ option.value === selected }
40
+ option={ option }
41
+ onChange={ ( value: string ) => {
42
+ onChange( value );
43
+ if ( typeof option.onChange === 'function' ) {
44
+ option.onChange( value );
45
+ }
46
+ } }
47
+ />
48
+ ) ) }
49
+ </div>
50
+ );
51
+ };
52
+
53
+ export default RadioControl;
54
+ export { default as RadioControlOption } from './option';
55
+ export { default as RadioControlOptionLayout } from './option-layout';
assets/js/base/components/radio-control/option-layout.tsx CHANGED
@@ -1,8 +1,7 @@
1
  /**
2
- * External dependencies
3
  */
4
- import type { ReactElement } from 'react';
5
- import type { PackageRateOption } from '@woocommerce/type-defs/shipping';
6
 
7
  const OptionLayout = ( {
8
  label,
@@ -10,7 +9,7 @@ const OptionLayout = ( {
10
  description,
11
  secondaryDescription,
12
  id,
13
- }: Partial< PackageRateOption > ): ReactElement => {
14
  return (
15
  <div className="wc-block-components-radio-control__option-layout">
16
  <div className="wc-block-components-radio-control__label-group">
1
  /**
2
+ * Internal dependencies
3
  */
4
+ import type { RadioControlOptionLayout } from './types';
 
5
 
6
  const OptionLayout = ( {
7
  label,
9
  description,
10
  secondaryDescription,
11
  id,
12
+ }: RadioControlOptionLayout ): JSX.Element => {
13
  return (
14
  <div className="wc-block-components-radio-control__option-layout">
15
  <div className="wc-block-components-radio-control__label-group">
assets/js/base/components/radio-control/{option.js → option.tsx} RENAMED
@@ -7,8 +7,14 @@ import classnames from 'classnames';
7
  * Internal dependencies
8
  */
9
  import OptionLayout from './option-layout';
 
10
 
11
- const Option = ( { checked, name, onChange, option } ) => {
 
 
 
 
 
12
  const {
13
  value,
14
  label,
@@ -16,7 +22,8 @@ const Option = ( { checked, name, onChange, option } ) => {
16
  secondaryLabel,
17
  secondaryDescription,
18
  } = option;
19
- const onChangeValue = ( event ) => onChange( event.target.value );
 
20
 
21
  return (
22
  <label
7
  * Internal dependencies
8
  */
9
  import OptionLayout from './option-layout';
10
+ import type { RadioControlOptionProps } from './types';
11
 
12
+ const Option = ( {
13
+ checked,
14
+ name,
15
+ onChange,
16
+ option,
17
+ }: RadioControlOptionProps ): JSX.Element => {
18
  const {
19
  value,
20
  label,
22
  secondaryLabel,
23
  secondaryDescription,
24
  } = option;
25
+ const onChangeValue = ( event: React.ChangeEvent< HTMLInputElement > ) =>
26
+ onChange( event.target.value );
27
 
28
  return (
29
  <label
assets/js/base/components/radio-control/types.ts ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { ReactElement } from 'react';
5
+
6
+ export interface RadioControlProps {
7
+ // Class name for control.
8
+ className?: string;
9
+ // ID for the control.
10
+ id?: string;
11
+ // The selected option. This is a controlled component.
12
+ selected: string;
13
+ // Fired when an option is changed.
14
+ onChange: ( value: string ) => void;
15
+ // List of radio control options.
16
+ options: RadioControlOption[];
17
+ }
18
+
19
+ export interface RadioControlOptionProps {
20
+ checked: boolean;
21
+ name?: string;
22
+ onChange: ( value: string ) => void;
23
+ option: RadioControlOption;
24
+ }
25
+
26
+ interface RadioControlOptionContent {
27
+ label: string;
28
+ description?: string | ReactElement | undefined;
29
+ secondaryLabel?: string | ReactElement | undefined;
30
+ secondaryDescription?: string | undefined;
31
+ }
32
+
33
+ export interface RadioControlOption extends RadioControlOptionContent {
34
+ value: string;
35
+ onChange?: ( value: string ) => void;
36
+ }
37
+
38
+ export interface RadioControlOptionLayout extends RadioControlOptionContent {
39
+ id?: string;
40
+ }
assets/js/base/components/sort-select/{index.js → index.tsx} RENAMED
@@ -1,40 +1,63 @@
1
  /**
2
  * External dependencies
3
  */
4
- import PropTypes from 'prop-types';
5
  import classNames from 'classnames';
6
  import Label from '@woocommerce/base-components/label';
7
  import { withInstanceId } from '@wordpress/compose';
 
8
 
9
  /**
10
  * Internal dependencies
11
  */
12
  import './style.scss';
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  /**
15
  * Component used for 'Order by' selectors, which renders a label
16
  * and a <select> with the options provided in the props.
17
- *
18
- * @param {Object} props Incoming props for the component.
19
- * @param {string} props.className CSS class used.
20
- * @param {string} props.instanceId Unique id for component instance.
21
- * @param {string} props.label Label for the select.
22
- * @param {function():any} props.onChange Function to call on the change event.
23
- * @param {Array} props.options Option values for the select.
24
- * @param {string} props.screenReaderLabel Screen reader label.
25
- * @param {boolean} props.readOnly Whether the select is read only or not.
26
- * @param {string} props.value The selected value.
27
  */
28
  const SortSelect = ( {
29
  className,
30
  instanceId,
31
- label,
32
  onChange,
33
  options,
34
  screenReaderLabel,
35
- readOnly,
36
  value,
37
- } ) => {
38
  const selectId = `wc-block-components-sort-select__select-${ instanceId }`;
39
 
40
  return (
@@ -59,33 +82,17 @@ const SortSelect = ( {
59
  id={ selectId }
60
  className="wc-block-sort-select__select wc-block-components-sort-select__select"
61
  onChange={ onChange }
62
- readOnly={ readOnly }
63
  value={ value }
64
  >
65
- { options.map( ( option ) => (
66
- <option key={ option.key } value={ option.key }>
67
- { option.label }
68
- </option>
69
- ) ) }
 
70
  </select>
71
  </div>
72
  );
73
  };
74
 
75
- SortSelect.propTypes = {
76
- label: PropTypes.string,
77
- onChange: PropTypes.func,
78
- options: PropTypes.arrayOf(
79
- PropTypes.shape( {
80
- key: PropTypes.string.isRequired,
81
- label: PropTypes.string.isRequired,
82
- } )
83
- ),
84
- readOnly: PropTypes.bool,
85
- screenReaderLabel: PropTypes.string,
86
- value: PropTypes.string,
87
- // from withInstanceId
88
- instanceId: PropTypes.number.isRequired,
89
- };
90
-
91
  export default withInstanceId( SortSelect );
1
  /**
2
  * External dependencies
3
  */
 
4
  import classNames from 'classnames';
5
  import Label from '@woocommerce/base-components/label';
6
  import { withInstanceId } from '@wordpress/compose';
7
+ import { ChangeEventHandler } from 'react';
8
 
9
  /**
10
  * Internal dependencies
11
  */
12
  import './style.scss';
13
 
14
+ interface SortSelectProps {
15
+ /**
16
+ * Unique id for component instance.
17
+ */
18
+ instanceId: number;
19
+ /**
20
+ * CSS class used.
21
+ */
22
+ className?: string;
23
+ /**
24
+ * Label for the select.
25
+ */
26
+ label?: string;
27
+ /**
28
+ * Function to call on the change event.
29
+ */
30
+ onChange: ChangeEventHandler;
31
+ /**
32
+ * Option values for the select.
33
+ */
34
+ options: {
35
+ key: string;
36
+ label: string;
37
+ }[];
38
+ /**
39
+ * Screen reader label.
40
+ */
41
+ screenReaderLabel: string;
42
+ /**
43
+ * The selected value.
44
+ */
45
+ value: string;
46
+ }
47
+
48
  /**
49
  * Component used for 'Order by' selectors, which renders a label
50
  * and a <select> with the options provided in the props.
 
 
 
 
 
 
 
 
 
 
51
  */
52
  const SortSelect = ( {
53
  className,
54
  instanceId,
55
+ label = '',
56
  onChange,
57
  options,
58
  screenReaderLabel,
 
59
  value,
60
+ }: SortSelectProps ): JSX.Element => {
61
  const selectId = `wc-block-components-sort-select__select-${ instanceId }`;
62
 
63
  return (
82
  id={ selectId }
83
  className="wc-block-sort-select__select wc-block-components-sort-select__select"
84
  onChange={ onChange }
 
85
  value={ value }
86
  >
87
+ { options &&
88
+ options.map( ( option ) => (
89
+ <option key={ option.key } value={ option.key }>
90
+ { option.label }
91
+ </option>
92
+ ) ) }
93
  </select>
94
  </div>
95
  );
96
  };
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  export default withInstanceId( SortSelect );
assets/js/base/context/hooks/collections/{use-collection-header.js → use-collection-header.ts} RENAMED
@@ -5,6 +5,11 @@ import { COLLECTIONS_STORE_KEY as storeKey } from '@woocommerce/block-data';
5
  import { useSelect } from '@wordpress/data';
6
  import { useShallowEqual } from '@woocommerce/base-hooks';
7
 
 
 
 
 
 
8
  /**
9
  * This is a custom hook that is wired up to the `wc/store/collections` data
10
  * store. Given a header key and a collections option object, this will ensure a
@@ -36,7 +41,14 @@ import { useShallowEqual } from '@woocommerce/base-hooks';
36
  * - isLoading A boolean indicating whether the header is
37
  * loading (true) or not.
38
  */
39
- export const useCollectionHeader = ( headerKey, options ) => {
 
 
 
 
 
 
 
40
  const {
41
  namespace,
42
  resourceName,
5
  import { useSelect } from '@wordpress/data';
6
  import { useShallowEqual } from '@woocommerce/base-hooks';
7
 
8
+ /**
9
+ * Internal dependencies
10
+ */
11
+ import { useCollectionOptions } from '.';
12
+
13
  /**
14
  * This is a custom hook that is wired up to the `wc/store/collections` data
15
  * store. Given a header key and a collections option object, this will ensure a
41
  * - isLoading A boolean indicating whether the header is
42
  * loading (true) or not.
43
  */
44
+
45
+ export const useCollectionHeader = (
46
+ headerKey: string,
47
+ options: Omit< useCollectionOptions, 'shouldSelect' >
48
+ ): {
49
+ value: unknown;
50
+ isLoading: boolean;
51
+ } => {
52
  const {
53
  namespace,
54
  resourceName,
assets/js/base/context/hooks/collections/{use-collection.js → use-collection.ts} RENAMED
@@ -5,6 +5,7 @@ import { COLLECTIONS_STORE_KEY as storeKey } from '@woocommerce/block-data';
5
  import { useSelect } from '@wordpress/data';
6
  import { useRef } from '@wordpress/element';
7
  import { useShallowEqual, useThrowError } from '@woocommerce/base-hooks';
 
8
 
9
  /**
10
  * This is a custom hook that is wired up to the `wc/store/collections` data
@@ -38,7 +39,21 @@ import { useShallowEqual, useThrowError } from '@woocommerce/base-hooks';
38
  * - isLoading A boolean indicating whether the collection is
39
  * loading (true) or not.
40
  */
41
- export const useCollection = ( options ) => {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  const {
43
  namespace,
44
  resourceName,
@@ -52,7 +67,10 @@ export const useCollection = ( options ) => {
52
  'the resource properties.'
53
  );
54
  }
55
- const currentResults = useRef( { results: [], isLoading: true } );
 
 
 
56
  // ensure we feed the previous reference if it's equivalent
57
  const currentQuery = useShallowEqual( query );
58
  const currentResourceValues = useShallowEqual( resourceValues );
@@ -72,11 +90,17 @@ export const useCollection = ( options ) => {
72
  const error = store.getCollectionError( ...args );
73
 
74
  if ( error ) {
75
- throwError( error );
 
 
 
 
 
 
76
  }
77
 
78
  return {
79
- results: store.getCollection( ...args ),
80
  isLoading: ! store.hasFinishedResolution(
81
  'getCollection',
82
  args
5
  import { useSelect } from '@wordpress/data';
6
  import { useRef } from '@wordpress/element';
7
  import { useShallowEqual, useThrowError } from '@woocommerce/base-hooks';
8
+ import { isError, Query } from '@woocommerce/types';
9
 
10
  /**
11
  * This is a custom hook that is wired up to the `wc/store/collections` data
39
  * - isLoading A boolean indicating whether the collection is
40
  * loading (true) or not.
41
  */
42
+
43
+ export interface useCollectionOptions {
44
+ namespace: string;
45
+ resourceName: string;
46
+ resourceValues?: number[];
47
+ query: Query;
48
+ shouldSelect?: boolean;
49
+ }
50
+
51
+ export const useCollection = (
52
+ options: useCollectionOptions
53
+ ): {
54
+ results: unknown;
55
+ isLoading: boolean;
56
+ } => {
57
  const {
58
  namespace,
59
  resourceName,
67
  'the resource properties.'
68
  );
69
  }
70
+ const currentResults = useRef< { results: unknown; isLoading: boolean } >( {
71
+ results: [],
72
+ isLoading: true,
73
+ } );
74
  // ensure we feed the previous reference if it's equivalent
75
  const currentQuery = useShallowEqual( query );
76
  const currentResourceValues = useShallowEqual( resourceValues );
90
  const error = store.getCollectionError( ...args );
91
 
92
  if ( error ) {
93
+ if ( isError( error ) ) {
94
+ throwError( error );
95
+ } else {
96
+ throw new Error(
97
+ 'TypeError: `error` object is not an instance of Error constructor'
98
+ );
99
+ }
100
  }
101
 
102
  return {
103
+ results: store.getCollection< T >( ...args ),
104
  isLoading: ! store.hasFinishedResolution(
105
  'getCollection',
106
  args
assets/js/base/context/hooks/shipping/index.js CHANGED
@@ -1,2 +1 @@
1
  export * from './use-select-shipping-rate';
2
- export * from './use-select-shipping-rates';
1
  export * from './use-select-shipping-rate';
 
assets/js/base/context/hooks/shipping/use-select-shipping-rate.ts CHANGED
@@ -1,81 +1,70 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { useState, useEffect, useRef, useCallback } from '@wordpress/element';
5
- import isShallowEqual from '@wordpress/is-shallow-equal';
6
- import { CartShippingPackageShippingRate } from '@woocommerce/type-defs/cart';
 
7
 
8
  /**
9
  * Internal dependencies
10
  */
11
- import { useSelectShippingRates } from './use-select-shipping-rates';
12
  import { useStoreEvents } from '../use-store-events';
13
 
14
  /**
15
- * Selected rates are derived by looping over the shipping rates.
16
  *
17
- * @param {Array} shippingRates Array of shipping rates.
18
- * @return {string} Selected rate id.
19
- */
20
- // This will find the selected rate ID in an array of shipping rates.
21
- const deriveSelectedRateId = (
22
- shippingRates: CartShippingPackageShippingRate[]
23
- ) => shippingRates.find( ( rate ) => rate.selected )?.rate_id;
24
-
25
- /**
26
- * This is a custom hook for tracking selected shipping rates for a package and selecting a rate. State is used so
27
- * changes are reflected in the UI instantly.
28
- *
29
- * @param {string} packageId Package ID to select rates for.
30
- * @param {Array} shippingRates an array of packages with shipping rates.
31
  * @return {Object} This hook will return an object with these properties:
32
  * - selectShippingRate: A function that immediately returns the selected rate and dispatches an action generator.
33
- * - selectedShippingRate: The selected rate id.
34
  * - isSelectingRate: True when rates are being resolved to the API.
35
  */
36
- export const useSelectShippingRate = (
37
- packageId: string | number,
38
- shippingRates: CartShippingPackageShippingRate[]
39
- ): {
40
- selectShippingRate: ( newShippingRateId: string ) => unknown;
41
- selectedShippingRate: string | undefined;
 
42
  isSelectingRate: boolean;
43
  } => {
 
44
  const { dispatchCheckoutEvent } = useStoreEvents();
45
 
46
- // Rates are selected via the shipping data context provider.
47
- const { selectShippingRate, isSelectingRate } = useSelectShippingRates();
48
-
49
- // Selected rates are stored in state. This allows shipping rates changes to be shown in the UI instantly.
50
- // Defaults to the currently selected rate_id.
51
- const [ selectedShippingRate, setSelectedShippingRate ] = useState( () =>
52
- deriveSelectedRateId( shippingRates )
53
- );
54
-
55
- // This ref is used to track when changes come in via the props. When the incoming shipping rates change, update our local state if there are changes to selected methods.
56
- const currentShippingRates = useRef( shippingRates );
57
- useEffect( () => {
58
- if ( ! isShallowEqual( currentShippingRates.current, shippingRates ) ) {
59
- currentShippingRates.current = shippingRates;
60
- setSelectedShippingRate( deriveSelectedRateId( shippingRates ) );
61
- }
62
- }, [ shippingRates ] );
63
 
64
- // Sets a rate for a package in state (so changes are shown right away to consumers of the hook) and in the stores.
65
- const setPackageRateId = useCallback(
66
- ( newShippingRateId ) => {
67
- setSelectedShippingRate( newShippingRateId );
68
- selectShippingRate( newShippingRateId, packageId );
69
- dispatchCheckoutEvent( 'set-selected-shipping-rate', {
70
- shippingRateId: newShippingRateId,
71
- } );
 
 
 
 
 
72
  },
73
- [ packageId, selectShippingRate, dispatchCheckoutEvent ]
74
  );
75
 
 
 
 
 
 
76
  return {
77
- selectShippingRate: setPackageRateId,
78
- selectedShippingRate,
79
  isSelectingRate,
80
  };
81
  };
1
  /**
2
  * External dependencies
3
  */
4
+ import { useDispatch, useSelect } from '@wordpress/data';
5
+ import { useCallback } from '@wordpress/element';
6
+ import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
7
+ import { useThrowError } from '@woocommerce/base-hooks';
8
 
9
  /**
10
  * Internal dependencies
11
  */
 
12
  import { useStoreEvents } from '../use-store-events';
13
 
14
  /**
15
+ * This is a custom hook for selecting shipping rates for a shipping package.
16
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  * @return {Object} This hook will return an object with these properties:
18
  * - selectShippingRate: A function that immediately returns the selected rate and dispatches an action generator.
 
19
  * - isSelectingRate: True when rates are being resolved to the API.
20
  */
21
+ export const useSelectShippingRate = (): {
22
+ // Returns a function that accepts a shipping rate ID and a package ID.
23
+ selectShippingRate: (
24
+ newShippingRateId: string,
25
+ packageId: string | number
26
+ ) => unknown;
27
+ // True when a rate is currently being selected and persisted to the server.
28
  isSelectingRate: boolean;
29
  } => {
30
+ const throwError = useThrowError();
31
  const { dispatchCheckoutEvent } = useStoreEvents();
32
 
33
+ const { selectShippingRate: dispatchSelectShippingRate } = ( useDispatch(
34
+ storeKey
35
+ ) as {
36
+ selectShippingRate: unknown;
37
+ } ) as {
38
+ selectShippingRate: (
39
+ newShippingRateId: string,
40
+ packageId: string | number
41
+ ) => Promise< unknown >;
42
+ };
 
 
 
 
 
 
 
43
 
44
+ // Selects a shipping rate, fires an event, and catch any errors.
45
+ const selectShippingRate = useCallback(
46
+ ( newShippingRateId, packageId ) => {
47
+ dispatchSelectShippingRate( newShippingRateId, packageId )
48
+ .then( () => {
49
+ dispatchCheckoutEvent( 'set-selected-shipping-rate', {
50
+ shippingRateId: newShippingRateId,
51
+ } );
52
+ } )
53
+ .catch( ( error ) => {
54
+ // Throw an error because an error when selecting a rate is problematic.
55
+ throwError( error );
56
+ } );
57
  },
58
+ [ dispatchSelectShippingRate, dispatchCheckoutEvent, throwError ]
59
  );
60
 
61
+ // See if rates are being selected.
62
+ const isSelectingRate = useSelect< boolean >( ( select ) => {
63
+ return select( storeKey ).isShippingRateBeingSelected();
64
+ }, [] );
65
+
66
  return {
67
+ selectShippingRate,
 
68
  isSelectingRate,
69
  };
70
  };
assets/js/base/context/hooks/shipping/use-select-shipping-rates.ts DELETED
@@ -1,55 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { useDispatch, useSelect } from '@wordpress/data';
5
- import { useCallback } from '@wordpress/element';
6
- import { CART_STORE_KEY as storeKey } from '@woocommerce/block-data';
7
- import { useThrowError } from '@woocommerce/base-hooks';
8
-
9
- /**
10
- * This is a custom hook for selecting shipping rates
11
- *
12
- * @return {Object} This hook will return an object with these properties:
13
- * - selectShippingRate: A function that immediately returns the selected rate and dispatches an action generator.
14
- * - isSelectingRate: True when rates are being resolved to the API.
15
- */
16
- export const useSelectShippingRates = (): {
17
- selectShippingRate: (
18
- newShippingRateId: string,
19
- packageId: string | number
20
- ) => unknown;
21
- isSelectingRate: boolean;
22
- } => {
23
- const throwError = useThrowError();
24
- const { selectShippingRate } = ( useDispatch( storeKey ) as {
25
- selectShippingRate: unknown;
26
- } ) as {
27
- selectShippingRate: (
28
- newShippingRateId: string,
29
- packageId: string | number
30
- ) => Promise< unknown >;
31
- };
32
-
33
- // Sets a rate for a package in state (so changes are shown right away to consumers of the hook) and in the stores.
34
- const setRate = useCallback(
35
- ( newShippingRateId, packageId ) => {
36
- selectShippingRate( newShippingRateId, packageId ).catch(
37
- ( error ) => {
38
- // we throw this error because an error on selecting a rate is problematic.
39
- throwError( error );
40
- }
41
- );
42
- },
43
- [ throwError, selectShippingRate ]
44
- );
45
-
46
- // See if rates are being selected.
47
- const isSelectingRate = useSelect< boolean >( ( select ) => {
48
- return select( storeKey ).isShippingRateBeingSelected();
49
- }, [] );
50
-
51
- return {
52
- selectShippingRate: setRate,
53
- isSelectingRate,
54
- };
55
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/base/context/hooks/{use-store-products.js → use-store-products.ts} RENAMED
@@ -1,3 +1,7 @@
 
 
 
 
1
  /**
2
  * Internal dependencies
3
  */
@@ -20,7 +24,13 @@ import { useCollectionHeader, useCollection } from './collections';
20
  * - productsLoading A boolean indicating whether the products
21
  * are still loading or not.
22
  */
23
- export const useStoreProducts = ( query ) => {
 
 
 
 
 
 
24
  const collectionOptions = {
25
  namespace: '/wc/store',
26
  resourceName: 'products',
@@ -34,8 +44,8 @@ export const useStoreProducts = ( query ) => {
34
  query,
35
  } );
36
  return {
37
- products,
38
- totalProducts: parseInt( totalProducts, 10 ),
39
  productsLoading,
40
  };
41
  };
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { Query, ProductResponseItem } from '@woocommerce/types';
5
  /**
6
  * Internal dependencies
7
  */
24
  * - productsLoading A boolean indicating whether the products
25
  * are still loading or not.
26
  */
27
+ export const useStoreProducts = (
28
+ query: Query
29
+ ): {
30
+ products: ProductResponseItem[];
31
+ totalProducts: number;
32
+ productsLoading: boolean;
33
+ } => {
34
  const collectionOptions = {
35
  namespace: '/wc/store',
36
  resourceName: 'products',
44
  query,
45
  } );
46
  return {
47
+ products: products as ProductResponseItem[], // TODO: Remove this once getCollection selector and resolver is converted to TS.
48
+ totalProducts: parseInt( totalProducts as string, 10 ),
49
  productsLoading,
50
  };
51
  };
assets/js/base/context/providers/add-to-cart-form/form/submit/index.js CHANGED
@@ -5,6 +5,7 @@ import { __ } from '@wordpress/i18n';
5
  import triggerFetch from '@wordpress/api-fetch';
6
  import { useEffect, useCallback, useState } from '@wordpress/element';
7
  import { decodeEntities } from '@wordpress/html-entities';
 
8
 
9
  /**
10
  * Internal dependencies
@@ -107,6 +108,7 @@ const FormSubmit = () => {
107
  } else {
108
  receiveCart( response );
109
  }
 
110
  dispatchActions.setAfterProcessing( response );
111
  setIsSubmitting( false );
112
  } );
5
  import triggerFetch from '@wordpress/api-fetch';
6
  import { useEffect, useCallback, useState } from '@wordpress/element';
7
  import { decodeEntities } from '@wordpress/html-entities';
8
+ import { triggerAddedToCartEvent } from '@woocommerce/base-utils';
9
 
10
  /**
11
  * Internal dependencies
108
  } else {
109
  receiveCart( response );
110
  }
111
+ triggerAddedToCartEvent( { preserveCartData: true } );
112
  dispatchActions.setAfterProcessing( response );
113
  setIsSubmitting( false );
114
  } );
assets/js/base/context/providers/cart-checkout/shipping/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
  import { useCheckoutContext } from '../checkout-state';
28
  import { useCustomerDataContext } from '../customer';
29
  import { useStoreCart } from '../../../hooks/cart/use-store-cart';
30
- import { useSelectShippingRates } from '../../../hooks/shipping/use-select-shipping-rates';
31
 
32
  /**
33
  * @typedef {import('@woocommerce/type-defs/contexts').ShippingDataContext} ShippingDataContext
@@ -60,7 +60,7 @@ export const ShippingDataProvider = ( { children } ) => {
60
  shippingRatesLoading,
61
  cartErrors,
62
  } = useStoreCart();
63
- const { selectShippingRate, isSelectingRate } = useSelectShippingRates();
64
  const [ shippingErrorStatus, dispatchErrorStatus ] = useReducer(
65
  errorStatusReducer,
66
  NONE
27
  import { useCheckoutContext } from '../checkout-state';
28
  import { useCustomerDataContext } from '../customer';
29
  import { useStoreCart } from '../../../hooks/cart/use-store-cart';
30
+ import { useSelectShippingRate } from '../../../hooks/shipping/use-select-shipping-rate';
31
 
32
  /**
33
  * @typedef {import('@woocommerce/type-defs/contexts').ShippingDataContext} ShippingDataContext
60
  shippingRatesLoading,
61
  cartErrors,
62
  } = useStoreCart();
63
+ const { selectShippingRate, isSelectingRate } = useSelectShippingRate();
64
  const [ shippingErrorStatus, dispatchErrorStatus ] = useReducer(
65
  errorStatusReducer,
66
  NONE
assets/js/blocks-registry/block-components/{get-registered-block-components.js → get-registered-block-components.ts} RENAMED
@@ -2,6 +2,7 @@
2
  * External dependencies
3
  */
4
  import deprecated from '@wordpress/deprecated';
 
5
 
6
  /**
7
  * Internal dependencies
@@ -21,7 +22,9 @@ import { registeredBlockComponents } from './registered-block-components-init';
21
  * as well as any Components registered under all contexts.
22
  * @return {Object} List of React Components registered under the provided context.
23
  */
24
- export function getRegisteredBlockComponents( context ) {
 
 
25
  const parentInnerBlocks =
26
  typeof registeredBlockComponents[ context ] === 'object' &&
27
  Object.keys( registeredBlockComponents[ context ] ).length > 0
@@ -40,7 +43,9 @@ export function getRegisteredBlockComponents( context ) {
40
  * @param {string} main Name of the parent block to retrieve children of.
41
  * @return {Object} List of registered inner blocks.
42
  */
43
- export function getRegisteredInnerBlocks( main ) {
 
 
44
  deprecated( 'getRegisteredInnerBlocks', {
45
  version: '2.8.0',
46
  alternative: 'getRegisteredBlockComponents',
2
  * External dependencies
3
  */
4
  import deprecated from '@wordpress/deprecated';
5
+ import type { RegisteredBlockComponent } from '@woocommerce/types';
6
 
7
  /**
8
  * Internal dependencies
22
  * as well as any Components registered under all contexts.
23
  * @return {Object} List of React Components registered under the provided context.
24
  */
25
+ export function getRegisteredBlockComponents(
26
+ context: string
27
+ ): Record< string, RegisteredBlockComponent > {
28
  const parentInnerBlocks =
29
  typeof registeredBlockComponents[ context ] === 'object' &&
30
  Object.keys( registeredBlockComponents[ context ] ).length > 0
43
  * @param {string} main Name of the parent block to retrieve children of.
44
  * @return {Object} List of registered inner blocks.
45
  */
46
+ export function getRegisteredInnerBlocks(
47
+ main: string
48
+ ): Record< string, RegisteredBlockComponent > {
49
  deprecated( 'getRegisteredInnerBlocks', {
50
  version: '2.8.0',
51
  alternative: 'getRegisteredBlockComponents',
assets/js/blocks-registry/block-components/registered-block-components-init.js DELETED
@@ -1,3 +0,0 @@
1
- const registeredBlockComponents = {};
2
-
3
- export { registeredBlockComponents };
 
 
 
assets/js/blocks-registry/block-components/registered-block-components-init.ts ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import type { RegisteredBlockComponent } from '@woocommerce/types';
5
+
6
+ const registeredBlockComponents: Record<
7
+ string,
8
+ Record< string, RegisteredBlockComponent >
9
+ > = {};
10
+
11
+ export { registeredBlockComponents };
assets/js/blocks/active-filters/index.js CHANGED
@@ -3,7 +3,8 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
- import { Icon, toggle } from '@woocommerce/icons';
 
7
  import classNames from 'classnames';
8
  import { useBlockProps } from '@wordpress/block-editor';
9
 
@@ -18,7 +19,7 @@ registerBlockType( 'woocommerce/active-filters', {
18
  icon: {
19
  src: (
20
  <Icon
21
- srcElement={ toggle }
22
  className="wc-block-editor-components-block-icon"
23
  />
24
  ),
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
+ import { toggle } from '@woocommerce/icons';
7
+ import { Icon } from '@wordpress/icons';
8
  import classNames from 'classnames';
9
  import { useBlockProps } from '@wordpress/block-editor';
10
 
19
  icon: {
20
  src: (
21
  <Icon
22
+ icon={ toggle }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
assets/js/blocks/attribute-filter/block.js CHANGED
@@ -18,6 +18,7 @@ import FilterSubmitButton from '@woocommerce/base-components/filter-submit-butto
18
  import isShallowEqual from '@wordpress/is-shallow-equal';
19
  import { decodeEntities } from '@wordpress/html-entities';
20
  import { Notice } from '@wordpress/components';
 
21
 
22
  /**
23
  * Internal dependencies
@@ -25,6 +26,7 @@ import { Notice } from '@wordpress/components';
25
  import { getAttributeFromID } from '../../utils/attributes';
26
  import { updateAttributeFilter } from '../../utils/attributes-query';
27
  import { previewAttributeObject, previewOptions } from './preview';
 
28
  import './style.scss';
29
 
30
  /**
@@ -50,6 +52,8 @@ const AttributeFilterBlock = ( {
50
  : []
51
  );
52
 
 
 
53
  const [ queryState ] = useQueryStateByContext();
54
  const [
55
  productAttributesQuery,
@@ -381,7 +385,11 @@ const AttributeFilterBlock = ( {
381
  <DropdownSelector
382
  attributeLabel={ attributeObject.label }
383
  checked={ checked }
384
- className={ 'wc-block-attribute-filter-dropdown' }
 
 
 
 
385
  inputLabel={ blockAttributes.heading }
386
  isLoading={ isLoading }
387
  multiple={ multiple }
18
  import isShallowEqual from '@wordpress/is-shallow-equal';
19
  import { decodeEntities } from '@wordpress/html-entities';
20
  import { Notice } from '@wordpress/components';
21
+ import classNames from 'classnames';
22
 
23
  /**
24
  * Internal dependencies
26
  import { getAttributeFromID } from '../../utils/attributes';
27
  import { updateAttributeFilter } from '../../utils/attributes-query';
28
  import { previewAttributeObject, previewOptions } from './preview';
29
+ import { useBorderProps } from '../../hooks/style-attributes';
30
  import './style.scss';
31
 
32
  /**
52
  : []
53
  );
54
 
55
+ const borderProps = useBorderProps( blockAttributes );
56
+
57
  const [ queryState ] = useQueryStateByContext();
58
  const [
59
  productAttributesQuery,
385
  <DropdownSelector
386
  attributeLabel={ attributeObject.label }
387
  checked={ checked }
388
+ className={ classNames(
389
+ 'wc-block-attribute-filter-dropdown',
390
+ borderProps.className
391
+ ) }
392
+ style={ { ...borderProps.style, borderStyle: 'none' } }
393
  inputLabel={ blockAttributes.heading }
394
  isLoading={ isLoading }
395
  multiple={ multiple }
assets/js/blocks/attribute-filter/edit.js CHANGED
@@ -3,7 +3,11 @@
3
  */
4
  import { __, sprintf, _n } from '@wordpress/i18n';
5
  import { useState } from '@wordpress/element';
6
- import { InspectorControls, BlockControls } from '@wordpress/block-editor';
 
 
 
 
7
  import {
8
  Placeholder,
9
  Disabled,
@@ -13,7 +17,7 @@ import {
13
  ToolbarGroup,
14
  withSpokenMessages,
15
  } from '@wordpress/components';
16
- import { Icon, server, external } from '@woocommerce/icons';
17
  import { SearchListControl } from '@woocommerce/editor-components/search-list-control';
18
  import { mapValues, toArray, sortBy } from 'lodash';
19
  import { getAdminLink, getSetting } from '@woocommerce/settings';
@@ -47,6 +51,8 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
47
  ! attributeId && ! isPreview
48
  );
49
 
 
 
50
  const getBlockControls = () => {
51
  return (
52
  <BlockControls>
@@ -222,7 +228,7 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
222
  const noAttributesPlaceholder = () => (
223
  <Placeholder
224
  className="wc-block-attribute-filter"
225
- icon={ <Icon srcElement={ server } /> }
226
  label={ __(
227
  'Filter Products by Attribute',
228
  'woo-gutenberg-products-block'
@@ -247,7 +253,7 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
247
  >
248
  { __( 'Add new attribute', 'woo-gutenberg-products-block' ) +
249
  ' ' }
250
- <Icon srcElement={ external } />
251
  </Button>
252
  <Button
253
  className="wc-block-attribute-filter__read_more_button"
@@ -356,7 +362,7 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
356
  return (
357
  <Placeholder
358
  className="wc-block-attribute-filter"
359
- icon={ <Icon srcElement={ server } /> }
360
  label={ __(
361
  'Filter Products by Attribute',
362
  'woo-gutenberg-products-block'
@@ -379,7 +385,7 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
379
  return Object.keys( ATTRIBUTES ).length === 0 ? (
380
  noAttributesPlaceholder()
381
  ) : (
382
- <>
383
  { getBlockControls() }
384
  { getInspectorControls() }
385
  { isEditing ? (
@@ -404,7 +410,7 @@ const Edit = ( { attributes, setAttributes, debouncedSpeak } ) => {
404
  </Disabled>
405
  </div>
406
  ) }
407
- </>
408
  );
409
  };
410
 
3
  */
4
  import { __, sprintf, _n } from '@wordpress/i18n';
5
  import { useState } from '@wordpress/element';
6
+ import {
7
+ InspectorControls,
8
+ BlockControls,
9
+ useBlockProps,
10
+ } from '@wordpress/block-editor';
11
  import {
12
  Placeholder,
13
  Disabled,
17
  ToolbarGroup,
18
  withSpokenMessages,
19
  } from '@wordpress/components';
20
+ import { Icon, category, external } from '@wordpress/icons';
21
  import { SearchListControl } from '@woocommerce/editor-components/search-list-control';
22
  import { mapValues, toArray, sortBy } from 'lodash';
23
  import { getAdminLink, getSetting } from '@woocommerce/settings';
51
  ! attributeId && ! isPreview
52
  );
53
 
54
+ const blockProps = useBlockProps();
55
+
56
  const getBlockControls = () => {
57
  return (
58
  <BlockControls>
228
  const noAttributesPlaceholder = () => (
229
  <Placeholder
230
  className="wc-block-attribute-filter"
231
+ icon={ <Icon icon={ category } /> }
232
  label={ __(
233
  'Filter Products by Attribute',
234
  'woo-gutenberg-products-block'
253
  >
254
  { __( 'Add new attribute', 'woo-gutenberg-products-block' ) +
255
  ' ' }
256
+ <Icon icon={ external } />
257
  </Button>
258
  <Button
259
  className="wc-block-attribute-filter__read_more_button"
362
  return (
363
  <Placeholder
364
  className="wc-block-attribute-filter"
365
+ icon={ <Icon icon={ category } /> }
366
  label={ __(
367
  'Filter Products by Attribute',
368
  'woo-gutenberg-products-block'
385
  return Object.keys( ATTRIBUTES ).length === 0 ? (
386
  noAttributesPlaceholder()
387
  ) : (
388
+ <div { ...blockProps }>
389
  { getBlockControls() }
390
  { getInspectorControls() }
391
  { isEditing ? (
410
  </Disabled>
411
  </div>
412
  ) }
413
+ </div>
414
  );
415
  };
416
 
assets/js/blocks/attribute-filter/editor.scss CHANGED
@@ -1,3 +1,10 @@
 
 
 
 
 
 
 
1
  .wc-block-attribute-filter {
2
  .components-placeholder__instructions {
3
  border-bottom: 1px solid #e0e2e6;
@@ -33,4 +40,10 @@
33
  display: block;
34
  margin-bottom: 1em;
35
  }
 
 
 
 
 
 
36
  }
1
+ .editor-styles-wrapper .wp-block-woocommerce-attribute-filter {
2
+ // We need to override it because by default the global styles applied the border-style: solid;
3
+ // Our goal is not to have a border on main wrapper DOM element
4
+ border-style: none !important;
5
+ }
6
+
7
+
8
  .wc-block-attribute-filter {
9
  .components-placeholder__instructions {
10
  border-bottom: 1px solid #e0e2e6;
40
  display: block;
41
  margin-bottom: 1em;
42
  }
43
+
44
+ .components-disabled {
45
+ border-radius: inherit;
46
+ border-color: inherit;
47
+ }
48
+
49
  }
assets/js/blocks/attribute-filter/index.js CHANGED
@@ -3,7 +3,9 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
- import { Icon, server } from '@woocommerce/icons';
 
 
7
  import classNames from 'classnames';
8
 
9
  /**
@@ -12,11 +14,12 @@ import classNames from 'classnames';
12
  import edit from './edit.js';
13
 
14
  registerBlockType( 'woocommerce/attribute-filter', {
 
15
  title: __( 'Filter Products by Attribute', 'woo-gutenberg-products-block' ),
16
  icon: {
17
  src: (
18
  <Icon
19
- srcElement={ server }
20
  className="wc-block-editor-components-block-icon"
21
  />
22
  ),
@@ -29,6 +32,17 @@ registerBlockType( 'woocommerce/attribute-filter', {
29
  ),
30
  supports: {
31
  html: false,
 
 
 
 
 
 
 
 
 
 
 
32
  },
33
  example: {
34
  attributes: {
@@ -103,7 +117,9 @@ registerBlockType( 'woocommerce/attribute-filter', {
103
  }
104
  return (
105
  <div
106
- className={ classNames( 'is-loading', className ) }
 
 
107
  { ...data }
108
  >
109
  <span
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
+ import { useBlockProps } from '@wordpress/block-editor';
7
+ import { isFeaturePluginBuild } from '@woocommerce/block-settings';
8
+ import { Icon, category } from '@wordpress/icons';
9
  import classNames from 'classnames';
10
 
11
  /**
14
  import edit from './edit.js';
15
 
16
  registerBlockType( 'woocommerce/attribute-filter', {
17
+ apiVersion: 2,
18
  title: __( 'Filter Products by Attribute', 'woo-gutenberg-products-block' ),
19
  icon: {
20
  src: (
21
  <Icon
22
+ icon={ category }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
32
  ),
33
  supports: {
34
  html: false,
35
+ color: {
36
+ text: true,
37
+ background: false,
38
+ },
39
+ ...( isFeaturePluginBuild() && {
40
+ __experimentalBorder: {
41
+ radius: true,
42
+ color: true,
43
+ width: false,
44
+ },
45
+ } ),
46
  },
47
  example: {
48
  attributes: {
117
  }
118
  return (
119
  <div
120
+ { ...useBlockProps.save( {
121
+ className: classNames( 'is-loading', className ),
122
+ } ) }
123
  { ...data }
124
  >
125
  <span
assets/js/blocks/attribute-filter/style.scss CHANGED
@@ -1,9 +1,19 @@
 
 
 
 
 
 
1
  .wc-block-attribute-filter {
2
  margin-bottom: $gap-large;
 
 
3
 
4
  &.style-dropdown {
5
  display: flex;
6
  gap: $gap;
 
 
7
  }
8
 
9
  .wc-block-attribute-filter-list {
@@ -26,6 +36,8 @@
26
  flex-grow: 1;
27
  max-width: unset;
28
  width: 0;
 
 
29
  }
30
 
31
  .is-single .wc-block-attribute-filter-list-count,
@@ -35,5 +47,7 @@
35
 
36
  .wc-block-components-dropdown-selector__input-wrapper {
37
  height: 100%;
 
 
38
  }
39
  }
1
+ .wp-block-woocommerce-attribute-filter {
2
+ // We need to override it because by default the global styles applied the border-style: solid;
3
+ // Our goal is not to have a border on main wrapper DOM element
4
+ border-style: none !important;
5
+ }
6
+
7
  .wc-block-attribute-filter {
8
  margin-bottom: $gap-large;
9
+ border-radius: inherit;
10
+ border-color: inherit;
11
 
12
  &.style-dropdown {
13
  display: flex;
14
  gap: $gap;
15
+ border-radius: inherit;
16
+ border-color: inherit;
17
  }
18
 
19
  .wc-block-attribute-filter-list {
36
  flex-grow: 1;
37
  max-width: unset;
38
  width: 0;
39
+ border-radius: inherit;
40
+ border-color: inherit;
41
  }
42
 
43
  .is-single .wc-block-attribute-filter-list-count,
47
 
48
  .wc-block-components-dropdown-selector__input-wrapper {
49
  height: 100%;
50
+ border-radius: inherit;
51
+ border-color: inherit;
52
  }
53
  }
assets/js/blocks/cart-checkout/cart/edit.js CHANGED
@@ -23,7 +23,8 @@ import {
23
  import { createInterpolateElement } from '@wordpress/element';
24
  import { getAdminLink } from '@woocommerce/settings';
25
  import { previewCart } from '@woocommerce/resource-previews';
26
- import { Icon, filledCart, removeCart } from '@woocommerce/icons';
 
27
 
28
  /**
29
  * Internal dependencies
@@ -50,12 +51,12 @@ const views = [
50
  {
51
  view: 'woocommerce/filled-cart-block',
52
  label: __( 'Filled Cart', 'woo-gutenberg-products-block' ),
53
- icon: <Icon srcElement={ filledCart } />,
54
  },
55
  {
56
  view: 'woocommerce/empty-cart-block',
57
  label: __( 'Empty Cart', 'woo-gutenberg-products-block' ),
58
- icon: <Icon srcElement={ removeCart } />,
59
  },
60
  ];
61
 
23
  import { createInterpolateElement } from '@wordpress/element';
24
  import { getAdminLink } from '@woocommerce/settings';
25
  import { previewCart } from '@woocommerce/resource-previews';
26
+ import { filledCart, removeCart } from '@woocommerce/icons';
27
+ import { Icon } from '@wordpress/icons';
28
 
29
  /**
30
  * Internal dependencies
51
  {
52
  view: 'woocommerce/filled-cart-block',
53
  label: __( 'Filled Cart', 'woo-gutenberg-products-block' ),
54
+ icon: <Icon icon={ filledCart } />,
55
  },
56
  {
57
  view: 'woocommerce/empty-cart-block',
58
  label: __( 'Empty Cart', 'woo-gutenberg-products-block' ),
59
+ icon: <Icon icon={ removeCart } />,
60
  },
61
  ];
62
 
assets/js/blocks/cart-checkout/cart/editor.scss CHANGED
@@ -20,3 +20,12 @@ body.wc-lock-selected-block--remove {
20
  }
21
  }
22
 
 
 
 
 
 
 
 
 
 
20
  }
21
  }
22
 
23
+ .wp-block-woocommerce-cart-items-block,
24
+ .wp-block-woocommerce-cart-totals-block,
25
+ .wp-block-woocommerce-empty-cart-block {
26
+ // Temporary fix after the appender button was positioned absolute
27
+ // See https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/5742#issuecomment-1032804168
28
+ .block-list-appender {
29
+ position: relative;
30
+ }
31
+ }
assets/js/blocks/cart-checkout/cart/index.js CHANGED
@@ -4,7 +4,8 @@
4
  import { __ } from '@wordpress/i18n';
5
  import classnames from 'classnames';
6
  import { InnerBlocks } from '@wordpress/block-editor';
7
- import { Icon, cart } from '@woocommerce/icons';
 
8
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
9
  import { createBlock } from '@wordpress/blocks';
10
  /**
@@ -23,7 +24,7 @@ const settings = {
23
  icon: {
24
  src: (
25
  <Icon
26
- srcElement={ cart }
27
  className="wc-block-editor-components-block-icon"
28
  />
29
  ),
4
  import { __ } from '@wordpress/i18n';
5
  import classnames from 'classnames';
6
  import { InnerBlocks } from '@wordpress/block-editor';
7
+ import { cart } from '@woocommerce/icons';
8
+ import { Icon } from '@wordpress/icons';
9
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
10
  import { createBlock } from '@wordpress/blocks';
11
  /**
24
  icon: {
25
  src: (
26
  <Icon
27
+ icon={ cart }
28
  className="wc-block-editor-components-block-icon"
29
  />
30
  ),
assets/js/blocks/cart-checkout/cart/inner-blocks/cart-accepted-payment-methods-block/index.tsx CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
5
- import { Icon, card } from '@woocommerce/icons';
6
 
7
  /**
8
  * Internal dependencies
@@ -14,7 +14,7 @@ registerFeaturePluginBlockType( metadata, {
14
  icon: {
15
  src: (
16
  <Icon
17
- srcElement={ card }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
2
  * External dependencies
3
  */
4
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
5
+ import { Icon, payment } from '@wordpress/icons';
6
 
7
  /**
8
  * Internal dependencies
14
  icon: {
15
  src: (
16
  <Icon
17
+ icon={ payment }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
assets/js/blocks/cart-checkout/cart/inner-blocks/cart-express-payment-block/edit.tsx CHANGED
@@ -5,7 +5,7 @@ import { __ } from '@wordpress/i18n';
5
  import { useBlockProps } from '@wordpress/block-editor';
6
  import { Placeholder, Button } from 'wordpress-components';
7
  import { useExpressPaymentMethods } from '@woocommerce/base-context/hooks';
8
- import { Icon, card } from '@woocommerce/icons';
9
  import { ADMIN_URL } from '@woocommerce/settings';
10
  import classnames from 'classnames';
11
 
@@ -21,7 +21,7 @@ import './editor.scss';
21
  const NoExpressPaymentMethodsPlaceholder = () => {
22
  return (
23
  <Placeholder
24
- icon={ <Icon srcElement={ card } /> }
25
  label={ __( 'Express Checkout', 'woo-gutenberg-products-block' ) }
26
  className="wp-block-woocommerce-checkout-express-payment-block-placeholder"
27
  >
5
  import { useBlockProps } from '@wordpress/block-editor';
6
  import { Placeholder, Button } from 'wordpress-components';
7
  import { useExpressPaymentMethods } from '@woocommerce/base-context/hooks';
8
+ import { Icon, payment } from '@wordpress/icons';
9
  import { ADMIN_URL } from '@woocommerce/settings';
10
  import classnames from 'classnames';
11
 
21
  const NoExpressPaymentMethodsPlaceholder = () => {
22
  return (
23
  <Placeholder
24
+ icon={ <Icon icon={ payment } /> }
25
  label={ __( 'Express Checkout', 'woo-gutenberg-products-block' ) }
26
  className="wp-block-woocommerce-checkout-express-payment-block-placeholder"
27
  >
assets/js/blocks/cart-checkout/cart/inner-blocks/cart-express-payment-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, card } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -14,7 +14,7 @@ registerFeaturePluginBlockType( metadata, {
14
  icon: {
15
  src: (
16
  <Icon
17
- srcElement={ card }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, payment } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
14
  icon: {
15
  src: (
16
  <Icon
17
+ icon={ payment }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
assets/js/blocks/cart-checkout/cart/inner-blocks/cart-order-summary-block/index.tsx CHANGED
@@ -1,7 +1,8 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, totals } from '@woocommerce/icons';
 
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -15,7 +16,7 @@ registerFeaturePluginBlockType( metadata, {
15
  icon: {
16
  src: (
17
  <Icon
18
- srcElement={ totals }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { totals } from '@woocommerce/icons';
5
+ import { Icon } from '@wordpress/icons';
6
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
7
 
8
  /**
16
  icon: {
17
  src: (
18
  <Icon
19
+ icon={ totals }
20
  className="wc-block-editor-components-block-icon"
21
  />
22
  ),
assets/js/blocks/cart-checkout/cart/inner-blocks/empty-cart-block/index.tsx CHANGED
@@ -1,7 +1,8 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, removeCart } from '@woocommerce/icons';
 
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -14,7 +15,7 @@ registerFeaturePluginBlockType( metadata, {
14
  icon: {
15
  src: (
16
  <Icon
17
- srcElement={ removeCart }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { removeCart } from '@woocommerce/icons';
5
+ import { Icon } from '@wordpress/icons';
6
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
7
 
8
  /**
15
  icon: {
16
  src: (
17
  <Icon
18
+ icon={ removeCart }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
assets/js/blocks/cart-checkout/cart/inner-blocks/filled-cart-block/index.tsx CHANGED
@@ -1,7 +1,8 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, filledCart } from '@woocommerce/icons';
 
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -14,7 +15,7 @@ registerFeaturePluginBlockType( metadata, {
14
  icon: {
15
  src: (
16
  <Icon
17
- srcElement={ filledCart }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { filledCart } from '@woocommerce/icons';
5
+ import { Icon } from '@wordpress/icons';
6
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
7
 
8
  /**
15
  icon: {
16
  src: (
17
  <Icon
18
+ icon={ filledCart }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
assets/js/blocks/cart-checkout/mini-cart-contents/edit.tsx CHANGED
@@ -8,7 +8,8 @@ import {
8
  BlockControls,
9
  } from '@wordpress/block-editor';
10
  import { __ } from '@wordpress/i18n';
11
- import { Icon, filledCart, removeCart } from '@woocommerce/icons';
 
12
  import { EditorProvider } from '@woocommerce/base-context';
13
  import type { TemplateArray } from '@wordpress/blocks';
14
 
@@ -28,12 +29,12 @@ const views = [
28
  {
29
  view: 'woocommerce/filled-mini-cart-contents-block',
30
  label: __( 'Filled Mini Cart', 'woo-gutenberg-products-block' ),
31
- icon: <Icon srcElement={ filledCart } />,
32
  },
33
  {
34
  view: 'woocommerce/empty-mini-cart-contents-block',
35
  label: __( 'Empty Mini Cart', 'woo-gutenberg-products-block' ),
36
- icon: <Icon srcElement={ removeCart } />,
37
  },
38
  ];
39
 
8
  BlockControls,
9
  } from '@wordpress/block-editor';
10
  import { __ } from '@wordpress/i18n';
11
+ import { filledCart, removeCart } from '@woocommerce/icons';
12
+ import { Icon } from '@wordpress/icons';
13
  import { EditorProvider } from '@woocommerce/base-context';
14
  import type { TemplateArray } from '@wordpress/blocks';
15
 
29
  {
30
  view: 'woocommerce/filled-mini-cart-contents-block',
31
  label: __( 'Filled Mini Cart', 'woo-gutenberg-products-block' ),
32
+ icon: <Icon icon={ filledCart } />,
33
  },
34
  {
35
  view: 'woocommerce/empty-mini-cart-contents-block',
36
  label: __( 'Empty Mini Cart', 'woo-gutenberg-products-block' ),
37
+ icon: <Icon icon={ removeCart } />,
38
  },
39
  ];
40
 
assets/js/blocks/cart-checkout/mini-cart-contents/editor.scss CHANGED
@@ -21,6 +21,13 @@
21
  flex-direction: column;
22
  height: 100%;
23
  }
 
 
 
 
 
 
 
24
  }
25
 
26
  .wp-block-woocommerce-mini-cart-products-table-block {
@@ -41,4 +48,22 @@
41
  box-shadow: inset 0 0 0 1px;
42
  color: inherit;
43
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
21
  flex-direction: column;
22
  height: 100%;
23
  }
24
+
25
+ // Temporary fix after the appender button was positioned absolute
26
+ // See https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/5742#issuecomment-1032804168
27
+ .block-list-appender {
28
+ position: relative;
29
+ }
30
+
31
  }
32
 
33
  .wp-block-woocommerce-mini-cart-products-table-block {
48
  box-shadow: inset 0 0 0 1px;
49
  color: inherit;
50
  }
51
+
52
+ .wp-block-woocommerce-empty-mini-cart-contents-block {
53
+ overflow-y: unset;
54
+ padding: 0;
55
+
56
+ > .block-editor-inner-blocks {
57
+ max-height: 100vh;
58
+ overflow-y: auto;
59
+ box-sizing: border-box;
60
+ padding: $gap-largest $gap $gap;
61
+ }
62
+
63
+ // Temporary fix after the appender button was positioned absolute
64
+ // See https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/5742#issuecomment-1032804168
65
+ .block-list-appender {
66
+ position: relative;
67
+ }
68
+ }
69
  }
assets/js/blocks/cart-checkout/mini-cart-contents/index.tsx CHANGED
@@ -2,7 +2,8 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { Icon, cart } from '@woocommerce/icons';
 
6
  import { registerExperimentalBlockType } from '@woocommerce/block-settings';
7
 
8
  /**
@@ -18,7 +19,7 @@ const settings = {
18
  icon: {
19
  src: (
20
  <Icon
21
- srcElement={ cart }
22
  className="wc-block-editor-components-block-icon"
23
  />
24
  ),
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { cart } from '@woocommerce/icons';
6
+ import { Icon } from '@wordpress/icons';
7
  import { registerExperimentalBlockType } from '@woocommerce/block-settings';
8
 
9
  /**
19
  icon: {
20
  src: (
21
  <Icon
22
+ icon={ cart }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/block.tsx DELETED
@@ -1,5 +0,0 @@
1
- const Block = ( { children }: { children: JSX.Element } ): JSX.Element => {
2
- return <>{ children }</>;
3
- };
4
-
5
- export default Block;
 
 
 
 
 
assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/frontend.tsx CHANGED
@@ -2,6 +2,7 @@
2
  * External dependencies
3
  */
4
  import { useStoreCart } from '@woocommerce/base-context/hooks';
 
5
 
6
  /**
7
  * Internal dependencies
@@ -16,11 +17,27 @@ const EmptyMiniCartContentsBlock = ( {
16
  }: EmptyMiniCartContentsBlockProps ): JSX.Element | null => {
17
  const { cartItems, cartIsLoading } = useStoreCart();
18
 
 
 
 
 
 
 
 
 
19
  if ( cartIsLoading || cartItems.length > 0 ) {
20
  return null;
21
  }
22
 
23
- return <>{ children }</>;
 
 
 
 
 
 
 
 
24
  };
25
 
26
  export default EmptyMiniCartContentsBlock;
2
  * External dependencies
3
  */
4
  import { useStoreCart } from '@woocommerce/base-context/hooks';
5
+ import { useEffect, useRef } from 'react';
6
 
7
  /**
8
  * Internal dependencies
17
  }: EmptyMiniCartContentsBlockProps ): JSX.Element | null => {
18
  const { cartItems, cartIsLoading } = useStoreCart();
19
 
20
+ const elementRef = useRef< HTMLDivElement >( null );
21
+
22
+ useEffect( () => {
23
+ if ( cartItems.length === 0 && ! cartIsLoading ) {
24
+ elementRef.current?.focus();
25
+ }
26
+ }, [ cartItems, cartIsLoading ] );
27
+
28
  if ( cartIsLoading || cartItems.length > 0 ) {
29
  return null;
30
  }
31
 
32
+ return (
33
+ <div
34
+ tabIndex={ -1 }
35
+ ref={ elementRef }
36
+ className="wp-block-woocommerce-empty-mini-cart-contents-block"
37
+ >
38
+ { children }
39
+ </div>
40
+ );
41
  };
42
 
43
  export default EmptyMiniCartContentsBlock;
assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/empty-mini-cart-contents-block/index.tsx CHANGED
@@ -1,7 +1,8 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, removeCart } from '@woocommerce/icons';
 
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -14,7 +15,7 @@ registerFeaturePluginBlockType( metadata, {
14
  icon: {
15
  src: (
16
  <Icon
17
- srcElement={ removeCart }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { removeCart } from '@woocommerce/icons';
5
+ import { Icon } from '@wordpress/icons';
6
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
7
 
8
  /**
15
  icon: {
16
  src: (
17
  <Icon
18
+ icon={ removeCart }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/filled-mini-cart-contents-block/index.tsx CHANGED
@@ -1,7 +1,8 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, filledCart } from '@woocommerce/icons';
 
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -14,7 +15,7 @@ registerFeaturePluginBlockType( metadata, {
14
  icon: {
15
  src: (
16
  <Icon
17
- srcElement={ filledCart }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { filledCart } from '@woocommerce/icons';
5
+ import { Icon } from '@wordpress/icons';
6
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
7
 
8
  /**
15
  icon: {
16
  src: (
17
  <Icon
18
+ icon={ filledCart }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/mini-cart-footer-block/block.tsx CHANGED
@@ -56,6 +56,7 @@ const Block = ( { color, backgroundColor }: Props ): JSX.Element => {
56
  color,
57
  borderColor: color,
58
  } }
 
59
  >
60
  { __( 'View my cart', 'woo-gutenberg-products-block' ) }
61
  </Button>
56
  color,
57
  borderColor: color,
58
  } }
59
+ variant="outlined"
60
  >
61
  { __( 'View my cart', 'woo-gutenberg-products-block' ) }
62
  </Button>
assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/mini-cart-footer-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, card } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -14,7 +14,7 @@ registerFeaturePluginBlockType( metadata, {
14
  icon: {
15
  src: (
16
  <Icon
17
- srcElement={ card }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, payment } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
14
  icon: {
15
  src: (
16
  <Icon
17
+ icon={ payment }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/mini-cart-items-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, grid } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -14,7 +14,7 @@ registerFeaturePluginBlockType( metadata, {
14
  icon: {
15
  src: (
16
  <Icon
17
- srcElement={ grid }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, grid } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
14
  icon: {
15
  src: (
16
  <Icon
17
+ icon={ grid }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/mini-cart-products-table-block/block.json CHANGED
@@ -16,7 +16,7 @@
16
  "type": "object",
17
  "default": {
18
  "remove": true,
19
- "move": false
20
  }
21
  }
22
  },
16
  "type": "object",
17
  "default": {
18
  "remove": true,
19
+ "move": false
20
  }
21
  }
22
  },
assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/mini-cart-products-table-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, list } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -12,10 +12,7 @@ import metadata from './block.json';
12
 
13
  registerFeaturePluginBlockType( metadata, {
14
  icon: (
15
- <Icon
16
- srcElement={ list }
17
- className="wc-block-editor-components-block-icon"
18
- />
19
  ),
20
  edit: Edit,
21
  save: Save,
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, list } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
12
 
13
  registerFeaturePluginBlockType( metadata, {
14
  icon: (
15
+ <Icon icon={ list } className="wc-block-editor-components-block-icon" />
 
 
 
16
  ),
17
  edit: Edit,
18
  save: Save,
assets/js/blocks/cart-checkout/mini-cart-contents/inner-blocks/mini-cart-title-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, bookmark } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -14,7 +14,7 @@ registerFeaturePluginBlockType( metadata, {
14
  icon: {
15
  src: (
16
  <Icon
17
- srcElement={ bookmark }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, heading } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
14
  icon: {
15
  src: (
16
  <Icon
17
+ icon={ heading }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
assets/js/blocks/cart-checkout/mini-cart/block.tsx CHANGED
@@ -13,7 +13,6 @@ import {
13
  import { getSettingWithCoercion } from '@woocommerce/settings';
14
  import { isBoolean, isString } from '@woocommerce/types';
15
  import {
16
- RawHTML,
17
  unmountComponentAtNode,
18
  useCallback,
19
  useEffect,
@@ -193,10 +192,8 @@ const MiniCartBlock = ( {
193
  <div
194
  className="wc-block-mini-cart__template-part"
195
  ref={ contentsRef }
196
- >
197
- { /* @todo The `div` wrapper of RawHTML isn't removed on the front end. */ }
198
- <RawHTML>{ contents }</RawHTML>
199
- </div>
200
  </Drawer>
201
  </>
202
  );
13
  import { getSettingWithCoercion } from '@woocommerce/settings';
14
  import { isBoolean, isString } from '@woocommerce/types';
15
  import {
 
16
  unmountComponentAtNode,
17
  useCallback,
18
  useEffect,
192
  <div
193
  className="wc-block-mini-cart__template-part"
194
  ref={ contentsRef }
195
+ dangerouslySetInnerHTML={ { __html: contents } }
196
+ ></div>
 
 
197
  </Drawer>
198
  </>
199
  );
assets/js/blocks/cart-checkout/mini-cart/index.tsx CHANGED
@@ -2,7 +2,8 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { Icon, cart } from '@woocommerce/icons';
 
6
  import { registerExperimentalBlockType } from '@woocommerce/block-settings';
7
 
8
  /**
@@ -16,7 +17,7 @@ const settings = {
16
  icon: {
17
  src: (
18
  <Icon
19
- srcElement={ cart }
20
  className="wc-block-editor-components-block-icon"
21
  />
22
  ),
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { cart } from '@woocommerce/icons';
6
+ import { Icon } from '@wordpress/icons';
7
  import { registerExperimentalBlockType } from '@woocommerce/block-settings';
8
 
9
  /**
17
  icon: {
18
  src: (
19
  <Icon
20
+ icon={ cart }
21
  className="wc-block-editor-components-block-icon"
22
  />
23
  ),
assets/js/blocks/cart-checkout/mini-cart/quantity-badge/index.tsx CHANGED
@@ -1,7 +1,8 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, miniCart } from '@woocommerce/icons';
 
5
 
6
  /**
7
  * Internal dependencies
@@ -24,7 +25,7 @@ const QuantityBadge = ( {
24
  <Icon
25
  className="wc-block-mini-cart__icon"
26
  size={ 20 }
27
- srcElement={ miniCart }
28
  />
29
  <span
30
  className={ `wc-block-mini-cart__badge ${ colorClassNames }` }
1
  /**
2
  * External dependencies
3
  */
4
+ import { miniCart } from '@woocommerce/icons';
5
+ import { Icon } from '@wordpress/icons';
6
 
7
  /**
8
  * Internal dependencies
25
  <Icon
26
  className="wc-block-mini-cart__icon"
27
  size={ 20 }
28
+ icon={ miniCart }
29
  />
30
  <span
31
  className={ `wc-block-mini-cart__badge ${ colorClassNames }` }
assets/js/blocks/cart-checkout/mini-cart/style.scss CHANGED
@@ -65,6 +65,7 @@
65
 
66
  button {
67
  color: inherit;
 
68
  }
69
 
70
  svg {
@@ -84,6 +85,11 @@
84
  justify-content: center;
85
  }
86
 
 
 
 
 
 
87
  h2.wc-block-mini-cart__title {
88
  @include font-size(larger);
89
  margin: $gap-largest $gap 0;
@@ -132,9 +138,6 @@ h2.wc-block-mini-cart__title {
132
  gap: $gap;
133
 
134
  .wc-block-mini-cart__footer-cart.wc-block-components-button {
135
- background-color: transparent;
136
- border: 1px solid $gray-900;
137
- color: $gray-900;
138
  display: none;
139
  flex-grow: 1;
140
  font-weight: 600;
@@ -145,7 +148,6 @@ h2.wc-block-mini-cart__title {
145
  }
146
 
147
  .wc-block-mini-cart__footer-checkout {
148
- border: 1px solid $gray-900;
149
  flex-grow: 1;
150
  font-weight: 600;
151
  }
65
 
66
  button {
67
  color: inherit;
68
+ z-index: 9999;
69
  }
70
 
71
  svg {
85
  justify-content: center;
86
  }
87
 
88
+ .wp-block-woocommerce-empty-mini-cart-contents-block {
89
+ overflow-y: auto;
90
+ padding: $gap-largest $gap $gap;
91
+ }
92
+
93
  h2.wc-block-mini-cart__title {
94
  @include font-size(larger);
95
  margin: $gap-largest $gap 0;
138
  gap: $gap;
139
 
140
  .wc-block-mini-cart__footer-cart.wc-block-components-button {
 
 
 
141
  display: none;
142
  flex-grow: 1;
143
  font-weight: 600;
148
  }
149
 
150
  .wc-block-mini-cart__footer-checkout {
 
151
  flex-grow: 1;
152
  font-weight: 600;
153
  }
assets/js/blocks/cart-checkout/payment-methods/no-payment-methods/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { Placeholder, Button, Notice } from 'wordpress-components';
6
- import { Icon, card } from '@woocommerce/icons';
7
  import { ADMIN_URL } from '@woocommerce/settings';
8
  import { useEditorContext } from '@woocommerce/base-context';
9
  import classnames from 'classnames';
@@ -32,7 +32,7 @@ const NoPaymentMethods = () => {
32
  const NoPaymentMethodsPlaceholder = () => {
33
  return (
34
  <Placeholder
35
- icon={ <Icon srcElement={ card } /> }
36
  label={ __( 'Payment methods', 'woo-gutenberg-products-block' ) }
37
  className="wc-block-checkout__no-payment-methods-placeholder"
38
  >
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { Placeholder, Button, Notice } from 'wordpress-components';
6
+ import { Icon, payment } from '@wordpress/icons';
7
  import { ADMIN_URL } from '@woocommerce/settings';
8
  import { useEditorContext } from '@woocommerce/base-context';
9
  import classnames from 'classnames';
32
  const NoPaymentMethodsPlaceholder = () => {
33
  return (
34
  <Placeholder
35
+ icon={ <Icon icon={ payment } /> }
36
  label={ __( 'Payment methods', 'woo-gutenberg-products-block' ) }
37
  className="wc-block-checkout__no-payment-methods-placeholder"
38
  >
assets/js/blocks/cart-checkout/shared/use-view-switcher.tsx CHANGED
@@ -5,7 +5,8 @@ import { __ } from '@wordpress/i18n';
5
  import { useState, useEffect } from '@wordpress/element';
6
  import { useDispatch, select } from '@wordpress/data';
7
  import { ToolbarGroup, ToolbarDropdownMenu } from '@wordpress/components';
8
- import { Icon, eye } from '@woocommerce/icons';
 
9
  import { store as blockEditorStore } from '@wordpress/block-editor';
10
 
11
  interface View {
@@ -87,9 +88,7 @@ export const useViewSwitcher = (
87
  <ToolbarDropdownMenu
88
  label={ __( 'Switch view', 'woo-gutenberg-products-block' ) }
89
  text={ currentView.label }
90
- icon={
91
- <Icon srcElement={ eye } style={ { marginRight: '8px' } } />
92
- }
93
  controls={ views.map( ( view ) => ( {
94
  ...view,
95
  title: <span>{ view.label }</span>,
5
  import { useState, useEffect } from '@wordpress/element';
6
  import { useDispatch, select } from '@wordpress/data';
7
  import { ToolbarGroup, ToolbarDropdownMenu } from '@wordpress/components';
8
+ import { eye } from '@woocommerce/icons';
9
+ import { Icon } from '@wordpress/icons';
10
  import { store as blockEditorStore } from '@wordpress/block-editor';
11
 
12
  interface View {
88
  <ToolbarDropdownMenu
89
  label={ __( 'Switch view', 'woo-gutenberg-products-block' ) }
90
  text={ currentView.label }
91
+ icon={ <Icon icon={ eye } style={ { marginRight: '8px' } } /> }
 
 
92
  controls={ views.map( ( view ) => ( {
93
  ...view,
94
  title: <span>{ view.label }</span>,
assets/js/blocks/checkout/checkout-order-error/index.js CHANGED
@@ -3,7 +3,8 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { CART_URL } from '@woocommerce/block-settings';
6
- import { Icon, removeCart } from '@woocommerce/icons';
 
7
  import { getSetting } from '@woocommerce/settings';
8
  import { decodeEntities } from '@wordpress/html-entities';
9
 
@@ -57,8 +58,7 @@ const CheckoutOrderError = () => {
57
  <div className="wc-block-checkout-error">
58
  <Icon
59
  className="wc-block-checkout-error__image"
60
- alt=""
61
- srcElement={ removeCart }
62
  size={ 100 }
63
  />
64
  <ErrorTitle errorData={ errorData } />
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { CART_URL } from '@woocommerce/block-settings';
6
+ import { removeCart } from '@woocommerce/icons';
7
+ import { Icon } from '@wordpress/icons';
8
  import { getSetting } from '@woocommerce/settings';
9
  import { decodeEntities } from '@wordpress/html-entities';
10
 
58
  <div className="wc-block-checkout-error">
59
  <Icon
60
  className="wc-block-checkout-error__image"
61
+ icon={ removeCart }
 
62
  size={ 100 }
63
  />
64
  <ErrorTitle errorData={ errorData } />
assets/js/blocks/checkout/empty-cart/index.js CHANGED
@@ -3,7 +3,8 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { SHOP_URL } from '@woocommerce/block-settings';
6
- import { Icon, cart } from '@woocommerce/icons';
 
7
 
8
  /**
9
  * Internal dependencies
@@ -15,8 +16,7 @@ const EmptyCart = () => {
15
  <div className="wc-block-checkout-empty">
16
  <Icon
17
  className="wc-block-checkout-empty__image"
18
- alt=""
19
- srcElement={ cart }
20
  size={ 100 }
21
  />
22
  <strong className="wc-block-checkout-empty__title">
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { SHOP_URL } from '@woocommerce/block-settings';
6
+ import { cart } from '@woocommerce/icons';
7
+ import { Icon } from '@wordpress/icons';
8
 
9
  /**
10
  * Internal dependencies
16
  <div className="wc-block-checkout-empty">
17
  <Icon
18
  className="wc-block-checkout-empty__image"
19
+ icon={ cart }
 
20
  size={ 100 }
21
  />
22
  <strong className="wc-block-checkout-empty__title">
assets/js/blocks/checkout/frontend.tsx CHANGED
@@ -17,11 +17,12 @@ import { renderParentBlock } from '@woocommerce/atomic-utils';
17
  import './inner-blocks/register-components';
18
  import Block from './block';
19
  import { blockName, blockAttributes } from './attributes';
 
20
 
21
  const getProps = ( el: Element ) => {
22
  return {
23
  attributes: getValidBlockAttributes(
24
- blockAttributes,
25
  /* eslint-disable @typescript-eslint/no-explicit-any */
26
  ( el instanceof HTMLElement ? el.dataset : {} ) as any
27
  ),
17
  import './inner-blocks/register-components';
18
  import Block from './block';
19
  import { blockName, blockAttributes } from './attributes';
20
+ import metadata from './block.json';
21
 
22
  const getProps = ( el: Element ) => {
23
  return {
24
  attributes: getValidBlockAttributes(
25
+ { ...metadata.attributes, ...blockAttributes },
26
  /* eslint-disable @typescript-eslint/no-explicit-any */
27
  ( el instanceof HTMLElement ? el.dataset : {} ) as any
28
  ),
assets/js/blocks/checkout/index.tsx CHANGED
@@ -2,7 +2,8 @@
2
  * External dependencies
3
  */
4
  import classnames from 'classnames';
5
- import { Icon, fields } from '@woocommerce/icons';
 
6
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
7
  import { BlockInstance, createBlock } from '@wordpress/blocks';
8
 
@@ -18,7 +19,7 @@ const settings = {
18
  icon: {
19
  src: (
20
  <Icon
21
- srcElement={ fields }
22
  className="wc-block-editor-components-block-icon"
23
  />
24
  ),
2
  * External dependencies
3
  */
4
  import classnames from 'classnames';
5
+ import { fields } from '@woocommerce/icons';
6
+ import { Icon } from '@wordpress/icons';
7
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
8
  import { BlockInstance, createBlock } from '@wordpress/blocks';
9
 
19
  icon: {
20
  src: (
21
  <Icon
22
+ icon={ fields }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
assets/js/blocks/checkout/inner-blocks/checkout-billing-address-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, address } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -15,7 +15,7 @@ registerFeaturePluginBlockType( metadata, {
15
  icon: {
16
  src: (
17
  <Icon
18
- srcElement={ address }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, mapMarker } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
15
  icon: {
16
  src: (
17
  <Icon
18
+ icon={ mapMarker }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
assets/js/blocks/checkout/inner-blocks/checkout-contact-information-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, contact } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -15,7 +15,7 @@ registerFeaturePluginBlockType( metadata, {
15
  icon: {
16
  src: (
17
  <Icon
18
- srcElement={ contact }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, atSymbol } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
15
  icon: {
16
  src: (
17
  <Icon
18
+ icon={ atSymbol }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
assets/js/blocks/checkout/inner-blocks/checkout-express-payment-block/edit.tsx CHANGED
@@ -5,7 +5,7 @@ import { __ } from '@wordpress/i18n';
5
  import { useBlockProps } from '@wordpress/block-editor';
6
  import { Placeholder, Button } from 'wordpress-components';
7
  import { useExpressPaymentMethods } from '@woocommerce/base-context/hooks';
8
- import { Icon, card } from '@woocommerce/icons';
9
  import { ADMIN_URL } from '@woocommerce/settings';
10
  import classnames from 'classnames';
11
 
@@ -21,7 +21,7 @@ import './editor.scss';
21
  const NoExpressPaymentMethodsPlaceholder = () => {
22
  return (
23
  <Placeholder
24
- icon={ <Icon srcElement={ card } /> }
25
  label={ __( 'Express Checkout', 'woo-gutenberg-products-block' ) }
26
  className="wp-block-woocommerce-checkout-express-payment-block-placeholder"
27
  >
5
  import { useBlockProps } from '@wordpress/block-editor';
6
  import { Placeholder, Button } from 'wordpress-components';
7
  import { useExpressPaymentMethods } from '@woocommerce/base-context/hooks';
8
+ import { Icon, payment } from '@wordpress/icons';
9
  import { ADMIN_URL } from '@woocommerce/settings';
10
  import classnames from 'classnames';
11
 
21
  const NoExpressPaymentMethodsPlaceholder = () => {
22
  return (
23
  <Placeholder
24
+ icon={ <Icon icon={ payment } /> }
25
  label={ __( 'Express Checkout', 'woo-gutenberg-products-block' ) }
26
  className="wp-block-woocommerce-checkout-express-payment-block-placeholder"
27
  >
assets/js/blocks/checkout/inner-blocks/checkout-express-payment-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, card } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -14,7 +14,7 @@ registerFeaturePluginBlockType( metadata, {
14
  icon: {
15
  src: (
16
  <Icon
17
- srcElement={ card }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, payment } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
14
  icon: {
15
  src: (
16
  <Icon
17
+ icon={ payment }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
assets/js/blocks/checkout/inner-blocks/checkout-order-note-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, notes } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -14,7 +14,7 @@ registerFeaturePluginBlockType( metadata, {
14
  icon: {
15
  src: (
16
  <Icon
17
- srcElement={ notes }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, page } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
14
  icon: {
15
  src: (
16
  <Icon
17
+ icon={ page }
18
  className="wc-block-editor-components-block-icon"
19
  />
20
  ),
assets/js/blocks/checkout/inner-blocks/checkout-order-summary-block/index.tsx CHANGED
@@ -1,7 +1,8 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, totals } from '@woocommerce/icons';
 
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -15,7 +16,7 @@ registerFeaturePluginBlockType( metadata, {
15
  icon: {
16
  src: (
17
  <Icon
18
- srcElement={ totals }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { totals } from '@woocommerce/icons';
5
+ import { Icon } from '@wordpress/icons';
6
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
7
 
8
  /**
16
  icon: {
17
  src: (
18
  <Icon
19
+ icon={ totals }
20
  className="wc-block-editor-components-block-icon"
21
  />
22
  ),
assets/js/blocks/checkout/inner-blocks/checkout-payment-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, card } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -15,7 +15,7 @@ registerFeaturePluginBlockType( metadata, {
15
  icon: {
16
  src: (
17
  <Icon
18
- srcElement={ card }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, payment } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
15
  icon: {
16
  src: (
17
  <Icon
18
+ icon={ payment }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
assets/js/blocks/checkout/inner-blocks/checkout-shipping-address-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, address } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -15,7 +15,7 @@ registerFeaturePluginBlockType( metadata, {
15
  icon: {
16
  src: (
17
  <Icon
18
- srcElement={ address }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, mapMarker } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
15
  icon: {
16
  src: (
17
  <Icon
18
+ icon={ mapMarker }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, truck } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
@@ -15,7 +15,7 @@ registerFeaturePluginBlockType( metadata, {
15
  icon: {
16
  src: (
17
  <Icon
18
- srcElement={ truck }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, shipping } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
 
7
  /**
15
  icon: {
16
  src: (
17
  <Icon
18
+ icon={ shipping }
19
  className="wc-block-editor-components-block-icon"
20
  />
21
  ),
assets/js/blocks/checkout/inner-blocks/checkout-shipping-methods-block/no-shipping-placeholder/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { Placeholder, Button } from 'wordpress-components';
6
- import { Icon, truck } from '@woocommerce/icons';
7
  import { ADMIN_URL } from '@woocommerce/settings';
8
 
9
  /**
@@ -14,7 +14,7 @@ import './style.scss';
14
  const NoShippingPlaceholder = () => {
15
  return (
16
  <Placeholder
17
- icon={ <Icon srcElement={ truck } /> }
18
  label={ __( 'Shipping options', 'woo-gutenberg-products-block' ) }
19
  className="wc-block-checkout__no-shipping-placeholder"
20
  >
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { Placeholder, Button } from 'wordpress-components';
6
+ import { Icon, shipping } from '@wordpress/icons';
7
  import { ADMIN_URL } from '@woocommerce/settings';
8
 
9
  /**
14
  const NoShippingPlaceholder = () => {
15
  return (
16
  <Placeholder
17
+ icon={ <Icon icon={ shipping } /> }
18
  label={ __( 'Shipping options', 'woo-gutenberg-products-block' ) }
19
  className="wc-block-checkout__no-shipping-placeholder"
20
  >
assets/js/blocks/checkout/inner-blocks/checkout-terms-block/index.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Icon, asterisk } from '@woocommerce/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
  /**
7
  * Internal dependencies
@@ -13,7 +13,7 @@ registerFeaturePluginBlockType( metadata, {
13
  icon: {
14
  src: (
15
  <Icon
16
- srcElement={ asterisk }
17
  className="wc-block-editor-components-block-icon"
18
  />
19
  ),
1
  /**
2
  * External dependencies
3
  */
4
+ import { Icon, customPostType } from '@wordpress/icons';
5
  import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
6
  /**
7
  * Internal dependencies
13
  icon: {
14
  src: (
15
  <Icon
16
+ icon={ customPostType }
17
  className="wc-block-editor-components-block-icon"
18
  />
19
  ),
assets/js/blocks/checkout/styles/editor.scss CHANGED
@@ -23,6 +23,12 @@
23
  .block-editor-block-list__layout {
24
  display: block;
25
  }
 
 
 
 
 
 
26
  }
27
  }
28
 
23
  .block-editor-block-list__layout {
24
  display: block;
25
  }
26
+
27
+ // Temporary fix after the appender button was positioned absolute
28
+ // See https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/5742#issuecomment-1032804168
29
+ .block-list-appender {
30
+ position: relative;
31
+ }
32
  }
33
  }
34
 
assets/js/blocks/featured-category/block.js CHANGED
@@ -28,9 +28,11 @@ import { withSelect } from '@wordpress/data';
28
  import { compose, createHigherOrderComponent } from '@wordpress/compose';
29
  import PropTypes from 'prop-types';
30
  import { getSetting } from '@woocommerce/settings';
31
- import { Icon, folderStarred } from '@woocommerce/icons';
 
32
  import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
33
  import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
 
34
 
35
  /**
36
  * Internal dependencies
@@ -89,18 +91,29 @@ const FeaturedCategory = ( {
89
  setAttributes( { contentAlign: nextAlign } );
90
  } }
91
  />
92
- <MediaReplaceFlow
93
- mediaId={ mediaId }
94
- mediaURL={ mediaSrc }
95
- accept="image/*"
96
- onSelect={ ( media ) => {
97
- setAttributes( {
98
- mediaId: media.id,
99
- mediaSrc: media.url,
100
- } );
101
- } }
102
- allowedTypes={ [ 'image' ] }
103
- />
 
 
 
 
 
 
 
 
 
 
 
104
  <ToolbarGroup
105
  controls={ [
106
  {
@@ -196,7 +209,7 @@ const FeaturedCategory = ( {
196
 
197
  return (
198
  <Placeholder
199
- icon={ <Icon srcElement={ folderStarred } /> }
200
  label={ __(
201
  'Featured Category',
202
  'woo-gutenberg-products-block'
@@ -274,7 +287,13 @@ const FeaturedCategory = ( {
274
  };
275
 
276
  const renderCategory = () => {
277
- const { contentAlign, dimRatio, focalPoint, showDesc } = attributes;
 
 
 
 
 
 
278
 
279
  const classes = classnames(
280
  'wc-block-featured-category',
@@ -302,10 +321,7 @@ const FeaturedCategory = ( {
302
  return (
303
  <ResizableBox
304
  className={ classes }
305
- size={ {
306
- height: '',
307
- width: '',
308
- } }
309
  minHeight={ getSetting( 'min_height', 500 ) }
310
  enable={ { bottom: true } }
311
  onResizeStop={ onResizeStop }
@@ -337,7 +353,7 @@ const FeaturedCategory = ( {
337
  const renderNoCategory = () => (
338
  <Placeholder
339
  className="wc-block-featured-category"
340
- icon={ <Icon srcElement={ folderStarred } /> }
341
  label={ __( 'Featured Category', 'woo-gutenberg-products-block' ) }
342
  >
343
  { isLoading ? (
28
  import { compose, createHigherOrderComponent } from '@wordpress/compose';
29
  import PropTypes from 'prop-types';
30
  import { getSetting } from '@woocommerce/settings';
31
+ import { folderStarred } from '@woocommerce/icons';
32
+ import { Icon } from '@wordpress/icons';
33
  import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
34
  import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
35
+ import TextToolbarButton from '@woocommerce/editor-components/text-toolbar-button';
36
 
37
  /**
38
  * Internal dependencies
91
  setAttributes( { contentAlign: nextAlign } );
92
  } }
93
  />
94
+ <ToolbarGroup>
95
+ <MediaReplaceFlow
96
+ mediaId={ mediaId }
97
+ mediaURL={ mediaSrc }
98
+ accept="image/*"
99
+ onSelect={ ( media ) => {
100
+ setAttributes( {
101
+ mediaId: media.id,
102
+ mediaSrc: media.url,
103
+ } );
104
+ } }
105
+ allowedTypes={ [ 'image' ] }
106
+ />
107
+ { mediaId && mediaSrc ? (
108
+ <TextToolbarButton
109
+ onClick={ () =>
110
+ setAttributes( { mediaId: 0, mediaSrc: '' } )
111
+ }
112
+ >
113
+ { __( 'Remove', 'woo-gutenberg-products-block' ) }
114
+ </TextToolbarButton>
115
+ ) : null }
116
+ </ToolbarGroup>
117
  <ToolbarGroup
118
  controls={ [
119
  {
209
 
210
  return (
211
  <Placeholder
212
+ icon={ <Icon icon={ folderStarred } /> }
213
  label={ __(
214
  'Featured Category',
215
  'woo-gutenberg-products-block'
287
  };
288
 
289
  const renderCategory = () => {
290
+ const {
291
+ height,
292
+ contentAlign,
293
+ dimRatio,
294
+ focalPoint,
295
+ showDesc,
296
+ } = attributes;
297
 
298
  const classes = classnames(
299
  'wc-block-featured-category',
321
  return (
322
  <ResizableBox
323
  className={ classes }
324
+ size={ { height } }
 
 
 
325
  minHeight={ getSetting( 'min_height', 500 ) }
326
  enable={ { bottom: true } }
327
  onResizeStop={ onResizeStop }
353
  const renderNoCategory = () => (
354
  <Placeholder
355
  className="wc-block-featured-category"
356
+ icon={ <Icon icon={ folderStarred } /> }
357
  label={ __( 'Featured Category', 'woo-gutenberg-products-block' ) }
358
  >
359
  { isLoading ? (
assets/js/blocks/featured-category/index.js CHANGED
@@ -5,7 +5,8 @@ import { __ } from '@wordpress/i18n';
5
  import { InnerBlocks } from '@wordpress/block-editor';
6
  import { registerBlockType } from '@wordpress/blocks';
7
  import { getSetting } from '@woocommerce/settings';
8
- import { Icon, folderStarred } from '@woocommerce/icons';
 
9
  import { isFeaturePluginBuild } from '@woocommerce/block-settings';
10
 
11
  /**
@@ -25,7 +26,7 @@ registerBlockType( 'woocommerce/featured-category', {
25
  icon: {
26
  src: (
27
  <Icon
28
- srcElement={ folderStarred }
29
  className="wc-block-editor-components-block-icon"
30
  />
31
  ),
5
  import { InnerBlocks } from '@wordpress/block-editor';
6
  import { registerBlockType } from '@wordpress/blocks';
7
  import { getSetting } from '@woocommerce/settings';
8
+ import { folderStarred } from '@woocommerce/icons';
9
+ import { Icon } from '@wordpress/icons';
10
  import { isFeaturePluginBuild } from '@woocommerce/block-settings';
11
 
12
  /**
26
  icon: {
27
  src: (
28
  <Icon
29
+ icon={ folderStarred }
30
  className="wc-block-editor-components-block-icon"
31
  />
32
  ),
assets/js/blocks/featured-category/style.scss CHANGED
@@ -10,7 +10,7 @@
10
  background-size: cover;
11
  background-position: center center;
12
  width: 100%;
13
- margin: 0 0 0 0;
14
  display: flex;
15
  justify-content: center;
16
  align-items: center;
@@ -106,6 +106,7 @@
106
  bottom: 0;
107
  right: 0;
108
  background-color: inherit;
 
109
  opacity: 0.5;
110
  z-index: 1;
111
  }
10
  background-size: cover;
11
  background-position: center center;
12
  width: 100%;
13
+ margin: 0;
14
  display: flex;
15
  justify-content: center;
16
  align-items: center;
106
  bottom: 0;
107
  right: 0;
108
  background-color: inherit;
109
+ border-radius: inherit;
110
  opacity: 0.5;
111
  z-index: 1;
112
  }
assets/js/blocks/featured-product/block.js CHANGED
@@ -8,8 +8,6 @@ import {
8
  InnerBlocks,
9
  InspectorControls,
10
  MediaReplaceFlow,
11
- PanelColorSettings,
12
- withColors,
13
  RichText,
14
  } from '@wordpress/block-editor';
15
  import { withSelect } from '@wordpress/data';
@@ -34,7 +32,7 @@ import { getSetting } from '@woocommerce/settings';
34
  import ProductControl from '@woocommerce/editor-components/product-control';
35
  import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
36
  import { withProduct } from '@woocommerce/block-hocs';
37
- import { Icon, star } from '@woocommerce/icons';
38
 
39
  /**
40
  * Internal dependencies
@@ -55,10 +53,8 @@ import {
55
  * @param {function(any):any} props.getProduct Function for getting the product.
56
  * @param {boolean} props.isLoading Whether product is loading or not.
57
  * @param {boolean} props.isSelected Whether block is selected or not.
58
- * @param {Object} props.overlayColor Overlay color object.
59
  * @param {Object} props.product Product object.
60
  * @param {function(any):any} props.setAttributes Setter for attributes.
61
- * @param {function(any):any} props.setOverlayColor Setter for overlay color.
62
  * @param {function():any} props.triggerUrlUpdate Function for triggering a url update for product.
63
  */
64
  const FeaturedProduct = ( {
@@ -68,10 +64,8 @@ const FeaturedProduct = ( {
68
  getProduct,
69
  isLoading,
70
  isSelected,
71
- overlayColor,
72
  product,
73
  setAttributes,
74
- setOverlayColor,
75
  triggerUrlUpdate = () => void null,
76
  } ) => {
77
  const renderApiError = () => (
@@ -98,7 +92,7 @@ const FeaturedProduct = ( {
98
  <>
99
  { getBlockControls() }
100
  <Placeholder
101
- icon={ <Icon srcElement={ star } /> }
102
  label={ __(
103
  'Featured Product',
104
  'woo-gutenberg-products-block'
@@ -210,21 +204,14 @@ const FeaturedProduct = ( {
210
  }
211
  />
212
  </PanelBody>
213
- <PanelColorSettings
214
- title={ __( 'Overlay', 'woo-gutenberg-products-block' ) }
215
- colorSettings={ [
216
- {
217
- value: overlayColor.color,
218
- onChange: setOverlayColor,
219
- label: __(
220
- 'Overlay Color',
221
  'woo-gutenberg-products-block'
222
- ),
223
- },
224
- ] }
225
- >
226
- { !! url && (
227
- <>
228
  <RangeControl
229
  label={ __(
230
  'Background Opacity',
@@ -251,16 +238,15 @@ const FeaturedProduct = ( {
251
  }
252
  />
253
  ) }
254
- </>
255
- ) }
256
- </PanelColorSettings>
257
  </InspectorControls>
258
  );
259
  };
260
 
261
  const renderProduct = () => {
262
  const {
263
- className,
264
  contentAlign,
265
  dimRatio,
266
  focalPoint,
@@ -277,17 +263,13 @@ const FeaturedProduct = ( {
277
  'has-background-dim': dimRatio !== 0,
278
  },
279
  dimRatioToClass( dimRatio ),
280
- contentAlign !== 'center' && `has-${ contentAlign }-content`,
281
- className
282
  );
283
 
284
  const style = getBackgroundImageStyles(
285
  attributes.mediaSrc || product
286
  );
287
 
288
- if ( overlayColor.color ) {
289
- style.backgroundColor = overlayColor.color;
290
- }
291
  if ( focalPoint ) {
292
  const bgPosX = focalPoint.x * 100;
293
  const bgPosY = focalPoint.y * 100;
@@ -393,7 +375,7 @@ const FeaturedProduct = ( {
393
  const renderNoProduct = () => (
394
  <Placeholder
395
  className="wc-block-featured-product"
396
- icon={ <Icon srcElement={ star } /> }
397
  label={ __( 'Featured Product', 'woo-gutenberg-products-block' ) }
398
  >
399
  { isLoading ? (
@@ -451,9 +433,6 @@ FeaturedProduct.propTypes = {
451
  price_html: PropTypes.node,
452
  permalink: PropTypes.string,
453
  } ),
454
- // from withColors
455
- overlayColor: PropTypes.object,
456
- setOverlayColor: PropTypes.func.isRequired,
457
  // from withSpokenMessages
458
  debouncedSpeak: PropTypes.func.isRequired,
459
  triggerUrlUpdate: PropTypes.func,
@@ -461,7 +440,6 @@ FeaturedProduct.propTypes = {
461
 
462
  export default compose( [
463
  withProduct,
464
- withColors( { overlayColor: 'background-color' } ),
465
  withSpokenMessages,
466
  withSelect( ( select, { clientId }, { dispatch } ) => {
467
  const Block = select( 'core/block-editor' ).getBlock( clientId );
8
  InnerBlocks,
9
  InspectorControls,
10
  MediaReplaceFlow,
 
 
11
  RichText,
12
  } from '@wordpress/block-editor';
13
  import { withSelect } from '@wordpress/data';
32
  import ProductControl from '@woocommerce/editor-components/product-control';
33
  import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
34
  import { withProduct } from '@woocommerce/block-hocs';
35
+ import { Icon, starEmpty } from '@wordpress/icons';
36
 
37
  /**
38
  * Internal dependencies
53
  * @param {function(any):any} props.getProduct Function for getting the product.
54
  * @param {boolean} props.isLoading Whether product is loading or not.
55
  * @param {boolean} props.isSelected Whether block is selected or not.
 
56
  * @param {Object} props.product Product object.
57
  * @param {function(any):any} props.setAttributes Setter for attributes.
 
58
  * @param {function():any} props.triggerUrlUpdate Function for triggering a url update for product.
59
  */
60
  const FeaturedProduct = ( {
64
  getProduct,
65
  isLoading,
66
  isSelected,
 
67
  product,
68
  setAttributes,
 
69
  triggerUrlUpdate = () => void null,
70
  } ) => {
71
  const renderApiError = () => (
92
  <>
93
  { getBlockControls() }
94
  <Placeholder
95
+ icon={ <Icon icon={ starEmpty } /> }
96
  label={ __(
97
  'Featured Product',
98
  'woo-gutenberg-products-block'
204
  }
205
  />
206
  </PanelBody>
207
+ { !! url && (
208
+ <>
209
+ <PanelBody
210
+ title={ __(
211
+ 'Overlay',
 
 
 
212
  'woo-gutenberg-products-block'
213
+ ) }
214
+ >
 
 
 
 
215
  <RangeControl
216
  label={ __(
217
  'Background Opacity',
238
  }
239
  />
240
  ) }
241
+ </PanelBody>
242
+ </>
243
+ ) }
244
  </InspectorControls>
245
  );
246
  };
247
 
248
  const renderProduct = () => {
249
  const {
 
250
  contentAlign,
251
  dimRatio,
252
  focalPoint,
263
  'has-background-dim': dimRatio !== 0,
264
  },
265
  dimRatioToClass( dimRatio ),
266
+ contentAlign !== 'center' && `has-${ contentAlign }-content`
 
267
  );
268
 
269
  const style = getBackgroundImageStyles(
270
  attributes.mediaSrc || product
271
  );
272
 
 
 
 
273
  if ( focalPoint ) {
274
  const bgPosX = focalPoint.x * 100;
275
  const bgPosY = focalPoint.y * 100;
375
  const renderNoProduct = () => (
376
  <Placeholder
377
  className="wc-block-featured-product"
378
+ icon={ <Icon icon={ starEmpty } /> }
379
  label={ __( 'Featured Product', 'woo-gutenberg-products-block' ) }
380
  >
381
  { isLoading ? (
433
  price_html: PropTypes.node,
434
  permalink: PropTypes.string,
435
  } ),
 
 
 
436
  // from withSpokenMessages
437
  debouncedSpeak: PropTypes.func.isRequired,
438
  triggerUrlUpdate: PropTypes.func,
440
 
441
  export default compose( [
442
  withProduct,
 
443
  withSpokenMessages,
444
  withSelect( ( select, { clientId }, { dispatch } ) => {
445
  const Block = select( 'core/block-editor' ).getBlock( clientId );
assets/js/blocks/featured-product/edit.tsx ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { useBlockProps } from '@wordpress/block-editor';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import Block from './block';
10
+ import './editor.scss';
11
+
12
+ export const Edit = ( props: unknown ): JSX.Element => {
13
+ const blockProps = useBlockProps();
14
+
15
+ return (
16
+ <div { ...blockProps }>
17
+ <Block { ...props } />
18
+ </div>
19
+ );
20
+ };
assets/js/blocks/featured-product/editor.scss CHANGED
@@ -1,4 +1,6 @@
1
  .wc-block-featured-product {
 
 
2
  .components-resizable-box__handle {
3
  z-index: 10;
4
  }
1
  .wc-block-featured-product {
2
+ background-color: inherit;
3
+
4
  .components-resizable-box__handle {
5
  z-index: 10;
6
  }
assets/js/blocks/featured-product/index.js CHANGED
@@ -5,25 +5,26 @@ import { __ } from '@wordpress/i18n';
5
  import { InnerBlocks } from '@wordpress/block-editor';
6
  import { registerBlockType } from '@wordpress/blocks';
7
  import { getSetting } from '@woocommerce/settings';
8
- import { Icon, star } from '@woocommerce/icons';
 
9
 
10
  /**
11
  * Internal dependencies
12
  */
13
  import './style.scss';
14
- import './editor.scss';
15
  import { example } from './example';
16
- import Block from './block';
17
 
18
  /**
19
  * Register and run the "Featured Product" block.
20
  */
21
  registerBlockType( 'woocommerce/featured-product', {
 
22
  title: __( 'Featured Product', 'woo-gutenberg-products-block' ),
23
  icon: {
24
  src: (
25
  <Icon
26
- srcElement={ star }
27
  className="wc-block-editor-components-block-icon"
28
  />
29
  ),
@@ -37,6 +38,15 @@ registerBlockType( 'woocommerce/featured-product', {
37
  supports: {
38
  align: [ 'wide', 'full' ],
39
  html: false,
 
 
 
 
 
 
 
 
 
40
  },
41
  example,
42
  attributes: {
@@ -154,9 +164,7 @@ registerBlockType( 'woocommerce/featured-product', {
154
  *
155
  * @param {Object} props Props to pass to block.
156
  */
157
- edit( props ) {
158
- return <Block { ...props } />;
159
- },
160
 
161
  /**
162
  * Block content is rendered in PHP, not via save function.
5
  import { InnerBlocks } from '@wordpress/block-editor';
6
  import { registerBlockType } from '@wordpress/blocks';
7
  import { getSetting } from '@woocommerce/settings';
8
+ import { isFeaturePluginBuild } from '@woocommerce/block-settings';
9
+ import { Icon, starEmpty } from '@wordpress/icons';
10
 
11
  /**
12
  * Internal dependencies
13
  */
14
  import './style.scss';
 
15
  import { example } from './example';
16
+ import { Edit } from './edit';
17
 
18
  /**
19
  * Register and run the "Featured Product" block.
20
  */
21
  registerBlockType( 'woocommerce/featured-product', {
22
+ apiVersion: 2,
23
  title: __( 'Featured Product', 'woo-gutenberg-products-block' ),
24
  icon: {
25
  src: (
26
  <Icon
27
+ icon={ starEmpty }
28
  className="wc-block-editor-components-block-icon"
29
  />
30
  ),
38
  supports: {
39
  align: [ 'wide', 'full' ],
40
  html: false,
41
+ color: true,
42
+ ...( isFeaturePluginBuild() && {
43
+ __experimentalBorder: {
44
+ color: true,
45
+ radius: true,
46
+ width: true,
47
+ __experimentalSkipSerialization: false,
48
+ },
49
+ } ),
50
  },
51
  example,
52
  attributes: {
164
  *
165
  * @param {Object} props Props to pass to block.
166
  */
167
+ edit: Edit,
 
 
168
 
169
  /**
170
  * Block content is rendered in PHP, not via save function.
assets/js/blocks/featured-product/style.scss CHANGED
@@ -1,10 +1,16 @@
 
 
 
 
 
 
 
1
  .wc-block-featured-product {
2
  position: relative;
3
- background-color: $gray-900;
4
  background-size: cover;
5
  background-position: center center;
6
  width: 100%;
7
- margin: 0 0 1.5em 0;
8
  display: flex;
9
  justify-content: center;
10
  align-items: center;
@@ -49,10 +55,10 @@
49
  .wc-block-featured-product__variation,
50
  .wc-block-featured-product__description,
51
  .wc-block-featured-product__price {
52
- color: $white;
53
  line-height: 1.25;
54
  margin-bottom: 0;
55
  text-align: center;
 
56
 
57
  a,
58
  a:hover,
1
+ .wp-block-woocommerce-featured-product {
2
+ background-color: $gray-900;
3
+ border-color: transparent;
4
+ color: #fff;
5
+ overflow: hidden;
6
+ }
7
+
8
  .wc-block-featured-product {
9
  position: relative;
 
10
  background-size: cover;
11
  background-position: center center;
12
  width: 100%;
13
+ margin: 0;
14
  display: flex;
15
  justify-content: center;
16
  align-items: center;
55
  .wc-block-featured-product__variation,
56
  .wc-block-featured-product__description,
57
  .wc-block-featured-product__price {
 
58
  line-height: 1.25;
59
  margin-bottom: 0;
60
  text-align: center;
61
+ color: inherit;
62
 
63
  a,
64
  a:hover,
assets/js/blocks/handpicked-products/block.js CHANGED
@@ -21,7 +21,7 @@ import GridContentControl from '@woocommerce/editor-components/grid-content-cont
21
  import ProductsControl from '@woocommerce/editor-components/products-control';
22
  import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
23
  import { gridBlockPreview } from '@woocommerce/resource-previews';
24
- import { Icon, widgets } from '@woocommerce/icons';
25
 
26
  /**
27
  * Component to handle edit mode of "Hand-picked Products".
@@ -127,7 +127,7 @@ class ProductsBlock extends Component {
127
 
128
  return (
129
  <Placeholder
130
- icon={ <Icon srcElement={ widgets } /> }
131
  label={ __(
132
  'Hand-picked Products',
133
  'woo-gutenberg-products-block'
21
  import ProductsControl from '@woocommerce/editor-components/products-control';
22
  import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
23
  import { gridBlockPreview } from '@woocommerce/resource-previews';
24
+ import { Icon, stack } from '@wordpress/icons';
25
 
26
  /**
27
  * Component to handle edit mode of "Hand-picked Products".
127
 
128
  return (
129
  <Placeholder
130
+ icon={ <Icon icon={ stack } /> }
131
  label={ __(
132
  'Hand-picked Products',
133
  'woo-gutenberg-products-block'
assets/js/blocks/handpicked-products/index.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
  import { getSetting } from '@woocommerce/settings';
7
- import { Icon, widgets } from '@woocommerce/icons';
8
 
9
  /**
10
  * Internal dependencies
@@ -17,7 +17,7 @@ registerBlockType( 'woocommerce/handpicked-products', {
17
  icon: {
18
  src: (
19
  <Icon
20
- srcElement={ widgets }
21
  className="wc-block-editor-components-block-icon"
22
  />
23
  ),
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
  import { getSetting } from '@woocommerce/settings';
7
+ import { Icon, stack } from '@wordpress/icons';
8
 
9
  /**
10
  * Internal dependencies
17
  icon: {
18
  src: (
19
  <Icon
20
+ icon={ stack }
21
  className="wc-block-editor-components-block-icon"
22
  />
23
  ),
assets/js/blocks/price-filter/edit.js CHANGED
@@ -15,7 +15,7 @@ import { blocksConfig } from '@woocommerce/block-settings';
15
  import HeadingToolbar from '@woocommerce/editor-components/heading-toolbar';
16
  import BlockTitle from '@woocommerce/editor-components/block-title';
17
  import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';
18
- import { Icon, bill, external } from '@woocommerce/icons';
19
 
20
  /**
21
  * Internal dependencies
@@ -116,7 +116,7 @@ export default function ( { attributes, setAttributes } ) {
116
  const noProductsPlaceholder = () => (
117
  <Placeholder
118
  className="wc-block-price-slider"
119
- icon={ <Icon srcElement={ bill } /> }
120
  label={ __(
121
  'Filter Products by Price',
122
  'woo-gutenberg-products-block'
@@ -139,7 +139,7 @@ export default function ( { attributes, setAttributes } ) {
139
  >
140
  { __( 'Add new product', 'woo-gutenberg-products-block' ) +
141
  ' ' }
142
- <Icon srcElement={ external } />
143
  </Button>
144
  <Button
145
  className="wc-block-price-slider__read_more_button"
15
  import HeadingToolbar from '@woocommerce/editor-components/heading-toolbar';
16
  import BlockTitle from '@woocommerce/editor-components/block-title';
17
  import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';
18
+ import { Icon, currencyDollar, external } from '@wordpress/icons';
19
 
20
  /**
21
  * Internal dependencies
116
  const noProductsPlaceholder = () => (
117
  <Placeholder
118
  className="wc-block-price-slider"
119
+ icon={ <Icon icon={ currencyDollar } /> }
120
  label={ __(
121
  'Filter Products by Price',
122
  'woo-gutenberg-products-block'
139
  >
140
  { __( 'Add new product', 'woo-gutenberg-products-block' ) +
141
  ' ' }
142
+ <Icon icon={ external } />
143
  </Button>
144
  <Button
145
  className="wc-block-price-slider__read_more_button"
assets/js/blocks/price-filter/index.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
  import classNames from 'classnames';
7
- import { Icon, bill } from '@woocommerce/icons';
8
  import { isFeaturePluginBuild } from '@woocommerce/block-settings';
9
  import { useBlockProps } from '@wordpress/block-editor';
10
 
@@ -19,7 +19,7 @@ registerBlockType( 'woocommerce/price-filter', {
19
  icon: {
20
  src: (
21
  <Icon
22
- srcElement={ bill }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
  import classNames from 'classnames';
7
+ import { Icon, currencyDollar } from '@wordpress/icons';
8
  import { isFeaturePluginBuild } from '@woocommerce/block-settings';
9
  import { useBlockProps } from '@wordpress/block-editor';
10
 
19
  icon: {
20
  src: (
21
  <Icon
22
+ icon={ currencyDollar }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
assets/js/blocks/product-best-sellers/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { without } from 'lodash';
6
- import { Icon, stonks } from '@woocommerce/icons';
7
  import { createBlock, registerBlockType } from '@wordpress/blocks';
8
 
9
  /**
@@ -19,7 +19,7 @@ registerBlockType( 'woocommerce/product-best-sellers', {
19
  icon: {
20
  src: (
21
  <Icon
22
- srcElement={ stonks }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { without } from 'lodash';
6
+ import { Icon, trendingUp } from '@wordpress/icons';
7
  import { createBlock, registerBlockType } from '@wordpress/blocks';
8
 
9
  /**
19
  icon: {
20
  src: (
21
  <Icon
22
+ icon={ trendingUp }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
assets/js/blocks/product-categories/block.js CHANGED
@@ -11,12 +11,12 @@ import {
11
  ToggleControl,
12
  Placeholder,
13
  } from '@wordpress/components';
14
- import { Icon, list } from '@woocommerce/icons';
15
  import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';
16
 
17
  const EmptyPlaceholder = () => (
18
  <Placeholder
19
- icon={ <Icon srcElement={ list } /> }
20
  label={ __(
21
  'Product Categories List',
22
  'woo-gutenberg-products-block'
11
  ToggleControl,
12
  Placeholder,
13
  } from '@wordpress/components';
14
+ import { Icon, listView } from '@wordpress/icons';
15
  import ToggleButtonControl from '@woocommerce/editor-components/toggle-button-control';
16
 
17
  const EmptyPlaceholder = () => (
18
  <Placeholder
19
+ icon={ <Icon icon={ listView } /> }
20
  label={ __(
21
  'Product Categories List',
22
  'woo-gutenberg-products-block'
assets/js/blocks/product-categories/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
- import { Icon, list } from '@woocommerce/icons';
7
 
8
  import { isFeaturePluginBuild } from '@woocommerce/block-settings';
9
  /**
@@ -19,7 +19,7 @@ registerBlockType( 'woocommerce/product-categories', {
19
  icon: {
20
  src: (
21
  <Icon
22
- srcElement={ list }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
+ import { Icon, listView } from '@wordpress/icons';
7
 
8
  import { isFeaturePluginBuild } from '@woocommerce/block-settings';
9
  /**
19
  icon: {
20
  src: (
21
  <Icon
22
+ icon={ listView }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
assets/js/blocks/product-category/block.js CHANGED
@@ -20,12 +20,12 @@ import ProductCategoryControl from '@woocommerce/editor-components/product-categ
20
  import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
21
  import ProductStockControl from '@woocommerce/editor-components/product-stock-control';
22
  import { gridBlockPreview } from '@woocommerce/resource-previews';
23
- import { Icon, folder } from '@woocommerce/icons';
24
  import { getSetting } from '@woocommerce/settings';
25
 
26
  const EmptyPlaceholder = () => (
27
  <Placeholder
28
- icon={ <Icon srcElement={ folder } /> }
29
  label={ __( 'Products by Category', 'woo-gutenberg-products-block' ) }
30
  className="wc-block-products-grid wc-block-products-category"
31
  >
@@ -229,7 +229,7 @@ class ProductByCategoryBlock extends Component {
229
 
230
  return (
231
  <Placeholder
232
- icon={ <Icon srcElement={ folder } /> }
233
  label={ __(
234
  'Products by Category',
235
  'woo-gutenberg-products-block'
20
  import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
21
  import ProductStockControl from '@woocommerce/editor-components/product-stock-control';
22
  import { gridBlockPreview } from '@woocommerce/resource-previews';
23
+ import { Icon, file } from '@wordpress/icons';
24
  import { getSetting } from '@woocommerce/settings';
25
 
26
  const EmptyPlaceholder = () => (
27
  <Placeholder
28
+ icon={ <Icon icon={ file } /> }
29
  label={ __( 'Products by Category', 'woo-gutenberg-products-block' ) }
30
  className="wc-block-products-grid wc-block-products-category"
31
  >
229
 
230
  return (
231
  <Placeholder
232
+ icon={ <Icon icon={ file } /> }
233
  label={ __(
234
  'Products by Category',
235
  'woo-gutenberg-products-block'
assets/js/blocks/product-category/index.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
  import { without } from 'lodash';
7
- import { Icon, folder } from '@woocommerce/icons';
8
 
9
  /**
10
  * Internal dependencies
@@ -23,7 +23,7 @@ registerBlockType( 'woocommerce/product-category', {
23
  icon: {
24
  src: (
25
  <Icon
26
- srcElement={ folder }
27
  className="wc-block-editor-components-block-icon"
28
  />
29
  ),
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
  import { without } from 'lodash';
7
+ import { Icon, file } from '@wordpress/icons';
8
 
9
  /**
10
  * Internal dependencies
23
  icon: {
24
  src: (
25
  <Icon
26
+ icon={ file }
27
  className="wc-block-editor-components-block-icon"
28
  />
29
  ),
assets/js/blocks/product-new/index.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
  import { without } from 'lodash';
7
- import { Icon, exclamation } from '@woocommerce/icons';
8
 
9
  /**
10
  * Internal dependencies
@@ -19,8 +19,8 @@ registerBlockType( 'woocommerce/product-new', {
19
  icon: {
20
  src: (
21
  <Icon
22
- srcElement={ exclamation }
23
- className="wc-block-editor-components-block-icon"
24
  />
25
  ),
26
  },
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
  import { without } from 'lodash';
7
+ import { Icon, sparkles } from '@wordpress/icons';
8
 
9
  /**
10
  * Internal dependencies
19
  icon: {
20
  src: (
21
  <Icon
22
+ icon={ sparkles }
23
+ className="wc-block-editor-components-block-icon wc-block-editor-components-block-icon--sparkles"
24
  />
25
  ),
26
  },
assets/js/blocks/product-on-sale/block.js CHANGED
@@ -13,12 +13,12 @@ import ProductCategoryControl from '@woocommerce/editor-components/product-categ
13
  import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
14
  import ProductStockControl from '@woocommerce/editor-components/product-stock-control';
15
  import { gridBlockPreview } from '@woocommerce/resource-previews';
16
- import { Icon, tag } from '@woocommerce/icons';
17
  import { getSetting } from '@woocommerce/settings';
18
 
19
  const EmptyPlaceholder = () => (
20
  <Placeholder
21
- icon={ <Icon srcElement={ tag } /> }
22
  label={ __( 'On Sale Products', 'woo-gutenberg-products-block' ) }
23
  className="wc-block-product-on-sale"
24
  >
13
  import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
14
  import ProductStockControl from '@woocommerce/editor-components/product-stock-control';
15
  import { gridBlockPreview } from '@woocommerce/resource-previews';
16
+ import { Icon, percent } from '@wordpress/icons';
17
  import { getSetting } from '@woocommerce/settings';
18
 
19
  const EmptyPlaceholder = () => (
20
  <Placeholder
21
+ icon={ <Icon icon={ percent } /> }
22
  label={ __( 'On Sale Products', 'woo-gutenberg-products-block' ) }
23
  className="wc-block-product-on-sale"
24
  >
assets/js/blocks/product-on-sale/index.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
  import { without } from 'lodash';
7
- import { Icon, tag } from '@woocommerce/icons';
8
  /**
9
  * Internal dependencies
10
  */
@@ -19,7 +19,7 @@ registerBlockType( 'woocommerce/product-on-sale', {
19
  icon: {
20
  src: (
21
  <Icon
22
- srcElement={ tag }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
  import { without } from 'lodash';
7
+ import { Icon, percent } from '@wordpress/icons';
8
  /**
9
  * Internal dependencies
10
  */
19
  icon: {
20
  src: (
21
  <Icon
22
+ icon={ percent }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
assets/js/blocks/product-search/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
- import { Icon, search } from '@woocommerce/icons';
7
  /**
8
  * Internal dependencies
9
  */
@@ -51,7 +51,7 @@ registerBlockType( 'woocommerce/product-search', {
51
  icon: {
52
  src: (
53
  <Icon
54
- srcElement={ search }
55
  className="wc-block-editor-components-block-icon"
56
  />
57
  ),
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
+ import { Icon, search } from '@wordpress/icons';
7
  /**
8
  * Internal dependencies
9
  */
51
  icon: {
52
  src: (
53
  <Icon
54
+ icon={ search }
55
  className="wc-block-editor-components-block-icon"
56
  />
57
  ),
assets/js/blocks/product-tag/block.js CHANGED
@@ -19,7 +19,7 @@ import GridLayoutControl from '@woocommerce/editor-components/grid-layout-contro
19
  import ProductTagControl from '@woocommerce/editor-components/product-tag-control';
20
  import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
21
  import ProductStockControl from '@woocommerce/editor-components/product-stock-control';
22
- import { Icon, more } from '@woocommerce/icons';
23
  import { gridBlockPreview } from '@woocommerce/resource-previews';
24
  import { getSetting } from '@woocommerce/settings';
25
 
@@ -194,10 +194,7 @@ class ProductsByTagBlock extends Component {
194
  return (
195
  <Placeholder
196
  icon={
197
- <Icon
198
- srcElement={ more }
199
- className="block-editor-block-icon"
200
- />
201
  }
202
  label={ __(
203
  'Products by Tag',
@@ -251,7 +248,7 @@ class ProductsByTagBlock extends Component {
251
  <Placeholder
252
  icon={
253
  <Icon
254
- icon={ more }
255
  className="block-editor-block-icon"
256
  />
257
  }
@@ -305,7 +302,7 @@ class ProductsByTagBlock extends Component {
305
  ) : (
306
  <Placeholder
307
  icon={
308
- <Icon icon={ more } className="block-editor-block-icon" />
309
  }
310
  label={ __(
311
  'Products by Tag',
19
  import ProductTagControl from '@woocommerce/editor-components/product-tag-control';
20
  import ProductOrderbyControl from '@woocommerce/editor-components/product-orderby-control';
21
  import ProductStockControl from '@woocommerce/editor-components/product-stock-control';
22
+ import { Icon, tag } from '@wordpress/icons';
23
  import { gridBlockPreview } from '@woocommerce/resource-previews';
24
  import { getSetting } from '@woocommerce/settings';
25
 
194
  return (
195
  <Placeholder
196
  icon={
197
+ <Icon icon={ tag } className="block-editor-block-icon" />
 
 
 
198
  }
199
  label={ __(
200
  'Products by Tag',
248
  <Placeholder
249
  icon={
250
  <Icon
251
+ icon={ tag }
252
  className="block-editor-block-icon"
253
  />
254
  }
302
  ) : (
303
  <Placeholder
304
  icon={
305
+ <Icon icon={ tag } className="block-editor-block-icon" />
306
  }
307
  label={ __(
308
  'Products by Tag',
assets/js/blocks/product-tag/index.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
  import { getSetting } from '@woocommerce/settings';
7
- import { Icon, more } from '@woocommerce/icons';
8
 
9
  /**
10
  * Internal dependencies
@@ -20,7 +20,7 @@ registerBlockType( 'woocommerce/product-tag', {
20
  icon: {
21
  src: (
22
  <Icon
23
- srcElement={ more }
24
  className="wc-block-editor-components-block-icon"
25
  />
26
  ),
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
  import { getSetting } from '@woocommerce/settings';
7
+ import { Icon, tag } from '@wordpress/icons';
8
 
9
  /**
10
  * Internal dependencies
20
  icon: {
21
  src: (
22
  <Icon
23
+ icon={ tag }
24
  className="wc-block-editor-components-block-icon"
25
  />
26
  ),
assets/js/blocks/product-top-rated/index.js CHANGED
@@ -3,7 +3,8 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
- import { Icon, thumbUp } from '@woocommerce/icons';
 
7
  import { without } from 'lodash';
8
 
9
  /**
@@ -21,7 +22,7 @@ registerBlockType( blockTypeName, {
21
  icon: {
22
  src: (
23
  <Icon
24
- srcElement={ thumbUp }
25
  className="wc-block-editor-components-block-icon"
26
  />
27
  ),
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
+ import { thumbUp } from '@woocommerce/icons';
7
+ import { Icon } from '@wordpress/icons';
8
  import { without } from 'lodash';
9
 
10
  /**
22
  icon: {
23
  src: (
24
  <Icon
25
+ icon={ thumbUp }
26
  className="wc-block-editor-components-block-icon"
27
  />
28
  ),
assets/js/blocks/products-by-attribute/block.js CHANGED
@@ -13,7 +13,7 @@ import {
13
  withSpokenMessages,
14
  } from '@wordpress/components';
15
  import { Component } from '@wordpress/element';
16
- import { Icon, tags } from '@woocommerce/icons';
17
  import PropTypes from 'prop-types';
18
  import GridContentControl from '@woocommerce/editor-components/grid-content-control';
19
  import GridLayoutControl from '@woocommerce/editor-components/grid-layout-control';
@@ -133,7 +133,7 @@ class ProductsByAttributeBlock extends Component {
133
 
134
  return (
135
  <Placeholder
136
- icon={ <Icon srcElement={ tags } /> }
137
  label={ __(
138
  'Products by Attribute',
139
  'woo-gutenberg-products-block'
13
  withSpokenMessages,
14
  } from '@wordpress/components';
15
  import { Component } from '@wordpress/element';
16
+ import { Icon, category } from '@wordpress/icons';
17
  import PropTypes from 'prop-types';
18
  import GridContentControl from '@woocommerce/editor-components/grid-content-control';
19
  import GridLayoutControl from '@woocommerce/editor-components/grid-layout-control';
133
 
134
  return (
135
  <Placeholder
136
+ icon={ <Icon icon={ category } /> }
137
  label={ __(
138
  'Products by Attribute',
139
  'woo-gutenberg-products-block'
assets/js/blocks/products-by-attribute/index.js CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { Icon, tags } from '@woocommerce/icons';
6
  import { registerBlockType } from '@wordpress/blocks';
7
  import { getSetting } from '@woocommerce/settings';
8
 
@@ -19,7 +19,7 @@ registerBlockType( blockTypeName, {
19
  icon: {
20
  src: (
21
  <Icon
22
- srcElement={ tags }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { Icon, category } from '@wordpress/icons';
6
  import { registerBlockType } from '@wordpress/blocks';
7
  import { getSetting } from '@woocommerce/settings';
8
 
19
  icon: {
20
  src: (
21
  <Icon
22
+ icon={ category }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
assets/js/blocks/products/all-products/edit.js CHANGED
@@ -21,7 +21,7 @@ import {
21
  import { Component } from '@wordpress/element';
22
  import { compose } from '@wordpress/compose';
23
  import PropTypes from 'prop-types';
24
- import { Icon, grid } from '@woocommerce/icons';
25
  import GridLayoutControl from '@woocommerce/editor-components/grid-layout-control';
26
  import {
27
  InnerBlockLayoutContextProvider,
@@ -84,7 +84,7 @@ class Editor extends Component {
84
  };
85
 
86
  getIcon = () => {
87
- return <Icon srcElement={ grid } />;
88
  };
89
 
90
  togglePreview = () => {
@@ -245,7 +245,7 @@ class Editor extends Component {
245
  </Button>
246
  <Button
247
  className="wc-block-all-products__reset-button"
248
- icon={ <Icon srcElement={ grid } /> }
249
  label={ __(
250
  'Reset layout to default',
251
  'woo-gutenberg-products-block'
21
  import { Component } from '@wordpress/element';
22
  import { compose } from '@wordpress/compose';
23
  import PropTypes from 'prop-types';
24
+ import { Icon, grid } from '@wordpress/icons';
25
  import GridLayoutControl from '@woocommerce/editor-components/grid-layout-control';
26
  import {
27
  InnerBlockLayoutContextProvider,
84
  };
85
 
86
  getIcon = () => {
87
+ return <Icon icon={ grid } />;
88
  };
89
 
90
  togglePreview = () => {
245
  </Button>
246
  <Button
247
  className="wc-block-all-products__reset-button"
248
+ icon={ <Icon icon={ grid } /> }
249
  label={ __(
250
  'Reset layout to default',
251
  'woo-gutenberg-products-block'
assets/js/blocks/products/all-products/index.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { InnerBlocks } from '@wordpress/block-editor';
6
  import { registerBlockType } from '@wordpress/blocks';
7
- import { Icon, grid } from '@woocommerce/icons';
8
  import '@woocommerce/atomic-blocks';
9
 
10
  /**
@@ -19,7 +19,7 @@ export const blockSettings = {
19
  icon: {
20
  src: (
21
  <Icon
22
- srcElement={ grid }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
4
  import { __ } from '@wordpress/i18n';
5
  import { InnerBlocks } from '@wordpress/block-editor';
6
  import { registerBlockType } from '@wordpress/blocks';
7
+ import { Icon, grid } from '@wordpress/icons';
8
  import '@woocommerce/atomic-blocks';
9
 
10
  /**
19
  icon: {
20
  src: (
21
  <Icon
22
+ icon={ grid }
23
  className="wc-block-editor-components-block-icon"
24
  />
25
  ),
assets/js/blocks/products/edit-utils.js CHANGED
@@ -4,7 +4,7 @@
4
  import { __ } from '@wordpress/i18n';
5
  import { Button, Placeholder } from '@wordpress/components';
6
  import { ADMIN_URL } from '@woocommerce/settings';
7
- import { Icon, external } from '@woocommerce/icons';
8
 
9
  export const renderNoProductsPlaceholder = ( blockTitle, blockIcon ) => (
10
  <Placeholder
@@ -24,7 +24,7 @@ export const renderNoProductsPlaceholder = ( blockTitle, blockIcon ) => (
24
  href={ ADMIN_URL + 'post-new.php?post_type=product' }
25
  >
26
  { __( 'Add new product', 'woo-gutenberg-products-block' ) + ' ' }
27
- <Icon srcElement={ external } />
28
  </Button>
29
  <Button
30
  className="wc-block-products__read_more_button"
4
  import { __ } from '@wordpress/i18n';
5
  import { Button, Placeholder } from '@wordpress/components';
6
  import { ADMIN_URL } from '@woocommerce/settings';
7
+ import { Icon, external } from '@wordpress/icons';
8
 
9
  export const renderNoProductsPlaceholder = ( blockTitle, blockIcon ) => (
10
  <Placeholder
24
  href={ ADMIN_URL + 'post-new.php?post_type=product' }
25
  >
26
  { __( 'Add new product', 'woo-gutenberg-products-block' ) + ' ' }
27
+ <Icon icon={ external } />
28
  </Button>
29
  <Button
30
  className="wc-block-products__read_more_button"
assets/js/blocks/reviews/all-reviews/edit.js CHANGED
@@ -5,7 +5,7 @@ import { __ } from '@wordpress/i18n';
5
  import { InspectorControls } from '@wordpress/block-editor';
6
  import { PanelBody, ToggleControl } from '@wordpress/components';
7
  import PropTypes from 'prop-types';
8
- import { Icon, discussion } from '@woocommerce/icons';
9
 
10
  /**
11
  * Internal dependencies
@@ -67,7 +67,7 @@ const AllReviewsEditor = ( { attributes, setAttributes } ) => {
67
  attributes={ attributes }
68
  icon={
69
  <Icon
70
- icon={ discussion }
71
  className="block-editor-block-icon"
72
  />
73
  }
5
  import { InspectorControls } from '@wordpress/block-editor';
6
  import { PanelBody, ToggleControl } from '@wordpress/components';
7
  import PropTypes from 'prop-types';
8
+ import { Icon, postComments } from '@wordpress/icons';
9
 
10
  /**
11
  * Internal dependencies
67
  attributes={ attributes }
68
  icon={
69
  <Icon
70
+ icon={ postComments }
71
  className="block-editor-block-icon"
72
  />
73
  }
assets/js/blocks/reviews/all-reviews/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
- import { Icon, discussion } from '@woocommerce/icons';
7
 
8
  /**
9
  * Internal dependencies
@@ -24,7 +24,7 @@ registerBlockType( 'woocommerce/all-reviews', {
24
  icon: {
25
  src: (
26
  <Icon
27
- srcElement={ discussion }
28
  className="wc-block-editor-components-block-icon"
29
  />
30
  ),
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { createBlock, registerBlockType } from '@wordpress/blocks';
6
+ import { Icon, postComments } from '@wordpress/icons';
7
 
8
  /**
9
  * Internal dependencies
24
  icon: {
25
  src: (
26
  <Icon
27
+ icon={ postComments }
28
  className="wc-block-editor-components-block-icon"
29
  />
30
  ),
assets/js/blocks/reviews/all-reviews/no-reviews-placeholder.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { Placeholder } from '@wordpress/components';
6
- import { Icon, discussion } from '@woocommerce/icons';
7
 
8
  const NoCategoryReviewsPlaceholder = () => {
9
  return (
@@ -11,7 +11,7 @@ const NoCategoryReviewsPlaceholder = () => {
11
  className="wc-block-all-reviews"
12
  icon={
13
  <Icon
14
- srcElement={ discussion }
15
  className="block-editor-block-icon"
16
  />
17
  }
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { Placeholder } from '@wordpress/components';
6
+ import { Icon, postComments } from '@wordpress/icons';
7
 
8
  const NoCategoryReviewsPlaceholder = () => {
9
  return (
11
  className="wc-block-all-reviews"
12
  icon={
13
  <Icon
14
+ icon={ postComments }
15
  className="block-editor-block-icon"
16
  />
17
  }
assets/js/blocks/reviews/reviews-by-category/edit.js CHANGED
@@ -12,7 +12,7 @@ import {
12
  } from '@wordpress/components';
13
  import PropTypes from 'prop-types';
14
  import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
15
- import { Icon, review } from '@woocommerce/icons';
16
 
17
  /**
18
  * Internal dependencies
@@ -104,7 +104,7 @@ const ReviewsByCategoryEditor = ( {
104
  <Placeholder
105
  icon={
106
  <Icon
107
- srcElement={ review }
108
  className="block-editor-block-icon"
109
  />
110
  }
@@ -152,7 +152,7 @@ const ReviewsByCategoryEditor = ( {
152
  attributes={ attributes }
153
  icon={
154
  <Icon
155
- srcElement={ review }
156
  className="block-editor-block-icon"
157
  />
158
  }
12
  } from '@wordpress/components';
13
  import PropTypes from 'prop-types';
14
  import ProductCategoryControl from '@woocommerce/editor-components/product-category-control';
15
+ import { Icon, commentContent } from '@wordpress/icons';
16
 
17
  /**
18
  * Internal dependencies
104
  <Placeholder
105
  icon={
106
  <Icon
107
+ icon={ commentContent }
108
  className="block-editor-block-icon"
109
  />
110
  }
152
  attributes={ attributes }
153
  icon={
154
  <Icon
155
+ icon={ commentContent }
156
  className="block-editor-block-icon"
157
  />
158
  }
assets/js/blocks/reviews/reviews-by-category/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
- import { Icon, review } from '@woocommerce/icons';
7
 
8
  /**
9
  * Internal dependencies
@@ -22,7 +22,7 @@ registerBlockType( 'woocommerce/reviews-by-category', {
22
  icon: {
23
  src: (
24
  <Icon
25
- srcElement={ review }
26
  className="wc-block-editor-components-block-icon"
27
  />
28
  ),
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
+ import { Icon, commentContent } from '@wordpress/icons';
7
 
8
  /**
9
  * Internal dependencies
22
  icon: {
23
  src: (
24
  <Icon
25
+ icon={ commentContent }
26
  className="wc-block-editor-components-block-icon"
27
  />
28
  ),
assets/js/blocks/reviews/reviews-by-category/no-reviews-placeholder.js CHANGED
@@ -3,14 +3,14 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { Placeholder } from '@wordpress/components';
6
- import { Icon, review } from '@woocommerce/icons';
7
  const NoReviewsPlaceholder = () => {
8
  return (
9
  <Placeholder
10
  className="wc-block-reviews-by-category"
11
  icon={
12
  <Icon
13
- srcElement={ review }
14
  className="block-editor-block-icon"
15
  />
16
  }
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { Placeholder } from '@wordpress/components';
6
+ import { Icon, commentContent } from '@wordpress/icons';
7
  const NoReviewsPlaceholder = () => {
8
  return (
9
  <Placeholder
10
  className="wc-block-reviews-by-category"
11
  icon={
12
  <Icon
13
+ icon={ commentContent }
14
  className="block-editor-block-icon"
15
  />
16
  }
assets/js/blocks/reviews/reviews-by-product/edit.js CHANGED
@@ -12,7 +12,7 @@ import {
12
  import { SearchListItem } from '@woocommerce/editor-components/search-list-control';
13
  import PropTypes from 'prop-types';
14
  import ProductControl from '@woocommerce/editor-components/product-control';
15
- import { Icon, comment } from '@woocommerce/icons';
16
 
17
  /**
18
  * Internal dependencies
@@ -123,7 +123,7 @@ const ReviewsByProductEditor = ( {
123
  <Placeholder
124
  icon={
125
  <Icon
126
- icon={ comment }
127
  className="block-editor-block-icon"
128
  />
129
  }
@@ -175,7 +175,7 @@ const ReviewsByProductEditor = ( {
175
  attributes={ attributes }
176
  icon={
177
  <Icon
178
- icon={ comment }
179
  className="block-editor-block-icon"
180
  />
181
  }
12
  import { SearchListItem } from '@woocommerce/editor-components/search-list-control';
13
  import PropTypes from 'prop-types';
14
  import ProductControl from '@woocommerce/editor-components/product-control';
15
+ import { Icon, commentContent } from '@wordpress/icons';
16
 
17
  /**
18
  * Internal dependencies
123
  <Placeholder
124
  icon={
125
  <Icon
126
+ icon={ commentContent }
127
  className="block-editor-block-icon"
128
  />
129
  }
175
  attributes={ attributes }
176
  icon={
177
  <Icon
178
+ icon={ commentContent }
179
  className="block-editor-block-icon"
180
  />
181
  }
assets/js/blocks/reviews/reviews-by-product/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
- import { Icon, comment } from '@woocommerce/icons';
7
  /**
8
  * Internal dependencies
9
  */
@@ -22,7 +22,7 @@ registerBlockType( 'woocommerce/reviews-by-product', {
22
  icon: {
23
  src: (
24
  <Icon
25
- srcElement={ comment }
26
  className="wc-block-editor-components-block-icon"
27
  />
28
  ),
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
+ import { Icon, commentContent } from '@wordpress/icons';
7
  /**
8
  * Internal dependencies
9
  */
22
  icon: {
23
  src: (
24
  <Icon
25
+ icon={ commentContent }
26
  className="wc-block-editor-components-block-icon"
27
  />
28
  ),
assets/js/blocks/reviews/reviews-by-product/no-reviews-placeholder.js CHANGED
@@ -5,7 +5,7 @@ import { __, sprintf } from '@wordpress/i18n';
5
  import { Placeholder, Spinner } from '@wordpress/components';
6
  import PropTypes from 'prop-types';
7
  import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
8
- import { Icon, comment } from '@woocommerce/icons';
9
  import { withProduct } from '@woocommerce/block-hocs';
10
 
11
  const NoReviewsPlaceholder = ( { error, getProduct, isLoading, product } ) => {
@@ -41,7 +41,7 @@ const NoReviewsPlaceholder = ( { error, getProduct, isLoading, product } ) => {
41
  className="wc-block-reviews-by-product"
42
  icon={
43
  <Icon
44
- srcElement={ comment }
45
  className="block-editor-block-icon"
46
  />
47
  }
5
  import { Placeholder, Spinner } from '@wordpress/components';
6
  import PropTypes from 'prop-types';
7
  import ErrorPlaceholder from '@woocommerce/editor-components/error-placeholder';
8
+ import { Icon, commentContent } from '@wordpress/icons';
9
  import { withProduct } from '@woocommerce/block-hocs';
10
 
11
  const NoReviewsPlaceholder = ( { error, getProduct, isLoading, product } ) => {
41
  className="wc-block-reviews-by-product"
42
  icon={
43
  <Icon
44
+ icon={ commentContent }
45
  className="block-editor-block-icon"
46
  />
47
  }
assets/js/blocks/single-product/constants.js CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { Icon, reader } from '@woocommerce/icons';
6
  import { getBlockMap } from '@woocommerce/atomic-utils';
7
 
8
  export const BLOCK_NAME = 'woocommerce/single-product';
@@ -12,7 +12,7 @@ export const BLOCK_TITLE = __(
12
  );
13
  export const BLOCK_ICON = (
14
  <Icon
15
- srcElement={ reader }
16
  className="wc-block-editor-components-block-icon"
17
  />
18
  );
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { Icon, mediaAndText } from '@wordpress/icons';
6
  import { getBlockMap } from '@woocommerce/atomic-utils';
7
 
8
  export const BLOCK_NAME = 'woocommerce/single-product';
12
  );
13
  export const BLOCK_ICON = (
14
  <Icon
15
+ icon={ mediaAndText }
16
  className="wc-block-editor-components-block-icon"
17
  />
18
  );
assets/js/blocks/single-product/edit/layout-editor.js CHANGED
@@ -11,7 +11,7 @@ import {
11
  } from '@woocommerce/shared-context';
12
  import { createBlocksFromTemplate } from '@woocommerce/atomic-utils';
13
  import { PanelBody, Button } from '@wordpress/components';
14
- import { Icon, restore } from '@woocommerce/icons';
15
 
16
  /**
17
  * Internal dependencies
@@ -65,7 +65,7 @@ const LayoutEditor = ( { isLoading, product, clientId } ) => {
65
  isTertiary
66
  className="wc-block-single-product__reset-layout"
67
  >
68
- <Icon srcElement={ restore } />{ ' ' }
69
  { __(
70
  'Reset layout',
71
  'woo-gutenberg-products-block'
11
  } from '@woocommerce/shared-context';
12
  import { createBlocksFromTemplate } from '@woocommerce/atomic-utils';
13
  import { PanelBody, Button } from '@wordpress/components';
14
+ import { Icon, backup } from '@wordpress/icons';
15
 
16
  /**
17
  * Internal dependencies
65
  isTertiary
66
  className="wc-block-single-product__reset-layout"
67
  >
68
+ <Icon icon={ backup } />{ ' ' }
69
  { __(
70
  'Reset layout',
71
  'woo-gutenberg-products-block'
assets/js/blocks/stock-filter/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
- import { Icon, server } from '@woocommerce/icons';
7
  import classNames from 'classnames';
8
 
9
  /**
@@ -16,7 +16,7 @@ registerBlockType( 'woocommerce/stock-filter', {
16
  icon: {
17
  src: (
18
  <Icon
19
- srcElement={ server }
20
  className="wc-block-editor-components-block-icon"
21
  />
22
  ),
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import { registerBlockType } from '@wordpress/blocks';
6
+ import { Icon, box } from '@wordpress/icons';
7
  import classNames from 'classnames';
8
 
9
  /**
16
  icon: {
17
  src: (
18
  <Icon
19
+ icon={ box }
20
  className="wc-block-editor-components-block-icon"
21
  />
22
  ),
assets/js/editor-components/edit-product-link/index.js CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { Icon, external } from '@woocommerce/icons';
6
  import { ADMIN_URL } from '@woocommerce/settings';
7
  import { InspectorControls } from '@wordpress/block-editor';
8
  import { useProductDataContext } from '@woocommerce/shared-context';
@@ -34,7 +34,7 @@ const EditProductLink = ( props ) => {
34
  "Edit this product's details",
35
  'woo-gutenberg-products-block'
36
  ) }
37
- <Icon srcElement={ external } size={ 16 } />
38
  </a>
39
  </div>
40
  <div className="wc-block-single-product__edit-card-description">
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { Icon, external } from '@wordpress/icons';
6
  import { ADMIN_URL } from '@woocommerce/settings';
7
  import { InspectorControls } from '@wordpress/block-editor';
8
  import { useProductDataContext } from '@woocommerce/shared-context';
34
  "Edit this product's details",
35
  'woo-gutenberg-products-block'
36
  ) }
37
+ <Icon icon={ external } size={ 16 } />
38
  </a>
39
  </div>
40
  <div className="wc-block-single-product__edit-card-description">
assets/js/editor-components/error-placeholder/index.tsx CHANGED
@@ -2,7 +2,7 @@
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
- import { Icon, notice } from '@woocommerce/icons';
6
  import classNames from 'classnames';
7
  import { Button, Placeholder, Spinner } from '@wordpress/components';
8
 
@@ -50,7 +50,7 @@ const ErrorPlaceholder = ( {
50
  onRetry,
51
  }: ErrorPlaceholderProps ): JSX.Element => (
52
  <Placeholder
53
- icon={ <Icon srcElement={ notice } /> }
54
  label={ __(
55
  'Sorry, an error occurred',
56
  'woo-gutenberg-products-block'
2
  * External dependencies
3
  */
4
  import { __ } from '@wordpress/i18n';
5
+ import { Icon, warning } from '@wordpress/icons';
6
  import classNames from 'classnames';
7
  import { Button, Placeholder, Spinner } from '@wordpress/components';
8
 
50
  onRetry,
51
  }: ErrorPlaceholderProps ): JSX.Element => (
52
  <Placeholder
53
+ icon={ <Icon icon={ warning } /> }
54
  label={ __(
55
  'Sorry, an error occurred',
56
  'woo-gutenberg-products-block'
assets/js/editor-components/feedback-prompt/index.js CHANGED
@@ -3,7 +3,7 @@
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import PropTypes from 'prop-types';
6
- import { Icon, comment, external } from '@woocommerce/icons';
7
 
8
  /**
9
  * Internal dependencies
@@ -23,7 +23,7 @@ const FeedbackPrompt = ( {
23
  } ) => {
24
  return (
25
  <div className="wc-block-feedback-prompt">
26
- <Icon srcElement={ comment } />
27
  <h2 className="wc-block-feedback-prompt__title">
28
  { __( 'Feedback?', 'woo-gutenberg-products-block' ) }
29
  </h2>
@@ -38,7 +38,7 @@ const FeedbackPrompt = ( {
38
  'Give us your feedback.',
39
  'woo-gutenberg-products-block'
40
  ) }
41
- <Icon srcElement={ external } size={ 16 } />
42
  </a>
43
  </div>
44
  );
3
  */
4
  import { __ } from '@wordpress/i18n';
5
  import PropTypes from 'prop-types';
6
+ import { Icon, commentContent, external } from '@wordpress/icons';
7
 
8
  /**
9
  * Internal dependencies
23
  } ) => {
24
  return (
25
  <div className="wc-block-feedback-prompt">
26
+ <Icon icon={ commentContent } />
27
  <h2 className="wc-block-feedback-prompt__title">
28
  { __( 'Feedback?', 'woo-gutenberg-products-block' ) }
29
  </h2>
38
  'Give us your feedback.',
39
  'woo-gutenberg-products-block'
40
  ) }
41
+ <Icon icon={ external } size={ 16 } />
42
  </a>
43
  </div>
44
  );
assets/js/editor-components/heading-toolbar/heading-level-icon.js CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { Path, SVG } from '@wordpress/components';
5
 
6
  export default function HeadingLevelIcon( { level } ) {
7
  const levelToPath = {
1
  /**
2
  * External dependencies
3
  */
4
+ import { Path, SVG } from '@wordpress/primitives';
5
 
6
  export default function HeadingLevelIcon( { level } ) {
7
  const levelToPath = {
assets/js/icons/icon/index.tsx DELETED
@@ -1,29 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { cloneElement, isValidElement } from '@wordpress/element';
5
- import type { HTMLProps, ReactElement } from 'react';
6
-
7
- export interface IconProps {
8
- srcElement?: ReactElement;
9
- size?: number;
10
- className?: string;
11
- }
12
-
13
- function Icon( {
14
- srcElement,
15
- size = 24,
16
- ...props
17
- }: IconProps &
18
- HTMLProps< HTMLImageElement | SVGElement > ): ReactElement | null {
19
- if ( ! isValidElement( srcElement ) ) {
20
- return null;
21
- }
22
- return cloneElement( srcElement, {
23
- width: size,
24
- height: size,
25
- ...props,
26
- } );
27
- }
28
-
29
- export default Icon;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/index.js CHANGED
@@ -1,57 +1,13 @@
1
- export { default as Icon } from './icon';
2
-
3
- export { default as address } from './library/address';
4
- export { default as arrowBack } from './library/arrow-back';
5
- export { default as arrowDownAlt2 } from './library/arrow-down-alt2';
6
- export { default as asterisk } from './library/asterisk';
7
- export { default as atom } from './library/atom';
8
- export { default as bank } from './library/bank';
9
  export { default as barcode } from './library/barcode';
10
- export { default as bill } from './library/bill';
11
- export { default as bookmark } from './library/bookmark';
12
- export { default as box } from './library/box';
13
- export { default as card } from './library/card';
14
  export { default as cart } from './library/cart';
15
  export { default as checkPayment } from './library/check-payment';
16
- export { default as chevronDown } from './library/chevron-down';
17
- export { default as chevronUp } from './library/chevron-up';
18
- export { default as chevronRight } from './library/chevron-right';
19
- export { default as comment } from './library/comment';
20
- export { default as contact } from './library/contact';
21
- export { default as done } from './library/done';
22
- export { default as discussion } from './library/discussion';
23
  export { default as eye } from './library/eye';
24
- export { default as exclamation } from './library/exclamation';
25
- export { default as external } from './library/external';
26
  export { default as fields } from './library/fields';
27
  export { default as filledCart } from './library/filled-cart';
28
  export { default as folderStarred } from './library/folder-starred';
29
- export { default as folder } from './library/folder';
30
- export { default as formStep } from './library/form-step';
31
- export { default as grid } from './library/grid';
32
- export { default as heading } from './library/heading';
33
- export { default as image } from './library/image';
34
- export { default as list } from './library/list';
35
- export { default as more } from './library/more';
36
- export { default as noAlt } from './library/no-alt';
37
- export { default as notes } from './library/notes';
38
- export { default as notice } from './library/notice';
39
- export { default as radioSelected } from './library/radio-selected';
40
- export { default as radioUnselected } from './library/radio-unselected';
41
- export { default as reader } from './library/reader';
42
  export { default as removeCart } from './library/remove-cart';
43
- export { default as restore } from './library/restore';
44
- export { default as review } from './library/review';
45
- export { default as search } from './library/search';
46
- export { default as server } from './library/server';
47
- export { default as star } from './library/star';
48
- export { default as stonks } from './library/stonks';
49
- export { default as tag } from './library/tag';
50
- export { default as tags } from './library/tags';
51
  export { default as thumbUp } from './library/thumb-up';
52
  export { default as toggle } from './library/toggle';
53
  export { default as totals } from './library/totals';
54
- export { default as truck } from './library/truck';
55
- export { default as widgets } from './library/widgets';
56
  export { default as woo } from './library/woo';
57
  export { default as miniCart } from './library/mini-cart';
 
 
 
 
 
 
 
 
1
  export { default as barcode } from './library/barcode';
 
 
 
 
2
  export { default as cart } from './library/cart';
3
  export { default as checkPayment } from './library/check-payment';
 
 
 
 
 
 
 
4
  export { default as eye } from './library/eye';
 
 
5
  export { default as fields } from './library/fields';
6
  export { default as filledCart } from './library/filled-cart';
7
  export { default as folderStarred } from './library/folder-starred';
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  export { default as removeCart } from './library/remove-cart';
 
 
 
 
 
 
 
 
9
  export { default as thumbUp } from './library/thumb-up';
10
  export { default as toggle } from './library/toggle';
11
  export { default as totals } from './library/totals';
 
 
12
  export { default as woo } from './library/woo';
13
  export { default as miniCart } from './library/mini-cart';
assets/js/icons/library/address.tsx DELETED
@@ -1,16 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const address = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 16">
8
- <path
9
- fill="currentColor"
10
- fillRule="evenodd"
11
- d="M5.6 0A5.596 5.596 0 000 5.6C0 9.8 5.6 16 5.6 16s5.6-6.2 5.6-10.4C11.2 2.504 8.696 0 5.6 0zm-4 5.6c0-2.208 1.792-4 4-4s4 1.792 4 4c0 2.304-2.304 5.752-4 7.904-1.664-2.136-4-5.624-4-7.904zm2 0a2 2 0 114 0 2 2 0 01-4 0z"
12
- />
13
- </SVG>
14
- );
15
-
16
- export default address;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/arrow-back.tsx DELETED
@@ -1,18 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const arrowBack = (
7
- <SVG
8
- xmlns="http://www.w3.org/2000/svg"
9
- viewBox="0 0 24 24"
10
- width="24"
11
- height="24"
12
- fill="currentColor"
13
- >
14
- <path d="M20 11H7.8l5.6-5.6L12 4l-8 8 8 8 1.4-1.4L7.8 13H20v-2z" />
15
- </SVG>
16
- );
17
-
18
- export default arrowBack;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/arrow-down-alt2.tsx DELETED
@@ -1,23 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const Component = ( { className, size = 20, ...extraProps } ) => {
7
- return (
8
- <SVG
9
- xmlns="http://www.w3.org/2000/svg"
10
- viewBox="0 0 20 20"
11
- className={ className }
12
- width={ size }
13
- height={ size }
14
- { ...extraProps }
15
- >
16
- <path d="M5 6l5 5 5-5 2 1-7 7-7-7z" />
17
- </SVG>
18
- );
19
- };
20
-
21
- const arrowDownAlt2 = <Component />;
22
-
23
- export default arrowDownAlt2;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/asterisk.tsx DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const asterisk = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
8
- <g fill="currentColor" fillRule="evenodd">
9
- <path d="M13.147 2.527c.288.279.295.739.015 1.027L9 7.84l4.449 4.581a.726.726 0 11-1.042 1.012l-4.42-4.55-4.419 4.55a.726.726 0 01-1.042-1.012l4.45-4.581L2.81 3.554a.726.726 0 011.042-1.012l4.133 4.256 4.134-4.256a.726.726 0 011.027-.015z" />
10
- <path d="M.467 7.915c0-.4.326-.726.727-.726H7.29l-.03-5.99a.726.726 0 011.452-.008l.031 5.998h6.229a.726.726 0 110 1.453H8.752l.033 6.328a.726.726 0 11-1.453.007L7.3 8.642H1.194a.726.726 0 01-.727-.727z" />
11
- </g>
12
- </SVG>
13
- );
14
-
15
- export default asterisk;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/atom.tsx DELETED
@@ -1,12 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const atom = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <path d="M12 11a1 1 0 011 1 1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1M4.2 4.2c1.5-1.4 4.5-.8 7.8 1.4 3.3-2.2 6.4-2.8 7.8-1.4 1.4 1.5.8 4.5-1.4 7.8 2.2 3.3 2.8 6.4 1.4 7.8-1.4 1.4-4.6.8-7.8-1.4-3.3 2.2-6.3 2.8-7.8 1.4-1.4-1.4-.8-4.6 1.4-7.8-2.2-3.3-2.8-6.3-1.4-7.8m11.3 4.3a29 29 0 011.7 1.8c1.4-2 2-4 1.2-4.7-.8-.7-2.6-.2-4.7 1.2l1.8 1.7m-7 7a29 29 0 01-1.7-1.8c-1.4 2-2 4-1.2 4.7.8.7 2.6.2 4.7-1.2a29 29 0 01-1.8-1.7M5.6 5.6c-.7.8-.2 2.6 1.2 4.7a29 29 0 013.5-3.5c-2-1.4-4-2-4.7-1.2m4.3 8.5l2.1 2a28.1 28.1 0 004-4.1 28.1 28.1 0 00-4-4 28.1 28.1 0 00-4 4l1.9 2.1m8.5 4.3c.7-.8.2-2.6-1.2-4.7a29 29 0 01-3.5 3.5c2 1.4 4 2 4.7 1.2z" />
9
- </SVG>
10
- );
11
-
12
- export default atom;
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/bank.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const bank = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0z" />
9
- <path d="M4 10h3v7H4zM10.5 10h3v7h-3zM2 19h20v3H2zM17 10h3v7h-3zM12 1L2 6v2h20V6z" />
10
- </SVG>
11
- );
12
-
13
- export default bank;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/barcode.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
 
6
  const barcode = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
 
6
  const barcode = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
assets/js/icons/library/bill.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const grid = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z" />
10
- </SVG>
11
- );
12
-
13
- export default grid;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/bookmark.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const bookmark = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0z" />
9
- <path d="M17 3H7a2 2 0 00-2 2v16l7-3 7 3V5a2 2 0 00-2-2z" />
10
- </SVG>
11
- );
12
-
13
- export default bookmark;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/box.tsx DELETED
@@ -1,18 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const box = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <g fillRule="evenodd">
9
- <path d="M0 0h24v24H0z" fill="none" />
10
- <path
11
- fillRule="nonzero"
12
- d="M20.5 5.2l-1.4-1.7C19 3.3 18.5 3 18 3H6c-.5 0-.9.2-1.2.5L3.5 5.3A2 2 0 003 6.5V19c0 1.1.9 2 2 2h14a2 2 0 002-2V6.5c0-.5-.2-1-.5-1.3zM6.2 5h11.6l.8 1H5.4l.8-1zM5 19V8h14v11H5z"
13
- />
14
- </g>
15
- </SVG>
16
- );
17
-
18
- export default box;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/card.tsx DELETED
@@ -1,16 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const card = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path
10
- fill="currentColor"
11
- d="M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"
12
- />
13
- </SVG>
14
- );
15
-
16
- export default card;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/cart.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
 
6
  const cart = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
 
6
  const cart = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
assets/js/icons/library/check-payment.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
 
6
  const checkPayment = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
 
6
  const checkPayment = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
assets/js/icons/library/chevron-down.tsx DELETED
@@ -1,12 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const chevronDown = (
7
- <SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
8
- <path d="M17 9.4L12 14 7 9.4l-1 1.2 6 5.4 6-5.4z" />
9
- </SVG>
10
- );
11
-
12
- export default chevronDown;
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/chevron-right.tsx DELETED
@@ -1,12 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const chevronRight = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <path d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" />
9
- </SVG>
10
- );
11
-
12
- export default chevronRight;
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/chevron-up.tsx DELETED
@@ -1,12 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const chevronUp = (
7
- <SVG viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
8
- <path d="M12 8l-6 5.4 1 1.2 5-4.6 5 4.6 1-1.2z" />
9
- </SVG>
10
- );
11
-
12
- export default chevronUp;
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/comment.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const comment = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM20 4v13.17L18.83 16H4V4h16zM6 12h12v2H6zm0-3h12v2H6zm0-3h12v2H6z" />
10
- </SVG>
11
- );
12
-
13
- export default comment;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/contact.tsx DELETED
@@ -1,22 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const contact = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 16">
8
- <g fill="none" fillRule="evenodd">
9
- <path
10
- stroke="currentColor"
11
- strokeWidth="1.5"
12
- d="M2 .75h16c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"
13
- />
14
- <path
15
- fill="currentColor"
16
- d="M7.667 7.667A2.34 2.34 0 0010 5.333 2.34 2.34 0 007.667 3a2.34 2.34 0 00-2.334 2.333 2.34 2.34 0 002.334 2.334zM11.556 3H17v3.889h-5.444V3zm2.722 2.916l1.944-1.36v-.779L14.278 5.14l-1.945-1.362v.778l1.945 1.361zm-5.834-.583a.78.78 0 00-.777-.777.78.78 0 00-.778.777c0 .428.35.778.778.778a.78.78 0 00.777-.778zm3.89 5.904c0-1.945-3.088-2.785-4.667-2.785-1.58 0-4.667.84-4.667 2.785v1.097h9.333v-1.097zM7.666 10c-1.012 0-2.163.389-2.738.778h5.475C9.821 10.38 8.678 10 7.667 10z"
17
- />
18
- </g>
19
- </SVG>
20
- );
21
-
22
- export default contact;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/discussion.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const discussion = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M15 4v7H5.17l-.59.59-.58.58V4h11m1-2H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm5 4h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1z" />
10
- </SVG>
11
- );
12
-
13
- export default discussion;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/done.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const done = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0z" />
9
- <path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />
10
- </SVG>
11
- );
12
-
13
- export default done;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/exclamation.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const exclamation = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-4.51 2.11l.26 2.79-2.74.62-1.43 2.41L12 18.82l-2.58 1.11-1.43-2.41-2.74-.62.26-2.8L3.66 12l1.85-2.12-.26-2.78 2.74-.61 1.43-2.41L12 5.18l2.58-1.11 1.43 2.41 2.74.62-.26 2.79L20.34 12l-1.85 2.11zM11 15h2v2h-2zm0-8h2v6h-2z" />
10
- </SVG>
11
- );
12
-
13
- export default exclamation;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/external.tsx DELETED
@@ -1,27 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const external = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <mask
9
- id="external-mask"
10
- width="24"
11
- height="24"
12
- x="0"
13
- y="0"
14
- maskUnits="userSpaceOnUse"
15
- >
16
- <path
17
- fill="#fff"
18
- d="M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"
19
- />
20
- </mask>
21
- <g mask="url(#external-mask)">
22
- <path d="M0 0h24v24H0z" />
23
- </g>
24
- </SVG>
25
- );
26
-
27
- export default external;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/eye.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
 
6
  const eye = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
 
6
  const eye = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
assets/js/icons/library/fields.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
 
6
  const fields = (
7
  <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24" fill="none">
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
 
6
  const fields = (
7
  <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24" fill="none">
assets/js/icons/library/filled-cart.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
 
6
  const filledCart = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
 
6
  const filledCart = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
assets/js/icons/library/folder-starred.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
 
6
  const folderStarred = (
7
  <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
 
6
  const folderStarred = (
7
  <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
assets/js/icons/library/folder.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const folder = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z" />
10
- </SVG>
11
- );
12
-
13
- export default folder;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/form-step.tsx DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const FormStep = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <g fillRule="evenodd">
9
- <path d="M20 6a1 1 0 011 1v13a1 1 0 01-1 1H4a1 1 0 01-1-1V7a1 1 0 011-1h16zm-1 2H5v11h14V8z" />
10
- <path d="M3 4h8v3H3zM18 10v3H6v-3h12zm-3 1H7v1h8v-1zM18 14v3H6v-3h12zm-3 1H7v1h8v-1z" />
11
- </g>
12
- </SVG>
13
- );
14
-
15
- export default FormStep;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/grid.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const grid = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z" />
10
- </SVG>
11
- );
12
-
13
- export default grid;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/heading.tsx DELETED
@@ -1,12 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const heading = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <path d="M7 6L7 17L12 12.875L17 17L17 6L12 6L7 6Z" />
9
- </SVG>
10
- );
11
-
12
- export default heading;
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/image.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const image = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z" />
10
- </SVG>
11
- );
12
-
13
- export default image;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/list.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const list = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7zM20.1 3H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9zM19 19H5V5h14v14z" />
10
- </SVG>
11
- );
12
-
13
- export default list;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/mini-cart.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
 
6
  const miniCart = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
 
6
  const miniCart = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
assets/js/icons/library/more.tsx DELETED
@@ -1,16 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const more = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.97.89 1.66.89H22c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7.07L2.4 12l4.66-7H22v14z" />
10
- <circle cx="9" cy="12" r="1.5" />
11
- <circle cx="14" cy="12" r="1.5" />
12
- <circle cx="19" cy="12" r="1.5" />
13
- </SVG>
14
- );
15
-
16
- export default more;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/no-alt.tsx DELETED
@@ -1,23 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const Component = ( { className, size, ...extraProps } ) => {
7
- return (
8
- <SVG
9
- xmlns="http://www.w3.org/2000/svg"
10
- viewBox="0 0 20 20"
11
- className={ className }
12
- width={ size }
13
- height={ size }
14
- { ...extraProps }
15
- >
16
- <path d="M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z" />
17
- </SVG>
18
- );
19
- };
20
-
21
- const noAlt = <Component />;
22
-
23
- export default noAlt;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/notes.tsx DELETED
@@ -1,22 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const notes = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
8
- <g fill="none" fillRule="evenodd">
9
- <path
10
- stroke="currentColor"
11
- strokeWidth="1.5"
12
- d="M2 .75h12c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"
13
- />
14
- <path
15
- fill="currentColor"
16
- d="M12 6H4V4.75h8zM12 9H4V7.75h8zM10 12H4v-1.25h6z"
17
- />
18
- </g>
19
- </SVG>
20
- );
21
-
22
- export default notes;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/notice.tsx DELETED
@@ -1,12 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const notice = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" />
9
- </SVG>
10
- );
11
-
12
- export default notice;
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/radio-selected.tsx DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const radioSelected = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <path
9
- fill="#1E8CBE"
10
- d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
11
- />
12
- </SVG>
13
- );
14
-
15
- export default radioSelected;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/radio-unselected.tsx DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const radioUnselected = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <path
9
- fill="#757575"
10
- d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
11
- />
12
- </SVG>
13
- );
14
-
15
- export default radioUnselected;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/reader.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const reader = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M21 4H3a2 2 0 00-2 2v13c0 1.1.9 2 2 2h18a2 2 0 002-2V6a2 2 0 00-2-2zM3 19V6h8v13H3zm18 0h-8V6h8v13zm-7-9.5h6V11h-6zm0 2.5h6v1.5h-6zm0 2.5h6V16h-6z" />
10
- </SVG>
11
- );
12
-
13
- export default reader;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/remove-cart.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
 
6
  const removeCart = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
 
6
  const removeCart = (
7
  <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
assets/js/icons/library/restore.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const restore = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0z" />
9
- <path d="M14 12c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm-2-9c-5 0-9 4-9 9H0l4 4 4-4H5a7 7 0 113 5.7l-1.5 1.4A9 9 0 1012 3z" />
10
- </SVG>
11
- );
12
-
13
- export default restore;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/review.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const review = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17l-.59.59-.58.58V4h16v12zm-9.5-2H18v-2h-5.5zm3.86-5.87c.2-.2.2-.51 0-.71l-1.77-1.77c-.2-.2-.51-.2-.71 0L6 11.53V14h2.47l5.89-5.87z" />
10
- </SVG>
11
- );
12
-
13
- export default review;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/search.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const search = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" />
10
- </SVG>
11
- );
12
-
13
- export default search;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/server.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const server = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M19 15v4H5v-4h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1zM7 18.5c-.82 0-1.5-.67-1.5-1.5s.68-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM19 5v4H5V5h14m1-2H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h16c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1zM7 8.5c-.82 0-1.5-.67-1.5-1.5S6.18 5.5 7 5.5s1.5.68 1.5 1.5S7.83 8.5 7 8.5z" />
10
- </SVG>
11
- );
12
-
13
- export default server;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/star.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const star = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z" />
10
- </SVG>
11
- );
12
-
13
- export default star;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/stonks.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
- // 🤫
6
- const stonks = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99l1.5 1.5z" />
10
- </SVG>
11
- );
12
-
13
- export default stonks;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/tag.tsx DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const tag = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z" />
10
- <circle cx="6.5" cy="6.5" r="1.5" />
11
- <path d="M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z" />
12
- </SVG>
13
- );
14
-
15
- export default tag;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/tags.tsx DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const tags = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M2.53 19.65l1.34.56v-9.03l-2.43 5.86c-.41 1.02.08 2.19 1.09 2.61zm19.5-3.7L17.07 3.98c-.31-.75-1.04-1.21-1.81-1.23-.26 0-.53.04-.79.15L7.1 5.95c-.75.31-1.21 1.03-1.23 1.8-.01.27.04.54.15.8l4.96 11.97c.31.76 1.05 1.22 1.83 1.23.26 0 .52-.05.77-.15l7.36-3.05c1.02-.42 1.51-1.59 1.09-2.6zm-9.2 3.8L7.87 7.79l7.35-3.04h.01l4.95 11.95-7.35 3.05z" />
10
- <circle cx="11" cy="9" r="1" />
11
- <path d="M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z" />
12
- </SVG>
13
- );
14
-
15
- export default tags;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/thumb-up.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
 
6
  const thumbUp = (
7
  <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
 
6
  const thumbUp = (
7
  <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
assets/js/icons/library/toggle.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
 
6
  const toggle = (
7
  <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
 
6
  const toggle = (
7
  <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
assets/js/icons/library/totals.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
 
6
  const totals = (
7
  <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24" fill="none">
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
 
6
  const totals = (
7
  <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24" fill="none">
assets/js/icons/library/truck.tsx DELETED
@@ -1,16 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const truck = (
7
- <SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 13">
8
- <path
9
- fill="currentColor"
10
- fillRule="evenodd"
11
- d="M11.667 2.5h1.666l3.334 3.333V10H15a2.5 2.5 0 11-5 0H6.667a2.5 2.5 0 11-5 0H0V1.667C0 .746.746 0 1.667 0H10c.92 0 1.667.746 1.667 1.667V2.5zM2.917 10a1.25 1.25 0 102.5 0 1.25 1.25 0 00-2.5 0zm-1.25-2.5V1.667H10V7.5H1.667zM11.25 10a1.25 1.25 0 102.5 0 1.25 1.25 0 00-2.5 0z"
12
- />
13
- </SVG>
14
- );
15
-
16
- export default truck;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/widgets.tsx DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { SVG } from 'wordpress-components';
5
-
6
- const widgets = (
7
- <SVG xmlns="http://www.w3.org/2000/SVG" viewBox="0 0 24 24">
8
- <path fill="none" d="M0 0h24v24H0V0z" />
9
- <path d="M16.66 4.52l2.83 2.83-2.83 2.83-2.83-2.83 2.83-2.83M9 5v4H5V5h4m10 10v4h-4v-4h4M9 15v4H5v-4h4m7.66-13.31L11 7.34 16.66 13l5.66-5.66-5.66-5.65zM11 3H3v8h8V3zm10 10h-8v8h8v-8zm-10 0H3v8h8v-8z" />
10
- </SVG>
11
- );
12
-
13
- export default widgets;
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/icons/library/woo.tsx CHANGED
@@ -1,7 +1,7 @@
1
  /**
2
  * External dependencies
3
  */
4
- import { SVG } from 'wordpress-components';
5
  import classnames from 'classnames';
6
  const Component = ( { className, height, width, ...props } ) => {
7
  return (
1
  /**
2
  * External dependencies
3
  */
4
+ import { SVG } from '@wordpress/primitives';
5
  import classnames from 'classnames';
6
  const Component = ( { className, height, width, ...props } ) => {
7
  return (
assets/js/icons/stories/index.tsx CHANGED
@@ -2,41 +2,17 @@
2
  * External dependencies
3
  */
4
  import { omitBy } from 'lodash';
5
- import { Story, Meta } from '@storybook/react';
6
  import { useState } from '@wordpress/element';
 
7
 
8
  /**
9
  * Internal dependencies
10
  */
11
  import * as icons from '../index';
12
- import { IconProps } from '../icon';
13
 
14
- const { Icon, ...availableIcons } = icons;
15
-
16
- export default {
17
- title: 'WooCommerce Blocks/@woocommerce/icons',
18
- component: Icon,
19
- argTypes: {
20
- size: {
21
- control: { type: 'range', min: 8, max: 96 },
22
- },
23
- srcElement: {
24
- control: 'select',
25
- mapping: availableIcons,
26
- options: Object.keys( availableIcons ),
27
- },
28
- },
29
- } as Meta< IconProps >;
30
-
31
- const Template: Story< IconProps > = ( args ) => <Icon { ...args } />;
32
-
33
- export const BaseIcon = Template.bind( {} );
34
- BaseIcon.args = {
35
- srcElement: icons.woo,
36
- size: 24,
37
- };
38
-
39
- export const Library: Story< IconProps > = ( args ) => {
40
  const [ filter, setFilter ] = useState( '' );
41
  const filteredIcons = omitBy( availableIcons, ( _, name ) => {
42
  return ! name.includes( filter );
@@ -87,18 +63,18 @@ export const Library: Story< IconProps > = ( args ) => {
87
  >
88
  <Icon
89
  className={ args.className }
90
- srcElement={ icon }
91
  />
92
  <Icon
93
  className={ args.className }
94
  style={ { paddingLeft: '10px' } }
95
- srcElement={ icon }
96
  size={ 36 }
97
  />
98
  <Icon
99
  className={ args.className }
100
  style={ { paddingLeft: '10px' } }
101
- srcElement={ icon }
102
  size={ 48 }
103
  />
104
  </div>
2
  * External dependencies
3
  */
4
  import { omitBy } from 'lodash';
5
+ import { Story } from '@storybook/react';
6
  import { useState } from '@wordpress/element';
7
+ import { Icon } from '@wordpress/icons';
8
 
9
  /**
10
  * Internal dependencies
11
  */
12
  import * as icons from '../index';
13
+ const { ...availableIcons } = icons;
14
 
15
+ export const Library: Story = ( args ) => {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  const [ filter, setFilter ] = useState( '' );
17
  const filteredIcons = omitBy( availableIcons, ( _, name ) => {
18
  return ! name.includes( filter );
63
  >
64
  <Icon
65
  className={ args.className }
66
+ icon={ icon }
67
  />
68
  <Icon
69
  className={ args.className }
70
  style={ { paddingLeft: '10px' } }
71
+ icon={ icon }
72
  size={ 36 }
73
  />
74
  <Icon
75
  className={ args.className }
76
  style={ { paddingLeft: '10px' } }
77
+ icon={ icon }
78
  size={ 48 }
79
  />
80
  </div>
assets/js/index.js CHANGED
@@ -3,7 +3,8 @@
3
  */
4
  import { getCategories, setCategories } from '@wordpress/blocks';
5
  import { __ } from '@wordpress/i18n';
6
- import { woo, atom, Icon } from '@woocommerce/icons';
 
7
 
8
  /**
9
  * Internal dependencies
@@ -21,7 +22,7 @@ setCategories( [
21
  {
22
  slug: 'woocommerce',
23
  title: __( 'WooCommerce', 'woo-gutenberg-products-block' ),
24
- icon: <Icon srcElement={ woo } />,
25
  },
26
  {
27
  slug: 'woocommerce-product-elements',
@@ -31,7 +32,7 @@ setCategories( [
31
  ),
32
  icon: (
33
  <Icon
34
- srcElement={ atom }
35
  className="wc-block-editor-components-block-icon"
36
  />
37
  ),
3
  */
4
  import { getCategories, setCategories } from '@wordpress/blocks';
5
  import { __ } from '@wordpress/i18n';
6
+ import { woo } from '@woocommerce/icons';
7
+ import { Icon } from '@wordpress/icons';
8
 
9
  /**
10
  * Internal dependencies
22
  {
23
  slug: 'woocommerce',
24
  title: __( 'WooCommerce', 'woo-gutenberg-products-block' ),
25
+ icon: <Icon icon={ woo } />,
26
  },
27
  {
28
  slug: 'woocommerce-product-elements',
32
  ),
33
  icon: (
34
  <Icon
35
+ icon={ woo }
36
  className="wc-block-editor-components-block-icon"
37
  />
38
  ),
assets/js/previews/products.js CHANGED
@@ -34,6 +34,14 @@ export const previewProducts = [
34
  },
35
  ],
36
  average_rating: 5,
 
 
 
 
 
 
 
 
37
  review_count: 1,
38
  prices: {
39
  currency_code: 'GBP',
34
  },
35
  ],
36
  average_rating: 5,
37
+ categories: [
38
+ {
39
+ id: 1,
40
+ name: 'Decor',
41
+ slug: 'decor',
42
+ link: 'https://example.org',
43
+ },
44
+ ],
45
  review_count: 1,
46
  prices: {
47
  currency_code: 'GBP',
assets/js/types/type-defs/blocks.ts ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { LazyExoticComponent } from 'react';
5
+
6
+ export type RegisteredBlockComponent =
7
+ | LazyExoticComponent< React.ComponentType< unknown > >
8
+ | ( () => JSX.Element | null )
9
+ | null;
assets/js/types/type-defs/hooks.ts CHANGED
@@ -52,3 +52,11 @@ export interface StoreCart {
52
  paymentRequirements: Array< string >;
53
  receiveCart: ( cart: CartResponse ) => void;
54
  }
 
 
 
 
 
 
 
 
52
  paymentRequirements: Array< string >;
53
  receiveCart: ( cart: CartResponse ) => void;
54
  }
55
+
56
+ export type Query = {
57
+ catalog_visibility: 'catalog';
58
+ per_page: number;
59
+ page: number;
60
+ orderby: string;
61
+ order: string;
62
+ };
assets/js/types/type-defs/index.ts CHANGED
@@ -6,3 +6,5 @@ export * from './currency';
6
  export * from './payments';
7
  export * from './objects';
8
  export * from './payment-method-interface';
 
 
6
  export * from './payments';
7
  export * from './objects';
8
  export * from './payment-method-interface';
9
+ export * from './blocks';
10
+ export * from './utils';
assets/js/types/type-defs/utils.ts CHANGED
@@ -4,3 +4,7 @@
4
  */
5
  export type LooselyMustHave< T, K extends keyof T > = Partial< T > &
6
  Pick< T, K >;
 
 
 
 
4
  */
5
  export type LooselyMustHave< T, K extends keyof T > = Partial< T > &
6
  Pick< T, K >;
7
+
8
+ export type HTMLElementEvent< T extends HTMLElement > = Event & {
9
+ target: T;
10
+ };
assets/js/types/type-guards/index.ts CHANGED
@@ -38,3 +38,7 @@ export const isFunction = < T extends Function, U >(
38
  export const isBoolean = ( term: unknown ): term is boolean => {
39
  return typeof term === 'boolean';
40
  };
 
 
 
 
38
  export const isBoolean = ( term: unknown ): term is boolean => {
39
  return typeof term === 'boolean';
40
  };
41
+
42
+ export const isError = ( term: unknown ): term is Error => {
43
+ return term instanceof Error;
44
+ };
build/active-filters-frontend.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '265c2f723bda637cb220082df4f95667');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '53141c6798bdbc2a04b2fca31762cd4d');
build/active-filters-frontend.js CHANGED
@@ -1,13 +1,13 @@
1
- !function(e){var t={};function r(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,r),c.l=!0,c.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)r.d(n,c,function(t){return e[t]}.bind(null,c));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=188)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},104:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return s}));var n=r(2);const c=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;var n;return r.id&&e.push(r),e},[]),o=e=>{if(e)return c.find(t=>t.id===e)},s=e=>{if(e)return c.find(t=>t.taxonomy===e)}},105:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return o}));var n=r(5);const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=e.filter(e=>e.attribute===r.taxonomy),s=o.length?o[0]:null;if(!(s&&s.slug&&Array.isArray(s.slug)&&s.slug.includes(c)))return;const a=s.slug.filter(e=>e!==c),l=e.filter(e=>e.attribute!==r.taxonomy);a.length>0&&(s.slug=a.sort(),l.push(s)),t(Object(n.sortBy)(l,"attribute"))},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const s=e.filter(e=>e.attribute!==r.taxonomy);0===c.length?t(s):(s.push({attribute:r.taxonomy,operator:o,slug:c.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(s,"attribute")))}},11:function(e,t){e.exports=window.wp.isShallowEqual},112:function(e,t){},13:function(e,t,r){"use strict";var n=r(16),c=r.n(n),o=r(0),s=r(3),a=r(1),l=r(65),i=e=>{let{imageUrl:t=l.l+"/block-error.svg",header:r=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:c,errorMessagePrefix:s=Object(a.__)("Error:","woo-gutenberg-products-block"),button:i,showErrorBlock:u=!0}=e;return u?Object(o.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(o.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(o.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(o.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(o.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),c&&Object(o.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",c),i&&Object(o.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},i))):null};r(37);class u extends s.Component{constructor(){super(...arguments),c()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(o.createElement)(o.Fragment,null,Object(o.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:c,errorMessagePrefix:s,renderError:a,button:l}=this.props,{errorMessage:u,hasError:b}=this.state;return b?"function"==typeof a?a({errorMessage:u}):Object(o.createElement)(i,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:c,errorMessagePrefix:s,button:l}):this.props.children}}t.a=u},16:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},165:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(0),s=r(24);const a=Object(o.createElement)(e=>{let{className:t,size:r,...n}=e;return Object(o.createElement)(s.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:r,height:r},n),Object(o.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},null);t.a=a},168:function(e,t,r){"use strict";var n=r(10),c=r.n(n),o=r(0),s=r(4),a=r.n(s),l=r(1),i=r(98),u=r(165);r(112);var b=e=>{let{text:t,screenReaderText:r="",element:n="li",className:s="",radius:l="small",children:i=null,...u}=e;const b=n,p=a()(s,"wc-block-components-chip","wc-block-components-chip--radius-"+l),d=Boolean(r&&r!==t);return Object(o.createElement)(b,c()({className:p},u),Object(o.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(o.createElement)("span",{className:"screen-reader-text"},r),i)};t.a=e=>{let{ariaLabel:t="",className:r="",disabled:n=!1,onRemove:s=(()=>{}),removeOnAnyClick:p=!1,text:d,screenReaderText:m="",...f}=e;const g=p?"span":"button";if(!t){const e=m&&"string"==typeof m?m:d;t="string"!=typeof e?
2
  /* translators: Remove chip. */
3
  Object(l.__)("Remove","woo-gutenberg-products-block"):Object(l.sprintf)(
4
  /* translators: %s text of the chip to remove. */
5
- Object(l.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const O={"aria-label":t,disabled:n,onClick:s,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||s()}},j=p?O:{},_=p?{"aria-hidden":!0}:O;return Object(o.createElement)(b,c()({},f,j,{className:a()(r,"is-removable"),element:p?"button":f.element,screenReaderText:m,text:d}),Object(o.createElement)(g,c()({className:"wc-block-components-chip__remove"},_),Object(o.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",srcElement:u.a,size:16})))}},17:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0),c=r(11),o=r.n(c);function s(e){const t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},188:function(e,t,r){e.exports=r(209)},189:function(e,t){},19:function(e,t){e.exports=window.wp.htmlEntities},2:function(e,t){e.exports=window.wc.wcSettings},209:function(e,t,r){"use strict";r.r(t);var n=r(53),c=r(0),o=r(1),s=r(39),a=r(2),l=r(4),i=r.n(l),u=(r(8),r(21)),b=(r(189),r(104)),p=r(40),d=r(168);const m=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(o.sprintf)(
6
  /* translators: %1$s min price, %2$s max price */
7
- Object(o.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(p.formatPrice)(e),Object(p.formatPrice)(t)):Number.isFinite(e)?Object(o.sprintf)(
8
  /* translators: %s min price */
9
- Object(o.__)("From %s","woo-gutenberg-products-block"),Object(p.formatPrice)(e)):Object(o.sprintf)(
10
  /* translators: %s max price */
11
- Object(o.__)("Up to %s","woo-gutenberg-products-block"),Object(p.formatPrice)(t)),f=e=>{let{type:t,name:r,prefix:n,removeCallback:s=(()=>{}),showLabel:a=!0,displayStyle:l}=e;const i=n?Object(c.createElement)(c.Fragment,null,n," ",r):r,b=Object(o.sprintf)(
12
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
13
- Object(o.__)("Remove %s filter","woo-gutenberg-products-block"),r);return Object(c.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},a&&Object(c.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===l?Object(c.createElement)(d.a,{element:"span",text:i,onRemove:s,radius:"large",ariaLabel:b}):Object(c.createElement)("span",{className:"wc-block-active-filters__list-item-name"},i,Object(c.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:s},Object(c.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(c.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(c.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(c.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(c.createElement)(u.a,{screenReaderLabel:b}))))};var g=r(64),O=r(19),j=r(105),_=e=>{let{attributeObject:t={},slugs:r=[],operator:n="in",displayStyle:a}=e;const{results:l,isLoading:i}=Object(g.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[u,b]=Object(s.b)("attributes",[]);if(i)return null;const p=t.label;return Object(c.createElement)("li",null,Object(c.createElement)("span",{className:"wc-block-active-filters__list-item-type"},p,":"),Object(c.createElement)("ul",null,r.map((e,r)=>{const s=l.find(t=>t.slug===e);if(!s)return null;let i="";return r>0&&"and"===n&&(i=Object(c.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(o.__)("and","woo-gutenberg-products-block"))),f({type:p,name:Object(O.decodeEntities)(s.name||e),prefix:i,removeCallback:()=>{Object(j.a)(u,b,t,e)},showLabel:!1,displayStyle:a})})))};Object(n.a)({selector:".wp-block-woocommerce-active-filters",Block:e=>{let{attributes:t,isEditor:r=!1}=e;const[n,l]=Object(s.b)("attributes",[]),[p,d]=Object(s.b)("stock_status",[]),[g,O]=Object(s.b)("min_price"),[j,y]=Object(s.b)("max_price"),w=Object(a.getSetting)("stockStatusOptions",[]),E=Object(c.useMemo)(()=>{if(p.length>0)return p.map(e=>f({type:Object(o.__)("Stock Status","woo-gutenberg-products-block"),name:w[e],removeCallback:()=>{const t=p.filter(t=>t!==e);d(t)},displayStyle:t.displayStyle}))},[w,p,d,t.displayStyle]),h=Object(c.useMemo)(()=>Number.isFinite(g)||Number.isFinite(j)?f({type:Object(o.__)("Price","woo-gutenberg-products-block"),name:m(g,j),removeCallback:()=>{O(void 0),y(void 0)},displayStyle:t.displayStyle}):null,[g,j,t.displayStyle,O,y]),v=Object(c.useMemo)(()=>n.map(e=>{const r=Object(b.b)(e.attribute);return Object(c.createElement)(_,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}),[n,t.displayStyle]);if(!(n.length>0||p.length>0||Number.isFinite(g)||Number.isFinite(j)||r))return null;const k="h"+t.headingLevel,S=i()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(c.createElement)(c.Fragment,null,!r&&t.heading&&Object(c.createElement)(k,{className:"wc-block-active-filters__title"},t.heading),Object(c.createElement)("div",{className:"wc-block-active-filters"},Object(c.createElement)("ul",{className:S},r?Object(c.createElement)(c.Fragment,null,f({type:Object(o.__)("Size","woo-gutenberg-products-block"),name:Object(o.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),f({type:Object(o.__)("Color","woo-gutenberg-products-block"),name:Object(o.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(c.createElement)(c.Fragment,null,h,E,v)),Object(c.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{O(void 0),y(void 0),l([]),d([])}},Object(c.createElement)(u.a,{label:Object(o.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(o.__)("Clear All Filters","woo-gutenberg-products-block")}))))},getProps:e=>({attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3},isEditor:!1})})},21:function(e,t,r){"use strict";var n=r(0),c=r(4),o=r.n(c);t.a=e=>{let t,{label:r,screenReaderLabel:c,wrapperElement:s,wrapperProps:a={}}=e;const l=null!=r,i=null!=c;return!l&&i?(t=s||"span",a={...a,className:o()(a.className,"screen-reader-text")},Object(n.createElement)(t,a,c)):(t=s||n.Fragment,l&&i&&r!==c?Object(n.createElement)(t,a,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},c)):Object(n.createElement)(t,a,r))}},24:function(e,t){e.exports=window.wp.primitives},25:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const c=Object(n.createContext)("page"),o=()=>Object(n.useContext)(c);c.Provider},3:function(e,t){e.exports=window.React},37:function(e,t){},39:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return d}));var n=r(6),c=r(9),o=r(0),s=r(11),a=r.n(s),l=r(17),i=r(62),u=r(25);const b=e=>{const t=Object(u.a)();e=e||t;const r=Object(c.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:s}=Object(c.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(o.useCallback)(t=>{s(e,t)},[e,s])]},p=(e,t,r)=>{const s=Object(u.a)();r=r||s;const a=Object(c.useSelect)(c=>c(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:l}=Object(c.useDispatch)(n.QUERY_STATE_STORE_KEY);return[a,Object(o.useCallback)(t=>{l(r,e,t)},[r,e,l])]},d=(e,t)=>{const r=Object(u.a)();t=t||r;const[n,c]=b(t),s=Object(l.a)(n),p=Object(l.a)(e),d=Object(i.a)(p),m=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{a()(d,p)||(c(Object.assign({},s,p)),m.current=!0)},[s,p,d,c]),m.current?[n,c]:[e,c]}},4:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function c(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)){if(n.length){var s=c.apply(null,n);s&&e.push(s)}}else if("object"===o)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(c.default=c,e.exports=c):void 0===(n=function(){return c}.apply(t,[]))||(e.exports=n)}()},40:function(e,t){e.exports=window.wc.priceFormat},42:function(e,t,r){"use strict";var n=r(43);function c(){}function o(){}o.resetWarningCache=c,e.exports=function(){function e(e,t,r,c,o,s){if(s!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:c};return r.PropTypes=r,r}},43:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5:function(e,t){e.exports=window.lodash},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(10),c=r.n(n),o=r(0),s=r(13);const a=[".wp-block-woocommerce-cart"],l=e=>{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const l=n(e,r),i=a(e,r),u={...e.dataset,...l.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:a={},errorBoundaryProps:l={}}=e;Object(o.render)(Object(o.createElement)(s.a,l,Object(o.createElement)(o.Suspense,{fallback:Object(o.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(o.createElement)(t,c()({},a,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:l,attributes:u,errorBoundaryProps:i})})},i=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:c,selector:o}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:c,wrappers:o}=e;const s=document.body.querySelectorAll(c);o&&o.length>0&&Array.prototype.filter.call(s,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,o)),l({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:c,selector:o,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:c,wrapper:o}=e;const s=o.querySelectorAll(c);l({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const c=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},6:function(e,t){e.exports=window.wc.wcBlocksData},62:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(3);function c(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},64:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var n=r(6),c=r(9),o=r(0),s=r(17),a=r(54);const l=e=>{const{namespace:t,resourceName:r,resourceValues:l=[],query:i={},shouldSelect:u=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(o.useRef)({results:[],isLoading:!0}),p=Object(s.a)(i),d=Object(s.a)(l),m=Object(a.a)(),f=Object(c.useSelect)(e=>{if(!u)return null;const c=e(n.COLLECTIONS_STORE_KEY),o=[t,r,p,d],s=c.getCollectionError(...o);return s&&m(s),{results:c.getCollection(...o),isLoading:!c.hasFinishedResolution("getCollection",o)}},[t,r,d,p,u]);return null!==f&&(b.current=f),b.current}},65:function(e,t,r){"use strict";r.d(t,"n",(function(){return o})),r.d(t,"l",(function(){return s})),r.d(t,"k",(function(){return a})),r.d(t,"m",(function(){return l})),r.d(t,"i",(function(){return i})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return b})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return m})),r.d(t,"g",(function(){return f})),r.d(t,"a",(function(){return g})),r.d(t,"h",(function(){return O})),r.d(t,"b",(function(){return j}));var n,c=r(2);const o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),s=o.pluginUrl+"images/",a=o.pluginUrl+"build/",l=o.buildPhase,i=null===(n=c.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(c.STORE_PAGES.checkout.id,c.STORE_PAGES.checkout.permalink),b=c.STORE_PAGES.privacy.permalink,p=(c.STORE_PAGES.privacy.title,c.STORE_PAGES.terms.permalink),d=(c.STORE_PAGES.terms.title,c.STORE_PAGES.cart.id,c.STORE_PAGES.cart.permalink),m=c.STORE_PAGES.myaccount.permalink?c.STORE_PAGES.myaccount.permalink:Object(c.getSetting)("wpLoginUrl","/wp-login.php"),f=Object(c.getSetting)("shippingCountries",{}),g=Object(c.getSetting)("allowedCountries",{}),O=Object(c.getSetting)("shippingStates",{}),j=Object(c.getSetting)("allowedStates",{})},8:function(e,t,r){e.exports=r(42)()},9:function(e,t){e.exports=window.wp.data},98:function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{srcElement:t,size:r=24,...c}=e;return Object(n.isValidElement)(t)?Object(n.cloneElement)(t,{width:r,height:r,...c}):null}}});
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=192)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){e.exports=window.wp.isShallowEqual},100:function(e,t,r){"use strict";var n=r(0);t.a=function(e){let{icon:t,size:r=24,...o}=e;return Object(n.cloneElement)(t,{width:r,height:r,...o})}},105:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return s}));var n=r(2);const o=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const r=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;var n;return r.id&&e.push(r),e},[]),c=e=>{if(e)return o.find(t=>t.id===e)},s=e=>{if(e)return o.find(t=>t.taxonomy===e)}},106:function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return c}));var n=r(5);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const c=e.filter(e=>e.attribute===r.taxonomy),s=c.length?c[0]:null;if(!(s&&s.slug&&Array.isArray(s.slug)&&s.slug.includes(o)))return;const a=s.slug.filter(e=>e!==o),l=e.filter(e=>e.attribute!==r.taxonomy);a.length>0&&(s.slug=a.sort(),l.push(s)),t(Object(n.sortBy)(l,"attribute"))},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const s=e.filter(e=>e.attribute!==r.taxonomy);0===o.length?t(s):(s.push({attribute:r.taxonomy,operator:c,slug:o.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(s,"attribute")))}},11:function(e,t){function r(){return e.exports=r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,r.apply(this,arguments)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},115:function(e,t){},13:function(e,t){e.exports=window.wp.primitives},14:function(e,t,r){"use strict";var n=r(17),o=r.n(n),c=r(0),s=r(3),a=r(1),l=r(50),i=e=>{let{imageUrl:t=l.l+"/block-error.svg",header:r=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:n=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:s=Object(a.__)("Error:","woo-gutenberg-products-block"),button:i,showErrorBlock:u=!0}=e;return u?Object(c.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(c.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(c.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},r&&Object(c.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},r),n&&Object(c.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},n),o&&Object(c.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},s?s+" ":"",o),i&&Object(c.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},i))):null};r(37);class u extends s.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:r=!0,showErrorBlock:n=!0,text:o,errorMessagePrefix:s,renderError:a,button:l}=this.props,{errorMessage:u,hasError:b}=this.state;return b?"function"==typeof a?a({errorMessage:u}):Object(c.createElement)(i,{showErrorBlock:n,errorMessage:r?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:s,button:l}):this.props.children}}t.a=u},169:function(e,t,r){"use strict";var n=r(0),o=r(13);const c=Object(n.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(o.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=c},17:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},172:function(e,t,r){"use strict";var n=r(11),o=r.n(n),c=r(0),s=r(4),a=r.n(s),l=r(1),i=r(100),u=r(169);r(115);var b=e=>{let{text:t,screenReaderText:r="",element:n="li",className:s="",radius:l="small",children:i=null,...u}=e;const b=n,p=a()(s,"wc-block-components-chip","wc-block-components-chip--radius-"+l),d=Boolean(r&&r!==t);return Object(c.createElement)(b,o()({className:p},u),Object(c.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(c.createElement)("span",{className:"screen-reader-text"},r),i)};t.a=e=>{let{ariaLabel:t="",className:r="",disabled:n=!1,onRemove:s=(()=>{}),removeOnAnyClick:p=!1,text:d,screenReaderText:m="",...f}=e;const g=p?"span":"button";if(!t){const e=m&&"string"==typeof m?m:d;t="string"!=typeof e?
2
  /* translators: Remove chip. */
3
  Object(l.__)("Remove","woo-gutenberg-products-block"):Object(l.sprintf)(
4
  /* translators: %s text of the chip to remove. */
5
+ Object(l.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const O={"aria-label":t,disabled:n,onClick:s,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||s()}},j=p?O:{},y=p?{"aria-hidden":!0}:O;return Object(c.createElement)(b,o()({},f,j,{className:a()(r,"is-removable"),element:p?"button":f.element,screenReaderText:m,text:d}),Object(c.createElement)(g,o()({className:"wc-block-components-chip__remove"},y),Object(c.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},18:function(e,t,r){"use strict";r.d(t,"c",(function(){return n})),r.d(t,"e",(function(){return o})),r.d(t,"d",(function(){return c})),r.d(t,"f",(function(){return s})),r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return l}));const n=e=>"number"==typeof e,o=e=>"string"==typeof e,c=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function s(e,t){return c(e)&&t in e}const a=e=>"boolean"==typeof e,l=e=>e instanceof Error},19:function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=r(0),o=r(10),c=r.n(o);function s(e){const t=Object(n.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},192:function(e,t,r){e.exports=r(213)},193:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},21:function(e,t){e.exports=window.wp.htmlEntities},213:function(e,t,r){"use strict";r.r(t);var n=r(53),o=r(0),c=r(1),s=r(38),a=r(2),l=r(4),i=r.n(l),u=(r(8),r(23)),b=(r(193),r(105)),p=r(40),d=r(172);const m=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(c.sprintf)(
6
  /* translators: %1$s min price, %2$s max price */
7
+ Object(c.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(p.formatPrice)(e),Object(p.formatPrice)(t)):Number.isFinite(e)?Object(c.sprintf)(
8
  /* translators: %s min price */
9
+ Object(c.__)("From %s","woo-gutenberg-products-block"),Object(p.formatPrice)(e)):Object(c.sprintf)(
10
  /* translators: %s max price */
11
+ Object(c.__)("Up to %s","woo-gutenberg-products-block"),Object(p.formatPrice)(t)),f=e=>{let{type:t,name:r,prefix:n,removeCallback:s=(()=>{}),showLabel:a=!0,displayStyle:l}=e;const i=n?Object(o.createElement)(o.Fragment,null,n," ",r):r,b=Object(c.sprintf)(
12
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
13
+ Object(c.__)("Remove %s filter","woo-gutenberg-products-block"),r);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+r},a&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===l?Object(o.createElement)(d.a,{element:"span",text:i,onRemove:s,radius:"large",ariaLabel:b}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},i,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:s},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(u.a,{screenReaderLabel:b}))))};var g=r(65),O=r(21),j=r(106),y=e=>{let{attributeObject:t={},slugs:r=[],operator:n="in",displayStyle:a}=e;const{results:l,isLoading:i}=Object(g.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[u,b]=Object(s.b)("attributes",[]);if(i)return null;const p=t.label;return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},p,":"),Object(o.createElement)("ul",null,r.map((e,r)=>{const s=l.find(t=>t.slug===e);if(!s)return null;let i="";return r>0&&"and"===n&&(i=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(c.__)("and","woo-gutenberg-products-block"))),f({type:p,name:Object(O.decodeEntities)(s.name||e),prefix:i,removeCallback:()=>{Object(j.a)(u,b,t,e)},showLabel:!1,displayStyle:a})})))};Object(n.a)({selector:".wp-block-woocommerce-active-filters",Block:e=>{let{attributes:t,isEditor:r=!1}=e;const[n,l]=Object(s.b)("attributes",[]),[p,d]=Object(s.b)("stock_status",[]),[g,O]=Object(s.b)("min_price"),[j,_]=Object(s.b)("max_price"),w=Object(a.getSetting)("stockStatusOptions",[]),E=Object(o.useMemo)(()=>{if(p.length>0)return p.map(e=>f({type:Object(c.__)("Stock Status","woo-gutenberg-products-block"),name:w[e],removeCallback:()=>{const t=p.filter(t=>t!==e);d(t)},displayStyle:t.displayStyle}))},[w,p,d,t.displayStyle]),h=Object(o.useMemo)(()=>Number.isFinite(g)||Number.isFinite(j)?f({type:Object(c.__)("Price","woo-gutenberg-products-block"),name:m(g,j),removeCallback:()=>{O(void 0),_(void 0)},displayStyle:t.displayStyle}):null,[g,j,t.displayStyle,O,_]),v=Object(o.useMemo)(()=>n.map(e=>{const r=Object(b.b)(e.attribute);return Object(o.createElement)(y,{attributeObject:r,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}),[n,t.displayStyle]);if(!(n.length>0||p.length>0||Number.isFinite(g)||Number.isFinite(j)||r))return null;const k="h"+t.headingLevel,S=i()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!r&&t.heading&&Object(o.createElement)(k,{className:"wc-block-active-filters__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:S},r?Object(o.createElement)(o.Fragment,null,f({type:Object(c.__)("Size","woo-gutenberg-products-block"),name:Object(c.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),f({type:Object(c.__)("Color","woo-gutenberg-products-block"),name:Object(c.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,h,E,v)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{O(void 0),_(void 0),l([]),d([])}},Object(o.createElement)(u.a,{label:Object(c.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(c.__)("Clear All Filters","woo-gutenberg-products-block")}))))},getProps:e=>({attributes:{displayStyle:e.dataset.displayStyle,heading:e.dataset.heading,headingLevel:e.dataset.headingLevel||3},isEditor:!1})})},23:function(e,t,r){"use strict";var n=r(0),o=r(4),c=r.n(o);t.a=e=>{let t,{label:r,screenReaderLabel:o,wrapperElement:s,wrapperProps:a={}}=e;const l=null!=r,i=null!=o;return!l&&i?(t=s||"span",a={...a,className:c()(a.className,"screen-reader-text")},Object(n.createElement)(t,a,o)):(t=s||n.Fragment,l&&i&&r!==o?Object(n.createElement)(t,a,Object(n.createElement)("span",{"aria-hidden":"true"},r),Object(n.createElement)("span",{className:"screen-reader-text"},o)):Object(n.createElement)(t,a,r))}},26:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(0);const o=Object(n.createContext)("page"),c=()=>Object(n.useContext)(o);o.Provider},3:function(e,t){e.exports=window.React},37:function(e,t){},38:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return p})),r.d(t,"c",(function(){return d}));var n=r(6),o=r(9),c=r(0),s=r(10),a=r.n(s),l=r(19),i=r(63),u=r(26);const b=e=>{const t=Object(u.a)();e=e||t;const r=Object(o.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:s}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[r,Object(c.useCallback)(t=>{s(e,t)},[e,s])]},p=(e,t,r)=>{const s=Object(u.a)();r=r||s;const a=Object(o.useSelect)(o=>o(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(r,e,t),[r,e]),{setQueryValue:l}=Object(o.useDispatch)(n.QUERY_STATE_STORE_KEY);return[a,Object(c.useCallback)(t=>{l(r,e,t)},[r,e,l])]},d=(e,t)=>{const r=Object(u.a)();t=t||r;const[n,o]=b(t),s=Object(l.a)(n),p=Object(l.a)(e),d=Object(i.a)(p),m=Object(c.useRef)(!1);return Object(c.useEffect)(()=>{a()(d,p)||(o(Object.assign({},s,p)),m.current=!0)},[s,p,d,o]),m.current?[n,o]:[e,o]}},4:function(e,t,r){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var c=typeof n;if("string"===c||"number"===c)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===c)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},40:function(e,t){e.exports=window.wc.priceFormat},43:function(e,t,r){"use strict";var n=r(44);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,c,s){if(s!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return r.PropTypes=r,r}},44:function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5:function(e,t){e.exports=window.lodash},50:function(e,t,r){"use strict";r.d(t,"n",(function(){return c})),r.d(t,"l",(function(){return s})),r.d(t,"k",(function(){return a})),r.d(t,"m",(function(){return l})),r.d(t,"i",(function(){return i})),r.d(t,"d",(function(){return u})),r.d(t,"f",(function(){return b})),r.d(t,"j",(function(){return p})),r.d(t,"c",(function(){return d})),r.d(t,"e",(function(){return m})),r.d(t,"g",(function(){return f})),r.d(t,"a",(function(){return g})),r.d(t,"h",(function(){return O})),r.d(t,"b",(function(){return j}));var n,o=r(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),s=c.pluginUrl+"images/",a=c.pluginUrl+"build/",l=c.buildPhase,i=null===(n=o.STORE_PAGES.shop)||void 0===n?void 0:n.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),b=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),d=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),f=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),O=Object(o.getSetting)("shippingStates",{}),j=Object(o.getSetting)("allowedStates",{})},53:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(11),o=r.n(n),c=r(0),s=r(14);const a=[".wp-block-woocommerce-cart"],l=e=>{let{Block:t,containers:r,getProps:n=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==r.length&&Array.prototype.forEach.call(r,(e,r)=>{const l=n(e,r),i=a(e,r),u={...e.dataset,...l.attributes||{}};(e=>{let{Block:t,container:r,attributes:n={},props:a={},errorBoundaryProps:l={}}=e;Object(c.render)(Object(c.createElement)(s.a,l,Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(c.createElement)(t,o()({},a,{attributes:n})))),r,()=>{r.classList&&r.classList.remove("is-loading")})})({Block:t,container:e,props:l,attributes:u,errorBoundaryProps:i})})},i=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:r,getProps:n,getErrorBoundaryProps:o,selector:c}=e;(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrappers:c}=e;const s=document.body.querySelectorAll(o);c&&c.length>0&&Array.prototype.filter.call(s,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,c)),l({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({Block:r,getProps:n,getErrorBoundaryProps:o,selector:c,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:r,getErrorBoundaryProps:n,selector:o,wrapper:c}=e;const s=c.querySelectorAll(o);l({Block:t,containers:s,getProps:r,getErrorBoundaryProps:n})})({...e,wrapper:t})})})}},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);const o=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}},6:function(e,t){e.exports=window.wc.wcBlocksData},63:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(3);function o(e,t){const r=Object(n.useRef)();return Object(n.useEffect)(()=>{r.current===e||t&&!t(e,r.current)||(r.current=e)},[e,t]),r.current}},65:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(6),o=r(9),c=r(0),s=r(19),a=r(54),l=r(18);const i=e=>{const{namespace:t,resourceName:r,resourceValues:i=[],query:u={},shouldSelect:b=!0}=e;if(!t||!r)throw new Error("The options object must have valid values for the namespace and the resource properties.");const p=Object(c.useRef)({results:[],isLoading:!0}),d=Object(s.a)(u),m=Object(s.a)(i),f=Object(a.a)(),g=Object(o.useSelect)(e=>{if(!b)return null;const o=e(n.COLLECTIONS_STORE_KEY),c=[t,r,d,m],s=o.getCollectionError(...c);if(s){if(!Object(l.b)(s))throw new Error("TypeError: `error` object is not an instance of Error constructor");f(s)}return{results:o.getCollection(...c),isLoading:!o.hasFinishedResolution("getCollection",c)}},[t,r,m,d,b]);return null!==g&&(p.current=g),p.current}},8:function(e,t,r){e.exports=r(43)()},9:function(e,t){e.exports=window.wp.data}});
build/active-filters.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'ac4e8fac02a65dca34fdd8d2348316b2');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-price-format', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => 'c2fa186224f6da769ac772b82907c7d0');
build/active-filters.js CHANGED
@@ -1,17 +1,17 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var n,o,a=t[0],s=t[1],i=t[2],b=0,p=[];b<a.length;b++)o=a[b],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&p.push(r[o][0]),r[o]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);p.length;)p.shift()();return l.push.apply(l,i||[]),c()}function c(){for(var e,t=0;t<l.length;t++){for(var c=l[t],n=!0,a=1;a<c.length;a++){var s=c[a];0!==r[s]&&(n=!1)}n&&(l.splice(t--,1),e=o(o.s=c[0]))}return e}var n={},r={6:0},l=[];function o(t){if(n[t])return n[t].exports;var c=n[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,o),c.l=!0,c.exports}o.m=e,o.c=n,o.d=function(e,t,c){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(o.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(c,n,function(t){return e[t]}.bind(null,n));return c},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var u=s;return l.push([383,0]),c()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},107:function(e,t,c){"use strict";var n=c(0),r=(c(10),c(7)),l=c(9),o=c(1);c(145),t.a=Object(l.withInstanceId)(e=>{let{className:t,headingLevel:c,onChange:l,heading:a,instanceId:s}=e;const i="h"+c;return Object(n.createElement)(i,{className:t},Object(n.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+s},Object(o.__)("Block title","woo-gutenberg-products-block")),Object(n.createElement)(r.PlainText,{id:"block-title-"+s,className:"wc-block-editor-components-title",value:a,onChange:l}))})},109:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(8);function r(e,t){const c=Object(n.useRef)();return Object(n.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},115:function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var n=c(16),r=c(13),l=c(0),o=c(39),a=c(94);const s=e=>{const{namespace:t,resourceName:c,resourceValues:s=[],query:i={},shouldSelect:u=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(l.useRef)({results:[],isLoading:!0}),p=Object(o.a)(i),m=Object(o.a)(s),d=Object(a.a)(),h=Object(r.useSelect)(e=>{if(!u)return null;const r=e(n.COLLECTIONS_STORE_KEY),l=[t,c,p,m],o=r.getCollectionError(...l);return o&&d(o),{results:r.getCollection(...l),isLoading:!r.hasFinishedResolution("getCollection",l)}},[t,c,m,p,u]);return null!==h&&(b.current=h),b.current}},12:function(e,t){e.exports=window.wp.blocks},13:function(e,t){e.exports=window.wp.data},14:function(e,t){e.exports=window.wp.htmlEntities},145:function(e,t){},146:function(e,t){},16:function(e,t){e.exports=window.wc.wcBlocksData},177:function(e,t,c){"use strict";c.d(t,"a",(function(){return l})),c.d(t,"b",(function(){return o}));var n=c(2);const r=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const c=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;var n;return c.id&&e.push(c),e},[]),l=e=>{if(e)return r.find(t=>t.id===e)},o=e=>{if(e)return r.find(t=>t.taxonomy===e)}},178:function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return l}));var n=c(6);const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},c=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const l=e.filter(e=>e.attribute===c.taxonomy),o=l.length?l[0]:null;if(!(o&&o.slug&&Array.isArray(o.slug)&&o.slug.includes(r)))return;const a=o.slug.filter(e=>e!==r),s=e.filter(e=>e.attribute!==c.taxonomy);a.length>0&&(o.slug=a.sort(),s.push(o)),t(Object(n.sortBy)(s,"attribute"))},l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},c=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const o=e.filter(e=>e.attribute!==c.taxonomy);0===r.length?t(o):(o.push({attribute:c.taxonomy,operator:l,slug:r.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(o,"attribute")))}},18:function(e,t){e.exports=window.wp.primitives},187:function(e,t,c){"use strict";var n=c(5),r=c.n(n),l=c(0),o=c(4),a=c.n(o),s=c(1),i=c(43),u=c(212);c(146);var b=e=>{let{text:t,screenReaderText:c="",element:n="li",className:o="",radius:s="small",children:i=null,...u}=e;const b=n,p=a()(o,"wc-block-components-chip","wc-block-components-chip--radius-"+s),m=Boolean(c&&c!==t);return Object(l.createElement)(b,r()({className:p},u),Object(l.createElement)("span",{"aria-hidden":m,className:"wc-block-components-chip__text"},t),m&&Object(l.createElement)("span",{className:"screen-reader-text"},c),i)};t.a=e=>{let{ariaLabel:t="",className:c="",disabled:n=!1,onRemove:o=(()=>{}),removeOnAnyClick:p=!1,text:m,screenReaderText:d="",...h}=e;const O=p?"span":"button";if(!t){const e=d&&"string"==typeof d?d:m;t="string"!=typeof e?
2
  /* translators: Remove chip. */
3
  Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(
4
  /* translators: %s text of the chip to remove. */
5
- Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const g={"aria-label":t,disabled:n,onClick:o,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||o()}},j=p?g:{},v=p?{"aria-hidden":!0}:g;return Object(l.createElement)(b,r()({},h,j,{className:a()(c,"is-removable"),element:p?"button":h.element,screenReaderText:d,text:m}),Object(l.createElement)(O,r()({className:"wc-block-components-chip__remove"},v),Object(l.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",srcElement:u.a,size:16})))}},2:function(e,t){e.exports=window.wc.wcSettings},212:function(e,t,c){"use strict";var n=c(5),r=c.n(n),l=c(0),o=c(18);const a=Object(l.createElement)(e=>{let{className:t,size:c,...n}=e;return Object(l.createElement)(o.SVG,r()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:c,height:c},n),Object(l.createElement)("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},null);t.a=a},26:function(e,t){e.exports=window.wp.isShallowEqual},3:function(e,t){e.exports=window.wp.components},30:function(e,t,c){"use strict";var n=c(0),r=c(4),l=c.n(r);t.a=e=>{let t,{label:c,screenReaderLabel:r,wrapperElement:o,wrapperProps:a={}}=e;const s=null!=c,i=null!=r;return!s&&i?(t=o||"span",a={...a,className:l()(a.className,"screen-reader-text")},Object(n.createElement)(t,a,r)):(t=o||n.Fragment,s&&i&&c!==r?Object(n.createElement)(t,a,Object(n.createElement)("span",{"aria-hidden":"true"},c),Object(n.createElement)("span",{className:"screen-reader-text"},r)):Object(n.createElement)(t,a,c))}},35:function(e,t){e.exports=window.wc.priceFormat},383:function(e,t,c){e.exports=c(449)},384:function(e,t){},39:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var n=c(0),r=c(26),l=c.n(r);function o(e){const t=Object(n.useRef)(e);return l()(e,t.current)||(t.current=e),t.current}},43:function(e,t,c){"use strict";var n=c(0);t.a=function(e){let{srcElement:t,size:c=24,...r}=e;return Object(n.isValidElement)(t)?Object(n.cloneElement)(t,{width:c,height:c,...r}):null}},449:function(e,t,c){"use strict";c.r(t);var n=c(5),r=c.n(n),l=c(0),o=c(1),a=c(12),s=c(43),i=c(18),u=Object(l.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(l.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(l.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),b=c(4),p=c.n(b),m=c(7),d=c(3),h=c(90),O=c(107),g=c(55),j=c(73),v=c(2),f=(c(10),c(30)),w=(c(384),c(177)),_=c(35),y=c(187);const E=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(o.sprintf)(
6
  /* translators: %1$s min price, %2$s max price */
7
- Object(o.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(_.formatPrice)(e),Object(_.formatPrice)(t)):Number.isFinite(e)?Object(o.sprintf)(
8
  /* translators: %s min price */
9
- Object(o.__)("From %s","woo-gutenberg-products-block"),Object(_.formatPrice)(e)):Object(o.sprintf)(
10
  /* translators: %s max price */
11
- Object(o.__)("Up to %s","woo-gutenberg-products-block"),Object(_.formatPrice)(t)),k=e=>{let{type:t,name:c,prefix:n,removeCallback:r=(()=>{}),showLabel:a=!0,displayStyle:s}=e;const i=n?Object(l.createElement)(l.Fragment,null,n," ",c):c,u=Object(o.sprintf)(
12
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
13
- Object(o.__)("Remove %s filter","woo-gutenberg-products-block"),c);return Object(l.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+c},a&&Object(l.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?Object(l.createElement)(y.a,{element:"span",text:i,onRemove:r,radius:"large",ariaLabel:u}):Object(l.createElement)("span",{className:"wc-block-active-filters__list-item-name"},i,Object(l.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:r},Object(l.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(l.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(l.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(l.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(l.createElement)(f.a,{screenReaderLabel:u}))))};var x=c(115),S=c(14),C=c(178),N=e=>{let{attributeObject:t={},slugs:c=[],operator:n="in",displayStyle:r}=e;const{results:a,isLoading:s}=Object(x.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[i,u]=Object(j.b)("attributes",[]);if(s)return null;const b=t.label;return Object(l.createElement)("li",null,Object(l.createElement)("span",{className:"wc-block-active-filters__list-item-type"},b,":"),Object(l.createElement)("ul",null,c.map((e,c)=>{const s=a.find(t=>t.slug===e);if(!s)return null;let p="";return c>0&&"and"===n&&(p=Object(l.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(o.__)("and","woo-gutenberg-products-block"))),k({type:b,name:Object(S.decodeEntities)(s.name||e),prefix:p,removeCallback:()=>{Object(C.a)(i,u,t,e)},showLabel:!1,displayStyle:r})})))},L=e=>{let{attributes:t,isEditor:c=!1}=e;const[n,r]=Object(j.b)("attributes",[]),[a,s]=Object(j.b)("stock_status",[]),[i,u]=Object(j.b)("min_price"),[b,m]=Object(j.b)("max_price"),d=Object(v.getSetting)("stockStatusOptions",[]),h=Object(l.useMemo)(()=>{if(a.length>0)return a.map(e=>k({type:Object(o.__)("Stock Status","woo-gutenberg-products-block"),name:d[e],removeCallback:()=>{const t=a.filter(t=>t!==e);s(t)},displayStyle:t.displayStyle}))},[d,a,s,t.displayStyle]),O=Object(l.useMemo)(()=>Number.isFinite(i)||Number.isFinite(b)?k({type:Object(o.__)("Price","woo-gutenberg-products-block"),name:E(i,b),removeCallback:()=>{u(void 0),m(void 0)},displayStyle:t.displayStyle}):null,[i,b,t.displayStyle,u,m]),g=Object(l.useMemo)(()=>n.map(e=>{const c=Object(w.b)(e.attribute);return Object(l.createElement)(N,{attributeObject:c,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}),[n,t.displayStyle]);if(!(n.length>0||a.length>0||Number.isFinite(i)||Number.isFinite(b)||c))return null;const _="h"+t.headingLevel,y=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(l.createElement)(l.Fragment,null,!c&&t.heading&&Object(l.createElement)(_,{className:"wc-block-active-filters__title"},t.heading),Object(l.createElement)("div",{className:"wc-block-active-filters"},Object(l.createElement)("ul",{className:y},c?Object(l.createElement)(l.Fragment,null,k({type:Object(o.__)("Size","woo-gutenberg-products-block"),name:Object(o.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),k({type:Object(o.__)("Color","woo-gutenberg-products-block"),name:Object(o.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(l.createElement)(l.Fragment,null,O,h,g)),Object(l.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{u(void 0),m(void 0),r([]),s([])}},Object(l.createElement)(f.a,{label:Object(o.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(o.__)("Clear All Filters","woo-gutenberg-products-block")}))))},V=Object(d.withSpokenMessages)(e=>{let{attributes:t,setAttributes:c}=e;const{className:n,displayStyle:r,heading:a,headingLevel:s}=t,i=Object(m.useBlockProps)({className:n});return Object(l.createElement)("div",i,Object(l.createElement)(m.InspectorControls,{key:"inspector"},Object(l.createElement)(d.PanelBody,{title:Object(o.__)("Block Settings","woo-gutenberg-products-block")},Object(l.createElement)(g.a,{label:Object(o.__)("Display Style","woo-gutenberg-products-block"),value:r,options:[{label:Object(o.__)("List","woo-gutenberg-products-block"),value:"list"},{
14
  /* translators: "Chips" is a tag-like display style for chosen attributes. */
15
- label:Object(o.__)("Chips","woo-gutenberg-products-block"),value:"chips"}],onChange:e=>c({displayStyle:e})}),Object(l.createElement)("p",null,Object(o.__)("Heading Level","woo-gutenberg-products-block")),Object(l.createElement)(h.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:s,onChange:e=>c({headingLevel:e})}))),Object(l.createElement)(O.a,{className:"wc-block-active-filters__title",headingLevel:s,heading:a,onChange:e=>c({heading:e})}),Object(l.createElement)(d.Disabled,null,Object(l.createElement)(L,{attributes:t,isEditor:!0})))});Object(a.registerBlockType)("woocommerce/active-filters",{apiVersion:2,title:Object(o.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(l.createElement)(s.a,{srcElement:u,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(o.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(o.__)("Show the currently active product filters. Works in combination with the All Products and filters blocks.","woo-gutenberg-products-block"),supports:{html:!1,multiple:!1,color:{text:!0,background:!1}},example:{attributes:{}},attributes:{displayStyle:{type:"string",default:"list"},heading:{type:"string",default:Object(o.__)("Active filters","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3}},edit:V,save(e){let{attributes:t}=e;const{className:c,displayStyle:n,heading:o,headingLevel:a}=t,s={"data-display-style":n,"data-heading":o,"data-heading-level":a};return Object(l.createElement)("div",r()({},m.useBlockProps.save({className:p()("is-loading",c)}),s),Object(l.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},48:function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var n=c(0);const r=Object(n.createContext)("page"),l=()=>Object(n.useContext)(r);r.Provider},55:function(e,t,c){"use strict";var n=c(5),r=c.n(n),l=c(0),o=c(4),a=c.n(o),s=c(3),i=c(9);c(84);class u extends l.Component{constructor(){super(...arguments),this.onClick=this.onClick.bind(this)}onClick(e){this.props.onChange&&this.props.onChange(e.target.value)}render(){const{label:e,checked:t,instanceId:c,className:n,help:o,options:i,value:u}=this.props,b="inspector-toggle-button-control-"+c;let p;return o&&(p="function"==typeof o?o(t):o),Object(l.createElement)(s.BaseControl,{id:b,help:p,className:a()("components-toggle-button-control",n)},Object(l.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},e),Object(l.createElement)(s.ButtonGroup,{"aria-labelledby":b+"__label"},i.map((t,c)=>{const n={};return u===t.value?(n.isPrimary=!0,n["aria-pressed"]=!0):(n.isSecondary=!0,n["aria-pressed"]=!1),Object(l.createElement)(s.Button,r()({key:`${t.label}-${t.value}-${c}`,value:t.value,onClick:this.onClick,"aria-label":e+": "+t.label},n),t.label)})))}}t.a=Object(i.withInstanceId)(u)},6:function(e,t){e.exports=window.lodash},7:function(e,t){e.exports=window.wp.blockEditor},73:function(e,t,c){"use strict";c.d(t,"a",(function(){return b})),c.d(t,"b",(function(){return p})),c.d(t,"c",(function(){return m}));var n=c(16),r=c(13),l=c(0),o=c(26),a=c.n(o),s=c(39),i=c(109),u=c(48);const b=e=>{const t=Object(u.a)();e=e||t;const c=Object(r.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:o}=Object(r.useDispatch)(n.QUERY_STATE_STORE_KEY);return[c,Object(l.useCallback)(t=>{o(e,t)},[e,o])]},p=(e,t,c)=>{const o=Object(u.a)();c=c||o;const a=Object(r.useSelect)(r=>r(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:s}=Object(r.useDispatch)(n.QUERY_STATE_STORE_KEY);return[a,Object(l.useCallback)(t=>{s(c,e,t)},[c,e,s])]},m=(e,t)=>{const c=Object(u.a)();t=t||c;const[n,r]=b(t),o=Object(s.a)(n),p=Object(s.a)(e),m=Object(i.a)(p),d=Object(l.useRef)(!1);return Object(l.useEffect)(()=>{a()(m,p)||(r(Object.assign({},o,p)),d.current=!0)},[o,p,m,r]),d.current?[n,r]:[e,r]}},8:function(e,t){e.exports=window.React},84:function(e,t){},9:function(e,t){e.exports=window.wp.compose},90:function(e,t,c){"use strict";var n=c(0),r=c(6),l=c(1),o=c(3);function a(e){let{level:t}=e;const c={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return c.hasOwnProperty(t)?Object(n.createElement)(o.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)(o.Path,{d:c[t]})):null}class s extends n.Component{createLevelControl(e,t,c){const r=e===t;return{icon:Object(n.createElement)(a,{level:e}),title:Object(l.sprintf)(
16
  /* translators: %s: heading level e.g: "2", "3", "4" */
17
- Object(l.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:r,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:l,onChange:s}=this.props;return Object(n.createElement)(o.ToolbarGroup,{isCollapsed:e,icon:Object(n.createElement)(a,{level:l}),controls:Object(r.range)(t,c).map(e=>this.createLevelControl(e,l,s))})}}t.a=s},94:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(0);const r=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["active-filters"]=function(e){function t(t){for(var n,l,a=t[0],s=t[1],i=t[2],b=0,p=[];b<a.length;b++)l=a[b],Object.prototype.hasOwnProperty.call(r,l)&&r[l]&&p.push(r[l][0]),r[l]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(u&&u(t);p.length;)p.shift()();return o.push.apply(o,i||[]),c()}function c(){for(var e,t=0;t<o.length;t++){for(var c=o[t],n=!0,a=1;a<c.length;a++){var s=c[a];0!==r[s]&&(n=!1)}n&&(o.splice(t--,1),e=l(l.s=c[0]))}return e}var n={},r={6:0,1:0},o=[];function l(t){if(n[t])return n[t].exports;var c=n[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,l),c.l=!0,c.exports}l.m=e,l.c=n,l.d=function(e,t,c){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(l.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(c,n,function(t){return e[t]}.bind(null,n));return c},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var a=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],s=a.push.bind(a);a.push=t,a=a.slice();for(var i=0;i<a.length;i++)t(a[i]);var u=s;return o.push([376,0]),c()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},108:function(e,t,c){"use strict";var n=c(0),r=(c(10),c(7)),o=c(9),l=c(1);c(142),t.a=Object(o.withInstanceId)(e=>{let{className:t,headingLevel:c,onChange:o,heading:a,instanceId:s}=e;const i="h"+c;return Object(n.createElement)(i,{className:t},Object(n.createElement)("label",{className:"screen-reader-text",htmlFor:"block-title-"+s},Object(l.__)("Block title","woo-gutenberg-products-block")),Object(n.createElement)(r.PlainText,{id:"block-title-"+s,className:"wc-block-editor-components-title",value:a,onChange:o}))})},11:function(e,t){e.exports=window.wp.primitives},110:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(8);function r(e,t){const c=Object(n.useRef)();return Object(n.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},115:function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var n=c(18),r=c(14),o=c(0),l=c(38),a=c(94),s=c(36);const i=e=>{const{namespace:t,resourceName:c,resourceValues:i=[],query:u={},shouldSelect:b=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const p=Object(o.useRef)({results:[],isLoading:!0}),d=Object(l.a)(u),m=Object(l.a)(i),O=Object(a.a)(),f=Object(r.useSelect)(e=>{if(!b)return null;const r=e(n.COLLECTIONS_STORE_KEY),o=[t,c,d,m],l=r.getCollectionError(...o);if(l){if(!Object(s.a)(l))throw new Error("TypeError: `error` object is not an instance of Error constructor");O(l)}return{results:r.getCollection(...o),isLoading:!r.hasFinishedResolution("getCollection",o)}},[t,c,m,d,b]);return null!==f&&(p.current=f),p.current}},13:function(e,t){e.exports=window.wp.blocks},14:function(e,t){e.exports=window.wp.data},142:function(e,t){},143:function(e,t){},16:function(e,t){e.exports=window.wp.htmlEntities},177:function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return l}));var n=c(2);const r=Object(n.getSetting)("attributes",[]).reduce((e,t)=>{const c=(n=t)&&n.attribute_name?{id:parseInt(n.attribute_id,10),name:n.attribute_name,taxonomy:"pa_"+n.attribute_name,label:n.attribute_label}:null;var n;return c.id&&e.push(c),e},[]),o=e=>{if(e)return r.find(t=>t.id===e)},l=e=>{if(e)return r.find(t=>t.taxonomy===e)}},178:function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return o}));var n=c(6);const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},c=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const o=e.filter(e=>e.attribute===c.taxonomy),l=o.length?o[0]:null;if(!(l&&l.slug&&Array.isArray(l.slug)&&l.slug.includes(r)))return;const a=l.slug.filter(e=>e!==r),s=e.filter(e=>e.attribute!==c.taxonomy);a.length>0&&(l.slug=a.sort(),s.push(l)),t(Object(n.sortBy)(s,"attribute"))},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},c=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const l=e.filter(e=>e.attribute!==c.taxonomy);0===r.length?t(l):(l.push({attribute:c.taxonomy,operator:o,slug:r.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(n.sortBy)(l,"attribute")))}},18:function(e,t){e.exports=window.wc.wcBlocksData},188:function(e,t,c){"use strict";var n=c(5),r=c.n(n),o=c(0),l=c(4),a=c.n(l),s=c(1),i=c(103),u=c(502);c(143);var b=e=>{let{text:t,screenReaderText:c="",element:n="li",className:l="",radius:s="small",children:i=null,...u}=e;const b=n,p=a()(l,"wc-block-components-chip","wc-block-components-chip--radius-"+s),d=Boolean(c&&c!==t);return Object(o.createElement)(b,r()({className:p},u),Object(o.createElement)("span",{"aria-hidden":d,className:"wc-block-components-chip__text"},t),d&&Object(o.createElement)("span",{className:"screen-reader-text"},c),i)};t.a=e=>{let{ariaLabel:t="",className:c="",disabled:n=!1,onRemove:l=(()=>{}),removeOnAnyClick:p=!1,text:d,screenReaderText:m="",...O}=e;const f=p?"span":"button";if(!t){const e=m&&"string"==typeof m?m:d;t="string"!=typeof e?
2
  /* translators: Remove chip. */
3
  Object(s.__)("Remove","woo-gutenberg-products-block"):Object(s.sprintf)(
4
  /* translators: %s text of the chip to remove. */
5
+ Object(s.__)('Remove "%s"',"woo-gutenberg-products-block"),e)}const h={"aria-label":t,disabled:n,onClick:l,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||l()}},g=p?h:{},j=p?{"aria-hidden":!0}:h;return Object(o.createElement)(b,r()({},O,g,{className:a()(c,"is-removable"),element:p?"button":O.element,screenReaderText:m,text:d}),Object(o.createElement)(f,r()({className:"wc-block-components-chip__remove"},j),Object(o.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},2:function(e,t){e.exports=window.wc.wcSettings},25:function(e,t){e.exports=window.wp.isShallowEqual},29:function(e,t,c){"use strict";var n=c(0),r=c(4),o=c.n(r);t.a=e=>{let t,{label:c,screenReaderLabel:r,wrapperElement:l,wrapperProps:a={}}=e;const s=null!=c,i=null!=r;return!s&&i?(t=l||"span",a={...a,className:o()(a.className,"screen-reader-text")},Object(n.createElement)(t,a,r)):(t=l||n.Fragment,s&&i&&c!==r?Object(n.createElement)(t,a,Object(n.createElement)("span",{"aria-hidden":"true"},c),Object(n.createElement)("span",{className:"screen-reader-text"},r)):Object(n.createElement)(t,a,c))}},3:function(e,t){e.exports=window.wp.components},34:function(e,t){e.exports=window.wc.priceFormat},36:function(e,t,c){"use strict";c.d(t,"b",(function(){return n})),c.d(t,"d",(function(){return r})),c.d(t,"c",(function(){return o})),c.d(t,"e",(function(){return l})),c.d(t,"a",(function(){return a}));const n=e=>"number"==typeof e,r=e=>"string"==typeof e,o=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function l(e,t){return o(e)&&t in e}const a=e=>e instanceof Error},376:function(e,t,c){e.exports=c(442)},377:function(e,t){},38:function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var n=c(0),r=c(25),o=c.n(r);function l(e){const t=Object(n.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},442:function(e,t,c){"use strict";c.r(t);var n=c(5),r=c.n(n),o=c(0),l=c(1),a=c(13),s=c(11),i=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zm0-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})),u=c(103),b=c(4),p=c.n(b),d=c(7),m=c(3),O=c(90),f=c(108),h=c(56),g=c(73),j=c(2),v=(c(10),c(29)),w=(c(377),c(177)),y=c(34),_=c(188);const k=(e,t)=>Number.isFinite(e)&&Number.isFinite(t)?Object(l.sprintf)(
6
  /* translators: %1$s min price, %2$s max price */
7
+ Object(l.__)("Between %1$s and %2$s","woo-gutenberg-products-block"),Object(y.formatPrice)(e),Object(y.formatPrice)(t)):Number.isFinite(e)?Object(l.sprintf)(
8
  /* translators: %s min price */
9
+ Object(l.__)("From %s","woo-gutenberg-products-block"),Object(y.formatPrice)(e)):Object(l.sprintf)(
10
  /* translators: %s max price */
11
+ Object(l.__)("Up to %s","woo-gutenberg-products-block"),Object(y.formatPrice)(t)),E=e=>{let{type:t,name:c,prefix:n,removeCallback:r=(()=>{}),showLabel:a=!0,displayStyle:s}=e;const i=n?Object(o.createElement)(o.Fragment,null,n," ",c):c,u=Object(l.sprintf)(
12
  /* translators: %s attribute value used in the filter. For example: yellow, green, small, large. */
13
+ Object(l.__)("Remove %s filter","woo-gutenberg-products-block"),c);return Object(o.createElement)("li",{className:"wc-block-active-filters__list-item",key:t+":"+c},a&&Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},t+": "),"chips"===s?Object(o.createElement)(_.a,{element:"span",text:i,onRemove:r,radius:"large",ariaLabel:u}):Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-name"},i,Object(o.createElement)("button",{className:"wc-block-active-filters__list-item-remove",onClick:r},Object(o.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)("ellipse",{cx:"8",cy:"8",rx:"8",ry:"8",transform:"rotate(-180 8 8)",fill:"currentColor",fillOpacity:"0.7"}),Object(o.createElement)("rect",{x:"10.636",y:"3.94983",width:"2",height:"9.9466",transform:"rotate(45 10.636 3.94983)",fill:"white"}),Object(o.createElement)("rect",{x:"12.0503",y:"11.0209",width:"2",height:"9.9466",transform:"rotate(135 12.0503 11.0209)",fill:"white"})),Object(o.createElement)(v.a,{screenReaderLabel:u}))))};var x=c(115),S=c(16),C=c(178),N=e=>{let{attributeObject:t={},slugs:c=[],operator:n="in",displayStyle:r}=e;const{results:a,isLoading:s}=Object(x.a)({namespace:"/wc/store",resourceName:"products/attributes/terms",resourceValues:[t.id]}),[i,u]=Object(g.b)("attributes",[]);if(s)return null;const b=t.label;return Object(o.createElement)("li",null,Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-type"},b,":"),Object(o.createElement)("ul",null,c.map((e,c)=>{const s=a.find(t=>t.slug===e);if(!s)return null;let p="";return c>0&&"and"===n&&(p=Object(o.createElement)("span",{className:"wc-block-active-filters__list-item-operator"},Object(l.__)("and","woo-gutenberg-products-block"))),E({type:b,name:Object(S.decodeEntities)(s.name||e),prefix:p,removeCallback:()=>{Object(C.a)(i,u,t,e)},showLabel:!1,displayStyle:r})})))},L=e=>{let{attributes:t,isEditor:c=!1}=e;const[n,r]=Object(g.b)("attributes",[]),[a,s]=Object(g.b)("stock_status",[]),[i,u]=Object(g.b)("min_price"),[b,d]=Object(g.b)("max_price"),m=Object(j.getSetting)("stockStatusOptions",[]),O=Object(o.useMemo)(()=>{if(a.length>0)return a.map(e=>E({type:Object(l.__)("Stock Status","woo-gutenberg-products-block"),name:m[e],removeCallback:()=>{const t=a.filter(t=>t!==e);s(t)},displayStyle:t.displayStyle}))},[m,a,s,t.displayStyle]),f=Object(o.useMemo)(()=>Number.isFinite(i)||Number.isFinite(b)?E({type:Object(l.__)("Price","woo-gutenberg-products-block"),name:k(i,b),removeCallback:()=>{u(void 0),d(void 0)},displayStyle:t.displayStyle}):null,[i,b,t.displayStyle,u,d]),h=Object(o.useMemo)(()=>n.map(e=>{const c=Object(w.b)(e.attribute);return Object(o.createElement)(N,{attributeObject:c,displayStyle:t.displayStyle,slugs:e.slug,key:e.attribute,operator:e.operator})}),[n,t.displayStyle]);if(!(n.length>0||a.length>0||Number.isFinite(i)||Number.isFinite(b)||c))return null;const y="h"+t.headingLevel,_=p()("wc-block-active-filters__list",{"wc-block-active-filters__list--chips":"chips"===t.displayStyle});return Object(o.createElement)(o.Fragment,null,!c&&t.heading&&Object(o.createElement)(y,{className:"wc-block-active-filters__title"},t.heading),Object(o.createElement)("div",{className:"wc-block-active-filters"},Object(o.createElement)("ul",{className:_},c?Object(o.createElement)(o.Fragment,null,E({type:Object(l.__)("Size","woo-gutenberg-products-block"),name:Object(l.__)("Small","woo-gutenberg-products-block"),displayStyle:t.displayStyle}),E({type:Object(l.__)("Color","woo-gutenberg-products-block"),name:Object(l.__)("Blue","woo-gutenberg-products-block"),displayStyle:t.displayStyle})):Object(o.createElement)(o.Fragment,null,f,O,h)),Object(o.createElement)("button",{className:"wc-block-active-filters__clear-all",onClick:()=>{u(void 0),d(void 0),r([]),s([])}},Object(o.createElement)(v.a,{label:Object(l.__)("Clear All","woo-gutenberg-products-block"),screenReaderLabel:Object(l.__)("Clear All Filters","woo-gutenberg-products-block")}))))},H=Object(m.withSpokenMessages)(e=>{let{attributes:t,setAttributes:c}=e;const{className:n,displayStyle:r,heading:a,headingLevel:s}=t,i=Object(d.useBlockProps)({className:n});return Object(o.createElement)("div",i,Object(o.createElement)(d.InspectorControls,{key:"inspector"},Object(o.createElement)(m.PanelBody,{title:Object(l.__)("Block Settings","woo-gutenberg-products-block")},Object(o.createElement)(h.a,{label:Object(l.__)("Display Style","woo-gutenberg-products-block"),value:r,options:[{label:Object(l.__)("List","woo-gutenberg-products-block"),value:"list"},{
14
  /* translators: "Chips" is a tag-like display style for chosen attributes. */
15
+ label:Object(l.__)("Chips","woo-gutenberg-products-block"),value:"chips"}],onChange:e=>c({displayStyle:e})}),Object(o.createElement)("p",null,Object(l.__)("Heading Level","woo-gutenberg-products-block")),Object(o.createElement)(O.a,{isCollapsed:!1,minLevel:2,maxLevel:7,selectedLevel:s,onChange:e=>c({headingLevel:e})}))),Object(o.createElement)(f.a,{className:"wc-block-active-filters__title",headingLevel:s,heading:a,onChange:e=>c({heading:e})}),Object(o.createElement)(m.Disabled,null,Object(o.createElement)(L,{attributes:t,isEditor:!0})))});Object(a.registerBlockType)("woocommerce/active-filters",{apiVersion:2,title:Object(l.__)("Active Product Filters","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(u.a,{icon:i,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(l.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(l.__)("Show the currently active product filters. Works in combination with the All Products and filters blocks.","woo-gutenberg-products-block"),supports:{html:!1,multiple:!1,color:{text:!0,background:!1}},example:{attributes:{}},attributes:{displayStyle:{type:"string",default:"list"},heading:{type:"string",default:Object(l.__)("Active filters","woo-gutenberg-products-block")},headingLevel:{type:"number",default:3}},edit:H,save(e){let{attributes:t}=e;const{className:c,displayStyle:n,heading:l,headingLevel:a}=t,s={"data-display-style":n,"data-heading":l,"data-heading-level":a};return Object(o.createElement)("div",r()({},d.useBlockProps.save({className:p()("is-loading",c)}),s),Object(o.createElement)("span",{"aria-hidden":!0,className:"wc-block-active-product-filters__placeholder"}))}})},46:function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));var n=c(0);const r=Object(n.createContext)("page"),o=()=>Object(n.useContext)(r);r.Provider},56:function(e,t,c){"use strict";var n=c(5),r=c.n(n),o=c(0),l=c(4),a=c.n(l),s=c(3),i=c(9);c(84);class u extends o.Component{constructor(){super(...arguments),this.onClick=this.onClick.bind(this)}onClick(e){this.props.onChange&&this.props.onChange(e.target.value)}render(){const{label:e,checked:t,instanceId:c,className:n,help:l,options:i,value:u}=this.props,b="inspector-toggle-button-control-"+c;let p;return l&&(p="function"==typeof l?l(t):l),Object(o.createElement)(s.BaseControl,{id:b,help:p,className:a()("components-toggle-button-control",n)},Object(o.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},e),Object(o.createElement)(s.ButtonGroup,{"aria-labelledby":b+"__label"},i.map((t,c)=>{const n={};return u===t.value?(n.isPrimary=!0,n["aria-pressed"]=!0):(n.isSecondary=!0,n["aria-pressed"]=!1),Object(o.createElement)(s.Button,r()({key:`${t.label}-${t.value}-${c}`,value:t.value,onClick:this.onClick,"aria-label":e+": "+t.label},n),t.label)})))}}t.a=Object(i.withInstanceId)(u)},6:function(e,t){e.exports=window.lodash},7:function(e,t){e.exports=window.wp.blockEditor},73:function(e,t,c){"use strict";c.d(t,"a",(function(){return b})),c.d(t,"b",(function(){return p})),c.d(t,"c",(function(){return d}));var n=c(18),r=c(14),o=c(0),l=c(25),a=c.n(l),s=c(38),i=c(110),u=c(46);const b=e=>{const t=Object(u.a)();e=e||t;const c=Object(r.useSelect)(t=>t(n.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:l}=Object(r.useDispatch)(n.QUERY_STATE_STORE_KEY);return[c,Object(o.useCallback)(t=>{l(e,t)},[e,l])]},p=(e,t,c)=>{const l=Object(u.a)();c=c||l;const a=Object(r.useSelect)(r=>r(n.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:s}=Object(r.useDispatch)(n.QUERY_STATE_STORE_KEY);return[a,Object(o.useCallback)(t=>{s(c,e,t)},[c,e,s])]},d=(e,t)=>{const c=Object(u.a)();t=t||c;const[n,r]=b(t),l=Object(s.a)(n),p=Object(s.a)(e),d=Object(i.a)(p),m=Object(o.useRef)(!1);return Object(o.useEffect)(()=>{a()(d,p)||(r(Object.assign({},l,p)),m.current=!0)},[l,p,d,r]),m.current?[n,r]:[e,r]}},8:function(e,t){e.exports=window.React},84:function(e,t){},9:function(e,t){e.exports=window.wp.compose},90:function(e,t,c){"use strict";var n=c(0),r=c(6),o=c(1),l=c(3),a=c(11);function s(e){let{level:t}=e;const c={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return c.hasOwnProperty(t)?Object(n.createElement)(a.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)(a.Path,{d:c[t]})):null}class i extends n.Component{createLevelControl(e,t,c){const r=e===t;return{icon:Object(n.createElement)(s,{level:e}),title:Object(o.sprintf)(
16
  /* translators: %s: heading level e.g: "2", "3", "4" */
17
+ Object(o.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:r,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:o,onChange:a}=this.props;return Object(n.createElement)(l.ToolbarGroup,{isCollapsed:e,icon:Object(n.createElement)(s,{level:o}),controls:Object(r.range)(t,c).map(e=>this.createLevelControl(e,o,a))})}}t.a=i},94:function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var n=c(0);const r=()=>{const[,e]=Object(n.useState)();return Object(n.useCallback)(t=>{e(()=>{throw t})},[])}}});
build/all-products-frontend.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '89611f03bc284a4c5819fccf2418669e');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '4fa39b0aca60cacb79dbd6e328226efd');
build/all-products-frontend.js CHANGED
@@ -1,11 +1,11 @@
1
- !function(e){function t(t){for(var n,o,c=t[0],i=t[1],s=0,l=[];s<c.length;s++)o=c[s],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&l.push(r[o][0]),r[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(a&&a(t);l.length;)l.shift()()}var n={},r={6:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,o){n=r[e]=[t,o]}));t.push(n[2]=c);var i,s=document.createElement("script");s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.src=function(e){return o.p+""+({0:"vendors--atomic-block-components/add-to-cart--cart-blocks/order-summary--checkout-blocks/billing-ad--c5eb4dcd",1:"vendors--atomic-block-components/price--cart-blocks/line-items--cart-blocks/order-summary--checkout--8a3571de",7:"atomic-block-components/add-to-cart",8:"atomic-block-components/button",9:"atomic-block-components/category-list",10:"atomic-block-components/image",11:"atomic-block-components/price",12:"atomic-block-components/rating",13:"atomic-block-components/sale-badge",14:"atomic-block-components/sku",15:"atomic-block-components/stock-indicator",16:"atomic-block-components/summary",17:"atomic-block-components/tag-list",18:"atomic-block-components/title",49:"vendors--atomic-block-components/add-to-cart"}[e]||e)+"-frontend.js?ver="+{0:"9f3f7160cea9fec6b729",1:"44e8b4583ef14d0d1fdc",7:"ee5feb020130d6d54f2f",8:"8422937830a5bcfcf69f",9:"1f06fe341fd8f54234c7",10:"74c8be03232e12b30df4",11:"1b7308b900784c24ba62",12:"46e4dc4d3ef4a90e2519",13:"85bf4bdec9cccca4d188",14:"72dec6d824d90bf826ee",15:"3de4a997f6cb406bd20f",16:"13006ea9de35abe57566",17:"7d00ba6a20aee45636d8",18:"6082a5f049fe4b54cd45",49:"7fb4a4043fde41ff7bfe"}[e]}(e);var a=new Error;i=function(t){s.onerror=s.onload=null,clearTimeout(l);var n=r[e];if(0!==n){if(n){var o=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",a.name="ChunkLoadError",a.type=o,a.request=c,n[1](a)}r[e]=void 0}};var l=setTimeout((function(){i({type:"timeout",target:s})}),12e4);s.onerror=s.onload=i,document.head.appendChild(s)}return Promise.all(t)},o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var c=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var s=0;s<c.length;s++)t(c[s]);var a=i;o(o.s=175)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)){if(r.length){var i=o.apply(null,r);i&&e.push(i)}}else if("object"===c)if(r.toString===Object.prototype.toString)for(var s in r)n.call(r,s)&&r[s]&&e.push(s);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=n(42)()},function(e,t){e.exports=window.wp.data},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){e.exports=window.wp.compose},function(e,t,n){"use strict";var r=n(16),o=n.n(r),c=n(0),i=n(3),s=n(1),a=n(65),l=e=>{let{imageUrl:t=a.l+"/block-error.svg",header:n=Object(s.__)("Oops!","woo-gutenberg-products-block"),text:r=Object(s.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:i=Object(s.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(c.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(c.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(c.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},n&&Object(c.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},n),r&&Object(c.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),o&&Object(c.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",o),l&&Object(c.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};n(37);class u extends i.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:n=!0,showErrorBlock:r=!0,text:o,errorMessagePrefix:i,renderError:s,button:a}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof s?s({errorMessage:u}):Object(c.createElement)(l,{showErrorBlock:r,errorMessage:n?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:i,button:a}):this.props.children}}t.a=u},,function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(11),c=n.n(o);function i(e){const t=Object(r.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);n(9);const o=Object(r.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),c=()=>Object(r.useContext)(o)},function(e,t){e.exports=window.wp.htmlEntities},,function(e,t,n){"use strict";var r=n(0),o=n(4),c=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:i,wrapperProps:s={}}=e;const a=null!=n,l=null!=o;return!a&&l?(t=i||"span",s={...s,className:c()(s.className,"screen-reader-text")},Object(r.createElement)(t,s,o)):(t=i||r.Fragment,a&&l&&n!==o?Object(r.createElement)(t,s,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,s,n))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var r=n(5),o=n(0),c=n(6),i=n(9),s=n(19),a=n(70),l=n(109),u=n(18),d=n(67);const p=e=>{const t=e.detail;t&&t.preserveCartData||Object(i.dispatch)(c.CART_STORE_KEY).invalidateResolutionForStore()},b=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},m=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(d.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(d.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",p),document.body.addEventListener("wc-blocks_removed_from_cart",p),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",p),document.body.removeEventListener("wc-blocks_removed_from_cart",p)}}window.wcBlocksStoreCartListeners.count++})(),b),[])},f={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},h={...f,email:""},g={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:c.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},E=e=>Object(a.a)(Object.entries(e).map(e=>{let[t,n]=e;return[t,Object(s.decodeEntities)(n)]})),O={cartCoupons:c.EMPTY_CART_COUPONS,cartItems:c.EMPTY_CART_ITEMS,cartFees:c.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:g,cartIsLoading:!0,cartErrors:c.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:f,shippingRates:c.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:c.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:c.EMPTY_EXTENSIONS},w=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:n}=Object(u.a)(),s=null==n?void 0:n.previewCart,{shouldSelect:a}=e,d=Object(o.useRef)();m();const p=Object(i.useSelect)((e,n)=>{let{dispatch:r}=n;if(!a)return O;if(t)return{cartCoupons:s.coupons,cartItems:s.items,cartFees:s.fees,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:s.totals,cartIsLoading:!1,cartErrors:c.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:f,extensions:c.EMPTY_EXTENSIONS,shippingRates:s.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:s.has_calculated_shipping,paymentRequirements:s.paymentRequirements,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:()=>{}};const o=e(c.CART_STORE_KEY),i=o.getCartData(),u=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),b=o.isCustomerDataUpdating(),{receiveCart:m}=r(c.CART_STORE_KEY),g=E(i.billingAddress),w=i.needsShipping?E(i.shippingAddress):g,j=i.fees.length>0?i.fees.map(e=>E(e)):c.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map(e=>({...e,label:e.code})):c.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:j,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:d,cartIsLoading:p,cartErrors:u,billingAddress:Object(l.a)(g),shippingAddress:Object(l.a)(w),extensions:i.extensions,shippingRates:i.shippingRates,shippingRatesLoading:b,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:m}},[a]);return d.current&&Object(r.isEqual)(d.current,p)||(d.current=p),d.current}},function(e,t){e.exports=window.wp.a11y},function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);const o=Object(r.createContext)("page"),c=()=>Object(r.useContext)(o);o.Provider},function(e,t,n){"use strict";(function(e){var r=n(0);n(45);const o=Object(r.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,n(66))},function(e,t){e.exports=window.wp.apiFetch},,,function(e,t){e.exports=window.wp.deprecated},,,,function(e,t){e.exports=window.wp.url},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"d",(function(){return o})),n.d(t,"c",(function(){return c})),n.d(t,"e",(function(){return i})),n.d(t,"a",(function(){return s}));const r=e=>"number"==typeof e,o=e=>"string"==typeof e,c=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function i(e,t){return c(e)&&t in e}const s=e=>"boolean"==typeof e},,function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(48),o=n(0),c=n(22);const i=()=>{const e=Object(c.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...n,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return b}));var r=n(6),o=n(9),c=n(0),i=n(11),s=n.n(i),a=n(17),l=n(62),u=n(25);const d=e=>{const t=Object(u.a)();e=e||t;const n=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:i}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(c.useCallback)(t=>{i(e,t)},[e,i])]},p=(e,t,n)=>{const i=Object(u.a)();n=n||i;const s=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:a}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[s,Object(c.useCallback)(t=>{a(n,e,t)},[n,e,a])]},b=(e,t)=>{const n=Object(u.a)();t=t||n;const[r,o]=d(t),i=Object(a.a)(r),p=Object(a.a)(e),b=Object(l.a)(p),m=Object(c.useRef)(!1);return Object(c.useEffect)(()=>{s()(b,p)||(o(Object.assign({},i,p)),m.current=!0)},[i,p,b,o]),m.current?[r,o]:[e,o]}},function(e,t){e.exports=window.wc.priceFormat},,function(e,t,n){"use strict";var r=n(43);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,c,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},,function(e,t){e.exports=window.wp.warning},function(e,t,n){"use strict";var r=n(7),o=n(0),c=n(24),i=function({icon:e,className:t,...n}){const c=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(r.a)({className:c},n))};t.a=function({icon:e=null,size:t=24,...n}){if("string"==typeof e)return Object(o.createElement)(i,Object(r.a)({icon:e},n));if(Object(o.isValidElement)(e)&&i===e.type)return Object(o.cloneElement)(e,{...n});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...n}):e({size:t,...n});if(e&&("svg"===e.type||e.type===c.SVG)){const r={width:t,height:t,...e.props,...n};return Object(o.createElement)(c.SVG,r)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...n}):e}},function(e,t,n){"use strict";var r=n(4),o=n.n(r),c=n(0);t.a=Object(c.forwardRef)((function({as:e="div",className:t,...n},r){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(c.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...n,ref:r})}))},function(e,t){e.exports=window.wp.hooks},function(e,t){e.exports=window.wc.wcBlocksSharedContext},function(e,t,n){"use strict";var r=n(2),o=n(1),c=n(35);const i=Object(r.getSetting)("countryLocale",{}),s=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)(
2
  /* translators: %s Field label. */
3
- Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(c.b)(e.priority)&&(t.index=e.priority),Object(c.d)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},a=Object.entries(i).map(e=>{let[t,n]=e;return[t,Object.entries(n).map(e=>{let[t,n]=e;return[t,s(n)]}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{})]}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{});t.a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=n&&void 0!==a[n]?a[n]:{};return e.map(e=>({key:e,...r.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(10),o=n.n(r),c=n(0),i=n(13);const s=[".wp-block-woocommerce-cart"],a=e=>{let{Block:t,containers:n,getProps:r=(()=>({})),getErrorBoundaryProps:s=(()=>({}))}=e;0!==n.length&&Array.prototype.forEach.call(n,(e,n)=>{const a=r(e,n),l=s(e,n),u={...e.dataset,...a.attributes||{}};(e=>{let{Block:t,container:n,attributes:r={},props:s={},errorBoundaryProps:a={}}=e;Object(c.render)(Object(c.createElement)(i.a,a,Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(c.createElement)(t,o()({},s,{attributes:r})))),n,()=>{n.classList&&n.classList.remove("is-loading")})})({Block:t,container:e,props:a,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(s.join(",")),{Block:n,getProps:r,getErrorBoundaryProps:o,selector:c}=e;(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrappers:c}=e;const i=document.body.querySelectorAll(o);c&&c.length>0&&Array.prototype.filter.call(i,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,c)),a({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({Block:n,getProps:r,getErrorBoundaryProps:o,selector:c,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrapper:c}=e;const i=c.querySelectorAll(o);a({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({...e,wrapper:t})})})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},,function(e,t,n){"use strict";var r=n(7),o=n(0),c=n(4),i=n.n(c),s=n(5),a=n(30),l=n.n(a),u=n(12),d=n(60),p=n(90),b=n(1);function m(e,t,n){const{defaultView:r}=t,{frameElement:o}=r;if(!o||t===n.ownerDocument)return e;const c=o.getBoundingClientRect();return new r.DOMRect(e.left+c.left,e.top+c.top,e.width,e.height)}let f=0;function h(e){const t=document.scrollingElement||document.body;e&&(f=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=f)}let g=0;function E(){return Object(o.useEffect)(()=>(0===g&&h(!0),++g,()=>{1===g&&h(!1),--g}),[]),null}var O=n(26);function w(e){const t=Object(o.useContext)(O.a),n=t.slots[e]||{},r=t.fills[e],c=Object(o.useMemo)(()=>r||[],[r]);return{...n,updateSlot:Object(o.useCallback)(n=>{t.updateSlot(e,n)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(n=>{t.unregisterSlot(e,n)},[e,t.unregisterSlot]),fills:c,registerFill:Object(o.useCallback)(n=>{t.registerFill(e,n)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(n=>{t.unregisterFill(e,n)},[e,t.unregisterFill])}}var j=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function y({name:e,children:t,registerFill:n,unregisterFill:r}){const c=(e=>{const{getSlot:t,subscribe:n}=Object(o.useContext)(j),[r,c]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(c(t(e)),n(()=>{c(t(e))})),[e]),r})(e),i=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(n(e,i.current),()=>r(e,i.current)),[]),Object(o.useLayoutEffect)(()=>{i.current.children=t,c&&c.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==i.current.name&&(r(i.current.name,i.current),i.current.name=e,n(e,i.current))},[e]),c&&c.node?(Object(s.isFunction)(t)&&(t=t(c.props.fillProps)),Object(o.createPortal)(t,c.node)):null}var v=e=>Object(o.createElement)(j.Consumer,null,({registerFill:t,unregisterFill:n})=>Object(o.createElement)(y,Object(r.a)({},e,{registerFill:t,unregisterFill:n})));class _ extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:n={},getFills:r}=this.props,c=Object(s.map)(r(t,this),e=>{const t=Object(s.isFunction)(e.children)?e.children(n):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(s.isString)(e))return e;const n=e.key||t;return Object(o.cloneElement)(e,{key:n})})}).filter(Object(s.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(s.isFunction)(e)?e(c):c)}}var k=e=>Object(o.createElement)(j.Consumer,null,({registerSlot:t,unregisterSlot:n,getFills:c})=>Object(o.createElement)(_,Object(r.a)({},e,{registerSlot:t,unregisterSlot:n,getFills:c})));function x(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function C({name:e,children:t}){const n=w(e),r=Object(o.useRef)({rerender:x()});return Object(o.useEffect)(()=>(n.registerFill(r),()=>{n.unregisterFill(r)}),[n.registerFill,n.unregisterFill]),n.ref&&n.ref.current?("function"==typeof t&&(t=t(n.fillProps)),Object(o.createPortal)(t,n.ref.current)):null}var S=Object(o.forwardRef)((function({name:e,fillProps:t={},as:n="div",...c},i){const s=Object(o.useContext)(O.a),a=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(s.registerSlot(e,a,t),()=>{s.unregisterSlot(e,a)}),[s.registerSlot,s.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{s.updateSlot(e,t)}),Object(o.createElement)(n,Object(r.a)({ref:Object(u.useMergeRefs)([i,a])},c))}));function N(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(v,e),Object(o.createElement)(C,e))}n(11),o.Component;const P=Object(o.forwardRef)(({bubblesVirtually:e,...t},n)=>e?Object(o.createElement)(S,Object(r.a)({},t,{ref:n})):Object(o.createElement)(k,t));function R(e){return"appear"===e?"top":"left"}function T(e,t){const{paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:c}=(i=t).ownerDocument.defaultView.getComputedStyle(i);var i;const s=n?parseInt(n,10):0,a=r?parseInt(r,10):0,l=o?parseInt(o,10):0,u=c?parseInt(c,10):0;return{x:e.left+l,y:e.top+s,width:e.width-l-u,height:e.height-s-a,left:e.left+l,right:e.right-u,top:e.top+s,bottom:e.bottom-a}}function L(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function B(e,t,n=""){e.style[t]!==n&&(e.style[t]=n)}function A(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const M=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:n,className:c,noArrow:s=!0,isAlternate:a,position:f="bottom right",range:h,focusOnMount:g="firstElement",anchorRef:O,shouldAnchorIncludePadding:j,anchorRect:y,getAnchorRect:v,expandOnMobile:_,animate:k=!0,onClickOutside:x,onFocusOutside:C,__unstableStickyBoundaryElement:S,__unstableSlotName:P="Popover",__unstableObserveElement:M,__unstableBoundaryParent:F,__unstableForcePosition:I,__unstableForceXAlignment:D,...V},W)=>{const z=Object(o.useRef)(null),H=Object(o.useRef)(null),U=Object(o.useRef)(),Y=Object(u.useViewportMatch)("medium","<"),[q,Q]=Object(o.useState)(),K=w(P),X=_&&Y,[J,Z]=Object(u.useResizeObserver)();s=X||s,Object(o.useLayoutEffect)(()=>{if(X)return A(U.current,"is-without-arrow",s),A(U.current,"is-alternate",a),L(U.current,"data-x-axis"),L(U.current,"data-y-axis"),B(U.current,"top"),B(U.current,"left"),B(H.current,"maxHeight"),void B(H.current,"maxWidth");const e=()=>{if(!U.current||!H.current)return;let e=function(e,t,n,r=!1,o,c){if(t)return t;if(n){if(!e.current)return;const t=n(e.current);return m(t,t.ownerDocument||e.current.ownerDocument,c)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==r?void 0:r.cloneRange))return m(Object(d.getRectangleFromRange)(r),r.endContainer.ownerDocument,c);if("function"==typeof(null==r?void 0:r.getBoundingClientRect)){const e=m(r.getBoundingClientRect(),r.ownerDocument,c);return o?e:T(e,r)}const{top:e,bottom:t}=r,n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=m(new window.DOMRect(n.left,n.top,n.width,i.bottom-n.top),e.ownerDocument,c);return o?s:T(s,r)}if(!e.current)return;const{parentNode:i}=e.current,s=i.getBoundingClientRect();return o?s:T(s,i)}(z,y,v,O,j,U.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=U.current;let r,o=0;if(t&&t!==n.body){const n=t.getBoundingClientRect();o=n.top,e=new window.DOMRect(e.left-n.left,e.top-n.top,e.width,e.height)}var c;F&&(r=null===(c=U.current.closest(".popover-slot"))||void 0===c?void 0:c.parentNode);const i=Z.height?Z:H.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:h,contentHeight:g,contentWidth:E}=function(e,t,n="top",r,o,c,i,s,a){const[l,u="center",d]=n.split(" "),p=function(e,t,n,r,o,c,i,s){const{height:a}=t;if(o){const t=o.getBoundingClientRect().top+a-i;if(e.top<=t)return{yAxis:n,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===r?l=e.bottom:"top"===r&&(l=e.top);const u={popoverTop:l,contentHeight:(l-a/2>0?a/2:l)+(l+a/2>window.innerHeight?window.innerHeight-l:a/2)},d={popoverTop:e.top,contentHeight:e.top-10-a>0?a:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+a>window.innerHeight?window.innerHeight-10-e.bottom:a};let b,m=n,f=null;if(!o&&!s)if("middle"===n&&u.contentHeight===a)m="middle";else if("top"===n&&d.contentHeight===a)m="top";else if("bottom"===n&&p.contentHeight===a)m="bottom";else{m=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===m?d.contentHeight:p.contentHeight;f=e!==a?e:null}return b="middle"===m?u.popoverTop:"top"===m?d.popoverTop:p.popoverTop,{yAxis:m,popoverTop:b,contentHeight:f}}(e,t,l,d,r,0,c,s);return{...function(e,t,n,r,o,c,i,s,a){const{width:l}=t;"left"===n&&Object(b.isRTL)()?n="right":"right"===n&&Object(b.isRTL)()&&(n="left"),"left"===r&&Object(b.isRTL)()?r="right":"right"===r&&Object(b.isRTL)()&&(r="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===r?p=e.right:"middle"===c||a||(p=u);let m=e.right;"left"===r?m=e.left:"middle"===c||a||(m=u);const f={popoverLeft:p,contentWidth:p-l>0?l:p},h={popoverLeft:m,contentWidth:m+l>window.innerWidth?window.innerWidth-m:l};let g,E=n,O=null;if(!o&&!s)if("center"===n&&d.contentWidth===l)E="center";else if("left"===n&&f.contentWidth===l)E="left";else if("right"===n&&h.contentWidth===l)E="right";else{E=f.contentWidth>h.contentWidth?"left":"right";const e="left"===E?f.contentWidth:h.contentWidth;l>window.innerWidth&&(O=window.innerWidth),e!==l&&(E="center",d.popoverLeft=window.innerWidth/2)}if(g="center"===E?d.popoverLeft:"left"===E?f.popoverLeft:h.popoverLeft,i){const e=i.getBoundingClientRect();g=Math.min(g,e.right-l),Object(b.isRTL)()||(g=Math.max(g,0))}return{xAxis:E,popoverLeft:g,contentWidth:O}}(e,t,u,d,r,p.yAxis,i,s,a),...p}}(e,i,f,S,U.current,o,r,I,D);"number"==typeof l&&"number"==typeof u&&(B(U.current,"top",l+"px"),B(U.current,"left",u+"px")),A(U.current,"is-without-arrow",s||"center"===p&&"middle"===h),A(U.current,"is-alternate",a),L(U.current,"data-x-axis",p),L(U.current,"data-y-axis",h),B(H.current,"maxHeight","number"==typeof g?g+"px":""),B(H.current,"maxWidth","number"==typeof E?E+"px":""),Q(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[h]||"middle"))};e();const{ownerDocument:t}=U.current,{defaultView:n}=t,r=n.setInterval(e,500);let o;const c=()=>{n.cancelAnimationFrame(o),o=n.requestAnimationFrame(e)};n.addEventListener("click",c),n.addEventListener("resize",e),n.addEventListener("scroll",e,!0);const i=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(O);let l;return i&&i!==t&&(i.defaultView.addEventListener("resize",e),i.defaultView.addEventListener("scroll",e,!0)),M&&(l=new n.MutationObserver(e),l.observe(M,{attributes:!0})),()=>{n.clearInterval(r),n.removeEventListener("resize",e),n.removeEventListener("scroll",e,!0),n.removeEventListener("click",c),n.cancelAnimationFrame(o),i&&i!==t&&(i.defaultView.removeEventListener("resize",e),i.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[X,y,v,O,j,f,Z,S,M,F]);const $=(e,n)=>{if("focus-outside"===e&&C)C(n);else if("focus-outside"===e&&x){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>n.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),x(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:g,__unstableOnClose:$,onClose:$}),ne=Object(u.useMergeRefs)([U,ee,W]),re=Boolean(k&&q)&&function(e){if("loading"===e.type)return i()("components-animate__loading");const{type:t,origin:n=R(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return i()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+n):void 0}({type:"appear",origin:q});let oe=Object(o.createElement)("div",Object(r.a)({className:i()("components-popover",c,re,{"is-expanded":X,"is-without-arrow":s,"is-alternate":a})},V,{ref:ne},te,{tabIndex:"-1"}),X&&Object(o.createElement)(E,null),X&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(G,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:H,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},J,n)));return K.ref&&(oe=Object(o.createElement)(N,{name:P},oe)),O||y?oe:Object(o.createElement)("span",{ref:z},oe)});M.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(P,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var F=M,I=function({shortcut:e,className:t}){if(!e)return null;let n,r;return Object(s.isString)(e)&&(n=e),Object(s.isObject)(e)&&(n=e.display,r=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":r},n)};const D=Object(o.createElement)("div",{className:"event-catcher"}),V=({eventHandlers:e,child:t,childrenWithPopover:n})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(D,e),Object(o.cloneElement)(t,{children:n}),","),e),W=({child:e,eventHandlers:t,childrenWithPopover:n})=>Object(o.cloneElement)(e,{...t,children:n}),z=(e,t,n)=>{if(1!==o.Children.count(e))return;const r=o.Children.only(e);"function"==typeof r.props[t]&&r.props[t](n)};var H=function({children:e,position:t,text:n,shortcut:r}){const[c,i]=Object(o.useState)(!1),[a,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{z(e,"onMouseDown",t),document.addEventListener("mouseup",f),i(!0)},b=t=>{z(e,"onMouseUp",t),document.removeEventListener("mouseup",f),i(!1)},m=e=>"mouseUp"===e?b:"mouseDown"===e?p:void 0,f=m("mouseUp"),h=(t,n)=>r=>{if(z(e,t,r),r.currentTarget.disabled)return;if("focus"===r.type&&c)return;d.cancel();const o=Object(s.includes)(["focus","mouseenter"],r.type);o!==a&&(n?d(o):l(o))},g=()=>{d.cancel(),document.removeEventListener("mouseup",f)};if(Object(o.useEffect)(()=>g,[]),1!==o.Children.count(e))return e;const E={onMouseEnter:h("onMouseEnter",!0),onMouseLeave:h("onMouseLeave"),onClick:h("onClick"),onFocus:h("onFocus"),onBlur:h("onBlur"),onMouseDown:m("mouseDown")},O=o.Children.only(e),{children:w,disabled:j}=O.props;return(j?V:W)({child:O,eventHandlers:E,childrenWithPopover:(({grandchildren:e,isOver:t,position:n,text:r,shortcut:c})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(F,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(o.createElement)(I,{className:"components-tooltip__shortcut",shortcut:c}))))({grandchildren:w,isOver:a,position:t,text:n,shortcut:r})})},U=n(46),Y=n(47);const q=["onMouseDown","onClick"];var G=t.a=Object(o.forwardRef)((function(e,t){const{href:n,target:c,isSmall:a,isPressed:u,isBusy:d,isDestructive:p,className:b,disabled:m,icon:f,iconPosition:h="left",iconSize:g,showTooltip:E,tooltipPosition:O,shortcut:w,label:j,children:y,text:v,variant:_,__experimentalIsFocusable:k,describedBy:x,...C}=function({isDefault:e,isPrimary:t,isSecondary:n,isTertiary:r,isLink:o,variant:c,...i}){let s=c;var a,u,d,p,b;return t&&(null!==(a=s)&&void 0!==a||(s="primary")),r&&(null!==(u=s)&&void 0!==u||(s="tertiary")),n&&(null!==(d=s)&&void 0!==d||(s="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=s)&&void 0!==p||(s="secondary")),o&&(null!==(b=s)&&void 0!==b||(s="link")),{...i,variant:s}}(e),S=i()("components-button",b,{"is-secondary":"secondary"===_,"is-primary":"primary"===_,"is-small":a,"is-tertiary":"tertiary"===_,"is-pressed":u,"is-busy":d,"is-link":"link"===_,"is-destructive":p,"has-text":!!f&&!!y,"has-icon":!!f}),N=m&&!k,P=void 0===n||N?"button":"a",R="a"===P?{href:n,target:c}:{type:"button",disabled:N,"aria-pressed":u};if(m&&k){R["aria-disabled"]=!0;for(const e of q)C[e]=e=>{e.stopPropagation(),e.preventDefault()}}const T=!N&&(E&&j||w||!!j&&(!y||Object(s.isArray)(y)&&!y.length)&&!1!==E),L=x?Object(s.uniqueId)():null,B=C["aria-describedby"]||L,A=Object(o.createElement)(P,Object(r.a)({},R,C,{className:S,"aria-label":C["aria-label"]||j,"aria-describedby":B,ref:t}),f&&"left"===h&&Object(o.createElement)(U.a,{icon:f,size:g}),v&&Object(o.createElement)(o.Fragment,null,v),f&&"right"===h&&Object(o.createElement)(U.a,{icon:f,size:g}),y);return T?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(H,{text:x||j,shortcut:w,position:O},A),x&&Object(o.createElement)(Y.a,null,Object(o.createElement)("span",{id:L},x))):Object(o.createElement)(o.Fragment,null,A,x&&Object(o.createElement)(Y.a,null,Object(o.createElement)("span",{id:L},x)))}))},,,,function(e,t){e.exports=window.wp.dom},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(6),o=n(9),c=n(0),i=n(17),s=n(54);const a=e=>{const{namespace:t,resourceName:n,resourceValues:a=[],query:l={},shouldSelect:u=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(c.useRef)({results:[],isLoading:!0}),p=Object(i.a)(l),b=Object(i.a)(a),m=Object(s.a)(),f=Object(o.useSelect)(e=>{if(!u)return null;const o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,p,b],i=o.getCollectionError(...c);return i&&m(i),{results:o.getCollection(...c),isLoading:!o.hasFinishedResolution("getCollection",c)}},[t,n,b,p,u]);return null!==f&&(d.current=f),d.current}},function(e,t,n){"use strict";n.d(t,"n",(function(){return c})),n.d(t,"l",(function(){return i})),n.d(t,"k",(function(){return s})),n.d(t,"m",(function(){return a})),n.d(t,"i",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"c",(function(){return b})),n.d(t,"e",(function(){return m})),n.d(t,"g",(function(){return f})),n.d(t,"a",(function(){return h})),n.d(t,"h",(function(){return g})),n.d(t,"b",(function(){return E}));var r,o=n(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",s=c.pluginUrl+"build/",a=c.buildPhase,l=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),b=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),f=Object(o.getSetting)("shippingCountries",{}),h=Object(o.getSetting)("allowedCountries",{}),g=Object(o.getSetting)("shippingStates",{}),E=Object(o.getSetting)("allowedStates",{})},function(e,t){var n,r,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===c||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:c}catch(e){n=c}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,l=[],u=!1,d=-1;function p(){u&&a&&(u=!1,a.length?l=a.concat(l):d=-1,l.length&&b())}function b(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(a=l,l=[];++d<t;)a&&a[d].run();d=-1,t=l.length}a=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function f(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new m(e,t)),1!==l.length||u||s(b)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=f,o.addListener=f,o.once=f,o.off=f,o.removeListener=f,o.removeAllListeners=f,o.emit=f,o.prependListener=f,o.prependOnceListener=f,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return s}));const r=window.CustomEvent||null,o=(e,t)=>{let{bubbles:n=!1,cancelable:o=!1,element:c,detail:i={}}=t;if(!r)return;c||(c=document.body);const s=new r(e,{bubbles:n,cancelable:o,detail:i});c.dispatchEvent(s)};let c;const i=()=>{c&&clearTimeout(c),c=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const c=()=>{o(t,{bubbles:n,cancelable:r})};return jQuery(document).on(e,c),()=>jQuery(document).off(e,c)}},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>e.reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{})},function(e,t,n){"use strict";var r=n(10),o=n.n(r),c=n(0);n(101);const i=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};t.a=e=>t=>{const n=Object(c.useRef)(null);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:n,"aria-hidden":!0}),Object(c.createElement)(e,o()({},t,{scrollToTop:e=>{null!==n.current&&((e,t)=>{const{focusableSelector:n}=t||{};window&&Number.isFinite(window.innerHeight)&&(n?((e,t)=>{var n;const r=(null===(n=e.parentElement)||void 0===n?void 0:n.querySelectorAll(t))||[];if(r.length){const e=r[0];i(e),null==e||e.focus()}else i(e)})(e,n):i(e))})(n.current,e)}})))}},,,function(e,t){},,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"b",(function(){return f})),n.d(t,"a",(function(){return h}));var r=n(0),o=(n(8),n(9)),c=n(38),i=n(18),s=n(10),a=n.n(s),l=n(4),u=n.n(l),d=n(116);n(74);const p=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""};var b=e=>{let{className:t,notices:n,removeNotice:o}=e;const c=n.filter(e=>"snackbar"!==e.type);if(!c.length)return null;const i=u()(t,"wc-block-components-notices");return Object(r.createElement)("div",{className:i},c.map(e=>Object(r.createElement)(d.a,a()({key:"store-notice-"+e.id},e,{className:u()("wc-block-components-notices__notice",p(e)),onRemove:()=>{e.isDismissible&&o(e.id)}}),e.content)))};const m=Object(r.createContext)({notices:[],createNotice:(e,t,n)=>{},removeNotice:(e,t)=>{},setIsSuppressed:e=>{},context:"wc/core"}),f=()=>Object(r.useContext)(m),h=e=>{let{children:t,className:n="",createNoticeContainer:s=!0,context:a="wc/core"}=e;const{createNotice:l,removeNotice:u}=Object(o.useDispatch)("core/notices"),[d,p]=Object(r.useState)(!1),{dispatchStoreEvent:f}=Object(c.a)(),{isEditor:h}=Object(i.a)(),g=Object(r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};l(e,t,{...n,context:n.context||a}),f("store-notice-create",{status:e,content:t,options:n})}),[l,f,a]),E=Object(r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;u(e,t)}),[u,a]),{notices:O}=Object(o.useSelect)(e=>({notices:e("core/notices").getNotices(a)}),[a]),w={notices:O,createNotice:g,removeNotice:E,context:a,setIsSuppressed:p},j=d?null:Object(r.createElement)(b,{className:n,notices:w.notices,removeNotice:w.removeNotice,isEditor:h});return Object(r.createElement)(m.Provider,{value:w},s&&j,t)}},,,function(e,t,n){"use strict";var r=n(0),o=n(24);const c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,,,,,function(e,t,n){"use strict";var r=n(0);t.a=function(e){let{srcElement:t,size:n=24,...o}=e;return Object(r.isValidElement)(t)?Object(r.cloneElement)(t,{width:n,height:n,...o}):null}},,,function(e,t){},,function(e,t,n){"use strict";var r=n(0),o=(n(8),n(4)),c=n.n(o),i=n(21),s=n(12);n(115),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:n,label:o,onChange:s,options:a,screenReaderLabel:l,readOnly:u,value:d}=e;const p="wc-block-components-sort-select__select-"+n;return Object(r.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(r.createElement)(i.a,{label:o,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:p}}),Object(r.createElement)("select",{id:p,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,readOnly:u,value:d},a.map(e=>Object(r.createElement)("option",{key:e.key,value:e.key},e.label))))})},,,,,,function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return a}));var r=n(2),o=n(50),c=n(34);const i=e=>{let{country:t="",state:n="",city:r="",postcode:o=""}=e;return{country:t.trim(),state:n.trim(),city:r.trim(),postcode:o?o.replace(" ","").toUpperCase():""}},s=e=>{let{email:t=""}=e;return Object(c.isEmail)(t)?t.trim():""},a=e=>{const t=Object.keys(r.defaultAddressFields),n=Object(o.a)(t,{},e.country),c=Object.assign({},e);return n.forEach(t=>{let{key:n="",hidden:r=!1}=t;r&&((e,t)=>e in t)(n,e)&&(c[n]="")}),c}},function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(5),c=n(4),i=n.n(c),s=n(1),a=n(23),l=n(90),u=n(56);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:n,spokenMessage:c=n,onRemove:p=o.noop,isDismissible:b=!0,actions:m=[],politeness:f=d(t),__unstableHTML:h,onDismiss:g=o.noop}){!function(e,t){const n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)(()=>{n&&Object(a.speak)(n,t)},[n,t])}(c,f);const E=i()(e,"components-notice","is-"+t,{"is-dismissible":b});return h&&(n=Object(r.createElement)(r.RawHTML,null,n)),Object(r.createElement)("div",{className:E},Object(r.createElement)("div",{className:"components-notice__content"},n,Object(r.createElement)("div",{className:"components-notice__actions"},m.map(({className:e,label:t,isPrimary:n,variant:o,noDefaultClasses:c=!1,onClick:s,url:a},l)=>{let d=o;return"primary"===o||c||(d=a?"link":"secondary"),void 0===d&&n&&(d="primary"),Object(r.createElement)(u.a,{key:l,href:a,variant:d,onClick:a?void 0:s,className:i()("components-notice__action",e)},t)}))),b&&Object(r.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(s.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),g(),p()},showTooltip:!1}))}},,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(15),o=n(0),c=n(65);n.p=c.k,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([n.e(1),n.e(11)]).then(n.bind(null,364)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>n.e(10).then(n.bind(null,397)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>n.e(18).then(n.bind(null,398)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>n.e(12).then(n.bind(null,365)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>n.e(8).then(n.bind(null,366)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>n.e(16).then(n.bind(null,367)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>n.e(13).then(n.bind(null,288)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>n.e(14).then(n.bind(null,368)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>n.e(9).then(n.bind(null,369)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>n.e(17).then(n.bind(null,370)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>n.e(15).then(n.bind(null,371)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([n.e(0),n.e(49),n.e(7)]).then(n.bind(null,384)))});const i=e=>Object(r.getRegisteredBlockComponents)(e)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.blocks},,,,,,,,,,,,function(e,t,n){e.exports=n(200)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(87),c=n(53),i=n(3),s=(n(8),n(1)),a=n(5),l=n(4),u=n.n(l),d=n(21);n(178);const p=e=>{let{currentPage:t,displayFirstAndLastPages:n,displayNextAndPreviousArrows:o,pagesToDisplay:c,onPageChange:i,totalPages:a}=e,{minIndex:l,maxIndex:p}=((e,t,n)=>{if(n<=2)return{minIndex:null,maxIndex:null};const r=e-1,o=Math.max(Math.floor(t-r/2),2),c=Math.min(Math.ceil(t+(r-(t-o))),n-1);return{minIndex:Math.max(Math.floor(t-(r-(c-t))),2),maxIndex:c}})(c,t,a);const b=n&&Boolean(1!==l),m=n&&Boolean(p!==a),f=n&&Boolean(l>3),h=n&&Boolean(p<a-2);b&&3===l&&(l-=1),m&&p===a-2&&(p+=1);const g=[];if(l&&p)for(let e=l;e<=p;e++)g.push(e);return Object(r.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(r.createElement)(d.a,{screenReaderLabel:Object(s.__)("Navigate to another page","woo-gutenberg-products-block")}),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>i(t-1),title:Object(s.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(r.createElement)(d.a,{label:"←",screenReaderLabel:Object(s.__)("Previous page","woo-gutenberg-products-block")})),b&&Object(r.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:()=>i(1),disabled:1===t},Object(r.createElement)(d.a,{label:1,screenReaderLabel:Object(s.sprintf)(
4
  /* translators: %d is the page number (1, 2, 3...). */
5
- Object(s.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),g.map(e=>Object(r.createElement)("button",{key:e,className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:()=>i(e),disabled:t===e},Object(r.createElement)(d.a,{label:e,screenReaderLabel:Object(s.sprintf)(
6
  /* translators: %d is the page number (1, 2, 3...). */
7
- Object(s.__)("Page %d","woo-gutenberg-products-block"),e)}))),h&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(s.__)("…","woo-gutenberg-products-block")),m&&Object(r.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===a,"wc-block-components-pagination__page--active":t===a}),onClick:()=>i(a),disabled:t===a},Object(r.createElement)(d.a,{label:a,screenReaderLabel:Object(s.sprintf)(
8
  /* translators: %d is the page number (1, 2, 3...). */
9
- Object(s.__)("Page %d","woo-gutenberg-products-block"),a)})),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>i(t+1),title:Object(s.__)("Next page","woo-gutenberg-products-block"),disabled:t>=a},Object(r.createElement)(d.a,{label:"→",screenReaderLabel:Object(s.__)("Next page","woo-gutenberg-products-block")})))};p.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var b=p,m=n(62),f=n(39),h=n(64),g=n(6),E=n(9),O=n(17);var w=n(38),j=n(71),y=n(49),v=n(23),_=n(98),k=n(24),x=Object(r.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})),C=()=>{const{parentClassName:e}=Object(y.useInnerBlockLayoutContext)();return Object(r.createElement)("div",{className:e+"__no-products"},Object(r.createElement)(_.a,{className:e+"__no-products-image",alt:"",srcElement:x,size:100}),Object(r.createElement)("strong",{className:e+"__no-products-title"},Object(s.__)("No products","woo-gutenberg-products-block")),Object(r.createElement)("p",{className:e+"__no-products-description"},Object(s.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},S=Object(r.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.createElement)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),N=e=>{let{resetCallback:t=(()=>{})}=e;const{parentClassName:n}=Object(y.useInnerBlockLayoutContext)();return Object(r.createElement)("div",{className:n+"__no-products"},Object(r.createElement)(_.a,{className:n+"__no-products-image",alt:"",srcElement:S,size:100}),Object(r.createElement)("strong",{className:n+"__no-products-title"},Object(s.__)("No products found","woo-gutenberg-products-block")),Object(r.createElement)("p",{className:n+"__no-products-description"},Object(s.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(r.createElement)("button",{onClick:t},Object(s.__)("Reset Search","woo-gutenberg-products-block")))},P=n(103);n(177);var R=e=>{let{onChange:t,readOnly:n,value:o}=e;return Object(r.createElement)(P.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",name:"orderby",onChange:t,options:[{key:"menu_order",label:Object(s.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(s.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(s.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(s.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(s.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(s.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:n,screenReaderLabel:Object(s.__)("Order products by","woo-gutenberg-products-block"),value:o})},T=n(12),L=n(10),B=n.n(L),A=n(125);const M=(e,t,n,o)=>{if(!n)return;const c=Object(A.a)(e);return n.map((n,i)=>{let[s,a={}]=n,l=[];a.children&&a.children.length>0&&(l=M(e,t,a.children,o));const u=c[s];if(!u)return null;const d=t.id||0,p=["layout",s,i,o,d];return Object(r.createElement)(r.Suspense,{key:p.join("_"),fallback:Object(r.createElement)("div",{className:"wc-block-placeholder"})},Object(r.createElement)(u,B()({},a,{children:l,product:t})))})};var F=Object(T.withInstanceId)(e=>{let{product:t,attributes:n,instanceId:o}=e;const{layoutConfig:c}=n,{parentClassName:i,parentName:s}=Object(y.useInnerBlockLayoutContext)(),a=0===Object.keys(t).length,l=u()(i+"__product","wc-block-layout",{"is-loading":a});return Object(r.createElement)("li",{className:l,"aria-hidden":a},M(s,t,c,o))});n(176);const I=function(e){let{totalQuery:t,totalProducts:n}=e,{totalQuery:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!Object(a.isEqual)(t,r)&&Number.isFinite(n)};var D=Object(j.a)(e=>{let{attributes:t,currentPage:n,onPageChange:o,onSortChange:c,sortValue:i,scrollToTop:l}=e;const[d,p]=Object(f.b)("attributes",[]),[j,_]=Object(f.b)("stock_status",[]),[k,x]=Object(f.b)("min_price"),[S,P]=Object(f.b)("max_price"),[T]=Object(f.c)((e=>{let{sortValue:t,currentPage:n,attributes:r}=e;const{columns:o,rows:c}=r;return{...(e=>{switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}})(t),catalog_visibility:"catalog",per_page:o*c,page:n}})({attributes:t,sortValue:i,currentPage:n})),{products:L,totalProducts:B,productsLoading:A}=(e=>{const t={namespace:"/wc/store",resourceName:"products"},{results:n,isLoading:r}=Object(h.a)({...t,query:e}),{value:o}=((e,t)=>{const{namespace:n,resourceName:r,resourceValues:o=[],query:c={}}=t;if(!n||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const i=Object(O.a)(c),s=Object(O.a)(o),{value:a,isLoading:l=!0}=Object(E.useSelect)(e=>{const t=e(g.COLLECTIONS_STORE_KEY),o=["x-wp-total",n,r,i,s];return{value:t.getCollectionHeader(...o),isLoading:t.hasFinishedResolution("getCollectionHeader",o)}},["x-wp-total",n,r,s,i]);return{value:a,isLoading:l}})(0,{...t,query:e});return{products:n,totalProducts:parseInt(o,10),productsLoading:r}})(T),{parentClassName:M,parentName:D}=Object(y.useInnerBlockLayoutContext)(),V=(e=>{const{order:t,orderby:n,page:r,per_page:o,...c}=e;return c||{}})(T),{dispatchStoreEvent:W}=Object(w.a)(),z=Object(m.a)({totalQuery:V,totalProducts:B},I);Object(r.useEffect)(()=>{W("product-list-render",{products:L,listName:D})},[L,D,W]),Object(r.useEffect)(()=>{Object(a.isEqual)(V,null==z?void 0:z.totalQuery)||(o(1),null!=z&&z.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?Object(v.speak)(Object(s.__)("No products found","woo-gutenberg-products-block")):Object(v.speak)(Object(s.sprintf)(
10
  /* translators: %s is an integer higher than 0 (1, 2, 3...) */
11
- Object(s._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))})(B))},[null==z?void 0:z.totalQuery,B,o,V]);const{contentVisibility:H}=t,U=t.columns*t.rows,Y=!Number.isFinite(B)&&Number.isFinite(null==z?void 0:z.totalProducts)&&Object(a.isEqual)(V,null==z?void 0:z.totalQuery)?Math.ceil(z.totalProducts/U):Math.ceil(B/U),q=L.length?L:Array.from({length:U}),G=0!==L.length||A,Q=d.length>0||j.length>0||Number.isFinite(k)||Number.isFinite(S);return Object(r.createElement)("div",{className:(()=>{const{columns:e,rows:n,alignButtons:r,align:o}=t,c=void 0!==o?"align"+o:"";return u()(M,c,"has-"+e+"-columns",{"has-multiple-rows":n>1,"has-aligned-buttons":r})})()},H.orderBy&&G&&Object(r.createElement)(R,{onChange:c,value:i}),!G&&Q&&Object(r.createElement)(N,{resetCallback:()=>{p([]),_([]),x(null),P(null)}}),!G&&!Q&&Object(r.createElement)(C,null),G&&Object(r.createElement)("ul",{className:M+"__products"},q.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return Object(r.createElement)(F,{key:e.id||n,attributes:t,product:e})}))),Y>1&&Object(r.createElement)(b,{currentPage:n,onPageChange:e=>{l({focusableSelector:"a, button"}),o(e)},totalPages:Y}))}),V=e=>{let{attributes:t}=e;const[n,o]=Object(r.useState)(1),[c,i]=Object(r.useState)(t.orderby);return Object(r.useEffect)(()=>{i(t.orderby)},[t.orderby]),Object(r.createElement)(D,{attributes:t,currentPage:n,onPageChange:e=>{o(e)},onSortChange:e=>{const t=e.target.value;i(t),o(1)},sortValue:c})};const W=Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(r.createElement)("title",null,"Grid Block Preview"),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}));class z extends i.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?W:Object(r.createElement)(y.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(r.createElement)(V,{attributes:e,urlParameterSuffix:t}))}}var H=z;Object(c.a)({selector:".wp-block-woocommerce-all-products",Block:e=>Object(r.createElement)(o.a,{context:"wc/all-products"},Object(r.createElement)(H,e)),getProps:e=>({attributes:JSON.parse(e.dataset.attributes)})})}]);
1
+ !function(e){function t(t){for(var n,o,c=t[0],i=t[1],a=0,l=[];a<c.length;a++)o=c[a],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&l.push(r[o][0]),r[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(s&&s(t);l.length;)l.shift()()}var n={},r={6:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var c=new Promise((function(t,o){n=r[e]=[t,o]}));t.push(n[2]=c);var i,a=document.createElement("script");a.charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.src=function(e){return o.p+""+({0:"vendors--atomic-block-components/add-to-cart--cart-blocks/order-summary--checkout-blocks/billing-ad--c5eb4dcd",1:"vendors--atomic-block-components/price--cart-blocks/line-items--cart-blocks/order-summary--checkout--8a3571de",7:"atomic-block-components/add-to-cart",8:"atomic-block-components/button",9:"atomic-block-components/category-list",10:"atomic-block-components/image",11:"atomic-block-components/price",12:"atomic-block-components/rating",13:"atomic-block-components/sale-badge",14:"atomic-block-components/sku",15:"atomic-block-components/stock-indicator",16:"atomic-block-components/summary",17:"atomic-block-components/tag-list",18:"atomic-block-components/title",49:"vendors--atomic-block-components/add-to-cart"}[e]||e)+"-frontend.js?ver="+{0:"9389e91ddb161dce6467",1:"cc12b37eb3babf069a7f",7:"9489b1f5664d70511edc",8:"c531c6b4c4d2a4fe1bf0",9:"cedb06df469c54aa1286",10:"2a9ad3a9d90d1d4467cf",11:"9d17e564f97bb10395f0",12:"a93a8d90a103492aef77",13:"fe9b702caec5015357bd",14:"f9c88e7b99a64882d21b",15:"ecf5441636fe622c9a8f",16:"79d73bcd182a7b46ba1d",17:"4a7c85527622b1d5e7b4",18:"88f352fdaf8dc70e19a9",49:"71fe0bbaa1eb04beedcd"}[e]}(e);var s=new Error;i=function(t){a.onerror=a.onload=null,clearTimeout(l);var n=r[e];if(0!==n){if(n){var o=t&&("load"===t.type?"missing":t.type),c=t&&t.target&&t.target.src;s.message="Loading chunk "+e+" failed.\n("+o+": "+c+")",s.name="ChunkLoadError",s.type=o,s.request=c,n[1](s)}r[e]=void 0}};var l=setTimeout((function(){i({type:"timeout",target:a})}),12e4);a.onerror=a.onload=i,document.head.appendChild(a)}return Promise.all(t)},o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var c=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=c.push.bind(c);c.push=t,c=c.slice();for(var a=0;a<c.length;a++)t(c[a]);var s=i;o(o.s=179)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var c=typeof r;if("string"===c||"number"===c)e.push(r);else if(Array.isArray(r)){if(r.length){var i=o.apply(null,r);i&&e.push(i)}}else if("object"===c)if(r.toString===Object.prototype.toString)for(var a in r)n.call(r,a)&&r[a]&&e.push(a);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=n(43)()},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";var r=n(17),o=n.n(r),c=n(0),i=n(3),a=n(1),s=n(50),l=e=>{let{imageUrl:t=s.l+"/block-error.svg",header:n=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:r=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:i=Object(a.__)("Error:","woo-gutenberg-products-block"),button:l,showErrorBlock:u=!0}=e;return u?Object(c.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(c.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(c.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},n&&Object(c.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},n),r&&Object(c.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),o&&Object(c.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},i?i+" ":"",o),l&&Object(c.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},l))):null};n(37);class u extends i.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(c.createElement)(c.Fragment,null,Object(c.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:n=!0,showErrorBlock:r=!0,text:o,errorMessagePrefix:i,renderError:a,button:s}=this.props,{errorMessage:u,hasError:d}=this.state;return d?"function"==typeof a?a({errorMessage:u}):Object(c.createElement)(l,{showErrorBlock:r,errorMessage:n?u:null,header:e,imageUrl:t,text:o,errorMessagePrefix:i,button:s}):this.props.children}}t.a=u},,function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"e",(function(){return o})),n.d(t,"d",(function(){return c})),n.d(t,"f",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}));const r=e=>"number"==typeof e,o=e=>"string"==typeof e,c=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function i(e,t){return c(e)&&t in e}const a=e=>"boolean"==typeof e,s=e=>e instanceof Error},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(10),c=n.n(o);function i(e){const t=Object(r.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);n(9);const o=Object(r.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),c=()=>Object(r.useContext)(o)},function(e,t){e.exports=window.wp.htmlEntities},,function(e,t,n){"use strict";var r=n(0),o=n(4),c=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:i,wrapperProps:a={}}=e;const s=null!=n,l=null!=o;return!s&&l?(t=i||"span",a={...a,className:c()(a.className,"screen-reader-text")},Object(r.createElement)(t,a,o)):(t=i||r.Fragment,s&&l&&n!==o?Object(r.createElement)(t,a,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,a,n))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var r=n(5),o=n(0),c=n(6),i=n(9),a=n(21),s=n(71),l=n(112),u=n(20),d=n(67);const p=e=>{const t=e.detail;t&&t.preserveCartData||Object(i.dispatch)(c.CART_STORE_KEY).invalidateResolutionForStore()},b=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},m=()=>{Object(o.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(d.b)("added_to_cart","wc-blocks_added_to_cart"),t=Object(d.b)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",p),document.body.addEventListener("wc-blocks_removed_from_cart",p),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",p),document.body.removeEventListener("wc-blocks_removed_from_cart",p)}}window.wcBlocksStoreCartListeners.count++})(),b),[])},f={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},g={...f,email:""},h={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:c.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},E=e=>Object(s.a)(Object.entries(e).map(e=>{let[t,n]=e;return[t,Object(a.decodeEntities)(n)]})),O={cartCoupons:c.EMPTY_CART_COUPONS,cartItems:c.EMPTY_CART_ITEMS,cartFees:c.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:h,cartIsLoading:!0,cartErrors:c.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:f,shippingRates:c.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:c.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:c.EMPTY_EXTENSIONS},w=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:n}=Object(u.a)(),a=null==n?void 0:n.previewCart,{shouldSelect:s}=e,d=Object(o.useRef)();m();const p=Object(i.useSelect)((e,n)=>{let{dispatch:r}=n;if(!s)return O;if(t)return{cartCoupons:a.coupons,cartItems:a.items,cartFees:a.fees,cartItemsCount:a.items_count,cartItemsWeight:a.items_weight,cartNeedsPayment:a.needs_payment,cartNeedsShipping:a.needs_shipping,cartItemErrors:c.EMPTY_CART_ITEM_ERRORS,cartTotals:a.totals,cartIsLoading:!1,cartErrors:c.EMPTY_CART_ERRORS,billingAddress:g,shippingAddress:f,extensions:c.EMPTY_EXTENSIONS,shippingRates:a.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:a.has_calculated_shipping,paymentRequirements:a.paymentRequirements,receiveCart:"function"==typeof(null==a?void 0:a.receiveCart)?a.receiveCart:()=>{}};const o=e(c.CART_STORE_KEY),i=o.getCartData(),u=o.getCartErrors(),d=o.getCartTotals(),p=!o.hasFinishedResolution("getCartData"),b=o.isCustomerDataUpdating(),{receiveCart:m}=r(c.CART_STORE_KEY),h=E(i.billingAddress),w=i.needsShipping?E(i.shippingAddress):h,j=i.fees.length>0?i.fees.map(e=>E(e)):c.EMPTY_CART_FEES;return{cartCoupons:i.coupons.length>0?i.coupons.map(e=>({...e,label:e.code})):c.EMPTY_CART_COUPONS,cartItems:i.items,cartFees:j,cartItemsCount:i.itemsCount,cartItemsWeight:i.itemsWeight,cartNeedsPayment:i.needsPayment,cartNeedsShipping:i.needsShipping,cartItemErrors:i.errors,cartTotals:d,cartIsLoading:p,cartErrors:u,billingAddress:Object(l.a)(h),shippingAddress:Object(l.a)(w),extensions:i.extensions,shippingRates:i.shippingRates,shippingRatesLoading:b,cartHasCalculatedShipping:i.hasCalculatedShipping,paymentRequirements:i.paymentRequirements,receiveCart:m}},[s]);return d.current&&Object(r.isEqual)(d.current,p)||(d.current=p),d.current}},function(e,t){e.exports=window.wp.a11y},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0);const o=Object(r.createContext)("page"),c=()=>Object(r.useContext)(o);o.Provider},function(e,t,n){"use strict";(function(e){var r=n(0);n(45);const o=Object(r.createContext)({slots:{},fills:{},registerSlot:()=>{void 0!==e&&e.env},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{}});t.a=o}).call(this,n(66))},function(e,t){e.exports=window.wp.apiFetch},,,function(e,t){e.exports=window.wp.deprecated},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(48),o=n(0),c=n(24);const i=()=>{const e=Object(c.a)(),t=Object(o.useRef)(e);return Object(o.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(o.useCallback)((function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(r.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...n,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},,,function(e,t){e.exports=window.wp.url},function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return b}));var r=n(6),o=n(9),c=n(0),i=n(10),a=n.n(i),s=n(19),l=n(63),u=n(26);const d=e=>{const t=Object(u.a)();e=e||t;const n=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:i}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(c.useCallback)(t=>{i(e,t)},[e,i])]},p=(e,t,n)=>{const i=Object(u.a)();n=n||i;const a=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:s}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[a,Object(c.useCallback)(t=>{s(n,e,t)},[n,e,s])]},b=(e,t)=>{const n=Object(u.a)();t=t||n;const[r,o]=d(t),i=Object(s.a)(r),p=Object(s.a)(e),b=Object(l.a)(p),m=Object(c.useRef)(!1);return Object(c.useEffect)(()=>{a()(b,p)||(o(Object.assign({},i,p)),m.current=!0)},[i,p,b,o]),m.current?[r,o]:[e,o]}},,function(e,t){e.exports=window.wc.priceFormat},,,function(e,t,n){"use strict";var r=n(44);function o(){}function c(){}c.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,c,i){if(i!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){e.exports=window.wp.warning},function(e,t,n){"use strict";var r=n(7),o=n(0),c=n(13),i=function({icon:e,className:t,...n}){const c=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" ");return Object(o.createElement)("span",Object(r.a)({className:c},n))};t.a=function({icon:e=null,size:t=24,...n}){if("string"==typeof e)return Object(o.createElement)(i,Object(r.a)({icon:e},n));if(Object(o.isValidElement)(e)&&i===e.type)return Object(o.cloneElement)(e,{...n});if("function"==typeof e)return e.prototype instanceof o.Component?Object(o.createElement)(e,{size:t,...n}):e({size:t,...n});if(e&&("svg"===e.type||e.type===c.SVG)){const r={width:t,height:t,...e.props,...n};return Object(o.createElement)(c.SVG,r)}return Object(o.isValidElement)(e)?Object(o.cloneElement)(e,{size:t,...n}):e}},function(e,t,n){"use strict";var r=n(4),o=n.n(r),c=n(0);t.a=Object(c.forwardRef)((function({as:e="div",className:t,...n},r){return function({as:e="div",...t}){return"function"==typeof t.children?t.children(t):Object(c.createElement)(e,t)}({as:e,className:o()("components-visually-hidden",t),...n,ref:r})}))},function(e,t){e.exports=window.wp.hooks},function(e,t){e.exports=window.wc.wcBlocksSharedContext},function(e,t,n){"use strict";n.d(t,"n",(function(){return c})),n.d(t,"l",(function(){return i})),n.d(t,"k",(function(){return a})),n.d(t,"m",(function(){return s})),n.d(t,"i",(function(){return l})),n.d(t,"d",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"c",(function(){return b})),n.d(t,"e",(function(){return m})),n.d(t,"g",(function(){return f})),n.d(t,"a",(function(){return g})),n.d(t,"h",(function(){return h})),n.d(t,"b",(function(){return E}));var r,o=n(2);const c=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),i=c.pluginUrl+"images/",a=c.pluginUrl+"build/",s=c.buildPhase,l=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),b=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),f=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),E=Object(o.getSetting)("allowedStates",{})},function(e,t,n){"use strict";var r=n(2),o=n(1),c=n(18);const i=Object(r.getSetting)("countryLocale",{}),a=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(o.sprintf)(
2
  /* translators: %s Field label. */
3
+ Object(o.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(c.c)(e.priority)&&(t.index=e.priority),Object(c.e)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},s=Object.entries(i).map(e=>{let[t,n]=e;return[t,Object.entries(n).map(e=>{let[t,n]=e;return[t,a(n)]}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{})]}).reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{});t.a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const o=n&&void 0!==s[n]?s[n]:{};return e.map(e=>({key:e,...r.defaultAddressFields[e]||{},...o[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(11),o=n.n(r),c=n(0),i=n(14);const a=[".wp-block-woocommerce-cart"],s=e=>{let{Block:t,containers:n,getProps:r=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==n.length&&Array.prototype.forEach.call(n,(e,n)=>{const s=r(e,n),l=a(e,n),u={...e.dataset,...s.attributes||{}};(e=>{let{Block:t,container:n,attributes:r={},props:a={},errorBoundaryProps:s={}}=e;Object(c.render)(Object(c.createElement)(i.a,s,Object(c.createElement)(c.Suspense,{fallback:Object(c.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(c.createElement)(t,o()({},a,{attributes:r})))),n,()=>{n.classList&&n.classList.remove("is-loading")})})({Block:t,container:e,props:s,attributes:u,errorBoundaryProps:l})})},l=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:n,getProps:r,getErrorBoundaryProps:o,selector:c}=e;(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrappers:c}=e;const i=document.body.querySelectorAll(o);c&&c.length>0&&Array.prototype.filter.call(i,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,c)),s({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({Block:n,getProps:r,getErrorBoundaryProps:o,selector:c,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrapper:c}=e;const i=c.querySelectorAll(o);s({Block:t,containers:i,getProps:n,getErrorBoundaryProps:r})})({...e,wrapper:t})})})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},,function(e,t,n){"use strict";var r=n(7),o=n(0),c=n(4),i=n.n(c),a=n(5),s=n(31),l=n.n(s),u=n(12),d=n(61),p=n(91),b=n(1);function m(e,t,n){const{defaultView:r}=t,{frameElement:o}=r;if(!o||t===n.ownerDocument)return e;const c=o.getBoundingClientRect();return new r.DOMRect(e.left+c.left,e.top+c.top,e.width,e.height)}let f=0;function g(e){const t=document.scrollingElement||document.body;e&&(f=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=f)}let h=0;function E(){return Object(o.useEffect)(()=>(0===h&&g(!0),++h,()=>{1===h&&g(!1),--h}),[]),null}var O=n(27);function w(e){const t=Object(o.useContext)(O.a),n=t.slots[e]||{},r=t.fills[e],c=Object(o.useMemo)(()=>r||[],[r]);return{...n,updateSlot:Object(o.useCallback)(n=>{t.updateSlot(e,n)},[e,t.updateSlot]),unregisterSlot:Object(o.useCallback)(n=>{t.unregisterSlot(e,n)},[e,t.unregisterSlot]),fills:c,registerFill:Object(o.useCallback)(n=>{t.registerFill(e,n)},[e,t.registerFill]),unregisterFill:Object(o.useCallback)(n=>{t.unregisterFill(e,n)},[e,t.unregisterFill])}}var j=Object(o.createContext)({registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},getSlot:()=>{},getFills:()=>{},subscribe:()=>{}});function v({name:e,children:t,registerFill:n,unregisterFill:r}){const c=(e=>{const{getSlot:t,subscribe:n}=Object(o.useContext)(j),[r,c]=Object(o.useState)(t(e));return Object(o.useEffect)(()=>(c(t(e)),n(()=>{c(t(e))})),[e]),r})(e),i=Object(o.useRef)({name:e,children:t});return Object(o.useLayoutEffect)(()=>(n(e,i.current),()=>r(e,i.current)),[]),Object(o.useLayoutEffect)(()=>{i.current.children=t,c&&c.forceUpdate()},[t]),Object(o.useLayoutEffect)(()=>{e!==i.current.name&&(r(i.current.name,i.current),i.current.name=e,n(e,i.current))},[e]),c&&c.node?(Object(a.isFunction)(t)&&(t=t(c.props.fillProps)),Object(o.createPortal)(t,c.node)):null}var y=e=>Object(o.createElement)(j.Consumer,null,({registerFill:t,unregisterFill:n})=>Object(o.createElement)(v,Object(r.a)({},e,{registerFill:t,unregisterFill:n})));class _ extends o.Component{constructor(){super(...arguments),this.isUnmounted=!1,this.bindNode=this.bindNode.bind(this)}componentDidMount(){const{registerSlot:e}=this.props;e(this.props.name,this)}componentWillUnmount(){const{unregisterSlot:e}=this.props;this.isUnmounted=!0,e(this.props.name,this)}componentDidUpdate(e){const{name:t,unregisterSlot:n,registerSlot:r}=this.props;e.name!==t&&(n(e.name),r(t,this))}bindNode(e){this.node=e}forceUpdate(){this.isUnmounted||super.forceUpdate()}render(){const{children:e,name:t,fillProps:n={},getFills:r}=this.props,c=Object(a.map)(r(t,this),e=>{const t=Object(a.isFunction)(e.children)?e.children(n):e.children;return o.Children.map(t,(e,t)=>{if(!e||Object(a.isString)(e))return e;const n=e.key||t;return Object(o.cloneElement)(e,{key:n})})}).filter(Object(a.negate)(o.isEmptyElement));return Object(o.createElement)(o.Fragment,null,Object(a.isFunction)(e)?e(c):c)}}var k=e=>Object(o.createElement)(j.Consumer,null,({registerSlot:t,unregisterSlot:n,getFills:c})=>Object(o.createElement)(_,Object(r.a)({},e,{registerSlot:t,unregisterSlot:n,getFills:c})));function x(){const[,e]=Object(o.useState)({}),t=Object(o.useRef)(!0);return Object(o.useEffect)(()=>()=>{t.current=!1},[]),()=>{t.current&&e({})}}function C({name:e,children:t}){const n=w(e),r=Object(o.useRef)({rerender:x()});return Object(o.useEffect)(()=>(n.registerFill(r),()=>{n.unregisterFill(r)}),[n.registerFill,n.unregisterFill]),n.ref&&n.ref.current?("function"==typeof t&&(t=t(n.fillProps)),Object(o.createPortal)(t,n.ref.current)):null}var S=Object(o.forwardRef)((function({name:e,fillProps:t={},as:n="div",...c},i){const a=Object(o.useContext)(O.a),s=Object(o.useRef)();return Object(o.useLayoutEffect)(()=>(a.registerSlot(e,s,t),()=>{a.unregisterSlot(e,s)}),[a.registerSlot,a.unregisterSlot,e]),Object(o.useLayoutEffect)(()=>{a.updateSlot(e,t)}),Object(o.createElement)(n,Object(r.a)({ref:Object(u.useMergeRefs)([i,s])},c))}));function N(e){return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(y,e),Object(o.createElement)(C,e))}n(10),o.Component;const P=Object(o.forwardRef)(({bubblesVirtually:e,...t},n)=>e?Object(o.createElement)(S,Object(r.a)({},t,{ref:n})):Object(o.createElement)(k,t));function R(e){return"appear"===e?"top":"left"}function T(e,t){const{paddingTop:n,paddingBottom:r,paddingLeft:o,paddingRight:c}=(i=t).ownerDocument.defaultView.getComputedStyle(i);var i;const a=n?parseInt(n,10):0,s=r?parseInt(r,10):0,l=o?parseInt(o,10):0,u=c?parseInt(c,10):0;return{x:e.left+l,y:e.top+a,width:e.width-l-u,height:e.height-a-s,left:e.left+l,right:e.right-u,top:e.top+a,bottom:e.bottom-s}}function L(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function B(e,t,n=""){e.style[t]!==n&&(e.style[t]=n)}function A(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}const M=Object(o.forwardRef)(({headerTitle:e,onClose:t,children:n,className:c,noArrow:a=!0,isAlternate:s,position:f="bottom right",range:g,focusOnMount:h="firstElement",anchorRef:O,shouldAnchorIncludePadding:j,anchorRect:v,getAnchorRect:y,expandOnMobile:_,animate:k=!0,onClickOutside:x,onFocusOutside:C,__unstableStickyBoundaryElement:S,__unstableSlotName:P="Popover",__unstableObserveElement:M,__unstableBoundaryParent:F,__unstableForcePosition:I,__unstableForceXAlignment:D,...W},H)=>{const z=Object(o.useRef)(null),V=Object(o.useRef)(null),U=Object(o.useRef)(),Y=Object(u.useViewportMatch)("medium","<"),[q,G]=Object(o.useState)(),K=w(P),X=_&&Y,[J,Z]=Object(u.useResizeObserver)();a=X||a,Object(o.useLayoutEffect)(()=>{if(X)return A(U.current,"is-without-arrow",a),A(U.current,"is-alternate",s),L(U.current,"data-x-axis"),L(U.current,"data-y-axis"),B(U.current,"top"),B(U.current,"left"),B(V.current,"maxHeight"),void B(V.current,"maxWidth");const e=()=>{if(!U.current||!V.current)return;let e=function(e,t,n,r=!1,o,c){if(t)return t;if(n){if(!e.current)return;const t=n(e.current);return m(t,t.ownerDocument||e.current.ownerDocument,c)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if("function"==typeof(null==r?void 0:r.cloneRange))return m(Object(d.getRectangleFromRange)(r),r.endContainer.ownerDocument,c);if("function"==typeof(null==r?void 0:r.getBoundingClientRect)){const e=m(r.getBoundingClientRect(),r.ownerDocument,c);return o?e:T(e,r)}const{top:e,bottom:t}=r,n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=m(new window.DOMRect(n.left,n.top,n.width,i.bottom-n.top),e.ownerDocument,c);return o?a:T(a,r)}if(!e.current)return;const{parentNode:i}=e.current,a=i.getBoundingClientRect();return o?a:T(a,i)}(z,v,y,O,j,U.current);if(!e)return;const{offsetParent:t,ownerDocument:n}=U.current;let r,o=0;if(t&&t!==n.body){const n=t.getBoundingClientRect();o=n.top,e=new window.DOMRect(e.left-n.left,e.top-n.top,e.width,e.height)}var c;F&&(r=null===(c=U.current.closest(".popover-slot"))||void 0===c?void 0:c.parentNode);const i=Z.height?Z:V.current.getBoundingClientRect(),{popoverTop:l,popoverLeft:u,xAxis:p,yAxis:g,contentHeight:h,contentWidth:E}=function(e,t,n="top",r,o,c,i,a,s){const[l,u="center",d]=n.split(" "),p=function(e,t,n,r,o,c,i,a){const{height:s}=t;if(o){const t=o.getBoundingClientRect().top+s-i;if(e.top<=t)return{yAxis:n,popoverTop:Math.min(e.bottom,t)}}let l=e.top+e.height/2;"bottom"===r?l=e.bottom:"top"===r&&(l=e.top);const u={popoverTop:l,contentHeight:(l-s/2>0?s/2:l)+(l+s/2>window.innerHeight?window.innerHeight-l:s/2)},d={popoverTop:e.top,contentHeight:e.top-10-s>0?s:e.top-10},p={popoverTop:e.bottom,contentHeight:e.bottom+10+s>window.innerHeight?window.innerHeight-10-e.bottom:s};let b,m=n,f=null;if(!o&&!a)if("middle"===n&&u.contentHeight===s)m="middle";else if("top"===n&&d.contentHeight===s)m="top";else if("bottom"===n&&p.contentHeight===s)m="bottom";else{m=d.contentHeight>p.contentHeight?"top":"bottom";const e="top"===m?d.contentHeight:p.contentHeight;f=e!==s?e:null}return b="middle"===m?u.popoverTop:"top"===m?d.popoverTop:p.popoverTop,{yAxis:m,popoverTop:b,contentHeight:f}}(e,t,l,d,r,0,c,a);return{...function(e,t,n,r,o,c,i,a,s){const{width:l}=t;"left"===n&&Object(b.isRTL)()?n="right":"right"===n&&Object(b.isRTL)()&&(n="left"),"left"===r&&Object(b.isRTL)()?r="right":"right"===r&&Object(b.isRTL)()&&(r="left");const u=Math.round(e.left+e.width/2),d={popoverLeft:u,contentWidth:(u-l/2>0?l/2:u)+(u+l/2>window.innerWidth?window.innerWidth-u:l/2)};let p=e.left;"right"===r?p=e.right:"middle"===c||s||(p=u);let m=e.right;"left"===r?m=e.left:"middle"===c||s||(m=u);const f={popoverLeft:p,contentWidth:p-l>0?l:p},g={popoverLeft:m,contentWidth:m+l>window.innerWidth?window.innerWidth-m:l};let h,E=n,O=null;if(!o&&!a)if("center"===n&&d.contentWidth===l)E="center";else if("left"===n&&f.contentWidth===l)E="left";else if("right"===n&&g.contentWidth===l)E="right";else{E=f.contentWidth>g.contentWidth?"left":"right";const e="left"===E?f.contentWidth:g.contentWidth;l>window.innerWidth&&(O=window.innerWidth),e!==l&&(E="center",d.popoverLeft=window.innerWidth/2)}if(h="center"===E?d.popoverLeft:"left"===E?f.popoverLeft:g.popoverLeft,i){const e=i.getBoundingClientRect();h=Math.min(h,e.right-l),Object(b.isRTL)()||(h=Math.max(h,0))}return{xAxis:E,popoverLeft:h,contentWidth:O}}(e,t,u,d,r,p.yAxis,i,a,s),...p}}(e,i,f,S,U.current,o,r,I,D);"number"==typeof l&&"number"==typeof u&&(B(U.current,"top",l+"px"),B(U.current,"left",u+"px")),A(U.current,"is-without-arrow",a||"center"===p&&"middle"===g),A(U.current,"is-alternate",s),L(U.current,"data-x-axis",p),L(U.current,"data-y-axis",g),B(V.current,"maxHeight","number"==typeof h?h+"px":""),B(V.current,"maxWidth","number"==typeof E?E+"px":""),G(({left:"right",right:"left"}[p]||"center")+" "+({top:"bottom",bottom:"top"}[g]||"middle"))};e();const{ownerDocument:t}=U.current,{defaultView:n}=t,r=n.setInterval(e,500);let o;const c=()=>{n.cancelAnimationFrame(o),o=n.requestAnimationFrame(e)};n.addEventListener("click",c),n.addEventListener("resize",e),n.addEventListener("scroll",e,!0);const i=function(e){if(e)return e.endContainer?e.endContainer.ownerDocument:e.top?e.top.ownerDocument:e.ownerDocument}(O);let l;return i&&i!==t&&(i.defaultView.addEventListener("resize",e),i.defaultView.addEventListener("scroll",e,!0)),M&&(l=new n.MutationObserver(e),l.observe(M,{attributes:!0})),()=>{n.clearInterval(r),n.removeEventListener("resize",e),n.removeEventListener("scroll",e,!0),n.removeEventListener("click",c),n.cancelAnimationFrame(o),i&&i!==t&&(i.defaultView.removeEventListener("resize",e),i.defaultView.removeEventListener("scroll",e,!0)),l&&l.disconnect()}},[X,v,y,O,j,f,Z,S,M,F]);const $=(e,n)=>{if("focus-outside"===e&&C)C(n);else if("focus-outside"===e&&x){const e=new window.MouseEvent("click");Object.defineProperty(e,"target",{get:()=>n.relatedTarget}),l()("Popover onClickOutside prop",{since:"5.3",alternative:"onFocusOutside"}),x(e)}else t&&t()},[ee,te]=Object(u.__experimentalUseDialog)({focusOnMount:h,__unstableOnClose:$,onClose:$}),ne=Object(u.useMergeRefs)([U,ee,H]),re=Boolean(k&&q)&&function(e){if("loading"===e.type)return i()("components-animate__loading");const{type:t,origin:n=R(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return i()("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?i()("components-animate__slide-in","is-from-"+n):void 0}({type:"appear",origin:q});let oe=Object(o.createElement)("div",Object(r.a)({className:i()("components-popover",c,re,{"is-expanded":X,"is-without-arrow":a,"is-alternate":s})},W,{ref:ne},te,{tabIndex:"-1"}),X&&Object(o.createElement)(E,null),X&&Object(o.createElement)("div",{className:"components-popover__header"},Object(o.createElement)("span",{className:"components-popover__header-title"},e),Object(o.createElement)(Q,{className:"components-popover__close",icon:p.a,onClick:t})),Object(o.createElement)("div",{ref:V,className:"components-popover__content"},Object(o.createElement)("div",{style:{position:"relative"}},J,n)));return K.ref&&(oe=Object(o.createElement)(N,{name:P},oe)),O||v?oe:Object(o.createElement)("span",{ref:z},oe)});M.Slot=Object(o.forwardRef)((function({name:e="Popover"},t){return Object(o.createElement)(P,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})}));var F=M,I=function({shortcut:e,className:t}){if(!e)return null;let n,r;return Object(a.isString)(e)&&(n=e),Object(a.isObject)(e)&&(n=e.display,r=e.ariaLabel),Object(o.createElement)("span",{className:t,"aria-label":r},n)};const D=Object(o.createElement)("div",{className:"event-catcher"}),W=({eventHandlers:e,child:t,childrenWithPopover:n})=>Object(o.cloneElement)(Object(o.createElement)("span",{className:"disabled-element-wrapper"},Object(o.cloneElement)(D,e),Object(o.cloneElement)(t,{children:n}),","),e),H=({child:e,eventHandlers:t,childrenWithPopover:n})=>Object(o.cloneElement)(e,{...t,children:n}),z=(e,t,n)=>{if(1!==o.Children.count(e))return;const r=o.Children.only(e);"function"==typeof r.props[t]&&r.props[t](n)};var V=function({children:e,position:t,text:n,shortcut:r}){const[c,i]=Object(o.useState)(!1),[s,l]=Object(o.useState)(!1),d=Object(u.useDebounce)(l,700),p=t=>{z(e,"onMouseDown",t),document.addEventListener("mouseup",f),i(!0)},b=t=>{z(e,"onMouseUp",t),document.removeEventListener("mouseup",f),i(!1)},m=e=>"mouseUp"===e?b:"mouseDown"===e?p:void 0,f=m("mouseUp"),g=(t,n)=>r=>{if(z(e,t,r),r.currentTarget.disabled)return;if("focus"===r.type&&c)return;d.cancel();const o=Object(a.includes)(["focus","mouseenter"],r.type);o!==s&&(n?d(o):l(o))},h=()=>{d.cancel(),document.removeEventListener("mouseup",f)};if(Object(o.useEffect)(()=>h,[]),1!==o.Children.count(e))return e;const E={onMouseEnter:g("onMouseEnter",!0),onMouseLeave:g("onMouseLeave"),onClick:g("onClick"),onFocus:g("onFocus"),onBlur:g("onBlur"),onMouseDown:m("mouseDown")},O=o.Children.only(e),{children:w,disabled:j}=O.props;return(j?W:H)({child:O,eventHandlers:E,childrenWithPopover:(({grandchildren:e,isOver:t,position:n,text:r,shortcut:c})=>Object(o.concatChildren)(e,t&&Object(o.createElement)(F,{focusOnMount:!1,position:n,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},r,Object(o.createElement)(I,{className:"components-tooltip__shortcut",shortcut:c}))))({grandchildren:w,isOver:s,position:t,text:n,shortcut:r})})},U=n(46),Y=n(47);const q=["onMouseDown","onClick"];var Q=t.a=Object(o.forwardRef)((function(e,t){const{href:n,target:c,isSmall:s,isPressed:u,isBusy:d,isDestructive:p,className:b,disabled:m,icon:f,iconPosition:g="left",iconSize:h,showTooltip:E,tooltipPosition:O,shortcut:w,label:j,children:v,text:y,variant:_,__experimentalIsFocusable:k,describedBy:x,...C}=function({isDefault:e,isPrimary:t,isSecondary:n,isTertiary:r,isLink:o,variant:c,...i}){let a=c;var s,u,d,p,b;return t&&(null!==(s=a)&&void 0!==s||(a="primary")),r&&(null!==(u=a)&&void 0!==u||(a="tertiary")),n&&(null!==(d=a)&&void 0!==d||(a="secondary")),e&&(l()("Button isDefault prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(p=a)&&void 0!==p||(a="secondary")),o&&(null!==(b=a)&&void 0!==b||(a="link")),{...i,variant:a}}(e),S=i()("components-button",b,{"is-secondary":"secondary"===_,"is-primary":"primary"===_,"is-small":s,"is-tertiary":"tertiary"===_,"is-pressed":u,"is-busy":d,"is-link":"link"===_,"is-destructive":p,"has-text":!!f&&!!v,"has-icon":!!f}),N=m&&!k,P=void 0===n||N?"button":"a",R="a"===P?{href:n,target:c}:{type:"button",disabled:N,"aria-pressed":u};if(m&&k){R["aria-disabled"]=!0;for(const e of q)C[e]=e=>{e.stopPropagation(),e.preventDefault()}}const T=!N&&(E&&j||w||!!j&&(!v||Object(a.isArray)(v)&&!v.length)&&!1!==E),L=x?Object(a.uniqueId)():null,B=C["aria-describedby"]||L,A=Object(o.createElement)(P,Object(r.a)({},R,C,{className:S,"aria-label":C["aria-label"]||j,"aria-describedby":B,ref:t}),f&&"left"===g&&Object(o.createElement)(U.a,{icon:f,size:h}),y&&Object(o.createElement)(o.Fragment,null,y),f&&"right"===g&&Object(o.createElement)(U.a,{icon:f,size:h}),v);return T?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(V,{text:x||j,shortcut:w,position:O},A),x&&Object(o.createElement)(Y.a,null,Object(o.createElement)("span",{id:L},x))):Object(o.createElement)(o.Fragment,null,A,x&&Object(o.createElement)(Y.a,null,Object(o.createElement)("span",{id:L},x)))}))},,,,,function(e,t){e.exports=window.wp.dom},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(6),o=n(9),c=n(0),i=n(19),a=n(54),s=n(18);const l=e=>{const{namespace:t,resourceName:n,resourceValues:l=[],query:u={},shouldSelect:d=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const p=Object(c.useRef)({results:[],isLoading:!0}),b=Object(i.a)(u),m=Object(i.a)(l),f=Object(a.a)(),g=Object(o.useSelect)(e=>{if(!d)return null;const o=e(r.COLLECTIONS_STORE_KEY),c=[t,n,b,m],i=o.getCollectionError(...c);if(i){if(!Object(s.b)(i))throw new Error("TypeError: `error` object is not an instance of Error constructor");f(i)}return{results:o.getCollection(...c),isLoading:!o.hasFinishedResolution("getCollection",c)}},[t,n,m,b,d]);return null!==g&&(p.current=g),p.current}},function(e,t){var n,r,o=e.exports={};function c(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===c||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:c}catch(e){n=c}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var s,l=[],u=!1,d=-1;function p(){u&&s&&(u=!1,s.length?l=s.concat(l):d=-1,l.length&&b())}function b(){if(!u){var e=a(p);u=!0;for(var t=l.length;t;){for(s=l,l=[];++d<t;)s&&s[d].run();d=-1,t=l.length}s=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function f(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new m(e,t)),1!==l.length||u||a(b)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=f,o.addListener=f,o.once=f,o.off=f,o.removeListener=f,o.removeAllListeners=f,o.emit=f,o.prependListener=f,o.prependOnceListener=f,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return s}));const r=window.CustomEvent||null,o=(e,t)=>{let{bubbles:n=!1,cancelable:o=!1,element:c,detail:i={}}=t;if(!r)return;c||(c=document.body);const a=new r(e,{bubbles:n,cancelable:o,detail:i});c.dispatchEvent(a)};let c;const i=()=>{c&&clearTimeout(c),c=setTimeout(()=>{o("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},a=e=>{let{preserveCartData:t=!1}=e;o("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const c=()=>{o(t,{bubbles:n,cancelable:r})};return jQuery(document).on(e,c),()=>jQuery(document).off(e,c)}},function(e,t){e.exports=window.wp.blockEditor},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=e=>e.reduce((e,t)=>{let[n,r]=t;return e[n]=r,e},{})},function(e,t,n){"use strict";var r=n(11),o=n.n(r),c=n(0);n(102);const i=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};t.a=e=>t=>{const n=Object(c.useRef)(null);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:n,"aria-hidden":!0}),Object(c.createElement)(e,o()({},t,{scrollToTop:e=>{null!==n.current&&((e,t)=>{const{focusableSelector:n}=t||{};window&&Number.isFinite(window.innerHeight)&&(n?((e,t)=>{var n;const r=(null===(n=e.parentElement)||void 0===n?void 0:n.querySelectorAll(t))||[];if(r.length){const e=r[0];i(e),null==e||e.focus()}else i(e)})(e,n):i(e))})(n.current,e)}})))}},,,function(e,t){},,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"b",(function(){return f})),n.d(t,"a",(function(){return g}));var r=n(0),o=(n(8),n(9)),c=n(33),i=n(20),a=n(11),s=n.n(a),l=n(4),u=n.n(l),d=n(119);n(75);const p=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""};var b=e=>{let{className:t,notices:n,removeNotice:o}=e;const c=n.filter(e=>"snackbar"!==e.type);if(!c.length)return null;const i=u()(t,"wc-block-components-notices");return Object(r.createElement)("div",{className:i},c.map(e=>Object(r.createElement)(d.a,s()({key:"store-notice-"+e.id},e,{className:u()("wc-block-components-notices__notice",p(e)),onRemove:()=>{e.isDismissible&&o(e.id)}}),e.content)))};const m=Object(r.createContext)({notices:[],createNotice:(e,t,n)=>{},removeNotice:(e,t)=>{},setIsSuppressed:e=>{},context:"wc/core"}),f=()=>Object(r.useContext)(m),g=e=>{let{children:t,className:n="",createNoticeContainer:a=!0,context:s="wc/core"}=e;const{createNotice:l,removeNotice:u}=Object(o.useDispatch)("core/notices"),[d,p]=Object(r.useState)(!1),{dispatchStoreEvent:f}=Object(c.a)(),{isEditor:g}=Object(i.a)(),h=Object(r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};l(e,t,{...n,context:n.context||s}),f("store-notice-create",{status:e,content:t,options:n})}),[l,f,s]),E=Object(r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;u(e,t)}),[u,s]),{notices:O}=Object(o.useSelect)(e=>({notices:e("core/notices").getNotices(s)}),[s]),w={notices:O,createNotice:h,removeNotice:E,context:s,setIsSuppressed:p},j=d?null:Object(r.createElement)(b,{className:n,notices:w.notices,removeNotice:w.removeNotice,isEditor:g});return Object(r.createElement)(m.Provider,{value:w},a&&j,t)}},,,function(e,t,n){"use strict";var r=n(0),o=n(13);const c=Object(r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(o.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));t.a=c},,,,,,,,function(e,t){e.exports=window.wp.blocks},function(e,t,n){"use strict";var r=n(0);t.a=function(e){let{icon:t,size:n=24,...o}=e;return Object(r.cloneElement)(t,{width:n,height:n,...o})}},,function(e,t){},,function(e,t,n){"use strict";var r=n(0),o=n(4),c=n.n(o),i=n(23),a=n(12);n(118),t.a=Object(a.withInstanceId)(e=>{let{className:t,instanceId:n,label:o="",onChange:a,options:s,screenReaderLabel:l,value:u}=e;const d="wc-block-components-sort-select__select-"+n;return Object(r.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(r.createElement)(i.a,{label:o,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(r.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:a,value:u},s&&s.map(e=>Object(r.createElement)("option",{key:e.key,value:e.key},e.label))))})},,,,,,,,function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n(2),o=n(51),c=n(36);const i=e=>{let{country:t="",state:n="",city:r="",postcode:o=""}=e;return{country:t.trim(),state:n.trim(),city:r.trim(),postcode:o?o.replace(" ","").toUpperCase():""}},a=e=>{let{email:t=""}=e;return Object(c.isEmail)(t)?t.trim():""},s=e=>{const t=Object.keys(r.defaultAddressFields),n=Object(o.a)(t,{},e.country),c=Object.assign({},e);return n.forEach(t=>{let{key:n="",hidden:r=!1}=t;r&&((e,t)=>e in t)(n,e)&&(c[n]="")}),c}},function(e,t){e.exports=window.wc.wcBlocksSharedHocs},,,function(e,t){e.exports=window.wp.wordcount},function(e,t){e.exports=window.wp.autop},function(e,t){},function(e,t,n){"use strict";var r=n(0),o=n(5),c=n(4),i=n.n(c),a=n(1),s=n(25),l=n(91),u=n(56);function d(e){switch(e){case"success":case"warning":case"info":return"polite";case"error":default:return"assertive"}}t.a=function({className:e,status:t="info",children:n,spokenMessage:c=n,onRemove:p=o.noop,isDismissible:b=!0,actions:m=[],politeness:f=d(t),__unstableHTML:g,onDismiss:h=o.noop}){!function(e,t){const n="string"==typeof e?e:Object(r.renderToString)(e);Object(r.useEffect)(()=>{n&&Object(s.speak)(n,t)},[n,t])}(c,f);const E=i()(e,"components-notice","is-"+t,{"is-dismissible":b});return g&&(n=Object(r.createElement)(r.RawHTML,null,n)),Object(r.createElement)("div",{className:E},Object(r.createElement)("div",{className:"components-notice__content"},n,Object(r.createElement)("div",{className:"components-notice__actions"},m.map(({className:e,label:t,isPrimary:n,variant:o,noDefaultClasses:c=!1,onClick:a,url:s},l)=>{let d=o;return"primary"===o||c||(d=s?"link":"secondary"),void 0===d&&n&&(d="primary"),Object(r.createElement)(u.a,{key:l,href:s,variant:d,onClick:s?void 0:a,className:i()("components-notice__action",e)},t)}))),b&&Object(r.createElement)(u.a,{className:"components-notice__dismiss",icon:l.a,label:Object(a.__)("Dismiss this notice"),onClick:e=>{var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),h(),p()},showTooltip:!1}))}},,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(16),o=n(0),c=n(50);n.p=c.k,Object(r.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(o.lazy)(()=>Promise.all([n.e(1),n.e(11)]).then(n.bind(null,366)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(o.lazy)(()=>n.e(10).then(n.bind(null,399)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(o.lazy)(()=>n.e(18).then(n.bind(null,400)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(o.lazy)(()=>n.e(12).then(n.bind(null,367)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(o.lazy)(()=>n.e(8).then(n.bind(null,368)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(o.lazy)(()=>n.e(16).then(n.bind(null,369)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(o.lazy)(()=>n.e(13).then(n.bind(null,290)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(o.lazy)(()=>n.e(14).then(n.bind(null,370)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(o.lazy)(()=>n.e(9).then(n.bind(null,371)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(o.lazy)(()=>n.e(17).then(n.bind(null,372)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(o.lazy)(()=>n.e(15).then(n.bind(null,373)))}),Object(r.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(o.lazy)(()=>Promise.all([n.e(0),n.e(49),n.e(7)]).then(n.bind(null,386)))});const i=e=>Object(r.getRegisteredBlockComponents)(e)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){e.exports=n(204)},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(88),c=n(53),i=n(3),a=(n(8),n(1)),s=n(5),l=n(4),u=n.n(l),d=n(23);n(182);var p=e=>{let{currentPage:t,displayFirstAndLastPages:n=!0,displayNextAndPreviousArrows:o=!0,pagesToDisplay:c=3,onPageChange:i,totalPages:s}=e,{minIndex:l,maxIndex:p}=((e,t,n)=>{if(n<=2)return{minIndex:null,maxIndex:null};const r=e-1,o=Math.max(Math.floor(t-r/2),2),c=Math.min(Math.ceil(t+(r-(t-o))),n-1);return{minIndex:Math.max(Math.floor(t-(r-(c-t))),2),maxIndex:c}})(c,t,s);const b=n&&Boolean(1!==l),m=n&&Boolean(p!==s),f=n&&Boolean(l&&l>3),g=n&&Boolean(p&&p<s-2);b&&3===l&&(l-=1),m&&p===s-2&&(p+=1);const h=[];if(l&&p)for(let e=l;e<=p;e++)h.push(e);return Object(r.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(r.createElement)(d.a,{screenReaderLabel:Object(a.__)("Navigate to another page","woo-gutenberg-products-block")}),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>i(t-1),title:Object(a.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(r.createElement)(d.a,{label:"←",screenReaderLabel:Object(a.__)("Previous page","woo-gutenberg-products-block")})),b&&Object(r.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:()=>i(1),disabled:1===t},Object(r.createElement)(d.a,{label:"1",screenReaderLabel:Object(a.sprintf)(
4
  /* translators: %d is the page number (1, 2, 3...). */
5
+ Object(a.__)("Page %d","woo-gutenberg-products-block"),1)})),f&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(a.__)("…","woo-gutenberg-products-block")),h.map(e=>Object(r.createElement)("button",{key:e,className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?void 0:()=>i(e),disabled:t===e},Object(r.createElement)(d.a,{label:e.toString(),screenReaderLabel:Object(a.sprintf)(
6
  /* translators: %d is the page number (1, 2, 3...). */
7
+ Object(a.__)("Page %d","woo-gutenberg-products-block"),e)}))),g&&Object(r.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(a.__)("…","woo-gutenberg-products-block")),m&&Object(r.createElement)("button",{className:u()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===s,"wc-block-components-pagination__page--active":t===s}),onClick:()=>i(s),disabled:t===s},Object(r.createElement)(d.a,{label:s.toString(),screenReaderLabel:Object(a.sprintf)(
8
  /* translators: %d is the page number (1, 2, 3...). */
9
+ Object(a.__)("Page %d","woo-gutenberg-products-block"),s)})),o&&Object(r.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>i(t+1),title:Object(a.__)("Next page","woo-gutenberg-products-block"),disabled:t>=s},Object(r.createElement)(d.a,{label:"→",screenReaderLabel:Object(a.__)("Next page","woo-gutenberg-products-block")})))},b=n(63),m=n(38),f=n(65),g=n(6),h=n(9),E=n(19);var O=n(33),w=n(72),j=n(49),v=n(25),y=n(100),_=n(13),k=Object(r.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},Object(r.createElement)(_.Path,{d:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"})),x=()=>{const{parentClassName:e}=Object(j.useInnerBlockLayoutContext)();return Object(r.createElement)("div",{className:e+"__no-products"},Object(r.createElement)(y.a,{className:e+"__no-products-image",icon:k,size:100}),Object(r.createElement)("strong",{className:e+"__no-products-title"},Object(a.__)("No products","woo-gutenberg-products-block")),Object(r.createElement)("p",{className:e+"__no-products-description"},Object(a.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},C=Object(r.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(_.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"})),S=e=>{let{resetCallback:t=(()=>{})}=e;const{parentClassName:n}=Object(j.useInnerBlockLayoutContext)();return Object(r.createElement)("div",{className:n+"__no-products"},Object(r.createElement)(y.a,{className:n+"__no-products-image",icon:C,size:100}),Object(r.createElement)("strong",{className:n+"__no-products-title"},Object(a.__)("No products found","woo-gutenberg-products-block")),Object(r.createElement)("p",{className:n+"__no-products-description"},Object(a.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(r.createElement)("button",{onClick:t},Object(a.__)("Reset Search","woo-gutenberg-products-block")))},N=n(104);n(181);var P=e=>{let{onChange:t,value:n}=e;return Object(r.createElement)(N.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",onChange:t,options:[{key:"menu_order",label:Object(a.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(a.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(a.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(a.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(a.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(a.__)("Price: high to low","woo-gutenberg-products-block")}],screenReaderLabel:Object(a.__)("Order products by","woo-gutenberg-products-block"),value:n})},R=n(12),T=n(11),L=n.n(T),B=n(128);const A=(e,t,n,o)=>{if(!n)return;const c=Object(B.a)(e);return n.map((n,i)=>{let[a,s={}]=n,l=[];s.children&&s.children.length>0&&(l=A(e,t,s.children,o));const u=c[a];if(!u)return null;const d=t.id||0,p=["layout",a,i,o,d];return Object(r.createElement)(r.Suspense,{key:p.join("_"),fallback:Object(r.createElement)("div",{className:"wc-block-placeholder"})},Object(r.createElement)(u,L()({},s,{children:l,product:t})))})};var M=Object(R.withInstanceId)(e=>{let{product:t={},attributes:n,instanceId:o}=e;const{layoutConfig:c}=n,{parentClassName:i,parentName:a}=Object(j.useInnerBlockLayoutContext)(),s=0===Object.keys(t).length,l=u()(i+"__product","wc-block-layout",{"is-loading":s});return Object(r.createElement)("li",{className:l,"aria-hidden":s},A(a,t,c,o))});n(180);const F=e=>{switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}},I=function(e){let{totalQuery:t,totalProducts:n}=e,{totalQuery:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!Object(s.isEqual)(t,r)&&Number.isFinite(n)};var D=Object(w.a)(e=>{let{attributes:t,currentPage:n,onPageChange:o,onSortChange:c,sortValue:i,scrollToTop:l}=e;const[d,w]=Object(m.b)("attributes",[]),[y,_]=Object(m.b)("stock_status",[]),[k,C]=Object(m.b)("min_price"),[N,R]=Object(m.b)("max_price"),[T]=Object(m.c)((e=>{let{sortValue:t,currentPage:n,attributes:r}=e;const{columns:o,rows:c}=r;return{...F(t),catalog_visibility:"catalog",per_page:o*c,page:n}})({attributes:t,sortValue:i,currentPage:n})),{products:L,totalProducts:B,productsLoading:A}=(e=>{const t={namespace:"/wc/store",resourceName:"products"},{results:n,isLoading:r}=Object(f.a)({...t,query:e}),{value:o}=((e,t)=>{const{namespace:n,resourceName:r,resourceValues:o=[],query:c={}}=t;if(!n||!r)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const i=Object(E.a)(c),a=Object(E.a)(o),{value:s,isLoading:l=!0}=Object(h.useSelect)(e=>{const t=e(g.COLLECTIONS_STORE_KEY),o=["x-wp-total",n,r,i,a];return{value:t.getCollectionHeader(...o),isLoading:t.hasFinishedResolution("getCollectionHeader",o)}},["x-wp-total",n,r,a,i]);return{value:s,isLoading:l}})(0,{...t,query:e});return{products:n,totalProducts:parseInt(o,10),productsLoading:r}})(T),{parentClassName:D,parentName:W}=Object(j.useInnerBlockLayoutContext)(),H=(e=>{const{order:t,orderby:n,page:r,per_page:o,...c}=e;return c||{}})(T),{dispatchStoreEvent:z}=Object(O.a)(),V=Object(b.a)({totalQuery:H,totalProducts:B},I);Object(r.useEffect)(()=>{z("product-list-render",{products:L,listName:W})},[L,W,z]),Object(r.useEffect)(()=>{Object(s.isEqual)(H,null==V?void 0:V.totalQuery)||(o(1),null!=V&&V.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?Object(v.speak)(Object(a.__)("No products found","woo-gutenberg-products-block")):Object(v.speak)(Object(a.sprintf)(
10
  /* translators: %s is an integer higher than 0 (1, 2, 3...) */
11
+ Object(a._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))})(B))},[null==V?void 0:V.totalQuery,B,o,H]);const{contentVisibility:U}=t,Y=t.columns*t.rows,q=!Number.isFinite(B)&&Number.isFinite(null==V?void 0:V.totalProducts)&&Object(s.isEqual)(H,null==V?void 0:V.totalQuery)?Math.ceil(((null==V?void 0:V.totalProducts)||0)/Y):Math.ceil(B/Y),Q=L.length?L:Array.from({length:Y}),G=0!==L.length||A,K=d.length>0||y.length>0||Number.isFinite(k)||Number.isFinite(N);return Object(r.createElement)("div",{className:(()=>{const{columns:e,rows:n,alignButtons:r,align:o}=t,c=void 0!==o?"align"+o:"";return u()(D,c,"has-"+e+"-columns",{"has-multiple-rows":n>1,"has-aligned-buttons":r})})()},(null==U?void 0:U.orderBy)&&G&&Object(r.createElement)(P,{onChange:c,value:i}),!G&&K&&Object(r.createElement)(S,{resetCallback:()=>{w([]),_([]),C(null),R(null)}}),!G&&!K&&Object(r.createElement)(x,null),G&&Object(r.createElement)("ul",{className:D+"__products"},Q.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return Object(r.createElement)(M,{key:e.id||n,attributes:t,product:e})}))),q>1&&Object(r.createElement)(p,{currentPage:n,onPageChange:e=>{l({focusableSelector:"a, button"}),o(e)},totalPages:q}))}),W=e=>{let{attributes:t}=e;const[n,o]=Object(r.useState)(1),[c,i]=Object(r.useState)(t.orderby);return Object(r.useEffect)(()=>{i(t.orderby)},[t.orderby]),Object(r.createElement)(D,{attributes:t,currentPage:n,onPageChange:e=>{o(e)},onSortChange:e=>{var t;const n=null==e||null===(t=e.target)||void 0===t?void 0:t.value;i(n),o(1)},sortValue:c})};const H=Object(r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(r.createElement)("title",null,"Grid Block Preview"),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(r.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(r.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}));class z extends i.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?H:Object(r.createElement)(j.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(r.createElement)(W,{attributes:e,urlParameterSuffix:t}))}}var V=z;Object(c.a)({selector:".wp-block-woocommerce-all-products",Block:e=>Object(r.createElement)(o.a,{context:"wc/all-products"},Object(r.createElement)(V,e)),getProps:e=>({attributes:JSON.parse(e.dataset.attributes)})})}]);
build/all-products.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '2fa02865ac46a64f5becfa2ff4c391c9');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wc-settings', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '5c62d15ec876c8e7a49aa42643d43056');
build/all-products.js CHANGED
@@ -1,36 +1,36 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var o,a,s=t[0],l=t[1],i=t[2],b=0,d=[];b<s.length;b++)a=s[b],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&d.push(r[a][0]),r[a]=0;for(o in l)Object.prototype.hasOwnProperty.call(l,o)&&(e[o]=l[o]);for(u&&u(t);d.length;)d.shift()();return n.push.apply(n,i||[]),c()}function c(){for(var e,t=0;t<n.length;t++){for(var c=n[t],o=!0,s=1;s<c.length;s++){var l=c[s];0!==r[l]&&(o=!1)}o&&(n.splice(t--,1),e=a(a.s=c[0]))}return e}var o={},r={7:0,1:0,2:0,3:0,4:0,5:0,10:0,11:0,13:0,14:0,15:0,16:0,17:0,18:0},n=[];function a(t){if(o[t])return o[t].exports;var c=o[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,a),c.l=!0,c.exports}a.e=function(e){var t=[],c=r[e];if(0!==c)if(c)t.push(c[2]);else{var o=new Promise((function(t,o){c=r[e]=[t,o]}));t.push(c[2]=o);var n,s=document.createElement("script");s.charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---8f355022",2:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",3:"atomic-block-components/stock-indicator--atomic-block-components/summary--atomic-block-components/title",4:"atomic-block-components/add-to-cart--atomic-block-components/button",5:"atomic-block-components/sale-badge",9:"atomic-block-components/add-to-cart",10:"atomic-block-components/button",11:"atomic-block-components/category-list",12:"atomic-block-components/image",13:"atomic-block-components/price",14:"atomic-block-components/rating",15:"atomic-block-components/sku",16:"atomic-block-components/stock-indicator",17:"atomic-block-components/summary",18:"atomic-block-components/tag-list",19:"atomic-block-components/title"}[e]||e)+".js?ver="+{1:"a65364bc2aef96839601",2:"7ca2ec295c30d42f2d9b",3:"76461ee360049ed00215",4:"7de190fbe2df8ec8f501",5:"7d69f97596f26ac9df7b",9:"854480dd085ee6157644",10:"8ecf14e43ca010db9f1f",11:"341c2a01f126719d8a32",12:"8a2caac2e28944911fb8",13:"061fd4397f806ccbd4e5",14:"f893cd7327cfbe0f21ee",15:"30e9fcdc69c79ea4d159",16:"3a64488e8c2d0c984e84",17:"5bbe046a46d2362f145c",18:"b98414d5f33bdd0e8f1c",19:"7041eba2f6edef3011e4"}[e]}(e);var l=new Error;n=function(t){s.onerror=s.onload=null,clearTimeout(i);var c=r[e];if(0!==c){if(c){var o=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;l.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",l.name="ChunkLoadError",l.type=o,l.request=n,c[1](l)}r[e]=void 0}};var i=setTimeout((function(){n({type:"timeout",target:s})}),12e4);s.onerror=s.onload=n,document.head.appendChild(s)}return Promise.all(t)},a.m=e,a.c=o,a.d=function(e,t,c){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(c,o,function(t){return e[t]}.bind(null,o));return c},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var s=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var i=0;i<s.length;i++)t(s[i]);var u=l;return n.push([356,0]),c()}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wp.components},,,function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.compose},,function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,c){"use strict";c.d(t,"a",(function(){return a})),c.d(t,"c",(function(){return l})),c.d(t,"d",(function(){return i})),c.d(t,"b",(function(){return u}));var o=c(0),r=c(6),n=c(1);const a={clear:Object(n.__)("Clear all selected items","woo-gutenberg-products-block"),noItems:Object(n.__)("No items found.","woo-gutenberg-products-block"),
2
  /* Translators: %s search term */
3
  noResults:Object(n.__)("No results for %s","woo-gutenberg-products-block"),search:Object(n.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(n.sprintf)(
4
  /* translators: Number of items selected from list. */
5
- Object(n._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(n.__)("Search results updated.","woo-gutenberg-products-block")},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(r.groupBy)(e,"parent"),o=Object(r.keyBy)(t,"id"),n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=n(o[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=c[e.id];return delete c[e.id],{...e,breadcrumbs:n(o[e.parent]),children:t&&t.length?a(t):[]}}),s=a(c[0]||[]);return delete c[0],Object(r.forEach)(c,e=>{s.push(...a(e||[]))}),s},l=(e,t,c)=>{if(!t)return c?s(e):e;const o=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),r=e.map(e=>!!o.test(e.name)&&e).filter(Boolean);return c?s(r,e):r},i=(e,t)=>{if(!t)return e;const c=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"ig");return e.split(c).map((e,c)=>0===c?e:Object(o.createElement)(o.Fragment,{key:c},Object(o.createElement)("strong",null,t),e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},function(e,t){e.exports=window.wp.primitives},,,,,,function(e,t,c){"use strict";c.d(t,"o",(function(){return n})),c.d(t,"m",(function(){return a})),c.d(t,"l",(function(){return s})),c.d(t,"n",(function(){return l})),c.d(t,"j",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return b})),c.d(t,"g",(function(){return d})),c.d(t,"k",(function(){return m})),c.d(t,"c",(function(){return p})),c.d(t,"d",(function(){return g})),c.d(t,"h",(function(){return O})),c.d(t,"a",(function(){return h})),c.d(t,"i",(function(){return j})),c.d(t,"b",(function(){return E}));var o,r=c(2);const n=Object(r.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=n.pluginUrl+"images/",s=n.pluginUrl+"build/",l=n.buildPhase,i=null===(o=r.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,u=r.STORE_PAGES.checkout.id,b=r.STORE_PAGES.checkout.permalink,d=r.STORE_PAGES.privacy.permalink,m=(r.STORE_PAGES.privacy.title,r.STORE_PAGES.terms.permalink),p=(r.STORE_PAGES.terms.title,r.STORE_PAGES.cart.id),g=r.STORE_PAGES.cart.permalink,O=(r.STORE_PAGES.myaccount.permalink?r.STORE_PAGES.myaccount.permalink:Object(r.getSetting)("wpLoginUrl","/wp-login.php"),Object(r.getSetting)("shippingCountries",{})),h=Object(r.getSetting)("allowedCountries",{}),j=Object(r.getSetting)("shippingStates",{}),E=Object(r.getSetting)("allowedStates",{})},,function(e,t){e.exports=window.wp.isShallowEqual},function(e,t,c){"use strict";c.d(t,"h",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return b})),c.d(t,"i",(function(){return d})),c.d(t,"f",(function(){return m})),c.d(t,"c",(function(){return p})),c.d(t,"d",(function(){return g})),c.d(t,"g",(function(){return O})),c.d(t,"a",(function(){return h}));var o=c(15),r=c(11),n=c.n(r),a=c(6),s=c(2),l=c(24);const i=e=>{let{selected:t=[],search:c="",queryArgs:r={}}=e;const s=(e=>{let{selected:t=[],search:c="",queryArgs:r={}}=e;const n=l.o.productCount>100,a={per_page:n?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},s=[Object(o.addQueryArgs)("/wc/store/products",{...a,...r})];return n&&t.length&&s.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:t,per_page:0})),s})({selected:t,search:c,queryArgs:r});return Promise.all(s.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>n()({path:"/wc/store/products/"+e}),b=()=>n()({path:"wc/store/products/attributes"}),d=e=>n()({path:`wc/store/products/attributes/${e}/terms`}),m=e=>{let{selected:t=[],search:c}=e;const r=(e=>{let{selected:t=[],search:c}=e;const r=Object(s.getSetting)("limitTags",!1),n=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:r?100:0,orderby:r?"count":"name",order:r?"desc":"asc",search:c})];return r&&t.length&&n.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:t})),n})({selected:t,search:c});return Promise.all(r.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id"))},p=e=>n()({path:Object(o.addQueryArgs)("wc/store/products/categories",{per_page:0,...e})}),g=e=>n()({path:"wc/store/products/categories/"+e}),O=e=>n()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})}),h=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return n}));var o=c(1);const r=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},n=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},function(e,t){e.exports=window.wc.wcBlocksSharedContext},function(e,t,c){"use strict";var o=c(0),r=c(4),n=c.n(r);t.a=e=>{let t,{label:c,screenReaderLabel:r,wrapperElement:a,wrapperProps:s={}}=e;const l=null!=c,i=null!=r;return!l&&i?(t=a||"span",s={...s,className:n()(s.className,"screen-reader-text")},Object(o.createElement)(t,s,r)):(t=a||o.Fragment,l&&i&&c!==r?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},c),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,s,c))}},function(e,t){e.exports=window.wp.escapeHtml},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(31);t.a=e=>{let{error:t}=e;return Object(o.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(o.createElement)("span",null,Object(r.__)("The following error was returned","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(n.escapeHTML)(t))):"api"===c?Object(o.createElement)("span",null,Object(r.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(n.escapeHTML)(t))):t:Object(r.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var o=c(5),r=c.n(o),n=c(0),a=c(17);const s=e=>{let{countLabel:t,className:c,depth:o=0,controlId:s="",item:l,isSelected:i,isSingle:u,onSelect:b,search:d="",...m}=e;const p=null!=t&&void 0!==l.count&&null!==l.count,g=[c,"woocommerce-search-list__item"];g.push("depth-"+o),u&&g.push("is-radio-button"),p&&g.push("has-count");const O=l.breadcrumbs&&l.breadcrumbs.length,h=m.name||"search-list-item-"+s,j=`${h}-${l.id}`;return Object(n.createElement)("label",{htmlFor:j,className:g.join(" ")},u?Object(n.createElement)("input",r()({type:"radio",id:j,name:h,value:l.value,onChange:b(l),checked:i,className:"woocommerce-search-list__item-input"},m)):Object(n.createElement)("input",r()({type:"checkbox",id:j,name:h,value:l.value,onChange:b(l),checked:i,className:"woocommerce-search-list__item-input"},m)),Object(n.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(n.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(a.b)(l.breadcrumbs)):null,Object(n.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(a.d)(l.name,d))),!!p&&Object(n.createElement)("span",{className:"woocommerce-search-list__item-count"},t||l.count))};t.b=s},,function(e,t){e.exports=window.wc.priceFormat},function(e,t,c){"use strict";c.d(t,"a",(function(){return _}));var o=c(6),r=c(0),n=c(16),a=c(13),s=c(14),l=c(151),i=c(252),u=c(49),b=c(251);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(a.dispatch)(n.CART_STORE_KEY).invalidateResolutionForStore()},m=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},p=()=>{Object(r.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(b.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(b.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),m),[])},g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},O={...g,email:""},h={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:n.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},j=e=>Object(l.a)(Object.entries(e).map(e=>{let[t,c]=e;return[t,Object(s.decodeEntities)(c)]})),E={cartCoupons:n.EMPTY_CART_COUPONS,cartItems:n.EMPTY_CART_ITEMS,cartFees:n.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:h,cartIsLoading:!0,cartErrors:n.EMPTY_CART_ERRORS,billingAddress:O,shippingAddress:g,shippingRates:n.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:n.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:n.EMPTY_EXTENSIONS},_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:c}=Object(u.b)(),s=null==c?void 0:c.previewCart,{shouldSelect:l}=e,b=Object(r.useRef)();p();const d=Object(a.useSelect)((e,c)=>{let{dispatch:o}=c;if(!l)return E;if(t)return{cartCoupons:s.coupons,cartItems:s.items,cartFees:s.fees,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:s.totals,cartIsLoading:!1,cartErrors:n.EMPTY_CART_ERRORS,billingAddress:O,shippingAddress:g,extensions:n.EMPTY_EXTENSIONS,shippingRates:s.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:s.has_calculated_shipping,paymentRequirements:s.paymentRequirements,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:()=>{}};const r=e(n.CART_STORE_KEY),a=r.getCartData(),u=r.getCartErrors(),b=r.getCartTotals(),d=!r.hasFinishedResolution("getCartData"),m=r.isCustomerDataUpdating(),{receiveCart:p}=o(n.CART_STORE_KEY),h=j(a.billingAddress),_=a.needsShipping?j(a.shippingAddress):h,w=a.fees.length>0?a.fees.map(e=>j(e)):n.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map(e=>({...e,label:e.code})):n.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:w,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:b,cartIsLoading:d,cartErrors:u,billingAddress:Object(i.a)(h),shippingAddress:Object(i.a)(_),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:m,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:p}},[l]);return b.current&&Object(o.isEqual)(b.current,d)||(b.current=d),b.current}},,function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var o=c(0),r=c(26),n=c.n(r);function a(e){const t=Object(o.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},,function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(134),s=c(4),l=c.n(s);c(140);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:o,onValueChange:s,displayType:u="text",...b}=e;const d="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(d))return null;const m=d/10**o.minorUnit;if(!Number.isFinite(m))return null;const p=l()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...b,...i(o),value:void 0,currency:void 0,onValueChange:void 0},O=s?e=>{const t=+e.value*10**o.minorUnit;s(t)}:()=>{};return Object(n.createElement)(a.a,r()({className:p,displayType:u},g,{value:m,onValueChange:O}))}},,function(e,t,c){"use strict";var o=c(0);t.a=function(e){let{srcElement:t,size:c=24,...r}=e;return Object(o.isValidElement)(t)?Object(o.cloneElement)(t,{width:c,height:c,...r}):null}},function(e,t,c){"use strict";c.d(t,"a",(function(){return l})),c.d(t,"b",(function(){return i})),c.d(t,"c",(function(){return b}));var o=c(62);let r,n;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(r||(r={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(n||(n={}));const a=(e,t)=>Object(o.b)(e)&&"type"in e&&e.type===t,s=e=>a(e,r.SUCCESS),l=e=>a(e,r.ERROR),i=e=>a(e,r.FAIL),u=e=>!Object(o.b)(e)||void 0===e.retry||!0===e.retry,b=()=>({responseTypes:r,noticeContexts:n,shouldRetry:u,isSuccessResponse:s,isErrorResponse:l,isFailResponse:i})},,function(e,t){e.exports=window.wp.a11y},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(0),r=c(130);const n=()=>{const{notices:e,createNotice:t,removeNotice:c,setIsSuppressed:n}=Object(r.b)(),a=Object(o.useRef)(e);Object(o.useEffect)(()=>{a.current=e},[e]);const s=Object(o.useMemo)(()=>({hasNoticesOfType:e=>a.current.some(t=>t.type===e),removeNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.current.forEach(t=>{null!==e&&t.status!==e||c(t.id)})},removeNotice:c}),[c]),l=Object(o.useMemo)(()=>({addDefaultNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("default",e,{...c})},addErrorNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("error",e,{...c})},addWarningNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("warning",e,{...c})},addInfoNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("info",e,{...c})},addSuccessNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("success",e,{...c})}}),[t]);return{notices:e,...s,...l,setIsSuppressed:n}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(0);const r=Object(o.createContext)("page"),n=()=>Object(o.useContext)(r);r.Provider},function(e,t,c){"use strict";c.d(t,"b",(function(){return a})),c.d(t,"a",(function(){return s}));var o=c(0),r=c(13);const n=Object(o.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),a=()=>Object(o.useContext)(n),s=e=>{let{children:t,currentPostId:c=0,currentView:a="",previewData:s={}}=e;const l=Object(r.useSelect)(e=>c||e("core/editor").getCurrentPostId(),[c]),i=Object(o.useCallback)(e=>e in s?s[e]:{},[s]),u={isEditor:!0,currentPostId:l,currentView:a,previewData:s,getPreviewData:i};return Object(o.createElement)(n.Provider,{value:u},t)}},,,,,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(4),s=c.n(a),l=c(3),i=c(9);c(84);class u extends n.Component{constructor(){super(...arguments),this.onClick=this.onClick.bind(this)}onClick(e){this.props.onChange&&this.props.onChange(e.target.value)}render(){const{label:e,checked:t,instanceId:c,className:o,help:a,options:i,value:u}=this.props,b="inspector-toggle-button-control-"+c;let d;return a&&(d="function"==typeof a?a(t):a),Object(n.createElement)(l.BaseControl,{id:b,help:d,className:s()("components-toggle-button-control",o)},Object(n.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},e),Object(n.createElement)(l.ButtonGroup,{"aria-labelledby":b+"__label"},i.map((t,c)=>{const o={};return u===t.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(n.createElement)(l.Button,r()({key:`${t.label}-${t.value}-${c}`,value:t.value,onClick:this.onClick,"aria-label":e+": "+t.label},o),t.label)})))}}t.a=Object(i.withInstanceId)(u)},,,,function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(6),a=(c(10),c(3));t.a=e=>{let{columns:t,rows:c,setAttributes:s,alignButtons:l,minColumns:i=1,maxColumns:u=6,minRows:b=1,maxRows:d=6}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.RangeControl,{label:Object(r.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:e=>{const t=Object(n.clamp)(e,i,u);s({columns:Number.isNaN(t)?"":t})},min:i,max:u}),Object(o.createElement)(a.RangeControl,{label:Object(r.__)("Rows","woo-gutenberg-products-block"),value:c,onChange:e=>{const t=Object(n.clamp)(e,b,d);s({rows:Number.isNaN(t)?"":t})},min:b,max:d}),Object(o.createElement)(a.ToggleControl,{label:Object(r.__)("Align Last Block","woo-gutenberg-products-block"),help:l?Object(r.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(r.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:l,onChange:()=>s({alignButtons:!l})}))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var o=c(61),r=c(0),n=c(36);const a=()=>{const e=Object(n.a)(),t=Object(r.useRef)(e);return Object(r.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(r.useCallback)((function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...c,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t){e.exports=window.wp.hooks},function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"c",(function(){return r})),c.d(t,"b",(function(){return n})),c.d(t,"d",(function(){return a}));const o=e=>"number"==typeof e,r=e=>"string"==typeof e,n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function a(e,t){return n(e)&&t in e}},,,function(e,t,c){"use strict";c.d(t,"c",(function(){return n})),c.d(t,"d",(function(){return a})),c.d(t,"a",(function(){return s})),c.d(t,"b",(function(){return l}));var o=c(12),r=c(24);const n=(e,t)=>{if(r.n>2)return Object(o.registerBlockType)(e,t)},a=(e,t)=>{if(r.n>1)return Object(o.registerBlockType)(e,t)},s=()=>r.n>2,l=()=>r.n>1},,function(e,t){e.exports=window.wp.deprecated},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return b})),c.d(t,"b",(function(){return d})),c.d(t,"c",(function(){return m}));var o=c(16),r=c(13),n=c(0),a=c(26),s=c.n(a),l=c(39),i=c(109),u=c(48);const b=e=>{const t=Object(u.a)();e=e||t;const c=Object(r.useSelect)(t=>t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:a}=Object(r.useDispatch)(o.QUERY_STATE_STORE_KEY);return[c,Object(n.useCallback)(t=>{a(e,t)},[e,a])]},d=(e,t,c)=>{const a=Object(u.a)();c=c||a;const s=Object(r.useSelect)(r=>r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:l}=Object(r.useDispatch)(o.QUERY_STATE_STORE_KEY);return[s,Object(n.useCallback)(t=>{l(c,e,t)},[c,e,l])]},m=(e,t)=>{const c=Object(u.a)();t=t||c;const[o,r]=b(t),a=Object(l.a)(o),d=Object(l.a)(e),m=Object(i.a)(d),p=Object(n.useRef)(!1);return Object(n.useEffect)(()=>{s()(m,d)||(r(Object.assign({},a,d)),p.current=!0)},[a,d,m,r]),p.current?[o,r]:[e,r]}},,,function(e,t){e.exports=window.wp.autop},,,,function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(139),s=c(4),l=c.n(s),i=c(100);c(160),t.a=e=>{let{className:t,showSpinner:c=!1,children:o,...s}=e;const u=l()("wc-block-components-button",t,{"wc-block-components-button--loading":c});return Object(n.createElement)(a.a,r()({className:u},s),c&&Object(n.createElement)(i.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},o))}},,function(e,t){e.exports=window.wp.dom},,function(e,t){},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return k}));var o=c(5),r=c.n(o),n=c(0),a=c(1),s=c(3),l=c(485),i=c(487),u=c(4),b=c.n(u),d=c(9),m=c(17),p=c(33),g=c(486),O=c(14);const h=e=>{let{id:t,label:c,popoverContents:o,remove:r,screenReaderLabel:i,className:u=""}=e;const[m,p]=Object(n.useState)(!1),j=Object(d.useInstanceId)(h);if(i=i||c,!c)return null;c=Object(O.decodeEntities)(c);const E=b()("woocommerce-tag",u,{"has-remove":!!r}),_="woocommerce-tag__label-"+j,w=Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},i),Object(n.createElement)("span",{"aria-hidden":"true"},c));return Object(n.createElement)("span",{className:E},o?Object(n.createElement)(s.Button,{className:"woocommerce-tag__text",id:_,onClick:()=>p(!0)},w):Object(n.createElement)("span",{className:"woocommerce-tag__text",id:_},w),o&&m&&Object(n.createElement)(s.Popover,{onClose:()=>p(!1)},o),r&&Object(n.createElement)(s.Button,{className:"woocommerce-tag__remove",onClick:r(t),label:Object(a.sprintf)(// Translators: %s label.
6
- Object(a.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":_},Object(n.createElement)(l.a,{icon:g.a,size:20,className:"clear-icon"})))};var j=h;const E=e=>Object(n.createElement)(p.b,e),_=e=>{const{list:t,selected:c,renderItem:o,depth:a=0,onSelect:s,instanceId:l,isSingle:i,search:u}=e;return t?Object(n.createElement)(n.Fragment,null,t.map(t=>{const b=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(n.createElement)(n.Fragment,{key:t.id},Object(n.createElement)("li",null,o({item:t,isSelected:b,onSelect:s,isSingle:i,search:u,depth:a,controlId:l})),Object(n.createElement)(_,r()({},e,{list:t.children,depth:a+1})))})):null},w=e=>{let{isLoading:t,isSingle:c,selected:o,messages:r,onChange:l,onRemove:i}=e;if(t||c||!o)return null;const u=o.length;return Object(n.createElement)("div",{className:"woocommerce-search-list__selected"},Object(n.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(n.createElement)("strong",null,r.selected(u)),u>0?Object(n.createElement)(s.Button,{isLink:!0,isDestructive:!0,onClick:()=>l([]),"aria-label":r.clear},Object(a.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(n.createElement)("ul",null,o.map((e,t)=>Object(n.createElement)("li",{key:t},Object(n.createElement)(j,{label:e.name,id:e.id,remove:i})))):null)},f=e=>{let{filteredList:t,search:c,onSelect:o,instanceId:r,...s}=e;const{messages:u,renderItem:b,selected:d,isSingle:m}=s,p=b||E;return 0===t.length?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(n.createElement)(l.a,{icon:i.a})),Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(a.sprintf)(u.noResults,c):u.noItems)):Object(n.createElement)("ul",{className:"woocommerce-search-list__list"},Object(n.createElement)(_,{list:t,selected:d,renderItem:p,onSelect:o,instanceId:r,isSingle:m,search:c}))},k=e=>{const{className:t="",isCompact:c,isHierarchical:o,isLoading:a,isSingle:l,list:i,messages:u=m.a,onChange:p,onSearch:g,selected:O,debouncedSpeak:h}=e,[j,E]=Object(n.useState)(""),_=Object(d.useInstanceId)(k),v=Object(n.useMemo)(()=>({...m.a,...u}),[u]),y=Object(n.useMemo)(()=>Object(m.c)(i,j,o),[i,j,o]);Object(n.useEffect)(()=>{h&&h(v.updated)},[h,v]),Object(n.useEffect)(()=>{"function"==typeof g&&g(j)},[j,g]);const S=Object(n.useCallback)(e=>()=>{l&&p([]);const t=O.findIndex(t=>{let{id:c}=t;return c===e});p([...O.slice(0,t),...O.slice(t+1)])},[l,O,p]),C=Object(n.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:c}=t;return c===e.id})?p(l?[e]:[...O,e]):S(e.id)()},[l,S,p,O]);return Object(n.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":c})},Object(n.createElement)(w,r()({},e,{onRemove:S,messages:v})),Object(n.createElement)("div",{className:"woocommerce-search-list__search"},Object(n.createElement)(s.TextControl,{label:v.search,type:"search",value:j,onChange:e=>E(e)})),a?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(n.createElement)(s.Spinner,null)):Object(n.createElement)(f,r()({},e,{search:j,filteredList:y,messages:v,onSelect:C,instanceId:_})))};Object(s.withSpokenMessages)(k)},,function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(33),s=c(3),l=c(4),i=c.n(l);t.a=e=>{let{className:t,item:c,isSelected:o,isLoading:l,onSelect:u,disabled:b,...d}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.a,r()({},d,{key:c.id,className:t,isSelected:o,item:c,onSelect:u,isSingle:!0,disabled:b})),o&&l&&Object(n.createElement)("div",{key:"loading",className:i()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(n.createElement)(s.Spinner,null)))}},function(e,t,c){"use strict";var o=c(0),r=c(6),n=c(1),a=c(3);function s(e){let{level:t}=e;const c={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return c.hasOwnProperty(t)?Object(o.createElement)(a.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(a.Path,{d:c[t]})):null}class l extends o.Component{createLevelControl(e,t,c){const r=e===t;return{icon:Object(o.createElement)(s,{level:e}),title:Object(n.sprintf)(
7
  /* translators: %s: heading level e.g: "2", "3", "4" */
8
- Object(n.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:r,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:n,onChange:l}=this.props;return Object(o.createElement)(a.ToolbarGroup,{isCollapsed:e,icon:Object(o.createElement)(s,{level:n}),controls:Object(r.range)(t,c).map(e=>this.createLevelControl(e,n,l))})}}t.a=l},,function(e,t){e.exports=window.wp.warning},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(43),a=c(122),s=c(2),l=c(7),i=c(29);t.a=e=>{const t=(Object(i.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(o.createElement)(l.InspectorControls,null,Object(o.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(o.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(o.createElement)("a",{href:`${s.ADMIN_URL}post.php?post=${t}&action=edit`,target:"_blank",rel:"noopener noreferrer"},Object(r.__)("Edit this product's details","woo-gutenberg-products-block"),Object(o.createElement)(n.a,{srcElement:a.a,size:16}))),Object(o.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(r.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block")))):null}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(0);const r=()=>{const[,e]=Object(o.useState)();return Object(o.useCallback)(t=>{e(()=>{throw t})},[])}},,,,,function(e,t,c){"use strict";var o=c(2),r=c(1),n=c(62);const a=Object(o.getSetting)("countryLocale",{}),s=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(r.sprintf)(
9
  /* translators: %s Field label. */
10
- Object(r.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(n.a)(e.priority)&&(t.index=e.priority),Object(n.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(a).map(e=>{let[t,c]=e;return[t,Object.entries(c).map(e=>{let[t,c]=e;return[t,s(c)]}).reduce((e,t)=>{let[c,o]=t;return e[c]=o,e},{})]}).reduce((e,t)=>{let[c,o]=t;return e[c]=o,e},{});t.a=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const r=c&&void 0!==l[c]?l[c]:{};return e.map(e=>({key:e,...o.defaultAddressFields[e]||{},...r[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,c){"use strict";var o=c(0);c(161),t.a=()=>Object(o.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},function(e,t){e.exports=window.wp.wordcount},function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(1),s=c(6),l=(c(10),c(33)),i=c(87),u=c(9),b=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{render(){const{selected:t}=this.props,c=null==t;return Object(n.createElement)(e,r()({},this.props,{selected:c?[]:[t]}))}}return t.defaultProps={selected:null},t},"withTransformSingleSelectToMultipleSelect"),d=c(193),m=c(25),p=c.n(m),g=c(26),O=c.n(g),h=c(27),j=c(28),E=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{constructor(){super(...arguments),p()(this,"state",{error:null,loading:!1,variations:{}}),p()(this,"loadVariations",()=>{const{products:e}=this.props,{loading:t,variations:c}=this.state;if(t)return;const o=this.getExpandedProduct();if(!o||c[o])return;const r=e.find(e=>e.id===o);r.variations&&0!==r.variations.length?(this.setState({loading:!0}),Object(h.g)(o).then(e=>{const t=e.map(e=>({...e,parent:o}));this.setState({variations:{...this.state.variations,[o]:t},loading:!1,error:null})}).catch(async e=>{const t=await Object(j.a)(e);this.setState({variations:{...this.state.variations,[o]:null},loading:!1,error:t})})):this.setState({variations:{...this.state.variations,[o]:null},loading:!1,error:null})})}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:c,showVariations:o}=this.props;o&&(!O()(e.selected,c)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some(t=>t.id===e)}findParentProduct(e){const{products:t}=this.props;return t.filter(t=>t.variations&&t.variations.find(t=>{let{id:c}=t;return c===e}))[0].id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:c}=this.props;if(!c)return null;let o=t&&t.length?t[0]:null;return o?this.prevSelectedItem=o:this.prevSelectedItem&&(e||this.isProductId(this.prevSelectedItem)||(o=this.prevSelectedItem)),!e&&o?this.isProductId(o)?o:this.findParentProduct(o):null}render(){const{error:t,isLoading:c}=this.props,{error:o,loading:a,variations:s}=this.state;return Object(n.createElement)(e,r()({},this.props,{error:o||t,expandedProduct:this.getExpandedProduct(),isLoading:c,variations:s,variationsLoading:a}))}}return p()(t,"defaultProps",{selected:[],showVariations:!1}),t},"withProductVariations"),_=c(32),w=c(4),f=c.n(w),k=c(89);c(142);const v={list:Object(a.__)("Products","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(a.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(a.__)("Product search results updated.","woo-gutenberg-products-block")},y=e=>{let{expandedProduct:t,error:c,instanceId:o,isCompact:u,isLoading:b,onChange:d,onSearch:m,products:p,renderItem:g,selected:O,showVariations:h,variations:j,variationsLoading:E}=e;if(c)return Object(n.createElement)(_.a,{error:c});const w=[...p,...j&&j[t]?j[t]:[]];return Object(n.createElement)(i.a,{className:"woocommerce-products",list:w,isCompact:u,isLoading:b,isSingle:!0,selected:w.filter(e=>{let{id:t}=e;return O.includes(t)}),onChange:d,renderItem:g||(h?e=>{const{item:t,search:c,depth:i=0,isSelected:u,onSelect:d}=e,m=t.variations&&Array.isArray(t.variations)?t.variations.length:0,p=f()("woocommerce-search-product__item","woocommerce-search-list__item","depth-"+i,"has-count",{"is-searching":c.length>0,"is-skip-level":0===i&&0!==t.parent,"is-variable":m>0});if(!t.breadcrumbs.length)return Object(n.createElement)(k.a,r()({},e,{className:f()(p,{"is-selected":u}),isSelected:u,item:t,onSelect:()=>()=>{d(t)()},isLoading:b||E,countLabel:t.variations.length>0?Object(a.sprintf)(
11
  /* translators: %1$d is the number of variations of a product product. */
12
  Object(a.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-"+o,"aria-label":Object(a.sprintf)(
13
  /* translators: %1$s is the product name, %2$d is the number of variations of that product. */
14
- Object(a._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));const g=Object(s.isEmpty)(t.variation)?e:{...e,item:{...e.item,name:t.variation},"aria-label":`${t.breadcrumbs[0]}: ${t.variation}`};return Object(n.createElement)(l.a,r()({},g,{className:p,name:"variations-"+o}))}:null),onSearch:m,messages:v,isHierarchical:!0})};y.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=b(Object(d.a)(E(Object(u.withInstanceId)(y))))},function(e,t,c){"use strict";var o=c(0),r=c(18);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=n},,function(e,t,c){"use strict";var o=c(0),r=(c(10),c(4)),n=c.n(r),a=c(30),s=c(9);c(144),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:c,label:r,onChange:s,options:l,screenReaderLabel:i,readOnly:u,value:b}=e;const d="wc-block-components-sort-select__select-"+c;return Object(o.createElement)("div",{className:n()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(o.createElement)(a.a,{label:r,screenReaderLabel:i,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:d}}),Object(o.createElement)("select",{id:d,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,readOnly:u,value:b},l.map(e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label))))})},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(41),a=c(4),s=c.n(a),l=c(35);c(158);const i=e=>{let{currency:t,maxPrice:c,minPrice:a,priceClassName:i,priceStyle:u={}}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(r.sprintf)(
15
  /* translators: %1$s min price, %2$s max price */
16
- Object(r.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(l.formatPrice)(a),Object(l.formatPrice)(c))),Object(o.createElement)("span",{"aria-hidden":!0},Object(o.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:a,style:u})," — ",Object(o.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:a,regularPrice:l,priceClassName:i,priceStyle:u,price:b}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(r.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(n.a,{currency:t,renderText:e=>Object(o.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:a},e),value:l}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(r.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(n.a,{currency:t,renderText:e=>Object(o.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:u},e),value:b}))};t.a=e=>{let{align:t,className:c,currency:r,format:a="<price/>",maxPrice:l,minPrice:b,price:d,priceClassName:m,priceStyle:p,regularPrice:g,regularPriceClassName:O,regularPriceStyle:h}=e;const j=s()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});a.includes("<price/>")||(a="<price/>",console.error("Price formats need to include the `<price/>` tag."));const E=g&&d!==g;let _=Object(o.createElement)("span",{className:s()("wc-block-components-product-price__value",m)});return E?_=Object(o.createElement)(u,{currency:r,price:d,priceClassName:m,priceStyle:p,regularPrice:g,regularPriceClassName:O,regularPriceStyle:h}):void 0!==b&&void 0!==l?_=Object(o.createElement)(i,{currency:r,maxPrice:l,minPrice:b,priceClassName:m,priceStyle:p}):d&&(_=Object(o.createElement)(n.a,{className:s()("wc-block-components-product-price__value",m),currency:r,value:d,style:p})),Object(o.createElement)("span",{className:j},Object(o.createInterpolateElement)(a,{price:_}))}},,function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return s}));var o=c(6);let r;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(r||(r={}));const n={addEventCallback:function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(o.uniqueId)(),type:r.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:c}},removeEventCallback:(e,t)=>({id:t,type:r.REMOVE_EVENT_CALLBACK,eventType:e})},a={},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,{type:t,eventType:c,id:o,callback:n,priority:s}=arguments.length>1?arguments[1]:void 0;const l=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(t){case r.ADD_EVENT_CALLBACK:return l.set(o,{priority:s,callback:n}),{...e,[c]:l};case r.REMOVE_EVENT_CALLBACK:return l.delete(o),{...e,[c]:l}}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(8);function r(e,t){const c=Object(o.useRef)();return Object(o.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},,,,function(e,t,c){"use strict";c.d(t,"b",(function(){return l})),c.d(t,"c",(function(){return i})),c.d(t,"a",(function(){return u}));var o=c(7),r=c(65),n=c(62),a=c(194);const s=e=>Object(n.c)(e)?JSON.parse(e)||{}:Object(n.b)(e)?e:{},l=e=>{if(!Object(r.b)()||!Object(a.a)())return{style:{}};const t=Object(n.b)(e)?e:{},c=s(t.style);return Object(o.__experimentalGetSpacingClassesAndStyles)({...t,style:c})},i=e=>{const t=Object(n.b)(e)?e:{},c=s(t.style),o=Object(n.b)(c.typography)?c.typography:{};return{style:{fontSize:t.fontSize||o.fontSize,lineHeight:o.lineHeight,fontWeight:o.fontWeight,textTransform:o.textTransform,fontFamily:t.fontFamily}}},u=e=>{if(!Object(r.b)())return{className:"",style:{}};const t=Object(n.b)(e)?e:{},c=s(t.style);return Object(o.__experimentalUseColorProps)({...t,style:c})}},function(e,t,c){"use strict";c.d(t,"b",(function(){return l})),c.d(t,"a",(function(){return i}));var o=c(0),r=c(6),n=c(26),a=c.n(n);const s=Object(o.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),l=()=>Object(o.useContext)(s),i=e=>{let{children:t}=e;const[c,n]=Object(o.useState)({}),l=Object(o.useCallback)(e=>c[e],[c]),i=Object(o.useCallback)(e=>{const t=c[e];return!t||t.hidden?"":"validate-error-"+e},[c]),u=Object(o.useCallback)(e=>{n(t=>{if(!t[e])return t;const{[e]:c,...o}=t;return o})},[]),b=Object(o.useCallback)(()=>{n({})},[]),d=Object(o.useCallback)(e=>{e&&n(t=>(e=Object(r.pickBy)(e,(e,c)=>!("string"!=typeof e.message||t.hasOwnProperty(c)&&a()(t[c],e))),0===Object.values(e).length?t:{...t,...e}))},[]),m=Object(o.useCallback)((e,t)=>{n(c=>{if(!c.hasOwnProperty(e))return c;const o={...c[e],...t};return a()(c[e],o)?c:{...c,[e]:o}})},[]),p={getValidationError:l,setValidationErrors:d,clearValidationError:u,clearAllValidationErrors:b,hideValidationError:Object(o.useCallback)(e=>{m(e,{hidden:!0})},[m]),showValidationError:Object(o.useCallback)(e=>{m(e,{hidden:!1})},[m]),showAllValidationErrors:Object(o.useCallback)(()=>{n(e=>{const t={};return Object.keys(e).forEach(c=>{e[c].hidden&&(t[c]={...e[c],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:i};return Object(o.createElement)(s.Provider,{value:p},t)}},function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var o=c(16),r=c(13),n=c(0),a=c(39),s=c(94);const l=e=>{const{namespace:t,resourceName:c,resourceValues:l=[],query:i={},shouldSelect:u=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const b=Object(n.useRef)({results:[],isLoading:!0}),d=Object(a.a)(i),m=Object(a.a)(l),p=Object(s.a)(),g=Object(r.useSelect)(e=>{if(!u)return null;const r=e(o.COLLECTIONS_STORE_KEY),n=[t,c,d,m],a=r.getCollectionError(...n);return a&&p(a),{results:r.getCollection(...n),isLoading:!r.hasFinishedResolution("getCollection",n)}},[t,c,m,d,u]);return null!==g&&(b.current=g),b.current}},,,,,,,function(e,t,c){"use strict";var o=c(0),r=c(18);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(o.createElement)("path",{fill:"#fff",d:"M6.3431 6.3431v1.994l7.8984.0072-8.6055 8.6054 1.4142 1.4143 8.6055-8.6055.0071 7.8984h1.994V6.3431H6.3431z"})),Object(o.createElement)("g",{mask:"url(#external-mask)"},Object(o.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=n},,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(0);const r=Object(o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(o.createElement)("title",null,"Grid Block Preview"),Object(o.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(o.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(o.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(o.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(o.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(o.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(o.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(o.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(o.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(o.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(o.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(o.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(14),s=c(4),l=c.n(s);c(157),t.a=e=>{let{className:t="",disabled:c=!1,name:o,permalink:s="",rel:i,style:u,onClick:b,...d}=e;const m=l()("wc-block-components-product-name",t);if(c){const e=d;return Object(n.createElement)("span",r()({className:m},e,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(o)}}))}return Object(n.createElement)("a",r()({className:m,href:s,rel:i},d,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(o)},style:u}))}},function(e,t,c){"use strict";c.d(t,"b",(function(){return g})),c.d(t,"a",(function(){return O}));var o=c(0),r=(c(10),c(13)),n=c(60),a=c(49),s=c(5),l=c.n(s),i=c(4),u=c.n(i),b=c(488);c(159);const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""};var m=e=>{let{className:t,notices:c,removeNotice:r}=e;const n=c.filter(e=>"snackbar"!==e.type);if(!n.length)return null;const a=u()(t,"wc-block-components-notices");return Object(o.createElement)("div",{className:a},n.map(e=>Object(o.createElement)(b.a,l()({key:"store-notice-"+e.id},e,{className:u()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&r(e.id)}}),e.content)))};const p=Object(o.createContext)({notices:[],createNotice:(e,t,c)=>{},removeNotice:(e,t)=>{},setIsSuppressed:e=>{},context:"wc/core"}),g=()=>Object(o.useContext)(p),O=e=>{let{children:t,className:c="",createNoticeContainer:s=!0,context:l="wc/core"}=e;const{createNotice:i,removeNotice:u}=Object(r.useDispatch)("core/notices"),[b,d]=Object(o.useState)(!1),{dispatchStoreEvent:g}=Object(n.a)(),{isEditor:O}=Object(a.b)(),h=Object(o.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i(e,t,{...c,context:c.context||l}),g("store-notice-create",{status:e,content:t,options:c})}),[i,g,l]),j=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;u(e,t)}),[u,l]),{notices:E}=Object(r.useSelect)(e=>({notices:e("core/notices").getNotices(l)}),[l]),_={notices:E,createNotice:h,removeNotice:j,context:l,setIsSuppressed:d},w=b?null:Object(o.createElement)(m,{className:c,notices:_.notices,removeNotice:_.removeNotice,isEditor:O});return Object(o.createElement)(p.Provider,{value:_},s&&w,t)}},function(e,t,c){"use strict";var o=c(0),r=c(101),n=c(76);const a=e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},s=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),l=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,i=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;";const o=s(e),r=o.split(" ").splice(0,t).join(" ");return Object(n.autop)(l(r,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;";const r=s(e),a=r.slice(0,t);if(c)return Object(n.autop)(l(a,o));const i=a.match(/([\s]+)/g),u=i?i.length:0,b=r.slice(0,t+u);return Object(n.autop)(l(b,o))};t.a=e=>{let{source:t,maxLength:c=15,countType:s="words",className:l="",style:b={}}=e;const d=Object(o.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const o=Object(n.autop)(e),s=Object(r.count)(o,c);if(s<=t)return o;const l=a(o),b=Object(r.count)(l,c);return b<=t?l:"words"===c?i(l,t):u(l,t,"characters_including_spaces"===c)}(t,c,s),[t,c,s]);return Object(o.createElement)(o.RawHTML,{style:b,className:l},d)}},,,,,,,,,function(e,t){},,function(e,t){},,function(e,t){},,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));const o=e=>e.reduce((e,t)=>{let[c,o]=t;return e[c]=o,e},{})},,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(24),s=c(27),l=c(118),i=c(28);t.a=e=>t=>{let{selected:c,...o}=t;const[u,b]=Object(n.useState)(!0),[d,m]=Object(n.useState)(null),[p,g]=Object(n.useState)([]),O=a.o.productCount>100,h=async e=>{const t=await Object(i.a)(e);m(t),b(!1)},j=Object(n.useRef)(c);Object(n.useEffect)(()=>{Object(s.h)({selected:j.current}).then(e=>{g(e),b(!1)}).catch(h)},[j]);const E=Object(l.a)(e=>{Object(s.h)({selected:c,search:e}).then(e=>{g(e),b(!1)}).catch(h)},400),_=Object(n.useCallback)(e=>{b(!0),E(e)},[b,E]);return Object(n.createElement)(e,r()({},o,{selected:c,error:d,products:p,isLoading:u,onSearch:O?_:null}))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(7);const r=()=>"function"==typeof o.__experimentalGetSpacingClassesAndStyles},function(e,t,c){"use strict";c.r(t);var o=c(0),r=(c(10),c(1)),n=c(4),a=c.n(n),s=c(30),l=c(29),i=c(54);c(302),t.default=Object(i.withProductDataContext)(e=>{let{className:t,align:c}=e;const{parentClassName:n}=Object(l.useInnerBlockLayoutContext)(),{product:i}=Object(l.useProductDataContext)();if(!i.id||!i.on_sale)return null;const u="string"==typeof c?"wc-block-components-product-sale-badge--align-"+c:"";return Object(o.createElement)("div",{className:a()("wc-block-components-product-sale-badge",t,u,{[n+"__product-onsale"]:n})},Object(o.createElement)(s.a,{label:Object(r.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(r.__)("Product on sale","woo-gutenberg-products-block")}))})},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(0),r=(c(10),c(114));c(162);const n=e=>{let{errorMessage:t="",propertyName:c="",elementId:n=""}=e;const{getValidationError:a,getValidationErrorId:s}=Object(r.b)();if(!t||"string"!=typeof t){const e=a(c)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(o.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(o.createElement)("p",{id:s(n)},t))}},,,,,,,,,,,,,function(e,t,c){"use strict";var o=c(0),r=c(18);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M11 17h2v-1h1c.55 0 1-.45 1-1v-3c0-.55-.45-1-1-1h-3v-1h4V8h-2V7h-2v1h-1c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h3v1H9v2h2v1zm9-13H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4V6h16v12z"}));t.a=n},function(e,t,c){"use strict";var o=c(0),r=c(18);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=n},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t,c){"use strict";var o=c(65);let r={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(o.b)()&&(r={...r,align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}}),t.a=r},function(e,t,c){"use strict";var o=c(0),r=c(4),n=c.n(r),a=c(29),s=c(65),l=c(54),i=c(129),u=c(60),b=(c(301),c(113));const d=e=>{let{children:t,headingLevel:c,elementType:r="h"+c,...n}=e;return Object(o.createElement)(r,n,t)};t.a=Object(l.withProductDataContext)(e=>{const{className:t,headingLevel:c=2,showProductLink:r=!0,align:l}=e,{parentClassName:m}=Object(a.useInnerBlockLayoutContext)(),{product:p}=Object(a.useProductDataContext)(),{dispatchStoreEvent:g}=Object(u.a)(),O=Object(b.a)(e),h=Object(b.b)(e),j=Object(b.c)(e);return p.id?Object(o.createElement)(d,{headingLevel:c,className:n()(t,O.className,"wc-block-components-product-title",{[m+"__product-title"]:m,["wc-block-components-product-title--align-"+l]:l&&Object(s.b)()}),style:Object(s.b)()?{...h.style,...j.style,...O.style}:{}},Object(o.createElement)(i.a,{disabled:!r,name:p.name,permalink:p.permalink,rel:r?"nofollow":"",onClick:()=>{g("product-view-link",{product:p})}})):Object(o.createElement)(d,{headingLevel:c,className:n()(t,O.className,"wc-block-components-product-title",{[m+"__product-title"]:m,["wc-block-components-product-title--align-"+l]:l&&Object(s.b)()}),style:Object(s.b)()?{...h.style,...j.style,...O.style}:{}})})},function(e,t,c){"use strict";c.d(t,"b",(function(){return a})),c.d(t,"a",(function(){return s}));const o=window.CustomEvent||null,r=(e,t)=>{let{bubbles:c=!1,cancelable:r=!1,element:n,detail:a={}}=t;if(!o)return;n||(n=document.body);const s=new o(e,{bubbles:c,cancelable:r,detail:a});n.dispatchEvent(s)};let n;const a=()=>{n&&clearTimeout(n),n=setTimeout(()=>{r("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},s=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const n=()=>{r(t,{bubbles:c,cancelable:o})};return jQuery(document).on(e,n),()=>jQuery(document).off(e,n)}},function(e,t,c){"use strict";c.d(t,"b",(function(){return a})),c.d(t,"c",(function(){return s})),c.d(t,"a",(function(){return l}));var o=c(2),r=c(99),n=c(15);const a=e=>{let{country:t="",state:c="",city:o="",postcode:r=""}=e;return{country:t.trim(),state:c.trim(),city:o.trim(),postcode:r?r.replace(" ","").toUpperCase():""}},s=e=>{let{email:t=""}=e;return Object(n.isEmail)(t)?t.trim():""},l=e=>{const t=Object.keys(o.defaultAddressFields),c=Object(r.a)(t,{},e.country),n=Object.assign({},e);return c.forEach(t=>{let{key:c="",hidden:o=!1}=t;o&&((e,t)=>e in t)(c,e)&&(n[c]="")}),n}},function(e,t,c){"use strict";t.a={showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=(c(10),c(1)),s=c(4),l=c.n(s),i=c(2),u=c(29),b=c(54),d=c(60),m=c(195);c(303);const p=()=>Object(n.createElement)("img",{src:i.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),g=e=>{let{image:t,onLoad:c,loaded:o,showFullSize:a,fallbackAlt:s}=e;const{thumbnail:l,src:i,srcset:u,sizes:b,alt:d}=t||{},m={alt:d||s,onLoad:c,hidden:!o,src:l,...a&&{src:i,srcSet:u,sizes:b}};return Object(n.createElement)(n.Fragment,null,m.src&&Object(n.createElement)("img",r()({"data-testid":"product-image"},m)),!o&&Object(n.createElement)(p,null))};t.a=Object(b.withProductDataContext)(e=>{let{className:t,imageSizing:c="full-size",showProductLink:o=!0,showSaleBadge:r,saleBadgeAlign:s="right"}=e;const{parentClassName:i}=Object(u.useInnerBlockLayoutContext)(),{product:b}=Object(u.useProductDataContext)(),[O,h]=Object(n.useState)(!1),{dispatchStoreEvent:j}=Object(d.a)();if(!b.id)return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",{[i+"__product-image"]:i})},Object(n.createElement)(p,null));const E=!!b.images.length,_=E?b.images[0]:null,w=o?"a":n.Fragment,f=Object(a.sprintf)(
17
  /* translators: %s is referring to the product name */
18
- Object(a.__)("Link to %s","woo-gutenberg-products-block"),b.name),k={href:b.permalink,rel:"nofollow",...!E&&{"aria-label":f},onClick:()=>{j("product-view-link",{product:b})}};return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image",{[i+"__product-image"]:i})},Object(n.createElement)(w,o&&k,!!r&&Object(n.createElement)(m.default,{align:s,product:b}),Object(n.createElement)(g,{fallbackAlt:b.name,image:_,onLoad:()=>h(!0),loaded:O,showFullSize:"cropped"!==c})))})},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(108);const r=(e,t)=>function(c){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=o.a.addEventCallback(e,c,r);return t(n),()=>{t(o.a.removeEventCallback(e,n.id))}}},function(e,t,c){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},function(e,t,c){"use strict";var o=c(0),r=(c(10),c(4)),n=c.n(r),a=c(1),s=c(39),l=c(478);const i={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},u={status:i.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},b={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:d,SET_IDLE:m,SET_DISABLED:p,SET_PROCESSING:g,SET_BEFORE_PROCESSING:O,SET_AFTER_PROCESSING:h,SET_PROCESSING_RESPONSE:j,SET_HAS_ERROR:E,SET_NO_ERROR:_,SET_QUANTITY:w,SET_REQUEST_PARAMS:f}=b,k=()=>({type:m}),v=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?E:_;return{type:t}},{SET_PRISTINE:y,SET_IDLE:S,SET_DISABLED:C,SET_PROCESSING:x,SET_BEFORE_PROCESSING:N,SET_AFTER_PROCESSING:P,SET_PROCESSING_RESPONSE:T,SET_HAS_ERROR:R,SET_NO_ERROR:I,SET_QUANTITY:A,SET_REQUEST_PARAMS:B}=b,{PRISTINE:L,IDLE:V,DISABLED:z,PROCESSING:D,BEFORE_PROCESSING:F,AFTER_PROCESSING:M}=i,H=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,{quantity:c,type:o,data:r}=arguments.length>1?arguments[1]:void 0;switch(o){case y:e=u;break;case S:e=t.status!==V?{...t,status:V}:t;break;case C:e=t.status!==z?{...t,status:z}:t;break;case A:e=c!==t.quantity?{...t,quantity:c}:t;break;case B:e={...t,requestParams:{...t.requestParams,...r}};break;case T:e={...t,processingResponse:r};break;case x:e=t.status!==D?{...t,status:D,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case N:e=t.status!==F?{...t,status:F,hasError:!1}:t;break;case P:e=t.status!==M?{...t,status:M}:t;break;case R:e=t.hasError?t:{...t,hasError:!0},e=t.status===D||t.status===F?{...e,status:V}:e;break;case I:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&o!==y&&e.status===L&&(e.status=V),e};var G=c(108),q=c(255);const Q=e=>({onAddToCartAfterProcessingWithSuccess:Object(q.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(q.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(q.a)("add_to_cart_before_processing",e)});var Y=c(258),U=c(114),$=c(47),W=c(44);const K=Object(o.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),J=()=>Object(o.useContext)(K),X=e=>{var t,c,r,n;let{children:b,product:m,showFormElements:E}=e;const[_,y]=Object(o.useReducer)(H,u),[S,C]=Object(o.useReducer)(G.b,{}),x=Object(s.a)(S),{addErrorNotice:N,removeNotices:P}=Object($.a)(),{setValidationErrors:T}=Object(U.b)(),{isSuccessResponse:R,isErrorResponse:I,isFailResponse:A}=Object(W.c)(),B=Object(o.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:Q(C).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Q(C).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Q(C).onAddToCartBeforeProcessing}),[C]),L=Object(o.useMemo)(()=>({resetForm:()=>{y({type:d})},submitForm:()=>{y({type:O})},setQuantity:e=>{y((e=>({type:w,quantity:e}))(e))},setHasError:e=>{y(v(e))},setRequestParams:e=>{y((e=>({type:f,data:e}))(e))},setAfterProcessing:e=>{y({type:j,data:e}),y({type:h})}}),[]);Object(o.useEffect)(()=>{const e=_.status,t=!m.id||!Object(l.a)(m);e!==i.DISABLED||t?e!==i.DISABLED&&t&&y({type:p}):y(k())},[_.status,m,y]),Object(o.useEffect)(()=>{_.status===i.BEFORE_PROCESSING&&(P("error"),Object(Y.a)(x,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:c}=e;t&&N(t),c&&T(c)}),y(k())):y({type:g})}))},[_.status,T,N,P,y,x]),Object(o.useEffect)(()=>{if(_.status===i.AFTER_PROCESSING){const e={processingResponse:_.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:c,messageContext:o}=e;(I(e)||A(e))&&c&&(t=!0,N(c,o?{context:o}:void 0))}),t};if(_.hasError)return void Object(Y.b)(x,"add_to_cart_after_processing_with_error",e).then(c=>{if(!t(c)){var o;const t=(null===(o=e.processingResponse)||void 0===o?void 0:o.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");N(t,{id:"add-to-cart"})}y(k())});Object(Y.b)(x,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?y(v(!0)):y(k())})}},[_.status,_.hasError,_.processingResponse,L,N,I,A,R,x]);const V=Object(l.b)(m),z={product:m,productType:m.type||"simple",productIsPurchasable:Object(l.a)(m),productHasOptions:m.has_options||!1,supportsFormElements:V,showFormElements:E&&V,quantity:_.quantity||(null==m||null===(t=m.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==m||null===(c=m.add_to_cart)||void 0===c?void 0:c.minimum)||1,maxQuantity:(null==m||null===(r=m.add_to_cart)||void 0===r?void 0:r.maximum)||99,multipleOf:(null==m||null===(n=m.add_to_cart)||void 0===n?void 0:n.multiple_of)||1,requestParams:_.requestParams,isIdle:_.status===i.IDLE,isDisabled:_.status===i.DISABLED,isProcessing:_.status===i.PROCESSING,isBeforeProcessing:_.status===i.BEFORE_PROCESSING,isAfterProcessing:_.status===i.AFTER_PROCESSING,hasError:_.hasError,eventRegistration:B,dispatchActions:L};return Object(o.createElement)(K.Provider,{value:z},b)};var Z=c(11),ee=c.n(Z),te=c(14),ce=c(36),oe=()=>{const{dispatchActions:e,product:t,quantity:c,eventRegistration:r,hasError:n,isProcessing:s,requestParams:l}=J(),{hasValidationErrors:i,showAllValidationErrors:u}=Object(U.b)(),{addErrorNotice:b,removeNotice:d}=Object($.a)(),{receiveCart:m}=Object(ce.a)(),[p,g]=Object(o.useState)(!1),O=!n&&s,h=Object(o.useCallback)(()=>!i||(u(),{type:"error"}),[i,u]);Object(o.useEffect)(()=>{const e=r.onAddToCartBeforeProcessing(h,0);return()=>{e()}},[r,h]);const j=Object(o.useCallback)(()=>{g(!0),d("add-to-cart");const o={id:t.id||0,quantity:c,...l};ee()({path:"/wc/store/cart/add-item",method:"POST",data:o,cache:"no-store",parse:!1}).then(t=>{ee.a.setNonce(t.headers),t.json().then((function(c){t.ok?m(c):(c.body&&c.body.message?b(Object(te.decodeEntities)(c.body.message),{id:"add-to-cart"}):b(Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),e.setHasError()),e.setAfterProcessing(c),g(!1)}))}).catch(t=>{t.json().then((function(t){var c;null!==(c=t.data)&&void 0!==c&&c.cart&&m(t.data.cart),e.setHasError(),e.setAfterProcessing(t),g(!1)}))})},[t,b,d,m,e,c,l]);return Object(o.useEffect)(()=>{O&&!p&&j()},[O,j,p]),null};const re=e=>{let{children:t,product:c,showFormElements:r}=e;return Object(o.createElement)(U.a,null,Object(o.createElement)(X,{product:c,showFormElements:r},t,Object(o.createElement)(oe,null)))};var ne=c(29),ae=c(6),se=c(54),le=(c(248),c(80)),ie=c(43),ue=c(312),be=c(60),de=c(360);const me=e=>{let{className:t,href:c,text:r,onClick:n}=e;return Object(o.createElement)(le.a,{className:t,href:c,onClick:n,rel:"nofollow"},r)},pe=e=>{let{className:t,quantityInCart:c,isProcessing:r,isDisabled:n,isDone:s,onClick:l}=e;return Object(o.createElement)(le.a,{className:t,disabled:n,showSpinner:r,onClick:l},s&&c>0?Object(a.sprintf)(
19
  /* translators: %s number of products in cart. */
20
- Object(a._n)("%d in cart","%d in cart",c,"woo-gutenberg-products-block"),c):Object(a.__)("Add to cart","woo-gutenberg-products-block"),!!s&&Object(o.createElement)(ie.a,{srcElement:ue.a,alt:Object(a.__)("Done","woo-gutenberg-products-block")}))};var ge=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:c,product:r,productType:n,isDisabled:s,isProcessing:l,eventRegistration:i,hasError:u,dispatchActions:b}=J(),{parentName:d}=Object(ne.useInnerBlockLayoutContext)(),{dispatchStoreEvent:m}=Object(be.a)(),{cartQuantity:p}=Object(de.a)(r.id||0),[g,O]=Object(o.useState)(!1),h=r.add_to_cart||{url:"",text:""};return Object(o.useEffect)(()=>{const e=i.onAddToCartAfterProcessingWithSuccess(()=>(u||O(!0),!0),0);return()=>{e()}},[i,u]),(e||!c&&"simple"===n)&&t?Object(o.createElement)(pe,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:p,isDisabled:s,isProcessing:l,isDone:g,onClick:()=>{b.submitForm(),m("cart-add-item",{product:r,listName:d})}}):Object(o.createElement)(me,{className:"wc-block-components-product-add-to-cart-button",href:h.url,text:h.text||Object(a.__)("View Product","woo-gutenberg-products-block"),onClick:()=>{m("product-view-link",{product:r,listName:d})}})},Oe=c(118),he=e=>{let{disabled:t,min:c,max:r,step:n=1,value:a,onChange:s}=e;const l=void 0!==r,i=Object(Oe.a)(e=>{let t=e;l&&(t=Math.min(t,Math.floor(r/n)*n)),t=Math.max(t,Math.ceil(c/n)*n),t=Math.floor(t/n)*n,t!==e&&s(t)},300);return Object(o.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:a,min:c,max:r,step:n,hidden:1===r,disabled:t,onChange:e=>{s(e.target.value),i(e.target.value)}})},je=e=>{let{reason:t=Object(a.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block")}=e;return Object(o.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},Ee=()=>{const{product:e,quantity:t,minQuantity:c,maxQuantity:r,multipleOf:n,dispatchActions:s,isDisabled:l}=J();return e.id&&!e.is_purchasable?Object(o.createElement)(je,null):e.id&&!e.is_in_stock?Object(o.createElement)(je,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(he,{value:t,min:c,max:r,step:n,disabled:l,onChange:s.setQuantity}),Object(o.createElement)(ge,null))},_e=(c(311),c(499)),we=c(8),fe=c(196);const ke={value:"",label:Object(a.__)("Select an option","woo-gutenberg-products-block")};var ve=e=>{let{attributeName:t,options:c=[],value:r="",onChange:s=(()=>{}),errorMessage:l=Object(a.__)("Please select a value.","woo-gutenberg-products-block")}=e;const{getValidationError:i,setValidationErrors:u,clearValidationError:b}=Object(U.b)(),d=t,m=i(d)||{};return Object(we.useEffect)(()=>{r?b(d):u({[d]:{message:l,hidden:!0}})},[r,d,l,b,u]),Object(we.useEffect)(()=>()=>{b(d)},[d,b]),Object(o.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(o.createElement)(_e.a,{label:Object(te.decodeEntities)(t),value:r||"",options:[ke,...c],onChange:s,required:!0,className:n()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":m.message&&!m.hidden})}),Object(o.createElement)(fe.a,{propertyName:d,elementId:d}))},ye=c(62);const Se=(e,t,c)=>{const o=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(c).every(e=>""===e))return o;const r=Object.keys(e);return o.filter(e=>r.every(o=>{const r=c[o]||"",n=t["id:"+e].attributes[o];return""===r||null===n||n===r}))};var Ce=e=>{let{attributes:t,variationAttributes:c,setRequestParams:r}=e;const n=Object(s.a)(t),a=Object(s.a)(c),[l,i]=Object(o.useState)(0),[u,b]=Object(o.useState)({}),[d,m]=Object(o.useState)(!1),p=Object(o.useMemo)(()=>((e,t,c)=>{const o={},r=Object.keys(e),n=Object.values(c).filter(Boolean).length>0;return r.forEach(r=>{const a=e[r],s={...c,[r]:null},l=n?Se(e,t,s):null,i=null!==l?l.map(e=>t["id:"+e].attributes[r]):null;o[r]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:c,slug:o}=e;return null===t||t.includes(null)||t.includes(o)?{value:o,label:Object(te.decodeEntities)(c)}:null}).filter(Boolean)}(a.terms,i)}),o})(n,a,u),[u,n,a]);return Object(o.useEffect)(()=>{if(!d){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(ye.b)(e))return{};const t=Object.keys(e),c={};return 0===t.length||t.forEach(t=>{const o=e[t],r=o.terms.filter(e=>e.default);var n;r.length>0&&(c[o.name]=null===(n=r[0])||void 0===n?void 0:n.slug)}),c}(t);e&&b({...e}),m(!0)}},[u,t,d]),Object(o.useEffect)(()=>{Object.values(u).filter(e=>""!==e).length===Object.keys(n).length?i(((e,t,c)=>Se(e,t,c)[0]||0)(n,a,u)):l>0&&i(0)},[u,l,n,a]),Object(o.useEffect)(()=>{r({id:l,variation:Object.keys(u).map(e=>({attribute:e,value:u[e]}))})},[r,l,u]),Object(o.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(n).map(e=>Object(o.createElement)(ve,{key:e,attributeName:e,options:p[e],value:u[e],onChange:t=>{b({...u,[e]:t})}})))},xe=e=>{let{product:t,dispatchers:c}=e;const r=(e=>e?Object(ae.keyBy)(Object.values(e).filter(e=>{let{has_variations:t}=e;return t}),"name"):{})(t.attributes),n=(e=>{if(!e)return{};const t={};return e.forEach(e=>{let{id:c,attributes:o}=e;t["id:"+c]={id:c,attributes:o.reduce((e,t)=>{let{name:c,value:o}=t;return e[c]=o,e},{})}}),t})(t.variations);return 0===Object.keys(r).length||0===n.length?null:Object(o.createElement)(Ce,{attributes:r,variationAttributes:n,setRequestParams:c.setRequestParams})},Ne=()=>{const{product:e,quantity:t,minQuantity:c,maxQuantity:r,multipleOf:n,dispatchActions:s,isDisabled:l}=J();return e.id&&!e.is_purchasable?Object(o.createElement)(je,null):e.id&&!e.is_in_stock?Object(o.createElement)(je,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(xe,{product:e,dispatchers:s}),Object(o.createElement)(he,{value:t,min:c,max:r,step:n,disabled:l,onChange:s.setQuantity}),Object(o.createElement)(ge,null))},Pe=()=>Object(o.createElement)(ge,null),Te=c(490),Re=()=>Object(o.createElement)(Te.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element."),Ie=()=>Object(o.createElement)(Re,null);const Ae=()=>{const{showFormElements:e,productType:t}=J();return e?"variable"===t?Object(o.createElement)(Ne,null):"grouped"===t?Object(o.createElement)(Ie,null):"external"===t?Object(o.createElement)(Pe,null):"simple"===t||"variation"===t?Object(o.createElement)(Ee,null):null:Object(o.createElement)(ge,null)};t.a=Object(se.withProductDataContext)(e=>{let{className:t,showFormElements:c}=e;const{product:r}=Object(ne.useProductDataContext)(),a=n()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(ae.isEmpty)(r)});return Object(o.createElement)(re,{product:r,showFormElements:c},Object(o.createElement)("div",{className:a},Object(o.createElement)(Ae,null)))})},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return a}));const o=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var r=c(44);const n=async(e,t,c)=>{const r=o(e,t),n=[];for(const e of r)try{const t=await Promise.resolve(e.callback(c));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n},a=async(e,t,c)=>{const n=[],a=o(e,t);for(const e of a)try{const t=await Promise.resolve(e.callback(c));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(r.a)(t)||Object(r.b)(t))return n.push(t),n;n.push(t)}catch(e){return console.error(e),n.push({type:"error"}),n}return n}},,,,,function(e,t,c){"use strict";c.r(t);var o=c(0),r=(c(10),c(4)),n=c.n(r),a=c(106),s=c(35),l=c(29),i=c(7),u=c(65),b=c(54);t.default=Object(b.withProductDataContext)(e=>{var t,c;let{className:r,align:b,fontSize:d,customFontSize:m,saleFontSize:p,customSaleFontSize:g,color:O,customColor:h,saleColor:j,customSaleColor:E}=e;const{parentClassName:_}=Object(l.useInnerBlockLayoutContext)(),{product:w}=Object(l.useProductDataContext)(),f=n()(r,{[_+"__product-price"]:_});if(!w.id)return Object(o.createElement)(a.a,{align:b,className:f});const k=Object(i.getColorClassName)("color",O),v=Object(i.getFontSizeClass)(d),y=Object(i.getColorClassName)("color",j),S=Object(i.getFontSizeClass)(p),C=n()({"has-text-color":O||h,"has-font-size":d||m,[k]:k,[v]:v}),x=n()({"has-text-color":j||E,"has-font-size":p||g,[y]:y,[S]:S}),N={color:h,fontSize:m},P={color:E,fontSize:g},T=w.prices,R=Object(s.getCurrencyFromPriceResponse)(T),I=T.price!==T.regular_price,A=I?n()({[_+"__product-price__value"]:_,[x]:Object(u.b)()}):n()({[_+"__product-price__value"]:_,[C]:Object(u.b)()}),B=I?P:N;return Object(o.createElement)(a.a,{align:b,className:f,currency:R,price:T.price,priceClassName:A,priceStyle:Object(u.b)()?B:{},minPrice:null==T||null===(t=T.price_range)||void 0===t?void 0:t.min_amount,maxPrice:null==T||null===(c=T.price_range)||void 0===c?void 0:c.max_amount,regularPrice:T.regular_price,regularPriceClassName:n()({[_+"__product-price__regular"]:_,[C]:Object(u.b)()}),regularPriceStyle:Object(u.b)()?N:{}})})},function(e,t,c){"use strict";c.r(t);var o=c(0),r=(c(10),c(1)),n=c(4),a=c.n(n),s=c(29),l=c(54);c(304);t.default=Object(l.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(n);if(!l)return null;const i={width:l/5*100+"%"},u=Object(r.sprintf)(
21
  /* translators: %f is referring to the average rating value */
22
  Object(r.__)("Rated %f out of 5","woo-gutenberg-products-block"),l),b=(e=>{const t=parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(n),d={__html:Object(r.sprintf)(
23
  /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
24
- Object(r._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",b,"woo-gutenberg-products-block"),Object(r.sprintf)('<strong class="rating">%f</strong>',l),Object(r.sprintf)('<span class="rating">%d</span>',b))};return Object(o.createElement)("div",{className:a()(t,"wc-block-components-product-rating",{[c+"__product-rating"]:c})},Object(o.createElement)("div",{className:a()("wc-block-components-product-rating__stars",c+"__product-rating__stars"),role:"img","aria-label":u},Object(o.createElement)("span",{style:i,dangerouslySetInnerHTML:d})))})},function(e,t,c){"use strict";c.r(t);var o=c(5),r=c.n(o),n=c(0),a=(c(10),c(4)),s=c.n(a),l=c(1),i=c(60),u=c(360),b=c(14),d=c(29),m=c(54);c(305);const p=e=>{let{product:t}=e;const{id:c,permalink:o,add_to_cart:a,has_options:d,is_purchasable:m,is_in_stock:p}=t,{dispatchStoreEvent:g}=Object(i.a)(),{cartQuantity:O,addingToCart:h,addToCart:j}=Object(u.a)(c),E=Number.isFinite(O)&&O>0,_=!d&&m&&p,w=Object(b.decodeEntities)((null==a?void 0:a.description)||""),f=E?Object(l.sprintf)(
25
  /* translators: %s number of products in cart. */
26
- Object(l._n)("%d in cart","%d in cart",O,"woo-gutenberg-products-block"),O):Object(b.decodeEntities)((null==a?void 0:a.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),k=_?"button":"a",v={};return _?v.onClick=()=>{j(),g("cart-add-item",{product:t})}:(v.href=o,v.rel="nofollow",v.onClick=()=>{g("product-view-link",{product:t})}),Object(n.createElement)(k,r()({"aria-label":w,className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:h,added:E}),disabled:h},v),f)},g=()=>Object(n.createElement)("button",{className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0});t.default=Object(m.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(d.useInnerBlockLayoutContext)(),{product:o}=Object(d.useProductDataContext)();return Object(n.createElement)("div",{className:s()(t,"wp-block-button","wc-block-components-product-button",{[c+"__product-add-to-cart"]:c})},o.id?Object(n.createElement)(p,{product:o}):Object(n.createElement)(g,null))})},function(e,t,c){"use strict";c.r(t);var o=c(0),r=(c(10),c(4)),n=c.n(r),a=c(131),s=c(24),l=c(29),i=c(54),u=(c(306),c(113));t.default=Object(i.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(l.useInnerBlockLayoutContext)(),{product:r}=Object(l.useProductDataContext)(),i=Object(u.a)(e),b=Object(u.c)(e);if(!r)return Object(o.createElement)("div",{className:n()(t,"wc-block-components-product-summary",{[c+"__product-summary"]:c})});const d=r.short_description?r.short_description:r.description;return d?Object(o.createElement)(a.a,{className:n()(t,i.className,"wc-block-components-product-summary",{[c+"__product-summary"]:c}),source:d,maxLength:150,countType:s.o.wordCountType||"words",style:{...i.style,...b.style}}):null})},function(e,t,c){"use strict";c.r(t);var o=c(0),r=c(1),n=(c(10),c(4)),a=c.n(n),s=c(29),l=c(54);c(307),t.default=Object(l.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=n.sku;return l?Object(o.createElement)("div",{className:a()(t,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(r.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,l)):null})},function(e,t,c){"use strict";c.r(t);var o=c(0),r=c(1),n=c(4),a=c.n(n),s=c(29),l=c(6),i=c(54);c(308),t.default=Object(i.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)();return Object(l.isEmpty)(n.categories)?null:Object(o.createElement)("div",{className:a()(t,"wc-block-components-product-category-list",{[c+"__product-category-list"]:c})},Object(r.__)("Categories:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.categories).map(e=>{let{name:t,link:c,slug:r}=e;return Object(o.createElement)("li",{key:"category-list-item-"+r},Object(o.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var o=c(0),r=c(1),n=(c(10),c(4)),a=c.n(n),s=c(29),l=c(6),i=c(54);c(309),t.default=Object(i.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)();return Object(l.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:a()(t,"wc-block-components-product-tag-list",{[c+"__product-tag-list"]:c})},Object(r.__)("Tags:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.tags).map(e=>{let{name:t,link:c,slug:r}=e;return Object(o.createElement)("li",{key:"tag-list-item-"+r},Object(o.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var o=c(0),r=c(1),n=(c(10),c(4)),a=c.n(n),s=c(29),l=c(54),i=(c(310),c(113));t.default=Object(l.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=Object(i.a)(e),u=Object(i.c)(e);if(!n.id||!n.is_purchasable)return null;const b=!!n.is_in_stock,d=n.low_stock_remaining,m=n.is_on_backorder;return Object(o.createElement)("div",{className:a()(t,l.className,"wc-block-components-product-stock-indicator",{[c+"__stock-indicator"]:c,"wc-block-components-product-stock-indicator--in-stock":b,"wc-block-components-product-stock-indicator--out-of-stock":!b,"wc-block-components-product-stock-indicator--low-stock":!!d,"wc-block-components-product-stock-indicator--available-on-backorder":!!m}),style:{...l.style,...u.style}},d?(e=>Object(r.sprintf)(
27
  /* translators: %d stock amount (number of items in stock for product) */
28
- Object(r.__)("%d left in stock","woo-gutenberg-products-block"),e))(d):((e,t)=>t?Object(r.__)("Available on backorder","woo-gutenberg-products-block"):e?Object(r.__)("In Stock","woo-gutenberg-products-block"):Object(r.__)("Out of Stock","woo-gutenberg-products-block"))(b,m))})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,c){"use strict";var o=c(0),r=c(18);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(o.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=n},,,,,,,,,,,,,,,,function(e,t,c){"use strict";var o=c(0),r=c(18);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"}));t.a=n},,,,,,,function(e,t,c){"use strict";var o=c(0),r=c(18);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58s1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41s-.23-1.06-.59-1.42zM13 20.01L4 11V4h7v-.01l9 9-7 7.02z"}),Object(o.createElement)("circle",{cx:"6.5",cy:"6.5",r:"1.5"}),Object(o.createElement)("path",{d:"M8.9 12.55c0 .57.23 1.07.6 1.45l3.5 3.5 3.5-3.5c.37-.37.6-.89.6-1.45 0-1.13-.92-2.05-2.05-2.05-.57 0-1.08.23-1.45.6l-.6.6-.6-.59c-.37-.38-.89-.61-1.45-.61-1.13 0-2.05.92-2.05 2.05z"}));t.a=n},,,,,,,,function(e,t,c){"use strict";var o=c(0),r=c(18);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}));t.a=n},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(1),r=c(24);const n=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(o.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>7.99</span>',images:[{id:1,src:r.m+"previews/pennant.jpg",thumbnail:r.m+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:Object(o.__)("Add to cart","woo-gutenberg-products-block"),description:Object(o.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},,,,,function(e,t,c){"use strict";var o=c(0),r=c(18);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));t.a=n},,,,,,,function(e,t,c){e.exports=c(440)},function(e,t){},function(e,t){},function(e,t){},function(e,t,c){"use strict";c.d(t,"a",(function(){return u}));var o=c(0),r=c(13),n=c(16),a=c(14),s=c(36),l=c(47);const i=(e,t)=>{const c=e.find(e=>{let{id:c}=e;return c===t});return c?c.quantity:0},u=e=>{const{addItemToCart:t}=Object(r.useDispatch)(n.CART_STORE_KEY),{cartItems:c,cartIsLoading:u}=Object(s.a)(),{addErrorNotice:b,removeNotice:d}=Object(l.a)(),[m,p]=Object(o.useState)(!1),g=Object(o.useRef)(i(c,e));return Object(o.useEffect)(()=>{const t=i(c,e);t!==g.current&&(g.current=t)},[c,e]),{cartQuantity:Number.isFinite(g.current)?g.current:0,addingToCart:m,cartIsLoading:u,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return p(!0),t(e,c).then(()=>{d("add-to-cart")}).catch(e=>{b(Object(a.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})}).finally(()=>{p(!1)})}}}},function(e,t,c){"use strict";var o=c(0),r=c(18);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},Object(o.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(o.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",d:"M2 .75h12c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"}),Object(o.createElement)("path",{fill:"currentColor",d:"M12 6H4V4.75h8zM12 9H4V7.75h8zM10 12H4v-1.25h6z"})));t.a=n},function(e,t){},,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.r(t),c.d(t,"blockSettings",(function(){return zt}));var o=c(5),r=c.n(o),n=c(0),a=c(1),s=c(7),l=c(12),i=c(43),u=c(18),b=Object(n.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"})),d=c(65),m=c(4),p=c.n(m),g={category:"woocommerce-product-elements",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(n.createElement)(i.a,{srcElement:b,className:"wc-block-editor-components-block-icon"})},supports:{html:!1},parent:Object(d.a)()?void 0:["@woocommerce/all-products","@woocommerce/single-product"],save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",{className:p()("is-loading",t.className)})},deprecated:[{attributes:{},save:()=>null}]},O=c(249),h=c(3),j=c(9),E=c(90),_=c(250),w=c(102);c(358);var f=function(e){let{className:t="",...c}=e;const o=p()("wc-block-text-toolbar-button",t);return Object(n.createElement)(h.Button,r()({className:o},c))},k=c(29);c(357);var v=e=>t=>c=>{const o=Object(k.useProductDataContext)(),{attributes:r,setAttributes:l}=c,{productId:i}=r,[u,b]=Object(n.useState)(!i);return o.hasContext?Object(n.createElement)(t,c):Object(n.createElement)(n.Fragment,null,u?Object(n.createElement)(h.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(n.createElement)("div",null,e.description),Object(n.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(n.createElement)(w.a,{selected:i||0,showVariations:!0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];l({productId:e[0]?e[0].id:0})}}),Object(n.createElement)(h.Button,{isSecondary:!0,disabled:!i,onClick:()=>{b(!1)}},Object(a.__)("Done","woo-gutenberg-products-block")))):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(h.ToolbarGroup,null,Object(n.createElement)(f,{onClick:()=>b(!0)},Object(a.__)("Switch product…","woo-gutenberg-products-block")))),Object(n.createElement)(t,c)))},y=Object(n.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(n.createElement)("path",{d:"M17 3H7a2 2 0 00-2 2v16l7-3 7 3V5a2 2 0 00-2-2z"}));const S=Object(a.__)("Product Title","woo-gutenberg-products-block"),C=Object(n.createElement)(i.a,{srcElement:y,className:"wc-block-editor-components-block-icon"}),x=Object(a.__)("Display the title of a product.","woo-gutenberg-products-block");c(359);const N=e=>{let{attributes:t,setAttributes:c}=e;const o=Object(s.useBlockProps)(),{headingLevel:r,showProductLink:l,align:i}=t;return Object(n.createElement)("div",o,Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(E.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:r,onChange:e=>c({headingLevel:e})}),Object(d.b)()&&Object(n.createElement)(s.AlignmentToolbar,{value:i,onChange:e=>{c({align:e})}})),Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)(h.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(n.createElement)(h.ToggleControl,{label:Object(a.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(a.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:l,onChange:()=>c({showProductLink:!l})}))),Object(n.createElement)(h.Disabled,null,Object(n.createElement)(_.a,t)))};var P=Object(d.b)()?Object(j.compose)([v({icon:C,label:S,description:Object(a.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(N):N,T=c(194);const R={...g,apiVersion:2,title:S,description:x,icon:{src:C},attributes:O.a,edit:P,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))},supports:{...g.supports,...Object(d.b)()&&{typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0},color:{text:!0,background:!0,link:!1,gradients:!0,__experimentalSkipSerialization:!0},...Object(T.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-title"}}};Object(l.registerBlockType)("woocommerce/product-title",R);var I=c(263),A=c(209);const B=Object(a.__)("Product Price","woo-gutenberg-products-block"),L=Object(n.createElement)(i.a,{srcElement:A.a,className:"wc-block-editor-components-block-icon"}),V=Object(a.__)("Display the price of a product.","woo-gutenberg-products-block"),z=e=>{let{fontSize:t,setFontSize:c,color:o,setColor:r,colorLabel:l}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.FontSizePicker,{value:t.size,onChange:c}),Object(n.createElement)(h.BaseControl,{label:l},Object(n.createElement)(s.ColorPalette,{value:o.color,onChange:r,label:Object(a.__)("Color","woo-gutenberg-products-block")})))},D=e=>{let{fontSize:t,saleFontSize:c,setFontSize:o,setSaleFontSize:r,color:l,saleColor:i,setColor:u,setSaleColor:b,attributes:m,setAttributes:p}=e;const{align:g}=m;return Object(n.createElement)(n.Fragment,null,Object(d.b)()&&Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(s.AlignmentToolbar,{value:g,onChange:e=>{p({align:e})}})),Object(n.createElement)(s.InspectorControls,null,Object(d.b)()&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(h.PanelBody,{title:Object(a.__)("Price","woo-gutenberg-products-block")},Object(n.createElement)(z,{color:l,setColor:u,fontSize:t,setFontSize:o,colorLabel:Object(a.__)("Color","woo-gutenberg-products-block")})),Object(n.createElement)(h.PanelBody,{title:Object(a.__)("Sale price","woo-gutenberg-products-block")},Object(n.createElement)(z,{color:i,setColor:b,fontSize:c,setFontSize:r,colorLabel:Object(a.__)("Color","woo-gutenberg-products-block")})))),Object(n.createElement)(I.default,m))};var F=Object(d.b)()?Object(j.compose)([Object(s.withFontSizes)("fontSize"),Object(s.withFontSizes)("saleFontSize"),Object(s.withFontSizes)("originalFontSize"),Object(s.withColors)("color",{textColor:"color"}),Object(s.withColors)("saleColor",{textColor:"saleColor"}),Object(s.withColors)("originalColor",{textColor:"originalColor"}),v({icon:L,label:B,description:Object(a.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(D):D;let M={productId:{type:"number",default:0}};Object(d.b)()&&(M={...M,align:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},saleFontSize:{type:"string"},customSaleFontSize:{type:"number"},color:{type:"string"},saleColor:{type:"string"},customColor:{type:"string"},customSaleColor:{type:"string"}});const H={title:B,description:V,icon:{src:L},attributes:M,edit:F};Object(l.registerBlockType)("woocommerce/product-price",{...g,...H});var G=c(253),q=c(55),Q=c(2),Y=c(254),U=Object(n.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(n.createElement)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86l-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}));const $=Object(a.__)("Product Image","woo-gutenberg-products-block"),W=Object(n.createElement)(i.a,{srcElement:U,className:"wc-block-editor-components-block-icon"}),K=Object(a.__)("Display the main product image","woo-gutenberg-products-block");var J=v({icon:W,label:$,description:Object(a.__)("Choose a product to display its image.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const{showProductLink:o,imageSizing:r,showSaleBadge:l,saleBadgeAlign:i}=t;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)(h.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(n.createElement)(h.ToggleControl,{label:Object(a.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(a.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:o,onChange:()=>c({showProductLink:!o})}),Object(n.createElement)(h.ToggleControl,{label:Object(a.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(a.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:l,onChange:()=>c({showSaleBadge:!l})}),l&&Object(n.createElement)(q.a,{label:Object(a.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:i,options:[{label:Object(a.__)("Left","woo-gutenberg-products-block"),value:"left"},{label:Object(a.__)("Center","woo-gutenberg-products-block"),value:"center"},{label:Object(a.__)("Right","woo-gutenberg-products-block"),value:"right"}],onChange:e=>c({saleBadgeAlign:e})}),Object(n.createElement)(q.a,{label:Object(a.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(n.createInterpolateElement)(Object(a.__)("Product image cropping can be modified in the <a>Customizer</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(Q.getAdminLink)("customize.php")+"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images",target:"_blank",rel:"noopener noreferrer"})}),value:r,options:[{label:Object(a.__)("Full Size","woo-gutenberg-products-block"),value:"full-size"},{label:Object(a.__)("Cropped","woo-gutenberg-products-block"),value:"cropped"}],onChange:e=>c({imageSizing:e})}))),Object(n.createElement)(h.Disabled,null,Object(n.createElement)(Y.a,t)))});const X={title:$,description:K,icon:{src:W},attributes:G.a,edit:J};Object(l.registerBlockType)("woocommerce/product-image",{...g,...X});var Z=c(264),ee=c(343);const te=Object(a.__)("Product Rating","woo-gutenberg-products-block"),ce=Object(n.createElement)(i.a,{srcElement:ee.a,className:"wc-block-editor-components-block-icon"}),oe={title:te,description:Object(a.__)("Display the average rating of a product.","woo-gutenberg-products-block"),icon:{src:ce},attributes:{productId:{type:"number",default:0}},edit:v({icon:ce,label:te,description:Object(a.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;return Object(n.createElement)(Z.default,t)})};Object(l.registerBlockType)("woocommerce/product-rating",{...g,...oe});var re=c(265),ne=c(210);const ae=Object(a.__)("Add to Cart Button","woo-gutenberg-products-block"),se=Object(n.createElement)(i.a,{srcElement:ne.a,className:"wc-block-editor-components-block-icon"}),le={title:ae,description:Object(a.__)("Display a call to action button which either adds the product to the cart, or links to the product page.","woo-gutenberg-products-block"),icon:{src:se},attributes:{productId:{type:"number",default:0}},edit:v({icon:se,label:ae,description:Object(a.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;return Object(n.createElement)(h.Disabled,null,Object(n.createElement)(re.default,t))})};Object(l.registerBlockType)("woocommerce/product-button",{...g,...le});var ie=c(266),ue=c(361);const be=Object(a.__)("Product Summary","woo-gutenberg-products-block"),de=Object(n.createElement)(i.a,{srcElement:ue.a,className:"wc-block-editor-components-block-icon"}),me=Object(a.__)("Display a short description about a product.","woo-gutenberg-products-block");c(362);var pe=v({icon:de,label:be,description:Object(a.__)("Choose a product to display its short description.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(ie.default,t))});const ge={apiVersion:2,title:be,description:me,icon:{src:de},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-summary"}},edit:pe,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(l.registerBlockType)("woocommerce/product-summary",{...g,...ge});var Oe=c(195),he=c(335);const je=Object(a.__)("On-Sale Badge","woo-gutenberg-products-block"),Ee=Object(n.createElement)(i.a,{srcElement:he.a,className:"wc-block-editor-components-block-icon"}),_e={title:je,description:Object(a.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:Ee},supports:{html:!1},attributes:{productId:{type:"number",default:0}},edit:v({icon:Ee,label:je,description:Object(a.__)("Choose a product to display its sale-badge.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;return Object(n.createElement)(Oe.default,t)})};Object(l.registerBlockType)("woocommerce/product-sale-badge",{...g,..._e});var we=c(93),fe=c(267),ke=Object(n.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"}));const ve=Object(a.__)("Product SKU","woo-gutenberg-products-block"),ye=Object(n.createElement)(i.a,{srcElement:ke,className:"wc-block-editor-components-block-icon"}),Se={title:ve,description:Object(a.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:ye},attributes:{productId:{type:"number",default:0}},edit:v({icon:ye,label:ve,description:Object(a.__)("Choose a product to display its SKU.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(we.a,null),Object(n.createElement)(fe.default,t))})};Object(d.c)("woocommerce/product-sku",{...g,...Se});var Ce=c(268),xe=c(328);const Ne=Object(a.__)("Product Category List","woo-gutenberg-products-block"),Pe=Object(n.createElement)(i.a,{srcElement:xe.a,className:"wc-block-editor-components-block-icon"}),Te=Object(a.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block");var Re=v({icon:Pe,label:Ne,description:Object(a.__)("Choose a product to display its categories.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(we.a,null),Object(n.createElement)(h.Disabled,null,Object(n.createElement)(Ce.default,t)))});const Ie={...g,title:Ne,description:Te,icon:{src:Pe},attributes:{productId:{type:"number",default:0}},edit:Re};Object(d.c)("woocommerce/product-category-list",Ie);var Ae=c(269);const Be=Object(a.__)("Product Tag List","woo-gutenberg-products-block"),Le=Object(n.createElement)(i.a,{srcElement:he.a,className:"wc-block-editor-components-block-icon"}),Ve={title:Be,description:Object(a.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block"),icon:{src:Le},attributes:{productId:{type:"number",default:0}},edit:v({icon:Le,label:Be,description:Object(a.__)("Choose a product to display its tags.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(we.a,null),Object(n.createElement)(h.Disabled,null,Object(n.createElement)(Ae.default,t)))})};Object(d.c)("woocommerce/product-tag-list",{...g,...Ve});var ze=c(270),De=Object(n.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("g",{fillRule:"evenodd"},Object(n.createElement)("path",{d:"M0 0h24v24H0z",fill:"none"}),Object(n.createElement)("path",{fillRule:"nonzero",d:"M20.5 5.2l-1.4-1.7C19 3.3 18.5 3 18 3H6c-.5 0-.9.2-1.2.5L3.5 5.3A2 2 0 003 6.5V19c0 1.1.9 2 2 2h14a2 2 0 002-2V6.5c0-.5-.2-1-.5-1.3zM6.2 5h11.6l.8 1H5.4l.8-1zM5 19V8h14v11H5z"})));const Fe=Object(a.__)("Product Stock Indicator","woo-gutenberg-products-block"),Me=Object(n.createElement)(i.a,{srcElement:De,className:"wc-block-editor-components-block-icon"}),He=Object(a.__)("Display product stock status.","woo-gutenberg-products-block");var Ge=v({icon:Me,label:Fe,description:Object(a.__)("Choose a product to display its stock.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(we.a,null),Object(n.createElement)(ze.default,t))});const qe={apiVersion:2,title:Fe,description:He,icon:{src:Me},attributes:{productId:{type:"number",default:0}},supports:{...Object(d.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-stock-indicator"}},edit:Ge,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(d.c)("woocommerce/product-stock-indicator",{...g,...qe});var Qe=c(478),Ye=(c(248),c(257));const Ue=Object(a.__)("Add to Cart","woo-gutenberg-products-block"),$e=Object(n.createElement)(i.a,{srcElement:ne.a,className:"wc-block-editor-components-block-icon"}),We={title:Ue,description:Object(a.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:$e},edit:v({icon:$e,label:Ue,description:Object(a.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const{product:o}=Object(k.useProductDataContext)(),{className:r,showFormElements:l}=t;return Object(n.createElement)("div",{className:p()(r,"wc-block-components-product-add-to-cart")},Object(n.createElement)(we.a,{productId:o.id}),Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)(h.PanelBody,{title:Object(a.__)("Layout","woo-gutenberg-products-block")},Object(Qe.b)(o)?Object(n.createElement)(h.ToggleControl,{label:Object(a.__)("Display form elements","woo-gutenberg-products-block"),help:Object(a.__)("Depending on product type, allow customers to select a quantity, variations etc.","woo-gutenberg-products-block"),checked:l,onChange:()=>c({showFormElements:!l})}):Object(n.createElement)(h.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(a.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woo-gutenberg-products-block")))),Object(n.createElement)(h.Disabled,null,Object(n.createElement)(Ye.a,t)))}),attributes:c(256).a};Object(d.c)("woocommerce/product-add-to-cart",{...g,...We});var Ke=c(25),Je=c.n(Ke),Xe=c(13),Ze=(c(10),c(59)),et=c(469),tt=c(344),ct=c(24);const ot=(e,t)=>{const{className:c,contentVisibility:o}=t;return p()(e,c,{"has-image":o&&o.image,"has-title":o&&o.title,"has-rating":o&&o.rating,"has-price":o&&o.price,"has-button":o&&o.button})};var rt=c(122);const nt=[["woocommerce/product-image",{imageSizing:"cropped"}],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],at=e=>e&&0!==e.length?e.map(e=>[e.name,{...e.attributes,product:void 0,children:e.innerBlocks.length>0?at(e.innerBlocks):[]}]):[];var st=c(8),lt=c(6),it=c(30);c(368);const ut=e=>{let{currentPage:t,displayFirstAndLastPages:c,displayNextAndPreviousArrows:o,pagesToDisplay:r,onPageChange:s,totalPages:l}=e,{minIndex:i,maxIndex:u}=((e,t,c)=>{if(c<=2)return{minIndex:null,maxIndex:null};const o=e-1,r=Math.max(Math.floor(t-o/2),2),n=Math.min(Math.ceil(t+(o-(t-r))),c-1);return{minIndex:Math.max(Math.floor(t-(o-(n-t))),2),maxIndex:n}})(r,t,l);const b=c&&Boolean(1!==i),d=c&&Boolean(u!==l),m=c&&Boolean(i>3),g=c&&Boolean(u<l-2);b&&3===i&&(i-=1),d&&u===l-2&&(u+=1);const O=[];if(i&&u)for(let e=i;e<=u;e++)O.push(e);return Object(n.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(n.createElement)(it.a,{screenReaderLabel:Object(a.__)("Navigate to another page","woo-gutenberg-products-block")}),o&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>s(t-1),title:Object(a.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(n.createElement)(it.a,{label:"←",screenReaderLabel:Object(a.__)("Previous page","woo-gutenberg-products-block")})),b&&Object(n.createElement)("button",{className:p()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:()=>s(1),disabled:1===t},Object(n.createElement)(it.a,{label:1,screenReaderLabel:Object(a.sprintf)(
29
  /* translators: %d is the page number (1, 2, 3...). */
30
- Object(a.__)("Page %d","woo-gutenberg-products-block"),1)})),m&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(a.__)("…","woo-gutenberg-products-block")),O.map(e=>Object(n.createElement)("button",{key:e,className:p()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?null:()=>s(e),disabled:t===e},Object(n.createElement)(it.a,{label:e,screenReaderLabel:Object(a.sprintf)(
31
  /* translators: %d is the page number (1, 2, 3...). */
32
- Object(a.__)("Page %d","woo-gutenberg-products-block"),e)}))),g&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(a.__)("…","woo-gutenberg-products-block")),d&&Object(n.createElement)("button",{className:p()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===l,"wc-block-components-pagination__page--active":t===l}),onClick:()=>s(l),disabled:t===l},Object(n.createElement)(it.a,{label:l,screenReaderLabel:Object(a.sprintf)(
33
  /* translators: %d is the page number (1, 2, 3...). */
34
- Object(a.__)("Page %d","woo-gutenberg-products-block"),l)})),o&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>s(t+1),title:Object(a.__)("Next page","woo-gutenberg-products-block"),disabled:t>=l},Object(n.createElement)(it.a,{label:"→",screenReaderLabel:Object(a.__)("Next page","woo-gutenberg-products-block")})))};ut.defaultProps={displayFirstAndLastPages:!0,displayNextAndPreviousArrows:!0,pagesToDisplay:3};var bt=ut,dt=c(109),mt=c(73),pt=c(115),gt=c(16),Ot=c(39);var ht=c(60);c(369);const jt=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};var Et=c(46),_t=c(103),wt=()=>{const{parentClassName:e}=Object(k.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:e+"__no-products"},Object(n.createElement)(i.a,{className:e+"__no-products-image",alt:"",srcElement:_t.a,size:100}),Object(n.createElement)("strong",{className:e+"__no-products-title"},Object(a.__)("No products","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:e+"__no-products-description"},Object(a.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},ft=c(349),kt=e=>{let{resetCallback:t=(()=>{})}=e;const{parentClassName:c}=Object(k.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:c+"__no-products"},Object(n.createElement)(i.a,{className:c+"__no-products-image",alt:"",srcElement:ft.a,size:100}),Object(n.createElement)("strong",{className:c+"__no-products-title"},Object(a.__)("No products found","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:c+"__no-products-description"},Object(a.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(n.createElement)("button",{onClick:t},Object(a.__)("Reset Search","woo-gutenberg-products-block")))},vt=c(105);c(367);var yt=e=>{let{onChange:t,readOnly:c,value:o}=e;return Object(n.createElement)(vt.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",name:"orderby",onChange:t,options:[{key:"menu_order",label:Object(a.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(a.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(a.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(a.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(a.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(a.__)("Price: high to low","woo-gutenberg-products-block")}],readOnly:c,screenReaderLabel:Object(a.__)("Order products by","woo-gutenberg-products-block"),value:o})};const St=(e,t,c,o)=>{if(!c)return;const a=Object(et.a)(e);return c.map((c,s)=>{let[l,i={}]=c,u=[];i.children&&i.children.length>0&&(u=St(e,t,i.children,o));const b=a[l];if(!b)return null;const d=t.id||0,m=["layout",l,s,o,d];return Object(n.createElement)(n.Suspense,{key:m.join("_"),fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},Object(n.createElement)(b,r()({},i,{children:u,product:t})))})};var Ct=Object(j.withInstanceId)(e=>{let{product:t,attributes:c,instanceId:o}=e;const{layoutConfig:r}=c,{parentClassName:a,parentName:s}=Object(k.useInnerBlockLayoutContext)(),l=0===Object.keys(t).length,i=p()(a+"__product","wc-block-layout",{"is-loading":l});return Object(n.createElement)("li",{className:i,"aria-hidden":l},St(s,t,r,o))});c(366);const xt=function(e){let{totalQuery:t,totalProducts:c}=e,{totalQuery:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!Object(lt.isEqual)(t,o)&&Number.isFinite(c)};var Nt,Pt=(Nt=e=>{let{attributes:t,currentPage:c,onPageChange:o,onSortChange:r,sortValue:s,scrollToTop:l}=e;const[i,u]=Object(mt.b)("attributes",[]),[b,d]=Object(mt.b)("stock_status",[]),[m,g]=Object(mt.b)("min_price"),[O,h]=Object(mt.b)("max_price"),[j]=Object(mt.c)((e=>{let{sortValue:t,currentPage:c,attributes:o}=e;const{columns:r,rows:n}=o;return{...(e=>{switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}})(t),catalog_visibility:"catalog",per_page:r*n,page:c}})({attributes:t,sortValue:s,currentPage:c})),{products:E,totalProducts:_,productsLoading:w}=(e=>{const t={namespace:"/wc/store",resourceName:"products"},{results:c,isLoading:o}=Object(pt.a)({...t,query:e}),{value:r}=((e,t)=>{const{namespace:c,resourceName:o,resourceValues:r=[],query:n={}}=t;if(!c||!o)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const a=Object(Ot.a)(n),s=Object(Ot.a)(r),{value:l,isLoading:i=!0}=Object(Xe.useSelect)(e=>{const t=e(gt.COLLECTIONS_STORE_KEY),r=["x-wp-total",c,o,a,s];return{value:t.getCollectionHeader(...r),isLoading:t.hasFinishedResolution("getCollectionHeader",r)}},["x-wp-total",c,o,s,a]);return{value:l,isLoading:i}})(0,{...t,query:e});return{products:c,totalProducts:parseInt(r,10),productsLoading:o}})(j),{parentClassName:f,parentName:v}=Object(k.useInnerBlockLayoutContext)(),y=(e=>{const{order:t,orderby:c,page:o,per_page:r,...n}=e;return n||{}})(j),{dispatchStoreEvent:S}=Object(ht.a)(),C=Object(dt.a)({totalQuery:y,totalProducts:_},xt);Object(n.useEffect)(()=>{S("product-list-render",{products:E,listName:v})},[E,v,S]),Object(n.useEffect)(()=>{Object(lt.isEqual)(y,null==C?void 0:C.totalQuery)||(o(1),null!=C&&C.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?Object(Et.speak)(Object(a.__)("No products found","woo-gutenberg-products-block")):Object(Et.speak)(Object(a.sprintf)(
35
  /* translators: %s is an integer higher than 0 (1, 2, 3...) */
36
- Object(a._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))})(_))},[null==C?void 0:C.totalQuery,_,o,y]);const{contentVisibility:x}=t,N=t.columns*t.rows,P=!Number.isFinite(_)&&Number.isFinite(null==C?void 0:C.totalProducts)&&Object(lt.isEqual)(y,null==C?void 0:C.totalQuery)?Math.ceil(C.totalProducts/N):Math.ceil(_/N),T=E.length?E:Array.from({length:N}),R=0!==E.length||w,I=i.length>0||b.length>0||Number.isFinite(m)||Number.isFinite(O);return Object(n.createElement)("div",{className:(()=>{const{columns:e,rows:c,alignButtons:o,align:r}=t,n=void 0!==r?"align"+r:"";return p()(f,n,"has-"+e+"-columns",{"has-multiple-rows":c>1,"has-aligned-buttons":o})})()},x.orderBy&&R&&Object(n.createElement)(yt,{onChange:r,value:s}),!R&&I&&Object(n.createElement)(kt,{resetCallback:()=>{u([]),d([]),g(null),h(null)}}),!R&&!I&&Object(n.createElement)(wt,null),R&&Object(n.createElement)("ul",{className:f+"__products"},T.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;return Object(n.createElement)(Ct,{key:e.id||c,attributes:t,product:e})}))),P>1&&Object(n.createElement)(bt,{currentPage:c,onPageChange:e=>{l({focusableSelector:"a, button"}),o(e)},totalPages:P}))},e=>{const t=Object(n.useRef)(null);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:t,"aria-hidden":!0}),Object(n.createElement)(Nt,r()({},e,{scrollToTop:e=>{null!==t.current&&((e,t)=>{const{focusableSelector:c}=t||{};window&&Number.isFinite(window.innerHeight)&&(c?((e,t)=>{var c;const o=(null===(c=e.parentElement)||void 0===c?void 0:c.querySelectorAll(t))||[];if(o.length){const e=o[0];jt(e),null==e||e.focus()}else jt(e)})(e,c):jt(e))})(t.current,e)}})))}),Tt=e=>{let{attributes:t}=e;const[c,o]=Object(n.useState)(1),[r,a]=Object(n.useState)(t.orderby);return Object(n.useEffect)(()=>{a(t.orderby)},[t.orderby]),Object(n.createElement)(Pt,{attributes:t,currentPage:c,onPageChange:e=>{o(e)},onSortChange:e=>{const t=e.target.value;a(t),o(1)},sortValue:r})},Rt=c(128);class It extends st.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?Rt.a:Object(n.createElement)(k.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(n.createElement)(Tt,{attributes:e,urlParameterSuffix:t}))}}var At=It;c(365);class Bt extends n.Component{constructor(){super(...arguments),Je()(this,"state",{isEditing:!1,innerBlocks:[]}),Je()(this,"blockMap",Object(et.a)("woocommerce/all-products")),Je()(this,"componentDidMount",()=>{const{block:e}=this.props;this.setState({innerBlocks:e.innerBlocks})}),Je()(this,"getTitle",()=>Object(a.__)("All Products","woo-gutenberg-products-block")),Je()(this,"getIcon",()=>Object(n.createElement)(i.a,{srcElement:b})),Je()(this,"togglePreview",()=>{const{debouncedSpeak:e}=this.props;this.setState({isEditing:!this.state.isEditing}),this.state.isEditing||e(Object(a.__)("Showing All Products block preview.","woo-gutenberg-products-block"))}),Je()(this,"getInspectorControls",()=>{const{attributes:e,setAttributes:t}=this.props,{columns:c,rows:o,alignButtons:r}=e;return Object(n.createElement)(s.InspectorControls,{key:"inspector"},Object(n.createElement)(h.PanelBody,{title:Object(a.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(n.createElement)(Ze.a,{columns:c,rows:o,alignButtons:r,setAttributes:t,minColumns:Object(Q.getSetting)("min_columns",1),maxColumns:Object(Q.getSetting)("max_columns",6),minRows:Object(Q.getSetting)("min_rows",1),maxRows:Object(Q.getSetting)("max_rows",6)})),Object(n.createElement)(h.PanelBody,{title:Object(a.__)("Content Settings","woo-gutenberg-products-block")},((e,t)=>{const{contentVisibility:c}=e;return Object(n.createElement)(h.ToggleControl,{label:Object(a.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:c.orderBy,onChange:()=>t({contentVisibility:{...c,orderBy:!c.orderBy}})})})(e,t),((e,t)=>Object(n.createElement)(h.SelectControl,{label:Object(a.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(a.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(a.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(a.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(a.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(a.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(a.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:e=>t({orderby:e})}))(e,t)))}),Je()(this,"getBlockControls",()=>{const{isEditing:e}=this.state;return Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(h.ToolbarGroup,{controls:[{icon:"edit",title:Object(a.__)("Edit inner product layout","woo-gutenberg-products-block"),onClick:()=>this.togglePreview(),isActive:e}]}))}),Je()(this,"renderEditMode",()=>{const e={template:this.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(this.blockMap)};return 0!==this.props.attributes.layoutConfig.length&&(e.renderAppender=!1),Object(n.createElement)(h.Placeholder,{icon:this.getIcon(),label:this.getTitle()},Object(a.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(n.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(n.createElement)(h.Tip,null,Object(a.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(n.createElement)(k.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(n.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(n.createElement)("ul",{className:"wc-block-grid__products"},Object(n.createElement)("li",{className:"wc-block-grid__product"},Object(n.createElement)(k.ProductDataContextProvider,{product:tt.a[0]},Object(n.createElement)(s.InnerBlocks,e)))))),Object(n.createElement)("div",{className:"wc-block-all-products__actions"},Object(n.createElement)(h.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:()=>{const{block:e,setAttributes:t}=this.props;t({layoutConfig:at(e.innerBlocks)}),this.setState({innerBlocks:e.innerBlocks}),this.togglePreview()}},Object(a.__)("Done","woo-gutenberg-products-block")),Object(n.createElement)(h.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,{innerBlocks:c}=this.state;t(e.clientId,c,!1),this.togglePreview()}},Object(a.__)("Cancel","woo-gutenberg-products-block")),Object(n.createElement)(h.Button,{className:"wc-block-all-products__reset-button",icon:Object(n.createElement)(i.a,{srcElement:b}),label:Object(a.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,c=[];nt.map(e=>{let[t,o]=e;return c.push(Object(l.createBlock)(t,o)),!0}),t(e.clientId,c,!1),this.setState({innerBlocks:e.innerBlocks})}},Object(a.__)("Reset Layout","woo-gutenberg-products-block")))))}),Je()(this,"renderViewMode",()=>{const{attributes:e}=this.props,{layoutConfig:t}=e,c=t&&0!==t.length,o=this.getTitle(),r=this.getIcon();return c?Object(n.createElement)(h.Disabled,null,Object(n.createElement)(At,{attributes:e})):((e,t)=>Object(n.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(a.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")))(o,r)}),Je()(this,"render",()=>{const{attributes:e}=this.props,{isEditing:t}=this.state,c=this.getTitle(),o=this.getIcon();return 0===ct.o.productCount?((e,t)=>Object(n.createElement)(h.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(n.createElement)("p",null,Object(a.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(n.createElement)(h.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:Q.ADMIN_URL+"post-new.php?post_type=product"},Object(a.__)("Add new product","woo-gutenberg-products-block")+" ",Object(n.createElement)(i.a,{srcElement:rt.a})),Object(n.createElement)(h.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(a.__)("Learn more","woo-gutenberg-products-block"))))(c,o):Object(n.createElement)("div",{className:ot("wc-block-all-products",e)},this.getBlockControls(),this.getInspectorControls(),t?this.renderEditMode():this.renderViewMode())})}}var Lt=Object(j.compose)(h.withSpokenMessages,Object(Xe.withSelect)((e,t)=>{let{clientId:c}=t;const{getBlock:o}=e("core/block-editor");return{block:o(c)}}),Object(Xe.withDispatch)(e=>{const{replaceInnerBlocks:t}=e("core/block-editor");return{replaceInnerBlocks:t}}))(Bt);const Vt={columns:Object(Q.getSetting)("default_columns",3),rows:Object(Q.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:nt,isPreview:!1},zt={title:Object(a.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(n.createElement)(i.a,{srcElement:b,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("Display products from your store in a grid layout.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1,multiple:!1},example:{attributes:{isPreview:!0}},attributes:{columns:{type:"number"},rows:{type:"number"},alignButtons:{type:"boolean"},contentVisibility:{type:"object"},orderby:{type:"string"},layoutConfig:{type:"array"},isPreview:{type:"boolean",default:!1}},defaults:Vt,edit:e=>Object(n.createElement)(Lt,e),save(e){let{attributes:t}=e;const c={};Object.keys(t).sort().forEach(e=>{c[e]=t[e]});const o={"data-attributes":JSON.stringify(c)};return Object(n.createElement)("div",r()({className:ot("wc-block-all-products",t)},o),Object(n.createElement)(s.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",{...zt,deprecated:[{attributes:Object.assign({},zt.attributes,{rows:{type:"number",default:1}}),save(e){let{attributes:t}=e;const c={"data-attributes":JSON.stringify(t)};return Object(n.createElement)("div",r()({className:ot("wc-block-all-products",t)},c),Object(n.createElement)(s.InnerBlocks.Content,null))}}]})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var o=c(38),r=c(0),n=c(24);c.p=n.l,Object(o.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(r.lazy)(()=>Promise.all([c.e(0),c.e(13)]).then(c.bind(null,263)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(r.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(5),c.e(12)]).then(c.bind(null,502)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(r.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(19)]).then(c.bind(null,503)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(r.lazy)(()=>c.e(14).then(c.bind(null,264)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(r.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(2),c.e(4),c.e(10)]).then(c.bind(null,265)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(r.lazy)(()=>Promise.all([c.e(1),c.e(3),c.e(17)]).then(c.bind(null,266)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(r.lazy)(()=>c.e(5).then(c.bind(null,195)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(r.lazy)(()=>c.e(15).then(c.bind(null,267)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(r.lazy)(()=>c.e(11).then(c.bind(null,268)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(r.lazy)(()=>c.e(18).then(c.bind(null,269)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(r.lazy)(()=>Promise.all([c.e(1),c.e(3),c.e(16)]).then(c.bind(null,270)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(r.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(2),c.e(4),c.e(9)]).then(c.bind(null,504)))});const a=e=>Object(o.getRegisteredBlockComponents)(e)},,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return r}));const o=e=>e.is_purchasable||!1,r=e=>["simple","variable"].includes(e.type||"simple")}]);
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-products"]=function(e){function t(t){for(var o,a,s=t[0],l=t[1],i=t[2],b=0,d=[];b<s.length;b++)a=s[b],Object.prototype.hasOwnProperty.call(r,a)&&r[a]&&d.push(r[a][0]),r[a]=0;for(o in l)Object.prototype.hasOwnProperty.call(l,o)&&(e[o]=l[o]);for(u&&u(t);d.length;)d.shift()();return n.push.apply(n,i||[]),c()}function c(){for(var e,t=0;t<n.length;t++){for(var c=n[t],o=!0,s=1;s<c.length;s++){var l=c[s];0!==r[l]&&(o=!1)}o&&(n.splice(t--,1),e=a(a.s=c[0]))}return e}var o={},r={7:0,1:0,2:0,3:0,4:0,5:0,10:0,11:0,13:0,14:0,15:0,16:0,17:0,18:0},n=[];function a(t){if(o[t])return o[t].exports;var c=o[t]={i:t,l:!1,exports:{}};return e[t].call(c.exports,c,c.exports,a),c.l=!0,c.exports}a.e=function(e){var t=[],c=r[e];if(0!==c)if(c)t.push(c[2]);else{var o=new Promise((function(t,o){c=r[e]=[t,o]}));t.push(c[2]=o);var n,s=document.createElement("script");s.charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.src=function(e){return a.p+""+({1:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/catego--ce653f6d",2:"atomic-block-components/category-list--atomic-block-components/image--atomic-block-components/sale---5e68150f",3:"atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b",4:"atomic-block-components/add-to-cart--atomic-block-components/button",5:"atomic-block-components/sale-badge",9:"atomic-block-components/add-to-cart",10:"atomic-block-components/button",11:"atomic-block-components/category-list",12:"atomic-block-components/image",13:"atomic-block-components/price",14:"atomic-block-components/rating",15:"atomic-block-components/sku",16:"atomic-block-components/stock-indicator",17:"atomic-block-components/summary",18:"atomic-block-components/tag-list",19:"atomic-block-components/title"}[e]||e)+".js?ver="+{1:"10d7f4f3c56eee2c1dfb",2:"645096edbc149a733d81",3:"9b3ab05344f7fc3c6b82",4:"e97f89565b6d7750bfd7",5:"375fd6238d0494d61795",9:"8fd1eaf5f58ea1b936ce",10:"8d4cfd0ef675e17ad78d",11:"c9b92706a1345b4ba61d",12:"d73922a73544bb49ecbd",13:"903ffde246902d791de2",14:"57bbe58f8a3522fee798",15:"f56cc611c5b0df157de1",16:"661ab72f78559cf2fd71",17:"3069ca52baed2c762bc9",18:"67d34142b8bed905bc6f",19:"50f2651f4e5394f31053"}[e]}(e);var l=new Error;n=function(t){s.onerror=s.onload=null,clearTimeout(i);var c=r[e];if(0!==c){if(c){var o=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;l.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",l.name="ChunkLoadError",l.type=o,l.request=n,c[1](l)}r[e]=void 0}};var i=setTimeout((function(){n({type:"timeout",target:s})}),12e4);s.onerror=s.onload=n,document.head.appendChild(s)}return Promise.all(t)},a.m=e,a.c=o,a.d=function(e,t,c){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:c})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var c=Object.create(null);if(a.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(c,o,function(t){return e[t]}.bind(null,o));return c},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a.oe=function(e){throw console.error(e),e};var s=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var i=0;i<s.length;i++)t(s[i]);var u=l;return n.push([351,0]),c()}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.wp.components},,,function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.compose},,function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=window.wp.data},,function(e,t){e.exports=window.wp.htmlEntities},function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,c){"use strict";c.d(t,"a",(function(){return a})),c.d(t,"c",(function(){return l})),c.d(t,"d",(function(){return i})),c.d(t,"b",(function(){return u}));var o=c(0),r=c(6),n=c(1);const a={clear:Object(n.__)("Clear all selected items","woo-gutenberg-products-block"),noItems:Object(n.__)("No items found.","woo-gutenberg-products-block"),
2
  /* Translators: %s search term */
3
  noResults:Object(n.__)("No results for %s","woo-gutenberg-products-block"),search:Object(n.__)("Search for items","woo-gutenberg-products-block"),selected:e=>Object(n.sprintf)(
4
  /* translators: Number of items selected from list. */
5
+ Object(n._n)("%d item selected","%d items selected",e,"woo-gutenberg-products-block"),e),updated:Object(n.__)("Search results updated.","woo-gutenberg-products-block")},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;const c=Object(r.groupBy)(e,"parent"),o=Object(r.keyBy)(t,"id"),n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.parent)return e.name?[e.name]:[];const t=n(o[e.parent]);return[...t,e.name]},a=e=>e.map(e=>{const t=c[e.id];return delete c[e.id],{...e,breadcrumbs:n(o[e.parent]),children:t&&t.length?a(t):[]}}),s=a(c[0]||[]);return delete c[0],Object(r.forEach)(c,e=>{s.push(...a(e||[]))}),s},l=(e,t,c)=>{if(!t)return c?s(e):e;const o=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"i"),r=e.map(e=>!!o.test(e.name)&&e).filter(Boolean);return c?s(r,e):r},i=(e,t)=>{if(!t)return e;const c=new RegExp(t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"ig");return e.split(c).map((e,c)=>0===c?e:Object(o.createElement)(o.Fragment,{key:c},Object(o.createElement)("strong",null,t),e))},u=e=>1===e.length?e.slice(0,1).toString():2===e.length?e.slice(0,1).toString()+" › "+e.slice(-1).toString():e.slice(0,1).toString()+" … "+e.slice(-1).toString()},,,function(e,t,c){"use strict";c.d(t,"o",(function(){return n})),c.d(t,"m",(function(){return a})),c.d(t,"l",(function(){return s})),c.d(t,"n",(function(){return l})),c.d(t,"j",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"f",(function(){return b})),c.d(t,"g",(function(){return d})),c.d(t,"k",(function(){return p})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"h",(function(){return O})),c.d(t,"a",(function(){return j})),c.d(t,"i",(function(){return h})),c.d(t,"b",(function(){return E}));var o,r=c(2);const n=Object(r.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=n.pluginUrl+"images/",s=n.pluginUrl+"build/",l=n.buildPhase,i=null===(o=r.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,u=r.STORE_PAGES.checkout.id,b=r.STORE_PAGES.checkout.permalink,d=r.STORE_PAGES.privacy.permalink,p=(r.STORE_PAGES.privacy.title,r.STORE_PAGES.terms.permalink),m=(r.STORE_PAGES.terms.title,r.STORE_PAGES.cart.id),g=r.STORE_PAGES.cart.permalink,O=(r.STORE_PAGES.myaccount.permalink?r.STORE_PAGES.myaccount.permalink:Object(r.getSetting)("wpLoginUrl","/wp-login.php"),Object(r.getSetting)("shippingCountries",{})),j=Object(r.getSetting)("allowedCountries",{}),h=Object(r.getSetting)("shippingStates",{}),E=Object(r.getSetting)("allowedStates",{})},,,function(e,t){e.exports=window.wp.isShallowEqual},function(e,t,c){"use strict";c.d(t,"h",(function(){return i})),c.d(t,"e",(function(){return u})),c.d(t,"b",(function(){return b})),c.d(t,"i",(function(){return d})),c.d(t,"f",(function(){return p})),c.d(t,"c",(function(){return m})),c.d(t,"d",(function(){return g})),c.d(t,"g",(function(){return O})),c.d(t,"a",(function(){return j}));var o=c(17),r=c(12),n=c.n(r),a=c(6),s=c(2),l=c(22);const i=e=>{let{selected:t=[],search:c="",queryArgs:r={}}=e;const s=(e=>{let{selected:t=[],search:c="",queryArgs:r={}}=e;const n=l.o.productCount>100,a={per_page:n?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},s=[Object(o.addQueryArgs)("/wc/store/products",{...a,...r})];return n&&t.length&&s.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:t,per_page:0})),s})({selected:t,search:c,queryArgs:r});return Promise.all(s.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id").map(e=>({...e,parent:0}))).catch(e=>{throw e})},u=e=>n()({path:"/wc/store/products/"+e}),b=()=>n()({path:"wc/store/products/attributes"}),d=e=>n()({path:`wc/store/products/attributes/${e}/terms`}),p=e=>{let{selected:t=[],search:c}=e;const r=(e=>{let{selected:t=[],search:c}=e;const r=Object(s.getSetting)("limitTags",!1),n=[Object(o.addQueryArgs)("wc/store/products/tags",{per_page:r?100:0,orderby:r?"count":"name",order:r?"desc":"asc",search:c})];return r&&t.length&&n.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:t})),n})({selected:t,search:c});return Promise.all(r.map(e=>n()({path:e}))).then(e=>Object(a.uniqBy)(Object(a.flatten)(e),"id"))},m=e=>n()({path:Object(o.addQueryArgs)("wc/store/products/categories",{per_page:0,...e})}),g=e=>n()({path:"wc/store/products/categories/"+e}),O=e=>n()({path:Object(o.addQueryArgs)("wc/store/products",{per_page:0,type:"variation",parent:e})}),j=(e,t)=>{if(!e.title.raw)return e.slug;const c=1===t.filter(t=>t.title.raw===e.title.raw).length;return e.title.raw+(c?"":" - "+e.slug)}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r})),c.d(t,"b",(function(){return n}));var o=c(1);const r=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},n=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},function(e,t){e.exports=window.wc.wcBlocksSharedContext},function(e,t,c){"use strict";var o=c(0),r=c(4),n=c.n(r);t.a=e=>{let t,{label:c,screenReaderLabel:r,wrapperElement:a,wrapperProps:s={}}=e;const l=null!=c,i=null!=r;return!l&&i?(t=a||"span",s={...s,className:n()(s.className,"screen-reader-text")},Object(o.createElement)(t,s,r)):(t=a||o.Fragment,l&&i&&c!==r?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},c),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,s,c))}},function(e,t){e.exports=window.wp.escapeHtml},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(30);t.a=e=>{let{error:t}=e;return Object(o.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:c}=e;return t?"general"===c?Object(o.createElement)("span",null,Object(r.__)("The following error was returned","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(n.escapeHTML)(t))):"api"===c?Object(o.createElement)("span",null,Object(r.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(n.escapeHTML)(t))):t:Object(r.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var o=c(5),r=c.n(o),n=c(0),a=c(19);const s=e=>{let{countLabel:t,className:c,depth:o=0,controlId:s="",item:l,isSelected:i,isSingle:u,onSelect:b,search:d="",...p}=e;const m=null!=t&&void 0!==l.count&&null!==l.count,g=[c,"woocommerce-search-list__item"];g.push("depth-"+o),u&&g.push("is-radio-button"),m&&g.push("has-count");const O=l.breadcrumbs&&l.breadcrumbs.length,j=p.name||"search-list-item-"+s,h=`${j}-${l.id}`;return Object(n.createElement)("label",{htmlFor:h,className:g.join(" ")},u?Object(n.createElement)("input",r()({type:"radio",id:h,name:j,value:l.value,onChange:b(l),checked:i,className:"woocommerce-search-list__item-input"},p)):Object(n.createElement)("input",r()({type:"checkbox",id:h,name:j,value:l.value,onChange:b(l),checked:i,className:"woocommerce-search-list__item-input"},p)),Object(n.createElement)("span",{className:"woocommerce-search-list__item-label"},O?Object(n.createElement)("span",{className:"woocommerce-search-list__item-prefix"},Object(a.b)(l.breadcrumbs)):null,Object(n.createElement)("span",{className:"woocommerce-search-list__item-name"},Object(a.d)(l.name,d))),!!m&&Object(n.createElement)("span",{className:"woocommerce-search-list__item-count"},t||l.count))};t.b=s},,function(e,t){e.exports=window.wc.priceFormat},function(e,t,c){"use strict";c.d(t,"a",(function(){return _}));var o=c(6),r=c(0),n=c(18),a=c(14),s=c(16),l=c(149),i=c(251),u=c(48),b=c(250);const d=e=>{const t=e.detail;t&&t.preserveCartData||Object(a.dispatch)(n.CART_STORE_KEY).invalidateResolutionForStore()},p=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},m=()=>{Object(r.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(b.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(b.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",d),document.body.addEventListener("wc-blocks_removed_from_cart",d),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",d),document.body.removeEventListener("wc-blocks_removed_from_cart",d)}}window.wcBlocksStoreCartListeners.count++})(),p),[])},g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},O={...g,email:""},j={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:n.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},h=e=>Object(l.a)(Object.entries(e).map(e=>{let[t,c]=e;return[t,Object(s.decodeEntities)(c)]})),E={cartCoupons:n.EMPTY_CART_COUPONS,cartItems:n.EMPTY_CART_ITEMS,cartFees:n.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:j,cartIsLoading:!0,cartErrors:n.EMPTY_CART_ERRORS,billingAddress:O,shippingAddress:g,shippingRates:n.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:n.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:n.EMPTY_EXTENSIONS},_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:c}=Object(u.b)(),s=null==c?void 0:c.previewCart,{shouldSelect:l}=e,b=Object(r.useRef)();m();const d=Object(a.useSelect)((e,c)=>{let{dispatch:o}=c;if(!l)return E;if(t)return{cartCoupons:s.coupons,cartItems:s.items,cartFees:s.fees,cartItemsCount:s.items_count,cartItemsWeight:s.items_weight,cartNeedsPayment:s.needs_payment,cartNeedsShipping:s.needs_shipping,cartItemErrors:n.EMPTY_CART_ITEM_ERRORS,cartTotals:s.totals,cartIsLoading:!1,cartErrors:n.EMPTY_CART_ERRORS,billingAddress:O,shippingAddress:g,extensions:n.EMPTY_EXTENSIONS,shippingRates:s.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:s.has_calculated_shipping,paymentRequirements:s.paymentRequirements,receiveCart:"function"==typeof(null==s?void 0:s.receiveCart)?s.receiveCart:()=>{}};const r=e(n.CART_STORE_KEY),a=r.getCartData(),u=r.getCartErrors(),b=r.getCartTotals(),d=!r.hasFinishedResolution("getCartData"),p=r.isCustomerDataUpdating(),{receiveCart:m}=o(n.CART_STORE_KEY),j=h(a.billingAddress),_=a.needsShipping?h(a.shippingAddress):j,f=a.fees.length>0?a.fees.map(e=>h(e)):n.EMPTY_CART_FEES;return{cartCoupons:a.coupons.length>0?a.coupons.map(e=>({...e,label:e.code})):n.EMPTY_CART_COUPONS,cartItems:a.items,cartFees:f,cartItemsCount:a.itemsCount,cartItemsWeight:a.itemsWeight,cartNeedsPayment:a.needsPayment,cartNeedsShipping:a.needsShipping,cartItemErrors:a.errors,cartTotals:b,cartIsLoading:d,cartErrors:u,billingAddress:Object(i.a)(j),shippingAddress:Object(i.a)(_),extensions:a.extensions,shippingRates:a.shippingRates,shippingRatesLoading:p,cartHasCalculatedShipping:a.hasCalculatedShipping,paymentRequirements:a.paymentRequirements,receiveCart:m}},[l]);return b.current&&Object(o.isEqual)(b.current,d)||(b.current=d),b.current}},function(e,t,c){"use strict";c.d(t,"b",(function(){return o})),c.d(t,"d",(function(){return r})),c.d(t,"c",(function(){return n})),c.d(t,"e",(function(){return a})),c.d(t,"a",(function(){return s}));const o=e=>"number"==typeof e,r=e=>"string"==typeof e,n=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function a(e,t){return n(e)&&t in e}const s=e=>e instanceof Error},function(e,t){e.exports=window.wc.wcBlocksRegistry},function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var o=c(0),r=c(25),n=c.n(r);function a(e){const t=Object(o.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},,function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(131),s=c(4),l=c.n(s);c(137);const i=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});t.a=e=>{let{className:t,value:c,currency:o,onValueChange:s,displayType:u="text",...b}=e;const d="string"==typeof c?parseInt(c,10):c;if(!Number.isFinite(d))return null;const p=d/10**o.minorUnit;if(!Number.isFinite(p))return null;const m=l()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),g={...b,...i(o),value:void 0,currency:void 0,onValueChange:void 0},O=s?e=>{const t=+e.value*10**o.minorUnit;s(t)}:()=>{};return Object(n.createElement)(a.a,r()({className:m,displayType:u},g,{value:p,onValueChange:O}))}},,function(e,t,c){"use strict";c.d(t,"a",(function(){return l})),c.d(t,"b",(function(){return i})),c.d(t,"c",(function(){return b}));var o=c(36);let r,n;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(r||(r={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(n||(n={}));const a=(e,t)=>Object(o.c)(e)&&"type"in e&&e.type===t,s=e=>a(e,r.SUCCESS),l=e=>a(e,r.ERROR),i=e=>a(e,r.FAIL),u=e=>!Object(o.c)(e)||void 0===e.retry||!0===e.retry,b=()=>({responseTypes:r,noticeContexts:n,shouldRetry:u,isSuccessResponse:s,isErrorResponse:l,isFailResponse:i})},,function(e,t){e.exports=window.wp.a11y},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(0),r=c(127);const n=()=>{const{notices:e,createNotice:t,removeNotice:c,setIsSuppressed:n}=Object(r.b)(),a=Object(o.useRef)(e);Object(o.useEffect)(()=>{a.current=e},[e]);const s=Object(o.useMemo)(()=>({hasNoticesOfType:e=>a.current.some(t=>t.type===e),removeNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.current.forEach(t=>{null!==e&&t.status!==e||c(t.id)})},removeNotice:c}),[c]),l=Object(o.useMemo)(()=>({addDefaultNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("default",e,{...c})},addErrorNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("error",e,{...c})},addWarningNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("warning",e,{...c})},addInfoNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("info",e,{...c})},addSuccessNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("success",e,{...c})}}),[t]);return{notices:e,...s,...l,setIsSuppressed:n}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(0);const r=Object(o.createContext)("page"),n=()=>Object(o.useContext)(r);r.Provider},,function(e,t,c){"use strict";c.d(t,"b",(function(){return a})),c.d(t,"a",(function(){return s}));var o=c(0),r=c(14);const n=Object(o.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),a=()=>Object(o.useContext)(n),s=e=>{let{children:t,currentPostId:c=0,currentView:a="",previewData:s={}}=e;const l=Object(r.useSelect)(e=>c||e("core/editor").getCurrentPostId(),[c]),i=Object(o.useCallback)(e=>e in s?s[e]:{},[s]),u={isEditor:!0,currentPostId:l,currentView:a,previewData:s,getPreviewData:i};return Object(o.createElement)(n.Provider,{value:u},t)}},,function(e,t,c){"use strict";c.d(t,"c",(function(){return n})),c.d(t,"d",(function(){return a})),c.d(t,"a",(function(){return s})),c.d(t,"b",(function(){return l}));var o=c(13),r=c(22);const n=(e,t)=>{if(r.n>2)return Object(o.registerBlockType)(e,t)},a=(e,t)=>{if(r.n>1)return Object(o.registerBlockType)(e,t)},s=()=>r.n>2,l=()=>r.n>1},function(e,t,c){"use strict";c.d(t,"c",(function(){return l})),c.d(t,"d",(function(){return i})),c.d(t,"b",(function(){return u})),c.d(t,"a",(function(){return b}));var o=c(7),r=c(50),n=c(36),a=c(144);const s=e=>Object(n.d)(e)?JSON.parse(e)||{}:Object(n.c)(e)?e:{},l=e=>{if(!Object(r.b)()||!Object(a.a)())return{style:{}};const t=Object(n.c)(e)?e:{},c=s(t.style);return Object(o.__experimentalGetSpacingClassesAndStyles)({...t,style:c})},i=e=>{const t=Object(n.c)(e)?e:{},c=s(t.style),o=Object(n.c)(c.typography)?c.typography:{};return{style:{fontSize:t.fontSize||o.fontSize,lineHeight:o.lineHeight,fontWeight:o.fontWeight,textTransform:o.textTransform,fontFamily:t.fontFamily}}},u=e=>{if(!Object(r.b)())return{className:"",style:{}};const t=Object(n.c)(e)?e:{},c=s(t.style);return Object(o.__experimentalUseColorProps)({...t,style:c})},b=e=>{if(!Object(r.b)())return{className:"",style:{}};const t=Object(n.c)(e)?e:{},c=s(t.style);return Object(o.__experimentalUseBorderProps)({...t,style:c})}},,,,function(e,t){e.exports=window.wc.wcBlocksSharedHocs},function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(4),s=c.n(a),l=c(3),i=c(9);c(84);class u extends n.Component{constructor(){super(...arguments),this.onClick=this.onClick.bind(this)}onClick(e){this.props.onChange&&this.props.onChange(e.target.value)}render(){const{label:e,checked:t,instanceId:c,className:o,help:a,options:i,value:u}=this.props,b="inspector-toggle-button-control-"+c;let d;return a&&(d="function"==typeof a?a(t):a),Object(n.createElement)(l.BaseControl,{id:b,help:d,className:s()("components-toggle-button-control",o)},Object(n.createElement)("label",{id:b+"__label",htmlFor:b,className:"components-toggle-button-control__label"},e),Object(n.createElement)(l.ButtonGroup,{"aria-labelledby":b+"__label"},i.map((t,c)=>{const o={};return u===t.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(n.createElement)(l.Button,r()({key:`${t.label}-${t.value}-${c}`,value:t.value,onClick:this.onClick,"aria-label":e+": "+t.label},o),t.label)})))}}t.a=Object(i.withInstanceId)(u)},,,function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(6),a=(c(10),c(3));t.a=e=>{let{columns:t,rows:c,setAttributes:s,alignButtons:l,minColumns:i=1,maxColumns:u=6,minRows:b=1,maxRows:d=6}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(a.RangeControl,{label:Object(r.__)("Columns","woo-gutenberg-products-block"),value:t,onChange:e=>{const t=Object(n.clamp)(e,i,u);s({columns:Number.isNaN(t)?"":t})},min:i,max:u}),Object(o.createElement)(a.RangeControl,{label:Object(r.__)("Rows","woo-gutenberg-products-block"),value:c,onChange:e=>{const t=Object(n.clamp)(e,b,d);s({rows:Number.isNaN(t)?"":t})},min:b,max:d}),Object(o.createElement)(a.ToggleControl,{label:Object(r.__)("Align Last Block","woo-gutenberg-products-block"),help:l?Object(r.__)("The last inner block will be aligned vertically.","woo-gutenberg-products-block"):Object(r.__)("The last inner block will follow other content.","woo-gutenberg-products-block"),checked:l,onChange:()=>s({alignButtons:!l})}))}},function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var o=c(61),r=c(0),n=c(35);const a=()=>{const e=Object(n.a)(),t=Object(r.useRef)(e);return Object(r.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(r.useCallback)((function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...c,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},function(e,t){e.exports=window.wp.hooks},,,,,function(e,t){e.exports=window.wp.deprecated},,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return b})),c.d(t,"b",(function(){return d})),c.d(t,"c",(function(){return p}));var o=c(18),r=c(14),n=c(0),a=c(25),s=c.n(a),l=c(38),i=c(110),u=c(46);const b=e=>{const t=Object(u.a)();e=e||t;const c=Object(r.useSelect)(t=>t(o.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:a}=Object(r.useDispatch)(o.QUERY_STATE_STORE_KEY);return[c,Object(n.useCallback)(t=>{a(e,t)},[e,a])]},d=(e,t,c)=>{const a=Object(u.a)();c=c||a;const s=Object(r.useSelect)(r=>r(o.QUERY_STATE_STORE_KEY).getValueForQueryKey(c,e,t),[c,e]),{setQueryValue:l}=Object(r.useDispatch)(o.QUERY_STATE_STORE_KEY);return[s,Object(n.useCallback)(t=>{l(c,e,t)},[c,e,l])]},p=(e,t)=>{const c=Object(u.a)();t=t||c;const[o,r]=b(t),a=Object(l.a)(o),d=Object(l.a)(e),p=Object(i.a)(d),m=Object(n.useRef)(!1);return Object(n.useEffect)(()=>{s()(p,d)||(r(Object.assign({},a,d)),m.current=!0)},[a,d,p,r]),m.current?[o,r]:[e,r]}},,,,function(e,t){e.exports=window.wp.autop},,,function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(136),s=c(4),l=c.n(s),i=c(100);c(159),t.a=e=>{let{className:t,showSpinner:c=!1,children:o,variant:s="contained",...u}=e;const b=l()("wc-block-components-button",t,s,{"wc-block-components-button--loading":c});return Object(n.createElement)(a.a,r()({className:b},u),c&&Object(n.createElement)(i.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},o))}},,function(e,t){e.exports=window.wp.dom},,function(e,t){},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return k}));var o=c(5),r=c.n(o),n=c(0),a=c(1),s=c(3),l=c(103),i=c(479),u=c(4),b=c.n(u),d=c(9),p=c(19),m=c(32),g=c(478),O=c(16);const j=e=>{let{id:t,label:c,popoverContents:o,remove:r,screenReaderLabel:i,className:u=""}=e;const[p,m]=Object(n.useState)(!1),h=Object(d.useInstanceId)(j);if(i=i||c,!c)return null;c=Object(O.decodeEntities)(c);const E=b()("woocommerce-tag",u,{"has-remove":!!r}),_="woocommerce-tag__label-"+h,f=Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{className:"screen-reader-text"},i),Object(n.createElement)("span",{"aria-hidden":"true"},c));return Object(n.createElement)("span",{className:E},o?Object(n.createElement)(s.Button,{className:"woocommerce-tag__text",id:_,onClick:()=>m(!0)},f):Object(n.createElement)("span",{className:"woocommerce-tag__text",id:_},f),o&&p&&Object(n.createElement)(s.Popover,{onClose:()=>m(!1)},o),r&&Object(n.createElement)(s.Button,{className:"woocommerce-tag__remove",onClick:r(t),label:Object(a.sprintf)(// Translators: %s label.
6
+ Object(a.__)("Remove %s","woo-gutenberg-products-block"),c),"aria-describedby":_},Object(n.createElement)(l.a,{icon:g.a,size:20,className:"clear-icon"})))};var h=j;const E=e=>Object(n.createElement)(m.b,e),_=e=>{const{list:t,selected:c,renderItem:o,depth:a=0,onSelect:s,instanceId:l,isSingle:i,search:u}=e;return t?Object(n.createElement)(n.Fragment,null,t.map(t=>{const b=-1!==c.findIndex(e=>{let{id:c}=e;return c===t.id});return Object(n.createElement)(n.Fragment,{key:t.id},Object(n.createElement)("li",null,o({item:t,isSelected:b,onSelect:s,isSingle:i,search:u,depth:a,controlId:l})),Object(n.createElement)(_,r()({},e,{list:t.children,depth:a+1})))})):null},f=e=>{let{isLoading:t,isSingle:c,selected:o,messages:r,onChange:l,onRemove:i}=e;if(t||c||!o)return null;const u=o.length;return Object(n.createElement)("div",{className:"woocommerce-search-list__selected"},Object(n.createElement)("div",{className:"woocommerce-search-list__selected-header"},Object(n.createElement)("strong",null,r.selected(u)),u>0?Object(n.createElement)(s.Button,{isLink:!0,isDestructive:!0,onClick:()=>l([]),"aria-label":r.clear},Object(a.__)("Clear all","woo-gutenberg-products-block")):null),u>0?Object(n.createElement)("ul",null,o.map((e,t)=>Object(n.createElement)("li",{key:t},Object(n.createElement)(h,{label:e.name,id:e.id,remove:i})))):null)},w=e=>{let{filteredList:t,search:c,onSelect:o,instanceId:r,...s}=e;const{messages:u,renderItem:b,selected:d,isSingle:p}=s,m=b||E;return 0===t.length?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-not-found"},Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-icon"},Object(n.createElement)(l.a,{icon:i.a})),Object(n.createElement)("span",{className:"woocommerce-search-list__not-found-text"},c?Object(a.sprintf)(u.noResults,c):u.noItems)):Object(n.createElement)("ul",{className:"woocommerce-search-list__list"},Object(n.createElement)(_,{list:t,selected:d,renderItem:m,onSelect:o,instanceId:r,isSingle:p,search:c}))},k=e=>{const{className:t="",isCompact:c,isHierarchical:o,isLoading:a,isSingle:l,list:i,messages:u=p.a,onChange:m,onSearch:g,selected:O,debouncedSpeak:j}=e,[h,E]=Object(n.useState)(""),_=Object(d.useInstanceId)(k),v=Object(n.useMemo)(()=>({...p.a,...u}),[u]),y=Object(n.useMemo)(()=>Object(p.c)(i,h,o),[i,h,o]);Object(n.useEffect)(()=>{j&&j(v.updated)},[j,v]),Object(n.useEffect)(()=>{"function"==typeof g&&g(h)},[h,g]);const S=Object(n.useCallback)(e=>()=>{l&&m([]);const t=O.findIndex(t=>{let{id:c}=t;return c===e});m([...O.slice(0,t),...O.slice(t+1)])},[l,O,m]),C=Object(n.useCallback)(e=>()=>{-1===O.findIndex(t=>{let{id:c}=t;return c===e.id})?m(l?[e]:[...O,e]):S(e.id)()},[l,S,m,O]);return Object(n.createElement)("div",{className:b()("woocommerce-search-list",t,{"is-compact":c})},Object(n.createElement)(f,r()({},e,{onRemove:S,messages:v})),Object(n.createElement)("div",{className:"woocommerce-search-list__search"},Object(n.createElement)(s.TextControl,{label:v.search,type:"search",value:h,onChange:e=>E(e)})),a?Object(n.createElement)("div",{className:"woocommerce-search-list__list is-loading"},Object(n.createElement)(s.Spinner,null)):Object(n.createElement)(w,r()({},e,{search:h,filteredList:y,messages:v,onSelect:C,instanceId:_})))};Object(s.withSpokenMessages)(k)},,function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(32),s=c(3),l=c(4),i=c.n(l);t.a=e=>{let{className:t,item:c,isSelected:o,isLoading:l,onSelect:u,disabled:b,...d}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.a,r()({},d,{key:c.id,className:t,isSelected:o,item:c,onSelect:u,isSingle:!0,disabled:b})),o&&l&&Object(n.createElement)("div",{key:"loading",className:i()("woocommerce-search-list__item","woocommerce-product-attributes__item","depth-1","is-loading","is-not-active")},Object(n.createElement)(s.Spinner,null)))}},function(e,t,c){"use strict";var o=c(0),r=c(6),n=c(1),a=c(3),s=c(11);function l(e){let{level:t}=e;const c={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return c.hasOwnProperty(t)?Object(o.createElement)(s.SVG,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},Object(o.createElement)(s.Path,{d:c[t]})):null}class i extends o.Component{createLevelControl(e,t,c){const r=e===t;return{icon:Object(o.createElement)(l,{level:e}),title:Object(n.sprintf)(
7
  /* translators: %s: heading level e.g: "2", "3", "4" */
8
+ Object(n.__)("Heading %d","woo-gutenberg-products-block"),e),isActive:r,onClick:()=>c(e)}}render(){const{isCollapsed:e=!0,minLevel:t,maxLevel:c,selectedLevel:n,onChange:s}=this.props;return Object(o.createElement)(a.ToolbarGroup,{isCollapsed:e,icon:Object(o.createElement)(l,{level:n}),controls:Object(r.range)(t,c).map(e=>this.createLevelControl(e,n,s))})}}t.a=i},,function(e,t){e.exports=window.wp.warning},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(103),a=c(202),s=c(2),l=c(7),i=c(28);t.a=e=>{const t=(Object(i.useProductDataContext)().product||{}).id||e.productId||0;return t?Object(o.createElement)(l.InspectorControls,null,Object(o.createElement)("div",{className:"wc-block-single-product__edit-card"},Object(o.createElement)("div",{className:"wc-block-single-product__edit-card-title"},Object(o.createElement)("a",{href:`${s.ADMIN_URL}post.php?post=${t}&action=edit`,target:"_blank",rel:"noopener noreferrer"},Object(r.__)("Edit this product's details","woo-gutenberg-products-block"),Object(o.createElement)(n.a,{icon:a.a,size:16}))),Object(o.createElement)("div",{className:"wc-block-single-product__edit-card-description"},Object(r.__)("Edit details such as title, price, description and more.","woo-gutenberg-products-block")))):null}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(0);const r=()=>{const[,e]=Object(o.useState)();return Object(o.useCallback)(t=>{e(()=>{throw t})},[])}},,,,,function(e,t,c){"use strict";var o=c(2),r=c(1),n=c(36);const a=Object(o.getSetting)("countryLocale",{}),s=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(r.sprintf)(
9
  /* translators: %s Field label. */
10
+ Object(r.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(n.b)(e.priority)&&(t.index=e.priority),Object(n.d)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(a).map(e=>{let[t,c]=e;return[t,Object.entries(c).map(e=>{let[t,c]=e;return[t,s(c)]}).reduce((e,t)=>{let[c,o]=t;return e[c]=o,e},{})]}).reduce((e,t)=>{let[c,o]=t;return e[c]=o,e},{});t.a=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const r=c&&void 0!==l[c]?l[c]:{};return e.map(e=>({key:e,...o.defaultAddressFields[e]||{},...r[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}},function(e,t,c){"use strict";var o=c(0);c(160),t.a=()=>Object(o.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},function(e,t){e.exports=window.wp.wordcount},function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(1),s=c(6),l=(c(10),c(32)),i=c(87),u=c(9),b=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{render(){const{selected:t}=this.props,c=null==t;return Object(n.createElement)(e,r()({},this.props,{selected:c?[]:[t]}))}}return t.defaultProps={selected:null},t},"withTransformSingleSelectToMultipleSelect"),d=c(194),p=c(24),m=c.n(p),g=c(25),O=c.n(g),j=c(26),h=c(27),E=Object(u.createHigherOrderComponent)(e=>{class t extends n.Component{constructor(){super(...arguments),m()(this,"state",{error:null,loading:!1,variations:{}}),m()(this,"loadVariations",()=>{const{products:e}=this.props,{loading:t,variations:c}=this.state;if(t)return;const o=this.getExpandedProduct();if(!o||c[o])return;const r=e.find(e=>e.id===o);r.variations&&0!==r.variations.length?(this.setState({loading:!0}),Object(j.g)(o).then(e=>{const t=e.map(e=>({...e,parent:o}));this.setState({variations:{...this.state.variations,[o]:t},loading:!1,error:null})}).catch(async e=>{const t=await Object(h.a)(e);this.setState({variations:{...this.state.variations,[o]:null},loading:!1,error:t})})):this.setState({variations:{...this.state.variations,[o]:null},loading:!1,error:null})})}componentDidMount(){const{selected:e,showVariations:t}=this.props;e&&t&&this.loadVariations()}componentDidUpdate(e){const{isLoading:t,selected:c,showVariations:o}=this.props;o&&(!O()(e.selected,c)||e.isLoading&&!t)&&this.loadVariations()}isProductId(e){const{products:t}=this.props;return t.some(t=>t.id===e)}findParentProduct(e){const{products:t}=this.props;return t.filter(t=>t.variations&&t.variations.find(t=>{let{id:c}=t;return c===e}))[0].id}getExpandedProduct(){const{isLoading:e,selected:t,showVariations:c}=this.props;if(!c)return null;let o=t&&t.length?t[0]:null;return o?this.prevSelectedItem=o:this.prevSelectedItem&&(e||this.isProductId(this.prevSelectedItem)||(o=this.prevSelectedItem)),!e&&o?this.isProductId(o)?o:this.findParentProduct(o):null}render(){const{error:t,isLoading:c}=this.props,{error:o,loading:a,variations:s}=this.state;return Object(n.createElement)(e,r()({},this.props,{error:o||t,expandedProduct:this.getExpandedProduct(),isLoading:c,variations:s,variationsLoading:a}))}}return m()(t,"defaultProps",{selected:[],showVariations:!1}),t},"withProductVariations"),_=c(31),f=c(4),w=c.n(f),k=c(89);c(139);const v={list:Object(a.__)("Products","woo-gutenberg-products-block"),noItems:Object(a.__)("Your store doesn't have any products.","woo-gutenberg-products-block"),search:Object(a.__)("Search for a product to display","woo-gutenberg-products-block"),updated:Object(a.__)("Product search results updated.","woo-gutenberg-products-block")},y=e=>{let{expandedProduct:t,error:c,instanceId:o,isCompact:u,isLoading:b,onChange:d,onSearch:p,products:m,renderItem:g,selected:O,showVariations:j,variations:h,variationsLoading:E}=e;if(c)return Object(n.createElement)(_.a,{error:c});const f=[...m,...h&&h[t]?h[t]:[]];return Object(n.createElement)(i.a,{className:"woocommerce-products",list:f,isCompact:u,isLoading:b,isSingle:!0,selected:f.filter(e=>{let{id:t}=e;return O.includes(t)}),onChange:d,renderItem:g||(j?e=>{const{item:t,search:c,depth:i=0,isSelected:u,onSelect:d}=e,p=t.variations&&Array.isArray(t.variations)?t.variations.length:0,m=w()("woocommerce-search-product__item","woocommerce-search-list__item","depth-"+i,"has-count",{"is-searching":c.length>0,"is-skip-level":0===i&&0!==t.parent,"is-variable":p>0});if(!t.breadcrumbs.length)return Object(n.createElement)(k.a,r()({},e,{className:w()(m,{"is-selected":u}),isSelected:u,item:t,onSelect:()=>()=>{d(t)()},isLoading:b||E,countLabel:t.variations.length>0?Object(a.sprintf)(
11
  /* translators: %1$d is the number of variations of a product product. */
12
  Object(a.__)("%1$d variations","woo-gutenberg-products-block"),t.variations.length):null,name:"products-"+o,"aria-label":Object(a.sprintf)(
13
  /* translators: %1$s is the product name, %2$d is the number of variations of that product. */
14
+ Object(a._n)("%1$s, has %2$d variation","%1$s, has %2$d variations",t.variations.length,"woo-gutenberg-products-block"),t.name,t.variations.length)}));const g=Object(s.isEmpty)(t.variation)?e:{...e,item:{...e.item,name:t.variation},"aria-label":`${t.breadcrumbs[0]}: ${t.variation}`};return Object(n.createElement)(l.a,r()({},g,{className:m,name:"variations-"+o}))}:null),onSearch:p,messages:v,isHierarchical:!0})};y.defaultProps={isCompact:!1,expandedProduct:null,selected:[],showVariations:!1},t.a=b(Object(d.a)(E(Object(u.withInstanceId)(y))))},,,,function(e,t,c){"use strict";var o=c(0),r=c(4),n=c.n(r),a=c(29),s=c(9);c(141),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:c,label:r="",onChange:s,options:l,screenReaderLabel:i,value:u}=e;const b="wc-block-components-sort-select__select-"+c;return Object(o.createElement)("div",{className:n()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(o.createElement)(a.a,{label:r,screenReaderLabel:i,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:b}}),Object(o.createElement)("select",{id:b,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,value:u},l&&l.map(e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label))))})},function(e,t,c){"use strict";var o=c(0),r=c(1),n=c(40),a=c(4),s=c.n(a),l=c(34);c(157);const i=e=>{let{currency:t,maxPrice:c,minPrice:a,priceClassName:i,priceStyle:u={}}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(r.sprintf)(
15
  /* translators: %1$s min price, %2$s max price */
16
+ Object(r.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(l.formatPrice)(a),Object(l.formatPrice)(c))),Object(o.createElement)("span",{"aria-hidden":!0},Object(o.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:a,style:u})," — ",Object(o.createElement)(n.a,{className:s()("wc-block-components-product-price__value",i),currency:t,value:c,style:u})))},u=e=>{let{currency:t,regularPriceClassName:c,regularPriceStyle:a,regularPrice:l,priceClassName:i,priceStyle:u,price:b}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("span",{className:"screen-reader-text"},Object(r.__)("Previous price:","woo-gutenberg-products-block")),Object(o.createElement)(n.a,{currency:t,renderText:e=>Object(o.createElement)("del",{className:s()("wc-block-components-product-price__regular",c),style:a},e),value:l}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(r.__)("Discounted price:","woo-gutenberg-products-block")),Object(o.createElement)(n.a,{currency:t,renderText:e=>Object(o.createElement)("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:u},e),value:b}))};t.a=e=>{let{align:t,className:c,currency:r,format:a="<price/>",maxPrice:l,minPrice:b,price:d,priceClassName:p,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:j}=e;const h=s()(c,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+t]:t});a.includes("<price/>")||(a="<price/>",console.error("Price formats need to include the `<price/>` tag."));const E=g&&d!==g;let _=Object(o.createElement)("span",{className:s()("wc-block-components-product-price__value",p)});return E?_=Object(o.createElement)(u,{currency:r,price:d,priceClassName:p,priceStyle:m,regularPrice:g,regularPriceClassName:O,regularPriceStyle:j}):void 0!==b&&void 0!==l?_=Object(o.createElement)(i,{currency:r,maxPrice:l,minPrice:b,priceClassName:p,priceStyle:m}):d&&(_=Object(o.createElement)(n.a,{className:s()("wc-block-components-product-price__value",p),currency:r,value:d,style:m})),Object(o.createElement)("span",{className:h},Object(o.createInterpolateElement)(a,{price:_}))}},,function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return s}));var o=c(6);let r;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(r||(r={}));const n={addEventCallback:function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(o.uniqueId)(),type:r.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:c}},removeEventCallback:(e,t)=>({id:t,type:r.REMOVE_EVENT_CALLBACK,eventType:e})},a={},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,{type:t,eventType:c,id:o,callback:n,priority:s}=arguments.length>1?arguments[1]:void 0;const l=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(t){case r.ADD_EVENT_CALLBACK:return l.set(o,{priority:s,callback:n}),{...e,[c]:l};case r.REMOVE_EVENT_CALLBACK:return l.delete(o),{...e,[c]:l}}}},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(8);function r(e,t){const c=Object(o.useRef)();return Object(o.useEffect)(()=>{c.current===e||t&&!t(e,c.current)||(c.current=e)},[e,t]),c.current}},,,,function(e,t,c){"use strict";c.d(t,"b",(function(){return l})),c.d(t,"a",(function(){return i}));var o=c(0),r=c(6),n=c(25),a=c.n(n);const s=Object(o.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),l=()=>Object(o.useContext)(s),i=e=>{let{children:t}=e;const[c,n]=Object(o.useState)({}),l=Object(o.useCallback)(e=>c[e],[c]),i=Object(o.useCallback)(e=>{const t=c[e];return!t||t.hidden?"":"validate-error-"+e},[c]),u=Object(o.useCallback)(e=>{n(t=>{if(!t[e])return t;const{[e]:c,...o}=t;return o})},[]),b=Object(o.useCallback)(()=>{n({})},[]),d=Object(o.useCallback)(e=>{e&&n(t=>(e=Object(r.pickBy)(e,(e,c)=>!("string"!=typeof e.message||t.hasOwnProperty(c)&&a()(t[c],e))),0===Object.values(e).length?t:{...t,...e}))},[]),p=Object(o.useCallback)((e,t)=>{n(c=>{if(!c.hasOwnProperty(e))return c;const o={...c[e],...t};return a()(c[e],o)?c:{...c,[e]:o}})},[]),m={getValidationError:l,setValidationErrors:d,clearValidationError:u,clearAllValidationErrors:b,hideValidationError:Object(o.useCallback)(e=>{p(e,{hidden:!0})},[p]),showValidationError:Object(o.useCallback)(e=>{p(e,{hidden:!1})},[p]),showAllValidationErrors:Object(o.useCallback)(()=>{n(e=>{const t={};return Object.keys(e).forEach(c=>{e[c].hidden&&(t[c]={...e[c],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:i};return Object(o.createElement)(s.Provider,{value:m},t)}},function(e,t,c){"use strict";c.d(t,"a",(function(){return i}));var o=c(18),r=c(14),n=c(0),a=c(38),s=c(94),l=c(36);const i=e=>{const{namespace:t,resourceName:c,resourceValues:i=[],query:u={},shouldSelect:b=!0}=e;if(!t||!c)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(n.useRef)({results:[],isLoading:!0}),p=Object(a.a)(u),m=Object(a.a)(i),g=Object(s.a)(),O=Object(r.useSelect)(e=>{if(!b)return null;const r=e(o.COLLECTIONS_STORE_KEY),n=[t,c,p,m],a=r.getCollectionError(...n);if(a){if(!Object(l.a)(a))throw new Error("TypeError: `error` object is not an instance of Error constructor");g(a)}return{results:r.getCollection(...n),isLoading:!r.hasFinishedResolution("getCollection",n)}},[t,c,m,p,b]);return null!==O&&(d.current=O),d.current}},,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(0);const r=Object(o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 230 250",style:{width:"100%"}},Object(o.createElement)("title",null,"Grid Block Preview"),Object(o.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:".779",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(o.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(o.createElement)("rect",{width:"65.374",height:"65.374",x:".162",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"47.266",height:"5.148",x:"9.216",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(o.createElement)("rect",{width:"62.8",height:"15",x:"1.565",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(o.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:".779",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(o.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(o.createElement)("rect",{width:"65.374",height:"65.374",x:"82.478",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"47.266",height:"5.148",x:"91.532",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(o.createElement)("rect",{width:"62.8",height:"15",x:"83.882",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(o.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:".779",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"76.153",fill:"#E1E3E6",rx:"2.574"}),Object(o.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"101.448",fill:"#E1E3E6",rx:"5"}),Object(o.createElement)("rect",{width:"65.374",height:"65.374",x:"164.788",y:"136.277",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"47.266",height:"5.148",x:"173.843",y:"211.651",fill:"#E1E3E6",rx:"2.574"}),Object(o.createElement)("rect",{width:"62.8",height:"15",x:"166.192",y:"236.946",fill:"#E1E3E6",rx:"5"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"86.301",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"13.283",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"21.498",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"29.713",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"37.927",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"46.238",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"95.599",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"103.814",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"112.029",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"120.243",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"128.554",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"177.909",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"186.124",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"194.339",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"202.553",y:"221.798",fill:"#E1E3E6",rx:"3"}),Object(o.createElement)("rect",{width:"6.177",height:"6.177",x:"210.864",y:"221.798",fill:"#E1E3E6",rx:"3"}))},function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(16),s=c(4),l=c.n(s);c(156),t.a=e=>{let{className:t="",disabled:c=!1,name:o,permalink:s="",rel:i,style:u,onClick:b,...d}=e;const p=l()("wc-block-components-product-name",t);if(c){const e=d;return Object(n.createElement)("span",r()({className:p},e,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(o)}}))}return Object(n.createElement)("a",r()({className:p,href:s,rel:i},d,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(o)},style:u}))}},function(e,t,c){"use strict";c.d(t,"b",(function(){return g})),c.d(t,"a",(function(){return O}));var o=c(0),r=(c(10),c(14)),n=c(60),a=c(48),s=c(5),l=c.n(s),i=c(4),u=c.n(i),b=c(494);c(158);const d=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""};var p=e=>{let{className:t,notices:c,removeNotice:r}=e;const n=c.filter(e=>"snackbar"!==e.type);if(!n.length)return null;const a=u()(t,"wc-block-components-notices");return Object(o.createElement)("div",{className:a},n.map(e=>Object(o.createElement)(b.a,l()({key:"store-notice-"+e.id},e,{className:u()("wc-block-components-notices__notice",d(e)),onRemove:()=>{e.isDismissible&&r(e.id)}}),e.content)))};const m=Object(o.createContext)({notices:[],createNotice:(e,t,c)=>{},removeNotice:(e,t)=>{},setIsSuppressed:e=>{},context:"wc/core"}),g=()=>Object(o.useContext)(m),O=e=>{let{children:t,className:c="",createNoticeContainer:s=!0,context:l="wc/core"}=e;const{createNotice:i,removeNotice:u}=Object(r.useDispatch)("core/notices"),[b,d]=Object(o.useState)(!1),{dispatchStoreEvent:g}=Object(n.a)(),{isEditor:O}=Object(a.b)(),j=Object(o.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i(e,t,{...c,context:c.context||l}),g("store-notice-create",{status:e,content:t,options:c})}),[i,g,l]),h=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;u(e,t)}),[u,l]),{notices:E}=Object(r.useSelect)(e=>({notices:e("core/notices").getNotices(l)}),[l]),_={notices:E,createNotice:j,removeNotice:h,context:l,setIsSuppressed:d},f=b?null:Object(o.createElement)(p,{className:c,notices:_.notices,removeNotice:_.removeNotice,isEditor:O});return Object(o.createElement)(m.Provider,{value:_},s&&f,t)}},function(e,t,c){"use strict";var o=c(0),r=c(101),n=c(77);const a=e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},s=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),l=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t,i=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;";const o=s(e),r=o.split(" ").splice(0,t).join(" ");return Object(n.autop)(l(r,c))},u=function(e,t){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;";const r=s(e),a=r.slice(0,t);if(c)return Object(n.autop)(l(a,o));const i=a.match(/([\s]+)/g),u=i?i.length:0,b=r.slice(0,t+u);return Object(n.autop)(l(b,o))};t.a=e=>{let{source:t,maxLength:c=15,countType:s="words",className:l="",style:b={}}=e;const d=Object(o.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const o=Object(n.autop)(e),s=Object(r.count)(o,c);if(s<=t)return o;const l=a(o),b=Object(r.count)(l,c);return b<=t?l:"words"===c?i(l,t):u(l,t,"characters_including_spaces"===c)}(t,c,s),[t,c,s]);return Object(o.createElement)(o.RawHTML,{style:b,className:l},d)}},,,,,,,,,function(e,t){},,function(e,t){},,function(e,t){},,,function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(7);const r=()=>"function"==typeof o.__experimentalGetSpacingClassesAndStyles},,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o}));const o=e=>e.reduce((e,t)=>{let[c,o]=t;return e[c]=o,e},{})},,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(3),s=c(4),l=c.n(s);c(209),t.a=function(e){let{className:t="",...c}=e;const o=l()("wc-block-text-toolbar-button",t);return Object(n.createElement)(a.Button,r()({className:o},c))}},,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=c(22),s=c(26),l=c(118),i=c(27);t.a=e=>t=>{let{selected:c,...o}=t;const[u,b]=Object(n.useState)(!0),[d,p]=Object(n.useState)(null),[m,g]=Object(n.useState)([]),O=a.o.productCount>100,j=async e=>{const t=await Object(i.a)(e);p(t),b(!1)},h=Object(n.useRef)(c);Object(n.useEffect)(()=>{Object(s.h)({selected:h.current}).then(e=>{g(e),b(!1)}).catch(j)},[h]);const E=Object(l.a)(e=>{Object(s.h)({selected:c,search:e}).then(e=>{g(e),b(!1)}).catch(j)},400),_=Object(n.useCallback)(e=>{b(!0),E(e)},[b,E]);return Object(n.createElement)(e,r()({},o,{selected:c,error:d,products:m,isLoading:u,onSearch:O?_:null}))}},function(e,t,c){"use strict";c.r(t);var o=c(0),r=(c(10),c(1)),n=c(4),a=c.n(n),s=c(29),l=c(28),i=c(55),u=(c(302),c(51));t.default=Object(i.withProductDataContext)(e=>{const{className:t,align:c}=e,{parentClassName:n}=Object(l.useInnerBlockLayoutContext)(),{product:i}=Object(l.useProductDataContext)(),b=Object(u.a)(e),d=Object(u.b)(e),p=Object(u.d)(e),m=Object(u.c)(e);if(!i.id||!i.on_sale)return null;const g="string"==typeof c?"wc-block-components-product-sale-badge--align-"+c:"";return Object(o.createElement)("div",{className:a()("wc-block-components-product-sale-badge",t,g,{[n+"__product-onsale"]:n},d.className,b.className),style:{...d.style,...b.style,...p.style,...m.style}},Object(o.createElement)(s.a,{label:Object(r.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(r.__)("Product on sale","woo-gutenberg-products-block")}))})},function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(0),r=(c(10),c(114));c(161);const n=e=>{let{errorMessage:t="",propertyName:c="",elementId:n=""}=e;const{getValidationError:a,getValidationErrorId:s}=Object(r.b)();if(!t||"string"!=typeof t){const e=a(c)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(o.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(o.createElement)("p",{id:s(n)},t))}},,,,,,,,,,,,,function(e,t){},function(e,t,c){"use strict";var o=c(0),r=c(11);const n=Object(o.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M15.55 13c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.37-.66-.11-1.48-.87-1.48H5.21l-.94-2H1v2h2l3.6 7.59-1.35 2.44C4.52 15.37 5.48 17 7 17h12v-2H7l1.1-2h7.45zM6.16 6h12.15l-2.76 5H8.53L6.16 6zM7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zm10 0c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"}));t.a=n},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t,c){"use strict";var o=c(50);let r={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(o.b)()&&(r={...r,align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}}),t.a=r},function(e,t,c){"use strict";var o=c(0),r=c(4),n=c.n(r),a=c(28),s=c(50),l=c(55),i=c(126),u=c(60),b=(c(301),c(51));const d=e=>{let{children:t,headingLevel:c,elementType:r="h"+c,...n}=e;return Object(o.createElement)(r,n,t)};t.a=Object(l.withProductDataContext)(e=>{const{className:t,headingLevel:c=2,showProductLink:r=!0,align:l}=e,{parentClassName:p}=Object(a.useInnerBlockLayoutContext)(),{product:m}=Object(a.useProductDataContext)(),{dispatchStoreEvent:g}=Object(u.a)(),O=Object(b.b)(e),j=Object(b.c)(e),h=Object(b.d)(e);return m.id?Object(o.createElement)(d,{headingLevel:c,className:n()(t,O.className,"wc-block-components-product-title",{[p+"__product-title"]:p,["wc-block-components-product-title--align-"+l]:l&&Object(s.b)()}),style:Object(s.b)()?{...j.style,...h.style,...O.style}:{}},Object(o.createElement)(i.a,{disabled:!r,name:m.name,permalink:m.permalink,rel:r?"nofollow":"",onClick:()=>{g("product-view-link",{product:m})}})):Object(o.createElement)(d,{headingLevel:c,className:n()(t,O.className,"wc-block-components-product-title",{[p+"__product-title"]:p,["wc-block-components-product-title--align-"+l]:l&&Object(s.b)()}),style:Object(s.b)()?{...j.style,...h.style,...O.style}:{}})})},function(e,t,c){"use strict";c.d(t,"c",(function(){return a})),c.d(t,"b",(function(){return s})),c.d(t,"a",(function(){return l}));const o=window.CustomEvent||null,r=(e,t)=>{let{bubbles:c=!1,cancelable:r=!1,element:n,detail:a={}}=t;if(!o)return;n||(n=document.body);const s=new o(e,{bubbles:c,cancelable:r,detail:a});n.dispatchEvent(s)};let n;const a=()=>{n&&clearTimeout(n),n=setTimeout(()=>{r("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},s=e=>{let{preserveCartData:t=!1}=e;r("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},l=function(e,t){let c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const n=()=>{r(t,{bubbles:c,cancelable:o})};return jQuery(document).on(e,n),()=>jQuery(document).off(e,n)}},function(e,t,c){"use strict";c.d(t,"b",(function(){return a})),c.d(t,"c",(function(){return s})),c.d(t,"a",(function(){return l}));var o=c(2),r=c(99),n=c(17);const a=e=>{let{country:t="",state:c="",city:o="",postcode:r=""}=e;return{country:t.trim(),state:c.trim(),city:o.trim(),postcode:r?r.replace(" ","").toUpperCase():""}},s=e=>{let{email:t=""}=e;return Object(n.isEmail)(t)?t.trim():""},l=e=>{const t=Object.keys(o.defaultAddressFields),c=Object(r.a)(t,{},e.country),n=Object.assign({},e);return c.forEach(t=>{let{key:c="",hidden:o=!1}=t;o&&((e,t)=>e in t)(c,e)&&(n[c]="")}),n}},function(e,t,c){"use strict";t.a={showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},function(e,t,c){"use strict";var o=c(5),r=c.n(o),n=c(0),a=(c(10),c(1)),s=c(4),l=c.n(s),i=c(2),u=c(28),b=c(55),d=c(60),p=c(195),m=(c(303),c(51));const g=()=>Object(n.createElement)("img",{src:i.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),O=e=>{let{image:t,onLoad:c,loaded:o,showFullSize:a,fallbackAlt:s}=e;const{thumbnail:l,src:i,srcset:u,sizes:b,alt:d}=t||{},p={alt:d||s,onLoad:c,hidden:!o,src:l,...a&&{src:i,srcSet:u,sizes:b}};return Object(n.createElement)(n.Fragment,null,p.src&&Object(n.createElement)("img",r()({"data-testid":"product-image"},p)),!o&&Object(n.createElement)(g,null))};t.a=Object(b.withProductDataContext)(e=>{const{className:t,imageSizing:c="full-size",showProductLink:o=!0,showSaleBadge:r,saleBadgeAlign:s="right"}=e,{parentClassName:i}=Object(u.useInnerBlockLayoutContext)(),{product:b}=Object(u.useProductDataContext)(),[j,h]=Object(n.useState)(!1),{dispatchStoreEvent:E}=Object(d.a)(),_=Object(m.d)(e),f=Object(m.a)(e);if(!b.id)return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",{[i+"__product-image"]:i})},Object(n.createElement)(g,null));const w=!!b.images.length,k=w?b.images[0]:null,v=o?"a":n.Fragment,y=Object(a.sprintf)(
17
  /* translators: %s is referring to the product name */
18
+ Object(a.__)("Link to %s","woo-gutenberg-products-block"),b.name),S={href:b.permalink,rel:"nofollow",...!w&&{"aria-label":y},onClick:()=>{E("product-view-link",{product:b})}};return Object(n.createElement)("div",{className:l()(t,"wc-block-components-product-image",{[i+"__product-image"]:i},f.className),style:{..._.style,...f.style}},Object(n.createElement)(v,o&&S,!!r&&Object(n.createElement)(p.default,{align:s,product:b}),Object(n.createElement)(O,{fallbackAlt:b.name,image:k,onLoad:()=>h(!0),loaded:j,showFullSize:"cropped"!==c})))})},function(e,t,c){"use strict";c.d(t,"a",(function(){return r}));var o=c(109);const r=(e,t)=>function(c){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=o.a.addEventCallback(e,c,r);return t(n),()=>{t(o.a.removeEventCallback(e,n.id))}}},function(e,t,c){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},function(e,t,c){"use strict";var o=c(0),r=(c(10),c(4)),n=c.n(r),a=c(1),s=c(38),l=c(470);const i={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},u={status:i.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},b={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:d,SET_IDLE:p,SET_DISABLED:m,SET_PROCESSING:g,SET_BEFORE_PROCESSING:O,SET_AFTER_PROCESSING:j,SET_PROCESSING_RESPONSE:h,SET_HAS_ERROR:E,SET_NO_ERROR:_,SET_QUANTITY:f,SET_REQUEST_PARAMS:w}=b,k=()=>({type:p}),v=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?E:_;return{type:t}},{SET_PRISTINE:y,SET_IDLE:S,SET_DISABLED:C,SET_PROCESSING:N,SET_BEFORE_PROCESSING:x,SET_AFTER_PROCESSING:P,SET_PROCESSING_RESPONSE:T,SET_HAS_ERROR:R,SET_NO_ERROR:I,SET_QUANTITY:A,SET_REQUEST_PARAMS:B}=b,{PRISTINE:L,IDLE:D,DISABLED:F,PROCESSING:V,BEFORE_PROCESSING:z,AFTER_PROCESSING:M}=i,H=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,{quantity:c,type:o,data:r}=arguments.length>1?arguments[1]:void 0;switch(o){case y:e=u;break;case S:e=t.status!==D?{...t,status:D}:t;break;case C:e=t.status!==F?{...t,status:F}:t;break;case A:e=c!==t.quantity?{...t,quantity:c}:t;break;case B:e={...t,requestParams:{...t.requestParams,...r}};break;case T:e={...t,processingResponse:r};break;case N:e=t.status!==V?{...t,status:V,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case x:e=t.status!==z?{...t,status:z,hasError:!1}:t;break;case P:e=t.status!==M?{...t,status:M}:t;break;case R:e=t.hasError?t:{...t,hasError:!0},e=t.status===V||t.status===z?{...e,status:D}:e;break;case I:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&o!==y&&e.status===L&&(e.status=D),e};var q=c(109),G=c(254);const Q=e=>({onAddToCartAfterProcessingWithSuccess:Object(G.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(G.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(G.a)("add_to_cart_before_processing",e)});var Y=c(257),U=c(114),$=c(45),W=c(42);const K=Object(o.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),J=()=>Object(o.useContext)(K),X=e=>{var t,c,r,n;let{children:b,product:p,showFormElements:E}=e;const[_,y]=Object(o.useReducer)(H,u),[S,C]=Object(o.useReducer)(q.b,{}),N=Object(s.a)(S),{addErrorNotice:x,removeNotices:P}=Object($.a)(),{setValidationErrors:T}=Object(U.b)(),{isSuccessResponse:R,isErrorResponse:I,isFailResponse:A}=Object(W.c)(),B=Object(o.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:Q(C).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:Q(C).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:Q(C).onAddToCartBeforeProcessing}),[C]),L=Object(o.useMemo)(()=>({resetForm:()=>{y({type:d})},submitForm:()=>{y({type:O})},setQuantity:e=>{y((e=>({type:f,quantity:e}))(e))},setHasError:e=>{y(v(e))},setRequestParams:e=>{y((e=>({type:w,data:e}))(e))},setAfterProcessing:e=>{y({type:h,data:e}),y({type:j})}}),[]);Object(o.useEffect)(()=>{const e=_.status,t=!p.id||!Object(l.a)(p);e!==i.DISABLED||t?e!==i.DISABLED&&t&&y({type:m}):y(k())},[_.status,p,y]),Object(o.useEffect)(()=>{_.status===i.BEFORE_PROCESSING&&(P("error"),Object(Y.a)(N,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:c}=e;t&&x(t),c&&T(c)}),y(k())):y({type:g})}))},[_.status,T,x,P,y,N]),Object(o.useEffect)(()=>{if(_.status===i.AFTER_PROCESSING){const e={processingResponse:_.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:c,messageContext:o}=e;(I(e)||A(e))&&c&&(t=!0,x(c,o?{context:o}:void 0))}),t};if(_.hasError)return void Object(Y.b)(N,"add_to_cart_after_processing_with_error",e).then(c=>{if(!t(c)){var o;const t=(null===(o=e.processingResponse)||void 0===o?void 0:o.message)||Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");x(t,{id:"add-to-cart"})}y(k())});Object(Y.b)(N,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?y(v(!0)):y(k())})}},[_.status,_.hasError,_.processingResponse,L,x,I,A,R,N]);const D=Object(l.b)(p),F={product:p,productType:p.type||"simple",productIsPurchasable:Object(l.a)(p),productHasOptions:p.has_options||!1,supportsFormElements:D,showFormElements:E&&D,quantity:_.quantity||(null==p||null===(t=p.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==p||null===(c=p.add_to_cart)||void 0===c?void 0:c.minimum)||1,maxQuantity:(null==p||null===(r=p.add_to_cart)||void 0===r?void 0:r.maximum)||99,multipleOf:(null==p||null===(n=p.add_to_cart)||void 0===n?void 0:n.multiple_of)||1,requestParams:_.requestParams,isIdle:_.status===i.IDLE,isDisabled:_.status===i.DISABLED,isProcessing:_.status===i.PROCESSING,isBeforeProcessing:_.status===i.BEFORE_PROCESSING,isAfterProcessing:_.status===i.AFTER_PROCESSING,hasError:_.hasError,eventRegistration:B,dispatchActions:L};return Object(o.createElement)(K.Provider,{value:F},b)};var Z=c(12),ee=c.n(Z),te=c(16),ce=c(250),oe=c(35),re=()=>{const{dispatchActions:e,product:t,quantity:c,eventRegistration:r,hasError:n,isProcessing:s,requestParams:l}=J(),{hasValidationErrors:i,showAllValidationErrors:u}=Object(U.b)(),{addErrorNotice:b,removeNotice:d}=Object($.a)(),{receiveCart:p}=Object(oe.a)(),[m,g]=Object(o.useState)(!1),O=!n&&s,j=Object(o.useCallback)(()=>!i||(u(),{type:"error"}),[i,u]);Object(o.useEffect)(()=>{const e=r.onAddToCartBeforeProcessing(j,0);return()=>{e()}},[r,j]);const h=Object(o.useCallback)(()=>{g(!0),d("add-to-cart");const o={id:t.id||0,quantity:c,...l};ee()({path:"/wc/store/cart/add-item",method:"POST",data:o,cache:"no-store",parse:!1}).then(t=>{ee.a.setNonce(t.headers),t.json().then((function(c){t.ok?p(c):(c.body&&c.body.message?b(Object(te.decodeEntities)(c.body.message),{id:"add-to-cart"}):b(Object(a.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),e.setHasError()),Object(ce.b)({preserveCartData:!0}),e.setAfterProcessing(c),g(!1)}))}).catch(t=>{t.json().then((function(t){var c;null!==(c=t.data)&&void 0!==c&&c.cart&&p(t.data.cart),e.setHasError(),e.setAfterProcessing(t),g(!1)}))})},[t,b,d,p,e,c,l]);return Object(o.useEffect)(()=>{O&&!m&&h()},[O,h,m]),null};const ne=e=>{let{children:t,product:c,showFormElements:r}=e;return Object(o.createElement)(U.a,null,Object(o.createElement)(X,{product:c,showFormElements:r},t,Object(o.createElement)(re,null)))};var ae=c(28),se=c(6),le=c(55),ie=(c(247),c(80)),ue=c(103),be=c(499),de=c(60),pe=c(355);const me=e=>{let{className:t,href:c,text:r,onClick:n}=e;return Object(o.createElement)(ie.a,{className:t,href:c,onClick:n,rel:"nofollow"},r)},ge=e=>{let{className:t,quantityInCart:c,isProcessing:r,isDisabled:n,isDone:s,onClick:l}=e;return Object(o.createElement)(ie.a,{className:t,disabled:n,showSpinner:r,onClick:l},s&&c>0?Object(a.sprintf)(
19
  /* translators: %s number of products in cart. */
20
+ Object(a._n)("%d in cart","%d in cart",c,"woo-gutenberg-products-block"),c):Object(a.__)("Add to cart","woo-gutenberg-products-block"),!!s&&Object(o.createElement)(ue.a,{icon:be.a}))};var Oe=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:c,product:r,productType:n,isDisabled:s,isProcessing:l,eventRegistration:i,hasError:u,dispatchActions:b}=J(),{parentName:d}=Object(ae.useInnerBlockLayoutContext)(),{dispatchStoreEvent:p}=Object(de.a)(),{cartQuantity:m}=Object(pe.a)(r.id||0),[g,O]=Object(o.useState)(!1),j=r.add_to_cart||{url:"",text:""};return Object(o.useEffect)(()=>{const e=i.onAddToCartAfterProcessingWithSuccess(()=>(u||O(!0),!0),0);return()=>{e()}},[i,u]),(e||!c&&"simple"===n)&&t?Object(o.createElement)(ge,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:m,isDisabled:s,isProcessing:l,isDone:g,onClick:()=>{b.submitForm(),p("cart-add-item",{product:r,listName:d})}}):Object(o.createElement)(me,{className:"wc-block-components-product-add-to-cart-button",href:j.url,text:j.text||Object(a.__)("View Product","woo-gutenberg-products-block"),onClick:()=>{p("product-view-link",{product:r,listName:d})}})},je=c(118),he=e=>{let{disabled:t,min:c,max:r,step:n=1,value:a,onChange:s}=e;const l=void 0!==r,i=Object(je.a)(e=>{let t=e;l&&(t=Math.min(t,Math.floor(r/n)*n)),t=Math.max(t,Math.ceil(c/n)*n),t=Math.floor(t/n)*n,t!==e&&s(t)},300);return Object(o.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:a,min:c,max:r,step:n,hidden:1===r,disabled:t,onChange:e=>{s(e.target.value),i(e.target.value)}})},Ee=e=>{let{reason:t=Object(a.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block")}=e;return Object(o.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},_e=()=>{const{product:e,quantity:t,minQuantity:c,maxQuantity:r,multipleOf:n,dispatchActions:s,isDisabled:l}=J();return e.id&&!e.is_purchasable?Object(o.createElement)(Ee,null):e.id&&!e.is_in_stock?Object(o.createElement)(Ee,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(he,{value:t,min:c,max:r,step:n,disabled:l,onChange:s.setQuantity}),Object(o.createElement)(Oe,null))},fe=(c(311),c(517)),we=c(8),ke=c(196);const ve={value:"",label:Object(a.__)("Select an option","woo-gutenberg-products-block")};var ye=e=>{let{attributeName:t,options:c=[],value:r="",onChange:s=(()=>{}),errorMessage:l=Object(a.__)("Please select a value.","woo-gutenberg-products-block")}=e;const{getValidationError:i,setValidationErrors:u,clearValidationError:b}=Object(U.b)(),d=t,p=i(d)||{};return Object(we.useEffect)(()=>{r?b(d):u({[d]:{message:l,hidden:!0}})},[r,d,l,b,u]),Object(we.useEffect)(()=>()=>{b(d)},[d,b]),Object(o.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(o.createElement)(fe.a,{label:Object(te.decodeEntities)(t),value:r||"",options:[ve,...c],onChange:s,required:!0,className:n()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":p.message&&!p.hidden})}),Object(o.createElement)(ke.a,{propertyName:d,elementId:d}))},Se=c(36);const Ce=(e,t,c)=>{const o=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(c).every(e=>""===e))return o;const r=Object.keys(e);return o.filter(e=>r.every(o=>{const r=c[o]||"",n=t["id:"+e].attributes[o];return""===r||null===n||n===r}))};var Ne=e=>{let{attributes:t,variationAttributes:c,setRequestParams:r}=e;const n=Object(s.a)(t),a=Object(s.a)(c),[l,i]=Object(o.useState)(0),[u,b]=Object(o.useState)({}),[d,p]=Object(o.useState)(!1),m=Object(o.useMemo)(()=>((e,t,c)=>{const o={},r=Object.keys(e),n=Object.values(c).filter(Boolean).length>0;return r.forEach(r=>{const a=e[r],s={...c,[r]:null},l=n?Ce(e,t,s):null,i=null!==l?l.map(e=>t["id:"+e].attributes[r]):null;o[r]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:c,slug:o}=e;return null===t||t.includes(null)||t.includes(o)?{value:o,label:Object(te.decodeEntities)(c)}:null}).filter(Boolean)}(a.terms,i)}),o})(n,a,u),[u,n,a]);return Object(o.useEffect)(()=>{if(!d){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(Se.c)(e))return{};const t=Object.keys(e),c={};return 0===t.length||t.forEach(t=>{const o=e[t],r=o.terms.filter(e=>e.default);var n;r.length>0&&(c[o.name]=null===(n=r[0])||void 0===n?void 0:n.slug)}),c}(t);e&&b({...e}),p(!0)}},[u,t,d]),Object(o.useEffect)(()=>{Object.values(u).filter(e=>""!==e).length===Object.keys(n).length?i(((e,t,c)=>Ce(e,t,c)[0]||0)(n,a,u)):l>0&&i(0)},[u,l,n,a]),Object(o.useEffect)(()=>{r({id:l,variation:Object.keys(u).map(e=>({attribute:e,value:u[e]}))})},[r,l,u]),Object(o.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(n).map(e=>Object(o.createElement)(ye,{key:e,attributeName:e,options:m[e],value:u[e],onChange:t=>{b({...u,[e]:t})}})))},xe=e=>{let{product:t,dispatchers:c}=e;const r=(e=>e?Object(se.keyBy)(Object.values(e).filter(e=>{let{has_variations:t}=e;return t}),"name"):{})(t.attributes),n=(e=>{if(!e)return{};const t={};return e.forEach(e=>{let{id:c,attributes:o}=e;t["id:"+c]={id:c,attributes:o.reduce((e,t)=>{let{name:c,value:o}=t;return e[c]=o,e},{})}}),t})(t.variations);return 0===Object.keys(r).length||0===n.length?null:Object(o.createElement)(Ne,{attributes:r,variationAttributes:n,setRequestParams:c.setRequestParams})},Pe=()=>{const{product:e,quantity:t,minQuantity:c,maxQuantity:r,multipleOf:n,dispatchActions:s,isDisabled:l}=J();return e.id&&!e.is_purchasable?Object(o.createElement)(Ee,null):e.id&&!e.is_in_stock?Object(o.createElement)(Ee,{reason:Object(a.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(xe,{product:e,dispatchers:s}),Object(o.createElement)(he,{value:t,min:c,max:r,step:n,disabled:l,onChange:s.setQuantity}),Object(o.createElement)(Oe,null))},Te=()=>Object(o.createElement)(Oe,null),Re=c(501),Ie=()=>Object(o.createElement)(Re.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element."),Ae=()=>Object(o.createElement)(Ie,null);const Be=()=>{const{showFormElements:e,productType:t}=J();return e?"variable"===t?Object(o.createElement)(Pe,null):"grouped"===t?Object(o.createElement)(Ae,null):"external"===t?Object(o.createElement)(Te,null):"simple"===t||"variation"===t?Object(o.createElement)(_e,null):null:Object(o.createElement)(Oe,null)};t.a=Object(le.withProductDataContext)(e=>{let{className:t,showFormElements:c}=e;const{product:r}=Object(ae.useProductDataContext)(),a=n()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(se.isEmpty)(r)});return Object(o.createElement)(ne,{product:r,showFormElements:c},Object(o.createElement)("div",{className:a},Object(o.createElement)(Be,null)))})},function(e,t,c){"use strict";c.d(t,"a",(function(){return n})),c.d(t,"b",(function(){return a}));const o=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var r=c(42);const n=async(e,t,c)=>{const r=o(e,t),n=[];for(const e of r)try{const t=await Promise.resolve(e.callback(c));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n},a=async(e,t,c)=>{const n=[],a=o(e,t);for(const e of a)try{const t=await Promise.resolve(e.callback(c));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(r.a)(t)||Object(r.b)(t))return n.push(t),n;n.push(t)}catch(e){return console.error(e),n.push({type:"error"}),n}return n}},,,,,function(e,t,c){"use strict";c.r(t);var o=c(0),r=(c(10),c(4)),n=c.n(r),a=c(107),s=c(34),l=c(28),i=c(7),u=c(50),b=c(55);t.default=Object(b.withProductDataContext)(e=>{var t,c;let{className:r,align:b,fontSize:d,customFontSize:p,saleFontSize:m,customSaleFontSize:g,color:O,customColor:j,saleColor:h,customSaleColor:E}=e;const{parentClassName:_}=Object(l.useInnerBlockLayoutContext)(),{product:f}=Object(l.useProductDataContext)(),w=n()(r,{[_+"__product-price"]:_});if(!f.id)return Object(o.createElement)(a.a,{align:b,className:w});const k=Object(i.getColorClassName)("color",O),v=Object(i.getFontSizeClass)(d),y=Object(i.getColorClassName)("color",h),S=Object(i.getFontSizeClass)(m),C=n()({"has-text-color":O||j,"has-font-size":d||p,[k]:k,[v]:v}),N=n()({"has-text-color":h||E,"has-font-size":m||g,[y]:y,[S]:S}),x={color:j,fontSize:p},P={color:E,fontSize:g},T=f.prices,R=Object(s.getCurrencyFromPriceResponse)(T),I=T.price!==T.regular_price,A=I?n()({[_+"__product-price__value"]:_,[N]:Object(u.b)()}):n()({[_+"__product-price__value"]:_,[C]:Object(u.b)()}),B=I?P:x;return Object(o.createElement)(a.a,{align:b,className:w,currency:R,price:T.price,priceClassName:A,priceStyle:Object(u.b)()?B:{},minPrice:null==T||null===(t=T.price_range)||void 0===t?void 0:t.min_amount,maxPrice:null==T||null===(c=T.price_range)||void 0===c?void 0:c.max_amount,regularPrice:T.regular_price,regularPriceClassName:n()({[_+"__product-price__regular"]:_,[C]:Object(u.b)()}),regularPriceStyle:Object(u.b)()?x:{}})})},function(e,t,c){"use strict";c.r(t);var o=c(0),r=(c(10),c(1)),n=c(4),a=c.n(n),s=c(28),l=c(55);c(304);t.default=Object(l.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=(e=>{const t=parseFloat(e.average_rating);return Number.isFinite(t)&&t>0?t:0})(n);if(!l)return null;const i={width:l/5*100+"%"},u=Object(r.sprintf)(
21
  /* translators: %f is referring to the average rating value */
22
  Object(r.__)("Rated %f out of 5","woo-gutenberg-products-block"),l),b=(e=>{const t=parseInt(e.review_count,10);return Number.isFinite(t)&&t>0?t:0})(n),d={__html:Object(r.sprintf)(
23
  /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
24
+ Object(r._n)("Rated %1$s out of 5 based on %2$s customer rating","Rated %1$s out of 5 based on %2$s customer ratings",b,"woo-gutenberg-products-block"),Object(r.sprintf)('<strong class="rating">%f</strong>',l),Object(r.sprintf)('<span class="rating">%d</span>',b))};return Object(o.createElement)("div",{className:a()(t,"wc-block-components-product-rating",{[c+"__product-rating"]:c})},Object(o.createElement)("div",{className:a()("wc-block-components-product-rating__stars",c+"__product-rating__stars"),role:"img","aria-label":u},Object(o.createElement)("span",{style:i,dangerouslySetInnerHTML:d})))})},function(e,t,c){"use strict";c.r(t);var o=c(5),r=c.n(o),n=c(0),a=(c(10),c(4)),s=c.n(a),l=c(1),i=c(60),u=c(355),b=c(16),d=c(22),p=c(2),m=c(28),g=c(55);c(305);const O=e=>{let{product:t}=e;const{id:c,permalink:o,add_to_cart:a,has_options:m,is_purchasable:g,is_in_stock:O}=t,{dispatchStoreEvent:j}=Object(i.a)(),{cartQuantity:h,addingToCart:E,addToCart:_}=Object(u.a)(c),f=Number.isFinite(h)&&h>0,w=!m&&g&&O,k=Object(b.decodeEntities)((null==a?void 0:a.description)||""),v=f?Object(l.sprintf)(
25
  /* translators: %s number of products in cart. */
26
+ Object(l._n)("%d in cart","%d in cart",h,"woo-gutenberg-products-block"),h):Object(b.decodeEntities)((null==a?void 0:a.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),y=w?"button":"a",S={};return w?S.onClick=()=>{_(),j("cart-add-item",{product:t});const{cartRedirectAfterAdd:e}=Object(p.getSetting)("productsSettings");e&&(window.location.href=d.d)}:(S.href=o,S.rel="nofollow",S.onClick=()=>{j("product-view-link",{product:t})}),Object(n.createElement)(y,r()({"aria-label":k,className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:E,added:f}),disabled:E},S),v)},j=()=>Object(n.createElement)("button",{className:s()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0});t.default=Object(g.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(m.useInnerBlockLayoutContext)(),{product:o}=Object(m.useProductDataContext)();return Object(n.createElement)("div",{className:s()(t,"wp-block-button","wc-block-components-product-button",{[c+"__product-add-to-cart"]:c})},o.id?Object(n.createElement)(O,{product:o}):Object(n.createElement)(j,null))})},function(e,t,c){"use strict";c.r(t);var o=c(0),r=(c(10),c(4)),n=c.n(r),a=c(128),s=c(22),l=c(28),i=c(55),u=(c(306),c(51));t.default=Object(i.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(l.useInnerBlockLayoutContext)(),{product:r}=Object(l.useProductDataContext)(),i=Object(u.b)(e),b=Object(u.d)(e);if(!r)return Object(o.createElement)("div",{className:n()(t,"wc-block-components-product-summary",{[c+"__product-summary"]:c})});const d=r.short_description?r.short_description:r.description;return d?Object(o.createElement)(a.a,{className:n()(t,i.className,"wc-block-components-product-summary",{[c+"__product-summary"]:c}),source:d,maxLength:150,countType:s.o.wordCountType||"words",style:{...i.style,...b.style}}):null})},function(e,t,c){"use strict";c.r(t);var o=c(0),r=c(1),n=(c(10),c(4)),a=c.n(n),s=c(28),l=c(55);c(307),t.default=Object(l.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=n.sku;return l?Object(o.createElement)("div",{className:a()(t,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(r.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,l)):null})},function(e,t,c){"use strict";c.r(t);var o=c(0),r=c(1),n=c(4),a=c.n(n),s=c(28),l=c(6),i=c(55),u=(c(308),c(51));t.default=Object(i.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),i=Object(u.b)(e),b=Object(u.d)(e);return Object(l.isEmpty)(n.categories)?null:Object(o.createElement)("div",{className:a()(t,"wc-block-components-product-category-list",i.className,{[c+"__product-category-list"]:c}),style:{...i.style,...b.style}},Object(r.__)("Categories:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.categories).map(e=>{let{name:t,link:c,slug:r}=e;return Object(o.createElement)("li",{key:"category-list-item-"+r},Object(o.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var o=c(0),r=c(1),n=(c(10),c(4)),a=c.n(n),s=c(28),l=c(6),i=c(55),u=(c(309),c(51));t.default=Object(i.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),i=Object(u.b)(e),b=Object(u.d)(e);return Object(l.isEmpty)(n.tags)?null:Object(o.createElement)("div",{className:a()(t,i.className,"wc-block-components-product-tag-list",{[c+"__product-tag-list"]:c}),style:{...i.style,...b.style}},Object(r.__)("Tags:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.tags).map(e=>{let{name:t,link:c,slug:r}=e;return Object(o.createElement)("li",{key:"tag-list-item-"+r},Object(o.createElement)("a",{href:c},t))})))})},function(e,t,c){"use strict";c.r(t);var o=c(0),r=c(1),n=(c(10),c(4)),a=c.n(n),s=c(28),l=c(55),i=(c(310),c(51));t.default=Object(l.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:n}=Object(s.useProductDataContext)(),l=Object(i.b)(e),u=Object(i.d)(e);if(!n.id||!n.is_purchasable)return null;const b=!!n.is_in_stock,d=n.low_stock_remaining,p=n.is_on_backorder;return Object(o.createElement)("div",{className:a()(t,l.className,"wc-block-components-product-stock-indicator",{[c+"__stock-indicator"]:c,"wc-block-components-product-stock-indicator--in-stock":b,"wc-block-components-product-stock-indicator--out-of-stock":!b,"wc-block-components-product-stock-indicator--low-stock":!!d,"wc-block-components-product-stock-indicator--available-on-backorder":!!p}),style:{...l.style,...u.style}},d?(e=>Object(r.sprintf)(
27
  /* translators: %d stock amount (number of items in stock for product) */
28
+ Object(r.__)("%d left in stock","woo-gutenberg-products-block"),e))(d):((e,t)=>t?Object(r.__)("Available on backorder","woo-gutenberg-products-block"):e?Object(r.__)("In Stock","woo-gutenberg-products-block"):Object(r.__)("Out of Stock","woo-gutenberg-products-block"))(b,p))})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return n}));var o=c(1),r=c(22);const n=[{id:1,name:"WordPress Pennant",variation:"",permalink:"https://example.org",sku:"wp-pennant",short_description:Object(o.__)("Fly your WordPress banner with this beauty! Deck out your office space or add it to your kids walls. This banner will spruce up any space it’s hung!","woo-gutenberg-products-block"),description:"Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",price:"7.99",price_html:'<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">$</span>7.99</span>',images:[{id:1,src:r.m+"previews/pennant.jpg",thumbnail:r.m+"previews/pennant.jpg",name:"pennant-1.jpg",alt:"WordPress Pennant",srcset:"",sizes:""}],average_rating:5,categories:[{id:1,name:"Decor",slug:"decor",link:"https://example.org"}],review_count:1,prices:{currency_code:"GBP",decimal_separator:".",thousand_separator:",",decimals:2,price_prefix:"£",price_suffix:"",price:"7.99",regular_price:"9.99",sale_price:"7.99",price_range:null},add_to_cart:{text:Object(o.__)("Add to cart","woo-gutenberg-products-block"),description:Object(o.__)("Add to cart","woo-gutenberg-products-block")},has_options:!1,is_purchasable:!0,is_in_stock:!0,on_sale:!0}]},,,,,,,,,,,,function(e,t,c){e.exports=c(432)},function(e,t){},function(e,t){},function(e,t){},function(e,t,c){"use strict";c.d(t,"a",(function(){return u}));var o=c(0),r=c(14),n=c(18),a=c(16),s=c(35),l=c(45);const i=(e,t)=>{const c=e.find(e=>{let{id:c}=e;return c===t});return c?c.quantity:0},u=e=>{const{addItemToCart:t}=Object(r.useDispatch)(n.CART_STORE_KEY),{cartItems:c,cartIsLoading:u}=Object(s.a)(),{addErrorNotice:b,removeNotice:d}=Object(l.a)(),[p,m]=Object(o.useState)(!1),g=Object(o.useRef)(i(c,e));return Object(o.useEffect)(()=>{const t=i(c,e);t!==g.current&&(g.current=t)},[c,e]),{cartQuantity:Number.isFinite(g.current)?g.current:0,addingToCart:p,cartIsLoading:u,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return m(!0),t(e,c).then(()=>{d("add-to-cart")}).catch(e=>{b(Object(a.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})}).finally(()=>{m(!1)})}}}},function(e,t){},,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.r(t),c.d(t,"blockSettings",(function(){return qt}));var o=c(5),r=c.n(o),n=c(0),a=c(1),s=c(7),l=c(13),i=c(103),u=c(490),b=c(50),d=c(4),p=c.n(d),m={category:"woocommerce-product-elements",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],icon:{src:Object(n.createElement)(i.a,{icon:u.a,className:"wc-block-editor-components-block-icon"})},supports:{html:!1},parent:Object(b.a)()?void 0:["@woocommerce/all-products","@woocommerce/single-product"],save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",{className:p()("is-loading",t.className)})},deprecated:[{attributes:{},save:()=>null}]},g=c(248),O=c(3),j=c(9),h=c(90),E=c(249),_=c(102),f=c(174),w=c(28);c(352);var k=e=>t=>c=>{const o=Object(w.useProductDataContext)(),{attributes:r,setAttributes:l}=c,{productId:i}=r,[u,b]=Object(n.useState)(!i);return o.hasContext?Object(n.createElement)(t,c):Object(n.createElement)(n.Fragment,null,u?Object(n.createElement)(O.Placeholder,{icon:e.icon||"",label:e.label||"",className:"wc-atomic-blocks-product"},!!e.description&&Object(n.createElement)("div",null,e.description),Object(n.createElement)("div",{className:"wc-atomic-blocks-product__selection"},Object(n.createElement)(_.a,{selected:i||0,showVariations:!0,onChange:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];l({productId:e[0]?e[0].id:0})}}),Object(n.createElement)(O.Button,{isSecondary:!0,disabled:!i,onClick:()=>{b(!1)}},Object(a.__)("Done","woo-gutenberg-products-block")))):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(O.ToolbarGroup,null,Object(n.createElement)(f.a,{onClick:()=>b(!0)},Object(a.__)("Switch product…","woo-gutenberg-products-block")))),Object(n.createElement)(t,c)))},v=c(491);const y=Object(a.__)("Product Title","woo-gutenberg-products-block"),S=Object(n.createElement)(i.a,{icon:v.a,className:"wc-block-editor-components-block-icon"}),C=Object(a.__)("Display the title of a product.","woo-gutenberg-products-block");c(353);const N=e=>{let{attributes:t,setAttributes:c}=e;const o=Object(s.useBlockProps)(),{headingLevel:r,showProductLink:l,align:i}=t;return Object(n.createElement)("div",o,Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(h.a,{isCollapsed:!0,minLevel:1,maxLevel:7,selectedLevel:r,onChange:e=>c({headingLevel:e})}),Object(b.b)()&&Object(n.createElement)(s.AlignmentToolbar,{value:i,onChange:e=>{c({align:e})}})),Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(a.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:l,onChange:()=>c({showProductLink:!l})}))),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(E.a,t)))};var x=Object(b.b)()?Object(j.compose)([k({icon:S,label:y,description:Object(a.__)("Choose a product to display its title.","woo-gutenberg-products-block")})])(N):N,P=c(144);const T={...m,apiVersion:2,title:y,description:C,icon:{src:S},attributes:g.a,edit:x,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))},supports:{...m.supports,...Object(b.b)()&&{typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0},color:{text:!0,background:!0,link:!1,gradients:!0,__experimentalSkipSerialization:!0},...Object(P.a)()&&{spacing:{margin:!0,__experimentalSkipSerialization:!0}},__experimentalSelector:".wc-block-components-product-title"}}};Object(l.registerBlockType)("woocommerce/product-title",T);var R=c(262),I=c(492);const A=Object(a.__)("Product Price","woo-gutenberg-products-block"),B=Object(n.createElement)(i.a,{icon:I.a,className:"wc-block-editor-components-block-icon"}),L=Object(a.__)("Display the price of a product.","woo-gutenberg-products-block"),D=e=>{let{fontSize:t,setFontSize:c,color:o,setColor:r,colorLabel:l}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(s.FontSizePicker,{value:t.size,onChange:c}),Object(n.createElement)(O.BaseControl,{label:l},Object(n.createElement)(s.ColorPalette,{value:o.color,onChange:r,label:Object(a.__)("Color","woo-gutenberg-products-block")})))},F=e=>{let{fontSize:t,saleFontSize:c,setFontSize:o,setSaleFontSize:r,color:l,saleColor:i,setColor:u,setSaleColor:d,attributes:p,setAttributes:m}=e;const{align:g}=p;return Object(n.createElement)(n.Fragment,null,Object(b.b)()&&Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(s.AlignmentToolbar,{value:g,onChange:e=>{m({align:e})}})),Object(n.createElement)(s.InspectorControls,null,Object(b.b)()&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Price","woo-gutenberg-products-block")},Object(n.createElement)(D,{color:l,setColor:u,fontSize:t,setFontSize:o,colorLabel:Object(a.__)("Color","woo-gutenberg-products-block")})),Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Sale price","woo-gutenberg-products-block")},Object(n.createElement)(D,{color:i,setColor:d,fontSize:c,setFontSize:r,colorLabel:Object(a.__)("Color","woo-gutenberg-products-block")})))),Object(n.createElement)(R.default,p))};var V=Object(b.b)()?Object(j.compose)([Object(s.withFontSizes)("fontSize"),Object(s.withFontSizes)("saleFontSize"),Object(s.withFontSizes)("originalFontSize"),Object(s.withColors)("color",{textColor:"color"}),Object(s.withColors)("saleColor",{textColor:"saleColor"}),Object(s.withColors)("originalColor",{textColor:"originalColor"}),k({icon:B,label:A,description:Object(a.__)("Choose a product to display its price.","woo-gutenberg-products-block")})])(F):F;let z={productId:{type:"number",default:0}};Object(b.b)()&&(z={...z,align:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},saleFontSize:{type:"string"},customSaleFontSize:{type:"number"},color:{type:"string"},saleColor:{type:"string"},customColor:{type:"string"},customSaleColor:{type:"string"}});const M={title:A,description:L,icon:{src:B},attributes:z,edit:V};Object(l.registerBlockType)("woocommerce/product-price",{...m,...M});var H=c(252);const q={...Object(b.b)()&&{__experimentalBorder:{radius:!0}},typography:{fontSize:!0}};var G=c(56),Q=c(2),Y=c(253),U=c(493);const $=Object(a.__)("Product Image","woo-gutenberg-products-block"),W=Object(n.createElement)(i.a,{icon:U.a,className:"wc-block-editor-components-block-icon"}),K=Object(a.__)("Display the main product image","woo-gutenberg-products-block");c(354);var J=k({icon:W,label:$,description:Object(a.__)("Choose a product to display its image.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const{showProductLink:o,imageSizing:r,showSaleBadge:l,saleBadgeAlign:i}=t,u=Object(s.useBlockProps)();return Object(n.createElement)("div",u,Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Content","woo-gutenberg-products-block")},Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Link to Product Page","woo-gutenberg-products-block"),help:Object(a.__)("Links the image to the single product listing.","woo-gutenberg-products-block"),checked:o,onChange:()=>c({showProductLink:!o})}),Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Show On-Sale Badge","woo-gutenberg-products-block"),help:Object(a.__)('Overlay a "sale" badge if the product is on-sale.',"woo-gutenberg-products-block"),checked:l,onChange:()=>c({showSaleBadge:!l})}),l&&Object(n.createElement)(G.a,{label:Object(a.__)("Sale Badge Alignment","woo-gutenberg-products-block"),value:i,options:[{label:Object(a.__)("Left","woo-gutenberg-products-block"),value:"left"},{label:Object(a.__)("Center","woo-gutenberg-products-block"),value:"center"},{label:Object(a.__)("Right","woo-gutenberg-products-block"),value:"right"}],onChange:e=>c({saleBadgeAlign:e})}),Object(n.createElement)(G.a,{label:Object(a.__)("Image Sizing","woo-gutenberg-products-block"),help:Object(n.createInterpolateElement)(Object(a.__)("Product image cropping can be modified in the <a>Customizer</a>.","woo-gutenberg-products-block"),{a:Object(n.createElement)("a",{href:Object(Q.getAdminLink)("customize.php")+"?autofocus[panel]=woocommerce&autofocus[section]=woocommerce_product_images",target:"_blank",rel:"noopener noreferrer"})}),value:r,options:[{label:Object(a.__)("Full Size","woo-gutenberg-products-block"),value:"full-size"},{label:Object(a.__)("Cropped","woo-gutenberg-products-block"),value:"cropped"}],onChange:e=>c({imageSizing:e})}))),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Y.a,t)))});const X={apiVersion:2,title:$,description:K,icon:{src:W},attributes:H.a,edit:J,supports:q,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(l.registerBlockType)("woocommerce/product-image",{...m,...X});var Z=c(263),ee=c(486);const te=Object(a.__)("Product Rating","woo-gutenberg-products-block"),ce=Object(n.createElement)(i.a,{icon:ee.a,className:"wc-block-editor-components-block-icon"}),oe={title:te,description:Object(a.__)("Display the average rating of a product.","woo-gutenberg-products-block"),icon:{src:ce},attributes:{productId:{type:"number",default:0}},edit:k({icon:ce,label:te,description:Object(a.__)("Choose a product to display its rating.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;return Object(n.createElement)(Z.default,t)})};Object(l.registerBlockType)("woocommerce/product-rating",{...m,...oe});var re=c(264),ne=c(495);const ae=Object(a.__)("Add to Cart Button","woo-gutenberg-products-block"),se=Object(n.createElement)(i.a,{icon:ne.a,className:"wc-block-editor-components-block-icon"}),le={title:ae,description:Object(a.__)("Display a call to action button which either adds the product to the cart, or links to the product page.","woo-gutenberg-products-block"),icon:{src:se},attributes:{productId:{type:"number",default:0}},edit:k({icon:se,label:ae,description:Object(a.__)("Choose a product to display its add to cart button.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;return Object(n.createElement)(O.Disabled,null,Object(n.createElement)(re.default,t))})};Object(l.registerBlockType)("woocommerce/product-button",{...m,...le});var ie=c(265),ue=c(496);const be=Object(a.__)("Product Summary","woo-gutenberg-products-block"),de=Object(n.createElement)(i.a,{icon:ue.a,className:"wc-block-editor-components-block-icon"}),pe=Object(a.__)("Display a short description about a product.","woo-gutenberg-products-block");c(356);var me=k({icon:de,label:be,description:Object(a.__)("Choose a product to display its short description.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(ie.default,t))});const ge={apiVersion:2,title:be,description:pe,icon:{src:de},attributes:{productId:{type:"number",default:0}},supports:{...Object(b.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-summary"}},edit:me,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(l.registerBlockType)("woocommerce/product-summary",{...m,...ge});var Oe=c(195),je=c(484);const he=Object(a.__)("On-Sale Badge","woo-gutenberg-products-block"),Ee=Object(n.createElement)(i.a,{icon:je.a,className:"wc-block-editor-components-block-icon"}),_e={title:he,description:Object(a.__)("Displays an on-sale badge if the product is on-sale.","woo-gutenberg-products-block"),icon:{src:Ee},apiVersion:2,supports:{html:!1,color:{gradients:!0,background:!0,link:!1,__experimentalSkipSerialization:!0},typography:{fontSize:!0,__experimentalSkipSerialization:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0},spacing:{padding:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wc-block-components-product-sale-badge"},attributes:{productId:{type:"number",default:0}},edit:k({icon:Ee,label:he,description:Object(a.__)("Choose a product to display its sale-badge.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(Oe.default,t))}),save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(l.registerBlockType)("woocommerce/product-sale-badge",{...m,..._e});var fe=c(93),we=c(266),ke=c(11),ve=Object(n.createElement)(ke.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)("path",{d:"M2 6h2v12H2V6m3 0h1v12H5V6m2 0h3v12H7V6m4 0h1v12h-1V6m3 0h2v12h-2V6m3 0h3v12h-3V6m4 0h1v12h-1V6z"}));const ye=Object(a.__)("Product SKU","woo-gutenberg-products-block"),Se=Object(n.createElement)(i.a,{icon:ve,className:"wc-block-editor-components-block-icon"}),Ce={title:ye,description:Object(a.__)("Display the SKU of a product.","woo-gutenberg-products-block"),icon:{src:Se},attributes:{productId:{type:"number",default:0}},edit:k({icon:Se,label:ye,description:Object(a.__)("Choose a product to display its SKU.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(fe.a,null),Object(n.createElement)(we.default,t))})};Object(b.c)("woocommerce/product-sku",{...m,...Ce});var Ne=c(267),xe=c(497);const Pe=Object(a.__)("Product Category List","woo-gutenberg-products-block"),Te=Object(n.createElement)(i.a,{icon:xe.a,className:"wc-block-editor-components-block-icon"}),Re=Object(a.__)("Display a list of categories belonging to a product.","woo-gutenberg-products-block");var Ie=k({icon:Te,label:Pe,description:Object(a.__)("Choose a product to display its categories.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(fe.a,null),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Ne.default,t)))});const Ae={...m,apiVersion:2,title:Pe,description:Re,icon:{src:Te},attributes:{productId:{type:"number",default:0}},supports:{...Object(b.b)()&&{color:{text:!0,link:!0,background:!1}},typography:{fontSize:!0}},save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))},edit:Ie};Object(b.c)("woocommerce/product-category-list",Ae);var Be=c(268),Le=c(489);const De=Object(a.__)("Product Tag List","woo-gutenberg-products-block"),Fe=Object(n.createElement)(i.a,{icon:Le.a,className:"wc-block-editor-components-block-icon"}),Ve=Object(a.__)("Display a list of tags belonging to a product.","woo-gutenberg-products-block");var ze=k({icon:Fe,label:De,description:Object(a.__)("Choose a product to display its tags.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(fe.a,null),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Be.default,t)))});const Me={apiVersion:2,title:De,description:Ve,icon:{src:Fe},attributes:{productId:{type:"number",default:0}},supports:{...Object(b.b)()&&{color:{text:!0,background:!1,link:!0}},typography:{fontSize:!0}},edit:ze,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(b.c)("woocommerce/product-tag-list",{...m,...Me});var He=c(269),qe=c(498);const Ge=Object(a.__)("Product Stock Indicator","woo-gutenberg-products-block"),Qe=Object(n.createElement)(i.a,{icon:qe.a,className:"wc-block-editor-components-block-icon"}),Ye=Object(a.__)("Display product stock status.","woo-gutenberg-products-block");var Ue=k({icon:Qe,label:Ge,description:Object(a.__)("Choose a product to display its stock.","woo-gutenberg-products-block")})(e=>{let{attributes:t}=e;const c=Object(s.useBlockProps)();return Object(n.createElement)("div",c,Object(n.createElement)(fe.a,null),Object(n.createElement)(He.default,t))});const $e={apiVersion:2,title:Ge,description:Ye,icon:{src:Qe},attributes:{productId:{type:"number",default:0}},supports:{...Object(b.b)()&&{color:{text:!0,background:!1,link:!1},typography:{fontSize:!0},__experimentalSelector:".wc-block-components-product-stock-indicator"}},edit:Ue,save:e=>{let{attributes:t}=e;return Object(n.createElement)("div",s.useBlockProps.save({className:p()("is-loading",t.className)}))}};Object(b.c)("woocommerce/product-stock-indicator",{...m,...$e});var We=c(470),Ke=(c(247),c(256)),Je=c(210);const Xe=Object(a.__)("Add to Cart","woo-gutenberg-products-block"),Ze=Object(n.createElement)(i.a,{icon:Je.a,className:"wc-block-editor-components-block-icon"}),et={title:Xe,description:Object(a.__)("Displays an add to cart button. Optionally displays other add to cart form elements.","woo-gutenberg-products-block"),icon:{src:Ze},edit:k({icon:Ze,label:Xe,description:Object(a.__)("Choose a product to display its add to cart form.","woo-gutenberg-products-block")})(e=>{let{attributes:t,setAttributes:c}=e;const{product:o}=Object(w.useProductDataContext)(),{className:r,showFormElements:l}=t;return Object(n.createElement)("div",{className:p()(r,"wc-block-components-product-add-to-cart")},Object(n.createElement)(fe.a,{productId:o.id}),Object(n.createElement)(s.InspectorControls,null,Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Layout","woo-gutenberg-products-block")},Object(We.b)(o)?Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Display form elements","woo-gutenberg-products-block"),help:Object(a.__)("Depending on product type, allow customers to select a quantity, variations etc.","woo-gutenberg-products-block"),checked:l,onChange:()=>c({showFormElements:!l})}):Object(n.createElement)(O.Notice,{className:"wc-block-components-product-add-to-cart-notice",isDismissible:!1,status:"info"},Object(a.__)("This product does not support the block based add to cart form. A link to the product page will be shown instead.","woo-gutenberg-products-block")))),Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Ke.a,t)))}),attributes:c(255).a};Object(b.c)("woocommerce/product-add-to-cart",{...m,...et});var tt=c(24),ct=c.n(tt),ot=c(14),rt=(c(10),c(59)),nt=c(461),at=c(339),st=c(22);const lt=(e,t)=>{const{className:c,contentVisibility:o}=t;return p()(e,c,{"has-image":o&&o.image,"has-title":o&&o.title,"has-rating":o&&o.rating,"has-price":o&&o.price,"has-button":o&&o.button})};var it=c(202);const ut=[["woocommerce/product-image",{imageSizing:"cropped"}],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],bt=e=>e&&0!==e.length?e.map(e=>[e.name,{...e.attributes,product:void 0,children:e.innerBlocks.length>0?bt(e.innerBlocks):[]}]):[];var dt=c(8),pt=c(6),mt=c(29);c(362);var gt=e=>{let{currentPage:t,displayFirstAndLastPages:c=!0,displayNextAndPreviousArrows:o=!0,pagesToDisplay:r=3,onPageChange:s,totalPages:l}=e,{minIndex:i,maxIndex:u}=((e,t,c)=>{if(c<=2)return{minIndex:null,maxIndex:null};const o=e-1,r=Math.max(Math.floor(t-o/2),2),n=Math.min(Math.ceil(t+(o-(t-r))),c-1);return{minIndex:Math.max(Math.floor(t-(o-(n-t))),2),maxIndex:n}})(r,t,l);const b=c&&Boolean(1!==i),d=c&&Boolean(u!==l),m=c&&Boolean(i&&i>3),g=c&&Boolean(u&&u<l-2);b&&3===i&&(i-=1),d&&u===l-2&&(u+=1);const O=[];if(i&&u)for(let e=i;e<=u;e++)O.push(e);return Object(n.createElement)("div",{className:"wc-block-pagination wc-block-components-pagination"},Object(n.createElement)(mt.a,{screenReaderLabel:Object(a.__)("Navigate to another page","woo-gutenberg-products-block")}),o&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>s(t-1),title:Object(a.__)("Previous page","woo-gutenberg-products-block"),disabled:t<=1},Object(n.createElement)(mt.a,{label:"←",screenReaderLabel:Object(a.__)("Previous page","woo-gutenberg-products-block")})),b&&Object(n.createElement)("button",{className:p()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":1===t,"wc-block-components-pagination__page--active":1===t}),onClick:()=>s(1),disabled:1===t},Object(n.createElement)(mt.a,{label:"1",screenReaderLabel:Object(a.sprintf)(
29
  /* translators: %d is the page number (1, 2, 3...). */
30
+ Object(a.__)("Page %d","woo-gutenberg-products-block"),1)})),m&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(a.__)("…","woo-gutenberg-products-block")),O.map(e=>Object(n.createElement)("button",{key:e,className:p()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===e,"wc-block-components-pagination__page--active":t===e}),onClick:t===e?void 0:()=>s(e),disabled:t===e},Object(n.createElement)(mt.a,{label:e.toString(),screenReaderLabel:Object(a.sprintf)(
31
  /* translators: %d is the page number (1, 2, 3...). */
32
+ Object(a.__)("Page %d","woo-gutenberg-products-block"),e)}))),g&&Object(n.createElement)("span",{className:"wc-block-pagination-ellipsis wc-block-components-pagination__ellipsis","aria-hidden":"true"},Object(a.__)("…","woo-gutenberg-products-block")),d&&Object(n.createElement)("button",{className:p()("wc-block-pagination-page","wc-block-components-pagination__page",{"wc-block-pagination-page--active":t===l,"wc-block-components-pagination__page--active":t===l}),onClick:()=>s(l),disabled:t===l},Object(n.createElement)(mt.a,{label:l.toString(),screenReaderLabel:Object(a.sprintf)(
33
  /* translators: %d is the page number (1, 2, 3...). */
34
+ Object(a.__)("Page %d","woo-gutenberg-products-block"),l)})),o&&Object(n.createElement)("button",{className:"wc-block-pagination-page wc-block-components-pagination__page wc-block-components-pagination-page--arrow",onClick:()=>s(t+1),title:Object(a.__)("Next page","woo-gutenberg-products-block"),disabled:t>=l},Object(n.createElement)(mt.a,{label:"→",screenReaderLabel:Object(a.__)("Next page","woo-gutenberg-products-block")})))},Ot=c(110),jt=c(73),ht=c(115),Et=c(18),_t=c(38);var ft=c(60);c(363);const wt=e=>{if(!e)return;const t=e.getBoundingClientRect().bottom;t>=0&&t<=window.innerHeight||e.scrollIntoView()};var kt=c(44),vt=c(155),yt=()=>{const{parentClassName:e}=Object(w.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:e+"__no-products"},Object(n.createElement)(i.a,{className:e+"__no-products-image",icon:vt.a,size:100}),Object(n.createElement)("strong",{className:e+"__no-products-title"},Object(a.__)("No products","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:e+"__no-products-description"},Object(a.__)("There are currently no products available to display.","woo-gutenberg-products-block")))},St=c(488),Ct=e=>{let{resetCallback:t=(()=>{})}=e;const{parentClassName:c}=Object(w.useInnerBlockLayoutContext)();return Object(n.createElement)("div",{className:c+"__no-products"},Object(n.createElement)(i.a,{className:c+"__no-products-image",icon:St.a,size:100}),Object(n.createElement)("strong",{className:c+"__no-products-title"},Object(a.__)("No products found","woo-gutenberg-products-block")),Object(n.createElement)("p",{className:c+"__no-products-description"},Object(a.__)("We were unable to find any results based on your search.","woo-gutenberg-products-block")),Object(n.createElement)("button",{onClick:t},Object(a.__)("Reset Search","woo-gutenberg-products-block")))},Nt=c(106);c(361);var xt=e=>{let{onChange:t,value:c}=e;return Object(n.createElement)(Nt.a,{className:"wc-block-product-sort-select wc-block-components-product-sort-select",onChange:t,options:[{key:"menu_order",label:Object(a.__)("Default sorting","woo-gutenberg-products-block")},{key:"popularity",label:Object(a.__)("Popularity","woo-gutenberg-products-block")},{key:"rating",label:Object(a.__)("Average rating","woo-gutenberg-products-block")},{key:"date",label:Object(a.__)("Latest","woo-gutenberg-products-block")},{key:"price",label:Object(a.__)("Price: low to high","woo-gutenberg-products-block")},{key:"price-desc",label:Object(a.__)("Price: high to low","woo-gutenberg-products-block")}],screenReaderLabel:Object(a.__)("Order products by","woo-gutenberg-products-block"),value:c})};const Pt=(e,t,c,o)=>{if(!c)return;const a=Object(nt.a)(e);return c.map((c,s)=>{let[l,i={}]=c,u=[];i.children&&i.children.length>0&&(u=Pt(e,t,i.children,o));const b=a[l];if(!b)return null;const d=t.id||0,p=["layout",l,s,o,d];return Object(n.createElement)(n.Suspense,{key:p.join("_"),fallback:Object(n.createElement)("div",{className:"wc-block-placeholder"})},Object(n.createElement)(b,r()({},i,{children:u,product:t})))})};var Tt=Object(j.withInstanceId)(e=>{let{product:t={},attributes:c,instanceId:o}=e;const{layoutConfig:r}=c,{parentClassName:a,parentName:s}=Object(w.useInnerBlockLayoutContext)(),l=0===Object.keys(t).length,i=p()(a+"__product","wc-block-layout",{"is-loading":l});return Object(n.createElement)("li",{className:i,"aria-hidden":l},Pt(s,t,r,o))});c(360);const Rt=e=>{switch(e){case"menu_order":case"popularity":case"rating":case"price":return{orderby:e,order:"asc"};case"price-desc":return{orderby:"price",order:"desc"};case"date":return{orderby:"date",order:"desc"}}},It=function(e){let{totalQuery:t,totalProducts:c}=e,{totalQuery:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!Object(pt.isEqual)(t,o)&&Number.isFinite(c)};var At,Bt=(At=e=>{let{attributes:t,currentPage:c,onPageChange:o,onSortChange:r,sortValue:s,scrollToTop:l}=e;const[i,u]=Object(jt.b)("attributes",[]),[b,d]=Object(jt.b)("stock_status",[]),[m,g]=Object(jt.b)("min_price"),[O,j]=Object(jt.b)("max_price"),[h]=Object(jt.c)((e=>{let{sortValue:t,currentPage:c,attributes:o}=e;const{columns:r,rows:n}=o;return{...Rt(t),catalog_visibility:"catalog",per_page:r*n,page:c}})({attributes:t,sortValue:s,currentPage:c})),{products:E,totalProducts:_,productsLoading:f}=(e=>{const t={namespace:"/wc/store",resourceName:"products"},{results:c,isLoading:o}=Object(ht.a)({...t,query:e}),{value:r}=((e,t)=>{const{namespace:c,resourceName:o,resourceValues:r=[],query:n={}}=t;if(!c||!o)throw new Error("The options object must have valid values for the namespace and the resource name properties.");const a=Object(_t.a)(n),s=Object(_t.a)(r),{value:l,isLoading:i=!0}=Object(ot.useSelect)(e=>{const t=e(Et.COLLECTIONS_STORE_KEY),r=["x-wp-total",c,o,a,s];return{value:t.getCollectionHeader(...r),isLoading:t.hasFinishedResolution("getCollectionHeader",r)}},["x-wp-total",c,o,s,a]);return{value:l,isLoading:i}})(0,{...t,query:e});return{products:c,totalProducts:parseInt(r,10),productsLoading:o}})(h),{parentClassName:k,parentName:v}=Object(w.useInnerBlockLayoutContext)(),y=(e=>{const{order:t,orderby:c,page:o,per_page:r,...n}=e;return n||{}})(h),{dispatchStoreEvent:S}=Object(ft.a)(),C=Object(Ot.a)({totalQuery:y,totalProducts:_},It);Object(n.useEffect)(()=>{S("product-list-render",{products:E,listName:v})},[E,v,S]),Object(n.useEffect)(()=>{Object(pt.isEqual)(y,null==C?void 0:C.totalQuery)||(o(1),null!=C&&C.totalQuery&&(e=>{Number.isFinite(e)&&(0===e?Object(kt.speak)(Object(a.__)("No products found","woo-gutenberg-products-block")):Object(kt.speak)(Object(a.sprintf)(
35
  /* translators: %s is an integer higher than 0 (1, 2, 3...) */
36
+ Object(a._n)("%d product found","%d products found",e,"woo-gutenberg-products-block"),e)))})(_))},[null==C?void 0:C.totalQuery,_,o,y]);const{contentVisibility:N}=t,x=t.columns*t.rows,P=!Number.isFinite(_)&&Number.isFinite(null==C?void 0:C.totalProducts)&&Object(pt.isEqual)(y,null==C?void 0:C.totalQuery)?Math.ceil(((null==C?void 0:C.totalProducts)||0)/x):Math.ceil(_/x),T=E.length?E:Array.from({length:x}),R=0!==E.length||f,I=i.length>0||b.length>0||Number.isFinite(m)||Number.isFinite(O);return Object(n.createElement)("div",{className:(()=>{const{columns:e,rows:c,alignButtons:o,align:r}=t,n=void 0!==r?"align"+r:"";return p()(k,n,"has-"+e+"-columns",{"has-multiple-rows":c>1,"has-aligned-buttons":o})})()},(null==N?void 0:N.orderBy)&&R&&Object(n.createElement)(xt,{onChange:r,value:s}),!R&&I&&Object(n.createElement)(Ct,{resetCallback:()=>{u([]),d([]),g(null),j(null)}}),!R&&!I&&Object(n.createElement)(yt,null),R&&Object(n.createElement)("ul",{className:k+"__products"},T.map((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=arguments.length>1?arguments[1]:void 0;return Object(n.createElement)(Tt,{key:e.id||c,attributes:t,product:e})}))),P>1&&Object(n.createElement)(gt,{currentPage:c,onPageChange:e=>{l({focusableSelector:"a, button"}),o(e)},totalPages:P}))},e=>{const t=Object(n.useRef)(null);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"with-scroll-to-top__scroll-point",ref:t,"aria-hidden":!0}),Object(n.createElement)(At,r()({},e,{scrollToTop:e=>{null!==t.current&&((e,t)=>{const{focusableSelector:c}=t||{};window&&Number.isFinite(window.innerHeight)&&(c?((e,t)=>{var c;const o=(null===(c=e.parentElement)||void 0===c?void 0:c.querySelectorAll(t))||[];if(o.length){const e=o[0];wt(e),null==e||e.focus()}else wt(e)})(e,c):wt(e))})(t.current,e)}})))}),Lt=e=>{let{attributes:t}=e;const[c,o]=Object(n.useState)(1),[r,a]=Object(n.useState)(t.orderby);return Object(n.useEffect)(()=>{a(t.orderby)},[t.orderby]),Object(n.createElement)(Bt,{attributes:t,currentPage:c,onPageChange:e=>{o(e)},onSortChange:e=>{var t;const c=null==e||null===(t=e.target)||void 0===t?void 0:t.value;a(c),o(1)},sortValue:r})},Dt=c(125);class Ft extends dt.Component{render(){const{attributes:e,urlParameterSuffix:t}=this.props;return e.isPreview?Dt.a:Object(n.createElement)(w.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(n.createElement)(Lt,{attributes:e,urlParameterSuffix:t}))}}var Vt=Ft;c(359);class zt extends n.Component{constructor(){super(...arguments),ct()(this,"state",{isEditing:!1,innerBlocks:[]}),ct()(this,"blockMap",Object(nt.a)("woocommerce/all-products")),ct()(this,"componentDidMount",()=>{const{block:e}=this.props;this.setState({innerBlocks:e.innerBlocks})}),ct()(this,"getTitle",()=>Object(a.__)("All Products","woo-gutenberg-products-block")),ct()(this,"getIcon",()=>Object(n.createElement)(i.a,{icon:u.a})),ct()(this,"togglePreview",()=>{const{debouncedSpeak:e}=this.props;this.setState({isEditing:!this.state.isEditing}),this.state.isEditing||e(Object(a.__)("Showing All Products block preview.","woo-gutenberg-products-block"))}),ct()(this,"getInspectorControls",()=>{const{attributes:e,setAttributes:t}=this.props,{columns:c,rows:o,alignButtons:r}=e;return Object(n.createElement)(s.InspectorControls,{key:"inspector"},Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Layout Settings","woo-gutenberg-products-block"),initialOpen:!0},Object(n.createElement)(rt.a,{columns:c,rows:o,alignButtons:r,setAttributes:t,minColumns:Object(Q.getSetting)("min_columns",1),maxColumns:Object(Q.getSetting)("max_columns",6),minRows:Object(Q.getSetting)("min_rows",1),maxRows:Object(Q.getSetting)("max_rows",6)})),Object(n.createElement)(O.PanelBody,{title:Object(a.__)("Content Settings","woo-gutenberg-products-block")},((e,t)=>{const{contentVisibility:c}=e;return Object(n.createElement)(O.ToggleControl,{label:Object(a.__)("Show Sorting Dropdown","woo-gutenberg-products-block"),checked:c.orderBy,onChange:()=>t({contentVisibility:{...c,orderBy:!c.orderBy}})})})(e,t),((e,t)=>Object(n.createElement)(O.SelectControl,{label:Object(a.__)("Order Products By","woo-gutenberg-products-block"),value:e.orderby,options:[{label:Object(a.__)("Default sorting (menu order)","woo-gutenberg-products-block"),value:"menu_order"},{label:Object(a.__)("Popularity","woo-gutenberg-products-block"),value:"popularity"},{label:Object(a.__)("Average rating","woo-gutenberg-products-block"),value:"rating"},{label:Object(a.__)("Latest","woo-gutenberg-products-block"),value:"date"},{label:Object(a.__)("Price: low to high","woo-gutenberg-products-block"),value:"price"},{label:Object(a.__)("Price: high to low","woo-gutenberg-products-block"),value:"price-desc"}],onChange:e=>t({orderby:e})}))(e,t)))}),ct()(this,"getBlockControls",()=>{const{isEditing:e}=this.state;return Object(n.createElement)(s.BlockControls,null,Object(n.createElement)(O.ToolbarGroup,{controls:[{icon:"edit",title:Object(a.__)("Edit inner product layout","woo-gutenberg-products-block"),onClick:()=>this.togglePreview(),isActive:e}]}))}),ct()(this,"renderEditMode",()=>{const e={template:this.props.attributes.layoutConfig,templateLock:!1,allowedBlocks:Object.keys(this.blockMap)};return 0!==this.props.attributes.layoutConfig.length&&(e.renderAppender=!1),Object(n.createElement)(O.Placeholder,{icon:this.getIcon(),label:this.getTitle()},Object(a.__)("Display all products from your store as a grid.","woo-gutenberg-products-block"),Object(n.createElement)("div",{className:"wc-block-all-products-grid-item-template"},Object(n.createElement)(O.Tip,null,Object(a.__)("Edit the blocks inside the preview below to change the content displayed for each product within the product grid.","woo-gutenberg-products-block")),Object(n.createElement)(w.InnerBlockLayoutContextProvider,{parentName:"woocommerce/all-products",parentClassName:"wc-block-grid"},Object(n.createElement)("div",{className:"wc-block-grid wc-block-layout has-1-columns"},Object(n.createElement)("ul",{className:"wc-block-grid__products"},Object(n.createElement)("li",{className:"wc-block-grid__product"},Object(n.createElement)(w.ProductDataContextProvider,{product:at.a[0]},Object(n.createElement)(s.InnerBlocks,e)))))),Object(n.createElement)("div",{className:"wc-block-all-products__actions"},Object(n.createElement)(O.Button,{className:"wc-block-all-products__done-button",isPrimary:!0,onClick:()=>{const{block:e,setAttributes:t}=this.props;t({layoutConfig:bt(e.innerBlocks)}),this.setState({innerBlocks:e.innerBlocks}),this.togglePreview()}},Object(a.__)("Done","woo-gutenberg-products-block")),Object(n.createElement)(O.Button,{className:"wc-block-all-products__cancel-button",isTertiary:!0,onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,{innerBlocks:c}=this.state;t(e.clientId,c,!1),this.togglePreview()}},Object(a.__)("Cancel","woo-gutenberg-products-block")),Object(n.createElement)(O.Button,{className:"wc-block-all-products__reset-button",icon:Object(n.createElement)(i.a,{icon:u.a}),label:Object(a.__)("Reset layout to default","woo-gutenberg-products-block"),onClick:()=>{const{block:e,replaceInnerBlocks:t}=this.props,c=[];ut.map(e=>{let[t,o]=e;return c.push(Object(l.createBlock)(t,o)),!0}),t(e.clientId,c,!1),this.setState({innerBlocks:e.innerBlocks})}},Object(a.__)("Reset Layout","woo-gutenberg-products-block")))))}),ct()(this,"renderViewMode",()=>{const{attributes:e}=this.props,{layoutConfig:t}=e,c=t&&0!==t.length,o=this.getTitle(),r=this.getIcon();return c?Object(n.createElement)(O.Disabled,null,Object(n.createElement)(Vt,{attributes:e})):((e,t)=>Object(n.createElement)(O.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(a.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")))(o,r)}),ct()(this,"render",()=>{const{attributes:e}=this.props,{isEditing:t}=this.state,c=this.getTitle(),o=this.getIcon();return 0===st.o.productCount?((e,t)=>Object(n.createElement)(O.Placeholder,{className:"wc-block-products",icon:t,label:e},Object(n.createElement)("p",null,Object(a.__)("You haven't published any products to list here yet.","woo-gutenberg-products-block")),Object(n.createElement)(O.Button,{className:"wc-block-products__add-product-button",isSecondary:!0,href:Q.ADMIN_URL+"post-new.php?post_type=product"},Object(a.__)("Add new product","woo-gutenberg-products-block")+" ",Object(n.createElement)(i.a,{icon:it.a})),Object(n.createElement)(O.Button,{className:"wc-block-products__read_more_button",isTertiary:!0,href:"https://docs.woocommerce.com/document/managing-products/"},Object(a.__)("Learn more","woo-gutenberg-products-block"))))(c,o):Object(n.createElement)("div",{className:lt("wc-block-all-products",e)},this.getBlockControls(),this.getInspectorControls(),t?this.renderEditMode():this.renderViewMode())})}}var Mt=Object(j.compose)(O.withSpokenMessages,Object(ot.withSelect)((e,t)=>{let{clientId:c}=t;const{getBlock:o}=e("core/block-editor");return{block:o(c)}}),Object(ot.withDispatch)(e=>{const{replaceInnerBlocks:t}=e("core/block-editor");return{replaceInnerBlocks:t}}))(zt);const Ht={columns:Object(Q.getSetting)("default_columns",3),rows:Object(Q.getSetting)("default_rows",3),alignButtons:!1,contentVisibility:{orderBy:!0},orderby:"date",layoutConfig:ut,isPreview:!1},qt={title:Object(a.__)("All Products","woo-gutenberg-products-block"),icon:{src:Object(n.createElement)(i.a,{icon:u.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(a.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(a.__)("Display products from your store in a grid layout.","woo-gutenberg-products-block"),supports:{align:["wide","full"],html:!1,multiple:!1},example:{attributes:{isPreview:!0}},attributes:{columns:{type:"number"},rows:{type:"number"},alignButtons:{type:"boolean"},contentVisibility:{type:"object"},orderby:{type:"string"},layoutConfig:{type:"array"},isPreview:{type:"boolean",default:!1}},defaults:Ht,edit:e=>Object(n.createElement)(Mt,e),save(e){let{attributes:t}=e;const c={};Object.keys(t).sort().forEach(e=>{c[e]=t[e]});const o={"data-attributes":JSON.stringify(c)};return Object(n.createElement)("div",r()({className:lt("wc-block-all-products",t)},o),Object(n.createElement)(s.InnerBlocks.Content,null))}};Object(l.registerBlockType)("woocommerce/all-products",{...qt,deprecated:[{attributes:Object.assign({},qt.attributes,{rows:{type:"number",default:1}}),save(e){let{attributes:t}=e;const c={"data-attributes":JSON.stringify(t)};return Object(n.createElement)("div",r()({className:lt("wc-block-all-products",t)},c),Object(n.createElement)(s.InnerBlocks.Content,null))}}]})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return a}));var o=c(37),r=c(0),n=c(22);c.p=n.l,Object(o.registerBlockComponent)({blockName:"woocommerce/product-price",component:Object(r.lazy)(()=>Promise.all([c.e(0),c.e(13)]).then(c.bind(null,262)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-image",component:Object(r.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(5),c.e(12)]).then(c.bind(null,520)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-title",component:Object(r.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(3),c.e(19)]).then(c.bind(null,521)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-rating",component:Object(r.lazy)(()=>c.e(14).then(c.bind(null,263)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-button",component:Object(r.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(3),c.e(4),c.e(10)]).then(c.bind(null,264)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-summary",component:Object(r.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(17)]).then(c.bind(null,265)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-sale-badge",component:Object(r.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(5)]).then(c.bind(null,195)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-sku",component:Object(r.lazy)(()=>c.e(15).then(c.bind(null,266)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-category-list",component:Object(r.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(11)]).then(c.bind(null,267)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-tag-list",component:Object(r.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(18)]).then(c.bind(null,268)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-stock-indicator",component:Object(r.lazy)(()=>Promise.all([c.e(1),c.e(2),c.e(16)]).then(c.bind(null,269)))}),Object(o.registerBlockComponent)({blockName:"woocommerce/product-add-to-cart",component:Object(r.lazy)(()=>Promise.all([c.e(0),c.e(1),c.e(3),c.e(4),c.e(9)]).then(c.bind(null,522)))});const a=e=>Object(o.getRegisteredBlockComponents)(e)},,,,,,,,,function(e,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"b",(function(){return r}));const o=e=>e.is_purchasable||!1,r=e=>["simple","variable"].includes(e.type||"simple")}]);
build/all-reviews.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '32f1246764dc732b6746866302fb668f');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-settings', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '87095b11a9af59a4913e6041442bed8d');
build/all-reviews.js CHANGED
@@ -1,9 +1,9 @@
1
- this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var o,a,s=t[0],i=t[1],l=t[2],u=0,b=[];u<s.length;u++)a=s[u],Object.prototype.hasOwnProperty.call(n,a)&&n[a]&&b.push(n[a][0]),n[a]=0;for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o]);for(d&&d(t);b.length;)b.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],o=!0,s=1;s<r.length;s++){var i=r[s];0!==n[i]&&(o=!1)}o&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var o={},n={8:0},c=[];function a(t){if(o[t])return o[t].exports;var r=o[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=o,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(r,o,function(t){return e[t]}.bind(null,o));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var s=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=s.push.bind(s);s.push=t,s=s.slice();for(var l=0;l<s.length;l++)t(s[l]);var d=i;return c.push([345,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},103:function(e,t,r){"use strict";var o=r(0),n=r(18);const c=Object(o.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(o.createElement)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}));t.a=c},104:function(e,t){},105:function(e,t,r){"use strict";var o=r(0),n=(r(10),r(4)),c=r.n(n),a=r(30),s=r(9);r(144),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:r,label:n,onChange:s,options:i,screenReaderLabel:l,readOnly:d,value:u}=e;const b="wc-block-components-sort-select__select-"+r;return Object(o.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(o.createElement)(a.a,{label:n,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:b}}),Object(o.createElement)("select",{id:b,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,readOnly:d,value:u},i.map(e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label))))})},11:function(e,t){e.exports=window.wp.apiFetch},111:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var o=r(1),n=r(24);const c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(o.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",
2
  /* translators: An example person name used for the block previews. */
3
  reviewer:Object(o.__)("Alice","woo-gutenberg-products-block"),review:`<p>${Object(o.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block")}</p>\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(o.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",
4
  /* translators: An example person name used for the block previews. */
5
- reviewer:Object(o.__)("Bob","woo-gutenberg-products-block"),review:`<p>${Object(o.__)("This product is awesome, I love it!","woo-gutenberg-products-block")}</p>\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:null,verified:!1}]}}},12:function(e,t){e.exports=window.wp.blocks},132:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},133:function(e,t,r){"use strict";var o=r(5),n=r.n(o),c=r(0),a=r(7),s=(r(143),r(53));t.a=e=>{let{attributes:t}=e;return Object(c.createElement)("div",n()({},a.useBlockProps.save({className:Object(s.a)(t)}),Object(s.b)(t)))}},136:function(e,t,r){"use strict";var o=r(0),n=r(1),c=(r(10),r(6)),a=r(3),s=r(7),i=r(8),l=r(2),d=r(71),u=r(30);r(169);const b=e=>{let{onClick:t,label:r,screenReaderLabel:n}=e;return Object(o.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(o.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(o.createElement)(u.a,{label:r,screenReaderLabel:n})))};b.defaultProps={label:Object(n.__)("Load more","woo-gutenberg-products-block")};var w=b,m=r(105);r(166);var p=e=>{let{onChange:t,readOnly:r,value:c}=e;return Object(o.createElement)(m.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(n.__)("Order by","woo-gutenberg-products-block"),onChange:t,options:[{key:"most-recent",label:Object(n.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(n.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(n.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(n.__)("Order reviews by","woo-gutenberg-products-block"),value:c})},g=r(4),h=r.n(g),v=r(25),O=r.n(v),_=r(153),j=r.n(_);const f=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";const o=j()(e,{suffix:r,limit:t});return o.html},k=(e,t,r)=>(t<=r?e.start=e.middle+1:e.end=e.middle-1,e),y=(e,t,r,o)=>{const n=((e,t,r)=>{let o={start:0,middle:0,end:e.length};for(;o.start<=o.end;)o.middle=Math.floor((o.start+o.end)/2),t.innerHTML=f(e,o.middle),o=k(o,t.clientHeight,r);return o.middle})(e,t,r);return f(e,n-o.length,o)},E={className:"read-more-content",ellipsis:"&hellip;",lessText:Object(n.__)("Read less","woo-gutenberg-products-block"),maxLines:3,moreText:Object(n.__)("Read more","woo-gutenberg-products-block")};class R extends i.Component{constructor(e){super(e),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=Object(i.createRef)(),this.reviewSummary=Object(i.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const r=(this.reviewSummary.current.clientHeight+1)*e+1,o=this.reviewContent.current.clientHeight+1>r;this.setState({clampEnabled:o}),o&&this.setState({summary:y(this.reviewContent.current.innerHTML,this.reviewSummary.current,r,t)})}}getButton(){const{isExpanded:e}=this.state,{className:t,lessText:r,moreText:n}=this.props,c=e?r:n;if(c)return Object(o.createElement)("a",{href:"#more",className:t+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:e}=this.props,{content:t,summary:r,clampEnabled:n,isExpanded:c}=this.state;return t?!1===n?Object(o.createElement)("div",{className:e},Object(o.createElement)("div",{ref:this.reviewContent},t)):Object(o.createElement)("div",{className:e},(!c||null===n)&&Object(o.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:r}}),(c||null===n)&&Object(o.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},t),this.getButton()):null}}O()(R,"defaultProps",E);var S=R;r(168);var C=e=>{let{attributes:t,review:r={}}=e;const{imageType:c,showReviewDate:a,showReviewerName:s,showReviewImage:i,showReviewRating:l,showReviewContent:d,showProductName:u}=t,{rating:b}=r,w=!Object.keys(r).length>0,m=Number.isFinite(b)&&l;return Object(o.createElement)("li",{className:h()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":w,"wc-block-components-review-list-item__item--has-image":i}),"aria-hidden":w},(u||a||s||i||m)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},i&&function(e,t,r){var c,a;return r||!e?Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(o.createElement)("img",{"aria-hidden":"true",alt:(null===(c=e.product_image)||void 0===c?void 0:c.alt)||"",src:(null===(a=e.product_image)||void 0===a?void 0:a.thumbnail)||""}):Object(o.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(o.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(n.__)("Verified buyer","woo-gutenberg-products-block")},Object(n.__)("Verified buyer","woo-gutenberg-products-block")))}(r,c,w),(u||s||m||a)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},m&&function(e){const{rating:t}=e,r={width:t/5*100+"%"},c=Object(n.sprintf)(
6
  /* translators: %f is referring to the average rating value */
7
  Object(n.__)("Rated %f out of 5","woo-gutenberg-products-block"),t),a={__html:Object(n.sprintf)(
8
  /* translators: %s is referring to the average rating value */
9
- Object(n.__)("Rated %s out of 5","woo-gutenberg-products-block"),Object(n.sprintf)('<strong class="rating">%f</strong>',t))};return Object(o.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(o.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(o.createElement)("span",{style:r,dangerouslySetInnerHTML:a})))}(r),u&&function(e){return Object(o.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(o.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(r),s&&function(e){const{reviewer:t=""}=e;return Object(o.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},t)}(r),a&&function(e){const{date_created:t,formatted_date_created:r}=e;return Object(o.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(r))),d&&function(e){return Object(o.createElement)(S,{maxLines:10,moreText:Object(n.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(n.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(o.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(r))};r(167);var P=e=>{let{attributes:t,reviews:r}=e;const n=Object(l.getSetting)("showAvatars",!0),c=Object(l.getSetting)("reviewRatingsEnabled",!0),a=(n||"product"===t.imageType)&&t.showReviewImage,s=c&&t.showReviewRating,i={...t,showReviewImage:a,showReviewRating:s};return Object(o.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(o.createElement)(C,{attributes:i}):r.map((e,t)=>Object(o.createElement)(C,{key:e.id||t,attributes:i,review:e})))},N=r(5),T=r.n(N),L=r(26),x=r.n(L),M=r(53),A=r(28);class I extends i.Component{render(){const{attributes:e,error:t,isLoading:r,noReviewsPlaceholder:c,reviews:s,totalReviews:i}=this.props;if(t)return Object(o.createElement)(d.a,{className:"wc-block-featured-product-error",error:t,isLoading:r});if(0===s.length&&!r)return Object(o.createElement)(c,{attributes:e});const u=Object(l.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(a.Disabled,null,e.showOrderby&&u&&Object(o.createElement)(p,{readOnly:!0,value:e.orderby}),Object(o.createElement)(P,{attributes:e,reviews:s}),e.showLoadMore&&i>s.length&&Object(o.createElement)(w,{screenReaderLabel:Object(n.__)("Load more reviews","woo-gutenberg-products-block")}))}}var D=(e=>{class t extends i.Component{constructor(){super(...arguments),O()(this,"isPreview",!!this.props.attributes.previewReviews),O()(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),O()(this,"isMounted",!1),O()(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),O()(this,"setError",async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await Object(A.a)(e);this.setState({reviews:[],loading:!1,error:r}),t(r)})}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}shouldReplaceReviews(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!x()(e.categoryIds,t.categoryIds)}componentWillUnmount(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}getArgs(e){const{categoryIds:t,order:r,orderby:o,productId:n,reviewsToDisplay:c}=this.props,a={order:r,orderby:o,per_page:c-e,offset:e};return t&&t.length&&(a.category_id=Array.isArray(t)?t.join(","):t),n&&(a.product_id=n),a}replaceReviews(){if(this.isPreview)return;const{onReviewsReplaced:e}=this.props;this.updateListOfReviews().then(e)}appendReviews(){if(this.isPreview)return;const{onReviewsAppended:e,reviewsToDisplay:t}=this.props,{reviews:r}=this.state;t<=r.length||this.updateListOfReviews(r).then(e)}updateListOfReviews(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,o=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(o).fill({}))}),Object(M.c)(this.getArgs(e.length)).then(t=>{let{reviews:r,totalReviews:o}=t;return this.isMounted&&this.setState({reviews:e.filter(e=>Object.keys(e).length).concat(r),totalReviews:o,loading:!1,error:null}),{newReviews:r}}).catch(this.setError)}render(){const{reviewsToDisplay:t}=this.props,{error:r,loading:n,reviews:c,totalReviews:a}=this.state;return Object(o.createElement)(e,T()({},this.props,{error:r,isLoading:n,reviews:c.slice(0,t),totalReviews:a}))}}O()(t,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:r=e.name||"Component"}=e;return t.displayName=`WithReviews( ${r} )`,t})(I);t.a=e=>{let{attributes:t,icon:r,name:i,noReviewsPlaceholder:l}=e;const{categoryIds:d,productId:u,reviewsOnPageLoad:b,showProductName:w,showReviewDate:m,showReviewerName:p,showReviewContent:g,showReviewImage:h,showReviewRating:v}=t,{order:O,orderby:_}=Object(M.d)(t.orderby),j=!(g||v||m||p||h||w),f=Object(s.useBlockProps)({className:Object(M.a)(t)});return j?Object(o.createElement)(a.Placeholder,{icon:r,label:i},Object(n.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")):Object(o.createElement)("div",f,Object(o.createElement)(D,{attributes:t,categoryIds:d,delayFunction:e=>Object(c.debounce)(e,400),noReviewsPlaceholder:l,orderby:_,order:O,productId:u,reviewsToDisplay:b}))}},143:function(e,t){},144:function(e,t){},166:function(e,t){},167:function(e,t){},168:function(e,t){},169:function(e,t){},18:function(e,t){e.exports=window.wp.primitives},2:function(e,t){e.exports=window.wc.wcSettings},24:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return s})),r.d(t,"n",(function(){return i})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"f",(function(){return u})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return w})),r.d(t,"c",(function(){return m})),r.d(t,"d",(function(){return p})),r.d(t,"h",(function(){return g})),r.d(t,"a",(function(){return h})),r.d(t,"i",(function(){return v})),r.d(t,"b",(function(){return O}));var o,n=r(2);const c=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",s=c.pluginUrl+"build/",i=c.buildPhase,l=null===(o=n.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,d=n.STORE_PAGES.checkout.id,u=n.STORE_PAGES.checkout.permalink,b=n.STORE_PAGES.privacy.permalink,w=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),m=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),p=n.STORE_PAGES.cart.permalink,g=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),h=Object(n.getSetting)("allowedCountries",{}),v=Object(n.getSetting)("shippingStates",{}),O=Object(n.getSetting)("allowedStates",{})},26:function(e,t){e.exports=window.wp.isShallowEqual},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var o=r(1);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},c=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},3:function(e,t){e.exports=window.wp.components},30:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n);t.a=e=>{let t,{label:r,screenReaderLabel:n,wrapperElement:a,wrapperProps:s={}}=e;const i=null!=r,l=null!=n;return!i&&l?(t=a||"span",s={...s,className:c()(s.className,"screen-reader-text")},Object(o.createElement)(t,s,n)):(t=a||o.Fragment,i&&l&&r!==n?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,s,r))}},31:function(e,t){e.exports=window.wp.escapeHtml},32:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(31);t.a=e=>{let{error:t}=e;return Object(o.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):"api"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},345:function(e,t,r){e.exports=r(454)},43:function(e,t,r){"use strict";var o=r(0);t.a=function(e){let{srcElement:t,size:r=24,...n}=e;return Object(o.isValidElement)(t)?Object(o.cloneElement)(t,{width:r,height:r,...n}):null}},454:function(e,t,r){"use strict";r.r(t);var o=r(0),n=r(1),c=r(12),a=r(43),s=r(18),i=Object(o.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(o.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(o.createElement)("path",{d:"M15 4v7H5.17l-.59.59-.58.58V4h11m1-2H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm5 4h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1z"})),l=(r(143),r(7)),d=r(3),u=(r(10),r(136)),b=()=>Object(o.createElement)(d.Placeholder,{className:"wc-block-all-reviews",icon:Object(o.createElement)(a.a,{srcElement:i,className:"block-editor-block-icon"}),label:Object(n.__)("All Reviews","woo-gutenberg-products-block")},Object(n.__)("This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.","woo-gutenberg-products-block")),w=r(95),m=r(132),p=r(133),g=r(111);Object(c.registerBlockType)("woocommerce/all-reviews",{apiVersion:2,title:Object(n.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(a.a,{srcElement:i,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(n.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:{...g.a,attributes:{...g.a.attributes,showProductName:!0}},attributes:{...m.a,showProductName:{type:"boolean",default:!0}},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:r}=e;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:e=>{let{instance:t}=e;return Object(c.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:e=>{let{attributes:t,setAttributes:r}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.InspectorControls,{key:"inspector"},Object(o.createElement)(d.PanelBody,{title:Object(n.__)("Content","woo-gutenberg-products-block")},Object(o.createElement)(d.ToggleControl,{label:Object(n.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:()=>r({showProductName:!t.showProductName})}),Object(w.b)(t,r)),Object(o.createElement)(d.PanelBody,{title:Object(n.__)("List Settings","woo-gutenberg-products-block")},Object(w.c)(t,r))),Object(o.createElement)(u.a,{attributes:t,icon:Object(o.createElement)(a.a,{icon:i,className:"block-editor-block-icon"}),name:Object(n.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:b}))},save:p.a})},53:function(e,t,r){"use strict";r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return u}));var o=r(11),n=r.n(o),c=r(4),a=r.n(c),s=r(2);const i=e=>{if(Object(s.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=e=>n()({path:"/wc/store/products/reviews?"+Object.entries(e).map(e=>e.join("=")).join("&"),parse:!1}).then(e=>e.json().then(t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}))),d=e=>{const{className:t,categoryIds:r,productId:o,showReviewDate:n,showReviewerName:c,showReviewContent:s,showProductName:i,showReviewImage:l,showReviewRating:d}=e;let u="wc-block-all-reviews";return o&&(u="wc-block-reviews-by-product"),Array.isArray(r)&&(u="wc-block-reviews-by-category"),a()(u,t,{"has-image":l,"has-name":c,"has-date":n,"has-rating":d,"has-content":s,"has-product-name":i})},u=e=>{const{categoryIds:t,imageType:r,orderby:o,productId:n,reviewsOnPageLoad:c,reviewsOnLoadMore:a,showLoadMore:s,showOrderby:i}=e,l={"data-image-type":r,"data-orderby":o,"data-reviews-on-page-load":c,"data-reviews-on-load-more":a,"data-show-load-more":s,"data-show-orderby":i};return n&&(l["data-product-id"]=n),Array.isArray(t)&&(l["data-category-ids"]=t.join(",")),l}},55:function(e,t,r){"use strict";var o=r(5),n=r.n(o),c=r(0),a=r(4),s=r.n(a),i=r(3),l=r(9);r(84);class d extends c.Component{constructor(){super(...arguments),this.onClick=this.onClick.bind(this)}onClick(e){this.props.onChange&&this.props.onChange(e.target.value)}render(){const{label:e,checked:t,instanceId:r,className:o,help:a,options:l,value:d}=this.props,u="inspector-toggle-button-control-"+r;let b;return a&&(b="function"==typeof a?a(t):a),Object(c.createElement)(i.BaseControl,{id:u,help:b,className:s()("components-toggle-button-control",o)},Object(c.createElement)("label",{id:u+"__label",htmlFor:u,className:"components-toggle-button-control__label"},e),Object(c.createElement)(i.ButtonGroup,{"aria-labelledby":u+"__label"},l.map((t,r)=>{const o={};return d===t.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(c.createElement)(i.Button,n()({key:`${t.label}-${t.value}-${r}`,value:t.value,onClick:this.onClick,"aria-label":e+": "+t.label},o),t.label)})))}}t.a=Object(l.withInstanceId)(d)},6:function(e,t){e.exports=window.lodash},7:function(e,t){e.exports=window.wp.blockEditor},71:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(43),a=r(103),s=r(4),i=r.n(s),l=r(3),d=r(32);r(104),t.a=e=>{let{className:t,error:r,isLoading:s=!1,onRetry:u}=e;return Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(c.a,{srcElement:a.a}),label:Object(n.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:i()("wc-block-api-error",t)},Object(o.createElement)(d.a,{error:r}),u&&Object(o.createElement)(o.Fragment,null,s?Object(o.createElement)(l.Spinner,null):Object(o.createElement)(l.Button,{isSecondary:!0,onClick:u},Object(n.__)("Retry","woo-gutenberg-products-block"))))}},8:function(e,t){e.exports=window.React},84:function(e,t){},9:function(e,t){e.exports=window.wp.compose},95:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return u}));var o=r(0),n=r(1),c=r(3),a=r(7),s=r(2),i=r(55);const l=(e,t,r)=>Object(o.createElement)(a.BlockControls,null,Object(o.createElement)(c.ToolbarGroup,{controls:[{icon:"edit",title:r,onClick:()=>t({editMode:!e}),isActive:e}]})),d=(e,t)=>{const r=Object(s.getSetting)("showAvatars",!0),a=Object(s.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:()=>t({showReviewRating:!e.showReviewRating})}),e.showReviewRating&&!a&&Object(o.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:()=>t({showReviewerName:!e.showReviewerName})}),Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:()=>t({showReviewImage:!e.showReviewImage})}),Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:()=>t({showReviewDate:!e.showReviewDate})}),Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:()=>t({showReviewContent:!e.showReviewContent})}),e.showReviewImage&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.a,{label:Object(n.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(n.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(n.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:e=>t({imageType:e})}),"reviewer"===e.imageType&&!r&&Object(o.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},u=(e,t)=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:()=>t({showOrderby:!e.showOrderby})}),Object(o.createElement)(c.SelectControl,{label:Object(n.__)("Order Product Reviews by","woo-gutenberg-products-block"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:e=>t({orderby:e})}),Object(o.createElement)(c.RangeControl,{label:Object(n.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:e=>t({reviewsOnPageLoad:e}),max:20,min:1}),Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:()=>t({showLoadMore:!e.showLoadMore})}),e.showLoadMore&&Object(o.createElement)(c.RangeControl,{label:Object(n.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:e=>t({reviewsOnLoadMore:e}),max:20,min:1}))}});
1
+ this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks["all-reviews"]=function(e){function t(t){for(var o,a,s=t[0],i=t[1],l=t[2],u=0,b=[];u<s.length;u++)a=s[u],Object.prototype.hasOwnProperty.call(n,a)&&n[a]&&b.push(n[a][0]),n[a]=0;for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o]);for(d&&d(t);b.length;)b.shift()();return c.push.apply(c,l||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],o=!0,s=1;s<r.length;s++){var i=r[s];0!==n[i]&&(o=!1)}o&&(c.splice(t--,1),e=a(a.s=r[0]))}return e}var o={},n={8:0},c=[];function a(t){if(o[t])return o[t].exports;var r=o[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.m=e,a.c=o,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(r,o,function(t){return e[t]}.bind(null,o));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var s=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=s.push.bind(s);s.push=t,s=s.slice();for(var l=0;l<s.length;l++)t(s[l]);var d=i;return c.push([341,0]),r()}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},104:function(e,t){},106:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n),a=r(29),s=r(9);r(141),t.a=Object(s.withInstanceId)(e=>{let{className:t,instanceId:r,label:n="",onChange:s,options:i,screenReaderLabel:l,value:d}=e;const u="wc-block-components-sort-select__select-"+r;return Object(o.createElement)("div",{className:c()("wc-block-sort-select","wc-block-components-sort-select",t)},Object(o.createElement)(a.a,{label:n,screenReaderLabel:l,wrapperElement:"label",wrapperProps:{className:"wc-block-sort-select__label wc-block-components-sort-select__label",htmlFor:u}}),Object(o.createElement)("select",{id:u,className:"wc-block-sort-select__select wc-block-components-sort-select__select",onChange:s,value:d},i&&i.map(e=>Object(o.createElement)("option",{key:e.key,value:e.key},e.label))))})},11:function(e,t){e.exports=window.wp.primitives},112:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var o=r(1),n=r(22);const c={attributes:{editMode:!1,imageType:"reviewer",orderby:"most-recent",reviewsOnLoadMore:10,reviewsOnPageLoad:10,showLoadMore:!0,showOrderby:!0,showReviewDate:!0,showReviewerName:!0,showReviewImage:!0,showReviewRating:!0,showReviewContent:!0,previewReviews:[{id:1,date_created:"2019-07-15T17:05:04",formatted_date_created:Object(o.__)("July 15, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-15T15:05:04",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",
2
  /* translators: An example person name used for the block previews. */
3
  reviewer:Object(o.__)("Alice","woo-gutenberg-products-block"),review:`<p>${Object(o.__)("I bought this product last week and I'm very happy with it.","woo-gutenberg-products-block")}</p>\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:5,verified:!0},{id:2,date_created:"2019-07-12T12:39:39",formatted_date_created:Object(o.__)("July 12, 2019","woo-gutenberg-products-block"),date_created_gmt:"2019-07-12T10:39:39",product_id:0,product_name:Object(o.__)("WordPress Pennant","woo-gutenberg-products-block"),product_permalink:"#",
4
  /* translators: An example person name used for the block previews. */
5
+ reviewer:Object(o.__)("Bob","woo-gutenberg-products-block"),review:`<p>${Object(o.__)("This product is awesome, I love it!","woo-gutenberg-products-block")}</p>\n`,reviewer_avatar_urls:{48:n.o.defaultAvatar,96:n.o.defaultAvatar},rating:null,verified:!1}]}}},12:function(e,t){e.exports=window.wp.apiFetch},129:function(e,t,r){"use strict";t.a={editMode:{type:"boolean",default:!0},imageType:{type:"string",default:"reviewer"},orderby:{type:"string",default:"most-recent"},reviewsOnLoadMore:{type:"number",default:10},reviewsOnPageLoad:{type:"number",default:10},showLoadMore:{type:"boolean",default:!0},showOrderby:{type:"boolean",default:!0},showReviewDate:{type:"boolean",default:!0},showReviewerName:{type:"boolean",default:!0},showReviewImage:{type:"boolean",default:!0},showReviewRating:{type:"boolean",default:!0},showReviewContent:{type:"boolean",default:!0},previewReviews:{type:"array",default:null}}},13:function(e,t){e.exports=window.wp.blocks},130:function(e,t,r){"use strict";var o=r(5),n=r.n(o),c=r(0),a=r(7),s=(r(140),r(54));t.a=e=>{let{attributes:t}=e;return Object(c.createElement)("div",n()({},a.useBlockProps.save({className:Object(s.a)(t)}),Object(s.b)(t)))}},133:function(e,t,r){"use strict";var o=r(0),n=r(1),c=(r(10),r(6)),a=r(3),s=r(7),i=r(8),l=r(2),d=r(71),u=r(29);r(168);var b=e=>{let{onClick:t,label:r=Object(n.__)("Load more","woo-gutenberg-products-block"),screenReaderLabel:c=Object(n.__)("Load more","woo-gutenberg-products-block")}=e;return Object(o.createElement)("div",{className:"wp-block-button wc-block-load-more wc-block-components-load-more"},Object(o.createElement)("button",{className:"wp-block-button__link",onClick:t},Object(o.createElement)(u.a,{label:r,screenReaderLabel:c})))},w=r(106);r(165);var p=e=>{let{onChange:t,readOnly:r,value:c}=e;return Object(o.createElement)(w.a,{className:"wc-block-review-sort-select wc-block-components-review-sort-select",label:Object(n.__)("Order by","woo-gutenberg-products-block"),onChange:t,options:[{key:"most-recent",label:Object(n.__)("Most recent","woo-gutenberg-products-block")},{key:"highest-rating",label:Object(n.__)("Highest rating","woo-gutenberg-products-block")},{key:"lowest-rating",label:Object(n.__)("Lowest rating","woo-gutenberg-products-block")}],readOnly:r,screenReaderLabel:Object(n.__)("Order reviews by","woo-gutenberg-products-block"),value:c})},m=r(4),g=r.n(m),h=r(24),v=r.n(h),_=r(151),O=r.n(_);const j=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";const o=O()(e,{suffix:r,limit:t});return o.html},f=(e,t,r)=>(t<=r?e.start=e.middle+1:e.end=e.middle-1,e),k=(e,t,r,o)=>{const n=((e,t,r)=>{let o={start:0,middle:0,end:e.length};for(;o.start<=o.end;)o.middle=Math.floor((o.start+o.end)/2),t.innerHTML=j(e,o.middle),o=f(o,t.clientHeight,r);return o.middle})(e,t,r);return j(e,n-o.length,o)},y={className:"read-more-content",ellipsis:"&hellip;",lessText:Object(n.__)("Read less","woo-gutenberg-products-block"),maxLines:3,moreText:Object(n.__)("Read more","woo-gutenberg-products-block")};class R extends i.Component{constructor(e){super(e),this.state={isExpanded:!1,clampEnabled:null,content:e.children,summary:"."},this.reviewContent=Object(i.createRef)(),this.reviewSummary=Object(i.createRef)(),this.getButton=this.getButton.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){this.setSummary()}componentDidUpdate(e){e.maxLines===this.props.maxLines&&e.children===this.props.children||this.setState({clampEnabled:null,summary:"."},this.setSummary)}setSummary(){if(this.props.children){const{maxLines:e,ellipsis:t}=this.props;if(!this.reviewSummary.current||!this.reviewContent.current)return;const r=(this.reviewSummary.current.clientHeight+1)*e+1,o=this.reviewContent.current.clientHeight+1>r;this.setState({clampEnabled:o}),o&&this.setState({summary:k(this.reviewContent.current.innerHTML,this.reviewSummary.current,r,t)})}}getButton(){const{isExpanded:e}=this.state,{className:t,lessText:r,moreText:n}=this.props,c=e?r:n;if(c)return Object(o.createElement)("a",{href:"#more",className:t+"__read_more",onClick:this.onClick,"aria-expanded":!e,role:"button"},c)}onClick(e){e.preventDefault();const{isExpanded:t}=this.state;this.setState({isExpanded:!t})}render(){const{className:e}=this.props,{content:t,summary:r,clampEnabled:n,isExpanded:c}=this.state;return t?!1===n?Object(o.createElement)("div",{className:e},Object(o.createElement)("div",{ref:this.reviewContent},t)):Object(o.createElement)("div",{className:e},(!c||null===n)&&Object(o.createElement)("div",{ref:this.reviewSummary,"aria-hidden":c,dangerouslySetInnerHTML:{__html:r}}),(c||null===n)&&Object(o.createElement)("div",{ref:this.reviewContent,"aria-hidden":!c},t),this.getButton()):null}}v()(R,"defaultProps",y);var E=R;r(167);var C=e=>{let{attributes:t,review:r={}}=e;const{imageType:c,showReviewDate:a,showReviewerName:s,showReviewImage:i,showReviewRating:l,showReviewContent:d,showProductName:u}=t,{rating:b}=r,w=!Object.keys(r).length>0,p=Number.isFinite(b)&&l;return Object(o.createElement)("li",{className:g()("wc-block-review-list-item__item","wc-block-components-review-list-item__item",{"is-loading":w,"wc-block-components-review-list-item__item--has-image":i}),"aria-hidden":w},(u||a||s||i||p)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__info wc-block-components-review-list-item__info"},i&&function(e,t,r){var c,a;return r||!e?Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"}):Object(o.createElement)("div",{className:"wc-block-review-list-item__image wc-block-components-review-list-item__image"},"product"===t?Object(o.createElement)("img",{"aria-hidden":"true",alt:(null===(c=e.product_image)||void 0===c?void 0:c.alt)||"",src:(null===(a=e.product_image)||void 0===a?void 0:a.thumbnail)||""}):Object(o.createElement)("img",{"aria-hidden":"true",alt:"",src:e.reviewer_avatar_urls[96]||""}),e.verified&&Object(o.createElement)("div",{className:"wc-block-review-list-item__verified wc-block-components-review-list-item__verified",title:Object(n.__)("Verified buyer","woo-gutenberg-products-block")},Object(n.__)("Verified buyer","woo-gutenberg-products-block")))}(r,c,w),(u||s||p||a)&&Object(o.createElement)("div",{className:"wc-block-review-list-item__meta wc-block-components-review-list-item__meta"},p&&function(e){const{rating:t}=e,r={width:t/5*100+"%"},c=Object(n.sprintf)(
6
  /* translators: %f is referring to the average rating value */
7
  Object(n.__)("Rated %f out of 5","woo-gutenberg-products-block"),t),a={__html:Object(n.sprintf)(
8
  /* translators: %s is referring to the average rating value */
9
+ Object(n.__)("Rated %s out of 5","woo-gutenberg-products-block"),Object(n.sprintf)('<strong class="rating">%f</strong>',t))};return Object(o.createElement)("div",{className:"wc-block-review-list-item__rating wc-block-components-review-list-item__rating"},Object(o.createElement)("div",{className:"wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars",role:"img","aria-label":c},Object(o.createElement)("span",{style:r,dangerouslySetInnerHTML:a})))}(r),u&&function(e){return Object(o.createElement)("div",{className:"wc-block-review-list-item__product wc-block-components-review-list-item__product"},Object(o.createElement)("a",{href:e.product_permalink,dangerouslySetInnerHTML:{__html:e.product_name}}))}(r),s&&function(e){const{reviewer:t=""}=e;return Object(o.createElement)("div",{className:"wc-block-review-list-item__author wc-block-components-review-list-item__author"},t)}(r),a&&function(e){const{date_created:t,formatted_date_created:r}=e;return Object(o.createElement)("time",{className:"wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date",dateTime:t},r)}(r))),d&&function(e){return Object(o.createElement)(E,{maxLines:10,moreText:Object(n.__)("Read full review","woo-gutenberg-products-block"),lessText:Object(n.__)("Hide full review","woo-gutenberg-products-block"),className:"wc-block-review-list-item__text wc-block-components-review-list-item__text"},Object(o.createElement)("div",{dangerouslySetInnerHTML:{__html:e.review||""}}))}(r))};r(166);var S=e=>{let{attributes:t,reviews:r}=e;const n=Object(l.getSetting)("showAvatars",!0),c=Object(l.getSetting)("reviewRatingsEnabled",!0),a=(n||"product"===t.imageType)&&t.showReviewImage,s=c&&t.showReviewRating,i={...t,showReviewImage:a,showReviewRating:s};return Object(o.createElement)("ul",{className:"wc-block-review-list wc-block-components-review-list"},0===r.length?Object(o.createElement)(C,{attributes:i}):r.map((e,t)=>Object(o.createElement)(C,{key:e.id||t,attributes:i,review:e})))},N=r(5),P=r.n(N),T=r(25),L=r.n(T),x=r(54),A=r(27);class I extends i.Component{render(){const{attributes:e,error:t,isLoading:r,noReviewsPlaceholder:c,reviews:s,totalReviews:i}=this.props;if(t)return Object(o.createElement)(d.a,{className:"wc-block-featured-product-error",error:t,isLoading:r});if(0===s.length&&!r)return Object(o.createElement)(c,{attributes:e});const u=Object(l.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(a.Disabled,null,e.showOrderby&&u&&Object(o.createElement)(p,{readOnly:!0,value:e.orderby}),Object(o.createElement)(S,{attributes:e,reviews:s}),e.showLoadMore&&i>s.length&&Object(o.createElement)(b,{screenReaderLabel:Object(n.__)("Load more reviews","woo-gutenberg-products-block")}))}}var M=(e=>{class t extends i.Component{constructor(){super(...arguments),v()(this,"isPreview",!!this.props.attributes.previewReviews),v()(this,"delayedAppendReviews",this.props.delayFunction(this.appendReviews)),v()(this,"isMounted",!1),v()(this,"state",{error:null,loading:!0,reviews:this.isPreview?this.props.attributes.previewReviews:[],totalReviews:this.isPreview?this.props.attributes.previewReviews.length:0}),v()(this,"setError",async e=>{if(!this.isMounted)return;const{onReviewsLoadError:t}=this.props,r=await Object(A.a)(e);this.setState({reviews:[],loading:!1,error:r}),t(r)})}componentDidMount(){this.isMounted=!0,this.replaceReviews()}componentDidUpdate(e){e.reviewsToDisplay<this.props.reviewsToDisplay?this.delayedAppendReviews():this.shouldReplaceReviews(e,this.props)&&this.replaceReviews()}shouldReplaceReviews(e,t){return e.orderby!==t.orderby||e.order!==t.order||e.productId!==t.productId||!L()(e.categoryIds,t.categoryIds)}componentWillUnmount(){this.isMounted=!1,this.delayedAppendReviews.cancel&&this.delayedAppendReviews.cancel()}getArgs(e){const{categoryIds:t,order:r,orderby:o,productId:n,reviewsToDisplay:c}=this.props,a={order:r,orderby:o,per_page:c-e,offset:e};return t&&t.length&&(a.category_id=Array.isArray(t)?t.join(","):t),n&&(a.product_id=n),a}replaceReviews(){if(this.isPreview)return;const{onReviewsReplaced:e}=this.props;this.updateListOfReviews().then(e)}appendReviews(){if(this.isPreview)return;const{onReviewsAppended:e,reviewsToDisplay:t}=this.props,{reviews:r}=this.state;t<=r.length||this.updateListOfReviews(r).then(e)}updateListOfReviews(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const{reviewsToDisplay:t}=this.props,{totalReviews:r}=this.state,o=Math.min(r,t)-e.length;return this.setState({loading:!0,reviews:e.concat(Array(o).fill({}))}),Object(x.c)(this.getArgs(e.length)).then(t=>{let{reviews:r,totalReviews:o}=t;return this.isMounted&&this.setState({reviews:e.filter(e=>Object.keys(e).length).concat(r),totalReviews:o,loading:!1,error:null}),{newReviews:r}}).catch(this.setError)}render(){const{reviewsToDisplay:t}=this.props,{error:r,loading:n,reviews:c,totalReviews:a}=this.state;return Object(o.createElement)(e,P()({},this.props,{error:r,isLoading:n,reviews:c.slice(0,t),totalReviews:a}))}}v()(t,"defaultProps",{delayFunction:e=>e,onReviewsAppended:()=>{},onReviewsLoadError:()=>{},onReviewsReplaced:()=>{}});const{displayName:r=e.name||"Component"}=e;return t.displayName=`WithReviews( ${r} )`,t})(I);t.a=e=>{let{attributes:t,icon:r,name:i,noReviewsPlaceholder:l}=e;const{categoryIds:d,productId:u,reviewsOnPageLoad:b,showProductName:w,showReviewDate:p,showReviewerName:m,showReviewContent:g,showReviewImage:h,showReviewRating:v}=t,{order:_,orderby:O}=Object(x.d)(t.orderby),j=!(g||v||p||m||h||w),f=Object(s.useBlockProps)({className:Object(x.a)(t)});return j?Object(o.createElement)(a.Placeholder,{icon:r,label:i},Object(n.__)("The content for this block is hidden due to block settings.","woo-gutenberg-products-block")):Object(o.createElement)("div",f,Object(o.createElement)(M,{attributes:t,categoryIds:d,delayFunction:e=>Object(c.debounce)(e,400),noReviewsPlaceholder:l,orderby:O,order:_,productId:u,reviewsToDisplay:b}))}},140:function(e,t){},141:function(e,t){},165:function(e,t){},166:function(e,t){},167:function(e,t){},168:function(e,t){},2:function(e,t){e.exports=window.wc.wcSettings},22:function(e,t,r){"use strict";r.d(t,"o",(function(){return c})),r.d(t,"m",(function(){return a})),r.d(t,"l",(function(){return s})),r.d(t,"n",(function(){return i})),r.d(t,"j",(function(){return l})),r.d(t,"e",(function(){return d})),r.d(t,"f",(function(){return u})),r.d(t,"g",(function(){return b})),r.d(t,"k",(function(){return w})),r.d(t,"c",(function(){return p})),r.d(t,"d",(function(){return m})),r.d(t,"h",(function(){return g})),r.d(t,"a",(function(){return h})),r.d(t,"i",(function(){return v})),r.d(t,"b",(function(){return _}));var o,n=r(2);const c=Object(n.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=c.pluginUrl+"images/",s=c.pluginUrl+"build/",i=c.buildPhase,l=null===(o=n.STORE_PAGES.shop)||void 0===o?void 0:o.permalink,d=n.STORE_PAGES.checkout.id,u=n.STORE_PAGES.checkout.permalink,b=n.STORE_PAGES.privacy.permalink,w=(n.STORE_PAGES.privacy.title,n.STORE_PAGES.terms.permalink),p=(n.STORE_PAGES.terms.title,n.STORE_PAGES.cart.id),m=n.STORE_PAGES.cart.permalink,g=(n.STORE_PAGES.myaccount.permalink?n.STORE_PAGES.myaccount.permalink:Object(n.getSetting)("wpLoginUrl","/wp-login.php"),Object(n.getSetting)("shippingCountries",{})),h=Object(n.getSetting)("allowedCountries",{}),v=Object(n.getSetting)("shippingStates",{}),_=Object(n.getSetting)("allowedStates",{})},25:function(e,t){e.exports=window.wp.isShallowEqual},27:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));var o=r(1);const n=async e=>{if("function"==typeof e.json)try{const t=await e.json();return{message:t.message,type:t.type||"api"}}catch(e){return{message:e.message,type:"general"}}return{message:e.message,type:e.type||"general"}},c=e=>{if(e.data&&"rest_invalid_param"===e.code){const t=Object.values(e.data.params);if(t[0])return t[0]}return(null==e?void 0:e.message)||Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block")}},29:function(e,t,r){"use strict";var o=r(0),n=r(4),c=r.n(n);t.a=e=>{let t,{label:r,screenReaderLabel:n,wrapperElement:a,wrapperProps:s={}}=e;const i=null!=r,l=null!=n;return!i&&l?(t=a||"span",s={...s,className:c()(s.className,"screen-reader-text")},Object(o.createElement)(t,s,n)):(t=a||o.Fragment,i&&l&&r!==n?Object(o.createElement)(t,s,Object(o.createElement)("span",{"aria-hidden":"true"},r),Object(o.createElement)("span",{className:"screen-reader-text"},n)):Object(o.createElement)(t,s,r))}},3:function(e,t){e.exports=window.wp.components},30:function(e,t){e.exports=window.wp.escapeHtml},31:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(30);t.a=e=>{let{error:t}=e;return Object(o.createElement)("div",{className:"wc-block-error-message"},(e=>{let{message:t,type:r}=e;return t?"general"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):"api"===r?Object(o.createElement)("span",null,Object(n.__)("The following error was returned from the API","woo-gutenberg-products-block"),Object(o.createElement)("br",null),Object(o.createElement)("code",null,Object(c.escapeHTML)(t))):t:Object(n.__)("An unknown error occurred which prevented the block from being updated.","woo-gutenberg-products-block")})(t))}},341:function(e,t,r){e.exports=r(449)},449:function(e,t,r){"use strict";r.r(t);var o=r(0),n=r(1),c=r(13),a=r(103),s=r(487),i=(r(140),r(7)),l=r(3),d=(r(10),r(133)),u=()=>Object(o.createElement)(l.Placeholder,{className:"wc-block-all-reviews",icon:Object(o.createElement)(a.a,{icon:s.a,className:"block-editor-block-icon"}),label:Object(n.__)("All Reviews","woo-gutenberg-products-block")},Object(n.__)("This block shows a list of all product reviews. Your store does not have any reviews yet, but they will show up here when it does.","woo-gutenberg-products-block")),b=r(95),w=r(129),p=r(130),m=r(112);Object(c.registerBlockType)("woocommerce/all-reviews",{apiVersion:2,title:Object(n.__)("All Reviews","woo-gutenberg-products-block"),icon:{src:Object(o.createElement)(a.a,{icon:s.a,className:"wc-block-editor-components-block-icon"})},category:"woocommerce",keywords:[Object(n.__)("WooCommerce","woo-gutenberg-products-block")],description:Object(n.__)("Show a list of all product reviews.","woo-gutenberg-products-block"),supports:{html:!1,color:{background:!1},typography:{fontSize:!0}},example:{...m.a,attributes:{...m.a.attributes,showProductName:!0}},attributes:{...w.a,showProductName:{type:"boolean",default:!0}},transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:e=>{let{idBase:t,instance:r}=e;return"woocommerce_recent_reviews"===t&&!(null==r||!r.raw)},transform:e=>{let{instance:t}=e;return Object(c.createBlock)("woocommerce/all-reviews",{reviewsOnPageLoad:t.raw.number,imageType:"product",showLoadMore:!1,showOrderby:!1,showReviewDate:!1,showReviewContent:!1})}}]},edit:e=>{let{attributes:t,setAttributes:r}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.InspectorControls,{key:"inspector"},Object(o.createElement)(l.PanelBody,{title:Object(n.__)("Content","woo-gutenberg-products-block")},Object(o.createElement)(l.ToggleControl,{label:Object(n.__)("Product name","woo-gutenberg-products-block"),checked:t.showProductName,onChange:()=>r({showProductName:!t.showProductName})}),Object(b.b)(t,r)),Object(o.createElement)(l.PanelBody,{title:Object(n.__)("List Settings","woo-gutenberg-products-block")},Object(b.c)(t,r))),Object(o.createElement)(d.a,{attributes:t,icon:Object(o.createElement)(a.a,{icon:s.a,className:"block-editor-block-icon"}),name:Object(n.__)("All Reviews","woo-gutenberg-products-block"),noReviewsPlaceholder:u}))},save:p.a})},54:function(e,t,r){"use strict";r.d(t,"d",(function(){return i})),r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return d})),r.d(t,"b",(function(){return u}));var o=r(12),n=r.n(o),c=r(4),a=r.n(c),s=r(2);const i=e=>{if(Object(s.getSetting)("reviewRatingsEnabled",!0)){if("lowest-rating"===e)return{order:"asc",orderby:"rating"};if("highest-rating"===e)return{order:"desc",orderby:"rating"}}return{order:"desc",orderby:"date_gmt"}},l=e=>n()({path:"/wc/store/products/reviews?"+Object.entries(e).map(e=>e.join("=")).join("&"),parse:!1}).then(e=>e.json().then(t=>({reviews:t,totalReviews:parseInt(e.headers.get("x-wp-total"),10)}))),d=e=>{const{className:t,categoryIds:r,productId:o,showReviewDate:n,showReviewerName:c,showReviewContent:s,showProductName:i,showReviewImage:l,showReviewRating:d}=e;let u="wc-block-all-reviews";return o&&(u="wc-block-reviews-by-product"),Array.isArray(r)&&(u="wc-block-reviews-by-category"),a()(u,t,{"has-image":l,"has-name":c,"has-date":n,"has-rating":d,"has-content":s,"has-product-name":i})},u=e=>{const{categoryIds:t,imageType:r,orderby:o,productId:n,reviewsOnPageLoad:c,reviewsOnLoadMore:a,showLoadMore:s,showOrderby:i}=e,l={"data-image-type":r,"data-orderby":o,"data-reviews-on-page-load":c,"data-reviews-on-load-more":a,"data-show-load-more":s,"data-show-orderby":i};return n&&(l["data-product-id"]=n),Array.isArray(t)&&(l["data-category-ids"]=t.join(",")),l}},56:function(e,t,r){"use strict";var o=r(5),n=r.n(o),c=r(0),a=r(4),s=r.n(a),i=r(3),l=r(9);r(84);class d extends c.Component{constructor(){super(...arguments),this.onClick=this.onClick.bind(this)}onClick(e){this.props.onChange&&this.props.onChange(e.target.value)}render(){const{label:e,checked:t,instanceId:r,className:o,help:a,options:l,value:d}=this.props,u="inspector-toggle-button-control-"+r;let b;return a&&(b="function"==typeof a?a(t):a),Object(c.createElement)(i.BaseControl,{id:u,help:b,className:s()("components-toggle-button-control",o)},Object(c.createElement)("label",{id:u+"__label",htmlFor:u,className:"components-toggle-button-control__label"},e),Object(c.createElement)(i.ButtonGroup,{"aria-labelledby":u+"__label"},l.map((t,r)=>{const o={};return d===t.value?(o.isPrimary=!0,o["aria-pressed"]=!0):(o.isSecondary=!0,o["aria-pressed"]=!1),Object(c.createElement)(i.Button,n()({key:`${t.label}-${t.value}-${r}`,value:t.value,onClick:this.onClick,"aria-label":e+": "+t.label},o),t.label)})))}}t.a=Object(l.withInstanceId)(d)},6:function(e,t){e.exports=window.lodash},7:function(e,t){e.exports=window.wp.blockEditor},71:function(e,t,r){"use strict";var o=r(0),n=r(1),c=r(103),a=r(155),s=r(4),i=r.n(s),l=r(3),d=r(31);r(104),t.a=e=>{let{className:t,error:r,isLoading:s=!1,onRetry:u}=e;return Object(o.createElement)(l.Placeholder,{icon:Object(o.createElement)(c.a,{icon:a.a}),label:Object(n.__)("Sorry, an error occurred","woo-gutenberg-products-block"),className:i()("wc-block-api-error",t)},Object(o.createElement)(d.a,{error:r}),u&&Object(o.createElement)(o.Fragment,null,s?Object(o.createElement)(l.Spinner,null):Object(o.createElement)(l.Button,{isSecondary:!0,onClick:u},Object(n.__)("Retry","woo-gutenberg-products-block"))))}},8:function(e,t){e.exports=window.React},84:function(e,t){},9:function(e,t){e.exports=window.wp.compose},95:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return u}));var o=r(0),n=r(1),c=r(3),a=r(7),s=r(2),i=r(56);const l=(e,t,r)=>Object(o.createElement)(a.BlockControls,null,Object(o.createElement)(c.ToolbarGroup,{controls:[{icon:"edit",title:r,onClick:()=>t({editMode:!e}),isActive:e}]})),d=(e,t)=>{const r=Object(s.getSetting)("showAvatars",!0),a=Object(s.getSetting)("reviewRatingsEnabled",!0);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Product rating","woo-gutenberg-products-block"),checked:e.showReviewRating,onChange:()=>t({showReviewRating:!e.showReviewRating})}),e.showReviewRating&&!a&&Object(o.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Product rating is disabled in your <a>store settings</a>.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(s.getAdminLink)("admin.php?page=wc-settings&tab=products"),target:"_blank",rel:"noopener noreferrer"})})),Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Reviewer name","woo-gutenberg-products-block"),checked:e.showReviewerName,onChange:()=>t({showReviewerName:!e.showReviewerName})}),Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Image","woo-gutenberg-products-block"),checked:e.showReviewImage,onChange:()=>t({showReviewImage:!e.showReviewImage})}),Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Review date","woo-gutenberg-products-block"),checked:e.showReviewDate,onChange:()=>t({showReviewDate:!e.showReviewDate})}),Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Review content","woo-gutenberg-products-block"),checked:e.showReviewContent,onChange:()=>t({showReviewContent:!e.showReviewContent})}),e.showReviewImage&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(i.a,{label:Object(n.__)("Review image","woo-gutenberg-products-block"),value:e.imageType,options:[{label:Object(n.__)("Reviewer photo","woo-gutenberg-products-block"),value:"reviewer"},{label:Object(n.__)("Product","woo-gutenberg-products-block"),value:"product"}],onChange:e=>t({imageType:e})}),"reviewer"===e.imageType&&!r&&Object(o.createElement)(c.Notice,{className:"wc-block-base-control-notice",isDismissible:!1},Object(o.createInterpolateElement)(Object(n.__)("Reviewer photo is disabled in your <a>site settings</a>.","woo-gutenberg-products-block"),{a:Object(o.createElement)("a",{href:Object(s.getAdminLink)("options-discussion.php"),target:"_blank",rel:"noopener noreferrer"})}))))},u=(e,t)=>Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Order by","woo-gutenberg-products-block"),checked:e.showOrderby,onChange:()=>t({showOrderby:!e.showOrderby})}),Object(o.createElement)(c.SelectControl,{label:Object(n.__)("Order Product Reviews by","woo-gutenberg-products-block"),value:e.orderby,options:[{label:"Most recent",value:"most-recent"},{label:"Highest Rating",value:"highest-rating"},{label:"Lowest Rating",value:"lowest-rating"}],onChange:e=>t({orderby:e})}),Object(o.createElement)(c.RangeControl,{label:Object(n.__)("Starting Number of Reviews","woo-gutenberg-products-block"),value:e.reviewsOnPageLoad,onChange:e=>t({reviewsOnPageLoad:e}),max:20,min:1}),Object(o.createElement)(c.ToggleControl,{label:Object(n.__)("Load more","woo-gutenberg-products-block"),checked:e.showLoadMore,onChange:()=>t({showLoadMore:!e.showLoadMore})}),e.showLoadMore&&Object(o.createElement)(c.RangeControl,{label:Object(n.__)("Load More Reviews","woo-gutenberg-products-block"),value:e.reviewsOnLoadMore,onChange:e=>t({reviewsOnLoadMore:e}),max:20,min:1}))}});
build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/catego--ce653f6d.js ADDED
@@ -0,0 +1 @@
 
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{36:function(n,t,c){"use strict";c.d(t,"b",(function(){return o})),c.d(t,"d",(function(){return r})),c.d(t,"c",(function(){return u})),c.d(t,"e",(function(){return e})),c.d(t,"a",(function(){return i}));const o=n=>"number"==typeof n,r=n=>"string"==typeof n,u=n=>!(n=>null===n)(n)&&n instanceof Object&&n.constructor===Object;function e(n,t){return u(n)&&t in n}const i=n=>n instanceof Error}}]);
build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---8f355022.js DELETED
@@ -1 +0,0 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{62:function(n,t,c){"use strict";c.d(t,"a",(function(){return o})),c.d(t,"c",(function(){return u})),c.d(t,"b",(function(){return r})),c.d(t,"d",(function(){return e}));const o=n=>"number"==typeof n,u=n=>"string"==typeof n,r=n=>!(n=>null===n)(n)&&n instanceof Object&&n.constructor===Object;function e(n,t){return r(n)&&t in n}}}]);
 
build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{151:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>e.reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})},251:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return i}));const n=window.CustomEvent||null,c=(e,t)=>{let{bubbles:r=!1,cancelable:c=!1,element:s,detail:o={}}=t;if(!n)return;s||(s=document.body);const i=new n(e,{bubbles:r,cancelable:c,detail:o});s.dispatchEvent(i)};let s;const o=()=>{s&&clearTimeout(s),s=setTimeout(()=>{c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},i=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const s=()=>{c(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,s),()=>jQuery(document).off(e,s)}},252:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return a}));var n=r(2),c=r(99),s=r(15);const o=e=>{let{country:t="",state:r="",city:n="",postcode:c=""}=e;return{country:t.trim(),state:r.trim(),city:n.trim(),postcode:c?c.replace(" ","").toUpperCase():""}},i=e=>{let{email:t=""}=e;return Object(s.isEmail)(t)?t.trim():""},a=e=>{const t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),s=Object.assign({},e);return r.forEach(t=>{let{key:r="",hidden:n=!1}=t;n&&((e,t)=>e in t)(r,e)&&(s[r]="")}),s}},36:function(e,t,r){"use strict";r.d(t,"a",(function(){return w}));var n=r(6),c=r(0),s=r(16),o=r(13),i=r(14),a=r(151),d=r(252),u=r(49),l=r(251);const p=e=>{const t=e.detail;t&&t.preserveCartData||Object(o.dispatch)(s.CART_STORE_KEY).invalidateResolutionForStore()},_=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},b=()=>{Object(c.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(l.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(l.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",p),document.body.addEventListener("wc-blocks_removed_from_cart",p),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",p),document.body.removeEventListener("wc-blocks_removed_from_cart",p)}}window.wcBlocksStoreCartListeners.count++})(),_),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},E={...m,email:""},h={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:s.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},g=e=>Object(a.a)(Object.entries(e).map(e=>{let[t,r]=e;return[t,Object(i.decodeEntities)(r)]})),f={cartCoupons:s.EMPTY_CART_COUPONS,cartItems:s.EMPTY_CART_ITEMS,cartFees:s.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:h,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:E,shippingAddress:m,shippingRates:s.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:s.EMPTY_EXTENSIONS},w=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:r}=Object(u.b)(),i=null==r?void 0:r.previewCart,{shouldSelect:a}=e,l=Object(c.useRef)();b();const p=Object(o.useSelect)((e,r)=>{let{dispatch:n}=r;if(!a)return f;if(t)return{cartCoupons:i.coupons,cartItems:i.items,cartFees:i.fees,cartItemsCount:i.items_count,cartItemsWeight:i.items_weight,cartNeedsPayment:i.needs_payment,cartNeedsShipping:i.needs_shipping,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:i.totals,cartIsLoading:!1,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:E,shippingAddress:m,extensions:s.EMPTY_EXTENSIONS,shippingRates:i.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:i.has_calculated_shipping,paymentRequirements:i.paymentRequirements,receiveCart:"function"==typeof(null==i?void 0:i.receiveCart)?i.receiveCart:()=>{}};const c=e(s.CART_STORE_KEY),o=c.getCartData(),u=c.getCartErrors(),l=c.getCartTotals(),p=!c.hasFinishedResolution("getCartData"),_=c.isCustomerDataUpdating(),{receiveCart:b}=n(s.CART_STORE_KEY),h=g(o.billingAddress),w=o.needsShipping?g(o.shippingAddress):h,C=o.fees.length>0?o.fees.map(e=>g(e)):s.EMPTY_CART_FEES;return{cartCoupons:o.coupons.length>0?o.coupons.map(e=>({...e,label:e.code})):s.EMPTY_CART_COUPONS,cartItems:o.items,cartFees:C,cartItemsCount:o.itemsCount,cartItemsWeight:o.itemsWeight,cartNeedsPayment:o.needsPayment,cartNeedsShipping:o.needsShipping,cartItemErrors:o.errors,cartTotals:l,cartIsLoading:p,cartErrors:u,billingAddress:Object(d.a)(h),shippingAddress:Object(d.a)(w),extensions:o.extensions,shippingRates:o.shippingRates,shippingRatesLoading:_,cartHasCalculatedShipping:o.hasCalculatedShipping,paymentRequirements:o.paymentRequirements,receiveCart:b}},[a]);return l.current&&Object(n.isEqual)(l.current,p)||(l.current=p),l.current}},49:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return i}));var n=r(0),c=r(13);const s=Object(n.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),o=()=>Object(n.useContext)(s),i=e=>{let{children:t,currentPostId:r=0,currentView:o="",previewData:i={}}=e;const a=Object(c.useSelect)(e=>r||e("core/editor").getCurrentPostId(),[r]),d=Object(n.useCallback)(e=>e in i?i[e]:{},[i]),u={isEditor:!0,currentPostId:a,currentView:o,previewData:i,getPreviewData:d};return Object(n.createElement)(s.Provider,{value:u},t)}},60:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(61),c=r(0),s=r(36);const o=()=>{const e=Object(s.a)(),t=Object(c.useRef)(e);return Object(c.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(c.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(c.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...r,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},99:function(e,t,r){"use strict";var n=r(2),c=r(1),s=r(62);const o=Object(n.getSetting)("countryLocale",{}),i=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(c.sprintf)(
2
  /* translators: %s Field label. */
3
- Object(c.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(s.a)(e.priority)&&(t.index=e.priority),Object(s.c)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},a=Object.entries(o).map(e=>{let[t,r]=e;return[t,Object.entries(r).map(e=>{let[t,r]=e;return[t,i(r)]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{});t.a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const c=r&&void 0!==a[r]?a[r]:{};return e.map(e=>({key:e,...n.defaultAddressFields[e]||{},...c[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{149:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n=e=>e.reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})},250:function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return a}));const n=window.CustomEvent||null,c=(e,t)=>{let{bubbles:r=!1,cancelable:c=!1,element:s,detail:o={}}=t;if(!n)return;s||(s=document.body);const i=new n(e,{bubbles:r,cancelable:c,detail:o});s.dispatchEvent(i)};let s;const o=()=>{s&&clearTimeout(s),s=setTimeout(()=>{c("wc_fragment_refresh",{bubbles:!0,cancelable:!0})},50)},i=e=>{let{preserveCartData:t=!1}=e;c("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:t}})},a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("function"!=typeof jQuery)return()=>{};const s=()=>{c(t,{bubbles:r,cancelable:n})};return jQuery(document).on(e,s),()=>jQuery(document).off(e,s)}},251:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return a}));var n=r(2),c=r(99),s=r(17);const o=e=>{let{country:t="",state:r="",city:n="",postcode:c=""}=e;return{country:t.trim(),state:r.trim(),city:n.trim(),postcode:c?c.replace(" ","").toUpperCase():""}},i=e=>{let{email:t=""}=e;return Object(s.isEmail)(t)?t.trim():""},a=e=>{const t=Object.keys(n.defaultAddressFields),r=Object(c.a)(t,{},e.country),s=Object.assign({},e);return r.forEach(t=>{let{key:r="",hidden:n=!1}=t;n&&((e,t)=>e in t)(r,e)&&(s[r]="")}),s}},35:function(e,t,r){"use strict";r.d(t,"a",(function(){return C}));var n=r(6),c=r(0),s=r(18),o=r(14),i=r(16),a=r(149),d=r(251),u=r(48),l=r(250);const p=e=>{const t=e.detail;t&&t.preserveCartData||Object(o.dispatch)(s.CART_STORE_KEY).invalidateResolutionForStore()},_=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},b=()=>{Object(c.useEffect)(()=>((()=>{if(window.wcBlocksStoreCartListeners||(window.wcBlocksStoreCartListeners={count:0,remove:()=>{}}),0===window.wcBlocksStoreCartListeners.count){const e=Object(l.a)("added_to_cart","wc-blocks_added_to_cart"),t=Object(l.a)("removed_from_cart","wc-blocks_removed_from_cart");document.body.addEventListener("wc-blocks_added_to_cart",p),document.body.addEventListener("wc-blocks_removed_from_cart",p),window.wcBlocksStoreCartListeners.count=0,window.wcBlocksStoreCartListeners.remove=()=>{e(),t(),document.body.removeEventListener("wc-blocks_added_to_cart",p),document.body.removeEventListener("wc-blocks_removed_from_cart",p)}}window.wcBlocksStoreCartListeners.count++})(),_),[])},m={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},E={...m,email:""},h={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:s.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},g=e=>Object(a.a)(Object.entries(e).map(e=>{let[t,r]=e;return[t,Object(i.decodeEntities)(r)]})),f={cartCoupons:s.EMPTY_CART_COUPONS,cartItems:s.EMPTY_CART_ITEMS,cartFees:s.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:h,cartIsLoading:!0,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:E,shippingAddress:m,shippingRates:s.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:s.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:()=>{},extensions:s.EMPTY_EXTENSIONS},C=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0};const{isEditor:t,previewData:r}=Object(u.b)(),i=null==r?void 0:r.previewCart,{shouldSelect:a}=e,l=Object(c.useRef)();b();const p=Object(o.useSelect)((e,r)=>{let{dispatch:n}=r;if(!a)return f;if(t)return{cartCoupons:i.coupons,cartItems:i.items,cartFees:i.fees,cartItemsCount:i.items_count,cartItemsWeight:i.items_weight,cartNeedsPayment:i.needs_payment,cartNeedsShipping:i.needs_shipping,cartItemErrors:s.EMPTY_CART_ITEM_ERRORS,cartTotals:i.totals,cartIsLoading:!1,cartErrors:s.EMPTY_CART_ERRORS,billingAddress:E,shippingAddress:m,extensions:s.EMPTY_EXTENSIONS,shippingRates:i.shipping_rates,shippingRatesLoading:!1,cartHasCalculatedShipping:i.has_calculated_shipping,paymentRequirements:i.paymentRequirements,receiveCart:"function"==typeof(null==i?void 0:i.receiveCart)?i.receiveCart:()=>{}};const c=e(s.CART_STORE_KEY),o=c.getCartData(),u=c.getCartErrors(),l=c.getCartTotals(),p=!c.hasFinishedResolution("getCartData"),_=c.isCustomerDataUpdating(),{receiveCart:b}=n(s.CART_STORE_KEY),h=g(o.billingAddress),C=o.needsShipping?g(o.shippingAddress):h,w=o.fees.length>0?o.fees.map(e=>g(e)):s.EMPTY_CART_FEES;return{cartCoupons:o.coupons.length>0?o.coupons.map(e=>({...e,label:e.code})):s.EMPTY_CART_COUPONS,cartItems:o.items,cartFees:w,cartItemsCount:o.itemsCount,cartItemsWeight:o.itemsWeight,cartNeedsPayment:o.needsPayment,cartNeedsShipping:o.needsShipping,cartItemErrors:o.errors,cartTotals:l,cartIsLoading:p,cartErrors:u,billingAddress:Object(d.a)(h),shippingAddress:Object(d.a)(C),extensions:o.extensions,shippingRates:o.shippingRates,shippingRatesLoading:_,cartHasCalculatedShipping:o.hasCalculatedShipping,paymentRequirements:o.paymentRequirements,receiveCart:b}},[a]);return l.current&&Object(n.isEqual)(l.current,p)||(l.current=p),l.current}},48:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return i}));var n=r(0),c=r(14);const s=Object(n.createContext)({isEditor:!1,currentPostId:0,currentView:"",previewData:{},getPreviewData:()=>{}}),o=()=>Object(n.useContext)(s),i=e=>{let{children:t,currentPostId:r=0,currentView:o="",previewData:i={}}=e;const a=Object(c.useSelect)(e=>r||e("core/editor").getCurrentPostId(),[r]),d=Object(n.useCallback)(e=>e in i?i[e]:{},[i]),u={isEditor:!0,currentPostId:a,currentView:o,previewData:i,getPreviewData:d};return Object(n.createElement)(s.Provider,{value:u},t)}},60:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(61),c=r(0),s=r(35);const o=()=>{const e=Object(s.a)(),t=Object(c.useRef)(e);return Object(c.useEffect)(()=>{t.current=e},[e]),{dispatchStoreEvent:Object(c.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-"+e,t)}catch(e){console.error(e)}}),[]),dispatchCheckoutEvent:Object(c.useCallback)((function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(n.doAction)("experimental__woocommerce_blocks-checkout-"+e,{...r,storeCart:t.current})}catch(e){console.error(e)}}),[])}}},99:function(e,t,r){"use strict";var n=r(2),c=r(1),s=r(36);const o=Object(n.getSetting)("countryLocale",{}),i=e=>{const t={};return void 0!==e.label&&(t.label=e.label),void 0!==e.required&&(t.required=e.required),void 0!==e.hidden&&(t.hidden=e.hidden),void 0===e.label||e.optionalLabel||(t.optionalLabel=Object(c.sprintf)(
2
  /* translators: %s Field label. */
3
+ Object(c.__)("%s (optional)","woo-gutenberg-products-block"),e.label)),e.priority&&(Object(s.b)(e.priority)&&(t.index=e.priority),Object(s.d)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},a=Object.entries(o).map(e=>{let[t,r]=e;return[t,Object.entries(r).map(e=>{let[t,r]=e;return[t,i(r)]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{})]}).reduce((e,t)=>{let[r,n]=t;return e[r]=n,e},{});t.a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const c=r&&void 0!==a[r]?a[r]:{};return e.map(e=>({key:e,...n.defaultAddressFields[e]||{},...c[e]||{},...t[e]||{}})).sort((e,t)=>e.index-t.index)}}}]);
build/atomic-block-components/add-to-cart--atomic-block-components/button.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{130:function(e,t,c){"use strict";c.d(t,"b",(function(){return v})),c.d(t,"a",(function(){return N}));var o=c(0),n=(c(10),c(13)),s=c(60),r=c(49),i=c(5),a=c.n(i),u=c(4),l=c.n(u),d=c(488);c(159);const m=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""};var b=e=>{let{className:t,notices:c,removeNotice:n}=e;const s=c.filter(e=>"snackbar"!==e.type);if(!s.length)return null;const r=l()(t,"wc-block-components-notices");return Object(o.createElement)("div",{className:r},s.map(e=>Object(o.createElement)(d.a,a()({key:"store-notice-"+e.id},e,{className:l()("wc-block-components-notices__notice",m(e)),onRemove:()=>{e.isDismissible&&n(e.id)}}),e.content)))};const f=Object(o.createContext)({notices:[],createNotice:(e,t,c)=>{},removeNotice:(e,t)=>{},setIsSuppressed:e=>{},context:"wc/core"}),v=()=>Object(o.useContext)(f),N=e=>{let{children:t,className:c="",createNoticeContainer:i=!0,context:a="wc/core"}=e;const{createNotice:u,removeNotice:l}=Object(n.useDispatch)("core/notices"),[d,m]=Object(o.useState)(!1),{dispatchStoreEvent:v}=Object(s.a)(),{isEditor:N}=Object(r.b)(),O=Object(o.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};u(e,t,{...c,context:c.context||a}),v("store-notice-create",{status:e,content:t,options:c})}),[u,v,a]),j=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;l(e,t)}),[l,a]),{notices:p}=Object(n.useSelect)(e=>({notices:e("core/notices").getNotices(a)}),[a]),h={notices:p,createNotice:O,removeNotice:j,context:a,setIsSuppressed:m},g=d?null:Object(o.createElement)(b,{className:c,notices:h.notices,removeNotice:h.removeNotice,isEditor:N});return Object(o.createElement)(f.Provider,{value:h},i&&g,t)}},159:function(e,t){},360:function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var o=c(0),n=c(13),s=c(16),r=c(14),i=c(36),a=c(47);const u=(e,t)=>{const c=e.find(e=>{let{id:c}=e;return c===t});return c?c.quantity:0},l=e=>{const{addItemToCart:t}=Object(n.useDispatch)(s.CART_STORE_KEY),{cartItems:c,cartIsLoading:l}=Object(i.a)(),{addErrorNotice:d,removeNotice:m}=Object(a.a)(),[b,f]=Object(o.useState)(!1),v=Object(o.useRef)(u(c,e));return Object(o.useEffect)(()=>{const t=u(c,e);t!==v.current&&(v.current=t)},[c,e]),{cartQuantity:Number.isFinite(v.current)?v.current:0,addingToCart:b,cartIsLoading:l,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return f(!0),t(e,c).then(()=>{m("add-to-cart")}).catch(e=>{d(Object(r.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})}).finally(()=>{f(!1)})}}}},47:function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var o=c(0),n=c(130);const s=()=>{const{notices:e,createNotice:t,removeNotice:c,setIsSuppressed:s}=Object(n.b)(),r=Object(o.useRef)(e);Object(o.useEffect)(()=>{r.current=e},[e]);const i=Object(o.useMemo)(()=>({hasNoticesOfType:e=>r.current.some(t=>t.type===e),removeNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;r.current.forEach(t=>{null!==e&&t.status!==e||c(t.id)})},removeNotice:c}),[c]),a=Object(o.useMemo)(()=>({addDefaultNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("default",e,{...c})},addErrorNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("error",e,{...c})},addWarningNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("warning",e,{...c})},addInfoNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("info",e,{...c})},addSuccessNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("success",e,{...c})}}),[t]);return{notices:e,...i,...a,setIsSuppressed:s}}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[4],{127:function(e,t,c){"use strict";c.d(t,"b",(function(){return v})),c.d(t,"a",(function(){return N}));var o=c(0),n=(c(10),c(14)),s=c(60),r=c(48),i=c(5),a=c.n(i),u=c(4),l=c.n(u),d=c(494);c(158);const m=e=>{let{status:t="default"}=e;switch(t){case"error":return"woocommerce-error";case"success":return"woocommerce-message";case"info":case"warning":return"woocommerce-info"}return""};var b=e=>{let{className:t,notices:c,removeNotice:n}=e;const s=c.filter(e=>"snackbar"!==e.type);if(!s.length)return null;const r=l()(t,"wc-block-components-notices");return Object(o.createElement)("div",{className:r},s.map(e=>Object(o.createElement)(d.a,a()({key:"store-notice-"+e.id},e,{className:l()("wc-block-components-notices__notice",m(e)),onRemove:()=>{e.isDismissible&&n(e.id)}}),e.content)))};const f=Object(o.createContext)({notices:[],createNotice:(e,t,c)=>{},removeNotice:(e,t)=>{},setIsSuppressed:e=>{},context:"wc/core"}),v=()=>Object(o.useContext)(f),N=e=>{let{children:t,className:c="",createNoticeContainer:i=!0,context:a="wc/core"}=e;const{createNotice:u,removeNotice:l}=Object(n.useDispatch)("core/notices"),[d,m]=Object(o.useState)(!1),{dispatchStoreEvent:v}=Object(s.a)(),{isEditor:N}=Object(r.b)(),O=Object(o.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};u(e,t,{...c,context:c.context||a}),v("store-notice-create",{status:e,content:t,options:c})}),[u,v,a]),j=Object(o.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;l(e,t)}),[l,a]),{notices:p}=Object(n.useSelect)(e=>({notices:e("core/notices").getNotices(a)}),[a]),h={notices:p,createNotice:O,removeNotice:j,context:a,setIsSuppressed:m},g=d?null:Object(o.createElement)(b,{className:c,notices:h.notices,removeNotice:h.removeNotice,isEditor:N});return Object(o.createElement)(f.Provider,{value:h},i&&g,t)}},158:function(e,t){},355:function(e,t,c){"use strict";c.d(t,"a",(function(){return l}));var o=c(0),n=c(14),s=c(18),r=c(16),i=c(35),a=c(45);const u=(e,t)=>{const c=e.find(e=>{let{id:c}=e;return c===t});return c?c.quantity:0},l=e=>{const{addItemToCart:t}=Object(n.useDispatch)(s.CART_STORE_KEY),{cartItems:c,cartIsLoading:l}=Object(i.a)(),{addErrorNotice:d,removeNotice:m}=Object(a.a)(),[b,f]=Object(o.useState)(!1),v=Object(o.useRef)(u(c,e));return Object(o.useEffect)(()=>{const t=u(c,e);t!==v.current&&(v.current=t)},[c,e]),{cartQuantity:Number.isFinite(v.current)?v.current:0,addingToCart:b,cartIsLoading:l,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return f(!0),t(e,c).then(()=>{m("add-to-cart")}).catch(e=>{d(Object(r.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})}).finally(()=>{f(!1)})}}}},45:function(e,t,c){"use strict";c.d(t,"a",(function(){return s}));var o=c(0),n=c(127);const s=()=>{const{notices:e,createNotice:t,removeNotice:c,setIsSuppressed:s}=Object(n.b)(),r=Object(o.useRef)(e);Object(o.useEffect)(()=>{r.current=e},[e]);const i=Object(o.useMemo)(()=>({hasNoticesOfType:e=>r.current.some(t=>t.type===e),removeNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;r.current.forEach(t=>{null!==e&&t.status!==e||c(t.id)})},removeNotice:c}),[c]),a=Object(o.useMemo)(()=>({addDefaultNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("default",e,{...c})},addErrorNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("error",e,{...c})},addWarningNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("warning",e,{...c})},addInfoNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("info",e,{...c})},addSuccessNotice:function(e){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("success",e,{...c})}}),[t]);return{notices:e,...i,...a,setIsSuppressed:s}}}}]);
build/atomic-block-components/add-to-cart-frontend.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[7],{130:function(e,t,r){"use strict";var s=r(0);r(157),t.a=()=>Object(s.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},157:function(e,t){},160:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return l}));var s=r(0),n=r(5),c=r(11),a=r.n(c);const o=Object(s.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),i=()=>Object(s.useContext)(o),l=e=>{let{children:t}=e;const[r,c]=Object(s.useState)({}),i=Object(s.useCallback)(e=>r[e],[r]),l=Object(s.useCallback)(e=>{const t=r[e];return!t||t.hidden?"":"validate-error-"+e},[r]),u=Object(s.useCallback)(e=>{c(t=>{if(!t[e])return t;const{[e]:r,...s}=t;return s})},[]),d=Object(s.useCallback)(()=>{c({})},[]),b=Object(s.useCallback)(e=>{e&&c(t=>(e=Object(n.pickBy)(e,(e,r)=>!("string"!=typeof e.message||t.hasOwnProperty(r)&&a()(t[r],e))),0===Object.values(e).length?t:{...t,...e}))},[]),E=Object(s.useCallback)((e,t)=>{c(r=>{if(!r.hasOwnProperty(e))return r;const s={...r[e],...t};return a()(r[e],s)?r:{...r,[e]:s}})},[]),p={getValidationError:i,setValidationErrors:b,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(s.useCallback)(e=>{E(e,{hidden:!0})},[E]),showValidationError:Object(s.useCallback)(e=>{E(e,{hidden:!1})},[E]),showAllValidationErrors:Object(s.useCallback)(()=>{c(e=>{const t={};return Object.keys(e).forEach(r=>{e[r].hidden&&(t[r]={...e[r],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(r).length>0,getValidationErrorId:l};return Object(s.createElement)(o.Provider,{value:p},t)}},169:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var s=r(89);const n=(e,t)=>function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const c=s.a.addEventCallback(e,r,n);return t(c),()=>{t(s.a.removeEventCallback(e,c.id))}}},17:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var s=r(0),n=r(11),c=r.n(n);function a(e){const t=Object(s.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},170:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));const s=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var n=r(29);const c=async(e,t,r)=>{const n=s(e,t),c=[];for(const e of n)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&c.push(t)}catch(e){console.error(e)}return!c.length||c},a=async(e,t,r)=>{const c=[],a=s(e,t);for(const e of a)try{const t=await Promise.resolve(e.callback(r));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(n.a)(t)||Object(n.b)(t))return c.push(t),c;c.push(t)}catch(e){return console.error(e),c.push({type:"error"}),c}return c}},222:function(e,t){},228:function(e,t,r){"use strict";var s=r(10),n=r.n(s),c=r(0),a=r(56),o=r(4),i=r.n(o),l=r(130);r(231),t.a=e=>{let{className:t,showSpinner:r=!1,children:s,...o}=e;const u=i()("wc-block-components-button",t,{"wc-block-components-button--loading":r});return Object(c.createElement)(a.a,n()({className:u},o),r&&Object(c.createElement)(l.a,null),Object(c.createElement)("span",{className:"wc-block-components-button__text"},s))}},231:function(e,t){},236:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var s=r(0),n=(r(8),r(160));r(222);const c=e=>{let{errorMessage:t="",propertyName:r="",elementId:c=""}=e;const{getValidationError:a,getValidationErrorId:o}=Object(n.b)();if(!t||"string"!=typeof t){const e=a(r)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(s.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(s.createElement)("p",{id:o(c)},t))}},29:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return d}));var s=r(35);let n,c;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));const a=(e,t)=>Object(s.c)(e)&&"type"in e&&e.type===t,o=e=>a(e,n.SUCCESS),i=e=>a(e,n.ERROR),l=e=>a(e,n.FAIL),u=e=>!Object(s.c)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:n,noticeContexts:c,shouldRetry:u,isSuccessResponse:o,isErrorResponse:i,isFailResponse:l})},318:function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var s=r(0),n=r(9),c=r(6),a=r(19),o=r(22),i=r(32);const l=(e,t)=>{const r=e.find(e=>{let{id:r}=e;return r===t});return r?r.quantity:0},u=e=>{const{addItemToCart:t}=Object(n.useDispatch)(c.CART_STORE_KEY),{cartItems:r,cartIsLoading:u}=Object(o.a)(),{addErrorNotice:d,removeNotice:b}=Object(i.a)(),[E,p]=Object(s.useState)(!1),m=Object(s.useRef)(l(r,e));return Object(s.useEffect)(()=>{const t=l(r,e);t!==m.current&&(m.current=t)},[r,e]),{cartQuantity:Number.isFinite(m.current)?m.current:0,addingToCart:E,cartIsLoading:u,addToCart:function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return p(!0),t(e,r).then(()=>{b("add-to-cart")}).catch(e=>{d(Object(a.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})}).finally(()=>{p(!1)})}}}},32:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var s=r(0),n=r(87);const c=()=>{const{notices:e,createNotice:t,removeNotice:r,setIsSuppressed:c}=Object(n.b)(),a=Object(s.useRef)(e);Object(s.useEffect)(()=>{a.current=e},[e]);const o=Object(s.useMemo)(()=>({hasNoticesOfType:e=>a.current.some(t=>t.type===e),removeNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.current.forEach(t=>{null!==e&&t.status!==e||r(t.id)})},removeNotice:r}),[r]),i=Object(s.useMemo)(()=>({addDefaultNotice:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("default",e,{...r})},addErrorNotice:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("error",e,{...r})},addWarningNotice:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("warning",e,{...r})},addInfoNotice:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("info",e,{...r})},addSuccessNotice:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("success",e,{...r})}}),[t]);return{notices:e,...o,...i,setIsSuppressed:c}}},324:function(e,t){},325:function(e,t,r){"use strict";var s=r(0),n=r(24);const c=Object(s.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(s.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(s.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=c},326:function(e,t){},384:function(e,t,r){"use strict";r.r(t);var s=r(110),n=r(0),c=(r(8),r(4)),a=r.n(c),o=r(1),i=r(17);const l=e=>e.is_purchasable||!1,u={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},d={status:u.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},b={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:E,SET_IDLE:p,SET_DISABLED:m,SET_PROCESSING:O,SET_BEFORE_PROCESSING:h,SET_AFTER_PROCESSING:f,SET_PROCESSING_RESPONSE:_,SET_HAS_ERROR:j,SET_NO_ERROR:g,SET_QUANTITY:S,SET_REQUEST_PARAMS:v}=b,y=()=>({type:p}),R=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?j:g;return{type:t}},{SET_PRISTINE:C,SET_IDLE:P,SET_DISABLED:T,SET_PROCESSING:A,SET_BEFORE_PROCESSING:k,SET_AFTER_PROCESSING:N,SET_PROCESSING_RESPONSE:w,SET_HAS_ERROR:I,SET_NO_ERROR:D,SET_QUANTITY:F,SET_REQUEST_PARAMS:V}=b,{PRISTINE:B,IDLE:L,DISABLED:q,PROCESSING:x,BEFORE_PROCESSING:G,AFTER_PROCESSING:M}=u,Q=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,{quantity:r,type:s,data:n}=arguments.length>1?arguments[1]:void 0;switch(s){case C:e=d;break;case P:e=t.status!==L?{...t,status:L}:t;break;case T:e=t.status!==q?{...t,status:q}:t;break;case F:e=r!==t.quantity?{...t,quantity:r}:t;break;case V:e={...t,requestParams:{...t.requestParams,...n}};break;case w:e={...t,processingResponse:n};break;case A:e=t.status!==x?{...t,status:x,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case k:e=t.status!==G?{...t,status:G,hasError:!1}:t;break;case N:e=t.status!==M?{...t,status:M}:t;break;case I:e=t.hasError?t:{...t,hasError:!0},e=t.status===x||t.status===G?{...e,status:L}:e;break;case D:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&s!==C&&e.status===B&&(e.status=L),e};var W=r(89),H=r(169);const U=e=>({onAddToCartAfterProcessingWithSuccess:Object(H.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(H.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(H.a)("add_to_cart_before_processing",e)});var K=r(170),Y=r(160),z=r(32),J=r(29);const X=Object(n.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),Z=()=>Object(n.useContext)(X),$=e=>{var t,r,s,c;let{children:a,product:b,showFormElements:p}=e;const[j,g]=Object(n.useReducer)(Q,d),[C,P]=Object(n.useReducer)(W.b,{}),T=Object(i.a)(C),{addErrorNotice:A,removeNotices:k}=Object(z.a)(),{setValidationErrors:N}=Object(Y.b)(),{isSuccessResponse:w,isErrorResponse:I,isFailResponse:D}=Object(J.c)(),F=Object(n.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:U(P).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:U(P).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:U(P).onAddToCartBeforeProcessing}),[P]),V=Object(n.useMemo)(()=>({resetForm:()=>{g({type:E})},submitForm:()=>{g({type:h})},setQuantity:e=>{g((e=>({type:S,quantity:e}))(e))},setHasError:e=>{g(R(e))},setRequestParams:e=>{g((e=>({type:v,data:e}))(e))},setAfterProcessing:e=>{g({type:_,data:e}),g({type:f})}}),[]);Object(n.useEffect)(()=>{const e=j.status,t=!b.id||!l(b);e!==u.DISABLED||t?e!==u.DISABLED&&t&&g({type:m}):g(y())},[j.status,b,g]),Object(n.useEffect)(()=>{j.status===u.BEFORE_PROCESSING&&(k("error"),Object(K.a)(T,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;t&&A(t),r&&N(r)}),g(y())):g({type:O})}))},[j.status,N,A,k,g,T]),Object(n.useEffect)(()=>{if(j.status===u.AFTER_PROCESSING){const e={processingResponse:j.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:r,messageContext:s}=e;(I(e)||D(e))&&r&&(t=!0,A(r,s?{context:s}:void 0))}),t};if(j.hasError)return void Object(K.b)(T,"add_to_cart_after_processing_with_error",e).then(r=>{if(!t(r)){var s;const t=(null===(s=e.processingResponse)||void 0===s?void 0:s.message)||Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");A(t,{id:"add-to-cart"})}g(y())});Object(K.b)(T,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?g(R(!0)):g(y())})}},[j.status,j.hasError,j.processingResponse,V,A,I,D,w,T]);const B=(e=>["simple","variable"].includes(e.type||"simple"))(b),L={product:b,productType:b.type||"simple",productIsPurchasable:l(b),productHasOptions:b.has_options||!1,supportsFormElements:B,showFormElements:p&&B,quantity:j.quantity||(null==b||null===(t=b.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==b||null===(r=b.add_to_cart)||void 0===r?void 0:r.minimum)||1,maxQuantity:(null==b||null===(s=b.add_to_cart)||void 0===s?void 0:s.maximum)||99,multipleOf:(null==b||null===(c=b.add_to_cart)||void 0===c?void 0:c.multiple_of)||1,requestParams:j.requestParams,isIdle:j.status===u.IDLE,isDisabled:j.status===u.DISABLED,isProcessing:j.status===u.PROCESSING,isBeforeProcessing:j.status===u.BEFORE_PROCESSING,isAfterProcessing:j.status===u.AFTER_PROCESSING,hasError:j.hasError,eventRegistration:F,dispatchActions:V};return Object(n.createElement)(X.Provider,{value:L},a)};var ee=r(27),te=r.n(ee),re=r(19),se=r(22),ne=()=>{const{dispatchActions:e,product:t,quantity:r,eventRegistration:s,hasError:c,isProcessing:a,requestParams:i}=Z(),{hasValidationErrors:l,showAllValidationErrors:u}=Object(Y.b)(),{addErrorNotice:d,removeNotice:b}=Object(z.a)(),{receiveCart:E}=Object(se.a)(),[p,m]=Object(n.useState)(!1),O=!c&&a,h=Object(n.useCallback)(()=>!l||(u(),{type:"error"}),[l,u]);Object(n.useEffect)(()=>{const e=s.onAddToCartBeforeProcessing(h,0);return()=>{e()}},[s,h]);const f=Object(n.useCallback)(()=>{m(!0),b("add-to-cart");const s={id:t.id||0,quantity:r,...i};te()({path:"/wc/store/cart/add-item",method:"POST",data:s,cache:"no-store",parse:!1}).then(t=>{te.a.setNonce(t.headers),t.json().then((function(r){t.ok?E(r):(r.body&&r.body.message?d(Object(re.decodeEntities)(r.body.message),{id:"add-to-cart"}):d(Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),e.setHasError()),e.setAfterProcessing(r),m(!1)}))}).catch(t=>{t.json().then((function(t){var r;null!==(r=t.data)&&void 0!==r&&r.cart&&E(t.data.cart),e.setHasError(),e.setAfterProcessing(t),m(!1)}))})},[t,d,b,E,e,r,i]);return Object(n.useEffect)(()=>{O&&!p&&f()},[O,f,p]),null};const ce=e=>{let{children:t,product:r,showFormElements:s}=e;return Object(n.createElement)(Y.a,null,Object(n.createElement)($,{product:r,showFormElements:s},t,Object(n.createElement)(ne,null)))};var ae=r(49),oe=r(5),ie=(r(324),r(228)),le=r(98),ue=r(325),de=r(38),be=r(318);const Ee=e=>{let{className:t,href:r,text:s,onClick:c}=e;return Object(n.createElement)(ie.a,{className:t,href:r,onClick:c,rel:"nofollow"},s)},pe=e=>{let{className:t,quantityInCart:r,isProcessing:s,isDisabled:c,isDone:a,onClick:i}=e;return Object(n.createElement)(ie.a,{className:t,disabled:c,showSpinner:s,onClick:i},a&&r>0?Object(o.sprintf)(
2
  /* translators: %s number of products in cart. */
3
- Object(o._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(o.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(le.a,{srcElement:ue.a,alt:Object(o.__)("Done","woo-gutenberg-products-block")}))};var me=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:r,product:s,productType:c,isDisabled:a,isProcessing:i,eventRegistration:l,hasError:u,dispatchActions:d}=Z(),{parentName:b}=Object(ae.useInnerBlockLayoutContext)(),{dispatchStoreEvent:E}=Object(de.a)(),{cartQuantity:p}=Object(be.a)(s.id||0),[m,O]=Object(n.useState)(!1),h=s.add_to_cart||{url:"",text:""};return Object(n.useEffect)(()=>{const e=l.onAddToCartAfterProcessingWithSuccess(()=>(u||O(!0),!0),0);return()=>{e()}},[l,u]),(e||!r&&"simple"===c)&&t?Object(n.createElement)(pe,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:p,isDisabled:a,isProcessing:i,isDone:m,onClick:()=>{d.submitForm(),E("cart-add-item",{product:s,listName:b})}}):Object(n.createElement)(Ee,{className:"wc-block-components-product-add-to-cart-button",href:h.url,text:h.text||Object(o.__)("View Product","woo-gutenberg-products-block"),onClick:()=>{E("product-view-link",{product:s,listName:b})}})},Oe=r(52),he=e=>{let{disabled:t,min:r,max:s,step:c=1,value:a,onChange:o}=e;const i=void 0!==s,l=Object(Oe.a)(e=>{let t=e;i&&(t=Math.min(t,Math.floor(s/c)*c)),t=Math.max(t,Math.ceil(r/c)*c),t=Math.floor(t/c)*c,t!==e&&o(t)},300);return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:a,min:r,max:s,step:c,hidden:1===s,disabled:t,onChange:e=>{o(e.target.value),l(e.target.value)}})},fe=e=>{let{reason:t=Object(o.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block")}=e;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},_e=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:s,multipleOf:c,dispatchActions:a,isDisabled:i}=Z();return e.id&&!e.is_purchasable?Object(n.createElement)(fe,null):e.id&&!e.is_in_stock?Object(n.createElement)(fe,{reason:Object(o.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(he,{value:t,min:r,max:s,step:c,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(me,null))},je=(r(326),r(385)),ge=r(3),Se=r(236);const ve={value:"",label:Object(o.__)("Select an option","woo-gutenberg-products-block")};var ye=e=>{let{attributeName:t,options:r=[],value:s="",onChange:c=(()=>{}),errorMessage:i=Object(o.__)("Please select a value.","woo-gutenberg-products-block")}=e;const{getValidationError:l,setValidationErrors:u,clearValidationError:d}=Object(Y.b)(),b=t,E=l(b)||{};return Object(ge.useEffect)(()=>{s?d(b):u({[b]:{message:i,hidden:!0}})},[s,b,i,d,u]),Object(ge.useEffect)(()=>()=>{d(b)},[b,d]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(je.a,{label:Object(re.decodeEntities)(t),value:s||"",options:[ve,...r],onChange:c,required:!0,className:a()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":E.message&&!E.hidden})}),Object(n.createElement)(Se.a,{propertyName:b,elementId:b}))},Re=r(35);const Ce=(e,t,r)=>{const s=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(r).every(e=>""===e))return s;const n=Object.keys(e);return s.filter(e=>n.every(s=>{const n=r[s]||"",c=t["id:"+e].attributes[s];return""===n||null===c||c===n}))};var Pe=e=>{let{attributes:t,variationAttributes:r,setRequestParams:s}=e;const c=Object(i.a)(t),a=Object(i.a)(r),[o,l]=Object(n.useState)(0),[u,d]=Object(n.useState)({}),[b,E]=Object(n.useState)(!1),p=Object(n.useMemo)(()=>((e,t,r)=>{const s={},n=Object.keys(e),c=Object.values(r).filter(Boolean).length>0;return n.forEach(n=>{const a=e[n],o={...r,[n]:null},i=c?Ce(e,t,o):null,l=null!==i?i.map(e=>t["id:"+e].attributes[n]):null;s[n]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:r,slug:s}=e;return null===t||t.includes(null)||t.includes(s)?{value:s,label:Object(re.decodeEntities)(r)}:null}).filter(Boolean)}(a.terms,l)}),s})(c,a,u),[u,c,a]);return Object(n.useEffect)(()=>{if(!b){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(Re.c)(e))return{};const t=Object.keys(e),r={};return 0===t.length||t.forEach(t=>{const s=e[t],n=s.terms.filter(e=>e.default);var c;n.length>0&&(r[s.name]=null===(c=n[0])||void 0===c?void 0:c.slug)}),r}(t);e&&d({...e}),E(!0)}},[u,t,b]),Object(n.useEffect)(()=>{Object.values(u).filter(e=>""!==e).length===Object.keys(c).length?l(((e,t,r)=>Ce(e,t,r)[0]||0)(c,a,u)):o>0&&l(0)},[u,o,c,a]),Object(n.useEffect)(()=>{s({id:o,variation:Object.keys(u).map(e=>({attribute:e,value:u[e]}))})},[s,o,u]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(c).map(e=>Object(n.createElement)(ye,{key:e,attributeName:e,options:p[e],value:u[e],onChange:t=>{d({...u,[e]:t})}})))},Te=e=>{let{product:t,dispatchers:r}=e;const s=(e=>e?Object(oe.keyBy)(Object.values(e).filter(e=>{let{has_variations:t}=e;return t}),"name"):{})(t.attributes),c=(e=>{if(!e)return{};const t={};return e.forEach(e=>{let{id:r,attributes:s}=e;t["id:"+r]={id:r,attributes:s.reduce((e,t)=>{let{name:r,value:s}=t;return e[r]=s,e},{})}}),t})(t.variations);return 0===Object.keys(s).length||0===c.length?null:Object(n.createElement)(Pe,{attributes:s,variationAttributes:c,setRequestParams:r.setRequestParams})},Ae=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:s,multipleOf:c,dispatchActions:a,isDisabled:i}=Z();return e.id&&!e.is_purchasable?Object(n.createElement)(fe,null):e.id&&!e.is_in_stock?Object(n.createElement)(fe,{reason:Object(o.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Te,{product:e,dispatchers:a}),Object(n.createElement)(he,{value:t,min:r,max:s,step:c,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(me,null))},ke=()=>Object(n.createElement)(me,null),Ne=r(297),we=()=>Object(n.createElement)(Ne.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element."),Ie=()=>Object(n.createElement)(we,null);const De=()=>{const{showFormElements:e,productType:t}=Z();return e?"variable"===t?Object(n.createElement)(Ae,null):"grouped"===t?Object(n.createElement)(Ie,null):"external"===t?Object(n.createElement)(ke,null):"simple"===t||"variation"===t?Object(n.createElement)(_e,null):null:Object(n.createElement)(me,null)};var Fe=Object(s.withProductDataContext)(e=>{let{className:t,showFormElements:r}=e;const{product:s}=Object(ae.useProductDataContext)(),c=a()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(oe.isEmpty)(s)});return Object(n.createElement)(ce,{product:s,showFormElements:r},Object(n.createElement)("div",{className:c},Object(n.createElement)(De,null)))});t.default=Object(s.withFilteredAttributes)({showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}})(Fe)},89:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return o}));var s=r(5);let n;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));const c={addEventCallback:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(s.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:(e,t)=>({id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e})},a={},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,{type:t,eventType:r,id:s,callback:c,priority:o}=arguments.length>1?arguments[1]:void 0;const i=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case n.ADD_EVENT_CALLBACK:return i.set(s,{priority:o,callback:c}),{...e,[r]:i};case n.REMOVE_EVENT_CALLBACK:return i.delete(s),{...e,[r]:i}}}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[7],{133:function(e,t,r){"use strict";var s=r(0);r(163),t.a=()=>Object(s.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},163:function(e,t){},166:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return u}));var s=r(0),n=r(5),c=r(10),a=r.n(c);const o=Object(s.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),i=()=>Object(s.useContext)(o),u=e=>{let{children:t}=e;const[r,c]=Object(s.useState)({}),i=Object(s.useCallback)(e=>r[e],[r]),u=Object(s.useCallback)(e=>{const t=r[e];return!t||t.hidden?"":"validate-error-"+e},[r]),l=Object(s.useCallback)(e=>{c(t=>{if(!t[e])return t;const{[e]:r,...s}=t;return s})},[]),d=Object(s.useCallback)(()=>{c({})},[]),b=Object(s.useCallback)(e=>{e&&c(t=>(e=Object(n.pickBy)(e,(e,r)=>!("string"!=typeof e.message||t.hasOwnProperty(r)&&a()(t[r],e))),0===Object.values(e).length?t:{...t,...e}))},[]),E=Object(s.useCallback)((e,t)=>{c(r=>{if(!r.hasOwnProperty(e))return r;const s={...r[e],...t};return a()(r[e],s)?r:{...r,[e]:s}})},[]),p={getValidationError:i,setValidationErrors:b,clearValidationError:l,clearAllValidationErrors:d,hideValidationError:Object(s.useCallback)(e=>{E(e,{hidden:!0})},[E]),showValidationError:Object(s.useCallback)(e=>{E(e,{hidden:!1})},[E]),showAllValidationErrors:Object(s.useCallback)(()=>{c(e=>{const t={};return Object.keys(e).forEach(r=>{e[r].hidden&&(t[r]={...e[r],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(r).length>0,getValidationErrorId:u};return Object(s.createElement)(o.Provider,{value:p},t)}},173:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var s=r(90);const n=(e,t)=>function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const c=s.a.addEventCallback(e,r,n);return t(c),()=>{t(s.a.removeEventCallback(e,c.id))}}},174:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return a}));const s=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var n=r(30);const c=async(e,t,r)=>{const n=s(e,t),c=[];for(const e of n)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&c.push(t)}catch(e){console.error(e)}return!c.length||c},a=async(e,t,r)=>{const c=[],a=s(e,t);for(const e of a)try{const t=await Promise.resolve(e.callback(r));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(n.a)(t)||Object(n.b)(t))return c.push(t),c;c.push(t)}catch(e){return console.error(e),c.push({type:"error"}),c}return c}},19:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var s=r(0),n=r(10),c=r.n(n);function a(e){const t=Object(s.useRef)(e);return c()(e,t.current)||(t.current=e),t.current}},227:function(e,t){},232:function(e,t,r){"use strict";var s=r(11),n=r.n(s),c=r(0),a=r(56),o=r(4),i=r.n(o),u=r(133);r(235),t.a=e=>{let{className:t,showSpinner:r=!1,children:s,variant:o="contained",...l}=e;const d=i()("wc-block-components-button",t,o,{"wc-block-components-button--loading":r});return Object(c.createElement)(a.a,n()({className:d},l),r&&Object(c.createElement)(u.a,null),Object(c.createElement)("span",{className:"wc-block-components-button__text"},s))}},235:function(e,t){},240:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var s=r(0),n=(r(8),r(166));r(227);const c=e=>{let{errorMessage:t="",propertyName:r="",elementId:c=""}=e;const{getValidationError:a,getValidationErrorId:o}=Object(n.b)();if(!t||"string"!=typeof t){const e=a(r)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(s.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(s.createElement)("p",{id:o(c)},t))}},30:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return d}));var s=r(18);let n,c;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(n||(n={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(c||(c={}));const a=(e,t)=>Object(s.d)(e)&&"type"in e&&e.type===t,o=e=>a(e,n.SUCCESS),i=e=>a(e,n.ERROR),u=e=>a(e,n.FAIL),l=e=>!Object(s.d)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:n,noticeContexts:c,shouldRetry:l,isSuccessResponse:o,isErrorResponse:i,isFailResponse:u})},320:function(e,t,r){"use strict";r.d(t,"a",(function(){return l}));var s=r(0),n=r(9),c=r(6),a=r(21),o=r(24),i=r(34);const u=(e,t)=>{const r=e.find(e=>{let{id:r}=e;return r===t});return r?r.quantity:0},l=e=>{const{addItemToCart:t}=Object(n.useDispatch)(c.CART_STORE_KEY),{cartItems:r,cartIsLoading:l}=Object(o.a)(),{addErrorNotice:d,removeNotice:b}=Object(i.a)(),[E,p]=Object(s.useState)(!1),m=Object(s.useRef)(u(r,e));return Object(s.useEffect)(()=>{const t=u(r,e);t!==m.current&&(m.current=t)},[r,e]),{cartQuantity:Number.isFinite(m.current)?m.current:0,addingToCart:E,cartIsLoading:l,addToCart:function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return p(!0),t(e,r).then(()=>{b("add-to-cart")}).catch(e=>{d(Object(a.decodeEntities)(e.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})}).finally(()=>{p(!1)})}}}},326:function(e,t){},328:function(e,t){},34:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var s=r(0),n=r(88);const c=()=>{const{notices:e,createNotice:t,removeNotice:r,setIsSuppressed:c}=Object(n.b)(),a=Object(s.useRef)(e);Object(s.useEffect)(()=>{a.current=e},[e]);const o=Object(s.useMemo)(()=>({hasNoticesOfType:e=>a.current.some(t=>t.type===e),removeNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.current.forEach(t=>{null!==e&&t.status!==e||r(t.id)})},removeNotice:r}),[r]),i=Object(s.useMemo)(()=>({addDefaultNotice:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("default",e,{...r})},addErrorNotice:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("error",e,{...r})},addWarningNotice:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("warning",e,{...r})},addInfoNotice:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("info",e,{...r})},addSuccessNotice:function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t("success",e,{...r})}}),[t]);return{notices:e,...o,...i,setIsSuppressed:c}}},386:function(e,t,r){"use strict";r.r(t);var s=r(113),n=r(0),c=(r(8),r(4)),a=r.n(c),o=r(1),i=r(19);const u=e=>e.is_purchasable||!1,l={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},d={status:l.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},b={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:E,SET_IDLE:p,SET_DISABLED:m,SET_PROCESSING:O,SET_BEFORE_PROCESSING:h,SET_AFTER_PROCESSING:f,SET_PROCESSING_RESPONSE:_,SET_HAS_ERROR:j,SET_NO_ERROR:g,SET_QUANTITY:S,SET_REQUEST_PARAMS:v}=b,y=()=>({type:p}),R=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?j:g;return{type:t}},{SET_PRISTINE:C,SET_IDLE:P,SET_DISABLED:T,SET_PROCESSING:A,SET_BEFORE_PROCESSING:N,SET_AFTER_PROCESSING:k,SET_PROCESSING_RESPONSE:w,SET_HAS_ERROR:I,SET_NO_ERROR:D,SET_QUANTITY:F,SET_REQUEST_PARAMS:V}=b,{PRISTINE:B,IDLE:q,DISABLED:L,PROCESSING:x,BEFORE_PROCESSING:G,AFTER_PROCESSING:M}=l,Q=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,{quantity:r,type:s,data:n}=arguments.length>1?arguments[1]:void 0;switch(s){case C:e=d;break;case P:e=t.status!==q?{...t,status:q}:t;break;case T:e=t.status!==L?{...t,status:L}:t;break;case F:e=r!==t.quantity?{...t,quantity:r}:t;break;case V:e={...t,requestParams:{...t.requestParams,...n}};break;case w:e={...t,processingResponse:n};break;case A:e=t.status!==x?{...t,status:x,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case N:e=t.status!==G?{...t,status:G,hasError:!1}:t;break;case k:e=t.status!==M?{...t,status:M}:t;break;case I:e=t.hasError?t:{...t,hasError:!0},e=t.status===x||t.status===G?{...e,status:q}:e;break;case D:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&s!==C&&e.status===B&&(e.status=q),e};var W=r(90),H=r(173);const U=e=>({onAddToCartAfterProcessingWithSuccess:Object(H.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(H.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(H.a)("add_to_cart_before_processing",e)});var K=r(174),Y=r(166),J=r(34),X=r(30);const z=Object(n.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),Z=()=>Object(n.useContext)(z),$=e=>{var t,r,s,c;let{children:a,product:b,showFormElements:p}=e;const[j,g]=Object(n.useReducer)(Q,d),[C,P]=Object(n.useReducer)(W.b,{}),T=Object(i.a)(C),{addErrorNotice:A,removeNotices:N}=Object(J.a)(),{setValidationErrors:k}=Object(Y.b)(),{isSuccessResponse:w,isErrorResponse:I,isFailResponse:D}=Object(X.c)(),F=Object(n.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:U(P).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:U(P).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:U(P).onAddToCartBeforeProcessing}),[P]),V=Object(n.useMemo)(()=>({resetForm:()=>{g({type:E})},submitForm:()=>{g({type:h})},setQuantity:e=>{g((e=>({type:S,quantity:e}))(e))},setHasError:e=>{g(R(e))},setRequestParams:e=>{g((e=>({type:v,data:e}))(e))},setAfterProcessing:e=>{g({type:_,data:e}),g({type:f})}}),[]);Object(n.useEffect)(()=>{const e=j.status,t=!b.id||!u(b);e!==l.DISABLED||t?e!==l.DISABLED&&t&&g({type:m}):g(y())},[j.status,b,g]),Object(n.useEffect)(()=>{j.status===l.BEFORE_PROCESSING&&(N("error"),Object(K.a)(T,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;t&&A(t),r&&k(r)}),g(y())):g({type:O})}))},[j.status,k,A,N,g,T]),Object(n.useEffect)(()=>{if(j.status===l.AFTER_PROCESSING){const e={processingResponse:j.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:r,messageContext:s}=e;(I(e)||D(e))&&r&&(t=!0,A(r,s?{context:s}:void 0))}),t};if(j.hasError)return void Object(K.b)(T,"add_to_cart_after_processing_with_error",e).then(r=>{if(!t(r)){var s;const t=(null===(s=e.processingResponse)||void 0===s?void 0:s.message)||Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");A(t,{id:"add-to-cart"})}g(y())});Object(K.b)(T,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?g(R(!0)):g(y())})}},[j.status,j.hasError,j.processingResponse,V,A,I,D,w,T]);const B=(e=>["simple","variable"].includes(e.type||"simple"))(b),q={product:b,productType:b.type||"simple",productIsPurchasable:u(b),productHasOptions:b.has_options||!1,supportsFormElements:B,showFormElements:p&&B,quantity:j.quantity||(null==b||null===(t=b.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==b||null===(r=b.add_to_cart)||void 0===r?void 0:r.minimum)||1,maxQuantity:(null==b||null===(s=b.add_to_cart)||void 0===s?void 0:s.maximum)||99,multipleOf:(null==b||null===(c=b.add_to_cart)||void 0===c?void 0:c.multiple_of)||1,requestParams:j.requestParams,isIdle:j.status===l.IDLE,isDisabled:j.status===l.DISABLED,isProcessing:j.status===l.PROCESSING,isBeforeProcessing:j.status===l.BEFORE_PROCESSING,isAfterProcessing:j.status===l.AFTER_PROCESSING,hasError:j.hasError,eventRegistration:F,dispatchActions:V};return Object(n.createElement)(z.Provider,{value:q},a)};var ee=r(28),te=r.n(ee),re=r(21),se=r(67),ne=r(24),ce=()=>{const{dispatchActions:e,product:t,quantity:r,eventRegistration:s,hasError:c,isProcessing:a,requestParams:i}=Z(),{hasValidationErrors:u,showAllValidationErrors:l}=Object(Y.b)(),{addErrorNotice:d,removeNotice:b}=Object(J.a)(),{receiveCart:E}=Object(ne.a)(),[p,m]=Object(n.useState)(!1),O=!c&&a,h=Object(n.useCallback)(()=>!u||(l(),{type:"error"}),[u,l]);Object(n.useEffect)(()=>{const e=s.onAddToCartBeforeProcessing(h,0);return()=>{e()}},[s,h]);const f=Object(n.useCallback)(()=>{m(!0),b("add-to-cart");const s={id:t.id||0,quantity:r,...i};te()({path:"/wc/store/cart/add-item",method:"POST",data:s,cache:"no-store",parse:!1}).then(t=>{te.a.setNonce(t.headers),t.json().then((function(r){t.ok?E(r):(r.body&&r.body.message?d(Object(re.decodeEntities)(r.body.message),{id:"add-to-cart"}):d(Object(o.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),e.setHasError()),Object(se.c)({preserveCartData:!0}),e.setAfterProcessing(r),m(!1)}))}).catch(t=>{t.json().then((function(t){var r;null!==(r=t.data)&&void 0!==r&&r.cart&&E(t.data.cart),e.setHasError(),e.setAfterProcessing(t),m(!1)}))})},[t,d,b,E,e,r,i]);return Object(n.useEffect)(()=>{O&&!p&&f()},[O,f,p]),null};const ae=e=>{let{children:t,product:r,showFormElements:s}=e;return Object(n.createElement)(Y.a,null,Object(n.createElement)($,{product:r,showFormElements:s},t,Object(n.createElement)(ce,null)))};var oe=r(49),ie=r(5),ue=(r(326),r(232)),le=r(100),de=r(327),be=r(33),Ee=r(320);const pe=e=>{let{className:t,href:r,text:s,onClick:c}=e;return Object(n.createElement)(ue.a,{className:t,href:r,onClick:c,rel:"nofollow"},s)},me=e=>{let{className:t,quantityInCart:r,isProcessing:s,isDisabled:c,isDone:a,onClick:i}=e;return Object(n.createElement)(ue.a,{className:t,disabled:c,showSpinner:s,onClick:i},a&&r>0?Object(o.sprintf)(
2
  /* translators: %s number of products in cart. */
3
+ Object(o._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(o.__)("Add to cart","woo-gutenberg-products-block"),!!a&&Object(n.createElement)(le.a,{icon:de.a}))};var Oe=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:r,product:s,productType:c,isDisabled:a,isProcessing:i,eventRegistration:u,hasError:l,dispatchActions:d}=Z(),{parentName:b}=Object(oe.useInnerBlockLayoutContext)(),{dispatchStoreEvent:E}=Object(be.a)(),{cartQuantity:p}=Object(Ee.a)(s.id||0),[m,O]=Object(n.useState)(!1),h=s.add_to_cart||{url:"",text:""};return Object(n.useEffect)(()=>{const e=u.onAddToCartAfterProcessingWithSuccess(()=>(l||O(!0),!0),0);return()=>{e()}},[u,l]),(e||!r&&"simple"===c)&&t?Object(n.createElement)(me,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:p,isDisabled:a,isProcessing:i,isDone:m,onClick:()=>{d.submitForm(),E("cart-add-item",{product:s,listName:b})}}):Object(n.createElement)(pe,{className:"wc-block-components-product-add-to-cart-button",href:h.url,text:h.text||Object(o.__)("View Product","woo-gutenberg-products-block"),onClick:()=>{E("product-view-link",{product:s,listName:b})}})},he=r(52),fe=e=>{let{disabled:t,min:r,max:s,step:c=1,value:a,onChange:o}=e;const i=void 0!==s,u=Object(he.a)(e=>{let t=e;i&&(t=Math.min(t,Math.floor(s/c)*c)),t=Math.max(t,Math.ceil(r/c)*c),t=Math.floor(t/c)*c,t!==e&&o(t)},300);return Object(n.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:a,min:r,max:s,step:c,hidden:1===s,disabled:t,onChange:e=>{o(e.target.value),u(e.target.value)}})},_e=e=>{let{reason:t=Object(o.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block")}=e;return Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},je=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:s,multipleOf:c,dispatchActions:a,isDisabled:i}=Z();return e.id&&!e.is_purchasable?Object(n.createElement)(_e,null):e.id&&!e.is_in_stock?Object(n.createElement)(_e,{reason:Object(o.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(fe,{value:t,min:r,max:s,step:c,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Oe,null))},ge=(r(328),r(387)),Se=r(3),ve=r(240);const ye={value:"",label:Object(o.__)("Select an option","woo-gutenberg-products-block")};var Re=e=>{let{attributeName:t,options:r=[],value:s="",onChange:c=(()=>{}),errorMessage:i=Object(o.__)("Please select a value.","woo-gutenberg-products-block")}=e;const{getValidationError:u,setValidationErrors:l,clearValidationError:d}=Object(Y.b)(),b=t,E=u(b)||{};return Object(Se.useEffect)(()=>{s?d(b):l({[b]:{message:i,hidden:!0}})},[s,b,i,d,l]),Object(Se.useEffect)(()=>()=>{d(b)},[b,d]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(n.createElement)(ge.a,{label:Object(re.decodeEntities)(t),value:s||"",options:[ye,...r],onChange:c,required:!0,className:a()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":E.message&&!E.hidden})}),Object(n.createElement)(ve.a,{propertyName:b,elementId:b}))},Ce=r(18);const Pe=(e,t,r)=>{const s=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(r).every(e=>""===e))return s;const n=Object.keys(e);return s.filter(e=>n.every(s=>{const n=r[s]||"",c=t["id:"+e].attributes[s];return""===n||null===c||c===n}))};var Te=e=>{let{attributes:t,variationAttributes:r,setRequestParams:s}=e;const c=Object(i.a)(t),a=Object(i.a)(r),[o,u]=Object(n.useState)(0),[l,d]=Object(n.useState)({}),[b,E]=Object(n.useState)(!1),p=Object(n.useMemo)(()=>((e,t,r)=>{const s={},n=Object.keys(e),c=Object.values(r).filter(Boolean).length>0;return n.forEach(n=>{const a=e[n],o={...r,[n]:null},i=c?Pe(e,t,o):null,u=null!==i?i.map(e=>t["id:"+e].attributes[n]):null;s[n]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:r,slug:s}=e;return null===t||t.includes(null)||t.includes(s)?{value:s,label:Object(re.decodeEntities)(r)}:null}).filter(Boolean)}(a.terms,u)}),s})(c,a,l),[l,c,a]);return Object(n.useEffect)(()=>{if(!b){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(Ce.d)(e))return{};const t=Object.keys(e),r={};return 0===t.length||t.forEach(t=>{const s=e[t],n=s.terms.filter(e=>e.default);var c;n.length>0&&(r[s.name]=null===(c=n[0])||void 0===c?void 0:c.slug)}),r}(t);e&&d({...e}),E(!0)}},[l,t,b]),Object(n.useEffect)(()=>{Object.values(l).filter(e=>""!==e).length===Object.keys(c).length?u(((e,t,r)=>Pe(e,t,r)[0]||0)(c,a,l)):o>0&&u(0)},[l,o,c,a]),Object(n.useEffect)(()=>{s({id:o,variation:Object.keys(l).map(e=>({attribute:e,value:l[e]}))})},[s,o,l]),Object(n.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(c).map(e=>Object(n.createElement)(Re,{key:e,attributeName:e,options:p[e],value:l[e],onChange:t=>{d({...l,[e]:t})}})))},Ae=e=>{let{product:t,dispatchers:r}=e;const s=(e=>e?Object(ie.keyBy)(Object.values(e).filter(e=>{let{has_variations:t}=e;return t}),"name"):{})(t.attributes),c=(e=>{if(!e)return{};const t={};return e.forEach(e=>{let{id:r,attributes:s}=e;t["id:"+r]={id:r,attributes:s.reduce((e,t)=>{let{name:r,value:s}=t;return e[r]=s,e},{})}}),t})(t.variations);return 0===Object.keys(s).length||0===c.length?null:Object(n.createElement)(Te,{attributes:s,variationAttributes:c,setRequestParams:r.setRequestParams})},Ne=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:s,multipleOf:c,dispatchActions:a,isDisabled:i}=Z();return e.id&&!e.is_purchasable?Object(n.createElement)(_e,null):e.id&&!e.is_in_stock?Object(n.createElement)(_e,{reason:Object(o.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Ae,{product:e,dispatchers:a}),Object(n.createElement)(fe,{value:t,min:r,max:s,step:c,disabled:i,onChange:a.setQuantity}),Object(n.createElement)(Oe,null))},ke=()=>Object(n.createElement)(Oe,null),we=r(299),Ie=()=>Object(n.createElement)(we.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element."),De=()=>Object(n.createElement)(Ie,null);const Fe=()=>{const{showFormElements:e,productType:t}=Z();return e?"variable"===t?Object(n.createElement)(Ne,null):"grouped"===t?Object(n.createElement)(De,null):"external"===t?Object(n.createElement)(ke,null):"simple"===t||"variation"===t?Object(n.createElement)(je,null):null:Object(n.createElement)(Oe,null)};var Ve=Object(s.withProductDataContext)(e=>{let{className:t,showFormElements:r}=e;const{product:s}=Object(oe.useProductDataContext)(),c=a()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(ie.isEmpty)(s)});return Object(n.createElement)(ae,{product:s,showFormElements:r},Object(n.createElement)("div",{className:c},Object(n.createElement)(Fe,null)))});t.default=Object(s.withFilteredAttributes)({showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}})(Ve)},90:function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return o}));var s=r(5);let n;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(n||(n={}));const c={addEventCallback:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(s.uniqueId)(),type:n.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:(e,t)=>({id:t,type:n.REMOVE_EVENT_CALLBACK,eventType:e})},a={},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,{type:t,eventType:r,id:s,callback:c,priority:o}=arguments.length>1?arguments[1]:void 0;const i=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case n.ADD_EVENT_CALLBACK:return i.set(s,{priority:o,callback:c}),{...e,[r]:i};case n.REMOVE_EVENT_CALLBACK:return i.delete(s),{...e,[r]:i}}}}}]);
build/atomic-block-components/add-to-cart.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[9],{100:function(e,t,r){"use strict";var s=r(0);r(161),t.a=()=>Object(s.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},108:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));var s=r(6);let a;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(a||(a={}));const n={addEventCallback:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(s.uniqueId)(),type:a.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:(e,t)=>({id:t,type:a.REMOVE_EVENT_CALLBACK,eventType:e})},c={},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,{type:t,eventType:r,id:s,callback:n,priority:o}=arguments.length>1?arguments[1]:void 0;const i=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case a.ADD_EVENT_CALLBACK:return i.set(s,{priority:o,callback:n}),{...e,[r]:i};case a.REMOVE_EVENT_CALLBACK:return i.delete(s),{...e,[r]:i}}}},114:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return l}));var s=r(0),a=r(6),n=r(26),c=r.n(n);const o=Object(s.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),i=()=>Object(s.useContext)(o),l=e=>{let{children:t}=e;const[r,n]=Object(s.useState)({}),i=Object(s.useCallback)(e=>r[e],[r]),l=Object(s.useCallback)(e=>{const t=r[e];return!t||t.hidden?"":"validate-error-"+e},[r]),u=Object(s.useCallback)(e=>{n(t=>{if(!t[e])return t;const{[e]:r,...s}=t;return s})},[]),d=Object(s.useCallback)(()=>{n({})},[]),b=Object(s.useCallback)(e=>{e&&n(t=>(e=Object(a.pickBy)(e,(e,r)=>!("string"!=typeof e.message||t.hasOwnProperty(r)&&c()(t[r],e))),0===Object.values(e).length?t:{...t,...e}))},[]),E=Object(s.useCallback)((e,t)=>{n(r=>{if(!r.hasOwnProperty(e))return r;const s={...r[e],...t};return c()(r[e],s)?r:{...r,[e]:s}})},[]),p={getValidationError:i,setValidationErrors:b,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(s.useCallback)(e=>{E(e,{hidden:!0})},[E]),showValidationError:Object(s.useCallback)(e=>{E(e,{hidden:!1})},[E]),showAllValidationErrors:Object(s.useCallback)(()=>{n(e=>{const t={};return Object.keys(e).forEach(r=>{e[r].hidden&&(t[r]={...e[r],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(r).length>0,getValidationErrorId:l};return Object(s.createElement)(o.Provider,{value:p},t)}},160:function(e,t){},161:function(e,t){},162:function(e,t){},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var s=r(0),a=(r(10),r(114));r(162);const n=e=>{let{errorMessage:t="",propertyName:r="",elementId:n=""}=e;const{getValidationError:c,getValidationErrorId:o}=Object(a.b)();if(!t||"string"!=typeof t){const e=c(r)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(s.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(s.createElement)("p",{id:o(n)},t))}},248:function(e,t){},255:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var s=r(108);const a=(e,t)=>function(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=s.a.addEventCallback(e,r,a);return t(n),()=>{t(s.a.removeEventCallback(e,n.id))}}},256:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},257:function(e,t,r){"use strict";var s=r(0),a=(r(10),r(4)),n=r.n(a),c=r(1),o=r(39),i=r(478);const l={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},u={status:l.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},d={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:b,SET_IDLE:E,SET_DISABLED:p,SET_PROCESSING:m,SET_BEFORE_PROCESSING:O,SET_AFTER_PROCESSING:_,SET_PROCESSING_RESPONSE:h,SET_HAS_ERROR:j,SET_NO_ERROR:f,SET_QUANTITY:S,SET_REQUEST_PARAMS:g}=d,v=()=>({type:E}),y=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?j:f;return{type:t}},{SET_PRISTINE:R,SET_IDLE:P,SET_DISABLED:C,SET_PROCESSING:A,SET_BEFORE_PROCESSING:k,SET_AFTER_PROCESSING:T,SET_PROCESSING_RESPONSE:w,SET_HAS_ERROR:N,SET_NO_ERROR:I,SET_QUANTITY:D,SET_REQUEST_PARAMS:F}=d,{PRISTINE:V,IDLE:B,DISABLED:L,PROCESSING:q,BEFORE_PROCESSING:x,AFTER_PROCESSING:G}=l,M=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,{quantity:r,type:s,data:a}=arguments.length>1?arguments[1]:void 0;switch(s){case R:e=u;break;case P:e=t.status!==B?{...t,status:B}:t;break;case C:e=t.status!==L?{...t,status:L}:t;break;case D:e=r!==t.quantity?{...t,quantity:r}:t;break;case F:e={...t,requestParams:{...t.requestParams,...a}};break;case w:e={...t,processingResponse:a};break;case A:e=t.status!==q?{...t,status:q,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case k:e=t.status!==x?{...t,status:x,hasError:!1}:t;break;case T:e=t.status!==G?{...t,status:G}:t;break;case N:e=t.hasError?t:{...t,hasError:!0},e=t.status===q||t.status===x?{...e,status:B}:e;break;case I:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&s!==R&&e.status===V&&(e.status=B),e};var Q=r(108),H=r(255);const W=e=>({onAddToCartAfterProcessingWithSuccess:Object(H.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(H.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(H.a)("add_to_cart_before_processing",e)});var U=r(258),K=r(114),Y=r(47),z=r(44);const J=Object(s.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),X=()=>Object(s.useContext)(J),Z=e=>{var t,r,a,n;let{children:d,product:E,showFormElements:j}=e;const[f,R]=Object(s.useReducer)(M,u),[P,C]=Object(s.useReducer)(Q.b,{}),A=Object(o.a)(P),{addErrorNotice:k,removeNotices:T}=Object(Y.a)(),{setValidationErrors:w}=Object(K.b)(),{isSuccessResponse:N,isErrorResponse:I,isFailResponse:D}=Object(z.c)(),F=Object(s.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:W(C).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:W(C).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:W(C).onAddToCartBeforeProcessing}),[C]),V=Object(s.useMemo)(()=>({resetForm:()=>{R({type:b})},submitForm:()=>{R({type:O})},setQuantity:e=>{R((e=>({type:S,quantity:e}))(e))},setHasError:e=>{R(y(e))},setRequestParams:e=>{R((e=>({type:g,data:e}))(e))},setAfterProcessing:e=>{R({type:h,data:e}),R({type:_})}}),[]);Object(s.useEffect)(()=>{const e=f.status,t=!E.id||!Object(i.a)(E);e!==l.DISABLED||t?e!==l.DISABLED&&t&&R({type:p}):R(v())},[f.status,E,R]),Object(s.useEffect)(()=>{f.status===l.BEFORE_PROCESSING&&(T("error"),Object(U.a)(A,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;t&&k(t),r&&w(r)}),R(v())):R({type:m})}))},[f.status,w,k,T,R,A]),Object(s.useEffect)(()=>{if(f.status===l.AFTER_PROCESSING){const e={processingResponse:f.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:r,messageContext:s}=e;(I(e)||D(e))&&r&&(t=!0,k(r,s?{context:s}:void 0))}),t};if(f.hasError)return void Object(U.b)(A,"add_to_cart_after_processing_with_error",e).then(r=>{if(!t(r)){var s;const t=(null===(s=e.processingResponse)||void 0===s?void 0:s.message)||Object(c.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(t,{id:"add-to-cart"})}R(v())});Object(U.b)(A,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?R(y(!0)):R(v())})}},[f.status,f.hasError,f.processingResponse,V,k,I,D,N,A]);const B=Object(i.b)(E),L={product:E,productType:E.type||"simple",productIsPurchasable:Object(i.a)(E),productHasOptions:E.has_options||!1,supportsFormElements:B,showFormElements:j&&B,quantity:f.quantity||(null==E||null===(t=E.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==E||null===(r=E.add_to_cart)||void 0===r?void 0:r.minimum)||1,maxQuantity:(null==E||null===(a=E.add_to_cart)||void 0===a?void 0:a.maximum)||99,multipleOf:(null==E||null===(n=E.add_to_cart)||void 0===n?void 0:n.multiple_of)||1,requestParams:f.requestParams,isIdle:f.status===l.IDLE,isDisabled:f.status===l.DISABLED,isProcessing:f.status===l.PROCESSING,isBeforeProcessing:f.status===l.BEFORE_PROCESSING,isAfterProcessing:f.status===l.AFTER_PROCESSING,hasError:f.hasError,eventRegistration:F,dispatchActions:V};return Object(s.createElement)(J.Provider,{value:L},d)};var $=r(11),ee=r.n($),te=r(14),re=r(36),se=()=>{const{dispatchActions:e,product:t,quantity:r,eventRegistration:a,hasError:n,isProcessing:o,requestParams:i}=X(),{hasValidationErrors:l,showAllValidationErrors:u}=Object(K.b)(),{addErrorNotice:d,removeNotice:b}=Object(Y.a)(),{receiveCart:E}=Object(re.a)(),[p,m]=Object(s.useState)(!1),O=!n&&o,_=Object(s.useCallback)(()=>!l||(u(),{type:"error"}),[l,u]);Object(s.useEffect)(()=>{const e=a.onAddToCartBeforeProcessing(_,0);return()=>{e()}},[a,_]);const h=Object(s.useCallback)(()=>{m(!0),b("add-to-cart");const s={id:t.id||0,quantity:r,...i};ee()({path:"/wc/store/cart/add-item",method:"POST",data:s,cache:"no-store",parse:!1}).then(t=>{ee.a.setNonce(t.headers),t.json().then((function(r){t.ok?E(r):(r.body&&r.body.message?d(Object(te.decodeEntities)(r.body.message),{id:"add-to-cart"}):d(Object(c.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),e.setHasError()),e.setAfterProcessing(r),m(!1)}))}).catch(t=>{t.json().then((function(t){var r;null!==(r=t.data)&&void 0!==r&&r.cart&&E(t.data.cart),e.setHasError(),e.setAfterProcessing(t),m(!1)}))})},[t,d,b,E,e,r,i]);return Object(s.useEffect)(()=>{O&&!p&&h()},[O,h,p]),null};const ae=e=>{let{children:t,product:r,showFormElements:a}=e;return Object(s.createElement)(K.a,null,Object(s.createElement)(Z,{product:r,showFormElements:a},t,Object(s.createElement)(se,null)))};var ne=r(29),ce=r(6),oe=r(54),ie=(r(248),r(80)),le=r(43),ue=r(312),de=r(60),be=r(360);const Ee=e=>{let{className:t,href:r,text:a,onClick:n}=e;return Object(s.createElement)(ie.a,{className:t,href:r,onClick:n,rel:"nofollow"},a)},pe=e=>{let{className:t,quantityInCart:r,isProcessing:a,isDisabled:n,isDone:o,onClick:i}=e;return Object(s.createElement)(ie.a,{className:t,disabled:n,showSpinner:a,onClick:i},o&&r>0?Object(c.sprintf)(
2
  /* translators: %s number of products in cart. */
3
- Object(c._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(c.__)("Add to cart","woo-gutenberg-products-block"),!!o&&Object(s.createElement)(le.a,{srcElement:ue.a,alt:Object(c.__)("Done","woo-gutenberg-products-block")}))};var me=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:r,product:a,productType:n,isDisabled:o,isProcessing:i,eventRegistration:l,hasError:u,dispatchActions:d}=X(),{parentName:b}=Object(ne.useInnerBlockLayoutContext)(),{dispatchStoreEvent:E}=Object(de.a)(),{cartQuantity:p}=Object(be.a)(a.id||0),[m,O]=Object(s.useState)(!1),_=a.add_to_cart||{url:"",text:""};return Object(s.useEffect)(()=>{const e=l.onAddToCartAfterProcessingWithSuccess(()=>(u||O(!0),!0),0);return()=>{e()}},[l,u]),(e||!r&&"simple"===n)&&t?Object(s.createElement)(pe,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:p,isDisabled:o,isProcessing:i,isDone:m,onClick:()=>{d.submitForm(),E("cart-add-item",{product:a,listName:b})}}):Object(s.createElement)(Ee,{className:"wc-block-components-product-add-to-cart-button",href:_.url,text:_.text||Object(c.__)("View Product","woo-gutenberg-products-block"),onClick:()=>{E("product-view-link",{product:a,listName:b})}})},Oe=r(118),_e=e=>{let{disabled:t,min:r,max:a,step:n=1,value:c,onChange:o}=e;const i=void 0!==a,l=Object(Oe.a)(e=>{let t=e;i&&(t=Math.min(t,Math.floor(a/n)*n)),t=Math.max(t,Math.ceil(r/n)*n),t=Math.floor(t/n)*n,t!==e&&o(t)},300);return Object(s.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:c,min:r,max:a,step:n,hidden:1===a,disabled:t,onChange:e=>{o(e.target.value),l(e.target.value)}})},he=e=>{let{reason:t=Object(c.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block")}=e;return Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},je=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:a,multipleOf:n,dispatchActions:o,isDisabled:i}=X();return e.id&&!e.is_purchasable?Object(s.createElement)(he,null):e.id&&!e.is_in_stock?Object(s.createElement)(he,{reason:Object(c.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(s.createElement)(s.Fragment,null,Object(s.createElement)(_e,{value:t,min:r,max:a,step:n,disabled:i,onChange:o.setQuantity}),Object(s.createElement)(me,null))},fe=(r(311),r(499)),Se=r(8),ge=r(196);const ve={value:"",label:Object(c.__)("Select an option","woo-gutenberg-products-block")};var ye=e=>{let{attributeName:t,options:r=[],value:a="",onChange:o=(()=>{}),errorMessage:i=Object(c.__)("Please select a value.","woo-gutenberg-products-block")}=e;const{getValidationError:l,setValidationErrors:u,clearValidationError:d}=Object(K.b)(),b=t,E=l(b)||{};return Object(Se.useEffect)(()=>{a?d(b):u({[b]:{message:i,hidden:!0}})},[a,b,i,d,u]),Object(Se.useEffect)(()=>()=>{d(b)},[b,d]),Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(s.createElement)(fe.a,{label:Object(te.decodeEntities)(t),value:a||"",options:[ve,...r],onChange:o,required:!0,className:n()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":E.message&&!E.hidden})}),Object(s.createElement)(ge.a,{propertyName:b,elementId:b}))},Re=r(62);const Pe=(e,t,r)=>{const s=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(r).every(e=>""===e))return s;const a=Object.keys(e);return s.filter(e=>a.every(s=>{const a=r[s]||"",n=t["id:"+e].attributes[s];return""===a||null===n||n===a}))};var Ce=e=>{let{attributes:t,variationAttributes:r,setRequestParams:a}=e;const n=Object(o.a)(t),c=Object(o.a)(r),[i,l]=Object(s.useState)(0),[u,d]=Object(s.useState)({}),[b,E]=Object(s.useState)(!1),p=Object(s.useMemo)(()=>((e,t,r)=>{const s={},a=Object.keys(e),n=Object.values(r).filter(Boolean).length>0;return a.forEach(a=>{const c=e[a],o={...r,[a]:null},i=n?Pe(e,t,o):null,l=null!==i?i.map(e=>t["id:"+e].attributes[a]):null;s[a]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:r,slug:s}=e;return null===t||t.includes(null)||t.includes(s)?{value:s,label:Object(te.decodeEntities)(r)}:null}).filter(Boolean)}(c.terms,l)}),s})(n,c,u),[u,n,c]);return Object(s.useEffect)(()=>{if(!b){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(Re.b)(e))return{};const t=Object.keys(e),r={};return 0===t.length||t.forEach(t=>{const s=e[t],a=s.terms.filter(e=>e.default);var n;a.length>0&&(r[s.name]=null===(n=a[0])||void 0===n?void 0:n.slug)}),r}(t);e&&d({...e}),E(!0)}},[u,t,b]),Object(s.useEffect)(()=>{Object.values(u).filter(e=>""!==e).length===Object.keys(n).length?l(((e,t,r)=>Pe(e,t,r)[0]||0)(n,c,u)):i>0&&l(0)},[u,i,n,c]),Object(s.useEffect)(()=>{a({id:i,variation:Object.keys(u).map(e=>({attribute:e,value:u[e]}))})},[a,i,u]),Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(n).map(e=>Object(s.createElement)(ye,{key:e,attributeName:e,options:p[e],value:u[e],onChange:t=>{d({...u,[e]:t})}})))},Ae=e=>{let{product:t,dispatchers:r}=e;const a=(e=>e?Object(ce.keyBy)(Object.values(e).filter(e=>{let{has_variations:t}=e;return t}),"name"):{})(t.attributes),n=(e=>{if(!e)return{};const t={};return e.forEach(e=>{let{id:r,attributes:s}=e;t["id:"+r]={id:r,attributes:s.reduce((e,t)=>{let{name:r,value:s}=t;return e[r]=s,e},{})}}),t})(t.variations);return 0===Object.keys(a).length||0===n.length?null:Object(s.createElement)(Ce,{attributes:a,variationAttributes:n,setRequestParams:r.setRequestParams})},ke=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:a,multipleOf:n,dispatchActions:o,isDisabled:i}=X();return e.id&&!e.is_purchasable?Object(s.createElement)(he,null):e.id&&!e.is_in_stock?Object(s.createElement)(he,{reason:Object(c.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(s.createElement)(s.Fragment,null,Object(s.createElement)(Ae,{product:e,dispatchers:o}),Object(s.createElement)(_e,{value:t,min:r,max:a,step:n,disabled:i,onChange:o.setQuantity}),Object(s.createElement)(me,null))},Te=()=>Object(s.createElement)(me,null),we=r(490),Ne=()=>Object(s.createElement)(we.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element."),Ie=()=>Object(s.createElement)(Ne,null);const De=()=>{const{showFormElements:e,productType:t}=X();return e?"variable"===t?Object(s.createElement)(ke,null):"grouped"===t?Object(s.createElement)(Ie,null):"external"===t?Object(s.createElement)(Te,null):"simple"===t||"variation"===t?Object(s.createElement)(je,null):null:Object(s.createElement)(me,null)};t.a=Object(oe.withProductDataContext)(e=>{let{className:t,showFormElements:r}=e;const{product:a}=Object(ne.useProductDataContext)(),c=n()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(ce.isEmpty)(a)});return Object(s.createElement)(ae,{product:a,showFormElements:r},Object(s.createElement)("div",{className:c},Object(s.createElement)(De,null)))})},258:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));const s=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var a=r(44);const n=async(e,t,r)=>{const a=s(e,t),n=[];for(const e of a)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n},c=async(e,t,r)=>{const n=[],c=s(e,t);for(const e of c)try{const t=await Promise.resolve(e.callback(r));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(a.a)(t)||Object(a.b)(t))return n.push(t),n;n.push(t)}catch(e){return console.error(e),n.push({type:"error"}),n}return n}},311:function(e,t){},312:function(e,t,r){"use strict";var s=r(0),a=r(18);const n=Object(s.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(s.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(s.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=n},39:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var s=r(0),a=r(26),n=r.n(a);function c(e){const t=Object(s.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},44:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return d}));var s=r(62);let a,n;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(a||(a={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(n||(n={}));const c=(e,t)=>Object(s.b)(e)&&"type"in e&&e.type===t,o=e=>c(e,a.SUCCESS),i=e=>c(e,a.ERROR),l=e=>c(e,a.FAIL),u=e=>!Object(s.b)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:a,noticeContexts:n,shouldRetry:u,isSuccessResponse:o,isErrorResponse:i,isFailResponse:l})},478:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return a}));const s=e=>e.is_purchasable||!1,a=e=>["simple","variable"].includes(e.type||"simple")},504:function(e,t,r){"use strict";r.r(t);var s=r(54),a=r(257),n=r(256);t.default=Object(s.withFilteredAttributes)(n.a)(a.a)},80:function(e,t,r){"use strict";var s=r(5),a=r.n(s),n=r(0),c=r(139),o=r(4),i=r.n(o),l=r(100);r(160),t.a=e=>{let{className:t,showSpinner:r=!1,children:s,...o}=e;const u=i()("wc-block-components-button",t,{"wc-block-components-button--loading":r});return Object(n.createElement)(c.a,a()({className:u},o),r&&Object(n.createElement)(l.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},s))}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[9],{100:function(e,t,r){"use strict";var s=r(0);r(160),t.a=()=>Object(s.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},109:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return o}));var s=r(6);let a;!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(a||(a={}));const n={addEventCallback:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(s.uniqueId)(),type:a.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}},removeEventCallback:(e,t)=>({id:t,type:a.REMOVE_EVENT_CALLBACK,eventType:e})},c={},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,{type:t,eventType:r,id:s,callback:n,priority:o}=arguments.length>1?arguments[1]:void 0;const i=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case a.ADD_EVENT_CALLBACK:return i.set(s,{priority:o,callback:n}),{...e,[r]:i};case a.REMOVE_EVENT_CALLBACK:return i.delete(s),{...e,[r]:i}}}},114:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return l}));var s=r(0),a=r(6),n=r(25),c=r.n(n);const o=Object(s.createContext)({getValidationError:()=>"",setValidationErrors:e=>{},clearValidationError:e=>{},clearAllValidationErrors:()=>{},hideValidationError:()=>{},showValidationError:()=>{},showAllValidationErrors:()=>{},hasValidationErrors:!1,getValidationErrorId:e=>e}),i=()=>Object(s.useContext)(o),l=e=>{let{children:t}=e;const[r,n]=Object(s.useState)({}),i=Object(s.useCallback)(e=>r[e],[r]),l=Object(s.useCallback)(e=>{const t=r[e];return!t||t.hidden?"":"validate-error-"+e},[r]),u=Object(s.useCallback)(e=>{n(t=>{if(!t[e])return t;const{[e]:r,...s}=t;return s})},[]),d=Object(s.useCallback)(()=>{n({})},[]),b=Object(s.useCallback)(e=>{e&&n(t=>(e=Object(a.pickBy)(e,(e,r)=>!("string"!=typeof e.message||t.hasOwnProperty(r)&&c()(t[r],e))),0===Object.values(e).length?t:{...t,...e}))},[]),E=Object(s.useCallback)((e,t)=>{n(r=>{if(!r.hasOwnProperty(e))return r;const s={...r[e],...t};return c()(r[e],s)?r:{...r,[e]:s}})},[]),p={getValidationError:i,setValidationErrors:b,clearValidationError:u,clearAllValidationErrors:d,hideValidationError:Object(s.useCallback)(e=>{E(e,{hidden:!0})},[E]),showValidationError:Object(s.useCallback)(e=>{E(e,{hidden:!1})},[E]),showAllValidationErrors:Object(s.useCallback)(()=>{n(e=>{const t={};return Object.keys(e).forEach(r=>{e[r].hidden&&(t[r]={...e[r],hidden:!1})}),0===Object.values(t).length?e:{...e,...t}})},[]),hasValidationErrors:Object.keys(r).length>0,getValidationErrorId:l};return Object(s.createElement)(o.Provider,{value:p},t)}},159:function(e,t){},160:function(e,t){},161:function(e,t){},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var s=r(0),a=(r(10),r(114));r(161);const n=e=>{let{errorMessage:t="",propertyName:r="",elementId:n=""}=e;const{getValidationError:c,getValidationErrorId:o}=Object(a.b)();if(!t||"string"!=typeof t){const e=c(r)||{};if(!e.message||e.hidden)return null;t=e.message}return Object(s.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(s.createElement)("p",{id:o(n)},t))}},247:function(e,t){},254:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var s=r(109);const a=(e,t)=>function(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=s.a.addEventCallback(e,r,a);return t(n),()=>{t(s.a.removeEventCallback(e,n.id))}}},255:function(e,t,r){"use strict";t.a={showFormElements:{type:"boolean",default:!1},productId:{type:"number",default:0}}},256:function(e,t,r){"use strict";var s=r(0),a=(r(10),r(4)),n=r.n(a),c=r(1),o=r(38),i=r(470);const l={PRISTINE:"pristine",IDLE:"idle",DISABLED:"disabled",PROCESSING:"processing",BEFORE_PROCESSING:"before_processing",AFTER_PROCESSING:"after_processing"},u={status:l.PRISTINE,hasError:!1,quantity:0,processingResponse:null,requestParams:{}},d={SET_PRISTINE:"set_pristine",SET_IDLE:"set_idle",SET_DISABLED:"set_disabled",SET_PROCESSING:"set_processing",SET_BEFORE_PROCESSING:"set_before_processing",SET_AFTER_PROCESSING:"set_after_processing",SET_PROCESSING_RESPONSE:"set_processing_response",SET_HAS_ERROR:"set_has_error",SET_NO_ERROR:"set_no_error",SET_QUANTITY:"set_quantity",SET_REQUEST_PARAMS:"set_request_params"},{SET_PRISTINE:b,SET_IDLE:E,SET_DISABLED:p,SET_PROCESSING:m,SET_BEFORE_PROCESSING:O,SET_AFTER_PROCESSING:_,SET_PROCESSING_RESPONSE:h,SET_HAS_ERROR:j,SET_NO_ERROR:f,SET_QUANTITY:S,SET_REQUEST_PARAMS:g}=d,v=()=>({type:E}),y=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e?j:f;return{type:t}},{SET_PRISTINE:R,SET_IDLE:P,SET_DISABLED:C,SET_PROCESSING:A,SET_BEFORE_PROCESSING:k,SET_AFTER_PROCESSING:T,SET_PROCESSING_RESPONSE:w,SET_HAS_ERROR:N,SET_NO_ERROR:I,SET_QUANTITY:D,SET_REQUEST_PARAMS:F}=d,{PRISTINE:V,IDLE:B,DISABLED:q,PROCESSING:L,BEFORE_PROCESSING:x,AFTER_PROCESSING:G}=l,M=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,{quantity:r,type:s,data:a}=arguments.length>1?arguments[1]:void 0;switch(s){case R:e=u;break;case P:e=t.status!==B?{...t,status:B}:t;break;case C:e=t.status!==q?{...t,status:q}:t;break;case D:e=r!==t.quantity?{...t,quantity:r}:t;break;case F:e={...t,requestParams:{...t.requestParams,...a}};break;case w:e={...t,processingResponse:a};break;case A:e=t.status!==L?{...t,status:L,hasError:!1}:t,e=!1===e.hasError?e:{...e,hasError:!1};break;case k:e=t.status!==x?{...t,status:x,hasError:!1}:t;break;case T:e=t.status!==G?{...t,status:G}:t;break;case N:e=t.hasError?t:{...t,hasError:!0},e=t.status===L||t.status===x?{...e,status:B}:e;break;case I:e=t.hasError?{...t,hasError:!1}:t}return e!==t&&s!==R&&e.status===V&&(e.status=B),e};var Q=r(109),W=r(254);const H=e=>({onAddToCartAfterProcessingWithSuccess:Object(W.a)("add_to_cart_after_processing_with_success",e),onAddToCartProcessingWithError:Object(W.a)("add_to_cart_after_processing_with_error",e),onAddToCartBeforeProcessing:Object(W.a)("add_to_cart_before_processing",e)});var U=r(257),K=r(114),Y=r(45),J=r(42);const X=Object(s.createContext)({product:{},productType:"simple",productIsPurchasable:!0,productHasOptions:!1,supportsFormElements:!0,showFormElements:!1,quantity:0,minQuantity:1,maxQuantity:99,requestParams:{},isIdle:!1,isDisabled:!1,isProcessing:!1,isBeforeProcessing:!1,isAfterProcessing:!1,hasError:!1,eventRegistration:{onAddToCartAfterProcessingWithSuccess:e=>{},onAddToCartAfterProcessingWithError:e=>{},onAddToCartBeforeProcessing:e=>{}},dispatchActions:{resetForm:()=>{},submitForm:()=>{},setQuantity:e=>{},setHasError:e=>{},setAfterProcessing:e=>{},setRequestParams:e=>{}}}),z=()=>Object(s.useContext)(X),Z=e=>{var t,r,a,n;let{children:d,product:E,showFormElements:j}=e;const[f,R]=Object(s.useReducer)(M,u),[P,C]=Object(s.useReducer)(Q.b,{}),A=Object(o.a)(P),{addErrorNotice:k,removeNotices:T}=Object(Y.a)(),{setValidationErrors:w}=Object(K.b)(),{isSuccessResponse:N,isErrorResponse:I,isFailResponse:D}=Object(J.c)(),F=Object(s.useMemo)(()=>({onAddToCartAfterProcessingWithSuccess:H(C).onAddToCartAfterProcessingWithSuccess,onAddToCartAfterProcessingWithError:H(C).onAddToCartAfterProcessingWithError,onAddToCartBeforeProcessing:H(C).onAddToCartBeforeProcessing}),[C]),V=Object(s.useMemo)(()=>({resetForm:()=>{R({type:b})},submitForm:()=>{R({type:O})},setQuantity:e=>{R((e=>({type:S,quantity:e}))(e))},setHasError:e=>{R(y(e))},setRequestParams:e=>{R((e=>({type:g,data:e}))(e))},setAfterProcessing:e=>{R({type:h,data:e}),R({type:_})}}),[]);Object(s.useEffect)(()=>{const e=f.status,t=!E.id||!Object(i.a)(E);e!==l.DISABLED||t?e!==l.DISABLED&&t&&R({type:p}):R(v())},[f.status,E,R]),Object(s.useEffect)(()=>{f.status===l.BEFORE_PROCESSING&&(T("error"),Object(U.a)(A,"add_to_cart_before_processing",{}).then(e=>{!0!==e?(Array.isArray(e)&&e.forEach(e=>{let{errorMessage:t,validationErrors:r}=e;t&&k(t),r&&w(r)}),R(v())):R({type:m})}))},[f.status,w,k,T,R,A]),Object(s.useEffect)(()=>{if(f.status===l.AFTER_PROCESSING){const e={processingResponse:f.processingResponse},t=e=>{let t=!1;return e.forEach(e=>{const{message:r,messageContext:s}=e;(I(e)||D(e))&&r&&(t=!0,k(r,s?{context:s}:void 0))}),t};if(f.hasError)return void Object(U.b)(A,"add_to_cart_after_processing_with_error",e).then(r=>{if(!t(r)){var s;const t=(null===(s=e.processingResponse)||void 0===s?void 0:s.message)||Object(c.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block");k(t,{id:"add-to-cart"})}R(v())});Object(U.b)(A,"add_to_cart_after_processing_with_success",e).then(e=>{t(e)?R(y(!0)):R(v())})}},[f.status,f.hasError,f.processingResponse,V,k,I,D,N,A]);const B=Object(i.b)(E),q={product:E,productType:E.type||"simple",productIsPurchasable:Object(i.a)(E),productHasOptions:E.has_options||!1,supportsFormElements:B,showFormElements:j&&B,quantity:f.quantity||(null==E||null===(t=E.add_to_cart)||void 0===t?void 0:t.minimum)||1,minQuantity:(null==E||null===(r=E.add_to_cart)||void 0===r?void 0:r.minimum)||1,maxQuantity:(null==E||null===(a=E.add_to_cart)||void 0===a?void 0:a.maximum)||99,multipleOf:(null==E||null===(n=E.add_to_cart)||void 0===n?void 0:n.multiple_of)||1,requestParams:f.requestParams,isIdle:f.status===l.IDLE,isDisabled:f.status===l.DISABLED,isProcessing:f.status===l.PROCESSING,isBeforeProcessing:f.status===l.BEFORE_PROCESSING,isAfterProcessing:f.status===l.AFTER_PROCESSING,hasError:f.hasError,eventRegistration:F,dispatchActions:V};return Object(s.createElement)(X.Provider,{value:q},d)};var $=r(12),ee=r.n($),te=r(16),re=r(250),se=r(35),ae=()=>{const{dispatchActions:e,product:t,quantity:r,eventRegistration:a,hasError:n,isProcessing:o,requestParams:i}=z(),{hasValidationErrors:l,showAllValidationErrors:u}=Object(K.b)(),{addErrorNotice:d,removeNotice:b}=Object(Y.a)(),{receiveCart:E}=Object(se.a)(),[p,m]=Object(s.useState)(!1),O=!n&&o,_=Object(s.useCallback)(()=>!l||(u(),{type:"error"}),[l,u]);Object(s.useEffect)(()=>{const e=a.onAddToCartBeforeProcessing(_,0);return()=>{e()}},[a,_]);const h=Object(s.useCallback)(()=>{m(!0),b("add-to-cart");const s={id:t.id||0,quantity:r,...i};ee()({path:"/wc/store/cart/add-item",method:"POST",data:s,cache:"no-store",parse:!1}).then(t=>{ee.a.setNonce(t.headers),t.json().then((function(r){t.ok?E(r):(r.body&&r.body.message?d(Object(te.decodeEntities)(r.body.message),{id:"add-to-cart"}):d(Object(c.__)("Something went wrong. Please contact us to get assistance.","woo-gutenberg-products-block"),{id:"add-to-cart"}),e.setHasError()),Object(re.b)({preserveCartData:!0}),e.setAfterProcessing(r),m(!1)}))}).catch(t=>{t.json().then((function(t){var r;null!==(r=t.data)&&void 0!==r&&r.cart&&E(t.data.cart),e.setHasError(),e.setAfterProcessing(t),m(!1)}))})},[t,d,b,E,e,r,i]);return Object(s.useEffect)(()=>{O&&!p&&h()},[O,h,p]),null};const ne=e=>{let{children:t,product:r,showFormElements:a}=e;return Object(s.createElement)(K.a,null,Object(s.createElement)(Z,{product:r,showFormElements:a},t,Object(s.createElement)(ae,null)))};var ce=r(28),oe=r(6),ie=r(55),le=(r(247),r(80)),ue=r(103),de=r(499),be=r(60),Ee=r(355);const pe=e=>{let{className:t,href:r,text:a,onClick:n}=e;return Object(s.createElement)(le.a,{className:t,href:r,onClick:n,rel:"nofollow"},a)},me=e=>{let{className:t,quantityInCart:r,isProcessing:a,isDisabled:n,isDone:o,onClick:i}=e;return Object(s.createElement)(le.a,{className:t,disabled:n,showSpinner:a,onClick:i},o&&r>0?Object(c.sprintf)(
2
  /* translators: %s number of products in cart. */
3
+ Object(c._n)("%d in cart","%d in cart",r,"woo-gutenberg-products-block"),r):Object(c.__)("Add to cart","woo-gutenberg-products-block"),!!o&&Object(s.createElement)(ue.a,{icon:de.a}))};var Oe=()=>{const{showFormElements:e,productIsPurchasable:t,productHasOptions:r,product:a,productType:n,isDisabled:o,isProcessing:i,eventRegistration:l,hasError:u,dispatchActions:d}=z(),{parentName:b}=Object(ce.useInnerBlockLayoutContext)(),{dispatchStoreEvent:E}=Object(be.a)(),{cartQuantity:p}=Object(Ee.a)(a.id||0),[m,O]=Object(s.useState)(!1),_=a.add_to_cart||{url:"",text:""};return Object(s.useEffect)(()=>{const e=l.onAddToCartAfterProcessingWithSuccess(()=>(u||O(!0),!0),0);return()=>{e()}},[l,u]),(e||!r&&"simple"===n)&&t?Object(s.createElement)(me,{className:"wc-block-components-product-add-to-cart-button",quantityInCart:p,isDisabled:o,isProcessing:i,isDone:m,onClick:()=>{d.submitForm(),E("cart-add-item",{product:a,listName:b})}}):Object(s.createElement)(pe,{className:"wc-block-components-product-add-to-cart-button",href:_.url,text:_.text||Object(c.__)("View Product","woo-gutenberg-products-block"),onClick:()=>{E("product-view-link",{product:a,listName:b})}})},_e=r(118),he=e=>{let{disabled:t,min:r,max:a,step:n=1,value:c,onChange:o}=e;const i=void 0!==a,l=Object(_e.a)(e=>{let t=e;i&&(t=Math.min(t,Math.floor(a/n)*n)),t=Math.max(t,Math.ceil(r/n)*n),t=Math.floor(t/n)*n,t!==e&&o(t)},300);return Object(s.createElement)("input",{className:"wc-block-components-product-add-to-cart-quantity",type:"number",value:c,min:r,max:a,step:n,hidden:1===a,disabled:t,onChange:e=>{o(e.target.value),l(e.target.value)}})},je=e=>{let{reason:t=Object(c.__)("Sorry, this product cannot be purchased.","woo-gutenberg-products-block")}=e;return Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-unavailable"},t)},fe=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:a,multipleOf:n,dispatchActions:o,isDisabled:i}=z();return e.id&&!e.is_purchasable?Object(s.createElement)(je,null):e.id&&!e.is_in_stock?Object(s.createElement)(je,{reason:Object(c.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(s.createElement)(s.Fragment,null,Object(s.createElement)(he,{value:t,min:r,max:a,step:n,disabled:i,onChange:o.setQuantity}),Object(s.createElement)(Oe,null))},Se=(r(311),r(517)),ge=r(8),ve=r(196);const ye={value:"",label:Object(c.__)("Select an option","woo-gutenberg-products-block")};var Re=e=>{let{attributeName:t,options:r=[],value:a="",onChange:o=(()=>{}),errorMessage:i=Object(c.__)("Please select a value.","woo-gutenberg-products-block")}=e;const{getValidationError:l,setValidationErrors:u,clearValidationError:d}=Object(K.b)(),b=t,E=l(b)||{};return Object(ge.useEffect)(()=>{a?d(b):u({[b]:{message:i,hidden:!0}})},[a,b,i,d,u]),Object(ge.useEffect)(()=>()=>{d(b)},[b,d]),Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker__container"},Object(s.createElement)(Se.a,{label:Object(te.decodeEntities)(t),value:a||"",options:[ye,...r],onChange:o,required:!0,className:n()("wc-block-components-product-add-to-cart-attribute-picker__select",{"has-error":E.message&&!E.hidden})}),Object(s.createElement)(ve.a,{propertyName:b,elementId:b}))},Pe=r(36);const Ce=(e,t,r)=>{const s=Object.values(t).map(e=>{let{id:t}=e;return t});if(Object.values(r).every(e=>""===e))return s;const a=Object.keys(e);return s.filter(e=>a.every(s=>{const a=r[s]||"",n=t["id:"+e].attributes[s];return""===a||null===n||n===a}))};var Ae=e=>{let{attributes:t,variationAttributes:r,setRequestParams:a}=e;const n=Object(o.a)(t),c=Object(o.a)(r),[i,l]=Object(s.useState)(0),[u,d]=Object(s.useState)({}),[b,E]=Object(s.useState)(!1),p=Object(s.useMemo)(()=>((e,t,r)=>{const s={},a=Object.keys(e),n=Object.values(r).filter(Boolean).length>0;return a.forEach(a=>{const c=e[a],o={...r,[a]:null},i=n?Ce(e,t,o):null,l=null!==i?i.map(e=>t["id:"+e].attributes[a]):null;s[a]=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Object.values(e).map(e=>{let{name:r,slug:s}=e;return null===t||t.includes(null)||t.includes(s)?{value:s,label:Object(te.decodeEntities)(r)}:null}).filter(Boolean)}(c.terms,l)}),s})(n,c,u),[u,n,c]);return Object(s.useEffect)(()=>{if(!b){const e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Object(Pe.c)(e))return{};const t=Object.keys(e),r={};return 0===t.length||t.forEach(t=>{const s=e[t],a=s.terms.filter(e=>e.default);var n;a.length>0&&(r[s.name]=null===(n=a[0])||void 0===n?void 0:n.slug)}),r}(t);e&&d({...e}),E(!0)}},[u,t,b]),Object(s.useEffect)(()=>{Object.values(u).filter(e=>""!==e).length===Object.keys(n).length?l(((e,t,r)=>Ce(e,t,r)[0]||0)(n,c,u)):i>0&&l(0)},[u,i,n,c]),Object(s.useEffect)(()=>{a({id:i,variation:Object.keys(u).map(e=>({attribute:e,value:u[e]}))})},[a,i,u]),Object(s.createElement)("div",{className:"wc-block-components-product-add-to-cart-attribute-picker"},Object.keys(n).map(e=>Object(s.createElement)(Re,{key:e,attributeName:e,options:p[e],value:u[e],onChange:t=>{d({...u,[e]:t})}})))},ke=e=>{let{product:t,dispatchers:r}=e;const a=(e=>e?Object(oe.keyBy)(Object.values(e).filter(e=>{let{has_variations:t}=e;return t}),"name"):{})(t.attributes),n=(e=>{if(!e)return{};const t={};return e.forEach(e=>{let{id:r,attributes:s}=e;t["id:"+r]={id:r,attributes:s.reduce((e,t)=>{let{name:r,value:s}=t;return e[r]=s,e},{})}}),t})(t.variations);return 0===Object.keys(a).length||0===n.length?null:Object(s.createElement)(Ae,{attributes:a,variationAttributes:n,setRequestParams:r.setRequestParams})},Te=()=>{const{product:e,quantity:t,minQuantity:r,maxQuantity:a,multipleOf:n,dispatchActions:o,isDisabled:i}=z();return e.id&&!e.is_purchasable?Object(s.createElement)(je,null):e.id&&!e.is_in_stock?Object(s.createElement)(je,{reason:Object(c.__)("This product is currently out of stock and cannot be purchased.","woo-gutenberg-products-block")}):Object(s.createElement)(s.Fragment,null,Object(s.createElement)(ke,{product:e,dispatchers:o}),Object(s.createElement)(he,{value:t,min:r,max:a,step:n,disabled:i,onChange:o.setQuantity}),Object(s.createElement)(Oe,null))},we=()=>Object(s.createElement)(Oe,null),Ne=r(501),Ie=()=>Object(s.createElement)(Ne.a,{className:"wc-block-components-product-add-to-cart-group-list"},"This is a placeholder for the grouped products form element."),De=()=>Object(s.createElement)(Ie,null);const Fe=()=>{const{showFormElements:e,productType:t}=z();return e?"variable"===t?Object(s.createElement)(Te,null):"grouped"===t?Object(s.createElement)(De,null):"external"===t?Object(s.createElement)(we,null):"simple"===t||"variation"===t?Object(s.createElement)(fe,null):null:Object(s.createElement)(Oe,null)};t.a=Object(ie.withProductDataContext)(e=>{let{className:t,showFormElements:r}=e;const{product:a}=Object(ce.useProductDataContext)(),c=n()(t,"wc-block-components-product-add-to-cart",{"wc-block-components-product-add-to-cart--placeholder":Object(oe.isEmpty)(a)});return Object(s.createElement)(ne,{product:a,showFormElements:r},Object(s.createElement)("div",{className:c},Object(s.createElement)(Fe,null)))})},257:function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return c}));const s=(e,t)=>e[t]?Array.from(e[t].values()).sort((e,t)=>e.priority-t.priority):[];var a=r(42);const n=async(e,t,r)=>{const a=s(e,t),n=[];for(const e of a)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&n.push(t)}catch(e){console.error(e)}return!n.length||n},c=async(e,t,r)=>{const n=[],c=s(e,t);for(const e of c)try{const t=await Promise.resolve(e.callback(r));if("object"!=typeof t||null===t)continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if(Object(a.a)(t)||Object(a.b)(t))return n.push(t),n;n.push(t)}catch(e){return console.error(e),n.push({type:"error"}),n}return n}},311:function(e,t){},38:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var s=r(0),a=r(25),n=r.n(a);function c(e){const t=Object(s.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},42:function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return l})),r.d(t,"c",(function(){return d}));var s=r(36);let a,n;!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(a||(a={})),function(e){e.PAYMENTS="wc/payment-area",e.EXPRESS_PAYMENTS="wc/express-payment-area"}(n||(n={}));const c=(e,t)=>Object(s.c)(e)&&"type"in e&&e.type===t,o=e=>c(e,a.SUCCESS),i=e=>c(e,a.ERROR),l=e=>c(e,a.FAIL),u=e=>!Object(s.c)(e)||void 0===e.retry||!0===e.retry,d=()=>({responseTypes:a,noticeContexts:n,shouldRetry:u,isSuccessResponse:o,isErrorResponse:i,isFailResponse:l})},470:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return a}));const s=e=>e.is_purchasable||!1,a=e=>["simple","variable"].includes(e.type||"simple")},522:function(e,t,r){"use strict";r.r(t);var s=r(55),a=r(256),n=r(255);t.default=Object(s.withFilteredAttributes)(n.a)(a.a)},80:function(e,t,r){"use strict";var s=r(5),a=r.n(s),n=r(0),c=r(136),o=r(4),i=r.n(o),l=r(100);r(159),t.a=e=>{let{className:t,showSpinner:r=!1,children:s,variant:o="contained",...u}=e;const d=i()("wc-block-components-button",t,o,{"wc-block-components-button--loading":r});return Object(n.createElement)(c.a,a()({className:d},u),r&&Object(n.createElement)(l.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},s))}}}]);
build/atomic-block-components/button-frontend.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{317:function(t,e){},318:function(t,e,c){"use strict";c.d(e,"a",(function(){return u}));var o=c(0),n=c(9),r=c(6),a=c(19),d=c(22),i=c(32);const s=(t,e)=>{const c=t.find(t=>{let{id:c}=t;return c===e});return c?c.quantity:0},u=t=>{const{addItemToCart:e}=Object(n.useDispatch)(r.CART_STORE_KEY),{cartItems:c,cartIsLoading:u}=Object(d.a)(),{addErrorNotice:l,removeNotice:b}=Object(i.a)(),[p,f]=Object(o.useState)(!1),m=Object(o.useRef)(s(c,t));return Object(o.useEffect)(()=>{const e=s(c,t);e!==m.current&&(m.current=e)},[c,t]),{cartQuantity:Number.isFinite(m.current)?m.current:0,addingToCart:p,cartIsLoading:u,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return f(!0),e(t,c).then(()=>{b("add-to-cart")}).catch(t=>{l(Object(a.decodeEntities)(t.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})}).finally(()=>{f(!1)})}}}},32:function(t,e,c){"use strict";c.d(e,"a",(function(){return r}));var o=c(0),n=c(87);const r=()=>{const{notices:t,createNotice:e,removeNotice:c,setIsSuppressed:r}=Object(n.b)(),a=Object(o.useRef)(t);Object(o.useEffect)(()=>{a.current=t},[t]);const d=Object(o.useMemo)(()=>({hasNoticesOfType:t=>a.current.some(e=>e.type===t),removeNotices:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.current.forEach(e=>{null!==t&&e.status!==t||c(e.id)})},removeNotice:c}),[c]),i=Object(o.useMemo)(()=>({addDefaultNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("default",t,{...c})},addErrorNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("error",t,{...c})},addWarningNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("warning",t,{...c})},addInfoNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("info",t,{...c})},addSuccessNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("success",t,{...c})}}),[e]);return{notices:t,...d,...i,setIsSuppressed:r}}},366:function(t,e,c){"use strict";c.r(e);var o=c(10),n=c.n(o),r=c(0),a=(c(8),c(4)),d=c.n(a),i=c(1),s=c(38),u=c(318),l=c(19),b=c(49),p=c(110);c(317);const f=t=>{let{product:e}=t;const{id:c,permalink:o,add_to_cart:a,has_options:b,is_purchasable:p,is_in_stock:f}=e,{dispatchStoreEvent:m}=Object(s.a)(),{cartQuantity:O,addingToCart:_,addToCart:j}=Object(u.a)(c),k=Number.isFinite(O)&&O>0,w=!b&&p&&f,g=Object(l.decodeEntities)((null==a?void 0:a.description)||""),h=k?Object(i.sprintf)(
2
  /* translators: %s number of products in cart. */
3
- Object(i._n)("%d in cart","%d in cart",O,"woo-gutenberg-products-block"),O):Object(l.decodeEntities)((null==a?void 0:a.text)||Object(i.__)("Add to cart","woo-gutenberg-products-block")),v=w?"button":"a",N={};return w?N.onClick=()=>{j(),m("cart-add-item",{product:e})}:(N.href=o,N.rel="nofollow",N.onClick=()=>{m("product-view-link",{product:e})}),Object(r.createElement)(v,n()({"aria-label":g,className:d()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:_,added:k}),disabled:_},N),h)},m=()=>Object(r.createElement)("button",{className:d()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0});e.default=Object(p.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:c}=Object(b.useInnerBlockLayoutContext)(),{product:o}=Object(b.useProductDataContext)();return Object(r.createElement)("div",{className:d()(e,"wp-block-button","wc-block-components-product-button",{[c+"__product-add-to-cart"]:c})},o.id?Object(r.createElement)(f,{product:o}):Object(r.createElement)(m,null))})}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{319:function(t,e){},320:function(t,e,c){"use strict";c.d(e,"a",(function(){return u}));var o=c(0),n=c(9),r=c(6),a=c(21),d=c(24),i=c(34);const s=(t,e)=>{const c=t.find(t=>{let{id:c}=t;return c===e});return c?c.quantity:0},u=t=>{const{addItemToCart:e}=Object(n.useDispatch)(r.CART_STORE_KEY),{cartItems:c,cartIsLoading:u}=Object(d.a)(),{addErrorNotice:l,removeNotice:b}=Object(i.a)(),[p,f]=Object(o.useState)(!1),O=Object(o.useRef)(s(c,t));return Object(o.useEffect)(()=>{const e=s(c,t);e!==O.current&&(O.current=e)},[c,t]),{cartQuantity:Number.isFinite(O.current)?O.current:0,addingToCart:p,cartIsLoading:u,addToCart:function(){let c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return f(!0),e(t,c).then(()=>{b("add-to-cart")}).catch(t=>{l(Object(a.decodeEntities)(t.message),{context:"wc/all-products",id:"add-to-cart",isDismissible:!0})}).finally(()=>{f(!1)})}}}},34:function(t,e,c){"use strict";c.d(e,"a",(function(){return r}));var o=c(0),n=c(88);const r=()=>{const{notices:t,createNotice:e,removeNotice:c,setIsSuppressed:r}=Object(n.b)(),a=Object(o.useRef)(t);Object(o.useEffect)(()=>{a.current=t},[t]);const d=Object(o.useMemo)(()=>({hasNoticesOfType:t=>a.current.some(e=>e.type===t),removeNotices:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.current.forEach(e=>{null!==t&&e.status!==t||c(e.id)})},removeNotice:c}),[c]),i=Object(o.useMemo)(()=>({addDefaultNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("default",t,{...c})},addErrorNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("error",t,{...c})},addWarningNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("warning",t,{...c})},addInfoNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("info",t,{...c})},addSuccessNotice:function(t){let c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e("success",t,{...c})}}),[e]);return{notices:t,...d,...i,setIsSuppressed:r}}},368:function(t,e,c){"use strict";c.r(e);var o=c(11),n=c.n(o),r=c(0),a=(c(8),c(4)),d=c.n(a),i=c(1),s=c(33),u=c(320),l=c(21),b=c(50),p=c(2),f=c(49),O=c(113);c(319);const m=t=>{let{product:e}=t;const{id:c,permalink:o,add_to_cart:a,has_options:f,is_purchasable:O,is_in_stock:m}=e,{dispatchStoreEvent:_}=Object(s.a)(),{cartQuantity:j,addingToCart:g,addToCart:w}=Object(u.a)(c),k=Number.isFinite(j)&&j>0,h=!f&&O&&m,v=Object(l.decodeEntities)((null==a?void 0:a.description)||""),N=k?Object(i.sprintf)(
2
  /* translators: %s number of products in cart. */
3
+ Object(i._n)("%d in cart","%d in cart",j,"woo-gutenberg-products-block"),j):Object(l.decodeEntities)((null==a?void 0:a.text)||Object(i.__)("Add to cart","woo-gutenberg-products-block")),E=h?"button":"a",C={};return h?C.onClick=()=>{w(),_("cart-add-item",{product:e});const{cartRedirectAfterAdd:t}=Object(p.getSetting)("productsSettings");t&&(window.location.href=b.c)}:(C.href=o,C.rel="nofollow",C.onClick=()=>{_("product-view-link",{product:e})}),Object(r.createElement)(E,n()({"aria-label":v,className:d()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:g,added:k}),disabled:g},C),N)},_=()=>Object(r.createElement)("button",{className:d()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0});e.default=Object(O.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:c}=Object(f.useInnerBlockLayoutContext)(),{product:o}=Object(f.useProductDataContext)();return Object(r.createElement)("div",{className:d()(e,"wp-block-button","wc-block-components-product-button",{[c+"__product-add-to-cart"]:c})},o.id?Object(r.createElement)(m,{product:o}):Object(r.createElement)(_,null))})}}]);
build/atomic-block-components/button.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[10],{265:function(t,o,c){"use strict";c.r(o);var e=c(5),n=c.n(e),a=c(0),d=(c(10),c(4)),r=c.n(d),l=c(1),b=c(60),u=c(360),i=c(14),s=c(29),p=c(54);c(305);const _=t=>{let{product:o}=t;const{id:c,permalink:e,add_to_cart:d,has_options:s,is_purchasable:p,is_in_stock:_}=o,{dispatchStoreEvent:k}=Object(b.a)(),{cartQuantity:w,addingToCart:m,addToCart:j}=Object(u.a)(c),O=Number.isFinite(w)&&w>0,C=!s&&p&&_,E=Object(i.decodeEntities)((null==d?void 0:d.description)||""),h=O?Object(l.sprintf)(
2
  /* translators: %s number of products in cart. */
3
- Object(l._n)("%d in cart","%d in cart",w,"woo-gutenberg-products-block"),w):Object(i.decodeEntities)((null==d?void 0:d.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),f=C?"button":"a",g={};return C?g.onClick=()=>{j(),k("cart-add-item",{product:o})}:(g.href=e,g.rel="nofollow",g.onClick=()=>{k("product-view-link",{product:o})}),Object(a.createElement)(f,n()({"aria-label":E,className:r()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:m,added:O}),disabled:m},g),h)},k=()=>Object(a.createElement)("button",{className:r()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0});o.default=Object(p.withProductDataContext)(t=>{let{className:o}=t;const{parentClassName:c}=Object(s.useInnerBlockLayoutContext)(),{product:e}=Object(s.useProductDataContext)();return Object(a.createElement)("div",{className:r()(o,"wp-block-button","wc-block-components-product-button",{[c+"__product-add-to-cart"]:c})},e.id?Object(a.createElement)(_,{product:e}):Object(a.createElement)(k,null))})},305:function(t,o){}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[10],{264:function(t,e,o){"use strict";o.r(e);var c=o(5),n=o.n(c),a=o(0),d=(o(10),o(4)),r=o.n(d),l=o(1),b=o(60),u=o(355),i=o(16),s=o(22),p=o(2),_=o(28),k=o(55);o(305);const w=t=>{let{product:e}=t;const{id:o,permalink:c,add_to_cart:d,has_options:_,is_purchasable:k,is_in_stock:w}=e,{dispatchStoreEvent:m}=Object(b.a)(),{cartQuantity:j,addingToCart:O,addToCart:g}=Object(u.a)(o),f=Number.isFinite(j)&&j>0,h=!_&&k&&w,C=Object(i.decodeEntities)((null==d?void 0:d.description)||""),E=f?Object(l.sprintf)(
2
  /* translators: %s number of products in cart. */
3
+ Object(l._n)("%d in cart","%d in cart",j,"woo-gutenberg-products-block"),j):Object(i.decodeEntities)((null==d?void 0:d.text)||Object(l.__)("Add to cart","woo-gutenberg-products-block")),v=h?"button":"a",N={};return h?N.onClick=()=>{g(),m("cart-add-item",{product:e});const{cartRedirectAfterAdd:t}=Object(p.getSetting)("productsSettings");t&&(window.location.href=s.d)}:(N.href=c,N.rel="nofollow",N.onClick=()=>{m("product-view-link",{product:e})}),Object(a.createElement)(v,n()({"aria-label":C,className:r()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:O,added:f}),disabled:O},N),E)},m=()=>Object(a.createElement)("button",{className:r()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0});e.default=Object(k.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:o}=Object(_.useInnerBlockLayoutContext)(),{product:c}=Object(_.useProductDataContext)();return Object(a.createElement)("div",{className:r()(e,"wp-block-button","wc-block-components-product-button",{[o+"__product-add-to-cart"]:o})},c.id?Object(a.createElement)(w,{product:c}):Object(a.createElement)(m,null))})},305:function(t,e){}}]);
build/atomic-block-components/category-list--atomic-block-components/image--atomic-block-components/sale---5e68150f.js ADDED
@@ -0,0 +1 @@
 
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[2],{144:function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var c=n(7);const s=()=>"function"==typeof c.__experimentalGetSpacingClassesAndStyles},51:function(t,e,n){"use strict";n.d(e,"c",(function(){return l})),n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return f}));var c=n(7),s=n(50),r=n(36),o=n(144);const i=t=>Object(r.d)(t)?JSON.parse(t)||{}:Object(r.c)(t)?t:{},l=t=>{if(!Object(s.b)()||!Object(o.a)())return{style:{}};const e=Object(r.c)(t)?t:{},n=i(e.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...e,style:n})},a=t=>{const e=Object(r.c)(t)?t:{},n=i(e.style),c=Object(r.c)(n.typography)?n.typography:{};return{style:{fontSize:e.fontSize||c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,textTransform:c.textTransform,fontFamily:e.fontFamily}}},u=t=>{if(!Object(s.b)())return{className:"",style:{}};const e=Object(r.c)(t)?t:{},n=i(e.style);return Object(c.__experimentalUseColorProps)({...e,style:n})},f=t=>{if(!Object(s.b)())return{className:"",style:{}};const e=Object(r.c)(t)?t:{},n=i(e.style);return Object(c.__experimentalUseBorderProps)({...e,style:n})}}}]);
build/atomic-block-components/category-list-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[9],{321:function(e,t){},369:function(e,t,c){"use strict";c.r(t);var o=c(0),a=c(1),n=c(4),l=c.n(n),r=c(49),s=c(5),u=c(110);c(321),t.default=Object(u.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(r.useInnerBlockLayoutContext)(),{product:n}=Object(r.useProductDataContext)();return Object(s.isEmpty)(n.categories)?null:Object(o.createElement)("div",{className:l()(t,"wc-block-components-product-category-list",{[c+"__product-category-list"]:c})},Object(a.__)("Categories:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.categories).map(e=>{let{name:t,link:c,slug:a}=e;return Object(o.createElement)("li",{key:"category-list-item-"+a},Object(o.createElement)("a",{href:c},t))})))})}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[9],{111:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n(99);var c=n(50);const s=()=>c.m>1},134:function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return l})),n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return u}));var c=n(68),s=n(111),r=n(18);const o=t=>Object(r.e)(t)?JSON.parse(t)||{}:Object(r.d)(t)?t:{},a=t=>{if(!Object(s.a)()||"function"!=typeof c.__experimentalGetSpacingClassesAndStyles)return{style:{}};const e=Object(r.d)(t)?t:{},n=o(e.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...e,style:n})},l=t=>{const e=Object(r.d)(t)?t:{},n=o(e.style),c=Object(r.d)(n.typography)?n.typography:{};return{style:{fontSize:e.fontSize||c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,textTransform:c.textTransform,fontFamily:e.fontFamily}}},i=t=>{if(!Object(s.a)())return{className:"",style:{}};const e=Object(r.d)(t)?t:{},n=o(e.style);return Object(c.__experimentalUseColorProps)({...e,style:n})},u=t=>{if(!Object(s.a)())return{className:"",style:{}};const e=Object(r.d)(t)?t:{},n=o(e.style);return Object(c.__experimentalUseBorderProps)({...e,style:n})}},323:function(t,e){},371:function(t,e,n){"use strict";n.r(e);var c=n(0),s=n(1),r=n(4),o=n.n(r),a=n(49),l=n(5),i=n(113),u=(n(323),n(134));e.default=Object(i.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:n}=Object(a.useInnerBlockLayoutContext)(),{product:r}=Object(a.useProductDataContext)(),i=Object(u.b)(t),b=Object(u.d)(t);return Object(l.isEmpty)(r.categories)?null:Object(c.createElement)("div",{className:o()(e,"wc-block-components-product-category-list",i.className,{[n+"__product-category-list"]:n}),style:{...i.style,...b.style}},Object(s.__)("Categories:","woo-gutenberg-products-block")," ",Object(c.createElement)("ul",null,Object.values(r.categories).map(t=>{let{name:e,link:n,slug:s}=t;return Object(c.createElement)("li",{key:"category-list-item-"+s},Object(c.createElement)("a",{href:n},e))})))})}}]);
build/atomic-block-components/category-list.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[11],{268:function(e,t,c){"use strict";c.r(t);var o=c(0),a=c(1),n=c(4),l=c.n(n),r=c(29),s=c(6),u=c(54);c(308),t.default=Object(u.withProductDataContext)(e=>{let{className:t}=e;const{parentClassName:c}=Object(r.useInnerBlockLayoutContext)(),{product:n}=Object(r.useProductDataContext)();return Object(s.isEmpty)(n.categories)?null:Object(o.createElement)("div",{className:l()(t,"wc-block-components-product-category-list",{[c+"__product-category-list"]:c})},Object(a.__)("Categories:","woo-gutenberg-products-block")," ",Object(o.createElement)("ul",null,Object.values(n.categories).map(e=>{let{name:t,link:c,slug:a}=e;return Object(o.createElement)("li",{key:"category-list-item-"+a},Object(o.createElement)("a",{href:c},t))})))})},308:function(e,t){}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[11],{267:function(e,t,c){"use strict";c.r(t);var a=c(0),o=c(1),s=c(4),l=c.n(s),n=c(28),r=c(6),u=c(55),b=(c(308),c(51));t.default=Object(u.withProductDataContext)(e=>{const{className:t}=e,{parentClassName:c}=Object(n.useInnerBlockLayoutContext)(),{product:s}=Object(n.useProductDataContext)(),u=Object(b.b)(e),i=Object(b.d)(e);return Object(r.isEmpty)(s.categories)?null:Object(a.createElement)("div",{className:l()(t,"wc-block-components-product-category-list",u.className,{[c+"__product-category-list"]:c}),style:{...u.style,...i.style}},Object(o.__)("Categories:","woo-gutenberg-products-block")," ",Object(a.createElement)("ul",null,Object.values(s.categories).map(e=>{let{name:t,link:c,slug:o}=e;return Object(a.createElement)("li",{key:"category-list-item-"+o},Object(a.createElement)("a",{href:c},t))})))})},308:function(e,t){}}]);
build/atomic-block-components/image-frontend.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[10,13],{21:function(e,t,a){"use strict";var c=a(0),n=a(4),l=a.n(n);t.a=e=>{let t,{label:a,screenReaderLabel:n,wrapperElement:r,wrapperProps:o={}}=e;const s=null!=a,i=null!=n;return!s&&i?(t=r||"span",o={...o,className:l()(o.className,"screen-reader-text")},Object(c.createElement)(t,o,n)):(t=r||c.Fragment,s&&i&&a!==n?Object(c.createElement)(t,o,Object(c.createElement)("span",{"aria-hidden":"true"},a),Object(c.createElement)("span",{className:"screen-reader-text"},n)):Object(c.createElement)(t,o,a))}},270:function(e,t){},288:function(e,t,a){"use strict";a.r(t);var c=a(0),n=(a(8),a(1)),l=a(4),r=a.n(l),o=a(21),s=a(49),i=a(110);a(270),t.default=Object(i.withProductDataContext)(e=>{let{className:t,align:a}=e;const{parentClassName:l}=Object(s.useInnerBlockLayoutContext)(),{product:i}=Object(s.useProductDataContext)();if(!i.id||!i.on_sale)return null;const u="string"==typeof a?"wc-block-components-product-sale-badge--align-"+a:"";return Object(c.createElement)("div",{className:r()("wc-block-components-product-sale-badge",t,u,{[l+"__product-onsale"]:l})},Object(c.createElement)(o.a,{label:Object(n.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(n.__)("Product on sale","woo-gutenberg-products-block")}))})},314:function(e,t){},397:function(e,t,a){"use strict";a.r(t);var c=a(110),n=a(10),l=a.n(n),r=a(0),o=(a(8),a(1)),s=a(4),i=a.n(s),u=a(2),d=a(49),b=a(38),m=a(288);a(314);const p=()=>Object(r.createElement)("img",{src:u.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),g=e=>{let{image:t,onLoad:a,loaded:c,showFullSize:n,fallbackAlt:o}=e;const{thumbnail:s,src:i,srcset:u,sizes:d,alt:b}=t||{},m={alt:b||o,onLoad:a,hidden:!c,src:s,...n&&{src:i,srcSet:u,sizes:d}};return Object(r.createElement)(r.Fragment,null,m.src&&Object(r.createElement)("img",l()({"data-testid":"product-image"},m)),!c&&Object(r.createElement)(p,null))};var O=Object(c.withProductDataContext)(e=>{let{className:t,imageSizing:a="full-size",showProductLink:c=!0,showSaleBadge:n,saleBadgeAlign:l="right"}=e;const{parentClassName:s}=Object(d.useInnerBlockLayoutContext)(),{product:u}=Object(d.useProductDataContext)(),[O,j]=Object(r.useState)(!1),{dispatchStoreEvent:w}=Object(b.a)();if(!u.id)return Object(r.createElement)("div",{className:i()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",{[s+"__product-image"]:s})},Object(r.createElement)(p,null));const f=!!u.images.length,h=f?u.images[0]:null,k=c?"a":r.Fragment,E=Object(o.sprintf)(
2
  /* translators: %s is referring to the product name */
3
- Object(o.__)("Link to %s","woo-gutenberg-products-block"),u.name),_={href:u.permalink,rel:"nofollow",...!f&&{"aria-label":E},onClick:()=>{w("product-view-link",{product:u})}};return Object(r.createElement)("div",{className:i()(t,"wc-block-components-product-image",{[s+"__product-image"]:s})},Object(r.createElement)(k,c&&_,!!n&&Object(r.createElement)(m.default,{align:l,product:u}),Object(r.createElement)(g,{fallbackAlt:u.name,image:h,onLoad:()=>j(!0),loaded:O,showFullSize:"cropped"!==a})))});t.default=Object(c.withFilteredAttributes)({showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}})(O)}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[10,13],{111:function(e,t,c){"use strict";c.d(t,"a",(function(){return a})),c(99);var n=c(50);const a=()=>n.m>1},134:function(e,t,c){"use strict";c.d(t,"c",(function(){return s})),c.d(t,"d",(function(){return o})),c.d(t,"b",(function(){return i})),c.d(t,"a",(function(){return u}));var n=c(68),a=c(111),r=c(18);const l=e=>Object(r.e)(e)?JSON.parse(e)||{}:Object(r.d)(e)?e:{},s=e=>{if(!Object(a.a)()||"function"!=typeof n.__experimentalGetSpacingClassesAndStyles)return{style:{}};const t=Object(r.d)(e)?e:{},c=l(t.style);return Object(n.__experimentalGetSpacingClassesAndStyles)({...t,style:c})},o=e=>{const t=Object(r.d)(e)?e:{},c=l(t.style),n=Object(r.d)(c.typography)?c.typography:{};return{style:{fontSize:t.fontSize||n.fontSize,lineHeight:n.lineHeight,fontWeight:n.fontWeight,textTransform:n.textTransform,fontFamily:t.fontFamily}}},i=e=>{if(!Object(a.a)())return{className:"",style:{}};const t=Object(r.d)(e)?e:{},c=l(t.style);return Object(n.__experimentalUseColorProps)({...t,style:c})},u=e=>{if(!Object(a.a)())return{className:"",style:{}};const t=Object(r.d)(e)?e:{},c=l(t.style);return Object(n.__experimentalUseBorderProps)({...t,style:c})}},23:function(e,t,c){"use strict";var n=c(0),a=c(4),r=c.n(a);t.a=e=>{let t,{label:c,screenReaderLabel:a,wrapperElement:l,wrapperProps:s={}}=e;const o=null!=c,i=null!=a;return!o&&i?(t=l||"span",s={...s,className:r()(s.className,"screen-reader-text")},Object(n.createElement)(t,s,a)):(t=l||n.Fragment,o&&i&&c!==a?Object(n.createElement)(t,s,Object(n.createElement)("span",{"aria-hidden":"true"},c),Object(n.createElement)("span",{className:"screen-reader-text"},a)):Object(n.createElement)(t,s,c))}},272:function(e,t){},290:function(e,t,c){"use strict";c.r(t);var n=c(0),a=(c(8),c(1)),r=c(4),l=c.n(r),s=c(23),o=c(49),i=c(113),u=(c(272),c(134));t.default=Object(i.withProductDataContext)(e=>{const{className:t,align:c}=e,{parentClassName:r}=Object(o.useInnerBlockLayoutContext)(),{product:i}=Object(o.useProductDataContext)(),d=Object(u.a)(e),b=Object(u.b)(e),m=Object(u.d)(e),p=Object(u.c)(e);if(!i.id||!i.on_sale)return null;const g="string"==typeof c?"wc-block-components-product-sale-badge--align-"+c:"";return Object(n.createElement)("div",{className:l()("wc-block-components-product-sale-badge",t,g,{[r+"__product-onsale"]:r},b.className,d.className),style:{...b.style,...d.style,...m.style,...p.style}},Object(n.createElement)(s.a,{label:Object(a.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(a.__)("Product on sale","woo-gutenberg-products-block")}))})},316:function(e,t){},399:function(e,t,c){"use strict";c.r(t);var n=c(113),a=c(11),r=c.n(a),l=c(0),s=(c(8),c(1)),o=c(4),i=c.n(o),u=c(2),d=c(49),b=c(33),m=c(290),p=(c(316),c(134));const g=()=>Object(l.createElement)("img",{src:u.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),O=e=>{let{image:t,onLoad:c,loaded:n,showFullSize:a,fallbackAlt:s}=e;const{thumbnail:o,src:i,srcset:u,sizes:d,alt:b}=t||{},m={alt:b||s,onLoad:c,hidden:!n,src:o,...a&&{src:i,srcSet:u,sizes:d}};return Object(l.createElement)(l.Fragment,null,m.src&&Object(l.createElement)("img",r()({"data-testid":"product-image"},m)),!n&&Object(l.createElement)(g,null))};var j=Object(n.withProductDataContext)(e=>{const{className:t,imageSizing:c="full-size",showProductLink:n=!0,showSaleBadge:a,saleBadgeAlign:r="right"}=e,{parentClassName:o}=Object(d.useInnerBlockLayoutContext)(),{product:u}=Object(d.useProductDataContext)(),[j,f]=Object(l.useState)(!1),{dispatchStoreEvent:y}=Object(b.a)(),h=Object(p.d)(e),w=Object(p.a)(e);if(!u.id)return Object(l.createElement)("div",{className:i()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",{[o+"__product-image"]:o})},Object(l.createElement)(g,null));const _=!!u.images.length,k=_?u.images[0]:null,E=n?"a":l.Fragment,S=Object(s.sprintf)(
2
  /* translators: %s is referring to the product name */
3
+ Object(s.__)("Link to %s","woo-gutenberg-products-block"),u.name),N={href:u.permalink,rel:"nofollow",...!_&&{"aria-label":S},onClick:()=>{y("product-view-link",{product:u})}};return Object(l.createElement)("div",{className:i()(t,"wc-block-components-product-image",{[o+"__product-image"]:o},w.className),style:{...h.style,...w.style}},Object(l.createElement)(E,n&&N,!!a&&Object(l.createElement)(m.default,{align:r,product:u}),Object(l.createElement)(O,{fallbackAlt:u.name,image:k,onLoad:()=>f(!0),loaded:j,showFullSize:"cropped"!==c})))});t.default=Object(n.withFilteredAttributes)({showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}})(j)}}]);
build/atomic-block-components/image.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{253:function(e,t,a){"use strict";t.a={showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},254:function(e,t,a){"use strict";var c=a(5),l=a.n(c),n=a(0),o=(a(10),a(1)),r=a(4),i=a.n(r),s=a(2),u=a(29),d=a(54),m=a(60),b=a(195);a(303);const g=()=>Object(n.createElement)("img",{src:s.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),p=e=>{let{image:t,onLoad:a,loaded:c,showFullSize:o,fallbackAlt:r}=e;const{thumbnail:i,src:s,srcset:u,sizes:d,alt:m}=t||{},b={alt:m||r,onLoad:a,hidden:!c,src:i,...o&&{src:s,srcSet:u,sizes:d}};return Object(n.createElement)(n.Fragment,null,b.src&&Object(n.createElement)("img",l()({"data-testid":"product-image"},b)),!c&&Object(n.createElement)(g,null))};t.a=Object(d.withProductDataContext)(e=>{let{className:t,imageSizing:a="full-size",showProductLink:c=!0,showSaleBadge:l,saleBadgeAlign:r="right"}=e;const{parentClassName:s}=Object(u.useInnerBlockLayoutContext)(),{product:d}=Object(u.useProductDataContext)(),[w,h]=Object(n.useState)(!1),{dispatchStoreEvent:f}=Object(m.a)();if(!d.id)return Object(n.createElement)("div",{className:i()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",{[s+"__product-image"]:s})},Object(n.createElement)(g,null));const O=!!d.images.length,j=O?d.images[0]:null,k=c?"a":n.Fragment,E=Object(o.sprintf)(
2
  /* translators: %s is referring to the product name */
3
- Object(o.__)("Link to %s","woo-gutenberg-products-block"),d.name),S={href:d.permalink,rel:"nofollow",...!O&&{"aria-label":E},onClick:()=>{f("product-view-link",{product:d})}};return Object(n.createElement)("div",{className:i()(t,"wc-block-components-product-image",{[s+"__product-image"]:s})},Object(n.createElement)(k,c&&S,!!l&&Object(n.createElement)(b.default,{align:r,product:d}),Object(n.createElement)(p,{fallbackAlt:d.name,image:j,onLoad:()=>h(!0),loaded:w,showFullSize:"cropped"!==a})))})},303:function(e,t){},502:function(e,t,a){"use strict";a.r(t);var c=a(54),l=a(254),n=a(253);t.default=Object(c.withFilteredAttributes)(n.a)(l.a)}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{252:function(e,t,a){"use strict";t.a={showProductLink:{type:"boolean",default:!0},showSaleBadge:{type:"boolean",default:!0},saleBadgeAlign:{type:"string",default:"right"},imageSizing:{type:"string",default:"full-size"},productId:{type:"number",default:0}}},253:function(e,t,a){"use strict";var c=a(5),l=a.n(c),n=a(0),o=(a(10),a(1)),s=a(4),r=a.n(s),i=a(2),d=a(28),u=a(55),m=a(60),b=a(195),g=(a(303),a(51));const p=()=>Object(n.createElement)("img",{src:i.PLACEHOLDER_IMG_SRC,alt:"",width:500,height:500}),w=e=>{let{image:t,onLoad:a,loaded:c,showFullSize:o,fallbackAlt:s}=e;const{thumbnail:r,src:i,srcset:d,sizes:u,alt:m}=t||{},b={alt:m||s,onLoad:a,hidden:!c,src:r,...o&&{src:i,srcSet:d,sizes:u}};return Object(n.createElement)(n.Fragment,null,b.src&&Object(n.createElement)("img",l()({"data-testid":"product-image"},b)),!c&&Object(n.createElement)(p,null))};t.a=Object(u.withProductDataContext)(e=>{const{className:t,imageSizing:a="full-size",showProductLink:c=!0,showSaleBadge:l,saleBadgeAlign:s="right"}=e,{parentClassName:i}=Object(d.useInnerBlockLayoutContext)(),{product:u}=Object(d.useProductDataContext)(),[O,h]=Object(n.useState)(!1),{dispatchStoreEvent:j}=Object(m.a)(),f=Object(g.d)(e),k=Object(g.a)(e);if(!u.id)return Object(n.createElement)("div",{className:r()(t,"wc-block-components-product-image","wc-block-components-product-image--placeholder",{[i+"__product-image"]:i})},Object(n.createElement)(p,null));const E=!!u.images.length,S=E?u.images[0]:null,y=c?"a":n.Fragment,L=Object(o.sprintf)(
2
  /* translators: %s is referring to the product name */
3
+ Object(o.__)("Link to %s","woo-gutenberg-products-block"),u.name),z={href:u.permalink,rel:"nofollow",...!E&&{"aria-label":L},onClick:()=>{j("product-view-link",{product:u})}};return Object(n.createElement)("div",{className:r()(t,"wc-block-components-product-image",{[i+"__product-image"]:i},k.className),style:{...f.style,...k.style}},Object(n.createElement)(y,c&&z,!!l&&Object(n.createElement)(b.default,{align:s,product:u}),Object(n.createElement)(w,{fallbackAlt:u.name,image:S,onLoad:()=>h(!0),loaded:O,showFullSize:"cropped"!==a})))})},303:function(e,t){},520:function(e,t,a){"use strict";a.r(t);var c=a(55),l=a(253),n=a(252);t.default=Object(c.withFilteredAttributes)(n.a)(l.a)}}]);
build/atomic-block-components/price-frontend.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[11],{159:function(e,c){},243:function(e,c,r){"use strict";r.d(c,"a",(function(){return a})),r(163);var t=r(65);const a=()=>t.m>1},247:function(e,c,r){"use strict";var t=r(0),a=r(1),n=r(96),l=r(4),o=r.n(l),i=r(40);r(248);const s=e=>{let{currency:c,maxPrice:r,minPrice:l,priceClassName:s,priceStyle:u={}}=e;return Object(t.createElement)(t.Fragment,null,Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)(
2
  /* translators: %1$s min price, %2$s max price */
3
- Object(a.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(i.formatPrice)(l),Object(i.formatPrice)(r))),Object(t.createElement)("span",{"aria-hidden":!0},Object(t.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:c,value:l,style:u})," — ",Object(t.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:c,value:r,style:u})))},u=e=>{let{currency:c,regularPriceClassName:r,regularPriceStyle:l,regularPrice:i,priceClassName:s,priceStyle:u,price:m}=e;return Object(t.createElement)(t.Fragment,null,Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(t.createElement)(n.a,{currency:c,renderText:e=>Object(t.createElement)("del",{className:o()("wc-block-components-product-price__regular",r),style:l},e),value:i}),Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(t.createElement)(n.a,{currency:c,renderText:e=>Object(t.createElement)("ins",{className:o()("wc-block-components-product-price__value","is-discounted",s),style:u},e),value:m}))};c.a=e=>{let{align:c,className:r,currency:a,format:l="<price/>",maxPrice:i,minPrice:m,price:p,priceClassName:b,priceStyle:d,regularPrice:g,regularPriceClassName:j,regularPriceStyle:O}=e;const _=o()(r,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+c]:c});l.includes("<price/>")||(l="<price/>",console.error("Price formats need to include the `<price/>` tag."));const y=g&&p!==g;let N=Object(t.createElement)("span",{className:o()("wc-block-components-product-price__value",b)});return y?N=Object(t.createElement)(u,{currency:a,price:p,priceClassName:b,priceStyle:d,regularPrice:g,regularPriceClassName:j,regularPriceStyle:O}):void 0!==m&&void 0!==i?N=Object(t.createElement)(s,{currency:a,maxPrice:i,minPrice:m,priceClassName:b,priceStyle:d}):p&&(N=Object(t.createElement)(n.a,{className:o()("wc-block-components-product-price__value",b),currency:a,value:p,style:d})),Object(t.createElement)("span",{className:_},Object(t.createInterpolateElement)(l,{price:N}))}},248:function(e,c){},364:function(e,c,r){"use strict";r.r(c);var t=r(0),a=(r(8),r(4)),n=r.n(a),l=r(247),o=r(40),i=r(49),s=r(162),u=r(243),m=r(110);c.default=Object(m.withProductDataContext)(e=>{var c,r;let{className:a,align:m,fontSize:p,customFontSize:b,saleFontSize:d,customSaleFontSize:g,color:j,customColor:O,saleColor:_,customSaleColor:y}=e;const{parentClassName:N}=Object(i.useInnerBlockLayoutContext)(),{product:f}=Object(i.useProductDataContext)(),v=n()(a,{[N+"__product-price"]:N});if(!f.id)return Object(t.createElement)(l.a,{align:m,className:v});const P=Object(s.getColorClassName)("color",j),C=Object(s.getFontSizeClass)(p),S=Object(s.getColorClassName)("color",_),w=Object(s.getFontSizeClass)(d),x=n()({"has-text-color":j||O,"has-font-size":p||b,[P]:P,[C]:C}),E=n()({"has-text-color":_||y,"has-font-size":d||g,[S]:S,[w]:w}),k={color:O,fontSize:b},h={color:y,fontSize:g},z=f.prices,F=Object(o.getCurrencyFromPriceResponse)(z),D=z.price!==z.regular_price,T=D?n()({[N+"__product-price__value"]:N,[E]:Object(u.a)()}):n()({[N+"__product-price__value"]:N,[x]:Object(u.a)()}),B=D?h:k;return Object(t.createElement)(l.a,{align:m,className:v,currency:F,price:z.price,priceClassName:T,priceStyle:Object(u.a)()?B:{},minPrice:null==z||null===(c=z.price_range)||void 0===c?void 0:c.min_amount,maxPrice:null==z||null===(r=z.price_range)||void 0===r?void 0:r.max_amount,regularPrice:z.regular_price,regularPriceClassName:n()({[N+"__product-price__regular"]:N,[x]:Object(u.a)()}),regularPriceStyle:Object(u.a)()?k:{}})})},96:function(e,c,r){"use strict";var t=r(10),a=r.n(t),n=r(0),l=r(131),o=r(4),i=r.n(o);r(159);const s=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});c.a=e=>{let{className:c,value:r,currency:t,onValueChange:o,displayType:u="text",...m}=e;const p="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(p))return null;const b=p/10**t.minorUnit;if(!Number.isFinite(b))return null;const d=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",c),g={...m,...s(t),value:void 0,currency:void 0,onValueChange:void 0},j=o?e=>{const c=+e.value*10**t.minorUnit;o(c)}:()=>{};return Object(n.createElement)(l.a,a()({className:d,displayType:u},g,{value:b,onValueChange:j}))}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[11],{111:function(e,c,r){"use strict";r.d(c,"a",(function(){return a})),r(99);var t=r(50);const a=()=>t.m>1},165:function(e,c){},250:function(e,c,r){"use strict";var t=r(0),a=r(1),n=r(97),l=r(4),o=r.n(l),i=r(40);r(251);const s=e=>{let{currency:c,maxPrice:r,minPrice:l,priceClassName:s,priceStyle:u={}}=e;return Object(t.createElement)(t.Fragment,null,Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)(
2
  /* translators: %1$s min price, %2$s max price */
3
+ Object(a.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(i.formatPrice)(l),Object(i.formatPrice)(r))),Object(t.createElement)("span",{"aria-hidden":!0},Object(t.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:c,value:l,style:u})," — ",Object(t.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:c,value:r,style:u})))},u=e=>{let{currency:c,regularPriceClassName:r,regularPriceStyle:l,regularPrice:i,priceClassName:s,priceStyle:u,price:m}=e;return Object(t.createElement)(t.Fragment,null,Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(t.createElement)(n.a,{currency:c,renderText:e=>Object(t.createElement)("del",{className:o()("wc-block-components-product-price__regular",r),style:l},e),value:i}),Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(t.createElement)(n.a,{currency:c,renderText:e=>Object(t.createElement)("ins",{className:o()("wc-block-components-product-price__value","is-discounted",s),style:u},e),value:m}))};c.a=e=>{let{align:c,className:r,currency:a,format:l="<price/>",maxPrice:i,minPrice:m,price:p,priceClassName:b,priceStyle:d,regularPrice:g,regularPriceClassName:j,regularPriceStyle:O}=e;const _=o()(r,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+c]:c});l.includes("<price/>")||(l="<price/>",console.error("Price formats need to include the `<price/>` tag."));const y=g&&p!==g;let N=Object(t.createElement)("span",{className:o()("wc-block-components-product-price__value",b)});return y?N=Object(t.createElement)(u,{currency:a,price:p,priceClassName:b,priceStyle:d,regularPrice:g,regularPriceClassName:j,regularPriceStyle:O}):void 0!==m&&void 0!==i?N=Object(t.createElement)(s,{currency:a,maxPrice:i,minPrice:m,priceClassName:b,priceStyle:d}):p&&(N=Object(t.createElement)(n.a,{className:o()("wc-block-components-product-price__value",b),currency:a,value:p,style:d})),Object(t.createElement)("span",{className:_},Object(t.createInterpolateElement)(l,{price:N}))}},251:function(e,c){},366:function(e,c,r){"use strict";r.r(c);var t=r(0),a=(r(8),r(4)),n=r.n(a),l=r(250),o=r(40),i=r(49),s=r(68),u=r(111),m=r(113);c.default=Object(m.withProductDataContext)(e=>{var c,r;let{className:a,align:m,fontSize:p,customFontSize:b,saleFontSize:d,customSaleFontSize:g,color:j,customColor:O,saleColor:_,customSaleColor:y}=e;const{parentClassName:N}=Object(i.useInnerBlockLayoutContext)(),{product:f}=Object(i.useProductDataContext)(),v=n()(a,{[N+"__product-price"]:N});if(!f.id)return Object(t.createElement)(l.a,{align:m,className:v});const P=Object(s.getColorClassName)("color",j),C=Object(s.getFontSizeClass)(p),S=Object(s.getColorClassName)("color",_),w=Object(s.getFontSizeClass)(d),x=n()({"has-text-color":j||O,"has-font-size":p||b,[P]:P,[C]:C}),E=n()({"has-text-color":_||y,"has-font-size":d||g,[S]:S,[w]:w}),k={color:O,fontSize:b},h={color:y,fontSize:g},z=f.prices,F=Object(o.getCurrencyFromPriceResponse)(z),D=z.price!==z.regular_price,T=D?n()({[N+"__product-price__value"]:N,[E]:Object(u.a)()}):n()({[N+"__product-price__value"]:N,[x]:Object(u.a)()}),B=D?h:k;return Object(t.createElement)(l.a,{align:m,className:v,currency:F,price:z.price,priceClassName:T,priceStyle:Object(u.a)()?B:{},minPrice:null==z||null===(c=z.price_range)||void 0===c?void 0:c.min_amount,maxPrice:null==z||null===(r=z.price_range)||void 0===r?void 0:r.max_amount,regularPrice:z.regular_price,regularPriceClassName:n()({[N+"__product-price__regular"]:N,[x]:Object(u.a)()}),regularPriceStyle:Object(u.a)()?k:{}})})},97:function(e,c,r){"use strict";var t=r(11),a=r.n(t),n=r(0),l=r(135),o=r(4),i=r.n(o);r(165);const s=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});c.a=e=>{let{className:c,value:r,currency:t,onValueChange:o,displayType:u="text",...m}=e;const p="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(p))return null;const b=p/10**t.minorUnit;if(!Number.isFinite(b))return null;const d=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",c),g={...m,...s(t),value:void 0,currency:void 0,onValueChange:void 0},j=o?e=>{const c=+e.value*10**t.minorUnit;o(c)}:()=>{};return Object(n.createElement)(l.a,a()({className:d,displayType:u},g,{value:b,onValueChange:j}))}}}]);
build/atomic-block-components/price.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{106:function(e,c,r){"use strict";var t=r(0),a=r(1),n=r(41),l=r(4),o=r.n(l),i=r(35);r(158);const s=e=>{let{currency:c,maxPrice:r,minPrice:l,priceClassName:s,priceStyle:u={}}=e;return Object(t.createElement)(t.Fragment,null,Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)(
2
  /* translators: %1$s min price, %2$s max price */
3
- Object(a.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(i.formatPrice)(l),Object(i.formatPrice)(r))),Object(t.createElement)("span",{"aria-hidden":!0},Object(t.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:c,value:l,style:u})," — ",Object(t.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:c,value:r,style:u})))},u=e=>{let{currency:c,regularPriceClassName:r,regularPriceStyle:l,regularPrice:i,priceClassName:s,priceStyle:u,price:m}=e;return Object(t.createElement)(t.Fragment,null,Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(t.createElement)(n.a,{currency:c,renderText:e=>Object(t.createElement)("del",{className:o()("wc-block-components-product-price__regular",r),style:l},e),value:i}),Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(t.createElement)(n.a,{currency:c,renderText:e=>Object(t.createElement)("ins",{className:o()("wc-block-components-product-price__value","is-discounted",s),style:u},e),value:m}))};c.a=e=>{let{align:c,className:r,currency:a,format:l="<price/>",maxPrice:i,minPrice:m,price:p,priceClassName:b,priceStyle:d,regularPrice:g,regularPriceClassName:j,regularPriceStyle:O}=e;const _=o()(r,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+c]:c});l.includes("<price/>")||(l="<price/>",console.error("Price formats need to include the `<price/>` tag."));const y=g&&p!==g;let N=Object(t.createElement)("span",{className:o()("wc-block-components-product-price__value",b)});return y?N=Object(t.createElement)(u,{currency:a,price:p,priceClassName:b,priceStyle:d,regularPrice:g,regularPriceClassName:j,regularPriceStyle:O}):void 0!==m&&void 0!==i?N=Object(t.createElement)(s,{currency:a,maxPrice:i,minPrice:m,priceClassName:b,priceStyle:d}):p&&(N=Object(t.createElement)(n.a,{className:o()("wc-block-components-product-price__value",b),currency:a,value:p,style:d})),Object(t.createElement)("span",{className:_},Object(t.createInterpolateElement)(l,{price:N}))}},140:function(e,c){},158:function(e,c){},263:function(e,c,r){"use strict";r.r(c);var t=r(0),a=(r(10),r(4)),n=r.n(a),l=r(106),o=r(35),i=r(29),s=r(7),u=r(65),m=r(54);c.default=Object(m.withProductDataContext)(e=>{var c,r;let{className:a,align:m,fontSize:p,customFontSize:b,saleFontSize:d,customSaleFontSize:g,color:j,customColor:O,saleColor:_,customSaleColor:y}=e;const{parentClassName:N}=Object(i.useInnerBlockLayoutContext)(),{product:v}=Object(i.useProductDataContext)(),f=n()(a,{[N+"__product-price"]:N});if(!v.id)return Object(t.createElement)(l.a,{align:m,className:f});const P=Object(s.getColorClassName)("color",j),C=Object(s.getFontSizeClass)(p),S=Object(s.getColorClassName)("color",_),w=Object(s.getFontSizeClass)(d),x=n()({"has-text-color":j||O,"has-font-size":p||b,[P]:P,[C]:C}),E=n()({"has-text-color":_||y,"has-font-size":d||g,[S]:S,[w]:w}),k={color:O,fontSize:b},h={color:y,fontSize:g},z=v.prices,F=Object(o.getCurrencyFromPriceResponse)(z),D=z.price!==z.regular_price,T=D?n()({[N+"__product-price__value"]:N,[E]:Object(u.b)()}):n()({[N+"__product-price__value"]:N,[x]:Object(u.b)()}),B=D?h:k;return Object(t.createElement)(l.a,{align:m,className:f,currency:F,price:z.price,priceClassName:T,priceStyle:Object(u.b)()?B:{},minPrice:null==z||null===(c=z.price_range)||void 0===c?void 0:c.min_amount,maxPrice:null==z||null===(r=z.price_range)||void 0===r?void 0:r.max_amount,regularPrice:z.regular_price,regularPriceClassName:n()({[N+"__product-price__regular"]:N,[x]:Object(u.b)()}),regularPriceStyle:Object(u.b)()?k:{}})})},41:function(e,c,r){"use strict";var t=r(5),a=r.n(t),n=r(0),l=r(134),o=r(4),i=r.n(o);r(140);const s=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});c.a=e=>{let{className:c,value:r,currency:t,onValueChange:o,displayType:u="text",...m}=e;const p="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(p))return null;const b=p/10**t.minorUnit;if(!Number.isFinite(b))return null;const d=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",c),g={...m,...s(t),value:void 0,currency:void 0,onValueChange:void 0},j=o?e=>{const c=+e.value*10**t.minorUnit;o(c)}:()=>{};return Object(n.createElement)(l.a,a()({className:d,displayType:u},g,{value:b,onValueChange:j}))}}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{107:function(e,c,r){"use strict";var t=r(0),a=r(1),n=r(40),l=r(4),o=r.n(l),i=r(34);r(157);const s=e=>{let{currency:c,maxPrice:r,minPrice:l,priceClassName:s,priceStyle:u={}}=e;return Object(t.createElement)(t.Fragment,null,Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.sprintf)(
2
  /* translators: %1$s min price, %2$s max price */
3
+ Object(a.__)("Price between %1$s and %2$s","woo-gutenberg-products-block"),Object(i.formatPrice)(l),Object(i.formatPrice)(r))),Object(t.createElement)("span",{"aria-hidden":!0},Object(t.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:c,value:l,style:u})," — ",Object(t.createElement)(n.a,{className:o()("wc-block-components-product-price__value",s),currency:c,value:r,style:u})))},u=e=>{let{currency:c,regularPriceClassName:r,regularPriceStyle:l,regularPrice:i,priceClassName:s,priceStyle:u,price:m}=e;return Object(t.createElement)(t.Fragment,null,Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Previous price:","woo-gutenberg-products-block")),Object(t.createElement)(n.a,{currency:c,renderText:e=>Object(t.createElement)("del",{className:o()("wc-block-components-product-price__regular",r),style:l},e),value:i}),Object(t.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:","woo-gutenberg-products-block")),Object(t.createElement)(n.a,{currency:c,renderText:e=>Object(t.createElement)("ins",{className:o()("wc-block-components-product-price__value","is-discounted",s),style:u},e),value:m}))};c.a=e=>{let{align:c,className:r,currency:a,format:l="<price/>",maxPrice:i,minPrice:m,price:p,priceClassName:b,priceStyle:d,regularPrice:g,regularPriceClassName:j,regularPriceStyle:O}=e;const _=o()(r,"price","wc-block-components-product-price",{["wc-block-components-product-price--align-"+c]:c});l.includes("<price/>")||(l="<price/>",console.error("Price formats need to include the `<price/>` tag."));const y=g&&p!==g;let N=Object(t.createElement)("span",{className:o()("wc-block-components-product-price__value",b)});return y?N=Object(t.createElement)(u,{currency:a,price:p,priceClassName:b,priceStyle:d,regularPrice:g,regularPriceClassName:j,regularPriceStyle:O}):void 0!==m&&void 0!==i?N=Object(t.createElement)(s,{currency:a,maxPrice:i,minPrice:m,priceClassName:b,priceStyle:d}):p&&(N=Object(t.createElement)(n.a,{className:o()("wc-block-components-product-price__value",b),currency:a,value:p,style:d})),Object(t.createElement)("span",{className:_},Object(t.createInterpolateElement)(l,{price:N}))}},137:function(e,c){},157:function(e,c){},262:function(e,c,r){"use strict";r.r(c);var t=r(0),a=(r(10),r(4)),n=r.n(a),l=r(107),o=r(34),i=r(28),s=r(7),u=r(50),m=r(55);c.default=Object(m.withProductDataContext)(e=>{var c,r;let{className:a,align:m,fontSize:p,customFontSize:b,saleFontSize:d,customSaleFontSize:g,color:j,customColor:O,saleColor:_,customSaleColor:y}=e;const{parentClassName:N}=Object(i.useInnerBlockLayoutContext)(),{product:v}=Object(i.useProductDataContext)(),f=n()(a,{[N+"__product-price"]:N});if(!v.id)return Object(t.createElement)(l.a,{align:m,className:f});const P=Object(s.getColorClassName)("color",j),C=Object(s.getFontSizeClass)(p),S=Object(s.getColorClassName)("color",_),w=Object(s.getFontSizeClass)(d),x=n()({"has-text-color":j||O,"has-font-size":p||b,[P]:P,[C]:C}),E=n()({"has-text-color":_||y,"has-font-size":d||g,[S]:S,[w]:w}),k={color:O,fontSize:b},h={color:y,fontSize:g},z=v.prices,F=Object(o.getCurrencyFromPriceResponse)(z),D=z.price!==z.regular_price,T=D?n()({[N+"__product-price__value"]:N,[E]:Object(u.b)()}):n()({[N+"__product-price__value"]:N,[x]:Object(u.b)()}),B=D?h:k;return Object(t.createElement)(l.a,{align:m,className:f,currency:F,price:z.price,priceClassName:T,priceStyle:Object(u.b)()?B:{},minPrice:null==z||null===(c=z.price_range)||void 0===c?void 0:c.min_amount,maxPrice:null==z||null===(r=z.price_range)||void 0===r?void 0:r.max_amount,regularPrice:z.regular_price,regularPriceClassName:n()({[N+"__product-price__regular"]:N,[x]:Object(u.b)()}),regularPriceStyle:Object(u.b)()?k:{}})})},40:function(e,c,r){"use strict";var t=r(5),a=r.n(t),n=r(0),l=r(131),o=r(4),i=r.n(o);r(137);const s=e=>({thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0});c.a=e=>{let{className:c,value:r,currency:t,onValueChange:o,displayType:u="text",...m}=e;const p="string"==typeof r?parseInt(r,10):r;if(!Number.isFinite(p))return null;const b=p/10**t.minorUnit;if(!Number.isFinite(b))return null;const d=i()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",c),g={...m,...s(t),value:void 0,currency:void 0,onValueChange:void 0},j=o?e=>{const c=+e.value*10**t.minorUnit;o(c)}:()=>{};return Object(n.createElement)(l.a,a()({className:d,displayType:u},g,{value:b,onValueChange:j}))}}}]);
build/atomic-block-components/rating-frontend.js CHANGED
@@ -1,4 +1,4 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{316:function(t,e){},365:function(t,e,n){"use strict";n.r(e);var s=n(0),r=(n(8),n(1)),c=n(4),o=n.n(c),a=n(49),u=n(110);n(316);e.default=Object(u.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:n}=Object(a.useInnerBlockLayoutContext)(),{product:c}=Object(a.useProductDataContext)(),u=(t=>{const e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0})(c);if(!u)return null;const i={width:u/5*100+"%"},l=Object(r.sprintf)(
2
  /* translators: %f is referring to the average rating value */
3
  Object(r.__)("Rated %f out of 5","woo-gutenberg-products-block"),u),b=(t=>{const e=parseInt(t.review_count,10);return Number.isFinite(e)&&e>0?e:0})(c),p={__html:Object(r.sprintf)(
4
  /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[12],{318:function(t,e){},367:function(t,e,n){"use strict";n.r(e);var s=n(0),r=(n(8),n(1)),c=n(4),o=n.n(c),a=n(49),u=n(113);n(318);e.default=Object(u.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:n}=Object(a.useInnerBlockLayoutContext)(),{product:c}=Object(a.useProductDataContext)(),u=(t=>{const e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0})(c);if(!u)return null;const i={width:u/5*100+"%"},l=Object(r.sprintf)(
2
  /* translators: %f is referring to the average rating value */
3
  Object(r.__)("Rated %f out of 5","woo-gutenberg-products-block"),u),b=(t=>{const e=parseInt(t.review_count,10);return Number.isFinite(e)&&e>0?e:0})(c),p={__html:Object(r.sprintf)(
4
  /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
build/atomic-block-components/rating.js CHANGED
@@ -1,4 +1,4 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[14],{264:function(t,e,n){"use strict";n.r(e);var s=n(0),r=(n(10),n(1)),c=n(4),o=n.n(c),a=n(29),u=n(54);n(304);e.default=Object(u.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:n}=Object(a.useInnerBlockLayoutContext)(),{product:c}=Object(a.useProductDataContext)(),u=(t=>{const e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0})(c);if(!u)return null;const i={width:u/5*100+"%"},l=Object(r.sprintf)(
2
  /* translators: %f is referring to the average rating value */
3
  Object(r.__)("Rated %f out of 5","woo-gutenberg-products-block"),u),b=(t=>{const e=parseInt(t.review_count,10);return Number.isFinite(e)&&e>0?e:0})(c),p={__html:Object(r.sprintf)(
4
  /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[14],{263:function(t,e,n){"use strict";n.r(e);var s=n(0),r=(n(10),n(1)),c=n(4),o=n.n(c),a=n(28),u=n(55);n(304);e.default=Object(u.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:n}=Object(a.useInnerBlockLayoutContext)(),{product:c}=Object(a.useProductDataContext)(),u=(t=>{const e=parseFloat(t.average_rating);return Number.isFinite(e)&&e>0?e:0})(c);if(!u)return null;const i={width:u/5*100+"%"},l=Object(r.sprintf)(
2
  /* translators: %f is referring to the average rating value */
3
  Object(r.__)("Rated %f out of 5","woo-gutenberg-products-block"),u),b=(t=>{const e=parseInt(t.review_count,10);return Number.isFinite(e)&&e>0?e:0})(c),p={__html:Object(r.sprintf)(
4
  /* translators: %1$s is referring to the average rating value, %2$s is referring to the number of ratings */
build/atomic-block-components/sale-badge-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{21:function(e,t,c){"use strict";var a=c(0),n=c(4),r=c.n(n);t.a=e=>{let t,{label:c,screenReaderLabel:n,wrapperElement:l,wrapperProps:s={}}=e;const o=null!=c,u=null!=n;return!o&&u?(t=l||"span",s={...s,className:r()(s.className,"screen-reader-text")},Object(a.createElement)(t,s,n)):(t=l||a.Fragment,o&&u&&c!==n?Object(a.createElement)(t,s,Object(a.createElement)("span",{"aria-hidden":"true"},c),Object(a.createElement)("span",{className:"screen-reader-text"},n)):Object(a.createElement)(t,s,c))}},270:function(e,t){},288:function(e,t,c){"use strict";c.r(t);var a=c(0),n=(c(8),c(1)),r=c(4),l=c.n(r),s=c(21),o=c(49),u=c(110);c(270),t.default=Object(u.withProductDataContext)(e=>{let{className:t,align:c}=e;const{parentClassName:r}=Object(o.useInnerBlockLayoutContext)(),{product:u}=Object(o.useProductDataContext)();if(!u.id||!u.on_sale)return null;const b="string"==typeof c?"wc-block-components-product-sale-badge--align-"+c:"";return Object(a.createElement)("div",{className:l()("wc-block-components-product-sale-badge",t,b,{[r+"__product-onsale"]:r})},Object(a.createElement)(s.a,{label:Object(n.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(n.__)("Product on sale","woo-gutenberg-products-block")}))})}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[13],{111:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n(99);var c=n(50);const r=()=>c.m>1},134:function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return o})),n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return i}));var c=n(68),r=n(111),s=n(18);const a=e=>Object(s.e)(e)?JSON.parse(e)||{}:Object(s.d)(e)?e:{},l=e=>{if(!Object(r.a)()||"function"!=typeof c.__experimentalGetSpacingClassesAndStyles)return{style:{}};const t=Object(s.d)(e)?e:{},n=a(t.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...t,style:n})},o=e=>{const t=Object(s.d)(e)?e:{},n=a(t.style),c=Object(s.d)(n.typography)?n.typography:{};return{style:{fontSize:t.fontSize||c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,textTransform:c.textTransform,fontFamily:t.fontFamily}}},u=e=>{if(!Object(r.a)())return{className:"",style:{}};const t=Object(s.d)(e)?e:{},n=a(t.style);return Object(c.__experimentalUseColorProps)({...t,style:n})},i=e=>{if(!Object(r.a)())return{className:"",style:{}};const t=Object(s.d)(e)?e:{},n=a(t.style);return Object(c.__experimentalUseBorderProps)({...t,style:n})}},23:function(e,t,n){"use strict";var c=n(0),r=n(4),s=n.n(r);t.a=e=>{let t,{label:n,screenReaderLabel:r,wrapperElement:a,wrapperProps:l={}}=e;const o=null!=n,u=null!=r;return!o&&u?(t=a||"span",l={...l,className:s()(l.className,"screen-reader-text")},Object(c.createElement)(t,l,r)):(t=a||c.Fragment,o&&u&&n!==r?Object(c.createElement)(t,l,Object(c.createElement)("span",{"aria-hidden":"true"},n),Object(c.createElement)("span",{className:"screen-reader-text"},r)):Object(c.createElement)(t,l,n))}},272:function(e,t){},290:function(e,t,n){"use strict";n.r(t);var c=n(0),r=(n(8),n(1)),s=n(4),a=n.n(s),l=n(23),o=n(49),u=n(113),i=(n(272),n(134));t.default=Object(u.withProductDataContext)(e=>{const{className:t,align:n}=e,{parentClassName:s}=Object(o.useInnerBlockLayoutContext)(),{product:u}=Object(o.useProductDataContext)(),b=Object(i.a)(e),d=Object(i.b)(e),p=Object(i.d)(e),m=Object(i.c)(e);if(!u.id||!u.on_sale)return null;const O="string"==typeof n?"wc-block-components-product-sale-badge--align-"+n:"";return Object(c.createElement)("div",{className:a()("wc-block-components-product-sale-badge",t,O,{[s+"__product-onsale"]:s},d.className,b.className),style:{...d.style,...b.style,...p.style,...m.style}},Object(c.createElement)(l.a,{label:Object(r.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(r.__)("Product on sale","woo-gutenberg-products-block")}))})}}]);
build/atomic-block-components/sale-badge.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[5],{195:function(e,t,c){"use strict";c.r(t);var a=c(0),n=(c(10),c(1)),r=c(4),l=c.n(r),s=c(30),o=c(29),u=c(54);c(302),t.default=Object(u.withProductDataContext)(e=>{let{className:t,align:c}=e;const{parentClassName:r}=Object(o.useInnerBlockLayoutContext)(),{product:u}=Object(o.useProductDataContext)();if(!u.id||!u.on_sale)return null;const b="string"==typeof c?"wc-block-components-product-sale-badge--align-"+c:"";return Object(a.createElement)("div",{className:l()("wc-block-components-product-sale-badge",t,b,{[r+"__product-onsale"]:r})},Object(a.createElement)(s.a,{label:Object(n.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(n.__)("Product on sale","woo-gutenberg-products-block")}))})},30:function(e,t,c){"use strict";var a=c(0),n=c(4),r=c.n(n);t.a=e=>{let t,{label:c,screenReaderLabel:n,wrapperElement:l,wrapperProps:s={}}=e;const o=null!=c,u=null!=n;return!o&&u?(t=l||"span",s={...s,className:r()(s.className,"screen-reader-text")},Object(a.createElement)(t,s,n)):(t=l||a.Fragment,o&&u&&c!==n?Object(a.createElement)(t,s,Object(a.createElement)("span",{"aria-hidden":"true"},c),Object(a.createElement)("span",{className:"screen-reader-text"},n)):Object(a.createElement)(t,s,c))}},302:function(e,t){}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[5],{195:function(e,t,c){"use strict";c.r(t);var a=c(0),n=(c(10),c(1)),s=c(4),l=c.n(s),r=c(29),o=c(28),b=c(55),u=(c(302),c(51));t.default=Object(b.withProductDataContext)(e=>{const{className:t,align:c}=e,{parentClassName:s}=Object(o.useInnerBlockLayoutContext)(),{product:b}=Object(o.useProductDataContext)(),d=Object(u.a)(e),p=Object(u.b)(e),m=Object(u.d)(e),i=Object(u.c)(e);if(!b.id||!b.on_sale)return null;const j="string"==typeof c?"wc-block-components-product-sale-badge--align-"+c:"";return Object(a.createElement)("div",{className:l()("wc-block-components-product-sale-badge",t,j,{[s+"__product-onsale"]:s},p.className,d.className),style:{...p.style,...d.style,...m.style,...i.style}},Object(a.createElement)(r.a,{label:Object(n.__)("Sale","woo-gutenberg-products-block"),screenReaderLabel:Object(n.__)("Product on sale","woo-gutenberg-products-block")}))})},29:function(e,t,c){"use strict";var a=c(0),n=c(4),s=c.n(n);t.a=e=>{let t,{label:c,screenReaderLabel:n,wrapperElement:l,wrapperProps:r={}}=e;const o=null!=c,b=null!=n;return!o&&b?(t=l||"span",r={...r,className:s()(r.className,"screen-reader-text")},Object(a.createElement)(t,r,n)):(t=l||a.Fragment,o&&b&&c!==n?Object(a.createElement)(t,r,Object(a.createElement)("span",{"aria-hidden":"true"},c),Object(a.createElement)("span",{className:"screen-reader-text"},n)):Object(a.createElement)(t,r,c))}},302:function(e,t){}}]);
build/atomic-block-components/sku-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[14],{320:function(t,e){},368:function(t,e,c){"use strict";c.r(e);var o=c(0),n=c(1),s=(c(8),c(4)),u=c.n(s),a=c(49),r=c(110);c(320),e.default=Object(r.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:c}=Object(a.useInnerBlockLayoutContext)(),{product:s}=Object(a.useProductDataContext)(),r=s.sku;return r?Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(n.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,r)):null})}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[14],{322:function(t,e){},370:function(t,e,c){"use strict";c.r(e);var o=c(0),n=c(1),s=(c(8),c(4)),u=c.n(s),a=c(49),r=c(113);c(322),e.default=Object(r.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:c}=Object(a.useInnerBlockLayoutContext)(),{product:s}=Object(a.useProductDataContext)(),r=s.sku;return r?Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(n.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,r)):null})}}]);
build/atomic-block-components/sku.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{267:function(t,e,c){"use strict";c.r(e);var o=c(0),n=c(1),s=(c(10),c(4)),u=c.n(s),a=c(29),r=c(54);c(307),e.default=Object(r.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:c}=Object(a.useInnerBlockLayoutContext)(),{product:s}=Object(a.useProductDataContext)(),r=s.sku;return r?Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(n.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,r)):null})},307:function(t,e){}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{266:function(t,e,c){"use strict";c.r(e);var o=c(0),n=c(1),s=(c(10),c(4)),u=c.n(s),a=c(28),r=c(55);c(307),e.default=Object(r.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:c}=Object(a.useInnerBlockLayoutContext)(),{product:s}=Object(a.useProductDataContext)(),r=s.sku;return r?Object(o.createElement)("div",{className:u()(e,"wc-block-components-product-sku",{[c+"__product-sku"]:c})},Object(n.__)("SKU:","woo-gutenberg-products-block")," ",Object(o.createElement)("strong",null,r)):null})},307:function(t,e){}}]);
build/atomic-block-components/stock-indicator--atomic-block-components/summary--atomic-block-components/title.js DELETED
@@ -1 +0,0 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[3],{113:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return b}));var s=n(7),c=n(65),r=n(62),o=n(194);const i=t=>Object(r.c)(t)?JSON.parse(t)||{}:Object(r.b)(t)?t:{},a=t=>{if(!Object(c.b)()||!Object(o.a)())return{style:{}};const e=Object(r.b)(t)?t:{},n=i(e.style);return Object(s.__experimentalGetSpacingClassesAndStyles)({...e,style:n})},l=t=>{const e=Object(r.b)(t)?t:{},n=i(e.style),s=Object(r.b)(n.typography)?n.typography:{};return{style:{fontSize:e.fontSize||s.fontSize,lineHeight:s.lineHeight,fontWeight:s.fontWeight,textTransform:s.textTransform,fontFamily:e.fontFamily}}},b=t=>{if(!Object(c.b)())return{className:"",style:{}};const e=Object(r.b)(t)?t:{},n=i(e.style);return Object(s.__experimentalUseColorProps)({...e,style:n})}},194:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var s=n(7);const c=()=>"function"==typeof s.__experimentalGetSpacingClassesAndStyles}}]);
 
build/atomic-block-components/stock-indicator-frontend.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{243:function(t,c,e){"use strict";e.d(c,"a",(function(){return n})),e(163);var o=e(65);const n=()=>o.m>1},260:function(t,c,e){"use strict";e.d(c,"b",(function(){return a})),e.d(c,"c",(function(){return i})),e.d(c,"a",(function(){return l}));var o=e(162),n=e(243),s=e(35);const r=t=>Object(s.d)(t)?JSON.parse(t)||{}:Object(s.c)(t)?t:{},a=t=>{if(!Object(n.a)()||"function"!=typeof o.__experimentalGetSpacingClassesAndStyles)return{style:{}};const c=Object(s.c)(t)?t:{},e=r(c.style);return Object(o.__experimentalGetSpacingClassesAndStyles)({...c,style:e})},i=t=>{const c=Object(s.c)(t)?t:{},e=r(c.style),o=Object(s.c)(e.typography)?e.typography:{};return{style:{fontSize:c.fontSize||o.fontSize,lineHeight:o.lineHeight,fontWeight:o.fontWeight,textTransform:o.textTransform,fontFamily:c.fontFamily}}},l=t=>{if(!Object(n.a)())return{className:"",style:{}};const c=Object(s.c)(t)?t:{},e=r(c.style);return Object(o.__experimentalUseColorProps)({...c,style:e})}},323:function(t,c){},371:function(t,c,e){"use strict";e.r(c);var o=e(0),n=e(1),s=(e(8),e(4)),r=e.n(s),a=e(49),i=e(110),l=(e(323),e(260));c.default=Object(i.withProductDataContext)(t=>{const{className:c}=t,{parentClassName:e}=Object(a.useInnerBlockLayoutContext)(),{product:s}=Object(a.useProductDataContext)(),i=Object(l.a)(t),u=Object(l.c)(t);if(!s.id||!s.is_purchasable)return null;const b=!!s.is_in_stock,p=s.low_stock_remaining,d=s.is_on_backorder;return Object(o.createElement)("div",{className:r()(c,i.className,"wc-block-components-product-stock-indicator",{[e+"__stock-indicator"]:e,"wc-block-components-product-stock-indicator--in-stock":b,"wc-block-components-product-stock-indicator--out-of-stock":!b,"wc-block-components-product-stock-indicator--low-stock":!!p,"wc-block-components-product-stock-indicator--available-on-backorder":!!d}),style:{...i.style,...u.style}},p?(t=>Object(n.sprintf)(
2
  /* translators: %d stock amount (number of items in stock for product) */
3
- Object(n.__)("%d left in stock","woo-gutenberg-products-block"),t))(p):((t,c)=>c?Object(n.__)("Available on backorder","woo-gutenberg-products-block"):t?Object(n.__)("In Stock","woo-gutenberg-products-block"):Object(n.__)("Out of Stock","woo-gutenberg-products-block"))(b,d))})}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[15],{111:function(t,e,c){"use strict";c.d(e,"a",(function(){return n})),c(99);var o=c(50);const n=()=>o.m>1},134:function(t,e,c){"use strict";c.d(e,"c",(function(){return a})),c.d(e,"d",(function(){return i})),c.d(e,"b",(function(){return l})),c.d(e,"a",(function(){return u}));var o=c(68),n=c(111),s=c(18);const r=t=>Object(s.e)(t)?JSON.parse(t)||{}:Object(s.d)(t)?t:{},a=t=>{if(!Object(n.a)()||"function"!=typeof o.__experimentalGetSpacingClassesAndStyles)return{style:{}};const e=Object(s.d)(t)?t:{},c=r(e.style);return Object(o.__experimentalGetSpacingClassesAndStyles)({...e,style:c})},i=t=>{const e=Object(s.d)(t)?t:{},c=r(e.style),o=Object(s.d)(c.typography)?c.typography:{};return{style:{fontSize:e.fontSize||o.fontSize,lineHeight:o.lineHeight,fontWeight:o.fontWeight,textTransform:o.textTransform,fontFamily:e.fontFamily}}},l=t=>{if(!Object(n.a)())return{className:"",style:{}};const e=Object(s.d)(t)?t:{},c=r(e.style);return Object(o.__experimentalUseColorProps)({...e,style:c})},u=t=>{if(!Object(n.a)())return{className:"",style:{}};const e=Object(s.d)(t)?t:{},c=r(e.style);return Object(o.__experimentalUseBorderProps)({...e,style:c})}},325:function(t,e){},373:function(t,e,c){"use strict";c.r(e);var o=c(0),n=c(1),s=(c(8),c(4)),r=c.n(s),a=c(49),i=c(113),l=(c(325),c(134));e.default=Object(i.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:c}=Object(a.useInnerBlockLayoutContext)(),{product:s}=Object(a.useProductDataContext)(),i=Object(l.b)(t),u=Object(l.d)(t);if(!s.id||!s.is_purchasable)return null;const b=!!s.is_in_stock,d=s.low_stock_remaining,p=s.is_on_backorder;return Object(o.createElement)("div",{className:r()(e,i.className,"wc-block-components-product-stock-indicator",{[c+"__stock-indicator"]:c,"wc-block-components-product-stock-indicator--in-stock":b,"wc-block-components-product-stock-indicator--out-of-stock":!b,"wc-block-components-product-stock-indicator--low-stock":!!d,"wc-block-components-product-stock-indicator--available-on-backorder":!!p}),style:{...i.style,...u.style}},d?(t=>Object(n.sprintf)(
2
  /* translators: %d stock amount (number of items in stock for product) */
3
+ Object(n.__)("%d left in stock","woo-gutenberg-products-block"),t))(d):((t,e)=>e?Object(n.__)("Available on backorder","woo-gutenberg-products-block"):t?Object(n.__)("In Stock","woo-gutenberg-products-block"):Object(n.__)("Out of Stock","woo-gutenberg-products-block"))(b,p))})}}]);
build/atomic-block-components/stock-indicator.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{270:function(o,c,t){"use strict";t.r(c);var e=t(0),n=t(1),s=(t(10),t(4)),r=t.n(s),a=t(29),b=t(54),i=(t(310),t(113));c.default=Object(b.withProductDataContext)(o=>{const{className:c}=o,{parentClassName:t}=Object(a.useInnerBlockLayoutContext)(),{product:s}=Object(a.useProductDataContext)(),b=Object(i.a)(o),k=Object(i.c)(o);if(!s.id||!s.is_purchasable)return null;const l=!!s.is_in_stock,u=s.low_stock_remaining,d=s.is_on_backorder;return Object(e.createElement)("div",{className:r()(c,b.className,"wc-block-components-product-stock-indicator",{[t+"__stock-indicator"]:t,"wc-block-components-product-stock-indicator--in-stock":l,"wc-block-components-product-stock-indicator--out-of-stock":!l,"wc-block-components-product-stock-indicator--low-stock":!!u,"wc-block-components-product-stock-indicator--available-on-backorder":!!d}),style:{...b.style,...k.style}},u?(o=>Object(n.sprintf)(
2
  /* translators: %d stock amount (number of items in stock for product) */
3
  Object(n.__)("%d left in stock","woo-gutenberg-products-block"),o))(u):((o,c)=>c?Object(n.__)("Available on backorder","woo-gutenberg-products-block"):o?Object(n.__)("In Stock","woo-gutenberg-products-block"):Object(n.__)("Out of Stock","woo-gutenberg-products-block"))(l,d))})},310:function(o,c){}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{269:function(o,c,t){"use strict";t.r(c);var e=t(0),n=t(1),s=(t(10),t(4)),r=t.n(s),a=t(28),b=t(55),i=(t(310),t(51));c.default=Object(b.withProductDataContext)(o=>{const{className:c}=o,{parentClassName:t}=Object(a.useInnerBlockLayoutContext)(),{product:s}=Object(a.useProductDataContext)(),b=Object(i.b)(o),k=Object(i.d)(o);if(!s.id||!s.is_purchasable)return null;const l=!!s.is_in_stock,u=s.low_stock_remaining,d=s.is_on_backorder;return Object(e.createElement)("div",{className:r()(c,b.className,"wc-block-components-product-stock-indicator",{[t+"__stock-indicator"]:t,"wc-block-components-product-stock-indicator--in-stock":l,"wc-block-components-product-stock-indicator--out-of-stock":!l,"wc-block-components-product-stock-indicator--low-stock":!!u,"wc-block-components-product-stock-indicator--available-on-backorder":!!d}),style:{...b.style,...k.style}},u?(o=>Object(n.sprintf)(
2
  /* translators: %d stock amount (number of items in stock for product) */
3
  Object(n.__)("%d left in stock","woo-gutenberg-products-block"),o))(u):((o,c)=>c?Object(n.__)("Available on backorder","woo-gutenberg-products-block"):o?Object(n.__)("In Stock","woo-gutenberg-products-block"):Object(n.__)("Out of Stock","woo-gutenberg-products-block"))(l,d))})},310:function(o,c){}}]);
build/atomic-block-components/summary-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{243:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n(163);var c=n(65);const s=()=>c.m>1},260:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return u})),n.d(e,"a",(function(){return i}));var c=n(162),s=n(243),o=n(35);const r=t=>Object(o.d)(t)?JSON.parse(t)||{}:Object(o.c)(t)?t:{},a=t=>{if(!Object(s.a)()||"function"!=typeof c.__experimentalGetSpacingClassesAndStyles)return{style:{}};const e=Object(o.c)(t)?t:{},n=r(e.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...e,style:n})},u=t=>{const e=Object(o.c)(t)?t:{},n=r(e.style),c=Object(o.c)(n.typography)?n.typography:{};return{style:{fontSize:e.fontSize||c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,textTransform:c.textTransform,fontFamily:e.fontFamily}}},i=t=>{if(!Object(s.a)())return{className:"",style:{}};const e=Object(o.c)(t)?t:{},n=r(e.style);return Object(c.__experimentalUseColorProps)({...e,style:n})}},261:function(t,e,n){"use strict";var c=n(0),s=n(113),o=n(114);const r=t=>{const e=t.indexOf("</p>");return-1===e?t:t.substr(0,e+4)},a=t=>t.replace(/<\/?[a-z][^>]*?>/gi,""),u=(t,e)=>t.replace(/[\s|\.\,]+$/i,"")+e,i=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;";const c=a(t),s=c.split(" ").splice(0,e).join(" ");return Object(o.autop)(u(s,n))},l=function(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;";const s=a(t),r=s.slice(0,e);if(n)return Object(o.autop)(u(r,c));const i=r.match(/([\s]+)/g),l=i?i.length:0,p=s.slice(0,e+l);return Object(o.autop)(u(p,c))};e.a=t=>{let{source:e,maxLength:n=15,countType:a="words",className:u="",style:p={}}=t;const d=Object(c.useMemo)(()=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const c=Object(o.autop)(t),a=Object(s.count)(c,n);if(a<=e)return c;const u=r(c),p=Object(s.count)(u,n);return p<=e?u:"words"===n?i(u,e):l(u,e,"characters_including_spaces"===n)}(e,n,a),[e,n,a]);return Object(c.createElement)(c.RawHTML,{style:p,className:u},d)}},319:function(t,e){},367:function(t,e,n){"use strict";n.r(e);var c=n(0),s=(n(8),n(4)),o=n.n(s),r=n(261),a=n(65),u=n(49),i=n(110),l=(n(319),n(260));e.default=Object(i.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:n}=Object(u.useInnerBlockLayoutContext)(),{product:s}=Object(u.useProductDataContext)(),i=Object(l.a)(t),p=Object(l.c)(t);if(!s)return Object(c.createElement)("div",{className:o()(e,"wc-block-components-product-summary",{[n+"__product-summary"]:n})});const d=s.short_description?s.short_description:s.description;return d?Object(c.createElement)(r.a,{className:o()(e,i.className,"wc-block-components-product-summary",{[n+"__product-summary"]:n}),source:d,maxLength:150,countType:a.n.wordCountType||"words",style:{...i.style,...p.style}}):null})}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[16],{111:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n(99);var c=n(50);const s=()=>c.m>1},134:function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return l})),n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return i}));var c=n(68),s=n(111),r=n(18);const o=t=>Object(r.e)(t)?JSON.parse(t)||{}:Object(r.d)(t)?t:{},a=t=>{if(!Object(s.a)()||"function"!=typeof c.__experimentalGetSpacingClassesAndStyles)return{style:{}};const e=Object(r.d)(t)?t:{},n=o(e.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...e,style:n})},l=t=>{const e=Object(r.d)(t)?t:{},n=o(e.style),c=Object(r.d)(n.typography)?n.typography:{};return{style:{fontSize:e.fontSize||c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,textTransform:c.textTransform,fontFamily:e.fontFamily}}},u=t=>{if(!Object(s.a)())return{className:"",style:{}};const e=Object(r.d)(t)?t:{},n=o(e.style);return Object(c.__experimentalUseColorProps)({...e,style:n})},i=t=>{if(!Object(s.a)())return{className:"",style:{}};const e=Object(r.d)(t)?t:{},n=o(e.style);return Object(c.__experimentalUseBorderProps)({...e,style:n})}},263:function(t,e,n){"use strict";var c=n(0),s=n(116),r=n(117);const o=t=>{const e=t.indexOf("</p>");return-1===e?t:t.substr(0,e+4)},a=t=>t.replace(/<\/?[a-z][^>]*?>/gi,""),l=(t,e)=>t.replace(/[\s|\.\,]+$/i,"")+e,u=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;";const c=a(t),s=c.split(" ").splice(0,e).join(" ");return Object(r.autop)(l(s,n))},i=function(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;";const s=a(t),o=s.slice(0,e);if(n)return Object(r.autop)(l(o,c));const u=o.match(/([\s]+)/g),i=u?u.length:0,p=s.slice(0,e+i);return Object(r.autop)(l(p,c))};e.a=t=>{let{source:e,maxLength:n=15,countType:a="words",className:l="",style:p={}}=t;const d=Object(c.useMemo)(()=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const c=Object(r.autop)(t),a=Object(s.count)(c,n);if(a<=e)return c;const l=o(c),p=Object(s.count)(l,n);return p<=e?l:"words"===n?u(l,e):i(l,e,"characters_including_spaces"===n)}(e,n,a),[e,n,a]);return Object(c.createElement)(c.RawHTML,{style:p,className:l},d)}},321:function(t,e){},369:function(t,e,n){"use strict";n.r(e);var c=n(0),s=(n(8),n(4)),r=n.n(s),o=n(263),a=n(50),l=n(49),u=n(113),i=(n(321),n(134));e.default=Object(u.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:n}=Object(l.useInnerBlockLayoutContext)(),{product:s}=Object(l.useProductDataContext)(),u=Object(i.b)(t),p=Object(i.d)(t);if(!s)return Object(c.createElement)("div",{className:r()(e,"wc-block-components-product-summary",{[n+"__product-summary"]:n})});const d=s.short_description?s.short_description:s.description;return d?Object(c.createElement)(o.a,{className:r()(e,u.className,"wc-block-components-product-summary",{[n+"__product-summary"]:n}),source:d,maxLength:150,countType:a.n.wordCountType||"words",style:{...u.style,...p.style}}):null})}}]);
build/atomic-block-components/summary.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[17],{131:function(t,e,c){"use strict";var n=c(0),o=c(101),s=c(76);const r=t=>{const e=t.indexOf("</p>");return-1===e?t:t.substr(0,e+4)},a=t=>t.replace(/<\/?[a-z][^>]*?>/gi,""),u=(t,e)=>t.replace(/[\s|\.\,]+$/i,"")+e,l=function(t,e){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;";const n=a(t),o=n.split(" ").splice(0,e).join(" ");return Object(s.autop)(u(o,c))},i=function(t,e){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;";const o=a(t),r=o.slice(0,e);if(c)return Object(s.autop)(u(r,n));const l=r.match(/([\s]+)/g),i=l?l.length:0,p=o.slice(0,e+i);return Object(s.autop)(u(p,n))};e.a=t=>{let{source:e,maxLength:c=15,countType:a="words",className:u="",style:p={}}=t;const d=Object(n.useMemo)(()=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const n=Object(s.autop)(t),a=Object(o.count)(n,c);if(a<=e)return n;const u=r(n),p=Object(o.count)(u,c);return p<=e?u:"words"===c?l(u,e):i(u,e,"characters_including_spaces"===c)}(e,c,a),[e,c,a]);return Object(n.createElement)(n.RawHTML,{style:p,className:u},d)}},266:function(t,e,c){"use strict";c.r(e);var n=c(0),o=(c(10),c(4)),s=c.n(o),r=c(131),a=c(24),u=c(29),l=c(54),i=(c(306),c(113));e.default=Object(l.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:c}=Object(u.useInnerBlockLayoutContext)(),{product:o}=Object(u.useProductDataContext)(),l=Object(i.a)(t),p=Object(i.c)(t);if(!o)return Object(n.createElement)("div",{className:s()(e,"wc-block-components-product-summary",{[c+"__product-summary"]:c})});const d=o.short_description?o.short_description:o.description;return d?Object(n.createElement)(r.a,{className:s()(e,l.className,"wc-block-components-product-summary",{[c+"__product-summary"]:c}),source:d,maxLength:150,countType:a.o.wordCountType||"words",style:{...l.style,...p.style}}):null})},306:function(t,e){}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[17],{128:function(t,e,c){"use strict";var n=c(0),o=c(101),s=c(77);const r=t=>{const e=t.indexOf("</p>");return-1===e?t:t.substr(0,e+4)},a=t=>t.replace(/<\/?[a-z][^>]*?>/gi,""),u=(t,e)=>t.replace(/[\s|\.\,]+$/i,"")+e,l=function(t,e){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"&hellip;";const n=a(t),o=n.split(" ").splice(0,e).join(" ");return Object(s.autop)(u(o,c))},i=function(t,e){let c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"&hellip;";const o=a(t),r=o.slice(0,e);if(c)return Object(s.autop)(u(r,n));const l=r.match(/([\s]+)/g),i=l?l.length:0,p=o.slice(0,e+i);return Object(s.autop)(u(p,n))};e.a=t=>{let{source:e,maxLength:c=15,countType:a="words",className:u="",style:p={}}=t;const d=Object(n.useMemo)(()=>function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words";const n=Object(s.autop)(t),a=Object(o.count)(n,c);if(a<=e)return n;const u=r(n),p=Object(o.count)(u,c);return p<=e?u:"words"===c?l(u,e):i(u,e,"characters_including_spaces"===c)}(e,c,a),[e,c,a]);return Object(n.createElement)(n.RawHTML,{style:p,className:u},d)}},265:function(t,e,c){"use strict";c.r(e);var n=c(0),o=(c(10),c(4)),s=c.n(o),r=c(128),a=c(22),u=c(28),l=c(55),i=(c(306),c(51));e.default=Object(l.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:c}=Object(u.useInnerBlockLayoutContext)(),{product:o}=Object(u.useProductDataContext)(),l=Object(i.b)(t),p=Object(i.d)(t);if(!o)return Object(n.createElement)("div",{className:s()(e,"wc-block-components-product-summary",{[c+"__product-summary"]:c})});const d=o.short_description?o.short_description:o.description;return d?Object(n.createElement)(r.a,{className:s()(e,l.className,"wc-block-components-product-summary",{[c+"__product-summary"]:c}),source:d,maxLength:150,countType:a.o.wordCountType||"words",style:{...l.style,...p.style}}):null})},306:function(t,e){}}]);
build/atomic-block-components/tag-list-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[17],{322:function(t,e){},370:function(t,e,c){"use strict";c.r(e);var a=c(0),n=c(1),l=(c(8),c(4)),s=c.n(l),o=c(49),u=c(5),r=c(110);c(322),e.default=Object(r.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:c}=Object(o.useInnerBlockLayoutContext)(),{product:l}=Object(o.useProductDataContext)();return Object(u.isEmpty)(l.tags)?null:Object(a.createElement)("div",{className:s()(e,"wc-block-components-product-tag-list",{[c+"__product-tag-list"]:c})},Object(n.__)("Tags:","woo-gutenberg-products-block")," ",Object(a.createElement)("ul",null,Object.values(l.tags).map(t=>{let{name:e,link:c,slug:n}=t;return Object(a.createElement)("li",{key:"tag-list-item-"+n},Object(a.createElement)("a",{href:c},e))})))})}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[17],{111:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n(99);var c=n(50);const s=()=>c.m>1},134:function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return l})),n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return u}));var c=n(68),s=n(111),r=n(18);const a=t=>Object(r.e)(t)?JSON.parse(t)||{}:Object(r.d)(t)?t:{},o=t=>{if(!Object(s.a)()||"function"!=typeof c.__experimentalGetSpacingClassesAndStyles)return{style:{}};const e=Object(r.d)(t)?t:{},n=a(e.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...e,style:n})},l=t=>{const e=Object(r.d)(t)?t:{},n=a(e.style),c=Object(r.d)(n.typography)?n.typography:{};return{style:{fontSize:e.fontSize||c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,textTransform:c.textTransform,fontFamily:e.fontFamily}}},i=t=>{if(!Object(s.a)())return{className:"",style:{}};const e=Object(r.d)(t)?t:{},n=a(e.style);return Object(c.__experimentalUseColorProps)({...e,style:n})},u=t=>{if(!Object(s.a)())return{className:"",style:{}};const e=Object(r.d)(t)?t:{},n=a(e.style);return Object(c.__experimentalUseBorderProps)({...e,style:n})}},324:function(t,e){},372:function(t,e,n){"use strict";n.r(e);var c=n(0),s=n(1),r=(n(8),n(4)),a=n.n(r),o=n(49),l=n(5),i=n(113),u=(n(324),n(134));e.default=Object(i.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:n}=Object(o.useInnerBlockLayoutContext)(),{product:r}=Object(o.useProductDataContext)(),i=Object(u.b)(t),b=Object(u.d)(t);return Object(l.isEmpty)(r.tags)?null:Object(c.createElement)("div",{className:a()(e,i.className,"wc-block-components-product-tag-list",{[n+"__product-tag-list"]:n}),style:{...i.style,...b.style}},Object(s.__)("Tags:","woo-gutenberg-products-block")," ",Object(c.createElement)("ul",null,Object.values(r.tags).map(t=>{let{name:e,link:n,slug:s}=t;return Object(c.createElement)("li",{key:"tag-list-item-"+s},Object(c.createElement)("a",{href:n},e))})))})}}]);
build/atomic-block-components/tag-list.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[18],{269:function(t,e,c){"use strict";c.r(e);var a=c(0),n=c(1),l=(c(10),c(4)),s=c.n(l),o=c(29),u=c(6),r=c(54);c(309),e.default=Object(r.withProductDataContext)(t=>{let{className:e}=t;const{parentClassName:c}=Object(o.useInnerBlockLayoutContext)(),{product:l}=Object(o.useProductDataContext)();return Object(u.isEmpty)(l.tags)?null:Object(a.createElement)("div",{className:s()(e,"wc-block-components-product-tag-list",{[c+"__product-tag-list"]:c})},Object(n.__)("Tags:","woo-gutenberg-products-block")," ",Object(a.createElement)("ul",null,Object.values(l.tags).map(t=>{let{name:e,link:c,slug:n}=t;return Object(a.createElement)("li",{key:"tag-list-item-"+n},Object(a.createElement)("a",{href:c},e))})))})},309:function(t,e){}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[18],{268:function(t,e,c){"use strict";c.r(e);var a=c(0),s=c(1),l=(c(10),c(4)),n=c.n(l),o=c(28),u=c(6),r=c(55),b=(c(309),c(51));e.default=Object(r.withProductDataContext)(t=>{const{className:e}=t,{parentClassName:c}=Object(o.useInnerBlockLayoutContext)(),{product:l}=Object(o.useProductDataContext)(),r=Object(b.b)(t),i=Object(b.d)(t);return Object(u.isEmpty)(l.tags)?null:Object(a.createElement)("div",{className:n()(e,r.className,"wc-block-components-product-tag-list",{[c+"__product-tag-list"]:c}),style:{...r.style,...i.style}},Object(s.__)("Tags:","woo-gutenberg-products-block")," ",Object(a.createElement)("ul",null,Object.values(l.tags).map(t=>{let{name:e,link:c,slug:s}=t;return Object(a.createElement)("li",{key:"tag-list-item-"+s},Object(a.createElement)("a",{href:c},e))})))})},309:function(t,e){}}]);
build/atomic-block-components/title-frontend.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[18],{243:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n(163);var c=n(65);const l=()=>c.m>1},249:function(e,t,n){"use strict";var c=n(10),l=n.n(c),o=n(0),s=n(19),r=n(4),a=n.n(r);n(250),t.a=e=>{let{className:t="",disabled:n=!1,name:c,permalink:r="",rel:i,style:u,onClick:d,...p}=e;const b=a()("wc-block-components-product-name",t);if(n){const e=p;return Object(o.createElement)("span",l()({className:b},e,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(c)}}))}return Object(o.createElement)("a",l()({className:b,href:r,rel:i},p,{dangerouslySetInnerHTML:{__html:Object(s.decodeEntities)(c)},style:u}))}},250:function(e,t){},260:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return i}));var c=n(162),l=n(243),o=n(35);const s=e=>Object(o.d)(e)?JSON.parse(e)||{}:Object(o.c)(e)?e:{},r=e=>{if(!Object(l.a)()||"function"!=typeof c.__experimentalGetSpacingClassesAndStyles)return{style:{}};const t=Object(o.c)(e)?e:{},n=s(t.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...t,style:n})},a=e=>{const t=Object(o.c)(e)?e:{},n=s(t.style),c=Object(o.c)(n.typography)?n.typography:{};return{style:{fontSize:t.fontSize||c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,textTransform:c.textTransform,fontFamily:t.fontFamily}}},i=e=>{if(!Object(l.a)())return{className:"",style:{}};const t=Object(o.c)(e)?e:{},n=s(t.style);return Object(c.__experimentalUseColorProps)({...t,style:n})}},315:function(e,t){},398:function(e,t,n){"use strict";n.r(t);var c=n(110),l=n(0),o=n(4),s=n.n(o),r=n(49),a=n(243),i=n(249),u=n(38),d=(n(315),n(260));const p=e=>{let{children:t,headingLevel:n,elementType:c="h"+n,...o}=e;return Object(l.createElement)(c,o,t)};var b=Object(c.withProductDataContext)(e=>{const{className:t,headingLevel:n=2,showProductLink:c=!0,align:o}=e,{parentClassName:b}=Object(r.useInnerBlockLayoutContext)(),{product:m}=Object(r.useProductDataContext)(),{dispatchStoreEvent:y}=Object(u.a)(),O=Object(d.a)(e),f=Object(d.b)(e),j=Object(d.c)(e);return m.id?Object(l.createElement)(p,{headingLevel:n,className:s()(t,O.className,"wc-block-components-product-title",{[b+"__product-title"]:b,["wc-block-components-product-title--align-"+o]:o&&Object(a.a)()}),style:Object(a.a)()?{...f.style,...j.style,...O.style}:{}},Object(l.createElement)(i.a,{disabled:!c,name:m.name,permalink:m.permalink,rel:c?"nofollow":"",onClick:()=>{y("product-view-link",{product:m})}})):Object(l.createElement)(p,{headingLevel:n,className:s()(t,O.className,"wc-block-components-product-title",{[b+"__product-title"]:b,["wc-block-components-product-title--align-"+o]:o&&Object(a.a)()}),style:Object(a.a)()?{...f.style,...j.style,...O.style}:{}})});let m={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(a.a)()&&(m={...m,align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}});var y=m;t.default=Object(c.withFilteredAttributes)(y)(b)}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[18],{111:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n(99);var c=n(50);const r=()=>c.m>1},134:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return u}));var c=n(68),r=n(111),s=n(18);const l=e=>Object(s.e)(e)?JSON.parse(e)||{}:Object(s.d)(e)?e:{},o=e=>{if(!Object(r.a)()||"function"!=typeof c.__experimentalGetSpacingClassesAndStyles)return{style:{}};const t=Object(s.d)(e)?e:{},n=l(t.style);return Object(c.__experimentalGetSpacingClassesAndStyles)({...t,style:n})},a=e=>{const t=Object(s.d)(e)?e:{},n=l(t.style),c=Object(s.d)(n.typography)?n.typography:{};return{style:{fontSize:t.fontSize||c.fontSize,lineHeight:c.lineHeight,fontWeight:c.fontWeight,textTransform:c.textTransform,fontFamily:t.fontFamily}}},i=e=>{if(!Object(r.a)())return{className:"",style:{}};const t=Object(s.d)(e)?e:{},n=l(t.style);return Object(c.__experimentalUseColorProps)({...t,style:n})},u=e=>{if(!Object(r.a)())return{className:"",style:{}};const t=Object(s.d)(e)?e:{},n=l(t.style);return Object(c.__experimentalUseBorderProps)({...t,style:n})}},252:function(e,t,n){"use strict";var c=n(11),r=n.n(c),s=n(0),l=n(21),o=n(4),a=n.n(o);n(253),t.a=e=>{let{className:t="",disabled:n=!1,name:c,permalink:o="",rel:i,style:u,onClick:d,...b}=e;const p=a()("wc-block-components-product-name",t);if(n){const e=b;return Object(s.createElement)("span",r()({className:p},e,{dangerouslySetInnerHTML:{__html:Object(l.decodeEntities)(c)}}))}return Object(s.createElement)("a",r()({className:p,href:o,rel:i},b,{dangerouslySetInnerHTML:{__html:Object(l.decodeEntities)(c)},style:u}))}},253:function(e,t){},317:function(e,t){},400:function(e,t,n){"use strict";n.r(t);var c=n(113),r=n(0),s=n(4),l=n.n(s),o=n(49),a=n(111),i=n(252),u=n(33),d=(n(317),n(134));const b=e=>{let{children:t,headingLevel:n,elementType:c="h"+n,...s}=e;return Object(r.createElement)(c,s,t)};var p=Object(c.withProductDataContext)(e=>{const{className:t,headingLevel:n=2,showProductLink:c=!0,align:s}=e,{parentClassName:p}=Object(o.useInnerBlockLayoutContext)(),{product:m}=Object(o.useProductDataContext)(),{dispatchStoreEvent:y}=Object(u.a)(),O=Object(d.b)(e),j=Object(d.c)(e),f=Object(d.d)(e);return m.id?Object(r.createElement)(b,{headingLevel:n,className:l()(t,O.className,"wc-block-components-product-title",{[p+"__product-title"]:p,["wc-block-components-product-title--align-"+s]:s&&Object(a.a)()}),style:Object(a.a)()?{...j.style,...f.style,...O.style}:{}},Object(r.createElement)(i.a,{disabled:!c,name:m.name,permalink:m.permalink,rel:c?"nofollow":"",onClick:()=>{y("product-view-link",{product:m})}})):Object(r.createElement)(b,{headingLevel:n,className:l()(t,O.className,"wc-block-components-product-title",{[p+"__product-title"]:p,["wc-block-components-product-title--align-"+s]:s&&Object(a.a)()}),style:Object(a.a)()?{...j.style,...f.style,...O.style}:{}})});let m={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(a.a)()&&(m={...m,align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}});var y=m;t.default=Object(c.withFilteredAttributes)(y)(p)}}]);
build/atomic-block-components/title.js CHANGED
@@ -1 +1 @@
1
- (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[19],{129:function(e,t,c){"use strict";var n=c(5),l=c.n(n),o=c(0),a=c(14),s=c(4),r=c.n(s);c(157),t.a=e=>{let{className:t="",disabled:c=!1,name:n,permalink:s="",rel:i,style:u,onClick:b,...d}=e;const p=r()("wc-block-components-product-name",t);if(c){const e=d;return Object(o.createElement)("span",l()({className:p},e,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(n)}}))}return Object(o.createElement)("a",l()({className:p,href:s,rel:i},d,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(n)},style:u}))}},157:function(e,t){},249:function(e,t,c){"use strict";var n=c(65);let l={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(n.b)()&&(l={...l,align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}}),t.a=l},250:function(e,t,c){"use strict";var n=c(0),l=c(4),o=c.n(l),a=c(29),s=c(65),r=c(54),i=c(129),u=c(60),b=(c(301),c(113));const d=e=>{let{children:t,headingLevel:c,elementType:l="h"+c,...o}=e;return Object(n.createElement)(l,o,t)};t.a=Object(r.withProductDataContext)(e=>{const{className:t,headingLevel:c=2,showProductLink:l=!0,align:r}=e,{parentClassName:p}=Object(a.useInnerBlockLayoutContext)(),{product:m}=Object(a.useProductDataContext)(),{dispatchStoreEvent:y}=Object(u.a)(),j=Object(b.a)(e),O=Object(b.b)(e),k=Object(b.c)(e);return m.id?Object(n.createElement)(d,{headingLevel:c,className:o()(t,j.className,"wc-block-components-product-title",{[p+"__product-title"]:p,["wc-block-components-product-title--align-"+r]:r&&Object(s.b)()}),style:Object(s.b)()?{...O.style,...k.style,...j.style}:{}},Object(n.createElement)(i.a,{disabled:!l,name:m.name,permalink:m.permalink,rel:l?"nofollow":"",onClick:()=>{y("product-view-link",{product:m})}})):Object(n.createElement)(d,{headingLevel:c,className:o()(t,j.className,"wc-block-components-product-title",{[p+"__product-title"]:p,["wc-block-components-product-title--align-"+r]:r&&Object(s.b)()}),style:Object(s.b)()?{...O.style,...k.style,...j.style}:{}})})},301:function(e,t){},503:function(e,t,c){"use strict";c.r(t);var n=c(54),l=c(250),o=c(249);t.default=Object(n.withFilteredAttributes)(o.a)(l.a)}}]);
1
+ (window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[19],{126:function(e,t,c){"use strict";var n=c(5),l=c.n(n),o=c(0),a=c(16),s=c(4),r=c.n(s);c(156),t.a=e=>{let{className:t="",disabled:c=!1,name:n,permalink:s="",rel:i,style:u,onClick:d,...b}=e;const p=r()("wc-block-components-product-name",t);if(c){const e=b;return Object(o.createElement)("span",l()({className:p},e,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(n)}}))}return Object(o.createElement)("a",l()({className:p,href:s,rel:i},b,{dangerouslySetInnerHTML:{__html:Object(a.decodeEntities)(n)},style:u}))}},156:function(e,t){},248:function(e,t,c){"use strict";var n=c(50);let l={headingLevel:{type:"number",default:2},showProductLink:{type:"boolean",default:!0},productId:{type:"number",default:0}};Object(n.b)()&&(l={...l,align:{type:"string"},color:{type:"string"},customColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"}}),t.a=l},249:function(e,t,c){"use strict";var n=c(0),l=c(4),o=c.n(l),a=c(28),s=c(50),r=c(55),i=c(126),u=c(60),d=(c(301),c(51));const b=e=>{let{children:t,headingLevel:c,elementType:l="h"+c,...o}=e;return Object(n.createElement)(l,o,t)};t.a=Object(r.withProductDataContext)(e=>{const{className:t,headingLevel:c=2,showProductLink:l=!0,align:r}=e,{parentClassName:p}=Object(a.useInnerBlockLayoutContext)(),{product:m}=Object(a.useProductDataContext)(),{dispatchStoreEvent:y}=Object(u.a)(),j=Object(d.b)(e),O=Object(d.c)(e),k=Object(d.d)(e);return m.id?Object(n.createElement)(b,{headingLevel:c,className:o()(t,j.className,"wc-block-components-product-title",{[p+"__product-title"]:p,["wc-block-components-product-title--align-"+r]:r&&Object(s.b)()}),style:Object(s.b)()?{...O.style,...k.style,...j.style}:{}},Object(n.createElement)(i.a,{disabled:!l,name:m.name,permalink:m.permalink,rel:l?"nofollow":"",onClick:()=>{y("product-view-link",{product:m})}})):Object(n.createElement)(b,{headingLevel:c,className:o()(t,j.className,"wc-block-components-product-title",{[p+"__product-title"]:p,["wc-block-components-product-title--align-"+r]:r&&Object(s.b)()}),style:Object(s.b)()?{...O.style,...k.style,...j.style}:{}})})},301:function(e,t){},521:function(e,t,c){"use strict";c.r(t);var n=c(55),l=c(249),o=c(248);t.default=Object(n.withFilteredAttributes)(o.a)(l.a)}}]);
build/attribute-filter-frontend.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '8b7b47cab520f377241aa64f77bcf85b');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wc-blocks-data-store', 'wc-settings', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-primitives'), 'version' => '072a7b6b55e10f67ad4cd027c7193e67');
build/attribute-filter-frontend.js CHANGED
@@ -1,29 +1,29 @@
1
- !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=182)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var a=o.apply(null,r);a&&e.push(a)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var c in r)n.call(r,c)&&r[c]&&e.push(c);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=n(42)()},function(e,t){e.exports=window.wp.data},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.isShallowEqual},,function(e,t,n){"use strict";var r=n(16),o=n.n(r),i=n(0),a=n(3),c=n(1),s=n(65),u=e=>{let{imageUrl:t=s.l+"/block-error.svg",header:n=Object(c.__)("Oops!","woo-gutenberg-products-block"),text:r=Object(c.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:a=Object(c.__)("Error:","woo-gutenberg-products-block"),button:u,showErrorBlock:l=!0}=e;return l?Object(i.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(i.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(i.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},n&&Object(i.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},n),r&&Object(i.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),o&&Object(i.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},a?a+" ":"",o),u&&Object(i.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},u))):null};n(37);class l extends a.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(i.createElement)(i.Fragment,null,Object(i.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:n=!0,showErrorBlock:r=!0,text:o,errorMessagePrefix:a,renderError:c,button:s}=this.props,{errorMessage:l,hasError:d}=this.state;return d?"function"==typeof c?c({errorMessage:l}):Object(i.createElement)(u,{showErrorBlock:r,errorMessage:n?l:null,header:e,imageUrl:t,text:o,errorMessagePrefix:a,button:s}):this.props.children}}t.a=l},,,function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),o=n(11),i=n.n(o);function a(e){const t=Object(r.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},,function(e,t){e.exports=window.wp.htmlEntities},,function(e,t,n){"use strict";var r=n(0),o=n(4),i=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:a,wrapperProps:c={}}=e;const s=null!=n,u=null!=o;return!s&&u?(t=a||"span",c={...c,className:i()(c.className,"screen-reader-text")},Object(r.createElement)(t,c,o)):(t=a||r.Fragment,s&&u&&n!==o?Object(r.createElement)(t,c,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,c,n))}},,function(e,t){e.exports=window.wp.a11y},function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);const o=Object(r.createContext)("page"),i=()=>Object(r.useContext)(o);o.Provider},,,,,,,,,,,,function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return f}));var r=n(6),o=n(9),i=n(0),a=n(11),c=n.n(a),s=n(17),u=n(62),l=n(25);const d=e=>{const t=Object(l.a)();e=e||t;const n=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:a}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(i.useCallback)(t=>{a(e,t)},[e,a])]},p=(e,t,n)=>{const a=Object(l.a)();n=n||a;const c=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:s}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[c,Object(i.useCallback)(t=>{s(n,e,t)},[n,e,s])]},f=(e,t)=>{const n=Object(l.a)();t=t||n;const[r,o]=d(t),a=Object(s.a)(r),p=Object(s.a)(e),f=Object(u.a)(p),m=Object(i.useRef)(!1);return Object(i.useEffect)(()=>{c()(f,p)||(o(Object.assign({},a,p)),m.current=!0)},[a,p,f,o]),m.current?[r,o]:[e,o]}},,,function(e,t,n){"use strict";var r=n(43);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t,n){var o=this,i=Object(r.useRef)(null),a=Object(r.useRef)(0),c=Object(r.useRef)(null),s=Object(r.useRef)([]),u=Object(r.useRef)(),l=Object(r.useRef)(),d=Object(r.useRef)(e),p=Object(r.useRef)(!0);d.current=e;var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var m=!!(n=n||{}).leading,b=!("trailing"in n)||!!n.trailing,g="maxWait"in n,h=g?Math.max(+n.maxWait||0,t):null;return Object(r.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]),Object(r.useMemo)((function(){var e=function(e){var t=s.current,n=u.current;return s.current=u.current=null,a.current=e,l.current=d.current.apply(n,t)},n=function(e,t){f&&cancelAnimationFrame(c.current),c.current=f?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!p.current)return!1;var n=e-i.current,r=e-a.current;return!i.current||n>=t||n<0||g&&r>=h},v=function(t){return c.current=null,b&&s.current?e(t):(s.current=u.current=null,l.current)},y=function(){var e=Date.now();if(r(e))return v(e);if(p.current){var o=e-i.current,c=e-a.current,s=t-o,u=g?Math.min(s,h-c):s;n(y,u)}},O=function(){for(var d=[],f=0;f<arguments.length;f++)d[f]=arguments[f];var b=Date.now(),h=r(b);if(s.current=d,u.current=o,i.current=b,h){if(!c.current&&p.current)return a.current=i.current,n(y,t),m?e(i.current):l.current;if(g)return n(y,t),e(i.current)}return c.current||n(y,t),l.current};return O.cancel=function(){c.current&&(f?cancelAnimationFrame(c.current):clearTimeout(c.current)),a.current=0,s.current=i.current=u.current=c.current=null},O.isPending=function(){return!!c.current},O.flush=function(){return c.current?v(Date.now()):l.current},O}),[m,g,t,h,b,f])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(10),o=n.n(r),i=n(0),a=n(13);const c=[".wp-block-woocommerce-cart"],s=e=>{let{Block:t,containers:n,getProps:r=(()=>({})),getErrorBoundaryProps:c=(()=>({}))}=e;0!==n.length&&Array.prototype.forEach.call(n,(e,n)=>{const s=r(e,n),u=c(e,n),l={...e.dataset,...s.attributes||{}};(e=>{let{Block:t,container:n,attributes:r={},props:c={},errorBoundaryProps:s={}}=e;Object(i.render)(Object(i.createElement)(a.a,s,Object(i.createElement)(i.Suspense,{fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(i.createElement)(t,o()({},c,{attributes:r})))),n,()=>{n.classList&&n.classList.remove("is-loading")})})({Block:t,container:e,props:s,attributes:l,errorBoundaryProps:u})})},u=e=>{const t=document.body.querySelectorAll(c.join(",")),{Block:n,getProps:r,getErrorBoundaryProps:o,selector:i}=e;(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrappers:i}=e;const a=document.body.querySelectorAll(o);i&&i.length>0&&Array.prototype.filter.call(a,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,i)),s({Block:t,containers:a,getProps:n,getErrorBoundaryProps:r})})({Block:n,getProps:r,getErrorBoundaryProps:o,selector:i,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrapper:i}=e;const a=i.querySelectorAll(o);s({Block:t,containers:a,getProps:n,getErrorBoundaryProps:r})})({...e,wrapper:t})})})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(21);n(117),t.a=e=>{let{name:t,count:n}=e;return Object(r.createElement)(r.Fragment,null,t,Number.isFinite(n)&&Object(r.createElement)(i.a,{label:n,screenReaderLabel:Object(o.sprintf)(
2
  /* translators: %s number of products. */
3
- Object(o._n)("%s product","%s products",n,"woo-gutenberg-products-block"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(6),o=n(9),i=n(0),a=n(17),c=n(54);const s=e=>{const{namespace:t,resourceName:n,resourceValues:s=[],query:u={},shouldSelect:l=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const d=Object(i.useRef)({results:[],isLoading:!0}),p=Object(a.a)(u),f=Object(a.a)(s),m=Object(c.a)(),b=Object(o.useSelect)(e=>{if(!l)return null;const o=e(r.COLLECTIONS_STORE_KEY),i=[t,n,p,f],a=o.getCollectionError(...i);return a&&m(a),{results:o.getCollection(...i),isLoading:!o.hasFinishedResolution("getCollection",i)}},[t,n,f,p,l]);return null!==b&&(d.current=b),d.current}},function(e,t,n){"use strict";n.d(t,"n",(function(){return i})),n.d(t,"l",(function(){return a})),n.d(t,"k",(function(){return c})),n.d(t,"m",(function(){return s})),n.d(t,"i",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return m})),n.d(t,"g",(function(){return b})),n.d(t,"a",(function(){return g})),n.d(t,"h",(function(){return h})),n.d(t,"b",(function(){return v}));var r,o=n(2);const i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=i.pluginUrl+"images/",c=i.pluginUrl+"build/",s=i.buildPhase,u=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),f=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),m=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),b=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},,,,,,,function(e,t,n){"use strict";var r=n(0),o=n(1),i=(n(8),n(4)),a=n.n(i),c=n(21);n(102);const s=e=>{let{className:t,disabled:n,label:
4
  /* translators: Submit button text for filters. */
5
- i=Object(o.__)("Go","woo-gutenberg-products-block"),onClick:s,screenReaderLabel:u=Object(o.__)("Apply filter","woo-gutenberg-products-block")}=e;return Object(r.createElement)("button",{type:"submit",className:a()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:s},Object(r.createElement)(c.a,{label:i,screenReaderLabel:u}))};s.defaultProps={disabled:!1},t.a=s},,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(3),o=n(52);function i(e,t){return e===t}function a(e){return"function"==typeof e?function(){return e}:e}function c(e,t,n){var c=n&&n.equalityFn||i,s=function(e){var t=Object(r.useState)(a(e)),n=t[0],o=t[1];return[n,Object(r.useCallback)((function(e){return o(a(e))}),[])]}(e),u=s[0],l=s[1],d=Object(o.a)(Object(r.useCallback)((function(e){return l(e)}),[l]),t,n),p=Object(r.useRef)(e);return c(p.current,e)||(d(e),p.current=e),[u,d]}},function(e,t){e.exports=window.wp.components},,,function(e,t,n){"use strict";var r=n(0);t.a=function(e){let{srcElement:t,size:n=24,...o}=e;return Object(r.isValidElement)(t)?Object(r.cloneElement)(t,{width:n,height:n,...o}):null}},,,,function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var r=n(2);const o=Object(r.getSetting)("attributes",[]).reduce((e,t)=>{const n=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;var r;return n.id&&e.push(n),e},[]),i=e=>{if(e)return o.find(t=>t.id===e)},a=e=>{if(e)return o.find(t=>t.taxonomy===e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));var r=n(5);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const i=e.filter(e=>e.attribute===n.taxonomy),a=i.length?i[0]:null;if(!(a&&a.slug&&Array.isArray(a.slug)&&a.slug.includes(o)))return;const c=a.slug.filter(e=>e!==o),s=e.filter(e=>e.attribute!==n.taxonomy);c.length>0&&(a.slug=c.sort(),s.push(a)),t(Object(r.sortBy)(s,"attribute"))},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const a=e.filter(e=>e.attribute!==n.taxonomy);0===o.length?t(a):(a.push({attribute:n.taxonomy,operator:i,slug:o.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(r.sortBy)(a,"attribute")))}},function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(4),a=n.n(i);n(118),t.a=e=>{let{className:t,onChange:n=(()=>{}),options:i=[],checked:c=[],isLoading:s=!1,isDisabled:u=!1,limit:l=10}=e;const[d,p]=Object(r.useState)(!1),f=Object(r.useMemo)(()=>[...Array(5)].map((e,t)=>Object(r.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})),[]),m=Object(r.useMemo)(()=>{const e=i.length-l;return!d&&Object(r.createElement)("li",{key:"show-more",className:"show-more"},Object(r.createElement)("button",{onClick:()=>{p(!0)},"aria-expanded":!1,"aria-label":Object(o.sprintf)(
6
  /* translators: %s is referring the remaining
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=186)}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wc.wcSettings},function(e,t){e.exports=window.React},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var c=o.apply(null,r);c&&e.push(c)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var a in r)n.call(r,a)&&r[a]&&e.push(a);else e.push(r.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wc.wcBlocksData},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports=n(43)()},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.isShallowEqual},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t){e.exports=window.wp.primitives},function(e,t,n){"use strict";var r=n(17),o=n.n(r),i=n(0),c=n(3),a=n(1),s=n(50),u=e=>{let{imageUrl:t=s.l+"/block-error.svg",header:n=Object(a.__)("Oops!","woo-gutenberg-products-block"),text:r=Object(a.__)("There was an error loading the content.","woo-gutenberg-products-block"),errorMessage:o,errorMessagePrefix:c=Object(a.__)("Error:","woo-gutenberg-products-block"),button:u,showErrorBlock:l=!0}=e;return l?Object(i.createElement)("div",{className:"wc-block-error wc-block-components-error"},t&&Object(i.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:t,alt:""}),Object(i.createElement)("div",{className:"wc-block-error__content wc-block-components-error__content"},n&&Object(i.createElement)("p",{className:"wc-block-error__header wc-block-components-error__header"},n),r&&Object(i.createElement)("p",{className:"wc-block-error__text wc-block-components-error__text"},r),o&&Object(i.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},c?c+" ":"",o),u&&Object(i.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},u))):null};n(37);class l extends c.Component{constructor(){super(...arguments),o()(this,"state",{errorMessage:"",hasError:!1})}static getDerivedStateFromError(e){return void 0!==e.statusText&&void 0!==e.status?{errorMessage:Object(i.createElement)(i.Fragment,null,Object(i.createElement)("strong",null,e.status),": ",e.statusText),hasError:!0}:{errorMessage:e.message,hasError:!0}}render(){const{header:e,imageUrl:t,showErrorMessage:n=!0,showErrorBlock:r=!0,text:o,errorMessagePrefix:c,renderError:a,button:s}=this.props,{errorMessage:l,hasError:d}=this.state;return d?"function"==typeof a?a({errorMessage:l}):Object(i.createElement)(u,{showErrorBlock:r,errorMessage:n?l:null,header:e,imageUrl:t,text:o,errorMessagePrefix:c,button:s}):this.props.children}}t.a=l},,,function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"e",(function(){return o})),n.d(t,"d",(function(){return i})),n.d(t,"f",(function(){return c})),n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s}));const r=e=>"number"==typeof e,o=e=>"string"==typeof e,i=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function c(e,t){return i(e)&&t in e}const a=e=>"boolean"==typeof e,s=e=>e instanceof Error},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(0),o=n(10),i=n.n(o);function c(e){const t=Object(r.useRef)(e);return i()(e,t.current)||(t.current=e),t.current}},,function(e,t){e.exports=window.wp.htmlEntities},,function(e,t,n){"use strict";var r=n(0),o=n(4),i=n.n(o);t.a=e=>{let t,{label:n,screenReaderLabel:o,wrapperElement:c,wrapperProps:a={}}=e;const s=null!=n,u=null!=o;return!s&&u?(t=c||"span",a={...a,className:i()(a.className,"screen-reader-text")},Object(r.createElement)(t,a,o)):(t=c||r.Fragment,s&&u&&n!==o?Object(r.createElement)(t,a,Object(r.createElement)("span",{"aria-hidden":"true"},n),Object(r.createElement)("span",{className:"screen-reader-text"},o)):Object(r.createElement)(t,a,n))}},,function(e,t){e.exports=window.wp.a11y},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0);const o=Object(r.createContext)("page"),i=()=>Object(r.useContext)(o);o.Provider},,,,,,,,,,,function(e,t){},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return f}));var r=n(6),o=n(9),i=n(0),c=n(10),a=n.n(c),s=n(19),u=n(63),l=n(26);const d=e=>{const t=Object(l.a)();e=e||t;const n=Object(o.useSelect)(t=>t(r.QUERY_STATE_STORE_KEY).getValueForQueryContext(e,void 0),[e]),{setValueForQueryContext:c}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[n,Object(i.useCallback)(t=>{c(e,t)},[e,c])]},p=(e,t,n)=>{const c=Object(l.a)();n=n||c;const a=Object(o.useSelect)(o=>o(r.QUERY_STATE_STORE_KEY).getValueForQueryKey(n,e,t),[n,e]),{setQueryValue:s}=Object(o.useDispatch)(r.QUERY_STATE_STORE_KEY);return[a,Object(i.useCallback)(t=>{s(n,e,t)},[n,e,s])]},f=(e,t)=>{const n=Object(l.a)();t=t||n;const[r,o]=d(t),c=Object(s.a)(r),p=Object(s.a)(e),f=Object(u.a)(p),b=Object(i.useRef)(!1);return Object(i.useEffect)(()=>{a()(f,p)||(o(Object.assign({},c,p)),b.current=!0)},[c,p,f,o]),b.current?[r,o]:[e,o]}},,,,,function(e,t,n){"use strict";var r=n(44);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,c){if(c!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},,,,,,function(e,t,n){"use strict";n.d(t,"n",(function(){return i})),n.d(t,"l",(function(){return c})),n.d(t,"k",(function(){return a})),n.d(t,"m",(function(){return s})),n.d(t,"i",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"f",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return b})),n.d(t,"g",(function(){return m})),n.d(t,"a",(function(){return g})),n.d(t,"h",(function(){return h})),n.d(t,"b",(function(){return v}));var r,o=n(2);const i=Object(o.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),c=i.pluginUrl+"images/",a=i.pluginUrl+"build/",s=i.buildPhase,u=null===(r=o.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,l=(o.STORE_PAGES.checkout.id,o.STORE_PAGES.checkout.permalink),d=o.STORE_PAGES.privacy.permalink,p=(o.STORE_PAGES.privacy.title,o.STORE_PAGES.terms.permalink),f=(o.STORE_PAGES.terms.title,o.STORE_PAGES.cart.id,o.STORE_PAGES.cart.permalink),b=o.STORE_PAGES.myaccount.permalink?o.STORE_PAGES.myaccount.permalink:Object(o.getSetting)("wpLoginUrl","/wp-login.php"),m=Object(o.getSetting)("shippingCountries",{}),g=Object(o.getSetting)("allowedCountries",{}),h=Object(o.getSetting)("shippingStates",{}),v=Object(o.getSetting)("allowedStates",{})},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t,n){var o=this,i=Object(r.useRef)(null),c=Object(r.useRef)(0),a=Object(r.useRef)(null),s=Object(r.useRef)([]),u=Object(r.useRef)(),l=Object(r.useRef)(),d=Object(r.useRef)(e),p=Object(r.useRef)(!0);d.current=e;var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var b=!!(n=n||{}).leading,m=!("trailing"in n)||!!n.trailing,g="maxWait"in n,h=g?Math.max(+n.maxWait||0,t):null;return Object(r.useEffect)((function(){return p.current=!0,function(){p.current=!1}}),[]),Object(r.useMemo)((function(){var e=function(e){var t=s.current,n=u.current;return s.current=u.current=null,c.current=e,l.current=d.current.apply(n,t)},n=function(e,t){f&&cancelAnimationFrame(a.current),a.current=f?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!p.current)return!1;var n=e-i.current,r=e-c.current;return!i.current||n>=t||n<0||g&&r>=h},v=function(t){return a.current=null,m&&s.current?e(t):(s.current=u.current=null,l.current)},y=function(){var e=Date.now();if(r(e))return v(e);if(p.current){var o=e-i.current,a=e-c.current,s=t-o,u=g?Math.min(s,h-a):s;n(y,u)}},O=function(){for(var d=[],f=0;f<arguments.length;f++)d[f]=arguments[f];var m=Date.now(),h=r(m);if(s.current=d,u.current=o,i.current=m,h){if(!a.current&&p.current)return c.current=i.current,n(y,t),b?e(i.current):l.current;if(g)return n(y,t),e(i.current)}return a.current||n(y,t),l.current};return O.cancel=function(){a.current&&(f?cancelAnimationFrame(a.current):clearTimeout(a.current)),c.current=0,s.current=i.current=u.current=a.current=null},O.isPending=function(){return!!a.current},O.flush=function(){return a.current?v(Date.now()):l.current},O}),[b,g,t,h,m,f])}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(11),o=n.n(r),i=n(0),c=n(14);const a=[".wp-block-woocommerce-cart"],s=e=>{let{Block:t,containers:n,getProps:r=(()=>({})),getErrorBoundaryProps:a=(()=>({}))}=e;0!==n.length&&Array.prototype.forEach.call(n,(e,n)=>{const s=r(e,n),u=a(e,n),l={...e.dataset,...s.attributes||{}};(e=>{let{Block:t,container:n,attributes:r={},props:a={},errorBoundaryProps:s={}}=e;Object(i.render)(Object(i.createElement)(c.a,s,Object(i.createElement)(i.Suspense,{fallback:Object(i.createElement)("div",{className:"wc-block-placeholder"})},t&&Object(i.createElement)(t,o()({},a,{attributes:r})))),n,()=>{n.classList&&n.classList.remove("is-loading")})})({Block:t,container:e,props:s,attributes:l,errorBoundaryProps:u})})},u=e=>{const t=document.body.querySelectorAll(a.join(",")),{Block:n,getProps:r,getErrorBoundaryProps:o,selector:i}=e;(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrappers:i}=e;const c=document.body.querySelectorAll(o);i&&i.length>0&&Array.prototype.filter.call(c,e=>!((e,t)=>Array.prototype.some.call(t,t=>t.contains(e)&&!t.isSameNode(e)))(e,i)),s({Block:t,containers:c,getProps:n,getErrorBoundaryProps:r})})({Block:n,getProps:r,getErrorBoundaryProps:o,selector:i,wrappers:t}),Array.prototype.forEach.call(t,t=>{t.addEventListener("wc-blocks_render_blocks_frontend",()=>{(e=>{let{Block:t,getProps:n,getErrorBoundaryProps:r,selector:o,wrapper:i}=e;const c=i.querySelectorAll(o);s({Block:t,containers:c,getProps:n,getErrorBoundaryProps:r})})({...e,wrapper:t})})})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0);const o=()=>{const[,e]=Object(r.useState)();return Object(r.useCallback)(t=>{e(()=>{throw t})},[])}},function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(23);n(120),t.a=e=>{let{name:t,count:n}=e;return Object(r.createElement)(r.Fragment,null,t,Number.isFinite(n)&&Object(r.createElement)(i.a,{label:n.toString(),screenReaderLabel:Object(o.sprintf)(
2
  /* translators: %s number of products. */
3
+ Object(o._n)("%s product","%s products",n,"woo-gutenberg-products-block"),n),wrapperElement:"span",wrapperProps:{className:"wc-filter-element-label-list-count"}}))}},,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(3);function o(e,t){const n=Object(r.useRef)();return Object(r.useEffect)(()=>{n.current===e||t&&!t(e,n.current)||(n.current=e)},[e,t]),n.current}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(6),o=n(9),i=n(0),c=n(19),a=n(54),s=n(18);const u=e=>{const{namespace:t,resourceName:n,resourceValues:u=[],query:l={},shouldSelect:d=!0}=e;if(!t||!n)throw new Error("The options object must have valid values for the namespace and the resource properties.");const p=Object(i.useRef)({results:[],isLoading:!0}),f=Object(c.a)(l),b=Object(c.a)(u),m=Object(a.a)(),g=Object(o.useSelect)(e=>{if(!d)return null;const o=e(r.COLLECTIONS_STORE_KEY),i=[t,n,f,b],c=o.getCollectionError(...i);if(c){if(!Object(s.b)(c))throw new Error("TypeError: `error` object is not an instance of Error constructor");m(c)}return{results:o.getCollection(...i),isLoading:!o.hasFinishedResolution("getCollection",i)}},[t,n,b,f,d]);return null!==g&&(p.current=g),p.current}},,,function(e,t){e.exports=window.wp.blockEditor},,,,,function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(4),c=n.n(i),a=n(23);n(103),t.a=e=>{let{className:t,disabled:n,label:
4
  /* translators: Submit button text for filters. */
5
+ i=Object(o.__)("Go","woo-gutenberg-products-block"),onClick:s,screenReaderLabel:u=Object(o.__)("Apply filter","woo-gutenberg-products-block")}=e;return Object(r.createElement)("button",{type:"submit",className:c()("wc-block-filter-submit-button","wc-block-components-filter-submit-button",t),disabled:n,onClick:s},Object(r.createElement)(a.a,{label:i,screenReaderLabel:u}))}},,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(3),o=n(52);function i(e,t){return e===t}function c(e){return"function"==typeof e?function(){return e}:e}function a(e,t,n){var a=n&&n.equalityFn||i,s=function(e){var t=Object(r.useState)(c(e)),n=t[0],o=t[1];return[n,Object(r.useCallback)((function(e){return o(c(e))}),[])]}(e),u=s[0],l=s[1],d=Object(o.a)(Object(r.useCallback)((function(e){return l(e)}),[l]),t,n),p=Object(r.useRef)(e);return a(p.current,e)||(d(e),p.current=e),[u,d]}},function(e,t){e.exports=window.wp.components},,,function(e,t){e.exports=window.wp.blocks},function(e,t,n){"use strict";var r=n(0);t.a=function(e){let{icon:t,size:n=24,...o}=e;return Object(r.cloneElement)(t,{width:n,height:n,...o})}},,,function(e,t){},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return c}));var r=n(2);const o=Object(r.getSetting)("attributes",[]).reduce((e,t)=>{const n=(r=t)&&r.attribute_name?{id:parseInt(r.attribute_id,10),name:r.attribute_name,taxonomy:"pa_"+r.attribute_name,label:r.attribute_label}:null;var r;return n.id&&e.push(n),e},[]),i=e=>{if(e)return o.find(t=>t.id===e)},c=e=>{if(e)return o.find(t=>t.taxonomy===e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return i}));var r=n(5);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";const i=e.filter(e=>e.attribute===n.taxonomy),c=i.length?i[0]:null;if(!(c&&c.slug&&Array.isArray(c.slug)&&c.slug.includes(o)))return;const a=c.slug.filter(e=>e!==o),s=e.filter(e=>e.attribute!==n.taxonomy);a.length>0&&(c.slug=a.sort(),s.push(c)),t(Object(r.sortBy)(s,"attribute"))},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"in";const c=e.filter(e=>e.attribute!==n.taxonomy);0===o.length?t(c):(c.push({attribute:n.taxonomy,operator:i,slug:o.map(e=>{let{slug:t}=e;return t}).sort()}),t(Object(r.sortBy)(c,"attribute")))}},function(e,t,n){"use strict";var r=n(0),o=n(1),i=n(4),c=n.n(i);n(121),t.a=e=>{let{className:t,onChange:n=(()=>{}),options:i=[],checked:a=[],isLoading:s=!1,isDisabled:u=!1,limit:l=10}=e;const[d,p]=Object(r.useState)(!1),f=Object(r.useMemo)(()=>[...Array(5)].map((e,t)=>Object(r.createElement)("li",{key:t,style:{width:Math.floor(75*Math.random())+25+"%"}})),[]),b=Object(r.useMemo)(()=>{const e=i.length-l;return!d&&Object(r.createElement)("li",{key:"show-more",className:"show-more"},Object(r.createElement)("button",{onClick:()=>{p(!0)},"aria-expanded":!1,"aria-label":Object(o.sprintf)(
6
  /* translators: %s is referring the remaining